aclocal.m4 revision 3e72ca8c
1# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
2
3# Copyright (C) 1996-2012 Free Software Foundation, Inc.
4
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_AUTOCONF_VERSION],
15  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
17[m4_warning([this file was generated for autoconf 2.69.
18You have another version of autoconf.  It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically 'autoreconf'.])])
21
22# Copyright (C) 2002-2012 Free Software Foundation, Inc.
23#
24# This file is free software; the Free Software Foundation
25# gives unlimited permission to copy and/or distribute it,
26# with or without modifications, as long as this notice is preserved.
27
28# serial 8
29
30# AM_AUTOMAKE_VERSION(VERSION)
31# ----------------------------
32# Automake X.Y traces this macro to ensure aclocal.m4 has been
33# generated from the m4 files accompanying Automake X.Y.
34# (This private macro should not be called outside this file.)
35AC_DEFUN([AM_AUTOMAKE_VERSION],
36[am__api_version='1.12'
37dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
38dnl require some minimum version.  Point them to the right macro.
39m4_if([$1], [1.12.2], [],
40      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
41])
42
43# _AM_AUTOCONF_VERSION(VERSION)
44# -----------------------------
45# aclocal traces this macro to find the Autoconf version.
46# This is a private macro too.  Using m4_define simplifies
47# the logic in aclocal, which can simply ignore this definition.
48m4_define([_AM_AUTOCONF_VERSION], [])
49
50# AM_SET_CURRENT_AUTOMAKE_VERSION
51# -------------------------------
52# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
53# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
54AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
55[AM_AUTOMAKE_VERSION([1.12.2])dnl
56m4_ifndef([AC_AUTOCONF_VERSION],
57  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
58_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
59
60# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
61
62# Copyright (C) 2001-2012 Free Software Foundation, Inc.
63#
64# This file is free software; the Free Software Foundation
65# gives unlimited permission to copy and/or distribute it,
66# with or without modifications, as long as this notice is preserved.
67
68# serial 2
69
70# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
71# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
72# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
73#
74# Of course, Automake must honor this variable whenever it calls a
75# tool from the auxiliary directory.  The problem is that $srcdir (and
76# therefore $ac_aux_dir as well) can be either absolute or relative,
77# depending on how configure is run.  This is pretty annoying, since
78# it makes $ac_aux_dir quite unusable in subdirectories: in the top
79# source directory, any form will work fine, but in subdirectories a
80# relative path needs to be adjusted first.
81#
82# $ac_aux_dir/missing
83#    fails when called from a subdirectory if $ac_aux_dir is relative
84# $top_srcdir/$ac_aux_dir/missing
85#    fails if $ac_aux_dir is absolute,
86#    fails when called from a subdirectory in a VPATH build with
87#          a relative $ac_aux_dir
88#
89# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
90# are both prefixed by $srcdir.  In an in-source build this is usually
91# harmless because $srcdir is '.', but things will broke when you
92# start a VPATH build or use an absolute $srcdir.
93#
94# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
95# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
96#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
97# and then we would define $MISSING as
98#   MISSING="\${SHELL} $am_aux_dir/missing"
99# This will work as long as MISSING is not called from configure, because
100# unfortunately $(top_srcdir) has no meaning in configure.
101# However there are other variables, like CC, which are often used in
102# configure, and could therefore not use this "fixed" $ac_aux_dir.
103#
104# Another solution, used here, is to always expand $ac_aux_dir to an
105# absolute PATH.  The drawback is that using absolute paths prevent a
106# configured tree to be moved without reconfiguration.
107
108AC_DEFUN([AM_AUX_DIR_EXPAND],
109[dnl Rely on autoconf to set up CDPATH properly.
110AC_PREREQ([2.50])dnl
111# expand $ac_aux_dir to an absolute path
112am_aux_dir=`cd $ac_aux_dir && pwd`
113])
114
115# AM_CONDITIONAL                                            -*- Autoconf -*-
116
117# Copyright (C) 1997-2012 Free Software Foundation, Inc.
118#
119# This file is free software; the Free Software Foundation
120# gives unlimited permission to copy and/or distribute it,
121# with or without modifications, as long as this notice is preserved.
122
123# serial 10
124
125# AM_CONDITIONAL(NAME, SHELL-CONDITION)
126# -------------------------------------
127# Define a conditional.
128AC_DEFUN([AM_CONDITIONAL],
129[AC_PREREQ([2.52])dnl
130 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
131       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
132AC_SUBST([$1_TRUE])dnl
133AC_SUBST([$1_FALSE])dnl
134_AM_SUBST_NOTMAKE([$1_TRUE])dnl
135_AM_SUBST_NOTMAKE([$1_FALSE])dnl
136m4_define([_AM_COND_VALUE_$1], [$2])dnl
137if $2; then
138  $1_TRUE=
139  $1_FALSE='#'
140else
141  $1_TRUE='#'
142  $1_FALSE=
143fi
144AC_CONFIG_COMMANDS_PRE(
145[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
146  AC_MSG_ERROR([[conditional "$1" was never defined.
147Usually this means the macro was only invoked conditionally.]])
148fi])])
149
150# Copyright (C) 1999-2012 Free Software Foundation, Inc.
151#
152# This file is free software; the Free Software Foundation
153# gives unlimited permission to copy and/or distribute it,
154# with or without modifications, as long as this notice is preserved.
155
156# serial 17
157
158# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
159# written in clear, in which case automake, when reading aclocal.m4,
160# will think it sees a *use*, and therefore will trigger all it's
161# C support machinery.  Also note that it means that autoscan, seeing
162# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
163
164
165# _AM_DEPENDENCIES(NAME)
166# ----------------------
167# See how the compiler implements dependency checking.
168# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
169# We try a few techniques and use that to set a single cache variable.
170#
171# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
172# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
173# dependency, and given that the user is not expected to run this macro,
174# just rely on AC_PROG_CC.
175AC_DEFUN([_AM_DEPENDENCIES],
176[AC_REQUIRE([AM_SET_DEPDIR])dnl
177AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
178AC_REQUIRE([AM_MAKE_INCLUDE])dnl
179AC_REQUIRE([AM_DEP_TRACK])dnl
180
181m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
182      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
183      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
184      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
185      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
186      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
187                    [depcc="$$1"   am_compiler_list=])
188
189AC_CACHE_CHECK([dependency style of $depcc],
190               [am_cv_$1_dependencies_compiler_type],
191[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
192  # We make a subdir and do the tests there.  Otherwise we can end up
193  # making bogus files that we don't know about and never remove.  For
194  # instance it was reported that on HP-UX the gcc test will end up
195  # making a dummy file named 'D' -- because '-MD' means "put the output
196  # in D".
197  rm -rf conftest.dir
198  mkdir conftest.dir
199  # Copy depcomp to subdir because otherwise we won't find it if we're
200  # using a relative directory.
201  cp "$am_depcomp" conftest.dir
202  cd conftest.dir
203  # We will build objects and dependencies in a subdirectory because
204  # it helps to detect inapplicable dependency modes.  For instance
205  # both Tru64's cc and ICC support -MD to output dependencies as a
206  # side effect of compilation, but ICC will put the dependencies in
207  # the current directory while Tru64 will put them in the object
208  # directory.
209  mkdir sub
210
211  am_cv_$1_dependencies_compiler_type=none
212  if test "$am_compiler_list" = ""; then
213     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
214  fi
215  am__universal=false
216  m4_case([$1], [CC],
217    [case " $depcc " in #(
218     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219     esac],
220    [CXX],
221    [case " $depcc " in #(
222     *\ -arch\ *\ -arch\ *) am__universal=true ;;
223     esac])
224
225  for depmode in $am_compiler_list; do
226    # Setup a source with many dependencies, because some compilers
227    # like to wrap large dependency lists on column 80 (with \), and
228    # we should not choose a depcomp mode which is confused by this.
229    #
230    # We need to recreate these files for each test, as the compiler may
231    # overwrite some of them when testing with obscure command lines.
232    # This happens at least with the AIX C compiler.
233    : > sub/conftest.c
234    for i in 1 2 3 4 5 6; do
235      echo '#include "conftst'$i'.h"' >> sub/conftest.c
236      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
237      # Solaris 10 /bin/sh.
238      echo '/* dummy */' > sub/conftst$i.h
239    done
240    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
241
242    # We check with '-c' and '-o' for the sake of the "dashmstdout"
243    # mode.  It turns out that the SunPro C++ compiler does not properly
244    # handle '-M -o', and we need to detect this.  Also, some Intel
245    # versions had trouble with output in subdirs.
246    am__obj=sub/conftest.${OBJEXT-o}
247    am__minus_obj="-o $am__obj"
248    case $depmode in
249    gcc)
250      # This depmode causes a compiler race in universal mode.
251      test "$am__universal" = false || continue
252      ;;
253    nosideeffect)
254      # After this tag, mechanisms are not by side-effect, so they'll
255      # only be used when explicitly requested.
256      if test "x$enable_dependency_tracking" = xyes; then
257	continue
258      else
259	break
260      fi
261      ;;
262    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
263      # This compiler won't grok '-c -o', but also, the minuso test has
264      # not run yet.  These depmodes are late enough in the game, and
265      # so weak that their functioning should not be impacted.
266      am__obj=conftest.${OBJEXT-o}
267      am__minus_obj=
268      ;;
269    none) break ;;
270    esac
271    if depmode=$depmode \
272       source=sub/conftest.c object=$am__obj \
273       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
274       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
275         >/dev/null 2>conftest.err &&
276       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
277       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
278       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
279       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
280      # icc doesn't choke on unknown options, it will just issue warnings
281      # or remarks (even with -Werror).  So we grep stderr for any message
282      # that says an option was ignored or not supported.
283      # When given -MP, icc 7.0 and 7.1 complain thusly:
284      #   icc: Command line warning: ignoring option '-M'; no argument required
285      # The diagnosis changed in icc 8.0:
286      #   icc: Command line remark: option '-MP' not supported
287      if (grep 'ignoring option' conftest.err ||
288          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
289        am_cv_$1_dependencies_compiler_type=$depmode
290        break
291      fi
292    fi
293  done
294
295  cd ..
296  rm -rf conftest.dir
297else
298  am_cv_$1_dependencies_compiler_type=none
299fi
300])
301AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
302AM_CONDITIONAL([am__fastdep$1], [
303  test "x$enable_dependency_tracking" != xno \
304  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
305])
306
307
308# AM_SET_DEPDIR
309# -------------
310# Choose a directory name for dependency files.
311# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
312AC_DEFUN([AM_SET_DEPDIR],
313[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
314AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
315])
316
317
318# AM_DEP_TRACK
319# ------------
320AC_DEFUN([AM_DEP_TRACK],
321[AC_ARG_ENABLE([dependency-tracking], [dnl
322AS_HELP_STRING(
323  [--enable-dependency-tracking],
324  [do not reject slow dependency extractors])
325AS_HELP_STRING(
326  [--disable-dependency-tracking],
327  [speeds up one-time build])])
328if test "x$enable_dependency_tracking" != xno; then
329  am_depcomp="$ac_aux_dir/depcomp"
330  AMDEPBACKSLASH='\'
331  am__nodep='_no'
332fi
333AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
334AC_SUBST([AMDEPBACKSLASH])dnl
335_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
336AC_SUBST([am__nodep])dnl
337_AM_SUBST_NOTMAKE([am__nodep])dnl
338])
339
340# Generate code to set up dependency tracking.              -*- Autoconf -*-
341
342# Copyright (C) 1999-2012 Free Software Foundation, Inc.
343#
344# This file is free software; the Free Software Foundation
345# gives unlimited permission to copy and/or distribute it,
346# with or without modifications, as long as this notice is preserved.
347
348# serial 6
349
350# _AM_OUTPUT_DEPENDENCY_COMMANDS
351# ------------------------------
352AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
353[{
354  # Autoconf 2.62 quotes --file arguments for eval, but not when files
355  # are listed without --file.  Let's play safe and only enable the eval
356  # if we detect the quoting.
357  case $CONFIG_FILES in
358  *\'*) eval set x "$CONFIG_FILES" ;;
359  *)   set x $CONFIG_FILES ;;
360  esac
361  shift
362  for mf
363  do
364    # Strip MF so we end up with the name of the file.
365    mf=`echo "$mf" | sed -e 's/:.*$//'`
366    # Check whether this is an Automake generated Makefile or not.
367    # We used to match only the files named 'Makefile.in', but
368    # some people rename them; so instead we look at the file content.
369    # Grep'ing the first line is not enough: some people post-process
370    # each Makefile.in and add a new line on top of each file to say so.
371    # Grep'ing the whole file is not good either: AIX grep has a line
372    # limit of 2048, but all sed's we know have understand at least 4000.
373    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
374      dirpart=`AS_DIRNAME("$mf")`
375    else
376      continue
377    fi
378    # Extract the definition of DEPDIR, am__include, and am__quote
379    # from the Makefile without running 'make'.
380    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
381    test -z "$DEPDIR" && continue
382    am__include=`sed -n 's/^am__include = //p' < "$mf"`
383    test -z "am__include" && continue
384    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
385    # Find all dependency output files, they are included files with
386    # $(DEPDIR) in their names.  We invoke sed twice because it is the
387    # simplest approach to changing $(DEPDIR) to its actual value in the
388    # expansion.
389    for file in `sed -n "
390      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
391	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
392      # Make sure the directory exists.
393      test -f "$dirpart/$file" && continue
394      fdir=`AS_DIRNAME(["$file"])`
395      AS_MKDIR_P([$dirpart/$fdir])
396      # echo "creating $dirpart/$file"
397      echo '# dummy' > "$dirpart/$file"
398    done
399  done
400}
401])# _AM_OUTPUT_DEPENDENCY_COMMANDS
402
403
404# AM_OUTPUT_DEPENDENCY_COMMANDS
405# -----------------------------
406# This macro should only be invoked once -- use via AC_REQUIRE.
407#
408# This code is only required when automatic dependency tracking
409# is enabled.  FIXME.  This creates each '.P' file that we will
410# need in order to bootstrap the dependency handling code.
411AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
412[AC_CONFIG_COMMANDS([depfiles],
413     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
414     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
415])
416
417# Do all the work for Automake.                             -*- Autoconf -*-
418
419# Copyright (C) 1996-2012 Free Software Foundation, Inc.
420#
421# This file is free software; the Free Software Foundation
422# gives unlimited permission to copy and/or distribute it,
423# with or without modifications, as long as this notice is preserved.
424
425# serial 19
426
427# This macro actually does too much.  Some checks are only needed if
428# your package does certain things.  But this isn't really a big deal.
429
430# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
431# AM_INIT_AUTOMAKE([OPTIONS])
432# -----------------------------------------------
433# The call with PACKAGE and VERSION arguments is the old style
434# call (pre autoconf-2.50), which is being phased out.  PACKAGE
435# and VERSION should now be passed to AC_INIT and removed from
436# the call to AM_INIT_AUTOMAKE.
437# We support both call styles for the transition.  After
438# the next Automake release, Autoconf can make the AC_INIT
439# arguments mandatory, and then we can depend on a new Autoconf
440# release and drop the old call support.
441AC_DEFUN([AM_INIT_AUTOMAKE],
442[AC_PREREQ([2.62])dnl
443dnl Autoconf wants to disallow AM_ names.  We explicitly allow
444dnl the ones we care about.
445m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
446AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
447AC_REQUIRE([AC_PROG_INSTALL])dnl
448if test "`cd $srcdir && pwd`" != "`pwd`"; then
449  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
450  # is not polluted with repeated "-I."
451  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
452  # test to see if srcdir already configured
453  if test -f $srcdir/config.status; then
454    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
455  fi
456fi
457
458# test whether we have cygpath
459if test -z "$CYGPATH_W"; then
460  if (cygpath --version) >/dev/null 2>/dev/null; then
461    CYGPATH_W='cygpath -w'
462  else
463    CYGPATH_W=echo
464  fi
465fi
466AC_SUBST([CYGPATH_W])
467
468# Define the identity of the package.
469dnl Distinguish between old-style and new-style calls.
470m4_ifval([$2],
471[AC_DIAGNOSE([obsolete],
472[$0: two- and three-arguments forms are deprecated.  For more info, see:
473http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
474m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
475 AC_SUBST([PACKAGE], [$1])dnl
476 AC_SUBST([VERSION], [$2])],
477[_AM_SET_OPTIONS([$1])dnl
478dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
479m4_if(
480  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
481  [ok:ok],,
482  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485
486_AM_IF_OPTION([no-define],,
487[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
488 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
489
490# Some tools Automake needs.
491AC_REQUIRE([AM_SANITY_CHECK])dnl
492AC_REQUIRE([AC_ARG_PROGRAM])dnl
493AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
494AM_MISSING_PROG([AUTOCONF], [autoconf])
495AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
496AM_MISSING_PROG([AUTOHEADER], [autoheader])
497AM_MISSING_PROG([MAKEINFO], [makeinfo])
498AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500AC_REQUIRE([AC_PROG_MKDIR_P])dnl
501# For better backward compatibility.  To be removed once Automake 1.9.x
502# dies out for good.  For more background, see:
503# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
504# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
505AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
506# We need awk for the "check" target.  The system "awk" is bad on
507# some platforms.
508AC_REQUIRE([AC_PROG_AWK])dnl
509AC_REQUIRE([AC_PROG_MAKE_SET])dnl
510AC_REQUIRE([AM_SET_LEADING_DOT])dnl
511_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
512	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
513			     [_AM_PROG_TAR([v7])])])
514_AM_IF_OPTION([no-dependencies],,
515[AC_PROVIDE_IFELSE([AC_PROG_CC],
516		  [_AM_DEPENDENCIES([CC])],
517		  [m4_define([AC_PROG_CC],
518			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
519AC_PROVIDE_IFELSE([AC_PROG_CXX],
520		  [_AM_DEPENDENCIES([CXX])],
521		  [m4_define([AC_PROG_CXX],
522			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
523AC_PROVIDE_IFELSE([AC_PROG_OBJC],
524		  [_AM_DEPENDENCIES([OBJC])],
525		  [m4_define([AC_PROG_OBJC],
526			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
527dnl Support for Objective C++ was only introduced in Autoconf 2.65,
528dnl but we still cater to Autoconf 2.62.
529m4_ifdef([AC_PROG_OBJCXX],
530[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
531		  [_AM_DEPENDENCIES([OBJCXX])],
532		  [m4_define([AC_PROG_OBJCXX],
533			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
534])
535_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
536dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
537dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
538dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
539AC_CONFIG_COMMANDS_PRE(dnl
540[m4_provide_if([_AM_COMPILER_EXEEXT],
541  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
542])
543
544dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
545dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
546dnl mangled by Autoconf and run in a shell conditional statement.
547m4_define([_AC_COMPILER_EXEEXT],
548m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
549
550
551# When config.status generates a header, we must update the stamp-h file.
552# This file resides in the same directory as the config header
553# that is generated.  The stamp files are numbered to have different names.
554
555# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
556# loop where config.status creates the headers, so we can generate
557# our stamp files there.
558AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
559[# Compute $1's index in $config_headers.
560_am_arg=$1
561_am_stamp_count=1
562for _am_header in $config_headers :; do
563  case $_am_header in
564    $_am_arg | $_am_arg:* )
565      break ;;
566    * )
567      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
568  esac
569done
570echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
571
572# Copyright (C) 2001-2012 Free Software Foundation, Inc.
573#
574# This file is free software; the Free Software Foundation
575# gives unlimited permission to copy and/or distribute it,
576# with or without modifications, as long as this notice is preserved.
577
578# serial 8
579
580# AM_PROG_INSTALL_SH
581# ------------------
582# Define $install_sh.
583AC_DEFUN([AM_PROG_INSTALL_SH],
584[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
585if test x"${install_sh}" != xset; then
586  case $am_aux_dir in
587  *\ * | *\	*)
588    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
589  *)
590    install_sh="\${SHELL} $am_aux_dir/install-sh"
591  esac
592fi
593AC_SUBST([install_sh])])
594
595# Copyright (C) 2003-2012 Free Software Foundation, Inc.
596#
597# This file is free software; the Free Software Foundation
598# gives unlimited permission to copy and/or distribute it,
599# with or without modifications, as long as this notice is preserved.
600
601# serial 2
602
603# Check whether the underlying file-system supports filenames
604# with a leading dot.  For instance MS-DOS doesn't.
605AC_DEFUN([AM_SET_LEADING_DOT],
606[rm -rf .tst 2>/dev/null
607mkdir .tst 2>/dev/null
608if test -d .tst; then
609  am__leading_dot=.
610else
611  am__leading_dot=_
612fi
613rmdir .tst 2>/dev/null
614AC_SUBST([am__leading_dot])])
615
616# Check to see how 'make' treats includes.	            -*- Autoconf -*-
617
618# Copyright (C) 2001-2012 Free Software Foundation, Inc.
619#
620# This file is free software; the Free Software Foundation
621# gives unlimited permission to copy and/or distribute it,
622# with or without modifications, as long as this notice is preserved.
623
624# serial 5
625
626# AM_MAKE_INCLUDE()
627# -----------------
628# Check to see how make treats includes.
629AC_DEFUN([AM_MAKE_INCLUDE],
630[am_make=${MAKE-make}
631cat > confinc << 'END'
632am__doit:
633	@echo this is the am__doit target
634.PHONY: am__doit
635END
636# If we don't find an include directive, just comment out the code.
637AC_MSG_CHECKING([for style of include used by $am_make])
638am__include="#"
639am__quote=
640_am_result=none
641# First try GNU make style include.
642echo "include confinc" > confmf
643# Ignore all kinds of additional output from 'make'.
644case `$am_make -s -f confmf 2> /dev/null` in #(
645*the\ am__doit\ target*)
646  am__include=include
647  am__quote=
648  _am_result=GNU
649  ;;
650esac
651# Now try BSD make style include.
652if test "$am__include" = "#"; then
653   echo '.include "confinc"' > confmf
654   case `$am_make -s -f confmf 2> /dev/null` in #(
655   *the\ am__doit\ target*)
656     am__include=.include
657     am__quote="\""
658     _am_result=BSD
659     ;;
660   esac
661fi
662AC_SUBST([am__include])
663AC_SUBST([am__quote])
664AC_MSG_RESULT([$_am_result])
665rm -f confinc confmf
666])
667
668# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
669
670# Copyright (C) 1997-2012 Free Software Foundation, Inc.
671#
672# This file is free software; the Free Software Foundation
673# gives unlimited permission to copy and/or distribute it,
674# with or without modifications, as long as this notice is preserved.
675
676# serial 7
677
678# AM_MISSING_PROG(NAME, PROGRAM)
679# ------------------------------
680AC_DEFUN([AM_MISSING_PROG],
681[AC_REQUIRE([AM_MISSING_HAS_RUN])
682$1=${$1-"${am_missing_run}$2"}
683AC_SUBST($1)])
684
685
686# AM_MISSING_HAS_RUN
687# ------------------
688# Define MISSING if not defined so far and test if it supports --run.
689# If it does, set am_missing_run to use it, otherwise, to nothing.
690AC_DEFUN([AM_MISSING_HAS_RUN],
691[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
692AC_REQUIRE_AUX_FILE([missing])dnl
693if test x"${MISSING+set}" != xset; then
694  case $am_aux_dir in
695  *\ * | *\	*)
696    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
697  *)
698    MISSING="\${SHELL} $am_aux_dir/missing" ;;
699  esac
700fi
701# Use eval to expand $SHELL
702if eval "$MISSING --run true"; then
703  am_missing_run="$MISSING --run "
704else
705  am_missing_run=
706  AC_MSG_WARN(['missing' script is too old or missing])
707fi
708])
709
710# Helper functions for option handling.                     -*- Autoconf -*-
711
712# Copyright (C) 2001-2012 Free Software Foundation, Inc.
713#
714# This file is free software; the Free Software Foundation
715# gives unlimited permission to copy and/or distribute it,
716# with or without modifications, as long as this notice is preserved.
717
718# serial 6
719
720# _AM_MANGLE_OPTION(NAME)
721# -----------------------
722AC_DEFUN([_AM_MANGLE_OPTION],
723[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
724
725# _AM_SET_OPTION(NAME)
726# --------------------
727# Set option NAME.  Presently that only means defining a flag for this option.
728AC_DEFUN([_AM_SET_OPTION],
729[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
730
731# _AM_SET_OPTIONS(OPTIONS)
732# ------------------------
733# OPTIONS is a space-separated list of Automake options.
734AC_DEFUN([_AM_SET_OPTIONS],
735[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
736
737# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
738# -------------------------------------------
739# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
740AC_DEFUN([_AM_IF_OPTION],
741[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
742
743# Check to make sure that the build environment is sane.    -*- Autoconf -*-
744
745# Copyright (C) 1996-2012 Free Software Foundation, Inc.
746#
747# This file is free software; the Free Software Foundation
748# gives unlimited permission to copy and/or distribute it,
749# with or without modifications, as long as this notice is preserved.
750
751# serial 9
752
753# AM_SANITY_CHECK
754# ---------------
755AC_DEFUN([AM_SANITY_CHECK],
756[AC_MSG_CHECKING([whether build environment is sane])
757# Reject unsafe characters in $srcdir or the absolute working directory
758# name.  Accept space and tab only in the latter.
759am_lf='
760'
761case `pwd` in
762  *[[\\\"\#\$\&\'\`$am_lf]]*)
763    AC_MSG_ERROR([unsafe absolute working directory name]);;
764esac
765case $srcdir in
766  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
767    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
768esac
769
770# Do 'set' in a subshell so we don't clobber the current shell's
771# arguments.  Must try -L first in case configure is actually a
772# symlink; some systems play weird games with the mod time of symlinks
773# (eg FreeBSD returns the mod time of the symlink's containing
774# directory).
775if (
776   am_has_slept=no
777   for am_try in 1 2; do
778     echo "timestamp, slept: $am_has_slept" > conftest.file
779     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
780     if test "$[*]" = "X"; then
781	# -L didn't work.
782	set X `ls -t "$srcdir/configure" conftest.file`
783     fi
784     if test "$[*]" != "X $srcdir/configure conftest.file" \
785	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
786
787	# If neither matched, then we have a broken ls.  This can happen
788	# if, for instance, CONFIG_SHELL is bash and it inherits a
789	# broken ls alias from the environment.  This has actually
790	# happened.  Such a system could not be considered "sane".
791	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
792  alias in your environment])
793     fi
794     if test "$[2]" = conftest.file || test $am_try -eq 2; then
795       break
796     fi
797     # Just in case.
798     sleep 1
799     am_has_slept=yes
800   done
801   test "$[2]" = conftest.file
802   )
803then
804   # Ok.
805   :
806else
807   AC_MSG_ERROR([newly created file is older than distributed files!
808Check your system clock])
809fi
810AC_MSG_RESULT([yes])
811# If we didn't sleep, we still need to ensure time stamps of config.status and
812# generated files are strictly newer.
813am_sleep_pid=
814if grep 'slept: no' conftest.file >/dev/null 2>&1; then
815  ( sleep 1 ) &
816  am_sleep_pid=$!
817fi
818AC_CONFIG_COMMANDS_PRE(
819  [AC_MSG_CHECKING([that generated files are newer than configure])
820   if test -n "$am_sleep_pid"; then
821     # Hide warnings about reused PIDs.
822     wait $am_sleep_pid 2>/dev/null
823   fi
824   AC_MSG_RESULT([done])])
825rm -f conftest.file
826])
827
828# Copyright (C) 2009-2012 Free Software Foundation, Inc.
829#
830# This file is free software; the Free Software Foundation
831# gives unlimited permission to copy and/or distribute it,
832# with or without modifications, as long as this notice is preserved.
833
834# serial 3
835
836# AM_SILENT_RULES([DEFAULT])
837# --------------------------
838# Enable less verbose build rules; with the default set to DEFAULT
839# ("yes" being less verbose, "no" or empty being verbose).
840AC_DEFUN([AM_SILENT_RULES],
841[AC_ARG_ENABLE([silent-rules], [dnl
842AS_HELP_STRING(
843  [--enable-silent-rules],
844  [less verbose build output (undo: "make V=1")])
845AS_HELP_STRING(
846  [--disable-silent-rules],
847  [verbose build output (undo: "make V=0")])dnl
848])
849case $enable_silent_rules in @%:@ (((
850  yes) AM_DEFAULT_VERBOSITY=0;;
851   no) AM_DEFAULT_VERBOSITY=1;;
852    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
853esac
854dnl
855dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
856dnl do not support nested variable expansions.
857dnl See automake bug#9928 and bug#10237.
858am_make=${MAKE-make}
859AC_CACHE_CHECK([whether $am_make supports nested variables],
860   [am_cv_make_support_nested_variables],
861   [if AS_ECHO([['TRUE=$(BAR$(V))
862BAR0=false
863BAR1=true
864V=1
865am__doit:
866	@$(TRUE)
867.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
868  am_cv_make_support_nested_variables=yes
869else
870  am_cv_make_support_nested_variables=no
871fi])
872if test $am_cv_make_support_nested_variables = yes; then
873  dnl Using '$V' instead of '$(V)' breaks IRIX make.
874  AM_V='$(V)'
875  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
876else
877  AM_V=$AM_DEFAULT_VERBOSITY
878  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
879fi
880AC_SUBST([AM_V])dnl
881AM_SUBST_NOTMAKE([AM_V])dnl
882AC_SUBST([AM_DEFAULT_V])dnl
883AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
884AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
885AM_BACKSLASH='\'
886AC_SUBST([AM_BACKSLASH])dnl
887_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
888])
889
890# Copyright (C) 2001-2012 Free Software Foundation, Inc.
891#
892# This file is free software; the Free Software Foundation
893# gives unlimited permission to copy and/or distribute it,
894# with or without modifications, as long as this notice is preserved.
895
896# serial 2
897
898# AM_PROG_INSTALL_STRIP
899# ---------------------
900# One issue with vendor 'install' (even GNU) is that you can't
901# specify the program used to strip binaries.  This is especially
902# annoying in cross-compiling environments, where the build's strip
903# is unlikely to handle the host's binaries.
904# Fortunately install-sh will honor a STRIPPROG variable, so we
905# always use install-sh in "make install-strip", and initialize
906# STRIPPROG with the value of the STRIP variable (set by the user).
907AC_DEFUN([AM_PROG_INSTALL_STRIP],
908[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
909# Installed binaries are usually stripped using 'strip' when the user
910# run "make install-strip".  However 'strip' might not be the right
911# tool to use in cross-compilation environments, therefore Automake
912# will honor the 'STRIP' environment variable to overrule this program.
913dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
914if test "$cross_compiling" != no; then
915  AC_CHECK_TOOL([STRIP], [strip], :)
916fi
917INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
918AC_SUBST([INSTALL_STRIP_PROGRAM])])
919
920# Copyright (C) 2006-2012 Free Software Foundation, Inc.
921#
922# This file is free software; the Free Software Foundation
923# gives unlimited permission to copy and/or distribute it,
924# with or without modifications, as long as this notice is preserved.
925
926# serial 3
927
928# _AM_SUBST_NOTMAKE(VARIABLE)
929# ---------------------------
930# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
931# This macro is traced by Automake.
932AC_DEFUN([_AM_SUBST_NOTMAKE])
933
934# AM_SUBST_NOTMAKE(VARIABLE)
935# --------------------------
936# Public sister of _AM_SUBST_NOTMAKE.
937AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
938
939# Check how to create a tarball.                            -*- Autoconf -*-
940
941# Copyright (C) 2004-2012 Free Software Foundation, Inc.
942#
943# This file is free software; the Free Software Foundation
944# gives unlimited permission to copy and/or distribute it,
945# with or without modifications, as long as this notice is preserved.
946
947# serial 3
948
949# _AM_PROG_TAR(FORMAT)
950# --------------------
951# Check how to create a tarball in format FORMAT.
952# FORMAT should be one of 'v7', 'ustar', or 'pax'.
953#
954# Substitute a variable $(am__tar) that is a command
955# writing to stdout a FORMAT-tarball containing the directory
956# $tardir.
957#     tardir=directory && $(am__tar) > result.tar
958#
959# Substitute a variable $(am__untar) that extract such
960# a tarball read from stdin.
961#     $(am__untar) < result.tar
962AC_DEFUN([_AM_PROG_TAR],
963[# Always define AMTAR for backward compatibility.  Yes, it's still used
964# in the wild :-(  We should find a proper way to deprecate it ...
965AC_SUBST([AMTAR], ['$${TAR-tar}'])
966m4_if([$1], [v7],
967     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
968     [m4_case([$1], [ustar],, [pax],,
969              [m4_fatal([Unknown tar format])])
970AC_MSG_CHECKING([how to create a $1 tar archive])
971# Loop over all known methods to create a tar archive until one works.
972_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
973_am_tools=${am_cv_prog_tar_$1-$_am_tools}
974# Do not fold the above two line into one, because Tru64 sh and
975# Solaris sh will not grok spaces in the rhs of '-'.
976for _am_tool in $_am_tools
977do
978  case $_am_tool in
979  gnutar)
980    for _am_tar in tar gnutar gtar;
981    do
982      AM_RUN_LOG([$_am_tar --version]) && break
983    done
984    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
985    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
986    am__untar="$_am_tar -xf -"
987    ;;
988  plaintar)
989    # Must skip GNU tar: if it does not support --format= it doesn't create
990    # ustar tarball either.
991    (tar --version) >/dev/null 2>&1 && continue
992    am__tar='tar chf - "$$tardir"'
993    am__tar_='tar chf - "$tardir"'
994    am__untar='tar xf -'
995    ;;
996  pax)
997    am__tar='pax -L -x $1 -w "$$tardir"'
998    am__tar_='pax -L -x $1 -w "$tardir"'
999    am__untar='pax -r'
1000    ;;
1001  cpio)
1002    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1003    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1004    am__untar='cpio -i -H $1 -d'
1005    ;;
1006  none)
1007    am__tar=false
1008    am__tar_=false
1009    am__untar=false
1010    ;;
1011  esac
1012
1013  # If the value was cached, stop now.  We just wanted to have am__tar
1014  # and am__untar set.
1015  test -n "${am_cv_prog_tar_$1}" && break
1016
1017  # tar/untar a dummy directory, and stop if the command works
1018  rm -rf conftest.dir
1019  mkdir conftest.dir
1020  echo GrepMe > conftest.dir/file
1021  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1022  rm -rf conftest.dir
1023  if test -s conftest.tar; then
1024    AM_RUN_LOG([$am__untar <conftest.tar])
1025    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1026  fi
1027done
1028rm -rf conftest.dir
1029
1030AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1031AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1032AC_SUBST([am__tar])
1033AC_SUBST([am__untar])
1034]) # _AM_PROG_TAR
1035
1036# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1037#
1038#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1039#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1040#                 Foundation, Inc.
1041#   Written by Gordon Matzigkeit, 1996
1042#
1043# This file is free software; the Free Software Foundation gives
1044# unlimited permission to copy and/or distribute it, with or without
1045# modifications, as long as this notice is preserved.
1046
1047m4_define([_LT_COPYING], [dnl
1048#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1049#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1050#                 Foundation, Inc.
1051#   Written by Gordon Matzigkeit, 1996
1052#
1053#   This file is part of GNU Libtool.
1054#
1055# GNU Libtool is free software; you can redistribute it and/or
1056# modify it under the terms of the GNU General Public License as
1057# published by the Free Software Foundation; either version 2 of
1058# the License, or (at your option) any later version.
1059#
1060# As a special exception to the GNU General Public License,
1061# if you distribute this file as part of a program or library that
1062# is built using GNU Libtool, you may include this file under the
1063# same distribution terms that you use for the rest of that program.
1064#
1065# GNU Libtool is distributed in the hope that it will be useful,
1066# but WITHOUT ANY WARRANTY; without even the implied warranty of
1067# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1068# GNU General Public License for more details.
1069#
1070# You should have received a copy of the GNU General Public License
1071# along with GNU Libtool; see the file COPYING.  If not, a copy
1072# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1073# obtained by writing to the Free Software Foundation, Inc.,
1074# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1075])
1076
1077# serial 57 LT_INIT
1078
1079
1080# LT_PREREQ(VERSION)
1081# ------------------
1082# Complain and exit if this libtool version is less that VERSION.
1083m4_defun([LT_PREREQ],
1084[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1085       [m4_default([$3],
1086		   [m4_fatal([Libtool version $1 or higher is required],
1087		             63)])],
1088       [$2])])
1089
1090
1091# _LT_CHECK_BUILDDIR
1092# ------------------
1093# Complain if the absolute build directory name contains unusual characters
1094m4_defun([_LT_CHECK_BUILDDIR],
1095[case `pwd` in
1096  *\ * | *\	*)
1097    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1098esac
1099])
1100
1101
1102# LT_INIT([OPTIONS])
1103# ------------------
1104AC_DEFUN([LT_INIT],
1105[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1106AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1107AC_BEFORE([$0], [LT_LANG])dnl
1108AC_BEFORE([$0], [LT_OUTPUT])dnl
1109AC_BEFORE([$0], [LTDL_INIT])dnl
1110m4_require([_LT_CHECK_BUILDDIR])dnl
1111
1112dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1113m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1114m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1115dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1116dnl unless we require an AC_DEFUNed macro:
1117AC_REQUIRE([LTOPTIONS_VERSION])dnl
1118AC_REQUIRE([LTSUGAR_VERSION])dnl
1119AC_REQUIRE([LTVERSION_VERSION])dnl
1120AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1121m4_require([_LT_PROG_LTMAIN])dnl
1122
1123_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1124
1125dnl Parse OPTIONS
1126_LT_SET_OPTIONS([$0], [$1])
1127
1128# This can be used to rebuild libtool when needed
1129LIBTOOL_DEPS="$ltmain"
1130
1131# Always use our own libtool.
1132LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1133AC_SUBST(LIBTOOL)dnl
1134
1135_LT_SETUP
1136
1137# Only expand once:
1138m4_define([LT_INIT])
1139])# LT_INIT
1140
1141# Old names:
1142AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1143AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1144dnl aclocal-1.4 backwards compatibility:
1145dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1146dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1147
1148
1149# _LT_CC_BASENAME(CC)
1150# -------------------
1151# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1152m4_defun([_LT_CC_BASENAME],
1153[for cc_temp in $1""; do
1154  case $cc_temp in
1155    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1156    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1157    \-*) ;;
1158    *) break;;
1159  esac
1160done
1161cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1162])
1163
1164
1165# _LT_FILEUTILS_DEFAULTS
1166# ----------------------
1167# It is okay to use these file commands and assume they have been set
1168# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1169m4_defun([_LT_FILEUTILS_DEFAULTS],
1170[: ${CP="cp -f"}
1171: ${MV="mv -f"}
1172: ${RM="rm -f"}
1173])# _LT_FILEUTILS_DEFAULTS
1174
1175
1176# _LT_SETUP
1177# ---------
1178m4_defun([_LT_SETUP],
1179[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1180AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1181AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1182AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1183
1184_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1185dnl
1186_LT_DECL([], [host_alias], [0], [The host system])dnl
1187_LT_DECL([], [host], [0])dnl
1188_LT_DECL([], [host_os], [0])dnl
1189dnl
1190_LT_DECL([], [build_alias], [0], [The build system])dnl
1191_LT_DECL([], [build], [0])dnl
1192_LT_DECL([], [build_os], [0])dnl
1193dnl
1194AC_REQUIRE([AC_PROG_CC])dnl
1195AC_REQUIRE([LT_PATH_LD])dnl
1196AC_REQUIRE([LT_PATH_NM])dnl
1197dnl
1198AC_REQUIRE([AC_PROG_LN_S])dnl
1199test -z "$LN_S" && LN_S="ln -s"
1200_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1201dnl
1202AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1203_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1204_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1205dnl
1206m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1207m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1208m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1209m4_require([_LT_CMD_RELOAD])dnl
1210m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1211m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1212m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1213m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1214m4_require([_LT_WITH_SYSROOT])dnl
1215
1216_LT_CONFIG_LIBTOOL_INIT([
1217# See if we are running on zsh, and set the options which allow our
1218# commands through without removal of \ escapes INIT.
1219if test -n "\${ZSH_VERSION+set}" ; then
1220   setopt NO_GLOB_SUBST
1221fi
1222])
1223if test -n "${ZSH_VERSION+set}" ; then
1224   setopt NO_GLOB_SUBST
1225fi
1226
1227_LT_CHECK_OBJDIR
1228
1229m4_require([_LT_TAG_COMPILER])dnl
1230
1231case $host_os in
1232aix3*)
1233  # AIX sometimes has problems with the GCC collect2 program.  For some
1234  # reason, if we set the COLLECT_NAMES environment variable, the problems
1235  # vanish in a puff of smoke.
1236  if test "X${COLLECT_NAMES+set}" != Xset; then
1237    COLLECT_NAMES=
1238    export COLLECT_NAMES
1239  fi
1240  ;;
1241esac
1242
1243# Global variables:
1244ofile=libtool
1245can_build_shared=yes
1246
1247# All known linkers require a `.a' archive for static linking (except MSVC,
1248# which needs '.lib').
1249libext=a
1250
1251with_gnu_ld="$lt_cv_prog_gnu_ld"
1252
1253old_CC="$CC"
1254old_CFLAGS="$CFLAGS"
1255
1256# Set sane defaults for various variables
1257test -z "$CC" && CC=cc
1258test -z "$LTCC" && LTCC=$CC
1259test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1260test -z "$LD" && LD=ld
1261test -z "$ac_objext" && ac_objext=o
1262
1263_LT_CC_BASENAME([$compiler])
1264
1265# Only perform the check for file, if the check method requires it
1266test -z "$MAGIC_CMD" && MAGIC_CMD=file
1267case $deplibs_check_method in
1268file_magic*)
1269  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1270    _LT_PATH_MAGIC
1271  fi
1272  ;;
1273esac
1274
1275# Use C for the default configuration in the libtool script
1276LT_SUPPORTED_TAG([CC])
1277_LT_LANG_C_CONFIG
1278_LT_LANG_DEFAULT_CONFIG
1279_LT_CONFIG_COMMANDS
1280])# _LT_SETUP
1281
1282
1283# _LT_PREPARE_SED_QUOTE_VARS
1284# --------------------------
1285# Define a few sed substitution that help us do robust quoting.
1286m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1287[# Backslashify metacharacters that are still active within
1288# double-quoted strings.
1289sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1290
1291# Same as above, but do not quote variable references.
1292double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1293
1294# Sed substitution to delay expansion of an escaped shell variable in a
1295# double_quote_subst'ed string.
1296delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1297
1298# Sed substitution to delay expansion of an escaped single quote.
1299delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1300
1301# Sed substitution to avoid accidental globbing in evaled expressions
1302no_glob_subst='s/\*/\\\*/g'
1303])
1304
1305# _LT_PROG_LTMAIN
1306# ---------------
1307# Note that this code is called both from `configure', and `config.status'
1308# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1309# `config.status' has no value for ac_aux_dir unless we are using Automake,
1310# so we pass a copy along to make sure it has a sensible value anyway.
1311m4_defun([_LT_PROG_LTMAIN],
1312[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1313_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1314ltmain="$ac_aux_dir/ltmain.sh"
1315])# _LT_PROG_LTMAIN
1316
1317
1318
1319# So that we can recreate a full libtool script including additional
1320# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1321# in macros and then make a single call at the end using the `libtool'
1322# label.
1323
1324
1325# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1326# ----------------------------------------
1327# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1328m4_define([_LT_CONFIG_LIBTOOL_INIT],
1329[m4_ifval([$1],
1330          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1331                     [$1
1332])])])
1333
1334# Initialize.
1335m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1336
1337
1338# _LT_CONFIG_LIBTOOL([COMMANDS])
1339# ------------------------------
1340# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1341m4_define([_LT_CONFIG_LIBTOOL],
1342[m4_ifval([$1],
1343          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1344                     [$1
1345])])])
1346
1347# Initialize.
1348m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1349
1350
1351# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1352# -----------------------------------------------------
1353m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1354[_LT_CONFIG_LIBTOOL([$1])
1355_LT_CONFIG_LIBTOOL_INIT([$2])
1356])
1357
1358
1359# _LT_FORMAT_COMMENT([COMMENT])
1360# -----------------------------
1361# Add leading comment marks to the start of each line, and a trailing
1362# full-stop to the whole comment if one is not present already.
1363m4_define([_LT_FORMAT_COMMENT],
1364[m4_ifval([$1], [
1365m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1366              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1367)])
1368
1369
1370
1371
1372
1373# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1374# -------------------------------------------------------------------
1375# CONFIGNAME is the name given to the value in the libtool script.
1376# VARNAME is the (base) name used in the configure script.
1377# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1378# VARNAME.  Any other value will be used directly.
1379m4_define([_LT_DECL],
1380[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1381    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1382	[m4_ifval([$1], [$1], [$2])])
1383    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1384    m4_ifval([$4],
1385	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1386    lt_dict_add_subkey([lt_decl_dict], [$2],
1387	[tagged?], [m4_ifval([$5], [yes], [no])])])
1388])
1389
1390
1391# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1392# --------------------------------------------------------
1393m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1394
1395
1396# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1397# ------------------------------------------------
1398m4_define([lt_decl_tag_varnames],
1399[_lt_decl_filter([tagged?], [yes], $@)])
1400
1401
1402# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1403# ---------------------------------------------------------
1404m4_define([_lt_decl_filter],
1405[m4_case([$#],
1406  [0], [m4_fatal([$0: too few arguments: $#])],
1407  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1408  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1409  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1410  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1411])
1412
1413
1414# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1415# --------------------------------------------------
1416m4_define([lt_decl_quote_varnames],
1417[_lt_decl_filter([value], [1], $@)])
1418
1419
1420# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1421# ---------------------------------------------------
1422m4_define([lt_decl_dquote_varnames],
1423[_lt_decl_filter([value], [2], $@)])
1424
1425
1426# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1427# ---------------------------------------------------
1428m4_define([lt_decl_varnames_tagged],
1429[m4_assert([$# <= 2])dnl
1430_$0(m4_quote(m4_default([$1], [[, ]])),
1431    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1432    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1433m4_define([_lt_decl_varnames_tagged],
1434[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1435
1436
1437# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1438# ------------------------------------------------
1439m4_define([lt_decl_all_varnames],
1440[_$0(m4_quote(m4_default([$1], [[, ]])),
1441     m4_if([$2], [],
1442	   m4_quote(lt_decl_varnames),
1443	m4_quote(m4_shift($@))))[]dnl
1444])
1445m4_define([_lt_decl_all_varnames],
1446[lt_join($@, lt_decl_varnames_tagged([$1],
1447			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1448])
1449
1450
1451# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1452# ------------------------------------
1453# Quote a variable value, and forward it to `config.status' so that its
1454# declaration there will have the same value as in `configure'.  VARNAME
1455# must have a single quote delimited value for this to work.
1456m4_define([_LT_CONFIG_STATUS_DECLARE],
1457[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1458
1459
1460# _LT_CONFIG_STATUS_DECLARATIONS
1461# ------------------------------
1462# We delimit libtool config variables with single quotes, so when
1463# we write them to config.status, we have to be sure to quote all
1464# embedded single quotes properly.  In configure, this macro expands
1465# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1466#
1467#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1468m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1469[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1470    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1471
1472
1473# _LT_LIBTOOL_TAGS
1474# ----------------
1475# Output comment and list of tags supported by the script
1476m4_defun([_LT_LIBTOOL_TAGS],
1477[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1478available_tags="_LT_TAGS"dnl
1479])
1480
1481
1482# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1483# -----------------------------------
1484# Extract the dictionary values for VARNAME (optionally with TAG) and
1485# expand to a commented shell variable setting:
1486#
1487#    # Some comment about what VAR is for.
1488#    visible_name=$lt_internal_name
1489m4_define([_LT_LIBTOOL_DECLARE],
1490[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1491					   [description])))[]dnl
1492m4_pushdef([_libtool_name],
1493    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1494m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1495    [0], [_libtool_name=[$]$1],
1496    [1], [_libtool_name=$lt_[]$1],
1497    [2], [_libtool_name=$lt_[]$1],
1498    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1499m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1500])
1501
1502
1503# _LT_LIBTOOL_CONFIG_VARS
1504# -----------------------
1505# Produce commented declarations of non-tagged libtool config variables
1506# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1507# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1508# section) are produced by _LT_LIBTOOL_TAG_VARS.
1509m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1510[m4_foreach([_lt_var],
1511    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1512    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1513
1514
1515# _LT_LIBTOOL_TAG_VARS(TAG)
1516# -------------------------
1517m4_define([_LT_LIBTOOL_TAG_VARS],
1518[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1519    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1520
1521
1522# _LT_TAGVAR(VARNAME, [TAGNAME])
1523# ------------------------------
1524m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1525
1526
1527# _LT_CONFIG_COMMANDS
1528# -------------------
1529# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1530# variables for single and double quote escaping we saved from calls
1531# to _LT_DECL, we can put quote escaped variables declarations
1532# into `config.status', and then the shell code to quote escape them in
1533# for loops in `config.status'.  Finally, any additional code accumulated
1534# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1535m4_defun([_LT_CONFIG_COMMANDS],
1536[AC_PROVIDE_IFELSE([LT_OUTPUT],
1537	dnl If the libtool generation code has been placed in $CONFIG_LT,
1538	dnl instead of duplicating it all over again into config.status,
1539	dnl then we will have config.status run $CONFIG_LT later, so it
1540	dnl needs to know what name is stored there:
1541        [AC_CONFIG_COMMANDS([libtool],
1542            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1543    dnl If the libtool generation code is destined for config.status,
1544    dnl expand the accumulated commands and init code now:
1545    [AC_CONFIG_COMMANDS([libtool],
1546        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1547])#_LT_CONFIG_COMMANDS
1548
1549
1550# Initialize.
1551m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1552[
1553
1554# The HP-UX ksh and POSIX shell print the target directory to stdout
1555# if CDPATH is set.
1556(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1557
1558sed_quote_subst='$sed_quote_subst'
1559double_quote_subst='$double_quote_subst'
1560delay_variable_subst='$delay_variable_subst'
1561_LT_CONFIG_STATUS_DECLARATIONS
1562LTCC='$LTCC'
1563LTCFLAGS='$LTCFLAGS'
1564compiler='$compiler_DEFAULT'
1565
1566# A function that is used when there is no print builtin or printf.
1567func_fallback_echo ()
1568{
1569  eval 'cat <<_LTECHO_EOF
1570\$[]1
1571_LTECHO_EOF'
1572}
1573
1574# Quote evaled strings.
1575for var in lt_decl_all_varnames([[ \
1576]], lt_decl_quote_varnames); do
1577    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1578    *[[\\\\\\\`\\"\\\$]]*)
1579      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1580      ;;
1581    *)
1582      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1583      ;;
1584    esac
1585done
1586
1587# Double-quote double-evaled strings.
1588for var in lt_decl_all_varnames([[ \
1589]], lt_decl_dquote_varnames); do
1590    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1591    *[[\\\\\\\`\\"\\\$]]*)
1592      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1593      ;;
1594    *)
1595      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1596      ;;
1597    esac
1598done
1599
1600_LT_OUTPUT_LIBTOOL_INIT
1601])
1602
1603# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1604# ------------------------------------
1605# Generate a child script FILE with all initialization necessary to
1606# reuse the environment learned by the parent script, and make the
1607# file executable.  If COMMENT is supplied, it is inserted after the
1608# `#!' sequence but before initialization text begins.  After this
1609# macro, additional text can be appended to FILE to form the body of
1610# the child script.  The macro ends with non-zero status if the
1611# file could not be fully written (such as if the disk is full).
1612m4_ifdef([AS_INIT_GENERATED],
1613[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1614[m4_defun([_LT_GENERATED_FILE_INIT],
1615[m4_require([AS_PREPARE])]dnl
1616[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1617[lt_write_fail=0
1618cat >$1 <<_ASEOF || lt_write_fail=1
1619#! $SHELL
1620# Generated by $as_me.
1621$2
1622SHELL=\${CONFIG_SHELL-$SHELL}
1623export SHELL
1624_ASEOF
1625cat >>$1 <<\_ASEOF || lt_write_fail=1
1626AS_SHELL_SANITIZE
1627_AS_PREPARE
1628exec AS_MESSAGE_FD>&1
1629_ASEOF
1630test $lt_write_fail = 0 && chmod +x $1[]dnl
1631m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1632
1633# LT_OUTPUT
1634# ---------
1635# This macro allows early generation of the libtool script (before
1636# AC_OUTPUT is called), incase it is used in configure for compilation
1637# tests.
1638AC_DEFUN([LT_OUTPUT],
1639[: ${CONFIG_LT=./config.lt}
1640AC_MSG_NOTICE([creating $CONFIG_LT])
1641_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1642[# Run this file to recreate a libtool stub with the current configuration.])
1643
1644cat >>"$CONFIG_LT" <<\_LTEOF
1645lt_cl_silent=false
1646exec AS_MESSAGE_LOG_FD>>config.log
1647{
1648  echo
1649  AS_BOX([Running $as_me.])
1650} >&AS_MESSAGE_LOG_FD
1651
1652lt_cl_help="\
1653\`$as_me' creates a local libtool stub from the current configuration,
1654for use in further configure time tests before the real libtool is
1655generated.
1656
1657Usage: $[0] [[OPTIONS]]
1658
1659  -h, --help      print this help, then exit
1660  -V, --version   print version number, then exit
1661  -q, --quiet     do not print progress messages
1662  -d, --debug     don't remove temporary files
1663
1664Report bugs to <bug-libtool@gnu.org>."
1665
1666lt_cl_version="\
1667m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1668m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1669configured by $[0], generated by m4_PACKAGE_STRING.
1670
1671Copyright (C) 2011 Free Software Foundation, Inc.
1672This config.lt script is free software; the Free Software Foundation
1673gives unlimited permision to copy, distribute and modify it."
1674
1675while test $[#] != 0
1676do
1677  case $[1] in
1678    --version | --v* | -V )
1679      echo "$lt_cl_version"; exit 0 ;;
1680    --help | --h* | -h )
1681      echo "$lt_cl_help"; exit 0 ;;
1682    --debug | --d* | -d )
1683      debug=: ;;
1684    --quiet | --q* | --silent | --s* | -q )
1685      lt_cl_silent=: ;;
1686
1687    -*) AC_MSG_ERROR([unrecognized option: $[1]
1688Try \`$[0] --help' for more information.]) ;;
1689
1690    *) AC_MSG_ERROR([unrecognized argument: $[1]
1691Try \`$[0] --help' for more information.]) ;;
1692  esac
1693  shift
1694done
1695
1696if $lt_cl_silent; then
1697  exec AS_MESSAGE_FD>/dev/null
1698fi
1699_LTEOF
1700
1701cat >>"$CONFIG_LT" <<_LTEOF
1702_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1703_LTEOF
1704
1705cat >>"$CONFIG_LT" <<\_LTEOF
1706AC_MSG_NOTICE([creating $ofile])
1707_LT_OUTPUT_LIBTOOL_COMMANDS
1708AS_EXIT(0)
1709_LTEOF
1710chmod +x "$CONFIG_LT"
1711
1712# configure is writing to config.log, but config.lt does its own redirection,
1713# appending to config.log, which fails on DOS, as config.log is still kept
1714# open by configure.  Here we exec the FD to /dev/null, effectively closing
1715# config.log, so it can be properly (re)opened and appended to by config.lt.
1716lt_cl_success=:
1717test "$silent" = yes &&
1718  lt_config_lt_args="$lt_config_lt_args --quiet"
1719exec AS_MESSAGE_LOG_FD>/dev/null
1720$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1721exec AS_MESSAGE_LOG_FD>>config.log
1722$lt_cl_success || AS_EXIT(1)
1723])# LT_OUTPUT
1724
1725
1726# _LT_CONFIG(TAG)
1727# ---------------
1728# If TAG is the built-in tag, create an initial libtool script with a
1729# default configuration from the untagged config vars.  Otherwise add code
1730# to config.status for appending the configuration named by TAG from the
1731# matching tagged config vars.
1732m4_defun([_LT_CONFIG],
1733[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1734_LT_CONFIG_SAVE_COMMANDS([
1735  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1736  m4_if(_LT_TAG, [C], [
1737    # See if we are running on zsh, and set the options which allow our
1738    # commands through without removal of \ escapes.
1739    if test -n "${ZSH_VERSION+set}" ; then
1740      setopt NO_GLOB_SUBST
1741    fi
1742
1743    cfgfile="${ofile}T"
1744    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1745    $RM "$cfgfile"
1746
1747    cat <<_LT_EOF >> "$cfgfile"
1748#! $SHELL
1749
1750# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1751# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1752# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1753# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1754#
1755_LT_COPYING
1756_LT_LIBTOOL_TAGS
1757
1758# ### BEGIN LIBTOOL CONFIG
1759_LT_LIBTOOL_CONFIG_VARS
1760_LT_LIBTOOL_TAG_VARS
1761# ### END LIBTOOL CONFIG
1762
1763_LT_EOF
1764
1765  case $host_os in
1766  aix3*)
1767    cat <<\_LT_EOF >> "$cfgfile"
1768# AIX sometimes has problems with the GCC collect2 program.  For some
1769# reason, if we set the COLLECT_NAMES environment variable, the problems
1770# vanish in a puff of smoke.
1771if test "X${COLLECT_NAMES+set}" != Xset; then
1772  COLLECT_NAMES=
1773  export COLLECT_NAMES
1774fi
1775_LT_EOF
1776    ;;
1777  esac
1778
1779  _LT_PROG_LTMAIN
1780
1781  # We use sed instead of cat because bash on DJGPP gets confused if
1782  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1783  # text mode, it properly converts lines to CR/LF.  This bash problem
1784  # is reportedly fixed, but why not run on old versions too?
1785  sed '$q' "$ltmain" >> "$cfgfile" \
1786     || (rm -f "$cfgfile"; exit 1)
1787
1788  _LT_PROG_REPLACE_SHELLFNS
1789
1790   mv -f "$cfgfile" "$ofile" ||
1791    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1792  chmod +x "$ofile"
1793],
1794[cat <<_LT_EOF >> "$ofile"
1795
1796dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1797dnl in a comment (ie after a #).
1798# ### BEGIN LIBTOOL TAG CONFIG: $1
1799_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1800# ### END LIBTOOL TAG CONFIG: $1
1801_LT_EOF
1802])dnl /m4_if
1803],
1804[m4_if([$1], [], [
1805    PACKAGE='$PACKAGE'
1806    VERSION='$VERSION'
1807    TIMESTAMP='$TIMESTAMP'
1808    RM='$RM'
1809    ofile='$ofile'], [])
1810])dnl /_LT_CONFIG_SAVE_COMMANDS
1811])# _LT_CONFIG
1812
1813
1814# LT_SUPPORTED_TAG(TAG)
1815# ---------------------
1816# Trace this macro to discover what tags are supported by the libtool
1817# --tag option, using:
1818#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1819AC_DEFUN([LT_SUPPORTED_TAG], [])
1820
1821
1822# C support is built-in for now
1823m4_define([_LT_LANG_C_enabled], [])
1824m4_define([_LT_TAGS], [])
1825
1826
1827# LT_LANG(LANG)
1828# -------------
1829# Enable libtool support for the given language if not already enabled.
1830AC_DEFUN([LT_LANG],
1831[AC_BEFORE([$0], [LT_OUTPUT])dnl
1832m4_case([$1],
1833  [C],			[_LT_LANG(C)],
1834  [C++],		[_LT_LANG(CXX)],
1835  [Go],			[_LT_LANG(GO)],
1836  [Java],		[_LT_LANG(GCJ)],
1837  [Fortran 77],		[_LT_LANG(F77)],
1838  [Fortran],		[_LT_LANG(FC)],
1839  [Windows Resource],	[_LT_LANG(RC)],
1840  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1841    [_LT_LANG($1)],
1842    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1843])# LT_LANG
1844
1845
1846# _LT_LANG(LANGNAME)
1847# ------------------
1848m4_defun([_LT_LANG],
1849[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1850  [LT_SUPPORTED_TAG([$1])dnl
1851  m4_append([_LT_TAGS], [$1 ])dnl
1852  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1853  _LT_LANG_$1_CONFIG($1)])dnl
1854])# _LT_LANG
1855
1856
1857m4_ifndef([AC_PROG_GO], [
1858# NOTE: This macro has been submitted for inclusion into   #
1859#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1860#  a released version of Autoconf we should remove this    #
1861#  macro and use it instead.                               #
1862m4_defun([AC_PROG_GO],
1863[AC_LANG_PUSH(Go)dnl
1864AC_ARG_VAR([GOC],     [Go compiler command])dnl
1865AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1866_AC_ARG_VAR_LDFLAGS()dnl
1867AC_CHECK_TOOL(GOC, gccgo)
1868if test -z "$GOC"; then
1869  if test -n "$ac_tool_prefix"; then
1870    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1871  fi
1872fi
1873if test -z "$GOC"; then
1874  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1875fi
1876])#m4_defun
1877])#m4_ifndef
1878
1879
1880# _LT_LANG_DEFAULT_CONFIG
1881# -----------------------
1882m4_defun([_LT_LANG_DEFAULT_CONFIG],
1883[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1884  [LT_LANG(CXX)],
1885  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1886
1887AC_PROVIDE_IFELSE([AC_PROG_F77],
1888  [LT_LANG(F77)],
1889  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
1890
1891AC_PROVIDE_IFELSE([AC_PROG_FC],
1892  [LT_LANG(FC)],
1893  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
1894
1895dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
1896dnl pulling things in needlessly.
1897AC_PROVIDE_IFELSE([AC_PROG_GCJ],
1898  [LT_LANG(GCJ)],
1899  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1900    [LT_LANG(GCJ)],
1901    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
1902      [LT_LANG(GCJ)],
1903      [m4_ifdef([AC_PROG_GCJ],
1904	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
1905       m4_ifdef([A][M_PROG_GCJ],
1906	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
1907       m4_ifdef([LT_PROG_GCJ],
1908	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
1909
1910AC_PROVIDE_IFELSE([AC_PROG_GO],
1911  [LT_LANG(GO)],
1912  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
1913
1914AC_PROVIDE_IFELSE([LT_PROG_RC],
1915  [LT_LANG(RC)],
1916  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
1917])# _LT_LANG_DEFAULT_CONFIG
1918
1919# Obsolete macros:
1920AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
1921AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
1922AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
1923AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
1924AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
1925dnl aclocal-1.4 backwards compatibility:
1926dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
1927dnl AC_DEFUN([AC_LIBTOOL_F77], [])
1928dnl AC_DEFUN([AC_LIBTOOL_FC], [])
1929dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
1930dnl AC_DEFUN([AC_LIBTOOL_RC], [])
1931
1932
1933# _LT_TAG_COMPILER
1934# ----------------
1935m4_defun([_LT_TAG_COMPILER],
1936[AC_REQUIRE([AC_PROG_CC])dnl
1937
1938_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
1939_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
1940_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
1941_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
1942
1943# If no C compiler was specified, use CC.
1944LTCC=${LTCC-"$CC"}
1945
1946# If no C compiler flags were specified, use CFLAGS.
1947LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1948
1949# Allow CC to be a program name with arguments.
1950compiler=$CC
1951])# _LT_TAG_COMPILER
1952
1953
1954# _LT_COMPILER_BOILERPLATE
1955# ------------------------
1956# Check for compiler boilerplate output or warnings with
1957# the simple compiler test code.
1958m4_defun([_LT_COMPILER_BOILERPLATE],
1959[m4_require([_LT_DECL_SED])dnl
1960ac_outfile=conftest.$ac_objext
1961echo "$lt_simple_compile_test_code" >conftest.$ac_ext
1962eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1963_lt_compiler_boilerplate=`cat conftest.err`
1964$RM conftest*
1965])# _LT_COMPILER_BOILERPLATE
1966
1967
1968# _LT_LINKER_BOILERPLATE
1969# ----------------------
1970# Check for linker boilerplate output or warnings with
1971# the simple link test code.
1972m4_defun([_LT_LINKER_BOILERPLATE],
1973[m4_require([_LT_DECL_SED])dnl
1974ac_outfile=conftest.$ac_objext
1975echo "$lt_simple_link_test_code" >conftest.$ac_ext
1976eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1977_lt_linker_boilerplate=`cat conftest.err`
1978$RM -r conftest*
1979])# _LT_LINKER_BOILERPLATE
1980
1981# _LT_REQUIRED_DARWIN_CHECKS
1982# -------------------------
1983m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
1984  case $host_os in
1985    rhapsody* | darwin*)
1986    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
1987    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
1988    AC_CHECK_TOOL([LIPO], [lipo], [:])
1989    AC_CHECK_TOOL([OTOOL], [otool], [:])
1990    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1991    _LT_DECL([], [DSYMUTIL], [1],
1992      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1993    _LT_DECL([], [NMEDIT], [1],
1994      [Tool to change global to local symbols on Mac OS X])
1995    _LT_DECL([], [LIPO], [1],
1996      [Tool to manipulate fat objects and archives on Mac OS X])
1997    _LT_DECL([], [OTOOL], [1],
1998      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1999    _LT_DECL([], [OTOOL64], [1],
2000      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2001
2002    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2003      [lt_cv_apple_cc_single_mod=no
2004      if test -z "${LT_MULTI_MODULE}"; then
2005	# By default we will add the -single_module flag. You can override
2006	# by either setting the environment variable LT_MULTI_MODULE
2007	# non-empty at configure time, or by adding -multi_module to the
2008	# link flags.
2009	rm -rf libconftest.dylib*
2010	echo "int foo(void){return 1;}" > conftest.c
2011	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2012-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2013	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2014	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2015        _lt_result=$?
2016	# If there is a non-empty error log, and "single_module"
2017	# appears in it, assume the flag caused a linker warning
2018        if test -s conftest.err && $GREP single_module conftest.err; then
2019	  cat conftest.err >&AS_MESSAGE_LOG_FD
2020	# Otherwise, if the output was created with a 0 exit code from
2021	# the compiler, it worked.
2022	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2023	  lt_cv_apple_cc_single_mod=yes
2024	else
2025	  cat conftest.err >&AS_MESSAGE_LOG_FD
2026	fi
2027	rm -rf libconftest.dylib*
2028	rm -f conftest.*
2029      fi])
2030
2031    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2032      [lt_cv_ld_exported_symbols_list],
2033      [lt_cv_ld_exported_symbols_list=no
2034      save_LDFLAGS=$LDFLAGS
2035      echo "_main" > conftest.sym
2036      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2037      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2038	[lt_cv_ld_exported_symbols_list=yes],
2039	[lt_cv_ld_exported_symbols_list=no])
2040	LDFLAGS="$save_LDFLAGS"
2041    ])
2042
2043    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2044      [lt_cv_ld_force_load=no
2045      cat > conftest.c << _LT_EOF
2046int forced_loaded() { return 2;}
2047_LT_EOF
2048      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2049      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2050      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2051      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2052      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2053      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2054      cat > conftest.c << _LT_EOF
2055int main() { return 0;}
2056_LT_EOF
2057      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2058      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2059      _lt_result=$?
2060      if test -s conftest.err && $GREP force_load conftest.err; then
2061	cat conftest.err >&AS_MESSAGE_LOG_FD
2062      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2063	lt_cv_ld_force_load=yes
2064      else
2065	cat conftest.err >&AS_MESSAGE_LOG_FD
2066      fi
2067        rm -f conftest.err libconftest.a conftest conftest.c
2068        rm -rf conftest.dSYM
2069    ])
2070    case $host_os in
2071    rhapsody* | darwin1.[[012]])
2072      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2073    darwin1.*)
2074      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2075    darwin*) # darwin 5.x on
2076      # if running on 10.5 or later, the deployment target defaults
2077      # to the OS version, if on x86, and 10.4, the deployment
2078      # target defaults to 10.4. Don't you love it?
2079      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2080	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2081	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2082	10.[[012]]*)
2083	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2084	10.*)
2085	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2086      esac
2087    ;;
2088  esac
2089    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2090      _lt_dar_single_mod='$single_module'
2091    fi
2092    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2093      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2094    else
2095      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2096    fi
2097    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2098      _lt_dsymutil='~$DSYMUTIL $lib || :'
2099    else
2100      _lt_dsymutil=
2101    fi
2102    ;;
2103  esac
2104])
2105
2106
2107# _LT_DARWIN_LINKER_FEATURES([TAG])
2108# ---------------------------------
2109# Checks for linker and compiler features on darwin
2110m4_defun([_LT_DARWIN_LINKER_FEATURES],
2111[
2112  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2113  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2114  _LT_TAGVAR(hardcode_direct, $1)=no
2115  _LT_TAGVAR(hardcode_automatic, $1)=yes
2116  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2117  if test "$lt_cv_ld_force_load" = "yes"; then
2118    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
2119    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2120                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2121  else
2122    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2123  fi
2124  _LT_TAGVAR(link_all_deplibs, $1)=yes
2125  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2126  case $cc_basename in
2127     ifort*) _lt_dar_can_shared=yes ;;
2128     *) _lt_dar_can_shared=$GCC ;;
2129  esac
2130  if test "$_lt_dar_can_shared" = "yes"; then
2131    output_verbose_link_cmd=func_echo_all
2132    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
2133    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2134    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
2135    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
2136    m4_if([$1], [CXX],
2137[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2138      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
2139      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
2140    fi
2141],[])
2142  else
2143  _LT_TAGVAR(ld_shlibs, $1)=no
2144  fi
2145])
2146
2147# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2148# ----------------------------------
2149# Links a minimal program and checks the executable
2150# for the system default hardcoded library path. In most cases,
2151# this is /usr/lib:/lib, but when the MPI compilers are used
2152# the location of the communication and MPI libs are included too.
2153# If we don't find anything, use the default library path according
2154# to the aix ld manual.
2155# Store the results from the different compilers for each TAGNAME.
2156# Allow to override them for all tags through lt_cv_aix_libpath.
2157m4_defun([_LT_SYS_MODULE_PATH_AIX],
2158[m4_require([_LT_DECL_SED])dnl
2159if test "${lt_cv_aix_libpath+set}" = set; then
2160  aix_libpath=$lt_cv_aix_libpath
2161else
2162  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2163  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2164  lt_aix_libpath_sed='[
2165      /Import File Strings/,/^$/ {
2166	  /^0/ {
2167	      s/^0  *\([^ ]*\) *$/\1/
2168	      p
2169	  }
2170      }]'
2171  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2172  # Check for a 64-bit object if we didn't find anything.
2173  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2174    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2175  fi],[])
2176  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2177    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2178  fi
2179  ])
2180  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2181fi
2182])# _LT_SYS_MODULE_PATH_AIX
2183
2184
2185# _LT_SHELL_INIT(ARG)
2186# -------------------
2187m4_define([_LT_SHELL_INIT],
2188[m4_divert_text([M4SH-INIT], [$1
2189])])# _LT_SHELL_INIT
2190
2191
2192
2193# _LT_PROG_ECHO_BACKSLASH
2194# -----------------------
2195# Find how we can fake an echo command that does not interpret backslash.
2196# In particular, with Autoconf 2.60 or later we add some code to the start
2197# of the generated configure script which will find a shell with a builtin
2198# printf (which we can use as an echo command).
2199m4_defun([_LT_PROG_ECHO_BACKSLASH],
2200[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2201ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2202ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2203
2204AC_MSG_CHECKING([how to print strings])
2205# Test print first, because it will be a builtin if present.
2206if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2207   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2208  ECHO='print -r --'
2209elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2210  ECHO='printf %s\n'
2211else
2212  # Use this function as a fallback that always works.
2213  func_fallback_echo ()
2214  {
2215    eval 'cat <<_LTECHO_EOF
2216$[]1
2217_LTECHO_EOF'
2218  }
2219  ECHO='func_fallback_echo'
2220fi
2221
2222# func_echo_all arg...
2223# Invoke $ECHO with all args, space-separated.
2224func_echo_all ()
2225{
2226    $ECHO "$*" 
2227}
2228
2229case "$ECHO" in
2230  printf*) AC_MSG_RESULT([printf]) ;;
2231  print*) AC_MSG_RESULT([print -r]) ;;
2232  *) AC_MSG_RESULT([cat]) ;;
2233esac
2234
2235m4_ifdef([_AS_DETECT_SUGGESTED],
2236[_AS_DETECT_SUGGESTED([
2237  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2238    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2239    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2240    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2241    PATH=/empty FPATH=/empty; export PATH FPATH
2242    test "X`printf %s $ECHO`" = "X$ECHO" \
2243      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2244
2245_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2246_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2247])# _LT_PROG_ECHO_BACKSLASH
2248
2249
2250# _LT_WITH_SYSROOT
2251# ----------------
2252AC_DEFUN([_LT_WITH_SYSROOT],
2253[AC_MSG_CHECKING([for sysroot])
2254AC_ARG_WITH([sysroot],
2255[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2256                        (or the compiler's sysroot if not specified).],
2257[], [with_sysroot=no])
2258
2259dnl lt_sysroot will always be passed unquoted.  We quote it here
2260dnl in case the user passed a directory name.
2261lt_sysroot=
2262case ${with_sysroot} in #(
2263 yes)
2264   if test "$GCC" = yes; then
2265     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2266   fi
2267   ;; #(
2268 /*)
2269   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2270   ;; #(
2271 no|'')
2272   ;; #(
2273 *)
2274   AC_MSG_RESULT([${with_sysroot}])
2275   AC_MSG_ERROR([The sysroot must be an absolute path.])
2276   ;;
2277esac
2278
2279 AC_MSG_RESULT([${lt_sysroot:-no}])
2280_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2281[dependent libraries, and in which our libraries should be installed.])])
2282
2283# _LT_ENABLE_LOCK
2284# ---------------
2285m4_defun([_LT_ENABLE_LOCK],
2286[AC_ARG_ENABLE([libtool-lock],
2287  [AS_HELP_STRING([--disable-libtool-lock],
2288    [avoid locking (might break parallel builds)])])
2289test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2290
2291# Some flags need to be propagated to the compiler or linker for good
2292# libtool support.
2293case $host in
2294ia64-*-hpux*)
2295  # Find out which ABI we are using.
2296  echo 'int i;' > conftest.$ac_ext
2297  if AC_TRY_EVAL(ac_compile); then
2298    case `/usr/bin/file conftest.$ac_objext` in
2299      *ELF-32*)
2300	HPUX_IA64_MODE="32"
2301	;;
2302      *ELF-64*)
2303	HPUX_IA64_MODE="64"
2304	;;
2305    esac
2306  fi
2307  rm -rf conftest*
2308  ;;
2309*-*-irix6*)
2310  # Find out which ABI we are using.
2311  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2312  if AC_TRY_EVAL(ac_compile); then
2313    if test "$lt_cv_prog_gnu_ld" = yes; then
2314      case `/usr/bin/file conftest.$ac_objext` in
2315	*32-bit*)
2316	  LD="${LD-ld} -melf32bsmip"
2317	  ;;
2318	*N32*)
2319	  LD="${LD-ld} -melf32bmipn32"
2320	  ;;
2321	*64-bit*)
2322	  LD="${LD-ld} -melf64bmip"
2323	;;
2324      esac
2325    else
2326      case `/usr/bin/file conftest.$ac_objext` in
2327	*32-bit*)
2328	  LD="${LD-ld} -32"
2329	  ;;
2330	*N32*)
2331	  LD="${LD-ld} -n32"
2332	  ;;
2333	*64-bit*)
2334	  LD="${LD-ld} -64"
2335	  ;;
2336      esac
2337    fi
2338  fi
2339  rm -rf conftest*
2340  ;;
2341
2342x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2343s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2344  # Find out which ABI we are using.
2345  echo 'int i;' > conftest.$ac_ext
2346  if AC_TRY_EVAL(ac_compile); then
2347    case `/usr/bin/file conftest.o` in
2348      *32-bit*)
2349	case $host in
2350	  x86_64-*kfreebsd*-gnu)
2351	    LD="${LD-ld} -m elf_i386_fbsd"
2352	    ;;
2353	  x86_64-*linux*)
2354	    LD="${LD-ld} -m elf_i386"
2355	    ;;
2356	  ppc64-*linux*|powerpc64-*linux*)
2357	    LD="${LD-ld} -m elf32ppclinux"
2358	    ;;
2359	  s390x-*linux*)
2360	    LD="${LD-ld} -m elf_s390"
2361	    ;;
2362	  sparc64-*linux*)
2363	    LD="${LD-ld} -m elf32_sparc"
2364	    ;;
2365	esac
2366	;;
2367      *64-bit*)
2368	case $host in
2369	  x86_64-*kfreebsd*-gnu)
2370	    LD="${LD-ld} -m elf_x86_64_fbsd"
2371	    ;;
2372	  x86_64-*linux*)
2373	    LD="${LD-ld} -m elf_x86_64"
2374	    ;;
2375	  ppc*-*linux*|powerpc*-*linux*)
2376	    LD="${LD-ld} -m elf64ppc"
2377	    ;;
2378	  s390*-*linux*|s390*-*tpf*)
2379	    LD="${LD-ld} -m elf64_s390"
2380	    ;;
2381	  sparc*-*linux*)
2382	    LD="${LD-ld} -m elf64_sparc"
2383	    ;;
2384	esac
2385	;;
2386    esac
2387  fi
2388  rm -rf conftest*
2389  ;;
2390
2391*-*-sco3.2v5*)
2392  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2393  SAVE_CFLAGS="$CFLAGS"
2394  CFLAGS="$CFLAGS -belf"
2395  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2396    [AC_LANG_PUSH(C)
2397     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2398     AC_LANG_POP])
2399  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2400    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2401    CFLAGS="$SAVE_CFLAGS"
2402  fi
2403  ;;
2404*-*solaris*)
2405  # Find out which ABI we are using.
2406  echo 'int i;' > conftest.$ac_ext
2407  if AC_TRY_EVAL(ac_compile); then
2408    case `/usr/bin/file conftest.o` in
2409    *64-bit*)
2410      case $lt_cv_prog_gnu_ld in
2411      yes*)
2412        case $host in
2413        i?86-*-solaris*)
2414          LD="${LD-ld} -m elf_x86_64"
2415          ;;
2416        sparc*-*-solaris*)
2417          LD="${LD-ld} -m elf64_sparc"
2418          ;;
2419        esac
2420        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2421        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2422          LD="${LD-ld}_sol2"
2423        fi
2424        ;;
2425      *)
2426	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2427	  LD="${LD-ld} -64"
2428	fi
2429	;;
2430      esac
2431      ;;
2432    esac
2433  fi
2434  rm -rf conftest*
2435  ;;
2436esac
2437
2438need_locks="$enable_libtool_lock"
2439])# _LT_ENABLE_LOCK
2440
2441
2442# _LT_PROG_AR
2443# -----------
2444m4_defun([_LT_PROG_AR],
2445[AC_CHECK_TOOLS(AR, [ar], false)
2446: ${AR=ar}
2447: ${AR_FLAGS=cru}
2448_LT_DECL([], [AR], [1], [The archiver])
2449_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2450
2451AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2452  [lt_cv_ar_at_file=no
2453   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2454     [echo conftest.$ac_objext > conftest.lst
2455      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2456      AC_TRY_EVAL([lt_ar_try])
2457      if test "$ac_status" -eq 0; then
2458	# Ensure the archiver fails upon bogus file names.
2459	rm -f conftest.$ac_objext libconftest.a
2460	AC_TRY_EVAL([lt_ar_try])
2461	if test "$ac_status" -ne 0; then
2462          lt_cv_ar_at_file=@
2463        fi
2464      fi
2465      rm -f conftest.* libconftest.a
2466     ])
2467  ])
2468
2469if test "x$lt_cv_ar_at_file" = xno; then
2470  archiver_list_spec=
2471else
2472  archiver_list_spec=$lt_cv_ar_at_file
2473fi
2474_LT_DECL([], [archiver_list_spec], [1],
2475  [How to feed a file listing to the archiver])
2476])# _LT_PROG_AR
2477
2478
2479# _LT_CMD_OLD_ARCHIVE
2480# -------------------
2481m4_defun([_LT_CMD_OLD_ARCHIVE],
2482[_LT_PROG_AR
2483
2484AC_CHECK_TOOL(STRIP, strip, :)
2485test -z "$STRIP" && STRIP=:
2486_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2487
2488AC_CHECK_TOOL(RANLIB, ranlib, :)
2489test -z "$RANLIB" && RANLIB=:
2490_LT_DECL([], [RANLIB], [1],
2491    [Commands used to install an old-style archive])
2492
2493# Determine commands to create old-style static archives.
2494old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2495old_postinstall_cmds='chmod 644 $oldlib'
2496old_postuninstall_cmds=
2497
2498if test -n "$RANLIB"; then
2499  case $host_os in
2500  openbsd*)
2501    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2502    ;;
2503  *)
2504    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2505    ;;
2506  esac
2507  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2508fi
2509
2510case $host_os in
2511  darwin*)
2512    lock_old_archive_extraction=yes ;;
2513  *)
2514    lock_old_archive_extraction=no ;;
2515esac
2516_LT_DECL([], [old_postinstall_cmds], [2])
2517_LT_DECL([], [old_postuninstall_cmds], [2])
2518_LT_TAGDECL([], [old_archive_cmds], [2],
2519    [Commands used to build an old-style archive])
2520_LT_DECL([], [lock_old_archive_extraction], [0],
2521    [Whether to use a lock for old archive extraction])
2522])# _LT_CMD_OLD_ARCHIVE
2523
2524
2525# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2526#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2527# ----------------------------------------------------------------
2528# Check whether the given compiler option works
2529AC_DEFUN([_LT_COMPILER_OPTION],
2530[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2531m4_require([_LT_DECL_SED])dnl
2532AC_CACHE_CHECK([$1], [$2],
2533  [$2=no
2534   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2535   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2536   lt_compiler_flag="$3"
2537   # Insert the option either (1) after the last *FLAGS variable, or
2538   # (2) before a word containing "conftest.", or (3) at the end.
2539   # Note that $ac_compile itself does not contain backslashes and begins
2540   # with a dollar sign (not a hyphen), so the echo should work correctly.
2541   # The option is referenced via a variable to avoid confusing sed.
2542   lt_compile=`echo "$ac_compile" | $SED \
2543   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2544   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2545   -e 's:$: $lt_compiler_flag:'`
2546   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2547   (eval "$lt_compile" 2>conftest.err)
2548   ac_status=$?
2549   cat conftest.err >&AS_MESSAGE_LOG_FD
2550   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2551   if (exit $ac_status) && test -s "$ac_outfile"; then
2552     # The compiler can only warn and ignore the option if not recognized
2553     # So say no if there are warnings other than the usual output.
2554     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2555     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2556     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2557       $2=yes
2558     fi
2559   fi
2560   $RM conftest*
2561])
2562
2563if test x"[$]$2" = xyes; then
2564    m4_if([$5], , :, [$5])
2565else
2566    m4_if([$6], , :, [$6])
2567fi
2568])# _LT_COMPILER_OPTION
2569
2570# Old name:
2571AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2572dnl aclocal-1.4 backwards compatibility:
2573dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2574
2575
2576# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2577#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2578# ----------------------------------------------------
2579# Check whether the given linker option works
2580AC_DEFUN([_LT_LINKER_OPTION],
2581[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2582m4_require([_LT_DECL_SED])dnl
2583AC_CACHE_CHECK([$1], [$2],
2584  [$2=no
2585   save_LDFLAGS="$LDFLAGS"
2586   LDFLAGS="$LDFLAGS $3"
2587   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2588   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2589     # The linker can only warn and ignore the option if not recognized
2590     # So say no if there are warnings
2591     if test -s conftest.err; then
2592       # Append any errors to the config.log.
2593       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2594       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2595       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2596       if diff conftest.exp conftest.er2 >/dev/null; then
2597         $2=yes
2598       fi
2599     else
2600       $2=yes
2601     fi
2602   fi
2603   $RM -r conftest*
2604   LDFLAGS="$save_LDFLAGS"
2605])
2606
2607if test x"[$]$2" = xyes; then
2608    m4_if([$4], , :, [$4])
2609else
2610    m4_if([$5], , :, [$5])
2611fi
2612])# _LT_LINKER_OPTION
2613
2614# Old name:
2615AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2616dnl aclocal-1.4 backwards compatibility:
2617dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2618
2619
2620# LT_CMD_MAX_LEN
2621#---------------
2622AC_DEFUN([LT_CMD_MAX_LEN],
2623[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2624# find the maximum length of command line arguments
2625AC_MSG_CHECKING([the maximum length of command line arguments])
2626AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2627  i=0
2628  teststring="ABCD"
2629
2630  case $build_os in
2631  msdosdjgpp*)
2632    # On DJGPP, this test can blow up pretty badly due to problems in libc
2633    # (any single argument exceeding 2000 bytes causes a buffer overrun
2634    # during glob expansion).  Even if it were fixed, the result of this
2635    # check would be larger than it should be.
2636    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2637    ;;
2638
2639  gnu*)
2640    # Under GNU Hurd, this test is not required because there is
2641    # no limit to the length of command line arguments.
2642    # Libtool will interpret -1 as no limit whatsoever
2643    lt_cv_sys_max_cmd_len=-1;
2644    ;;
2645
2646  cygwin* | mingw* | cegcc*)
2647    # On Win9x/ME, this test blows up -- it succeeds, but takes
2648    # about 5 minutes as the teststring grows exponentially.
2649    # Worse, since 9x/ME are not pre-emptively multitasking,
2650    # you end up with a "frozen" computer, even though with patience
2651    # the test eventually succeeds (with a max line length of 256k).
2652    # Instead, let's just punt: use the minimum linelength reported by
2653    # all of the supported platforms: 8192 (on NT/2K/XP).
2654    lt_cv_sys_max_cmd_len=8192;
2655    ;;
2656
2657  mint*)
2658    # On MiNT this can take a long time and run out of memory.
2659    lt_cv_sys_max_cmd_len=8192;
2660    ;;
2661
2662  amigaos*)
2663    # On AmigaOS with pdksh, this test takes hours, literally.
2664    # So we just punt and use a minimum line length of 8192.
2665    lt_cv_sys_max_cmd_len=8192;
2666    ;;
2667
2668  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2669    # This has been around since 386BSD, at least.  Likely further.
2670    if test -x /sbin/sysctl; then
2671      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2672    elif test -x /usr/sbin/sysctl; then
2673      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2674    else
2675      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2676    fi
2677    # And add a safety zone
2678    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2679    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2680    ;;
2681
2682  interix*)
2683    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2684    lt_cv_sys_max_cmd_len=196608
2685    ;;
2686
2687  os2*)
2688    # The test takes a long time on OS/2.
2689    lt_cv_sys_max_cmd_len=8192
2690    ;;
2691
2692  osf*)
2693    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2694    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2695    # nice to cause kernel panics so lets avoid the loop below.
2696    # First set a reasonable default.
2697    lt_cv_sys_max_cmd_len=16384
2698    #
2699    if test -x /sbin/sysconfig; then
2700      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2701        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2702      esac
2703    fi
2704    ;;
2705  sco3.2v5*)
2706    lt_cv_sys_max_cmd_len=102400
2707    ;;
2708  sysv5* | sco5v6* | sysv4.2uw2*)
2709    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2710    if test -n "$kargmax"; then
2711      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2712    else
2713      lt_cv_sys_max_cmd_len=32768
2714    fi
2715    ;;
2716  *)
2717    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2718    if test -n "$lt_cv_sys_max_cmd_len"; then
2719      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2720      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2721    else
2722      # Make teststring a little bigger before we do anything with it.
2723      # a 1K string should be a reasonable start.
2724      for i in 1 2 3 4 5 6 7 8 ; do
2725        teststring=$teststring$teststring
2726      done
2727      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2728      # If test is not a shell built-in, we'll probably end up computing a
2729      # maximum length that is only half of the actual maximum length, but
2730      # we can't tell.
2731      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2732	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2733	      test $i != 17 # 1/2 MB should be enough
2734      do
2735        i=`expr $i + 1`
2736        teststring=$teststring$teststring
2737      done
2738      # Only check the string length outside the loop.
2739      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2740      teststring=
2741      # Add a significant safety factor because C++ compilers can tack on
2742      # massive amounts of additional arguments before passing them to the
2743      # linker.  It appears as though 1/2 is a usable value.
2744      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2745    fi
2746    ;;
2747  esac
2748])
2749if test -n $lt_cv_sys_max_cmd_len ; then
2750  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2751else
2752  AC_MSG_RESULT(none)
2753fi
2754max_cmd_len=$lt_cv_sys_max_cmd_len
2755_LT_DECL([], [max_cmd_len], [0],
2756    [What is the maximum length of a command?])
2757])# LT_CMD_MAX_LEN
2758
2759# Old name:
2760AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2761dnl aclocal-1.4 backwards compatibility:
2762dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2763
2764
2765# _LT_HEADER_DLFCN
2766# ----------------
2767m4_defun([_LT_HEADER_DLFCN],
2768[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2769])# _LT_HEADER_DLFCN
2770
2771
2772# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2773#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2774# ----------------------------------------------------------------
2775m4_defun([_LT_TRY_DLOPEN_SELF],
2776[m4_require([_LT_HEADER_DLFCN])dnl
2777if test "$cross_compiling" = yes; then :
2778  [$4]
2779else
2780  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2781  lt_status=$lt_dlunknown
2782  cat > conftest.$ac_ext <<_LT_EOF
2783[#line $LINENO "configure"
2784#include "confdefs.h"
2785
2786#if HAVE_DLFCN_H
2787#include <dlfcn.h>
2788#endif
2789
2790#include <stdio.h>
2791
2792#ifdef RTLD_GLOBAL
2793#  define LT_DLGLOBAL		RTLD_GLOBAL
2794#else
2795#  ifdef DL_GLOBAL
2796#    define LT_DLGLOBAL		DL_GLOBAL
2797#  else
2798#    define LT_DLGLOBAL		0
2799#  endif
2800#endif
2801
2802/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2803   find out it does not work in some platform. */
2804#ifndef LT_DLLAZY_OR_NOW
2805#  ifdef RTLD_LAZY
2806#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2807#  else
2808#    ifdef DL_LAZY
2809#      define LT_DLLAZY_OR_NOW		DL_LAZY
2810#    else
2811#      ifdef RTLD_NOW
2812#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2813#      else
2814#        ifdef DL_NOW
2815#          define LT_DLLAZY_OR_NOW	DL_NOW
2816#        else
2817#          define LT_DLLAZY_OR_NOW	0
2818#        endif
2819#      endif
2820#    endif
2821#  endif
2822#endif
2823
2824/* When -fvisbility=hidden is used, assume the code has been annotated
2825   correspondingly for the symbols needed.  */
2826#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2827int fnord () __attribute__((visibility("default")));
2828#endif
2829
2830int fnord () { return 42; }
2831int main ()
2832{
2833  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2834  int status = $lt_dlunknown;
2835
2836  if (self)
2837    {
2838      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2839      else
2840        {
2841	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2842          else puts (dlerror ());
2843	}
2844      /* dlclose (self); */
2845    }
2846  else
2847    puts (dlerror ());
2848
2849  return status;
2850}]
2851_LT_EOF
2852  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2853    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2854    lt_status=$?
2855    case x$lt_status in
2856      x$lt_dlno_uscore) $1 ;;
2857      x$lt_dlneed_uscore) $2 ;;
2858      x$lt_dlunknown|x*) $3 ;;
2859    esac
2860  else :
2861    # compilation failed
2862    $3
2863  fi
2864fi
2865rm -fr conftest*
2866])# _LT_TRY_DLOPEN_SELF
2867
2868
2869# LT_SYS_DLOPEN_SELF
2870# ------------------
2871AC_DEFUN([LT_SYS_DLOPEN_SELF],
2872[m4_require([_LT_HEADER_DLFCN])dnl
2873if test "x$enable_dlopen" != xyes; then
2874  enable_dlopen=unknown
2875  enable_dlopen_self=unknown
2876  enable_dlopen_self_static=unknown
2877else
2878  lt_cv_dlopen=no
2879  lt_cv_dlopen_libs=
2880
2881  case $host_os in
2882  beos*)
2883    lt_cv_dlopen="load_add_on"
2884    lt_cv_dlopen_libs=
2885    lt_cv_dlopen_self=yes
2886    ;;
2887
2888  mingw* | pw32* | cegcc*)
2889    lt_cv_dlopen="LoadLibrary"
2890    lt_cv_dlopen_libs=
2891    ;;
2892
2893  cygwin*)
2894    lt_cv_dlopen="dlopen"
2895    lt_cv_dlopen_libs=
2896    ;;
2897
2898  darwin*)
2899  # if libdl is installed we need to link against it
2900    AC_CHECK_LIB([dl], [dlopen],
2901		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2902    lt_cv_dlopen="dyld"
2903    lt_cv_dlopen_libs=
2904    lt_cv_dlopen_self=yes
2905    ])
2906    ;;
2907
2908  *)
2909    AC_CHECK_FUNC([shl_load],
2910	  [lt_cv_dlopen="shl_load"],
2911      [AC_CHECK_LIB([dld], [shl_load],
2912	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2913	[AC_CHECK_FUNC([dlopen],
2914	      [lt_cv_dlopen="dlopen"],
2915	  [AC_CHECK_LIB([dl], [dlopen],
2916		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2917	    [AC_CHECK_LIB([svld], [dlopen],
2918		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2919	      [AC_CHECK_LIB([dld], [dld_link],
2920		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
2921	      ])
2922	    ])
2923	  ])
2924	])
2925      ])
2926    ;;
2927  esac
2928
2929  if test "x$lt_cv_dlopen" != xno; then
2930    enable_dlopen=yes
2931  else
2932    enable_dlopen=no
2933  fi
2934
2935  case $lt_cv_dlopen in
2936  dlopen)
2937    save_CPPFLAGS="$CPPFLAGS"
2938    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2939
2940    save_LDFLAGS="$LDFLAGS"
2941    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2942
2943    save_LIBS="$LIBS"
2944    LIBS="$lt_cv_dlopen_libs $LIBS"
2945
2946    AC_CACHE_CHECK([whether a program can dlopen itself],
2947	  lt_cv_dlopen_self, [dnl
2948	  _LT_TRY_DLOPEN_SELF(
2949	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2950	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2951    ])
2952
2953    if test "x$lt_cv_dlopen_self" = xyes; then
2954      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2955      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2956	  lt_cv_dlopen_self_static, [dnl
2957	  _LT_TRY_DLOPEN_SELF(
2958	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2959	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2960      ])
2961    fi
2962
2963    CPPFLAGS="$save_CPPFLAGS"
2964    LDFLAGS="$save_LDFLAGS"
2965    LIBS="$save_LIBS"
2966    ;;
2967  esac
2968
2969  case $lt_cv_dlopen_self in
2970  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2971  *) enable_dlopen_self=unknown ;;
2972  esac
2973
2974  case $lt_cv_dlopen_self_static in
2975  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2976  *) enable_dlopen_self_static=unknown ;;
2977  esac
2978fi
2979_LT_DECL([dlopen_support], [enable_dlopen], [0],
2980	 [Whether dlopen is supported])
2981_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2982	 [Whether dlopen of programs is supported])
2983_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2984	 [Whether dlopen of statically linked programs is supported])
2985])# LT_SYS_DLOPEN_SELF
2986
2987# Old name:
2988AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2989dnl aclocal-1.4 backwards compatibility:
2990dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2991
2992
2993# _LT_COMPILER_C_O([TAGNAME])
2994# ---------------------------
2995# Check to see if options -c and -o are simultaneously supported by compiler.
2996# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2997m4_defun([_LT_COMPILER_C_O],
2998[m4_require([_LT_DECL_SED])dnl
2999m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3000m4_require([_LT_TAG_COMPILER])dnl
3001AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3002  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3003  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3004   $RM -r conftest 2>/dev/null
3005   mkdir conftest
3006   cd conftest
3007   mkdir out
3008   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3009
3010   lt_compiler_flag="-o out/conftest2.$ac_objext"
3011   # Insert the option either (1) after the last *FLAGS variable, or
3012   # (2) before a word containing "conftest.", or (3) at the end.
3013   # Note that $ac_compile itself does not contain backslashes and begins
3014   # with a dollar sign (not a hyphen), so the echo should work correctly.
3015   lt_compile=`echo "$ac_compile" | $SED \
3016   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3017   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3018   -e 's:$: $lt_compiler_flag:'`
3019   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3020   (eval "$lt_compile" 2>out/conftest.err)
3021   ac_status=$?
3022   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3023   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3024   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3025   then
3026     # The compiler can only warn and ignore the option if not recognized
3027     # So say no if there are warnings
3028     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3029     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3030     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3031       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3032     fi
3033   fi
3034   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3035   $RM conftest*
3036   # SGI C++ compiler will create directory out/ii_files/ for
3037   # template instantiation
3038   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3039   $RM out/* && rmdir out
3040   cd ..
3041   $RM -r conftest
3042   $RM conftest*
3043])
3044_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3045	[Does compiler simultaneously support -c and -o options?])
3046])# _LT_COMPILER_C_O
3047
3048
3049# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3050# ----------------------------------
3051# Check to see if we can do hard links to lock some files if needed
3052m4_defun([_LT_COMPILER_FILE_LOCKS],
3053[m4_require([_LT_ENABLE_LOCK])dnl
3054m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3055_LT_COMPILER_C_O([$1])
3056
3057hard_links="nottested"
3058if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3059  # do not overwrite the value of need_locks provided by the user
3060  AC_MSG_CHECKING([if we can lock with hard links])
3061  hard_links=yes
3062  $RM conftest*
3063  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3064  touch conftest.a
3065  ln conftest.a conftest.b 2>&5 || hard_links=no
3066  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3067  AC_MSG_RESULT([$hard_links])
3068  if test "$hard_links" = no; then
3069    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3070    need_locks=warn
3071  fi
3072else
3073  need_locks=no
3074fi
3075_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3076])# _LT_COMPILER_FILE_LOCKS
3077
3078
3079# _LT_CHECK_OBJDIR
3080# ----------------
3081m4_defun([_LT_CHECK_OBJDIR],
3082[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3083[rm -f .libs 2>/dev/null
3084mkdir .libs 2>/dev/null
3085if test -d .libs; then
3086  lt_cv_objdir=.libs
3087else
3088  # MS-DOS does not allow filenames that begin with a dot.
3089  lt_cv_objdir=_libs
3090fi
3091rmdir .libs 2>/dev/null])
3092objdir=$lt_cv_objdir
3093_LT_DECL([], [objdir], [0],
3094         [The name of the directory that contains temporary libtool files])dnl
3095m4_pattern_allow([LT_OBJDIR])dnl
3096AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3097  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3098])# _LT_CHECK_OBJDIR
3099
3100
3101# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3102# --------------------------------------
3103# Check hardcoding attributes.
3104m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3105[AC_MSG_CHECKING([how to hardcode library paths into programs])
3106_LT_TAGVAR(hardcode_action, $1)=
3107if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3108   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3109   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3110
3111  # We can hardcode non-existent directories.
3112  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3113     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3114     # have to relink, otherwise we might link with an installed library
3115     # when we should be linking with a yet-to-be-installed one
3116     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3117     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3118    # Linking always hardcodes the temporary library directory.
3119    _LT_TAGVAR(hardcode_action, $1)=relink
3120  else
3121    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3122    _LT_TAGVAR(hardcode_action, $1)=immediate
3123  fi
3124else
3125  # We cannot hardcode anything, or else we can only hardcode existing
3126  # directories.
3127  _LT_TAGVAR(hardcode_action, $1)=unsupported
3128fi
3129AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3130
3131if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3132   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3133  # Fast installation is not supported
3134  enable_fast_install=no
3135elif test "$shlibpath_overrides_runpath" = yes ||
3136     test "$enable_shared" = no; then
3137  # Fast installation is not necessary
3138  enable_fast_install=needless
3139fi
3140_LT_TAGDECL([], [hardcode_action], [0],
3141    [How to hardcode a shared library path into an executable])
3142])# _LT_LINKER_HARDCODE_LIBPATH
3143
3144
3145# _LT_CMD_STRIPLIB
3146# ----------------
3147m4_defun([_LT_CMD_STRIPLIB],
3148[m4_require([_LT_DECL_EGREP])
3149striplib=
3150old_striplib=
3151AC_MSG_CHECKING([whether stripping libraries is possible])
3152if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3153  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3154  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3155  AC_MSG_RESULT([yes])
3156else
3157# FIXME - insert some real tests, host_os isn't really good enough
3158  case $host_os in
3159  darwin*)
3160    if test -n "$STRIP" ; then
3161      striplib="$STRIP -x"
3162      old_striplib="$STRIP -S"
3163      AC_MSG_RESULT([yes])
3164    else
3165      AC_MSG_RESULT([no])
3166    fi
3167    ;;
3168  *)
3169    AC_MSG_RESULT([no])
3170    ;;
3171  esac
3172fi
3173_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3174_LT_DECL([], [striplib], [1])
3175])# _LT_CMD_STRIPLIB
3176
3177
3178# _LT_SYS_DYNAMIC_LINKER([TAG])
3179# -----------------------------
3180# PORTME Fill in your ld.so characteristics
3181m4_defun([_LT_SYS_DYNAMIC_LINKER],
3182[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3183m4_require([_LT_DECL_EGREP])dnl
3184m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3185m4_require([_LT_DECL_OBJDUMP])dnl
3186m4_require([_LT_DECL_SED])dnl
3187m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3188AC_MSG_CHECKING([dynamic linker characteristics])
3189m4_if([$1],
3190	[], [
3191if test "$GCC" = yes; then
3192  case $host_os in
3193    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3194    *) lt_awk_arg="/^libraries:/" ;;
3195  esac
3196  case $host_os in
3197    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3198    *) lt_sed_strip_eq="s,=/,/,g" ;;
3199  esac
3200  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3201  case $lt_search_path_spec in
3202  *\;*)
3203    # if the path contains ";" then we assume it to be the separator
3204    # otherwise default to the standard path separator (i.e. ":") - it is
3205    # assumed that no part of a normal pathname contains ";" but that should
3206    # okay in the real world where ";" in dirpaths is itself problematic.
3207    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3208    ;;
3209  *)
3210    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3211    ;;
3212  esac
3213  # Ok, now we have the path, separated by spaces, we can step through it
3214  # and add multilib dir if necessary.
3215  lt_tmp_lt_search_path_spec=
3216  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3217  for lt_sys_path in $lt_search_path_spec; do
3218    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3219      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3220    else
3221      test -d "$lt_sys_path" && \
3222	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3223    fi
3224  done
3225  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3226BEGIN {RS=" "; FS="/|\n";} {
3227  lt_foo="";
3228  lt_count=0;
3229  for (lt_i = NF; lt_i > 0; lt_i--) {
3230    if ($lt_i != "" && $lt_i != ".") {
3231      if ($lt_i == "..") {
3232        lt_count++;
3233      } else {
3234        if (lt_count == 0) {
3235          lt_foo="/" $lt_i lt_foo;
3236        } else {
3237          lt_count--;
3238        }
3239      }
3240    }
3241  }
3242  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3243  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3244}'`
3245  # AWK program above erroneously prepends '/' to C:/dos/paths
3246  # for these hosts.
3247  case $host_os in
3248    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3249      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3250  esac
3251  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3252else
3253  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3254fi])
3255library_names_spec=
3256libname_spec='lib$name'
3257soname_spec=
3258shrext_cmds=".so"
3259postinstall_cmds=
3260postuninstall_cmds=
3261finish_cmds=
3262finish_eval=
3263shlibpath_var=
3264shlibpath_overrides_runpath=unknown
3265version_type=none
3266dynamic_linker="$host_os ld.so"
3267sys_lib_dlsearch_path_spec="/lib /usr/lib"
3268need_lib_prefix=unknown
3269hardcode_into_libs=no
3270
3271# when you set need_version to no, make sure it does not cause -set_version
3272# flags to be left without arguments
3273need_version=unknown
3274
3275case $host_os in
3276aix3*)
3277  version_type=linux # correct to gnu/linux during the next big refactor
3278  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3279  shlibpath_var=LIBPATH
3280
3281  # AIX 3 has no versioning support, so we append a major version to the name.
3282  soname_spec='${libname}${release}${shared_ext}$major'
3283  ;;
3284
3285aix[[4-9]]*)
3286  version_type=linux # correct to gnu/linux during the next big refactor
3287  need_lib_prefix=no
3288  need_version=no
3289  hardcode_into_libs=yes
3290  if test "$host_cpu" = ia64; then
3291    # AIX 5 supports IA64
3292    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3293    shlibpath_var=LD_LIBRARY_PATH
3294  else
3295    # With GCC up to 2.95.x, collect2 would create an import file
3296    # for dependence libraries.  The import file would start with
3297    # the line `#! .'.  This would cause the generated library to
3298    # depend on `.', always an invalid library.  This was fixed in
3299    # development snapshots of GCC prior to 3.0.
3300    case $host_os in
3301      aix4 | aix4.[[01]] | aix4.[[01]].*)
3302      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3303	   echo ' yes '
3304	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3305	:
3306      else
3307	can_build_shared=no
3308      fi
3309      ;;
3310    esac
3311    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3312    # soname into executable. Probably we can add versioning support to
3313    # collect2, so additional links can be useful in future.
3314    if test "$aix_use_runtimelinking" = yes; then
3315      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3316      # instead of lib<name>.a to let people know that these are not
3317      # typical AIX shared libraries.
3318      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3319    else
3320      # We preserve .a as extension for shared libraries through AIX4.2
3321      # and later when we are not doing run time linking.
3322      library_names_spec='${libname}${release}.a $libname.a'
3323      soname_spec='${libname}${release}${shared_ext}$major'
3324    fi
3325    shlibpath_var=LIBPATH
3326  fi
3327  ;;
3328
3329amigaos*)
3330  case $host_cpu in
3331  powerpc)
3332    # Since July 2007 AmigaOS4 officially supports .so libraries.
3333    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3334    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3335    ;;
3336  m68k)
3337    library_names_spec='$libname.ixlibrary $libname.a'
3338    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3339    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
3340    ;;
3341  esac
3342  ;;
3343
3344beos*)
3345  library_names_spec='${libname}${shared_ext}'
3346  dynamic_linker="$host_os ld.so"
3347  shlibpath_var=LIBRARY_PATH
3348  ;;
3349
3350bsdi[[45]]*)
3351  version_type=linux # correct to gnu/linux during the next big refactor
3352  need_version=no
3353  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3354  soname_spec='${libname}${release}${shared_ext}$major'
3355  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3356  shlibpath_var=LD_LIBRARY_PATH
3357  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3358  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3359  # the default ld.so.conf also contains /usr/contrib/lib and
3360  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3361  # libtool to hard-code these into programs
3362  ;;
3363
3364cygwin* | mingw* | pw32* | cegcc*)
3365  version_type=windows
3366  shrext_cmds=".dll"
3367  need_version=no
3368  need_lib_prefix=no
3369
3370  case $GCC,$cc_basename in
3371  yes,*)
3372    # gcc
3373    library_names_spec='$libname.dll.a'
3374    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3375    postinstall_cmds='base_file=`basename \${file}`~
3376      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3377      dldir=$destdir/`dirname \$dlpath`~
3378      test -d \$dldir || mkdir -p \$dldir~
3379      $install_prog $dir/$dlname \$dldir/$dlname~
3380      chmod a+x \$dldir/$dlname~
3381      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3382        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3383      fi'
3384    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3385      dlpath=$dir/\$dldll~
3386       $RM \$dlpath'
3387    shlibpath_overrides_runpath=yes
3388
3389    case $host_os in
3390    cygwin*)
3391      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3392      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3393m4_if([$1], [],[
3394      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3395      ;;
3396    mingw* | cegcc*)
3397      # MinGW DLLs use traditional 'lib' prefix
3398      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3399      ;;
3400    pw32*)
3401      # pw32 DLLs use 'pw' prefix rather than 'lib'
3402      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3403      ;;
3404    esac
3405    dynamic_linker='Win32 ld.exe'
3406    ;;
3407
3408  *,cl*)
3409    # Native MSVC
3410    libname_spec='$name'
3411    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3412    library_names_spec='${libname}.dll.lib'
3413
3414    case $build_os in
3415    mingw*)
3416      sys_lib_search_path_spec=
3417      lt_save_ifs=$IFS
3418      IFS=';'
3419      for lt_path in $LIB
3420      do
3421        IFS=$lt_save_ifs
3422        # Let DOS variable expansion print the short 8.3 style file name.
3423        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3424        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3425      done
3426      IFS=$lt_save_ifs
3427      # Convert to MSYS style.
3428      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3429      ;;
3430    cygwin*)
3431      # Convert to unix form, then to dos form, then back to unix form
3432      # but this time dos style (no spaces!) so that the unix form looks
3433      # like /cygdrive/c/PROGRA~1:/cygdr...
3434      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3435      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3436      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3437      ;;
3438    *)
3439      sys_lib_search_path_spec="$LIB"
3440      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3441        # It is most probably a Windows format PATH.
3442        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3443      else
3444        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3445      fi
3446      # FIXME: find the short name or the path components, as spaces are
3447      # common. (e.g. "Program Files" -> "PROGRA~1")
3448      ;;
3449    esac
3450
3451    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3452    postinstall_cmds='base_file=`basename \${file}`~
3453      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3454      dldir=$destdir/`dirname \$dlpath`~
3455      test -d \$dldir || mkdir -p \$dldir~
3456      $install_prog $dir/$dlname \$dldir/$dlname'
3457    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3458      dlpath=$dir/\$dldll~
3459       $RM \$dlpath'
3460    shlibpath_overrides_runpath=yes
3461    dynamic_linker='Win32 link.exe'
3462    ;;
3463
3464  *)
3465    # Assume MSVC wrapper
3466    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3467    dynamic_linker='Win32 ld.exe'
3468    ;;
3469  esac
3470  # FIXME: first we should search . and the directory the executable is in
3471  shlibpath_var=PATH
3472  ;;
3473
3474darwin* | rhapsody*)
3475  dynamic_linker="$host_os dyld"
3476  version_type=darwin
3477  need_lib_prefix=no
3478  need_version=no
3479  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3480  soname_spec='${libname}${release}${major}$shared_ext'
3481  shlibpath_overrides_runpath=yes
3482  shlibpath_var=DYLD_LIBRARY_PATH
3483  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3484m4_if([$1], [],[
3485  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3486  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3487  ;;
3488
3489dgux*)
3490  version_type=linux # correct to gnu/linux during the next big refactor
3491  need_lib_prefix=no
3492  need_version=no
3493  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3494  soname_spec='${libname}${release}${shared_ext}$major'
3495  shlibpath_var=LD_LIBRARY_PATH
3496  ;;
3497
3498freebsd* | dragonfly*)
3499  # DragonFly does not have aout.  When/if they implement a new
3500  # versioning mechanism, adjust this.
3501  if test -x /usr/bin/objformat; then
3502    objformat=`/usr/bin/objformat`
3503  else
3504    case $host_os in
3505    freebsd[[23]].*) objformat=aout ;;
3506    *) objformat=elf ;;
3507    esac
3508  fi
3509  version_type=freebsd-$objformat
3510  case $version_type in
3511    freebsd-elf*)
3512      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3513      need_version=no
3514      need_lib_prefix=no
3515      ;;
3516    freebsd-*)
3517      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3518      need_version=yes
3519      ;;
3520  esac
3521  shlibpath_var=LD_LIBRARY_PATH
3522  case $host_os in
3523  freebsd2.*)
3524    shlibpath_overrides_runpath=yes
3525    ;;
3526  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3527    shlibpath_overrides_runpath=yes
3528    hardcode_into_libs=yes
3529    ;;
3530  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3531  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3532    shlibpath_overrides_runpath=no
3533    hardcode_into_libs=yes
3534    ;;
3535  *) # from 4.6 on, and DragonFly
3536    shlibpath_overrides_runpath=yes
3537    hardcode_into_libs=yes
3538    ;;
3539  esac
3540  ;;
3541
3542gnu*)
3543  version_type=linux # correct to gnu/linux during the next big refactor
3544  need_lib_prefix=no
3545  need_version=no
3546  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3547  soname_spec='${libname}${release}${shared_ext}$major'
3548  shlibpath_var=LD_LIBRARY_PATH
3549  shlibpath_overrides_runpath=no
3550  hardcode_into_libs=yes
3551  ;;
3552
3553haiku*)
3554  version_type=linux # correct to gnu/linux during the next big refactor
3555  need_lib_prefix=no
3556  need_version=no
3557  dynamic_linker="$host_os runtime_loader"
3558  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3559  soname_spec='${libname}${release}${shared_ext}$major'
3560  shlibpath_var=LIBRARY_PATH
3561  shlibpath_overrides_runpath=yes
3562  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3563  hardcode_into_libs=yes
3564  ;;
3565
3566hpux9* | hpux10* | hpux11*)
3567  # Give a soname corresponding to the major version so that dld.sl refuses to
3568  # link against other versions.
3569  version_type=sunos
3570  need_lib_prefix=no
3571  need_version=no
3572  case $host_cpu in
3573  ia64*)
3574    shrext_cmds='.so'
3575    hardcode_into_libs=yes
3576    dynamic_linker="$host_os dld.so"
3577    shlibpath_var=LD_LIBRARY_PATH
3578    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3579    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3580    soname_spec='${libname}${release}${shared_ext}$major'
3581    if test "X$HPUX_IA64_MODE" = X32; then
3582      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3583    else
3584      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3585    fi
3586    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3587    ;;
3588  hppa*64*)
3589    shrext_cmds='.sl'
3590    hardcode_into_libs=yes
3591    dynamic_linker="$host_os dld.sl"
3592    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3593    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3594    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3595    soname_spec='${libname}${release}${shared_ext}$major'
3596    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3597    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3598    ;;
3599  *)
3600    shrext_cmds='.sl'
3601    dynamic_linker="$host_os dld.sl"
3602    shlibpath_var=SHLIB_PATH
3603    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3604    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3605    soname_spec='${libname}${release}${shared_ext}$major'
3606    ;;
3607  esac
3608  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3609  postinstall_cmds='chmod 555 $lib'
3610  # or fails outright, so override atomically:
3611  install_override_mode=555
3612  ;;
3613
3614interix[[3-9]]*)
3615  version_type=linux # correct to gnu/linux during the next big refactor
3616  need_lib_prefix=no
3617  need_version=no
3618  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3619  soname_spec='${libname}${release}${shared_ext}$major'
3620  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3621  shlibpath_var=LD_LIBRARY_PATH
3622  shlibpath_overrides_runpath=no
3623  hardcode_into_libs=yes
3624  ;;
3625
3626irix5* | irix6* | nonstopux*)
3627  case $host_os in
3628    nonstopux*) version_type=nonstopux ;;
3629    *)
3630	if test "$lt_cv_prog_gnu_ld" = yes; then
3631		version_type=linux # correct to gnu/linux during the next big refactor
3632	else
3633		version_type=irix
3634	fi ;;
3635  esac
3636  need_lib_prefix=no
3637  need_version=no
3638  soname_spec='${libname}${release}${shared_ext}$major'
3639  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3640  case $host_os in
3641  irix5* | nonstopux*)
3642    libsuff= shlibsuff=
3643    ;;
3644  *)
3645    case $LD in # libtool.m4 will add one of these switches to LD
3646    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3647      libsuff= shlibsuff= libmagic=32-bit;;
3648    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3649      libsuff=32 shlibsuff=N32 libmagic=N32;;
3650    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3651      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3652    *) libsuff= shlibsuff= libmagic=never-match;;
3653    esac
3654    ;;
3655  esac
3656  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3657  shlibpath_overrides_runpath=no
3658  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3659  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3660  hardcode_into_libs=yes
3661  ;;
3662
3663# No shared lib support for Linux oldld, aout, or coff.
3664linux*oldld* | linux*aout* | linux*coff*)
3665  dynamic_linker=no
3666  ;;
3667
3668# This must be glibc/ELF.
3669linux* | k*bsd*-gnu | kopensolaris*-gnu)
3670  version_type=linux # correct to gnu/linux during the next big refactor
3671  need_lib_prefix=no
3672  need_version=no
3673  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3674  soname_spec='${libname}${release}${shared_ext}$major'
3675  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3676  shlibpath_var=LD_LIBRARY_PATH
3677  shlibpath_overrides_runpath=no
3678
3679  # Some binutils ld are patched to set DT_RUNPATH
3680  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3681    [lt_cv_shlibpath_overrides_runpath=no
3682    save_LDFLAGS=$LDFLAGS
3683    save_libdir=$libdir
3684    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3685	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3686    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3687      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3688	 [lt_cv_shlibpath_overrides_runpath=yes])])
3689    LDFLAGS=$save_LDFLAGS
3690    libdir=$save_libdir
3691    ])
3692  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3693
3694  # This implies no fast_install, which is unacceptable.
3695  # Some rework will be needed to allow for fast_install
3696  # before this can be enabled.
3697  hardcode_into_libs=yes
3698
3699  # Add ABI-specific directories to the system library path.
3700  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
3701
3702  # Append ld.so.conf contents to the search path
3703  if test -f /etc/ld.so.conf; then
3704    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
3705    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
3706
3707  fi
3708
3709  # We used to test for /lib/ld.so.1 and disable shared libraries on
3710  # powerpc, because MkLinux only supported shared libraries with the
3711  # GNU dynamic linker.  Since this was broken with cross compilers,
3712  # most powerpc-linux boxes support dynamic linking these days and
3713  # people can always --disable-shared, the test was removed, and we
3714  # assume the GNU/Linux dynamic linker is in use.
3715  dynamic_linker='GNU/Linux ld.so'
3716  ;;
3717
3718netbsd*)
3719  version_type=sunos
3720  need_lib_prefix=no
3721  need_version=no
3722  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3723    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3724    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3725    dynamic_linker='NetBSD (a.out) ld.so'
3726  else
3727    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3728    soname_spec='${libname}${release}${shared_ext}$major'
3729    dynamic_linker='NetBSD ld.elf_so'
3730  fi
3731  shlibpath_var=LD_LIBRARY_PATH
3732  shlibpath_overrides_runpath=yes
3733  hardcode_into_libs=yes
3734  ;;
3735
3736newsos6)
3737  version_type=linux # correct to gnu/linux during the next big refactor
3738  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3739  shlibpath_var=LD_LIBRARY_PATH
3740  shlibpath_overrides_runpath=yes
3741  ;;
3742
3743*nto* | *qnx*)
3744  version_type=qnx
3745  need_lib_prefix=no
3746  need_version=no
3747  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3748  soname_spec='${libname}${release}${shared_ext}$major'
3749  shlibpath_var=LD_LIBRARY_PATH
3750  shlibpath_overrides_runpath=no
3751  hardcode_into_libs=yes
3752  dynamic_linker='ldqnx.so'
3753  ;;
3754
3755openbsd*)
3756  version_type=sunos
3757  sys_lib_dlsearch_path_spec="/usr/lib"
3758  need_lib_prefix=no
3759  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3760  case $host_os in
3761    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3762    *)				need_version=no  ;;
3763  esac
3764  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3765  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3766  shlibpath_var=LD_LIBRARY_PATH
3767  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3768    case $host_os in
3769      openbsd2.[[89]] | openbsd2.[[89]].*)
3770	shlibpath_overrides_runpath=no
3771	;;
3772      *)
3773	shlibpath_overrides_runpath=yes
3774	;;
3775      esac
3776  else
3777    shlibpath_overrides_runpath=yes
3778  fi
3779  ;;
3780
3781os2*)
3782  libname_spec='$name'
3783  shrext_cmds=".dll"
3784  need_lib_prefix=no
3785  library_names_spec='$libname${shared_ext} $libname.a'
3786  dynamic_linker='OS/2 ld.exe'
3787  shlibpath_var=LIBPATH
3788  ;;
3789
3790osf3* | osf4* | osf5*)
3791  version_type=osf
3792  need_lib_prefix=no
3793  need_version=no
3794  soname_spec='${libname}${release}${shared_ext}$major'
3795  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3796  shlibpath_var=LD_LIBRARY_PATH
3797  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3798  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3799  ;;
3800
3801rdos*)
3802  dynamic_linker=no
3803  ;;
3804
3805solaris*)
3806  version_type=linux # correct to gnu/linux during the next big refactor
3807  need_lib_prefix=no
3808  need_version=no
3809  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3810  soname_spec='${libname}${release}${shared_ext}$major'
3811  shlibpath_var=LD_LIBRARY_PATH
3812  shlibpath_overrides_runpath=yes
3813  hardcode_into_libs=yes
3814  # ldd complains unless libraries are executable
3815  postinstall_cmds='chmod +x $lib'
3816  ;;
3817
3818sunos4*)
3819  version_type=sunos
3820  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3821  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3822  shlibpath_var=LD_LIBRARY_PATH
3823  shlibpath_overrides_runpath=yes
3824  if test "$with_gnu_ld" = yes; then
3825    need_lib_prefix=no
3826  fi
3827  need_version=yes
3828  ;;
3829
3830sysv4 | sysv4.3*)
3831  version_type=linux # correct to gnu/linux during the next big refactor
3832  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3833  soname_spec='${libname}${release}${shared_ext}$major'
3834  shlibpath_var=LD_LIBRARY_PATH
3835  case $host_vendor in
3836    sni)
3837      shlibpath_overrides_runpath=no
3838      need_lib_prefix=no
3839      runpath_var=LD_RUN_PATH
3840      ;;
3841    siemens)
3842      need_lib_prefix=no
3843      ;;
3844    motorola)
3845      need_lib_prefix=no
3846      need_version=no
3847      shlibpath_overrides_runpath=no
3848      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3849      ;;
3850  esac
3851  ;;
3852
3853sysv4*MP*)
3854  if test -d /usr/nec ;then
3855    version_type=linux # correct to gnu/linux during the next big refactor
3856    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3857    soname_spec='$libname${shared_ext}.$major'
3858    shlibpath_var=LD_LIBRARY_PATH
3859  fi
3860  ;;
3861
3862sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3863  version_type=freebsd-elf
3864  need_lib_prefix=no
3865  need_version=no
3866  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3867  soname_spec='${libname}${release}${shared_ext}$major'
3868  shlibpath_var=LD_LIBRARY_PATH
3869  shlibpath_overrides_runpath=yes
3870  hardcode_into_libs=yes
3871  if test "$with_gnu_ld" = yes; then
3872    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3873  else
3874    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3875    case $host_os in
3876      sco3.2v5*)
3877        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3878	;;
3879    esac
3880  fi
3881  sys_lib_dlsearch_path_spec='/usr/lib'
3882  ;;
3883
3884tpf*)
3885  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3886  version_type=linux # correct to gnu/linux during the next big refactor
3887  need_lib_prefix=no
3888  need_version=no
3889  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3890  shlibpath_var=LD_LIBRARY_PATH
3891  shlibpath_overrides_runpath=no
3892  hardcode_into_libs=yes
3893  ;;
3894
3895uts4*)
3896  version_type=linux # correct to gnu/linux during the next big refactor
3897  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3898  soname_spec='${libname}${release}${shared_ext}$major'
3899  shlibpath_var=LD_LIBRARY_PATH
3900  ;;
3901
3902*)
3903  dynamic_linker=no
3904  ;;
3905esac
3906AC_MSG_RESULT([$dynamic_linker])
3907test "$dynamic_linker" = no && can_build_shared=no
3908
3909variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3910if test "$GCC" = yes; then
3911  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3912fi
3913
3914if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3915  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3916fi
3917if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3918  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3919fi
3920
3921_LT_DECL([], [variables_saved_for_relink], [1],
3922    [Variables whose values should be saved in libtool wrapper scripts and
3923    restored at link time])
3924_LT_DECL([], [need_lib_prefix], [0],
3925    [Do we need the "lib" prefix for modules?])
3926_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3927_LT_DECL([], [version_type], [0], [Library versioning type])
3928_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3929_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3930_LT_DECL([], [shlibpath_overrides_runpath], [0],
3931    [Is shlibpath searched before the hard-coded library search path?])
3932_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3933_LT_DECL([], [library_names_spec], [1],
3934    [[List of archive names.  First name is the real one, the rest are links.
3935    The last name is the one that the linker finds with -lNAME]])
3936_LT_DECL([], [soname_spec], [1],
3937    [[The coded name of the library, if different from the real name]])
3938_LT_DECL([], [install_override_mode], [1],
3939    [Permission mode override for installation of shared libraries])
3940_LT_DECL([], [postinstall_cmds], [2],
3941    [Command to use after installation of a shared archive])
3942_LT_DECL([], [postuninstall_cmds], [2],
3943    [Command to use after uninstallation of a shared archive])
3944_LT_DECL([], [finish_cmds], [2],
3945    [Commands used to finish a libtool library installation in a directory])
3946_LT_DECL([], [finish_eval], [1],
3947    [[As "finish_cmds", except a single script fragment to be evaled but
3948    not shown]])
3949_LT_DECL([], [hardcode_into_libs], [0],
3950    [Whether we should hardcode library paths into libraries])
3951_LT_DECL([], [sys_lib_search_path_spec], [2],
3952    [Compile-time system search path for libraries])
3953_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3954    [Run-time system search path for libraries])
3955])# _LT_SYS_DYNAMIC_LINKER
3956
3957
3958# _LT_PATH_TOOL_PREFIX(TOOL)
3959# --------------------------
3960# find a file program which can recognize shared library
3961AC_DEFUN([_LT_PATH_TOOL_PREFIX],
3962[m4_require([_LT_DECL_EGREP])dnl
3963AC_MSG_CHECKING([for $1])
3964AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3965[case $MAGIC_CMD in
3966[[\\/*] |  ?:[\\/]*])
3967  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3968  ;;
3969*)
3970  lt_save_MAGIC_CMD="$MAGIC_CMD"
3971  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3972dnl $ac_dummy forces splitting on constant user-supplied paths.
3973dnl POSIX.2 word splitting is done only on the output of word expansions,
3974dnl not every word.  This closes a longstanding sh security hole.
3975  ac_dummy="m4_if([$2], , $PATH, [$2])"
3976  for ac_dir in $ac_dummy; do
3977    IFS="$lt_save_ifs"
3978    test -z "$ac_dir" && ac_dir=.
3979    if test -f $ac_dir/$1; then
3980      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3981      if test -n "$file_magic_test_file"; then
3982	case $deplibs_check_method in
3983	"file_magic "*)
3984	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3985	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3986	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3987	    $EGREP "$file_magic_regex" > /dev/null; then
3988	    :
3989	  else
3990	    cat <<_LT_EOF 1>&2
3991
3992*** Warning: the command libtool uses to detect shared libraries,
3993*** $file_magic_cmd, produces output that libtool cannot recognize.
3994*** The result is that libtool may fail to recognize shared libraries
3995*** as such.  This will affect the creation of libtool libraries that
3996*** depend on shared libraries, but programs linked with such libtool
3997*** libraries will work regardless of this problem.  Nevertheless, you
3998*** may want to report the problem to your system manager and/or to
3999*** bug-libtool@gnu.org
4000
4001_LT_EOF
4002	  fi ;;
4003	esac
4004      fi
4005      break
4006    fi
4007  done
4008  IFS="$lt_save_ifs"
4009  MAGIC_CMD="$lt_save_MAGIC_CMD"
4010  ;;
4011esac])
4012MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4013if test -n "$MAGIC_CMD"; then
4014  AC_MSG_RESULT($MAGIC_CMD)
4015else
4016  AC_MSG_RESULT(no)
4017fi
4018_LT_DECL([], [MAGIC_CMD], [0],
4019	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4020])# _LT_PATH_TOOL_PREFIX
4021
4022# Old name:
4023AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4024dnl aclocal-1.4 backwards compatibility:
4025dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4026
4027
4028# _LT_PATH_MAGIC
4029# --------------
4030# find a file program which can recognize a shared library
4031m4_defun([_LT_PATH_MAGIC],
4032[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4033if test -z "$lt_cv_path_MAGIC_CMD"; then
4034  if test -n "$ac_tool_prefix"; then
4035    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4036  else
4037    MAGIC_CMD=:
4038  fi
4039fi
4040])# _LT_PATH_MAGIC
4041
4042
4043# LT_PATH_LD
4044# ----------
4045# find the pathname to the GNU or non-GNU linker
4046AC_DEFUN([LT_PATH_LD],
4047[AC_REQUIRE([AC_PROG_CC])dnl
4048AC_REQUIRE([AC_CANONICAL_HOST])dnl
4049AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4050m4_require([_LT_DECL_SED])dnl
4051m4_require([_LT_DECL_EGREP])dnl
4052m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4053
4054AC_ARG_WITH([gnu-ld],
4055    [AS_HELP_STRING([--with-gnu-ld],
4056	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4057    [test "$withval" = no || with_gnu_ld=yes],
4058    [with_gnu_ld=no])dnl
4059
4060ac_prog=ld
4061if test "$GCC" = yes; then
4062  # Check if gcc -print-prog-name=ld gives a path.
4063  AC_MSG_CHECKING([for ld used by $CC])
4064  case $host in
4065  *-*-mingw*)
4066    # gcc leaves a trailing carriage return which upsets mingw
4067    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4068  *)
4069    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4070  esac
4071  case $ac_prog in
4072    # Accept absolute paths.
4073    [[\\/]]* | ?:[[\\/]]*)
4074      re_direlt='/[[^/]][[^/]]*/\.\./'
4075      # Canonicalize the pathname of ld
4076      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4077      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4078	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4079      done
4080      test -z "$LD" && LD="$ac_prog"
4081      ;;
4082  "")
4083    # If it fails, then pretend we aren't using GCC.
4084    ac_prog=ld
4085    ;;
4086  *)
4087    # If it is relative, then search for the first ld in PATH.
4088    with_gnu_ld=unknown
4089    ;;
4090  esac
4091elif test "$with_gnu_ld" = yes; then
4092  AC_MSG_CHECKING([for GNU ld])
4093else
4094  AC_MSG_CHECKING([for non-GNU ld])
4095fi
4096AC_CACHE_VAL(lt_cv_path_LD,
4097[if test -z "$LD"; then
4098  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4099  for ac_dir in $PATH; do
4100    IFS="$lt_save_ifs"
4101    test -z "$ac_dir" && ac_dir=.
4102    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4103      lt_cv_path_LD="$ac_dir/$ac_prog"
4104      # Check to see if the program is GNU ld.  I'd rather use --version,
4105      # but apparently some variants of GNU ld only accept -v.
4106      # Break only if it was the GNU/non-GNU ld that we prefer.
4107      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4108      *GNU* | *'with BFD'*)
4109	test "$with_gnu_ld" != no && break
4110	;;
4111      *)
4112	test "$with_gnu_ld" != yes && break
4113	;;
4114      esac
4115    fi
4116  done
4117  IFS="$lt_save_ifs"
4118else
4119  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4120fi])
4121LD="$lt_cv_path_LD"
4122if test -n "$LD"; then
4123  AC_MSG_RESULT($LD)
4124else
4125  AC_MSG_RESULT(no)
4126fi
4127test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4128_LT_PATH_LD_GNU
4129AC_SUBST([LD])
4130
4131_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4132])# LT_PATH_LD
4133
4134# Old names:
4135AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4136AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4137dnl aclocal-1.4 backwards compatibility:
4138dnl AC_DEFUN([AM_PROG_LD], [])
4139dnl AC_DEFUN([AC_PROG_LD], [])
4140
4141
4142# _LT_PATH_LD_GNU
4143#- --------------
4144m4_defun([_LT_PATH_LD_GNU],
4145[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4146[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4147case `$LD -v 2>&1 </dev/null` in
4148*GNU* | *'with BFD'*)
4149  lt_cv_prog_gnu_ld=yes
4150  ;;
4151*)
4152  lt_cv_prog_gnu_ld=no
4153  ;;
4154esac])
4155with_gnu_ld=$lt_cv_prog_gnu_ld
4156])# _LT_PATH_LD_GNU
4157
4158
4159# _LT_CMD_RELOAD
4160# --------------
4161# find reload flag for linker
4162#   -- PORTME Some linkers may need a different reload flag.
4163m4_defun([_LT_CMD_RELOAD],
4164[AC_CACHE_CHECK([for $LD option to reload object files],
4165  lt_cv_ld_reload_flag,
4166  [lt_cv_ld_reload_flag='-r'])
4167reload_flag=$lt_cv_ld_reload_flag
4168case $reload_flag in
4169"" | " "*) ;;
4170*) reload_flag=" $reload_flag" ;;
4171esac
4172reload_cmds='$LD$reload_flag -o $output$reload_objs'
4173case $host_os in
4174  cygwin* | mingw* | pw32* | cegcc*)
4175    if test "$GCC" != yes; then
4176      reload_cmds=false
4177    fi
4178    ;;
4179  darwin*)
4180    if test "$GCC" = yes; then
4181      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4182    else
4183      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4184    fi
4185    ;;
4186esac
4187_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4188_LT_TAGDECL([], [reload_cmds], [2])dnl
4189])# _LT_CMD_RELOAD
4190
4191
4192# _LT_CHECK_MAGIC_METHOD
4193# ----------------------
4194# how to check for library dependencies
4195#  -- PORTME fill in with the dynamic library characteristics
4196m4_defun([_LT_CHECK_MAGIC_METHOD],
4197[m4_require([_LT_DECL_EGREP])
4198m4_require([_LT_DECL_OBJDUMP])
4199AC_CACHE_CHECK([how to recognize dependent libraries],
4200lt_cv_deplibs_check_method,
4201[lt_cv_file_magic_cmd='$MAGIC_CMD'
4202lt_cv_file_magic_test_file=
4203lt_cv_deplibs_check_method='unknown'
4204# Need to set the preceding variable on all platforms that support
4205# interlibrary dependencies.
4206# 'none' -- dependencies not supported.
4207# `unknown' -- same as none, but documents that we really don't know.
4208# 'pass_all' -- all dependencies passed with no checks.
4209# 'test_compile' -- check by making test program.
4210# 'file_magic [[regex]]' -- check by looking for files in library path
4211# which responds to the $file_magic_cmd with a given extended regex.
4212# If you have `file' or equivalent on your system and you're not sure
4213# whether `pass_all' will *always* work, you probably want this one.
4214
4215case $host_os in
4216aix[[4-9]]*)
4217  lt_cv_deplibs_check_method=pass_all
4218  ;;
4219
4220beos*)
4221  lt_cv_deplibs_check_method=pass_all
4222  ;;
4223
4224bsdi[[45]]*)
4225  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4226  lt_cv_file_magic_cmd='/usr/bin/file -L'
4227  lt_cv_file_magic_test_file=/shlib/libc.so
4228  ;;
4229
4230cygwin*)
4231  # func_win32_libid is a shell function defined in ltmain.sh
4232  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4233  lt_cv_file_magic_cmd='func_win32_libid'
4234  ;;
4235
4236mingw* | pw32*)
4237  # Base MSYS/MinGW do not provide the 'file' command needed by
4238  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4239  # unless we find 'file', for example because we are cross-compiling.
4240  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4241  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4242    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4243    lt_cv_file_magic_cmd='func_win32_libid'
4244  else
4245    # Keep this pattern in sync with the one in func_win32_libid.
4246    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4247    lt_cv_file_magic_cmd='$OBJDUMP -f'
4248  fi
4249  ;;
4250
4251cegcc*)
4252  # use the weaker test based on 'objdump'. See mingw*.
4253  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4254  lt_cv_file_magic_cmd='$OBJDUMP -f'
4255  ;;
4256
4257darwin* | rhapsody*)
4258  lt_cv_deplibs_check_method=pass_all
4259  ;;
4260
4261freebsd* | dragonfly*)
4262  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4263    case $host_cpu in
4264    i*86 )
4265      # Not sure whether the presence of OpenBSD here was a mistake.
4266      # Let's accept both of them until this is cleared up.
4267      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4268      lt_cv_file_magic_cmd=/usr/bin/file
4269      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4270      ;;
4271    esac
4272  else
4273    lt_cv_deplibs_check_method=pass_all
4274  fi
4275  ;;
4276
4277gnu*)
4278  lt_cv_deplibs_check_method=pass_all
4279  ;;
4280
4281haiku*)
4282  lt_cv_deplibs_check_method=pass_all
4283  ;;
4284
4285hpux10.20* | hpux11*)
4286  lt_cv_file_magic_cmd=/usr/bin/file
4287  case $host_cpu in
4288  ia64*)
4289    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4290    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4291    ;;
4292  hppa*64*)
4293    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
4294    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4295    ;;
4296  *)
4297    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4298    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4299    ;;
4300  esac
4301  ;;
4302
4303interix[[3-9]]*)
4304  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4305  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4306  ;;
4307
4308irix5* | irix6* | nonstopux*)
4309  case $LD in
4310  *-32|*"-32 ") libmagic=32-bit;;
4311  *-n32|*"-n32 ") libmagic=N32;;
4312  *-64|*"-64 ") libmagic=64-bit;;
4313  *) libmagic=never-match;;
4314  esac
4315  lt_cv_deplibs_check_method=pass_all
4316  ;;
4317
4318# This must be glibc/ELF.
4319linux* | k*bsd*-gnu | kopensolaris*-gnu)
4320  lt_cv_deplibs_check_method=pass_all
4321  ;;
4322
4323netbsd*)
4324  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4325    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4326  else
4327    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4328  fi
4329  ;;
4330
4331newos6*)
4332  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4333  lt_cv_file_magic_cmd=/usr/bin/file
4334  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4335  ;;
4336
4337*nto* | *qnx*)
4338  lt_cv_deplibs_check_method=pass_all
4339  ;;
4340
4341openbsd*)
4342  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4343    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4344  else
4345    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4346  fi
4347  ;;
4348
4349osf3* | osf4* | osf5*)
4350  lt_cv_deplibs_check_method=pass_all
4351  ;;
4352
4353rdos*)
4354  lt_cv_deplibs_check_method=pass_all
4355  ;;
4356
4357solaris*)
4358  lt_cv_deplibs_check_method=pass_all
4359  ;;
4360
4361sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4362  lt_cv_deplibs_check_method=pass_all
4363  ;;
4364
4365sysv4 | sysv4.3*)
4366  case $host_vendor in
4367  motorola)
4368    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
4369    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4370    ;;
4371  ncr)
4372    lt_cv_deplibs_check_method=pass_all
4373    ;;
4374  sequent)
4375    lt_cv_file_magic_cmd='/bin/file'
4376    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4377    ;;
4378  sni)
4379    lt_cv_file_magic_cmd='/bin/file'
4380    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4381    lt_cv_file_magic_test_file=/lib/libc.so
4382    ;;
4383  siemens)
4384    lt_cv_deplibs_check_method=pass_all
4385    ;;
4386  pc)
4387    lt_cv_deplibs_check_method=pass_all
4388    ;;
4389  esac
4390  ;;
4391
4392tpf*)
4393  lt_cv_deplibs_check_method=pass_all
4394  ;;
4395esac
4396])
4397
4398file_magic_glob=
4399want_nocaseglob=no
4400if test "$build" = "$host"; then
4401  case $host_os in
4402  mingw* | pw32*)
4403    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4404      want_nocaseglob=yes
4405    else
4406      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4407    fi
4408    ;;
4409  esac
4410fi
4411
4412file_magic_cmd=$lt_cv_file_magic_cmd
4413deplibs_check_method=$lt_cv_deplibs_check_method
4414test -z "$deplibs_check_method" && deplibs_check_method=unknown
4415
4416_LT_DECL([], [deplibs_check_method], [1],
4417    [Method to check whether dependent libraries are shared objects])
4418_LT_DECL([], [file_magic_cmd], [1],
4419    [Command to use when deplibs_check_method = "file_magic"])
4420_LT_DECL([], [file_magic_glob], [1],
4421    [How to find potential files when deplibs_check_method = "file_magic"])
4422_LT_DECL([], [want_nocaseglob], [1],
4423    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4424])# _LT_CHECK_MAGIC_METHOD
4425
4426
4427# LT_PATH_NM
4428# ----------
4429# find the pathname to a BSD- or MS-compatible name lister
4430AC_DEFUN([LT_PATH_NM],
4431[AC_REQUIRE([AC_PROG_CC])dnl
4432AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4433[if test -n "$NM"; then
4434  # Let the user override the test.
4435  lt_cv_path_NM="$NM"
4436else
4437  lt_nm_to_check="${ac_tool_prefix}nm"
4438  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4439    lt_nm_to_check="$lt_nm_to_check nm"
4440  fi
4441  for lt_tmp_nm in $lt_nm_to_check; do
4442    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4443    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4444      IFS="$lt_save_ifs"
4445      test -z "$ac_dir" && ac_dir=.
4446      tmp_nm="$ac_dir/$lt_tmp_nm"
4447      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4448	# Check to see if the nm accepts a BSD-compat flag.
4449	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4450	#   nm: unknown option "B" ignored
4451	# Tru64's nm complains that /dev/null is an invalid object file
4452	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4453	*/dev/null* | *'Invalid file or object type'*)
4454	  lt_cv_path_NM="$tmp_nm -B"
4455	  break
4456	  ;;
4457	*)
4458	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4459	  */dev/null*)
4460	    lt_cv_path_NM="$tmp_nm -p"
4461	    break
4462	    ;;
4463	  *)
4464	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4465	    continue # so that we can try to find one that supports BSD flags
4466	    ;;
4467	  esac
4468	  ;;
4469	esac
4470      fi
4471    done
4472    IFS="$lt_save_ifs"
4473  done
4474  : ${lt_cv_path_NM=no}
4475fi])
4476if test "$lt_cv_path_NM" != "no"; then
4477  NM="$lt_cv_path_NM"
4478else
4479  # Didn't find any BSD compatible name lister, look for dumpbin.
4480  if test -n "$DUMPBIN"; then :
4481    # Let the user override the test.
4482  else
4483    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4484    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4485    *COFF*)
4486      DUMPBIN="$DUMPBIN -symbols"
4487      ;;
4488    *)
4489      DUMPBIN=:
4490      ;;
4491    esac
4492  fi
4493  AC_SUBST([DUMPBIN])
4494  if test "$DUMPBIN" != ":"; then
4495    NM="$DUMPBIN"
4496  fi
4497fi
4498test -z "$NM" && NM=nm
4499AC_SUBST([NM])
4500_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4501
4502AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4503  [lt_cv_nm_interface="BSD nm"
4504  echo "int some_variable = 0;" > conftest.$ac_ext
4505  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4506  (eval "$ac_compile" 2>conftest.err)
4507  cat conftest.err >&AS_MESSAGE_LOG_FD
4508  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4509  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4510  cat conftest.err >&AS_MESSAGE_LOG_FD
4511  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4512  cat conftest.out >&AS_MESSAGE_LOG_FD
4513  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4514    lt_cv_nm_interface="MS dumpbin"
4515  fi
4516  rm -f conftest*])
4517])# LT_PATH_NM
4518
4519# Old names:
4520AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4521AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4522dnl aclocal-1.4 backwards compatibility:
4523dnl AC_DEFUN([AM_PROG_NM], [])
4524dnl AC_DEFUN([AC_PROG_NM], [])
4525
4526# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4527# --------------------------------
4528# how to determine the name of the shared library
4529# associated with a specific link library.
4530#  -- PORTME fill in with the dynamic library characteristics
4531m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4532[m4_require([_LT_DECL_EGREP])
4533m4_require([_LT_DECL_OBJDUMP])
4534m4_require([_LT_DECL_DLLTOOL])
4535AC_CACHE_CHECK([how to associate runtime and link libraries],
4536lt_cv_sharedlib_from_linklib_cmd,
4537[lt_cv_sharedlib_from_linklib_cmd='unknown'
4538
4539case $host_os in
4540cygwin* | mingw* | pw32* | cegcc*)
4541  # two different shell functions defined in ltmain.sh
4542  # decide which to use based on capabilities of $DLLTOOL
4543  case `$DLLTOOL --help 2>&1` in
4544  *--identify-strict*)
4545    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4546    ;;
4547  *)
4548    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4549    ;;
4550  esac
4551  ;;
4552*)
4553  # fallback: assume linklib IS sharedlib
4554  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4555  ;;
4556esac
4557])
4558sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4559test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4560
4561_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4562    [Command to associate shared and link libraries])
4563])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4564
4565
4566# _LT_PATH_MANIFEST_TOOL
4567# ----------------------
4568# locate the manifest tool
4569m4_defun([_LT_PATH_MANIFEST_TOOL],
4570[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4571test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4572AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4573  [lt_cv_path_mainfest_tool=no
4574  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4575  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4576  cat conftest.err >&AS_MESSAGE_LOG_FD
4577  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4578    lt_cv_path_mainfest_tool=yes
4579  fi
4580  rm -f conftest*])
4581if test "x$lt_cv_path_mainfest_tool" != xyes; then
4582  MANIFEST_TOOL=:
4583fi
4584_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4585])# _LT_PATH_MANIFEST_TOOL
4586
4587
4588# LT_LIB_M
4589# --------
4590# check for math library
4591AC_DEFUN([LT_LIB_M],
4592[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4593LIBM=
4594case $host in
4595*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4596  # These system don't have libm, or don't need it
4597  ;;
4598*-ncr-sysv4.3*)
4599  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4600  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4601  ;;
4602*)
4603  AC_CHECK_LIB(m, cos, LIBM="-lm")
4604  ;;
4605esac
4606AC_SUBST([LIBM])
4607])# LT_LIB_M
4608
4609# Old name:
4610AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4611dnl aclocal-1.4 backwards compatibility:
4612dnl AC_DEFUN([AC_CHECK_LIBM], [])
4613
4614
4615# _LT_COMPILER_NO_RTTI([TAGNAME])
4616# -------------------------------
4617m4_defun([_LT_COMPILER_NO_RTTI],
4618[m4_require([_LT_TAG_COMPILER])dnl
4619
4620_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4621
4622if test "$GCC" = yes; then
4623  case $cc_basename in
4624  nvcc*)
4625    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4626  *)
4627    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4628  esac
4629
4630  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4631    lt_cv_prog_compiler_rtti_exceptions,
4632    [-fno-rtti -fno-exceptions], [],
4633    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4634fi
4635_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4636	[Compiler flag to turn off builtin functions])
4637])# _LT_COMPILER_NO_RTTI
4638
4639
4640# _LT_CMD_GLOBAL_SYMBOLS
4641# ----------------------
4642m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4643[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4644AC_REQUIRE([AC_PROG_CC])dnl
4645AC_REQUIRE([AC_PROG_AWK])dnl
4646AC_REQUIRE([LT_PATH_NM])dnl
4647AC_REQUIRE([LT_PATH_LD])dnl
4648m4_require([_LT_DECL_SED])dnl
4649m4_require([_LT_DECL_EGREP])dnl
4650m4_require([_LT_TAG_COMPILER])dnl
4651
4652# Check for command to grab the raw symbol name followed by C symbol from nm.
4653AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4654AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4655[
4656# These are sane defaults that work on at least a few old systems.
4657# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4658
4659# Character class describing NM global symbol codes.
4660symcode='[[BCDEGRST]]'
4661
4662# Regexp to match symbols that can be accessed directly from C.
4663sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4664
4665# Define system-specific variables.
4666case $host_os in
4667aix*)
4668  symcode='[[BCDT]]'
4669  ;;
4670cygwin* | mingw* | pw32* | cegcc*)
4671  symcode='[[ABCDGISTW]]'
4672  ;;
4673hpux*)
4674  if test "$host_cpu" = ia64; then
4675    symcode='[[ABCDEGRST]]'
4676  fi
4677  ;;
4678irix* | nonstopux*)
4679  symcode='[[BCDEGRST]]'
4680  ;;
4681osf*)
4682  symcode='[[BCDEGQRST]]'
4683  ;;
4684solaris*)
4685  symcode='[[BDRT]]'
4686  ;;
4687sco3.2v5*)
4688  symcode='[[DT]]'
4689  ;;
4690sysv4.2uw2*)
4691  symcode='[[DT]]'
4692  ;;
4693sysv5* | sco5v6* | unixware* | OpenUNIX*)
4694  symcode='[[ABDT]]'
4695  ;;
4696sysv4)
4697  symcode='[[DFNSTU]]'
4698  ;;
4699esac
4700
4701# If we're using GNU nm, then use its standard symbol codes.
4702case `$NM -V 2>&1` in
4703*GNU* | *'with BFD'*)
4704  symcode='[[ABCDGIRSTW]]' ;;
4705esac
4706
4707# Transform an extracted symbol line into a proper C declaration.
4708# Some systems (esp. on ia64) link data and code symbols differently,
4709# so use this general approach.
4710lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4711
4712# Transform an extracted symbol line into symbol name and symbol address
4713lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4714lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
4715
4716# Handle CRLF in mingw tool chain
4717opt_cr=
4718case $build_os in
4719mingw*)
4720  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4721  ;;
4722esac
4723
4724# Try without a prefix underscore, then with it.
4725for ac_symprfx in "" "_"; do
4726
4727  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4728  symxfrm="\\1 $ac_symprfx\\2 \\2"
4729
4730  # Write the raw and C identifiers.
4731  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4732    # Fake it for dumpbin and say T for any non-static function
4733    # and D for any global variable.
4734    # Also find C++ and __fastcall symbols from MSVC++,
4735    # which start with @ or ?.
4736    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4737"     {last_section=section; section=\$ 3};"\
4738"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4739"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4740"     \$ 0!~/External *\|/{next};"\
4741"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4742"     {if(hide[section]) next};"\
4743"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4744"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4745"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4746"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4747"     ' prfx=^$ac_symprfx]"
4748  else
4749    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4750  fi
4751  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4752
4753  # Check to see that the pipe works correctly.
4754  pipe_works=no
4755
4756  rm -f conftest*
4757  cat > conftest.$ac_ext <<_LT_EOF
4758#ifdef __cplusplus
4759extern "C" {
4760#endif
4761char nm_test_var;
4762void nm_test_func(void);
4763void nm_test_func(void){}
4764#ifdef __cplusplus
4765}
4766#endif
4767int main(){nm_test_var='a';nm_test_func();return(0);}
4768_LT_EOF
4769
4770  if AC_TRY_EVAL(ac_compile); then
4771    # Now try to grab the symbols.
4772    nlist=conftest.nm
4773    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4774      # Try sorting and uniquifying the output.
4775      if sort "$nlist" | uniq > "$nlist"T; then
4776	mv -f "$nlist"T "$nlist"
4777      else
4778	rm -f "$nlist"T
4779      fi
4780
4781      # Make sure that we snagged all the symbols we need.
4782      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4783	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4784	  cat <<_LT_EOF > conftest.$ac_ext
4785/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4786#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4787/* DATA imports from DLLs on WIN32 con't be const, because runtime
4788   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4789# define LT@&t@_DLSYM_CONST
4790#elif defined(__osf__)
4791/* This system does not cope well with relocations in const data.  */
4792# define LT@&t@_DLSYM_CONST
4793#else
4794# define LT@&t@_DLSYM_CONST const
4795#endif
4796
4797#ifdef __cplusplus
4798extern "C" {
4799#endif
4800
4801_LT_EOF
4802	  # Now generate the symbol file.
4803	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4804
4805	  cat <<_LT_EOF >> conftest.$ac_ext
4806
4807/* The mapping between symbol names and symbols.  */
4808LT@&t@_DLSYM_CONST struct {
4809  const char *name;
4810  void       *address;
4811}
4812lt__PROGRAM__LTX_preloaded_symbols[[]] =
4813{
4814  { "@PROGRAM@", (void *) 0 },
4815_LT_EOF
4816	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4817	  cat <<\_LT_EOF >> conftest.$ac_ext
4818  {0, (void *) 0}
4819};
4820
4821/* This works around a problem in FreeBSD linker */
4822#ifdef FREEBSD_WORKAROUND
4823static const void *lt_preloaded_setup() {
4824  return lt__PROGRAM__LTX_preloaded_symbols;
4825}
4826#endif
4827
4828#ifdef __cplusplus
4829}
4830#endif
4831_LT_EOF
4832	  # Now try linking the two files.
4833	  mv conftest.$ac_objext conftstm.$ac_objext
4834	  lt_globsym_save_LIBS=$LIBS
4835	  lt_globsym_save_CFLAGS=$CFLAGS
4836	  LIBS="conftstm.$ac_objext"
4837	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4838	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4839	    pipe_works=yes
4840	  fi
4841	  LIBS=$lt_globsym_save_LIBS
4842	  CFLAGS=$lt_globsym_save_CFLAGS
4843	else
4844	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4845	fi
4846      else
4847	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4848      fi
4849    else
4850      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4851    fi
4852  else
4853    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4854    cat conftest.$ac_ext >&5
4855  fi
4856  rm -rf conftest* conftst*
4857
4858  # Do not use the global_symbol_pipe unless it works.
4859  if test "$pipe_works" = yes; then
4860    break
4861  else
4862    lt_cv_sys_global_symbol_pipe=
4863  fi
4864done
4865])
4866if test -z "$lt_cv_sys_global_symbol_pipe"; then
4867  lt_cv_sys_global_symbol_to_cdecl=
4868fi
4869if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4870  AC_MSG_RESULT(failed)
4871else
4872  AC_MSG_RESULT(ok)
4873fi
4874
4875# Response file support.
4876if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4877  nm_file_list_spec='@'
4878elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4879  nm_file_list_spec='@'
4880fi
4881
4882_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4883    [Take the output of nm and produce a listing of raw symbols and C names])
4884_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4885    [Transform the output of nm in a proper C declaration])
4886_LT_DECL([global_symbol_to_c_name_address],
4887    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4888    [Transform the output of nm in a C name address pair])
4889_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4890    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4891    [Transform the output of nm in a C name address pair when lib prefix is needed])
4892_LT_DECL([], [nm_file_list_spec], [1],
4893    [Specify filename containing input files for $NM])
4894]) # _LT_CMD_GLOBAL_SYMBOLS
4895
4896
4897# _LT_COMPILER_PIC([TAGNAME])
4898# ---------------------------
4899m4_defun([_LT_COMPILER_PIC],
4900[m4_require([_LT_TAG_COMPILER])dnl
4901_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4902_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4903_LT_TAGVAR(lt_prog_compiler_static, $1)=
4904
4905m4_if([$1], [CXX], [
4906  # C++ specific cases for pic, static, wl, etc.
4907  if test "$GXX" = yes; then
4908    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4909    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4910
4911    case $host_os in
4912    aix*)
4913      # All AIX code is PIC.
4914      if test "$host_cpu" = ia64; then
4915	# AIX 5 now supports IA64 processor
4916	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4917      fi
4918      ;;
4919
4920    amigaos*)
4921      case $host_cpu in
4922      powerpc)
4923            # see comment about AmigaOS4 .so support
4924            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4925        ;;
4926      m68k)
4927            # FIXME: we need at least 68020 code to build shared libraries, but
4928            # adding the `-m68020' flag to GCC prevents building anything better,
4929            # like `-m68040'.
4930            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4931        ;;
4932      esac
4933      ;;
4934
4935    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4936      # PIC is the default for these OSes.
4937      ;;
4938    mingw* | cygwin* | os2* | pw32* | cegcc*)
4939      # This hack is so that the source file can tell whether it is being
4940      # built for inclusion in a dll (and should export symbols for example).
4941      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4942      # (--disable-auto-import) libraries
4943      m4_if([$1], [GCJ], [],
4944	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4945      ;;
4946    darwin* | rhapsody*)
4947      # PIC is the default on this platform
4948      # Common symbols not allowed in MH_DYLIB files
4949      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4950      ;;
4951    *djgpp*)
4952      # DJGPP does not support shared libraries at all
4953      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4954      ;;
4955    haiku*)
4956      # PIC is the default for Haiku.
4957      # The "-static" flag exists, but is broken.
4958      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4959      ;;
4960    interix[[3-9]]*)
4961      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4962      # Instead, we relocate shared libraries at runtime.
4963      ;;
4964    sysv4*MP*)
4965      if test -d /usr/nec; then
4966	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4967      fi
4968      ;;
4969    hpux*)
4970      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4971      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4972      # sets the default TLS model and affects inlining.
4973      case $host_cpu in
4974      hppa*64*)
4975	;;
4976      *)
4977	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4978	;;
4979      esac
4980      ;;
4981    *qnx* | *nto*)
4982      # QNX uses GNU C++, but need to define -shared option too, otherwise
4983      # it will coredump.
4984      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4985      ;;
4986    *)
4987      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4988      ;;
4989    esac
4990  else
4991    case $host_os in
4992      aix[[4-9]]*)
4993	# All AIX code is PIC.
4994	if test "$host_cpu" = ia64; then
4995	  # AIX 5 now supports IA64 processor
4996	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4997	else
4998	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4999	fi
5000	;;
5001      chorus*)
5002	case $cc_basename in
5003	cxch68*)
5004	  # Green Hills C++ Compiler
5005	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
5006	  ;;
5007	esac
5008	;;
5009      mingw* | cygwin* | os2* | pw32* | cegcc*)
5010	# This hack is so that the source file can tell whether it is being
5011	# built for inclusion in a dll (and should export symbols for example).
5012	m4_if([$1], [GCJ], [],
5013	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5014	;;
5015      dgux*)
5016	case $cc_basename in
5017	  ec++*)
5018	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5019	    ;;
5020	  ghcx*)
5021	    # Green Hills C++ Compiler
5022	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5023	    ;;
5024	  *)
5025	    ;;
5026	esac
5027	;;
5028      freebsd* | dragonfly*)
5029	# FreeBSD uses GNU C++
5030	;;
5031      hpux9* | hpux10* | hpux11*)
5032	case $cc_basename in
5033	  CC*)
5034	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5035	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5036	    if test "$host_cpu" != ia64; then
5037	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5038	    fi
5039	    ;;
5040	  aCC*)
5041	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5042	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5043	    case $host_cpu in
5044	    hppa*64*|ia64*)
5045	      # +Z the default
5046	      ;;
5047	    *)
5048	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5049	      ;;
5050	    esac
5051	    ;;
5052	  *)
5053	    ;;
5054	esac
5055	;;
5056      interix*)
5057	# This is c89, which is MS Visual C++ (no shared libs)
5058	# Anyone wants to do a port?
5059	;;
5060      irix5* | irix6* | nonstopux*)
5061	case $cc_basename in
5062	  CC*)
5063	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5064	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5065	    # CC pic flag -KPIC is the default.
5066	    ;;
5067	  *)
5068	    ;;
5069	esac
5070	;;
5071      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5072	case $cc_basename in
5073	  KCC*)
5074	    # KAI C++ Compiler
5075	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5076	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5077	    ;;
5078	  ecpc* )
5079	    # old Intel C++ for x86_64 which still supported -KPIC.
5080	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5081	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5082	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5083	    ;;
5084	  icpc* )
5085	    # Intel C++, used to be incompatible with GCC.
5086	    # ICC 10 doesn't accept -KPIC any more.
5087	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5088	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5089	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5090	    ;;
5091	  pgCC* | pgcpp*)
5092	    # Portland Group C++ compiler
5093	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5094	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5095	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5096	    ;;
5097	  cxx*)
5098	    # Compaq C++
5099	    # Make sure the PIC flag is empty.  It appears that all Alpha
5100	    # Linux and Compaq Tru64 Unix objects are PIC.
5101	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5102	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5103	    ;;
5104	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5105	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5106	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5107	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5108	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5109	    ;;
5110	  *)
5111	    case `$CC -V 2>&1 | sed 5q` in
5112	    *Sun\ C*)
5113	      # Sun C++ 5.9
5114	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5115	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5116	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5117	      ;;
5118	    esac
5119	    ;;
5120	esac
5121	;;
5122      lynxos*)
5123	;;
5124      m88k*)
5125	;;
5126      mvs*)
5127	case $cc_basename in
5128	  cxx*)
5129	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5130	    ;;
5131	  *)
5132	    ;;
5133	esac
5134	;;
5135      netbsd*)
5136	;;
5137      *qnx* | *nto*)
5138        # QNX uses GNU C++, but need to define -shared option too, otherwise
5139        # it will coredump.
5140        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5141        ;;
5142      osf3* | osf4* | osf5*)
5143	case $cc_basename in
5144	  KCC*)
5145	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5146	    ;;
5147	  RCC*)
5148	    # Rational C++ 2.4.1
5149	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5150	    ;;
5151	  cxx*)
5152	    # Digital/Compaq C++
5153	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5154	    # Make sure the PIC flag is empty.  It appears that all Alpha
5155	    # Linux and Compaq Tru64 Unix objects are PIC.
5156	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5157	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5158	    ;;
5159	  *)
5160	    ;;
5161	esac
5162	;;
5163      psos*)
5164	;;
5165      solaris*)
5166	case $cc_basename in
5167	  CC* | sunCC*)
5168	    # Sun C++ 4.2, 5.x and Centerline C++
5169	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5170	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5171	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5172	    ;;
5173	  gcx*)
5174	    # Green Hills C++ Compiler
5175	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5176	    ;;
5177	  *)
5178	    ;;
5179	esac
5180	;;
5181      sunos4*)
5182	case $cc_basename in
5183	  CC*)
5184	    # Sun C++ 4.x
5185	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5186	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5187	    ;;
5188	  lcc*)
5189	    # Lucid
5190	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5191	    ;;
5192	  *)
5193	    ;;
5194	esac
5195	;;
5196      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5197	case $cc_basename in
5198	  CC*)
5199	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5200	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5201	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5202	    ;;
5203	esac
5204	;;
5205      tandem*)
5206	case $cc_basename in
5207	  NCC*)
5208	    # NonStop-UX NCC 3.20
5209	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5210	    ;;
5211	  *)
5212	    ;;
5213	esac
5214	;;
5215      vxworks*)
5216	;;
5217      *)
5218	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5219	;;
5220    esac
5221  fi
5222],
5223[
5224  if test "$GCC" = yes; then
5225    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5226    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5227
5228    case $host_os in
5229      aix*)
5230      # All AIX code is PIC.
5231      if test "$host_cpu" = ia64; then
5232	# AIX 5 now supports IA64 processor
5233	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5234      fi
5235      ;;
5236
5237    amigaos*)
5238      case $host_cpu in
5239      powerpc)
5240            # see comment about AmigaOS4 .so support
5241            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5242        ;;
5243      m68k)
5244            # FIXME: we need at least 68020 code to build shared libraries, but
5245            # adding the `-m68020' flag to GCC prevents building anything better,
5246            # like `-m68040'.
5247            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5248        ;;
5249      esac
5250      ;;
5251
5252    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5253      # PIC is the default for these OSes.
5254      ;;
5255
5256    mingw* | cygwin* | pw32* | os2* | cegcc*)
5257      # This hack is so that the source file can tell whether it is being
5258      # built for inclusion in a dll (and should export symbols for example).
5259      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5260      # (--disable-auto-import) libraries
5261      m4_if([$1], [GCJ], [],
5262	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5263      ;;
5264
5265    darwin* | rhapsody*)
5266      # PIC is the default on this platform
5267      # Common symbols not allowed in MH_DYLIB files
5268      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5269      ;;
5270
5271    haiku*)
5272      # PIC is the default for Haiku.
5273      # The "-static" flag exists, but is broken.
5274      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5275      ;;
5276
5277    hpux*)
5278      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5279      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5280      # sets the default TLS model and affects inlining.
5281      case $host_cpu in
5282      hppa*64*)
5283	# +Z the default
5284	;;
5285      *)
5286	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5287	;;
5288      esac
5289      ;;
5290
5291    interix[[3-9]]*)
5292      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5293      # Instead, we relocate shared libraries at runtime.
5294      ;;
5295
5296    msdosdjgpp*)
5297      # Just because we use GCC doesn't mean we suddenly get shared libraries
5298      # on systems that don't support them.
5299      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5300      enable_shared=no
5301      ;;
5302
5303    *nto* | *qnx*)
5304      # QNX uses GNU C++, but need to define -shared option too, otherwise
5305      # it will coredump.
5306      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5307      ;;
5308
5309    sysv4*MP*)
5310      if test -d /usr/nec; then
5311	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5312      fi
5313      ;;
5314
5315    *)
5316      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5317      ;;
5318    esac
5319
5320    case $cc_basename in
5321    nvcc*) # Cuda Compiler Driver 2.2
5322      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5323      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5324        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5325      fi
5326      ;;
5327    esac
5328  else
5329    # PORTME Check for flag to pass linker flags through the system compiler.
5330    case $host_os in
5331    aix*)
5332      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5333      if test "$host_cpu" = ia64; then
5334	# AIX 5 now supports IA64 processor
5335	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5336      else
5337	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5338      fi
5339      ;;
5340
5341    mingw* | cygwin* | pw32* | os2* | cegcc*)
5342      # This hack is so that the source file can tell whether it is being
5343      # built for inclusion in a dll (and should export symbols for example).
5344      m4_if([$1], [GCJ], [],
5345	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5346      ;;
5347
5348    hpux9* | hpux10* | hpux11*)
5349      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5350      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5351      # not for PA HP-UX.
5352      case $host_cpu in
5353      hppa*64*|ia64*)
5354	# +Z the default
5355	;;
5356      *)
5357	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5358	;;
5359      esac
5360      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5361      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5362      ;;
5363
5364    irix5* | irix6* | nonstopux*)
5365      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5366      # PIC (with -KPIC) is the default.
5367      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5368      ;;
5369
5370    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5371      case $cc_basename in
5372      # old Intel for x86_64 which still supported -KPIC.
5373      ecc*)
5374	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5375	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5376	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5377        ;;
5378      # icc used to be incompatible with GCC.
5379      # ICC 10 doesn't accept -KPIC any more.
5380      icc* | ifort*)
5381	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5382	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5383	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5384        ;;
5385      # Lahey Fortran 8.1.
5386      lf95*)
5387	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5388	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5389	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5390	;;
5391      nagfor*)
5392	# NAG Fortran compiler
5393	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5394	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5395	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5396	;;
5397      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5398        # Portland Group compilers (*not* the Pentium gcc compiler,
5399	# which looks to be a dead project)
5400	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5401	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5402	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5403        ;;
5404      ccc*)
5405        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5406        # All Alpha code is PIC.
5407        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5408        ;;
5409      xl* | bgxl* | bgf* | mpixl*)
5410	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5411	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5412	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5413	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5414	;;
5415      *)
5416	case `$CC -V 2>&1 | sed 5q` in
5417	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5418	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5419	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5420	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5421	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5422	  ;;
5423	*Sun\ F* | *Sun*Fortran*)
5424	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5425	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5426	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5427	  ;;
5428	*Sun\ C*)
5429	  # Sun C 5.9
5430	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5431	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5432	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5433	  ;;
5434        *Intel*\ [[CF]]*Compiler*)
5435	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5436	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5437	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5438	  ;;
5439	*Portland\ Group*)
5440	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5441	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5442	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5443	  ;;
5444	esac
5445	;;
5446      esac
5447      ;;
5448
5449    newsos6)
5450      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5451      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5452      ;;
5453
5454    *nto* | *qnx*)
5455      # QNX uses GNU C++, but need to define -shared option too, otherwise
5456      # it will coredump.
5457      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5458      ;;
5459
5460    osf3* | osf4* | osf5*)
5461      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5462      # All OSF/1 code is PIC.
5463      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5464      ;;
5465
5466    rdos*)
5467      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5468      ;;
5469
5470    solaris*)
5471      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5472      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5473      case $cc_basename in
5474      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5475	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5476      *)
5477	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5478      esac
5479      ;;
5480
5481    sunos4*)
5482      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5483      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5484      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5485      ;;
5486
5487    sysv4 | sysv4.2uw2* | sysv4.3*)
5488      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5489      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5490      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5491      ;;
5492
5493    sysv4*MP*)
5494      if test -d /usr/nec ;then
5495	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5496	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5497      fi
5498      ;;
5499
5500    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5501      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5502      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5503      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5504      ;;
5505
5506    unicos*)
5507      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5508      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5509      ;;
5510
5511    uts4*)
5512      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5513      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5514      ;;
5515
5516    *)
5517      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5518      ;;
5519    esac
5520  fi
5521])
5522case $host_os in
5523  # For platforms which do not support PIC, -DPIC is meaningless:
5524  *djgpp*)
5525    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5526    ;;
5527  *)
5528    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5529    ;;
5530esac
5531
5532AC_CACHE_CHECK([for $compiler option to produce PIC],
5533  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5534  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5535_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5536
5537#
5538# Check to make sure the PIC flag actually works.
5539#
5540if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5541  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5542    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5543    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5544    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5545     "" | " "*) ;;
5546     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5547     esac],
5548    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5549     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5550fi
5551_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5552	[Additional compiler flags for building library objects])
5553
5554_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5555	[How to pass a linker flag through the compiler])
5556#
5557# Check to make sure the static flag actually works.
5558#
5559wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5560_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5561  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5562  $lt_tmp_static_flag,
5563  [],
5564  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5565_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5566	[Compiler flag to prevent dynamic linking])
5567])# _LT_COMPILER_PIC
5568
5569
5570# _LT_LINKER_SHLIBS([TAGNAME])
5571# ----------------------------
5572# See if the linker supports building shared libraries.
5573m4_defun([_LT_LINKER_SHLIBS],
5574[AC_REQUIRE([LT_PATH_LD])dnl
5575AC_REQUIRE([LT_PATH_NM])dnl
5576m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5577m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5578m4_require([_LT_DECL_EGREP])dnl
5579m4_require([_LT_DECL_SED])dnl
5580m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5581m4_require([_LT_TAG_COMPILER])dnl
5582AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5583m4_if([$1], [CXX], [
5584  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5585  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5586  case $host_os in
5587  aix[[4-9]]*)
5588    # If we're using GNU nm, then we don't want the "-C" option.
5589    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5590    # Also, AIX nm treats weak defined symbols like other global defined
5591    # symbols, whereas GNU nm marks them as "W".
5592    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5593      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5594    else
5595      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5596    fi
5597    ;;
5598  pw32*)
5599    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5600    ;;
5601  cygwin* | mingw* | cegcc*)
5602    case $cc_basename in
5603    cl*)
5604      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5605      ;;
5606    *)
5607      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5608      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5609      ;;
5610    esac
5611    ;;
5612  *)
5613    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5614    ;;
5615  esac
5616], [
5617  runpath_var=
5618  _LT_TAGVAR(allow_undefined_flag, $1)=
5619  _LT_TAGVAR(always_export_symbols, $1)=no
5620  _LT_TAGVAR(archive_cmds, $1)=
5621  _LT_TAGVAR(archive_expsym_cmds, $1)=
5622  _LT_TAGVAR(compiler_needs_object, $1)=no
5623  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5624  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5625  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5626  _LT_TAGVAR(hardcode_automatic, $1)=no
5627  _LT_TAGVAR(hardcode_direct, $1)=no
5628  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5629  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5630  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5631  _LT_TAGVAR(hardcode_minus_L, $1)=no
5632  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5633  _LT_TAGVAR(inherit_rpath, $1)=no
5634  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5635  _LT_TAGVAR(module_cmds, $1)=
5636  _LT_TAGVAR(module_expsym_cmds, $1)=
5637  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5638  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5639  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5640  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5641  # include_expsyms should be a list of space-separated symbols to be *always*
5642  # included in the symbol list
5643  _LT_TAGVAR(include_expsyms, $1)=
5644  # exclude_expsyms can be an extended regexp of symbols to exclude
5645  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5646  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5647  # as well as any symbol that contains `d'.
5648  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5649  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5650  # platforms (ab)use it in PIC code, but their linkers get confused if
5651  # the symbol is explicitly referenced.  Since portable code cannot
5652  # rely on this symbol name, it's probably fine to never include it in
5653  # preloaded symbol tables.
5654  # Exclude shared library initialization/finalization symbols.
5655dnl Note also adjust exclude_expsyms for C++ above.
5656  extract_expsyms_cmds=
5657
5658  case $host_os in
5659  cygwin* | mingw* | pw32* | cegcc*)
5660    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5661    # When not using gcc, we currently assume that we are using
5662    # Microsoft Visual C++.
5663    if test "$GCC" != yes; then
5664      with_gnu_ld=no
5665    fi
5666    ;;
5667  interix*)
5668    # we just hope/assume this is gcc and not c89 (= MSVC++)
5669    with_gnu_ld=yes
5670    ;;
5671  openbsd*)
5672    with_gnu_ld=no
5673    ;;
5674  esac
5675
5676  _LT_TAGVAR(ld_shlibs, $1)=yes
5677
5678  # On some targets, GNU ld is compatible enough with the native linker
5679  # that we're better off using the native interface for both.
5680  lt_use_gnu_ld_interface=no
5681  if test "$with_gnu_ld" = yes; then
5682    case $host_os in
5683      aix*)
5684	# The AIX port of GNU ld has always aspired to compatibility
5685	# with the native linker.  However, as the warning in the GNU ld
5686	# block says, versions before 2.19.5* couldn't really create working
5687	# shared libraries, regardless of the interface used.
5688	case `$LD -v 2>&1` in
5689	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5690	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5691	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5692	  *)
5693	    lt_use_gnu_ld_interface=yes
5694	    ;;
5695	esac
5696	;;
5697      *)
5698	lt_use_gnu_ld_interface=yes
5699	;;
5700    esac
5701  fi
5702
5703  if test "$lt_use_gnu_ld_interface" = yes; then
5704    # If archive_cmds runs LD, not CC, wlarc should be empty
5705    wlarc='${wl}'
5706
5707    # Set some defaults for GNU ld with shared library support. These
5708    # are reset later if shared libraries are not supported. Putting them
5709    # here allows them to be overridden if necessary.
5710    runpath_var=LD_RUN_PATH
5711    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5712    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5713    # ancient GNU ld didn't support --whole-archive et. al.
5714    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5715      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5716    else
5717      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5718    fi
5719    supports_anon_versioning=no
5720    case `$LD -v 2>&1` in
5721      *GNU\ gold*) supports_anon_versioning=yes ;;
5722      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5723      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5724      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5725      *\ 2.11.*) ;; # other 2.11 versions
5726      *) supports_anon_versioning=yes ;;
5727    esac
5728
5729    # See if GNU ld supports shared libraries.
5730    case $host_os in
5731    aix[[3-9]]*)
5732      # On AIX/PPC, the GNU linker is very broken
5733      if test "$host_cpu" != ia64; then
5734	_LT_TAGVAR(ld_shlibs, $1)=no
5735	cat <<_LT_EOF 1>&2
5736
5737*** Warning: the GNU linker, at least up to release 2.19, is reported
5738*** to be unable to reliably create shared libraries on AIX.
5739*** Therefore, libtool is disabling shared libraries support.  If you
5740*** really care for shared libraries, you may want to install binutils
5741*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5742*** You will then need to restart the configuration process.
5743
5744_LT_EOF
5745      fi
5746      ;;
5747
5748    amigaos*)
5749      case $host_cpu in
5750      powerpc)
5751            # see comment about AmigaOS4 .so support
5752            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5753            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5754        ;;
5755      m68k)
5756            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5757            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5758            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5759        ;;
5760      esac
5761      ;;
5762
5763    beos*)
5764      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5765	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5766	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5767	# support --undefined.  This deserves some investigation.  FIXME
5768	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5769      else
5770	_LT_TAGVAR(ld_shlibs, $1)=no
5771      fi
5772      ;;
5773
5774    cygwin* | mingw* | pw32* | cegcc*)
5775      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5776      # as there is no search path for DLLs.
5777      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5778      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5779      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5780      _LT_TAGVAR(always_export_symbols, $1)=no
5781      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5782      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5783      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5784
5785      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5786        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5787	# If the export-symbols file already is a .def file (1st line
5788	# is EXPORTS), use it as is; otherwise, prepend...
5789	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5790	  cp $export_symbols $output_objdir/$soname.def;
5791	else
5792	  echo EXPORTS > $output_objdir/$soname.def;
5793	  cat $export_symbols >> $output_objdir/$soname.def;
5794	fi~
5795	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5796      else
5797	_LT_TAGVAR(ld_shlibs, $1)=no
5798      fi
5799      ;;
5800
5801    haiku*)
5802      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5803      _LT_TAGVAR(link_all_deplibs, $1)=yes
5804      ;;
5805
5806    interix[[3-9]]*)
5807      _LT_TAGVAR(hardcode_direct, $1)=no
5808      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5809      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5810      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5811      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5812      # Instead, shared libraries are loaded at an image base (0x10000000 by
5813      # default) and relocated if they conflict, which is a slow very memory
5814      # consuming and fragmenting process.  To avoid this, we pick a random,
5815      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5816      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5817      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5818      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5819      ;;
5820
5821    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5822      tmp_diet=no
5823      if test "$host_os" = linux-dietlibc; then
5824	case $cc_basename in
5825	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5826	esac
5827      fi
5828      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5829	 && test "$tmp_diet" = no
5830      then
5831	tmp_addflag=' $pic_flag'
5832	tmp_sharedflag='-shared'
5833	case $cc_basename,$host_cpu in
5834        pgcc*)				# Portland Group C compiler
5835	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5836	  tmp_addflag=' $pic_flag'
5837	  ;;
5838	pgf77* | pgf90* | pgf95* | pgfortran*)
5839					# Portland Group f77 and f90 compilers
5840	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5841	  tmp_addflag=' $pic_flag -Mnomain' ;;
5842	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5843	  tmp_addflag=' -i_dynamic' ;;
5844	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5845	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5846	ifc* | ifort*)			# Intel Fortran compiler
5847	  tmp_addflag=' -nofor_main' ;;
5848	lf95*)				# Lahey Fortran 8.1
5849	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5850	  tmp_sharedflag='--shared' ;;
5851	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5852	  tmp_sharedflag='-qmkshrobj'
5853	  tmp_addflag= ;;
5854	nvcc*)	# Cuda Compiler Driver 2.2
5855	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5856	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5857	  ;;
5858	esac
5859	case `$CC -V 2>&1 | sed 5q` in
5860	*Sun\ C*)			# Sun C 5.9
5861	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5862	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5863	  tmp_sharedflag='-G' ;;
5864	*Sun\ F*)			# Sun Fortran 8.3
5865	  tmp_sharedflag='-G' ;;
5866	esac
5867	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5868
5869        if test "x$supports_anon_versioning" = xyes; then
5870          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5871	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5872	    echo "local: *; };" >> $output_objdir/$libname.ver~
5873	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5874        fi
5875
5876	case $cc_basename in
5877	xlf* | bgf* | bgxlf* | mpixlf*)
5878	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5879	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5880	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5881	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5882	  if test "x$supports_anon_versioning" = xyes; then
5883	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5884	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5885	      echo "local: *; };" >> $output_objdir/$libname.ver~
5886	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5887	  fi
5888	  ;;
5889	esac
5890      else
5891        _LT_TAGVAR(ld_shlibs, $1)=no
5892      fi
5893      ;;
5894
5895    netbsd*)
5896      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5897	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5898	wlarc=
5899      else
5900	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5901	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5902      fi
5903      ;;
5904
5905    solaris*)
5906      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5907	_LT_TAGVAR(ld_shlibs, $1)=no
5908	cat <<_LT_EOF 1>&2
5909
5910*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5911*** create shared libraries on Solaris systems.  Therefore, libtool
5912*** is disabling shared libraries support.  We urge you to upgrade GNU
5913*** binutils to release 2.9.1 or newer.  Another option is to modify
5914*** your PATH or compiler configuration so that the native linker is
5915*** used, and then restart.
5916
5917_LT_EOF
5918      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5919	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5920	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5921      else
5922	_LT_TAGVAR(ld_shlibs, $1)=no
5923      fi
5924      ;;
5925
5926    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5927      case `$LD -v 2>&1` in
5928        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5929	_LT_TAGVAR(ld_shlibs, $1)=no
5930	cat <<_LT_EOF 1>&2
5931
5932*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5933*** reliably create shared libraries on SCO systems.  Therefore, libtool
5934*** is disabling shared libraries support.  We urge you to upgrade GNU
5935*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5936*** your PATH or compiler configuration so that the native linker is
5937*** used, and then restart.
5938
5939_LT_EOF
5940	;;
5941	*)
5942	  # For security reasons, it is highly recommended that you always
5943	  # use absolute paths for naming shared libraries, and exclude the
5944	  # DT_RUNPATH tag from executables and libraries.  But doing so
5945	  # requires that you compile everything twice, which is a pain.
5946	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5947	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5948	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5949	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5950	  else
5951	    _LT_TAGVAR(ld_shlibs, $1)=no
5952	  fi
5953	;;
5954      esac
5955      ;;
5956
5957    sunos4*)
5958      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5959      wlarc=
5960      _LT_TAGVAR(hardcode_direct, $1)=yes
5961      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5962      ;;
5963
5964    *)
5965      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5966	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5967	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5968      else
5969	_LT_TAGVAR(ld_shlibs, $1)=no
5970      fi
5971      ;;
5972    esac
5973
5974    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
5975      runpath_var=
5976      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5977      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5978      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5979    fi
5980  else
5981    # PORTME fill in a description of your system's linker (not GNU ld)
5982    case $host_os in
5983    aix3*)
5984      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5985      _LT_TAGVAR(always_export_symbols, $1)=yes
5986      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
5987      # Note: this linker hardcodes the directories in LIBPATH if there
5988      # are no directories specified by -L.
5989      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5990      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5991	# Neither direct hardcoding nor static linking is supported with a
5992	# broken collect2.
5993	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5994      fi
5995      ;;
5996
5997    aix[[4-9]]*)
5998      if test "$host_cpu" = ia64; then
5999	# On IA64, the linker does run time linking by default, so we don't
6000	# have to do anything special.
6001	aix_use_runtimelinking=no
6002	exp_sym_flag='-Bexport'
6003	no_entry_flag=""
6004      else
6005	# If we're using GNU nm, then we don't want the "-C" option.
6006	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6007	# Also, AIX nm treats weak defined symbols like other global
6008	# defined symbols, whereas GNU nm marks them as "W".
6009	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6010	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6011	else
6012	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6013	fi
6014	aix_use_runtimelinking=no
6015
6016	# Test if we are trying to use run time linking or normal
6017	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6018	# need to do runtime linking.
6019	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6020	  for ld_flag in $LDFLAGS; do
6021	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6022	    aix_use_runtimelinking=yes
6023	    break
6024	  fi
6025	  done
6026	  ;;
6027	esac
6028
6029	exp_sym_flag='-bexport'
6030	no_entry_flag='-bnoentry'
6031      fi
6032
6033      # When large executables or shared objects are built, AIX ld can
6034      # have problems creating the table of contents.  If linking a library
6035      # or program results in "error TOC overflow" add -mminimal-toc to
6036      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6037      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6038
6039      _LT_TAGVAR(archive_cmds, $1)=''
6040      _LT_TAGVAR(hardcode_direct, $1)=yes
6041      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6042      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6043      _LT_TAGVAR(link_all_deplibs, $1)=yes
6044      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6045
6046      if test "$GCC" = yes; then
6047	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6048	# We only want to do this on AIX 4.2 and lower, the check
6049	# below for broken collect2 doesn't work under 4.3+
6050	  collect2name=`${CC} -print-prog-name=collect2`
6051	  if test -f "$collect2name" &&
6052	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6053	  then
6054	  # We have reworked collect2
6055	  :
6056	  else
6057	  # We have old collect2
6058	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6059	  # It fails to find uninstalled libraries when the uninstalled
6060	  # path is not listed in the libpath.  Setting hardcode_minus_L
6061	  # to unsupported forces relinking
6062	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6063	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6064	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6065	  fi
6066	  ;;
6067	esac
6068	shared_flag='-shared'
6069	if test "$aix_use_runtimelinking" = yes; then
6070	  shared_flag="$shared_flag "'${wl}-G'
6071	fi
6072      else
6073	# not using gcc
6074	if test "$host_cpu" = ia64; then
6075	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6076	# chokes on -Wl,-G. The following line is correct:
6077	  shared_flag='-G'
6078	else
6079	  if test "$aix_use_runtimelinking" = yes; then
6080	    shared_flag='${wl}-G'
6081	  else
6082	    shared_flag='${wl}-bM:SRE'
6083	  fi
6084	fi
6085      fi
6086
6087      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6088      # It seems that -bexpall does not export symbols beginning with
6089      # underscore (_), so it is better to generate a list of symbols to export.
6090      _LT_TAGVAR(always_export_symbols, $1)=yes
6091      if test "$aix_use_runtimelinking" = yes; then
6092	# Warning - without using the other runtime loading flags (-brtl),
6093	# -berok will link without error, but may produce a broken library.
6094	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6095        # Determine the default libpath from the value encoded in an
6096        # empty executable.
6097        _LT_SYS_MODULE_PATH_AIX([$1])
6098        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6099        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6100      else
6101	if test "$host_cpu" = ia64; then
6102	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6103	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6104	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
6105	else
6106	 # Determine the default libpath from the value encoded in an
6107	 # empty executable.
6108	 _LT_SYS_MODULE_PATH_AIX([$1])
6109	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6110	  # Warning - without using the other run time loading flags,
6111	  # -berok will link without error, but may produce a broken library.
6112	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6113	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6114	  if test "$with_gnu_ld" = yes; then
6115	    # We only use this code for GNU lds that support --whole-archive.
6116	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6117	  else
6118	    # Exported symbols can be pulled into shared objects from archives
6119	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6120	  fi
6121	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6122	  # This is similar to how AIX traditionally builds its shared libraries.
6123	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6124	fi
6125      fi
6126      ;;
6127
6128    amigaos*)
6129      case $host_cpu in
6130      powerpc)
6131            # see comment about AmigaOS4 .so support
6132            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6133            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6134        ;;
6135      m68k)
6136            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
6137            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6138            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6139        ;;
6140      esac
6141      ;;
6142
6143    bsdi[[45]]*)
6144      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6145      ;;
6146
6147    cygwin* | mingw* | pw32* | cegcc*)
6148      # When not using gcc, we currently assume that we are using
6149      # Microsoft Visual C++.
6150      # hardcode_libdir_flag_spec is actually meaningless, as there is
6151      # no search path for DLLs.
6152      case $cc_basename in
6153      cl*)
6154	# Native MSVC
6155	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6156	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6157	_LT_TAGVAR(always_export_symbols, $1)=yes
6158	_LT_TAGVAR(file_list_spec, $1)='@'
6159	# Tell ltmain to make .lib files, not .a files.
6160	libext=lib
6161	# Tell ltmain to make .dll files, not .so files.
6162	shrext_cmds=".dll"
6163	# FIXME: Setting linknames here is a bad hack.
6164	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6165	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6166	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6167	  else
6168	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6169	  fi~
6170	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6171	  linknames='
6172	# The linker will not automatically build a static lib if we build a DLL.
6173	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6174	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6175	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6176	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
6177	# Don't use ranlib
6178	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6179	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6180	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6181	  case $lt_outputfile in
6182	    *.exe|*.EXE) ;;
6183	    *)
6184	      lt_outputfile="$lt_outputfile.exe"
6185	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6186	      ;;
6187	  esac~
6188	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6189	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6190	    $RM "$lt_outputfile.manifest";
6191	  fi'
6192	;;
6193      *)
6194	# Assume MSVC wrapper
6195	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6196	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6197	# Tell ltmain to make .lib files, not .a files.
6198	libext=lib
6199	# Tell ltmain to make .dll files, not .so files.
6200	shrext_cmds=".dll"
6201	# FIXME: Setting linknames here is a bad hack.
6202	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6203	# The linker will automatically build a .lib file if we build a DLL.
6204	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6205	# FIXME: Should let the user specify the lib program.
6206	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6207	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6208	;;
6209      esac
6210      ;;
6211
6212    darwin* | rhapsody*)
6213      _LT_DARWIN_LINKER_FEATURES($1)
6214      ;;
6215
6216    dgux*)
6217      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6218      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6219      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6220      ;;
6221
6222    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6223    # support.  Future versions do this automatically, but an explicit c++rt0.o
6224    # does not break anything, and helps significantly (at the cost of a little
6225    # extra space).
6226    freebsd2.2*)
6227      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6228      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6229      _LT_TAGVAR(hardcode_direct, $1)=yes
6230      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6231      ;;
6232
6233    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6234    freebsd2.*)
6235      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6236      _LT_TAGVAR(hardcode_direct, $1)=yes
6237      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6238      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6239      ;;
6240
6241    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6242    freebsd* | dragonfly*)
6243      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6244      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6245      _LT_TAGVAR(hardcode_direct, $1)=yes
6246      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6247      ;;
6248
6249    hpux9*)
6250      if test "$GCC" = yes; then
6251	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6252      else
6253	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6254      fi
6255      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6256      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6257      _LT_TAGVAR(hardcode_direct, $1)=yes
6258
6259      # hardcode_minus_L: Not really in the search PATH,
6260      # but as the default location of the library.
6261      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6262      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6263      ;;
6264
6265    hpux10*)
6266      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6267	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6268      else
6269	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6270      fi
6271      if test "$with_gnu_ld" = no; then
6272	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6273	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6274	_LT_TAGVAR(hardcode_direct, $1)=yes
6275	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6276	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6277	# hardcode_minus_L: Not really in the search PATH,
6278	# but as the default location of the library.
6279	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6280      fi
6281      ;;
6282
6283    hpux11*)
6284      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6285	case $host_cpu in
6286	hppa*64*)
6287	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6288	  ;;
6289	ia64*)
6290	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6291	  ;;
6292	*)
6293	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6294	  ;;
6295	esac
6296      else
6297	case $host_cpu in
6298	hppa*64*)
6299	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6300	  ;;
6301	ia64*)
6302	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6303	  ;;
6304	*)
6305	m4_if($1, [], [
6306	  # Older versions of the 11.00 compiler do not understand -b yet
6307	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6308	  _LT_LINKER_OPTION([if $CC understands -b],
6309	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6310	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6311	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6312	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6313	  ;;
6314	esac
6315      fi
6316      if test "$with_gnu_ld" = no; then
6317	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6318	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6319
6320	case $host_cpu in
6321	hppa*64*|ia64*)
6322	  _LT_TAGVAR(hardcode_direct, $1)=no
6323	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6324	  ;;
6325	*)
6326	  _LT_TAGVAR(hardcode_direct, $1)=yes
6327	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6328	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6329
6330	  # hardcode_minus_L: Not really in the search PATH,
6331	  # but as the default location of the library.
6332	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6333	  ;;
6334	esac
6335      fi
6336      ;;
6337
6338    irix5* | irix6* | nonstopux*)
6339      if test "$GCC" = yes; then
6340	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6341	# Try to use the -exported_symbol ld option, if it does not
6342	# work, assume that -exports_file does not work either and
6343	# implicitly export all symbols.
6344	# This should be the same for all languages, so no per-tag cache variable.
6345	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6346	  [lt_cv_irix_exported_symbol],
6347	  [save_LDFLAGS="$LDFLAGS"
6348	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6349	   AC_LINK_IFELSE(
6350	     [AC_LANG_SOURCE(
6351	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6352			      [C++], [[int foo (void) { return 0; }]],
6353			      [Fortran 77], [[
6354      subroutine foo
6355      end]],
6356			      [Fortran], [[
6357      subroutine foo
6358      end]])])],
6359	      [lt_cv_irix_exported_symbol=yes],
6360	      [lt_cv_irix_exported_symbol=no])
6361           LDFLAGS="$save_LDFLAGS"])
6362	if test "$lt_cv_irix_exported_symbol" = yes; then
6363          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
6364	fi
6365      else
6366	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6367	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
6368      fi
6369      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6370      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6371      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6372      _LT_TAGVAR(inherit_rpath, $1)=yes
6373      _LT_TAGVAR(link_all_deplibs, $1)=yes
6374      ;;
6375
6376    netbsd*)
6377      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6378	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6379      else
6380	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6381      fi
6382      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6383      _LT_TAGVAR(hardcode_direct, $1)=yes
6384      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6385      ;;
6386
6387    newsos6)
6388      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6389      _LT_TAGVAR(hardcode_direct, $1)=yes
6390      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6391      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6392      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6393      ;;
6394
6395    *nto* | *qnx*)
6396      ;;
6397
6398    openbsd*)
6399      if test -f /usr/libexec/ld.so; then
6400	_LT_TAGVAR(hardcode_direct, $1)=yes
6401	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6402	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6403	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6404	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6405	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6406	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6407	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6408	else
6409	  case $host_os in
6410	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6411	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6412	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6413	     ;;
6414	   *)
6415	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6416	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6417	     ;;
6418	  esac
6419	fi
6420      else
6421	_LT_TAGVAR(ld_shlibs, $1)=no
6422      fi
6423      ;;
6424
6425    os2*)
6426      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6427      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6428      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6429      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
6430      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6431      ;;
6432
6433    osf3*)
6434      if test "$GCC" = yes; then
6435	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6436	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6437      else
6438	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6439	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6440      fi
6441      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6442      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6443      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6444      ;;
6445
6446    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6447      if test "$GCC" = yes; then
6448	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6449	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6450	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6451      else
6452	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6453	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6454	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
6455	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
6456
6457	# Both c and cxx compiler support -rpath directly
6458	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6459      fi
6460      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6461      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6462      ;;
6463
6464    solaris*)
6465      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6466      if test "$GCC" = yes; then
6467	wlarc='${wl}'
6468	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6469	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6470	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6471      else
6472	case `$CC -V 2>&1` in
6473	*"Compilers 5.0"*)
6474	  wlarc=''
6475	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6476	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6477	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6478	  ;;
6479	*)
6480	  wlarc='${wl}'
6481	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6482	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6483	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6484	  ;;
6485	esac
6486      fi
6487      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6488      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6489      case $host_os in
6490      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6491      *)
6492	# The compiler driver will combine and reorder linker options,
6493	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6494	# but is careful enough not to reorder.
6495	# Supported since Solaris 2.6 (maybe 2.5.1?)
6496	if test "$GCC" = yes; then
6497	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6498	else
6499	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6500	fi
6501	;;
6502      esac
6503      _LT_TAGVAR(link_all_deplibs, $1)=yes
6504      ;;
6505
6506    sunos4*)
6507      if test "x$host_vendor" = xsequent; then
6508	# Use $CC to link under sequent, because it throws in some extra .o
6509	# files that make .init and .fini sections work.
6510	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6511      else
6512	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6513      fi
6514      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6515      _LT_TAGVAR(hardcode_direct, $1)=yes
6516      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6517      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6518      ;;
6519
6520    sysv4)
6521      case $host_vendor in
6522	sni)
6523	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6524	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6525	;;
6526	siemens)
6527	  ## LD is ld it makes a PLAMLIB
6528	  ## CC just makes a GrossModule.
6529	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6530	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6531	  _LT_TAGVAR(hardcode_direct, $1)=no
6532        ;;
6533	motorola)
6534	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6535	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6536	;;
6537      esac
6538      runpath_var='LD_RUN_PATH'
6539      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6540      ;;
6541
6542    sysv4.3*)
6543      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6544      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6545      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6546      ;;
6547
6548    sysv4*MP*)
6549      if test -d /usr/nec; then
6550	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6551	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6552	runpath_var=LD_RUN_PATH
6553	hardcode_runpath_var=yes
6554	_LT_TAGVAR(ld_shlibs, $1)=yes
6555      fi
6556      ;;
6557
6558    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6559      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6560      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6561      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6562      runpath_var='LD_RUN_PATH'
6563
6564      if test "$GCC" = yes; then
6565	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6566	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6567      else
6568	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6569	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6570      fi
6571      ;;
6572
6573    sysv5* | sco3.2v5* | sco5v6*)
6574      # Note: We can NOT use -z defs as we might desire, because we do not
6575      # link with -lc, and that would cause any symbols used from libc to
6576      # always be unresolved, which means just about no library would
6577      # ever link correctly.  If we're not using GNU ld we use -z text
6578      # though, which does catch some bad symbols but isn't as heavy-handed
6579      # as -z defs.
6580      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6581      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6582      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6583      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6584      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6585      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6586      _LT_TAGVAR(link_all_deplibs, $1)=yes
6587      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6588      runpath_var='LD_RUN_PATH'
6589
6590      if test "$GCC" = yes; then
6591	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6592	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6593      else
6594	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6595	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6596      fi
6597      ;;
6598
6599    uts4*)
6600      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6601      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6602      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6603      ;;
6604
6605    *)
6606      _LT_TAGVAR(ld_shlibs, $1)=no
6607      ;;
6608    esac
6609
6610    if test x$host_vendor = xsni; then
6611      case $host in
6612      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6613	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6614	;;
6615      esac
6616    fi
6617  fi
6618])
6619AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6620test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6621
6622_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6623
6624_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6625_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6626_LT_DECL([], [extract_expsyms_cmds], [2],
6627    [The commands to extract the exported symbol list from a shared archive])
6628
6629#
6630# Do we need to explicitly link libc?
6631#
6632case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6633x|xyes)
6634  # Assume -lc should be added
6635  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6636
6637  if test "$enable_shared" = yes && test "$GCC" = yes; then
6638    case $_LT_TAGVAR(archive_cmds, $1) in
6639    *'~'*)
6640      # FIXME: we may have to deal with multi-command sequences.
6641      ;;
6642    '$CC '*)
6643      # Test whether the compiler implicitly links with -lc since on some
6644      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6645      # to ld, don't add -lc before -lgcc.
6646      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6647	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6648	[$RM conftest*
6649	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6650
6651	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6652	  soname=conftest
6653	  lib=conftest
6654	  libobjs=conftest.$ac_objext
6655	  deplibs=
6656	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6657	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6658	  compiler_flags=-v
6659	  linker_flags=-v
6660	  verstring=
6661	  output_objdir=.
6662	  libname=conftest
6663	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6664	  _LT_TAGVAR(allow_undefined_flag, $1)=
6665	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6666	  then
6667	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6668	  else
6669	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6670	  fi
6671	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6672	else
6673	  cat conftest.err 1>&5
6674	fi
6675	$RM conftest*
6676	])
6677      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6678      ;;
6679    esac
6680  fi
6681  ;;
6682esac
6683
6684_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6685    [Whether or not to add -lc for building shared libraries])
6686_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6687    [enable_shared_with_static_runtimes], [0],
6688    [Whether or not to disallow shared libs when runtime libs are static])
6689_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6690    [Compiler flag to allow reflexive dlopens])
6691_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6692    [Compiler flag to generate shared objects directly from archives])
6693_LT_TAGDECL([], [compiler_needs_object], [1],
6694    [Whether the compiler copes with passing no objects directly])
6695_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6696    [Create an old-style archive from a shared archive])
6697_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6698    [Create a temporary old-style archive to link instead of a shared archive])
6699_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6700_LT_TAGDECL([], [archive_expsym_cmds], [2])
6701_LT_TAGDECL([], [module_cmds], [2],
6702    [Commands used to build a loadable module if different from building
6703    a shared archive.])
6704_LT_TAGDECL([], [module_expsym_cmds], [2])
6705_LT_TAGDECL([], [with_gnu_ld], [1],
6706    [Whether we are building with GNU ld or not])
6707_LT_TAGDECL([], [allow_undefined_flag], [1],
6708    [Flag that allows shared libraries with undefined symbols to be built])
6709_LT_TAGDECL([], [no_undefined_flag], [1],
6710    [Flag that enforces no undefined symbols])
6711_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6712    [Flag to hardcode $libdir into a binary during linking.
6713    This must work even if $libdir does not exist])
6714_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6715    [Whether we need a single "-rpath" flag with a separated argument])
6716_LT_TAGDECL([], [hardcode_direct], [0],
6717    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6718    DIR into the resulting binary])
6719_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6720    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6721    DIR into the resulting binary and the resulting library dependency is
6722    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6723    library is relocated])
6724_LT_TAGDECL([], [hardcode_minus_L], [0],
6725    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6726    into the resulting binary])
6727_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6728    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6729    into the resulting binary])
6730_LT_TAGDECL([], [hardcode_automatic], [0],
6731    [Set to "yes" if building a shared library automatically hardcodes DIR
6732    into the library and all subsequent libraries and executables linked
6733    against it])
6734_LT_TAGDECL([], [inherit_rpath], [0],
6735    [Set to yes if linker adds runtime paths of dependent libraries
6736    to runtime path list])
6737_LT_TAGDECL([], [link_all_deplibs], [0],
6738    [Whether libtool must link a program against all its dependency libraries])
6739_LT_TAGDECL([], [always_export_symbols], [0],
6740    [Set to "yes" if exported symbols are required])
6741_LT_TAGDECL([], [export_symbols_cmds], [2],
6742    [The commands to list exported symbols])
6743_LT_TAGDECL([], [exclude_expsyms], [1],
6744    [Symbols that should not be listed in the preloaded symbols])
6745_LT_TAGDECL([], [include_expsyms], [1],
6746    [Symbols that must always be exported])
6747_LT_TAGDECL([], [prelink_cmds], [2],
6748    [Commands necessary for linking programs (against libraries) with templates])
6749_LT_TAGDECL([], [postlink_cmds], [2],
6750    [Commands necessary for finishing linking programs])
6751_LT_TAGDECL([], [file_list_spec], [1],
6752    [Specify filename containing input files])
6753dnl FIXME: Not yet implemented
6754dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6755dnl    [Compiler flag to generate thread safe objects])
6756])# _LT_LINKER_SHLIBS
6757
6758
6759# _LT_LANG_C_CONFIG([TAG])
6760# ------------------------
6761# Ensure that the configuration variables for a C compiler are suitably
6762# defined.  These variables are subsequently used by _LT_CONFIG to write
6763# the compiler configuration to `libtool'.
6764m4_defun([_LT_LANG_C_CONFIG],
6765[m4_require([_LT_DECL_EGREP])dnl
6766lt_save_CC="$CC"
6767AC_LANG_PUSH(C)
6768
6769# Source file extension for C test sources.
6770ac_ext=c
6771
6772# Object file extension for compiled C test sources.
6773objext=o
6774_LT_TAGVAR(objext, $1)=$objext
6775
6776# Code to be used in simple compile tests
6777lt_simple_compile_test_code="int some_variable = 0;"
6778
6779# Code to be used in simple link tests
6780lt_simple_link_test_code='int main(){return(0);}'
6781
6782_LT_TAG_COMPILER
6783# Save the default compiler, since it gets overwritten when the other
6784# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6785compiler_DEFAULT=$CC
6786
6787# save warnings/boilerplate of simple test code
6788_LT_COMPILER_BOILERPLATE
6789_LT_LINKER_BOILERPLATE
6790
6791if test -n "$compiler"; then
6792  _LT_COMPILER_NO_RTTI($1)
6793  _LT_COMPILER_PIC($1)
6794  _LT_COMPILER_C_O($1)
6795  _LT_COMPILER_FILE_LOCKS($1)
6796  _LT_LINKER_SHLIBS($1)
6797  _LT_SYS_DYNAMIC_LINKER($1)
6798  _LT_LINKER_HARDCODE_LIBPATH($1)
6799  LT_SYS_DLOPEN_SELF
6800  _LT_CMD_STRIPLIB
6801
6802  # Report which library types will actually be built
6803  AC_MSG_CHECKING([if libtool supports shared libraries])
6804  AC_MSG_RESULT([$can_build_shared])
6805
6806  AC_MSG_CHECKING([whether to build shared libraries])
6807  test "$can_build_shared" = "no" && enable_shared=no
6808
6809  # On AIX, shared libraries and static libraries use the same namespace, and
6810  # are all built from PIC.
6811  case $host_os in
6812  aix3*)
6813    test "$enable_shared" = yes && enable_static=no
6814    if test -n "$RANLIB"; then
6815      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6816      postinstall_cmds='$RANLIB $lib'
6817    fi
6818    ;;
6819
6820  aix[[4-9]]*)
6821    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6822      test "$enable_shared" = yes && enable_static=no
6823    fi
6824    ;;
6825  esac
6826  AC_MSG_RESULT([$enable_shared])
6827
6828  AC_MSG_CHECKING([whether to build static libraries])
6829  # Make sure either enable_shared or enable_static is yes.
6830  test "$enable_shared" = yes || enable_static=yes
6831  AC_MSG_RESULT([$enable_static])
6832
6833  _LT_CONFIG($1)
6834fi
6835AC_LANG_POP
6836CC="$lt_save_CC"
6837])# _LT_LANG_C_CONFIG
6838
6839
6840# _LT_LANG_CXX_CONFIG([TAG])
6841# --------------------------
6842# Ensure that the configuration variables for a C++ compiler are suitably
6843# defined.  These variables are subsequently used by _LT_CONFIG to write
6844# the compiler configuration to `libtool'.
6845m4_defun([_LT_LANG_CXX_CONFIG],
6846[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6847m4_require([_LT_DECL_EGREP])dnl
6848m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6849if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6850    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6851    (test "X$CXX" != "Xg++"))) ; then
6852  AC_PROG_CXXCPP
6853else
6854  _lt_caught_CXX_error=yes
6855fi
6856
6857AC_LANG_PUSH(C++)
6858_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6859_LT_TAGVAR(allow_undefined_flag, $1)=
6860_LT_TAGVAR(always_export_symbols, $1)=no
6861_LT_TAGVAR(archive_expsym_cmds, $1)=
6862_LT_TAGVAR(compiler_needs_object, $1)=no
6863_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6864_LT_TAGVAR(hardcode_direct, $1)=no
6865_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6866_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6867_LT_TAGVAR(hardcode_libdir_separator, $1)=
6868_LT_TAGVAR(hardcode_minus_L, $1)=no
6869_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6870_LT_TAGVAR(hardcode_automatic, $1)=no
6871_LT_TAGVAR(inherit_rpath, $1)=no
6872_LT_TAGVAR(module_cmds, $1)=
6873_LT_TAGVAR(module_expsym_cmds, $1)=
6874_LT_TAGVAR(link_all_deplibs, $1)=unknown
6875_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6876_LT_TAGVAR(reload_flag, $1)=$reload_flag
6877_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6878_LT_TAGVAR(no_undefined_flag, $1)=
6879_LT_TAGVAR(whole_archive_flag_spec, $1)=
6880_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6881
6882# Source file extension for C++ test sources.
6883ac_ext=cpp
6884
6885# Object file extension for compiled C++ test sources.
6886objext=o
6887_LT_TAGVAR(objext, $1)=$objext
6888
6889# No sense in running all these tests if we already determined that
6890# the CXX compiler isn't working.  Some variables (like enable_shared)
6891# are currently assumed to apply to all compilers on this platform,
6892# and will be corrupted by setting them based on a non-working compiler.
6893if test "$_lt_caught_CXX_error" != yes; then
6894  # Code to be used in simple compile tests
6895  lt_simple_compile_test_code="int some_variable = 0;"
6896
6897  # Code to be used in simple link tests
6898  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6899
6900  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6901  _LT_TAG_COMPILER
6902
6903  # save warnings/boilerplate of simple test code
6904  _LT_COMPILER_BOILERPLATE
6905  _LT_LINKER_BOILERPLATE
6906
6907  # Allow CC to be a program name with arguments.
6908  lt_save_CC=$CC
6909  lt_save_CFLAGS=$CFLAGS
6910  lt_save_LD=$LD
6911  lt_save_GCC=$GCC
6912  GCC=$GXX
6913  lt_save_with_gnu_ld=$with_gnu_ld
6914  lt_save_path_LD=$lt_cv_path_LD
6915  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6916    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6917  else
6918    $as_unset lt_cv_prog_gnu_ld
6919  fi
6920  if test -n "${lt_cv_path_LDCXX+set}"; then
6921    lt_cv_path_LD=$lt_cv_path_LDCXX
6922  else
6923    $as_unset lt_cv_path_LD
6924  fi
6925  test -z "${LDCXX+set}" || LD=$LDCXX
6926  CC=${CXX-"c++"}
6927  CFLAGS=$CXXFLAGS
6928  compiler=$CC
6929  _LT_TAGVAR(compiler, $1)=$CC
6930  _LT_CC_BASENAME([$compiler])
6931
6932  if test -n "$compiler"; then
6933    # We don't want -fno-exception when compiling C++ code, so set the
6934    # no_builtin_flag separately
6935    if test "$GXX" = yes; then
6936      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6937    else
6938      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6939    fi
6940
6941    if test "$GXX" = yes; then
6942      # Set up default GNU C++ configuration
6943
6944      LT_PATH_LD
6945
6946      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6947      # archiving commands below assume that GNU ld is being used.
6948      if test "$with_gnu_ld" = yes; then
6949        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6950        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6951
6952        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6953        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6954
6955        # If archive_cmds runs LD, not CC, wlarc should be empty
6956        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6957        #     investigate it a little bit more. (MM)
6958        wlarc='${wl}'
6959
6960        # ancient GNU ld didn't support --whole-archive et. al.
6961        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6962	  $GREP 'no-whole-archive' > /dev/null; then
6963          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6964        else
6965          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6966        fi
6967      else
6968        with_gnu_ld=no
6969        wlarc=
6970
6971        # A generic and very simple default shared library creation
6972        # command for GNU C++ for the case where it uses the native
6973        # linker, instead of GNU ld.  If possible, this setting should
6974        # overridden to take advantage of the native linker features on
6975        # the platform it is being used on.
6976        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6977      fi
6978
6979      # Commands to make compiler produce verbose output that lists
6980      # what "hidden" libraries, object files and flags are used when
6981      # linking a shared library.
6982      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6983
6984    else
6985      GXX=no
6986      with_gnu_ld=no
6987      wlarc=
6988    fi
6989
6990    # PORTME: fill in a description of your system's C++ link characteristics
6991    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6992    _LT_TAGVAR(ld_shlibs, $1)=yes
6993    case $host_os in
6994      aix3*)
6995        # FIXME: insert proper C++ library support
6996        _LT_TAGVAR(ld_shlibs, $1)=no
6997        ;;
6998      aix[[4-9]]*)
6999        if test "$host_cpu" = ia64; then
7000          # On IA64, the linker does run time linking by default, so we don't
7001          # have to do anything special.
7002          aix_use_runtimelinking=no
7003          exp_sym_flag='-Bexport'
7004          no_entry_flag=""
7005        else
7006          aix_use_runtimelinking=no
7007
7008          # Test if we are trying to use run time linking or normal
7009          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7010          # need to do runtime linking.
7011          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7012	    for ld_flag in $LDFLAGS; do
7013	      case $ld_flag in
7014	      *-brtl*)
7015	        aix_use_runtimelinking=yes
7016	        break
7017	        ;;
7018	      esac
7019	    done
7020	    ;;
7021          esac
7022
7023          exp_sym_flag='-bexport'
7024          no_entry_flag='-bnoentry'
7025        fi
7026
7027        # When large executables or shared objects are built, AIX ld can
7028        # have problems creating the table of contents.  If linking a library
7029        # or program results in "error TOC overflow" add -mminimal-toc to
7030        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7031        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7032
7033        _LT_TAGVAR(archive_cmds, $1)=''
7034        _LT_TAGVAR(hardcode_direct, $1)=yes
7035        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7036        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7037        _LT_TAGVAR(link_all_deplibs, $1)=yes
7038        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7039
7040        if test "$GXX" = yes; then
7041          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7042          # We only want to do this on AIX 4.2 and lower, the check
7043          # below for broken collect2 doesn't work under 4.3+
7044	  collect2name=`${CC} -print-prog-name=collect2`
7045	  if test -f "$collect2name" &&
7046	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7047	  then
7048	    # We have reworked collect2
7049	    :
7050	  else
7051	    # We have old collect2
7052	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7053	    # It fails to find uninstalled libraries when the uninstalled
7054	    # path is not listed in the libpath.  Setting hardcode_minus_L
7055	    # to unsupported forces relinking
7056	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7057	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7058	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7059	  fi
7060          esac
7061          shared_flag='-shared'
7062	  if test "$aix_use_runtimelinking" = yes; then
7063	    shared_flag="$shared_flag "'${wl}-G'
7064	  fi
7065        else
7066          # not using gcc
7067          if test "$host_cpu" = ia64; then
7068	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7069	  # chokes on -Wl,-G. The following line is correct:
7070	  shared_flag='-G'
7071          else
7072	    if test "$aix_use_runtimelinking" = yes; then
7073	      shared_flag='${wl}-G'
7074	    else
7075	      shared_flag='${wl}-bM:SRE'
7076	    fi
7077          fi
7078        fi
7079
7080        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7081        # It seems that -bexpall does not export symbols beginning with
7082        # underscore (_), so it is better to generate a list of symbols to
7083	# export.
7084        _LT_TAGVAR(always_export_symbols, $1)=yes
7085        if test "$aix_use_runtimelinking" = yes; then
7086          # Warning - without using the other runtime loading flags (-brtl),
7087          # -berok will link without error, but may produce a broken library.
7088          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7089          # Determine the default libpath from the value encoded in an empty
7090          # executable.
7091          _LT_SYS_MODULE_PATH_AIX([$1])
7092          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7093
7094          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
7095        else
7096          if test "$host_cpu" = ia64; then
7097	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7098	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7099	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
7100          else
7101	    # Determine the default libpath from the value encoded in an
7102	    # empty executable.
7103	    _LT_SYS_MODULE_PATH_AIX([$1])
7104	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7105	    # Warning - without using the other run time loading flags,
7106	    # -berok will link without error, but may produce a broken library.
7107	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7108	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7109	    if test "$with_gnu_ld" = yes; then
7110	      # We only use this code for GNU lds that support --whole-archive.
7111	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7112	    else
7113	      # Exported symbols can be pulled into shared objects from archives
7114	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7115	    fi
7116	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7117	    # This is similar to how AIX traditionally builds its shared
7118	    # libraries.
7119	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
7120          fi
7121        fi
7122        ;;
7123
7124      beos*)
7125	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7126	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7127	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7128	  # support --undefined.  This deserves some investigation.  FIXME
7129	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7130	else
7131	  _LT_TAGVAR(ld_shlibs, $1)=no
7132	fi
7133	;;
7134
7135      chorus*)
7136        case $cc_basename in
7137          *)
7138	  # FIXME: insert proper C++ library support
7139	  _LT_TAGVAR(ld_shlibs, $1)=no
7140	  ;;
7141        esac
7142        ;;
7143
7144      cygwin* | mingw* | pw32* | cegcc*)
7145	case $GXX,$cc_basename in
7146	,cl* | no,cl*)
7147	  # Native MSVC
7148	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7149	  # no search path for DLLs.
7150	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7151	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7152	  _LT_TAGVAR(always_export_symbols, $1)=yes
7153	  _LT_TAGVAR(file_list_spec, $1)='@'
7154	  # Tell ltmain to make .lib files, not .a files.
7155	  libext=lib
7156	  # Tell ltmain to make .dll files, not .so files.
7157	  shrext_cmds=".dll"
7158	  # FIXME: Setting linknames here is a bad hack.
7159	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7160	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7161	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7162	    else
7163	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7164	    fi~
7165	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7166	    linknames='
7167	  # The linker will not automatically build a static lib if we build a DLL.
7168	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7169	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7170	  # Don't use ranlib
7171	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7172	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7173	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7174	    case $lt_outputfile in
7175	      *.exe|*.EXE) ;;
7176	      *)
7177		lt_outputfile="$lt_outputfile.exe"
7178		lt_tool_outputfile="$lt_tool_outputfile.exe"
7179		;;
7180	    esac~
7181	    func_to_tool_file "$lt_outputfile"~
7182	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7183	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7184	      $RM "$lt_outputfile.manifest";
7185	    fi'
7186	  ;;
7187	*)
7188	  # g++
7189	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7190	  # as there is no search path for DLLs.
7191	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7192	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7193	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7194	  _LT_TAGVAR(always_export_symbols, $1)=no
7195	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7196
7197	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7198	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
7199	    # If the export-symbols file already is a .def file (1st line
7200	    # is EXPORTS), use it as is; otherwise, prepend...
7201	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7202	      cp $export_symbols $output_objdir/$soname.def;
7203	    else
7204	      echo EXPORTS > $output_objdir/$soname.def;
7205	      cat $export_symbols >> $output_objdir/$soname.def;
7206	    fi~
7207	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
7208	  else
7209	    _LT_TAGVAR(ld_shlibs, $1)=no
7210	  fi
7211	  ;;
7212	esac
7213	;;
7214      darwin* | rhapsody*)
7215        _LT_DARWIN_LINKER_FEATURES($1)
7216	;;
7217
7218      dgux*)
7219        case $cc_basename in
7220          ec++*)
7221	    # FIXME: insert proper C++ library support
7222	    _LT_TAGVAR(ld_shlibs, $1)=no
7223	    ;;
7224          ghcx*)
7225	    # Green Hills C++ Compiler
7226	    # FIXME: insert proper C++ library support
7227	    _LT_TAGVAR(ld_shlibs, $1)=no
7228	    ;;
7229          *)
7230	    # FIXME: insert proper C++ library support
7231	    _LT_TAGVAR(ld_shlibs, $1)=no
7232	    ;;
7233        esac
7234        ;;
7235
7236      freebsd2.*)
7237        # C++ shared libraries reported to be fairly broken before
7238	# switch to ELF
7239        _LT_TAGVAR(ld_shlibs, $1)=no
7240        ;;
7241
7242      freebsd-elf*)
7243        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7244        ;;
7245
7246      freebsd* | dragonfly*)
7247        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7248        # conventions
7249        _LT_TAGVAR(ld_shlibs, $1)=yes
7250        ;;
7251
7252      gnu*)
7253        ;;
7254
7255      haiku*)
7256        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7257        _LT_TAGVAR(link_all_deplibs, $1)=yes
7258        ;;
7259
7260      hpux9*)
7261        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7262        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7263        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7264        _LT_TAGVAR(hardcode_direct, $1)=yes
7265        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7266				             # but as the default
7267				             # location of the library.
7268
7269        case $cc_basename in
7270          CC*)
7271            # FIXME: insert proper C++ library support
7272            _LT_TAGVAR(ld_shlibs, $1)=no
7273            ;;
7274          aCC*)
7275            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
7276            # Commands to make compiler produce verbose output that lists
7277            # what "hidden" libraries, object files and flags are used when
7278            # linking a shared library.
7279            #
7280            # There doesn't appear to be a way to prevent this compiler from
7281            # explicitly linking system object files so we need to strip them
7282            # from the output so that they don't get included in the library
7283            # dependencies.
7284            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7285            ;;
7286          *)
7287            if test "$GXX" = yes; then
7288              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
7289            else
7290              # FIXME: insert proper C++ library support
7291              _LT_TAGVAR(ld_shlibs, $1)=no
7292            fi
7293            ;;
7294        esac
7295        ;;
7296
7297      hpux10*|hpux11*)
7298        if test $with_gnu_ld = no; then
7299	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7300	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7301
7302          case $host_cpu in
7303            hppa*64*|ia64*)
7304              ;;
7305            *)
7306	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7307              ;;
7308          esac
7309        fi
7310        case $host_cpu in
7311          hppa*64*|ia64*)
7312            _LT_TAGVAR(hardcode_direct, $1)=no
7313            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7314            ;;
7315          *)
7316            _LT_TAGVAR(hardcode_direct, $1)=yes
7317            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7318            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7319					         # but as the default
7320					         # location of the library.
7321            ;;
7322        esac
7323
7324        case $cc_basename in
7325          CC*)
7326	    # FIXME: insert proper C++ library support
7327	    _LT_TAGVAR(ld_shlibs, $1)=no
7328	    ;;
7329          aCC*)
7330	    case $host_cpu in
7331	      hppa*64*)
7332	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7333	        ;;
7334	      ia64*)
7335	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7336	        ;;
7337	      *)
7338	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7339	        ;;
7340	    esac
7341	    # Commands to make compiler produce verbose output that lists
7342	    # what "hidden" libraries, object files and flags are used when
7343	    # linking a shared library.
7344	    #
7345	    # There doesn't appear to be a way to prevent this compiler from
7346	    # explicitly linking system object files so we need to strip them
7347	    # from the output so that they don't get included in the library
7348	    # dependencies.
7349	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7350	    ;;
7351          *)
7352	    if test "$GXX" = yes; then
7353	      if test $with_gnu_ld = no; then
7354	        case $host_cpu in
7355	          hppa*64*)
7356	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7357	            ;;
7358	          ia64*)
7359	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7360	            ;;
7361	          *)
7362	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7363	            ;;
7364	        esac
7365	      fi
7366	    else
7367	      # FIXME: insert proper C++ library support
7368	      _LT_TAGVAR(ld_shlibs, $1)=no
7369	    fi
7370	    ;;
7371        esac
7372        ;;
7373
7374      interix[[3-9]]*)
7375	_LT_TAGVAR(hardcode_direct, $1)=no
7376	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7377	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7378	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7379	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7380	# Instead, shared libraries are loaded at an image base (0x10000000 by
7381	# default) and relocated if they conflict, which is a slow very memory
7382	# consuming and fragmenting process.  To avoid this, we pick a random,
7383	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7384	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7385	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
7386	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
7387	;;
7388      irix5* | irix6*)
7389        case $cc_basename in
7390          CC*)
7391	    # SGI C++
7392	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7393
7394	    # Archives containing C++ object files must be created using
7395	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7396	    # necessary to make sure instantiated templates are included
7397	    # in the archive.
7398	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7399	    ;;
7400          *)
7401	    if test "$GXX" = yes; then
7402	      if test "$with_gnu_ld" = no; then
7403	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7404	      else
7405	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
7406	      fi
7407	    fi
7408	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7409	    ;;
7410        esac
7411        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7412        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7413        _LT_TAGVAR(inherit_rpath, $1)=yes
7414        ;;
7415
7416      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7417        case $cc_basename in
7418          KCC*)
7419	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7420
7421	    # KCC will only create a shared library if the output file
7422	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7423	    # to its proper name (with version) after linking.
7424	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7425	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
7426	    # Commands to make compiler produce verbose output that lists
7427	    # what "hidden" libraries, object files and flags are used when
7428	    # linking a shared library.
7429	    #
7430	    # There doesn't appear to be a way to prevent this compiler from
7431	    # explicitly linking system object files so we need to strip them
7432	    # from the output so that they don't get included in the library
7433	    # dependencies.
7434	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7435
7436	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7437	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7438
7439	    # Archives containing C++ object files must be created using
7440	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7441	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7442	    ;;
7443	  icpc* | ecpc* )
7444	    # Intel C++
7445	    with_gnu_ld=yes
7446	    # version 8.0 and above of icpc choke on multiply defined symbols
7447	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7448	    # earlier do not add the objects themselves.
7449	    case `$CC -V 2>&1` in
7450	      *"Version 7."*)
7451	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7452		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7453		;;
7454	      *)  # Version 8.0 or newer
7455	        tmp_idyn=
7456	        case $host_cpu in
7457		  ia64*) tmp_idyn=' -i_dynamic';;
7458		esac
7459	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7460		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7461		;;
7462	    esac
7463	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7464	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7465	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7466	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7467	    ;;
7468          pgCC* | pgcpp*)
7469            # Portland Group C++ compiler
7470	    case `$CC -V` in
7471	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7472	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7473		rm -rf $tpldir~
7474		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7475		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7476	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7477		rm -rf $tpldir~
7478		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7479		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7480		$RANLIB $oldlib'
7481	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7482		rm -rf $tpldir~
7483		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7484		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7485	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7486		rm -rf $tpldir~
7487		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7488		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
7489	      ;;
7490	    *) # Version 6 and above use weak symbols
7491	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7492	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
7493	      ;;
7494	    esac
7495
7496	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7497	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7498	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
7499            ;;
7500	  cxx*)
7501	    # Compaq C++
7502	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7503	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
7504
7505	    runpath_var=LD_RUN_PATH
7506	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7507	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7508
7509	    # Commands to make compiler produce verbose output that lists
7510	    # what "hidden" libraries, object files and flags are used when
7511	    # linking a shared library.
7512	    #
7513	    # There doesn't appear to be a way to prevent this compiler from
7514	    # explicitly linking system object files so we need to strip them
7515	    # from the output so that they don't get included in the library
7516	    # dependencies.
7517	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
7518	    ;;
7519	  xl* | mpixl* | bgxl*)
7520	    # IBM XL 8.0 on PPC, with GNU ld
7521	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7522	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7523	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7524	    if test "x$supports_anon_versioning" = xyes; then
7525	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7526		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7527		echo "local: *; };" >> $output_objdir/$libname.ver~
7528		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7529	    fi
7530	    ;;
7531	  *)
7532	    case `$CC -V 2>&1 | sed 5q` in
7533	    *Sun\ C*)
7534	      # Sun C++ 5.9
7535	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7536	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7537	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
7538	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7539	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
7540	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7541
7542	      # Not sure whether something based on
7543	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7544	      # would be better.
7545	      output_verbose_link_cmd='func_echo_all'
7546
7547	      # Archives containing C++ object files must be created using
7548	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7549	      # necessary to make sure instantiated templates are included
7550	      # in the archive.
7551	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7552	      ;;
7553	    esac
7554	    ;;
7555	esac
7556	;;
7557
7558      lynxos*)
7559        # FIXME: insert proper C++ library support
7560	_LT_TAGVAR(ld_shlibs, $1)=no
7561	;;
7562
7563      m88k*)
7564        # FIXME: insert proper C++ library support
7565        _LT_TAGVAR(ld_shlibs, $1)=no
7566	;;
7567
7568      mvs*)
7569        case $cc_basename in
7570          cxx*)
7571	    # FIXME: insert proper C++ library support
7572	    _LT_TAGVAR(ld_shlibs, $1)=no
7573	    ;;
7574	  *)
7575	    # FIXME: insert proper C++ library support
7576	    _LT_TAGVAR(ld_shlibs, $1)=no
7577	    ;;
7578	esac
7579	;;
7580
7581      netbsd*)
7582        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7583	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7584	  wlarc=
7585	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7586	  _LT_TAGVAR(hardcode_direct, $1)=yes
7587	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7588	fi
7589	# Workaround some broken pre-1.5 toolchains
7590	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7591	;;
7592
7593      *nto* | *qnx*)
7594        _LT_TAGVAR(ld_shlibs, $1)=yes
7595	;;
7596
7597      openbsd2*)
7598        # C++ shared libraries are fairly broken
7599	_LT_TAGVAR(ld_shlibs, $1)=no
7600	;;
7601
7602      openbsd*)
7603	if test -f /usr/libexec/ld.so; then
7604	  _LT_TAGVAR(hardcode_direct, $1)=yes
7605	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7606	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7607	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7608	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7609	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7610	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
7611	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7612	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7613	  fi
7614	  output_verbose_link_cmd=func_echo_all
7615	else
7616	  _LT_TAGVAR(ld_shlibs, $1)=no
7617	fi
7618	;;
7619
7620      osf3* | osf4* | osf5*)
7621        case $cc_basename in
7622          KCC*)
7623	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7624
7625	    # KCC will only create a shared library if the output file
7626	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7627	    # to its proper name (with version) after linking.
7628	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7629
7630	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7631	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7632
7633	    # Archives containing C++ object files must be created using
7634	    # the KAI C++ compiler.
7635	    case $host in
7636	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7637	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7638	    esac
7639	    ;;
7640          RCC*)
7641	    # Rational C++ 2.4.1
7642	    # FIXME: insert proper C++ library support
7643	    _LT_TAGVAR(ld_shlibs, $1)=no
7644	    ;;
7645          cxx*)
7646	    case $host in
7647	      osf3*)
7648	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7649	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7650	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7651		;;
7652	      *)
7653	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7654	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7655	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7656	          echo "-hidden">> $lib.exp~
7657	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
7658	          $RM $lib.exp'
7659	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7660		;;
7661	    esac
7662
7663	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7664
7665	    # Commands to make compiler produce verbose output that lists
7666	    # what "hidden" libraries, object files and flags are used when
7667	    # linking a shared library.
7668	    #
7669	    # There doesn't appear to be a way to prevent this compiler from
7670	    # explicitly linking system object files so we need to strip them
7671	    # from the output so that they don't get included in the library
7672	    # dependencies.
7673	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7674	    ;;
7675	  *)
7676	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7677	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7678	      case $host in
7679	        osf3*)
7680	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7681		  ;;
7682	        *)
7683	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7684		  ;;
7685	      esac
7686
7687	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7688	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7689
7690	      # Commands to make compiler produce verbose output that lists
7691	      # what "hidden" libraries, object files and flags are used when
7692	      # linking a shared library.
7693	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7694
7695	    else
7696	      # FIXME: insert proper C++ library support
7697	      _LT_TAGVAR(ld_shlibs, $1)=no
7698	    fi
7699	    ;;
7700        esac
7701        ;;
7702
7703      psos*)
7704        # FIXME: insert proper C++ library support
7705        _LT_TAGVAR(ld_shlibs, $1)=no
7706        ;;
7707
7708      sunos4*)
7709        case $cc_basename in
7710          CC*)
7711	    # Sun C++ 4.x
7712	    # FIXME: insert proper C++ library support
7713	    _LT_TAGVAR(ld_shlibs, $1)=no
7714	    ;;
7715          lcc*)
7716	    # Lucid
7717	    # FIXME: insert proper C++ library support
7718	    _LT_TAGVAR(ld_shlibs, $1)=no
7719	    ;;
7720          *)
7721	    # FIXME: insert proper C++ library support
7722	    _LT_TAGVAR(ld_shlibs, $1)=no
7723	    ;;
7724        esac
7725        ;;
7726
7727      solaris*)
7728        case $cc_basename in
7729          CC* | sunCC*)
7730	    # Sun C++ 4.2, 5.x and Centerline C++
7731            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7732	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7733	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7734	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7735	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7736
7737	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7738	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7739	    case $host_os in
7740	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7741	      *)
7742		# The compiler driver will combine and reorder linker options,
7743		# but understands `-z linker_flag'.
7744	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7745		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7746	        ;;
7747	    esac
7748	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7749
7750	    output_verbose_link_cmd='func_echo_all'
7751
7752	    # Archives containing C++ object files must be created using
7753	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7754	    # necessary to make sure instantiated templates are included
7755	    # in the archive.
7756	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7757	    ;;
7758          gcx*)
7759	    # Green Hills C++ Compiler
7760	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7761
7762	    # The C++ compiler must be used to create the archive.
7763	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7764	    ;;
7765          *)
7766	    # GNU C++ compiler with Solaris linker
7767	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7768	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7769	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7770	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7771	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7772		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7773
7774	        # Commands to make compiler produce verbose output that lists
7775	        # what "hidden" libraries, object files and flags are used when
7776	        # linking a shared library.
7777	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7778	      else
7779	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7780	        # platform.
7781	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7782	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7783		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7784
7785	        # Commands to make compiler produce verbose output that lists
7786	        # what "hidden" libraries, object files and flags are used when
7787	        # linking a shared library.
7788	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7789	      fi
7790
7791	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7792	      case $host_os in
7793		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7794		*)
7795		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7796		  ;;
7797	      esac
7798	    fi
7799	    ;;
7800        esac
7801        ;;
7802
7803    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7804      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7805      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7806      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7807      runpath_var='LD_RUN_PATH'
7808
7809      case $cc_basename in
7810        CC*)
7811	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7812	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7813	  ;;
7814	*)
7815	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7816	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7817	  ;;
7818      esac
7819      ;;
7820
7821      sysv5* | sco3.2v5* | sco5v6*)
7822	# Note: We can NOT use -z defs as we might desire, because we do not
7823	# link with -lc, and that would cause any symbols used from libc to
7824	# always be unresolved, which means just about no library would
7825	# ever link correctly.  If we're not using GNU ld we use -z text
7826	# though, which does catch some bad symbols but isn't as heavy-handed
7827	# as -z defs.
7828	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7829	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7830	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7831	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7832	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7833	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7834	_LT_TAGVAR(link_all_deplibs, $1)=yes
7835	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7836	runpath_var='LD_RUN_PATH'
7837
7838	case $cc_basename in
7839          CC*)
7840	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7841	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7842	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7843	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7844	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7845	      '"$_LT_TAGVAR(reload_cmds, $1)"
7846	    ;;
7847	  *)
7848	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7849	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7850	    ;;
7851	esac
7852      ;;
7853
7854      tandem*)
7855        case $cc_basename in
7856          NCC*)
7857	    # NonStop-UX NCC 3.20
7858	    # FIXME: insert proper C++ library support
7859	    _LT_TAGVAR(ld_shlibs, $1)=no
7860	    ;;
7861          *)
7862	    # FIXME: insert proper C++ library support
7863	    _LT_TAGVAR(ld_shlibs, $1)=no
7864	    ;;
7865        esac
7866        ;;
7867
7868      vxworks*)
7869        # FIXME: insert proper C++ library support
7870        _LT_TAGVAR(ld_shlibs, $1)=no
7871        ;;
7872
7873      *)
7874        # FIXME: insert proper C++ library support
7875        _LT_TAGVAR(ld_shlibs, $1)=no
7876        ;;
7877    esac
7878
7879    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7880    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7881
7882    _LT_TAGVAR(GCC, $1)="$GXX"
7883    _LT_TAGVAR(LD, $1)="$LD"
7884
7885    ## CAVEAT EMPTOR:
7886    ## There is no encapsulation within the following macros, do not change
7887    ## the running order or otherwise move them around unless you know exactly
7888    ## what you are doing...
7889    _LT_SYS_HIDDEN_LIBDEPS($1)
7890    _LT_COMPILER_PIC($1)
7891    _LT_COMPILER_C_O($1)
7892    _LT_COMPILER_FILE_LOCKS($1)
7893    _LT_LINKER_SHLIBS($1)
7894    _LT_SYS_DYNAMIC_LINKER($1)
7895    _LT_LINKER_HARDCODE_LIBPATH($1)
7896
7897    _LT_CONFIG($1)
7898  fi # test -n "$compiler"
7899
7900  CC=$lt_save_CC
7901  CFLAGS=$lt_save_CFLAGS
7902  LDCXX=$LD
7903  LD=$lt_save_LD
7904  GCC=$lt_save_GCC
7905  with_gnu_ld=$lt_save_with_gnu_ld
7906  lt_cv_path_LDCXX=$lt_cv_path_LD
7907  lt_cv_path_LD=$lt_save_path_LD
7908  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7909  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7910fi # test "$_lt_caught_CXX_error" != yes
7911
7912AC_LANG_POP
7913])# _LT_LANG_CXX_CONFIG
7914
7915
7916# _LT_FUNC_STRIPNAME_CNF
7917# ----------------------
7918# func_stripname_cnf prefix suffix name
7919# strip PREFIX and SUFFIX off of NAME.
7920# PREFIX and SUFFIX must not contain globbing or regex special
7921# characters, hashes, percent signs, but SUFFIX may contain a leading
7922# dot (in which case that matches only a dot).
7923#
7924# This function is identical to the (non-XSI) version of func_stripname,
7925# except this one can be used by m4 code that may be executed by configure,
7926# rather than the libtool script.
7927m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7928AC_REQUIRE([_LT_DECL_SED])
7929AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7930func_stripname_cnf ()
7931{
7932  case ${2} in
7933  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7934  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7935  esac
7936} # func_stripname_cnf
7937])# _LT_FUNC_STRIPNAME_CNF
7938
7939# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7940# ---------------------------------
7941# Figure out "hidden" library dependencies from verbose
7942# compiler output when linking a shared library.
7943# Parse the compiler output and extract the necessary
7944# objects, libraries and library flags.
7945m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7946[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7947AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7948# Dependencies to place before and after the object being linked:
7949_LT_TAGVAR(predep_objects, $1)=
7950_LT_TAGVAR(postdep_objects, $1)=
7951_LT_TAGVAR(predeps, $1)=
7952_LT_TAGVAR(postdeps, $1)=
7953_LT_TAGVAR(compiler_lib_search_path, $1)=
7954
7955dnl we can't use the lt_simple_compile_test_code here,
7956dnl because it contains code intended for an executable,
7957dnl not a library.  It's possible we should let each
7958dnl tag define a new lt_????_link_test_code variable,
7959dnl but it's only used here...
7960m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7961int a;
7962void foo (void) { a = 0; }
7963_LT_EOF
7964], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7965class Foo
7966{
7967public:
7968  Foo (void) { a = 0; }
7969private:
7970  int a;
7971};
7972_LT_EOF
7973], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7974      subroutine foo
7975      implicit none
7976      integer*4 a
7977      a=0
7978      return
7979      end
7980_LT_EOF
7981], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7982      subroutine foo
7983      implicit none
7984      integer a
7985      a=0
7986      return
7987      end
7988_LT_EOF
7989], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7990public class foo {
7991  private int a;
7992  public void bar (void) {
7993    a = 0;
7994  }
7995};
7996_LT_EOF
7997], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7998package foo
7999func foo() {
8000}
8001_LT_EOF
8002])
8003
8004_lt_libdeps_save_CFLAGS=$CFLAGS
8005case "$CC $CFLAGS " in #(
8006*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8007*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8008*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8009esac
8010
8011dnl Parse the compiler output and extract the necessary
8012dnl objects, libraries and library flags.
8013if AC_TRY_EVAL(ac_compile); then
8014  # Parse the compiler output and extract the necessary
8015  # objects, libraries and library flags.
8016
8017  # Sentinel used to keep track of whether or not we are before
8018  # the conftest object file.
8019  pre_test_object_deps_done=no
8020
8021  for p in `eval "$output_verbose_link_cmd"`; do
8022    case ${prev}${p} in
8023
8024    -L* | -R* | -l*)
8025       # Some compilers place space between "-{L,R}" and the path.
8026       # Remove the space.
8027       if test $p = "-L" ||
8028          test $p = "-R"; then
8029	 prev=$p
8030	 continue
8031       fi
8032
8033       # Expand the sysroot to ease extracting the directories later.
8034       if test -z "$prev"; then
8035         case $p in
8036         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8037         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8038         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8039         esac
8040       fi
8041       case $p in
8042       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8043       esac
8044       if test "$pre_test_object_deps_done" = no; then
8045	 case ${prev} in
8046	 -L | -R)
8047	   # Internal compiler library paths should come after those
8048	   # provided the user.  The postdeps already come after the
8049	   # user supplied libs so there is no need to process them.
8050	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8051	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8052	   else
8053	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8054	   fi
8055	   ;;
8056	 # The "-l" case would never come before the object being
8057	 # linked, so don't bother handling this case.
8058	 esac
8059       else
8060	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8061	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8062	 else
8063	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8064	 fi
8065       fi
8066       prev=
8067       ;;
8068
8069    *.lto.$objext) ;; # Ignore GCC LTO objects
8070    *.$objext)
8071       # This assumes that the test object file only shows up
8072       # once in the compiler output.
8073       if test "$p" = "conftest.$objext"; then
8074	 pre_test_object_deps_done=yes
8075	 continue
8076       fi
8077
8078       if test "$pre_test_object_deps_done" = no; then
8079	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8080	   _LT_TAGVAR(predep_objects, $1)="$p"
8081	 else
8082	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8083	 fi
8084       else
8085	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8086	   _LT_TAGVAR(postdep_objects, $1)="$p"
8087	 else
8088	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8089	 fi
8090       fi
8091       ;;
8092
8093    *) ;; # Ignore the rest.
8094
8095    esac
8096  done
8097
8098  # Clean up.
8099  rm -f a.out a.exe
8100else
8101  echo "libtool.m4: error: problem compiling $1 test program"
8102fi
8103
8104$RM -f confest.$objext
8105CFLAGS=$_lt_libdeps_save_CFLAGS
8106
8107# PORTME: override above test on systems where it is broken
8108m4_if([$1], [CXX],
8109[case $host_os in
8110interix[[3-9]]*)
8111  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8112  # hack all around it, let's just trust "g++" to DTRT.
8113  _LT_TAGVAR(predep_objects,$1)=
8114  _LT_TAGVAR(postdep_objects,$1)=
8115  _LT_TAGVAR(postdeps,$1)=
8116  ;;
8117
8118linux*)
8119  case `$CC -V 2>&1 | sed 5q` in
8120  *Sun\ C*)
8121    # Sun C++ 5.9
8122
8123    # The more standards-conforming stlport4 library is
8124    # incompatible with the Cstd library. Avoid specifying
8125    # it if it's in CXXFLAGS. Ignore libCrun as
8126    # -library=stlport4 depends on it.
8127    case " $CXX $CXXFLAGS " in
8128    *" -library=stlport4 "*)
8129      solaris_use_stlport4=yes
8130      ;;
8131    esac
8132
8133    if test "$solaris_use_stlport4" != yes; then
8134      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8135    fi
8136    ;;
8137  esac
8138  ;;
8139
8140solaris*)
8141  case $cc_basename in
8142  CC* | sunCC*)
8143    # The more standards-conforming stlport4 library is
8144    # incompatible with the Cstd library. Avoid specifying
8145    # it if it's in CXXFLAGS. Ignore libCrun as
8146    # -library=stlport4 depends on it.
8147    case " $CXX $CXXFLAGS " in
8148    *" -library=stlport4 "*)
8149      solaris_use_stlport4=yes
8150      ;;
8151    esac
8152
8153    # Adding this requires a known-good setup of shared libraries for
8154    # Sun compiler versions before 5.6, else PIC objects from an old
8155    # archive will be linked into the output, leading to subtle bugs.
8156    if test "$solaris_use_stlport4" != yes; then
8157      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8158    fi
8159    ;;
8160  esac
8161  ;;
8162esac
8163])
8164
8165case " $_LT_TAGVAR(postdeps, $1) " in
8166*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8167esac
8168 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8169if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8170 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8171fi
8172_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8173    [The directories searched by this compiler when creating a shared library])
8174_LT_TAGDECL([], [predep_objects], [1],
8175    [Dependencies to place before and after the objects being linked to
8176    create a shared library])
8177_LT_TAGDECL([], [postdep_objects], [1])
8178_LT_TAGDECL([], [predeps], [1])
8179_LT_TAGDECL([], [postdeps], [1])
8180_LT_TAGDECL([], [compiler_lib_search_path], [1],
8181    [The library search path used internally by the compiler when linking
8182    a shared library])
8183])# _LT_SYS_HIDDEN_LIBDEPS
8184
8185
8186# _LT_LANG_F77_CONFIG([TAG])
8187# --------------------------
8188# Ensure that the configuration variables for a Fortran 77 compiler are
8189# suitably defined.  These variables are subsequently used by _LT_CONFIG
8190# to write the compiler configuration to `libtool'.
8191m4_defun([_LT_LANG_F77_CONFIG],
8192[AC_LANG_PUSH(Fortran 77)
8193if test -z "$F77" || test "X$F77" = "Xno"; then
8194  _lt_disable_F77=yes
8195fi
8196
8197_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8198_LT_TAGVAR(allow_undefined_flag, $1)=
8199_LT_TAGVAR(always_export_symbols, $1)=no
8200_LT_TAGVAR(archive_expsym_cmds, $1)=
8201_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8202_LT_TAGVAR(hardcode_direct, $1)=no
8203_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8204_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8205_LT_TAGVAR(hardcode_libdir_separator, $1)=
8206_LT_TAGVAR(hardcode_minus_L, $1)=no
8207_LT_TAGVAR(hardcode_automatic, $1)=no
8208_LT_TAGVAR(inherit_rpath, $1)=no
8209_LT_TAGVAR(module_cmds, $1)=
8210_LT_TAGVAR(module_expsym_cmds, $1)=
8211_LT_TAGVAR(link_all_deplibs, $1)=unknown
8212_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8213_LT_TAGVAR(reload_flag, $1)=$reload_flag
8214_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8215_LT_TAGVAR(no_undefined_flag, $1)=
8216_LT_TAGVAR(whole_archive_flag_spec, $1)=
8217_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8218
8219# Source file extension for f77 test sources.
8220ac_ext=f
8221
8222# Object file extension for compiled f77 test sources.
8223objext=o
8224_LT_TAGVAR(objext, $1)=$objext
8225
8226# No sense in running all these tests if we already determined that
8227# the F77 compiler isn't working.  Some variables (like enable_shared)
8228# are currently assumed to apply to all compilers on this platform,
8229# and will be corrupted by setting them based on a non-working compiler.
8230if test "$_lt_disable_F77" != yes; then
8231  # Code to be used in simple compile tests
8232  lt_simple_compile_test_code="\
8233      subroutine t
8234      return
8235      end
8236"
8237
8238  # Code to be used in simple link tests
8239  lt_simple_link_test_code="\
8240      program t
8241      end
8242"
8243
8244  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8245  _LT_TAG_COMPILER
8246
8247  # save warnings/boilerplate of simple test code
8248  _LT_COMPILER_BOILERPLATE
8249  _LT_LINKER_BOILERPLATE
8250
8251  # Allow CC to be a program name with arguments.
8252  lt_save_CC="$CC"
8253  lt_save_GCC=$GCC
8254  lt_save_CFLAGS=$CFLAGS
8255  CC=${F77-"f77"}
8256  CFLAGS=$FFLAGS
8257  compiler=$CC
8258  _LT_TAGVAR(compiler, $1)=$CC
8259  _LT_CC_BASENAME([$compiler])
8260  GCC=$G77
8261  if test -n "$compiler"; then
8262    AC_MSG_CHECKING([if libtool supports shared libraries])
8263    AC_MSG_RESULT([$can_build_shared])
8264
8265    AC_MSG_CHECKING([whether to build shared libraries])
8266    test "$can_build_shared" = "no" && enable_shared=no
8267
8268    # On AIX, shared libraries and static libraries use the same namespace, and
8269    # are all built from PIC.
8270    case $host_os in
8271      aix3*)
8272        test "$enable_shared" = yes && enable_static=no
8273        if test -n "$RANLIB"; then
8274          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8275          postinstall_cmds='$RANLIB $lib'
8276        fi
8277        ;;
8278      aix[[4-9]]*)
8279	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8280	  test "$enable_shared" = yes && enable_static=no
8281	fi
8282        ;;
8283    esac
8284    AC_MSG_RESULT([$enable_shared])
8285
8286    AC_MSG_CHECKING([whether to build static libraries])
8287    # Make sure either enable_shared or enable_static is yes.
8288    test "$enable_shared" = yes || enable_static=yes
8289    AC_MSG_RESULT([$enable_static])
8290
8291    _LT_TAGVAR(GCC, $1)="$G77"
8292    _LT_TAGVAR(LD, $1)="$LD"
8293
8294    ## CAVEAT EMPTOR:
8295    ## There is no encapsulation within the following macros, do not change
8296    ## the running order or otherwise move them around unless you know exactly
8297    ## what you are doing...
8298    _LT_COMPILER_PIC($1)
8299    _LT_COMPILER_C_O($1)
8300    _LT_COMPILER_FILE_LOCKS($1)
8301    _LT_LINKER_SHLIBS($1)
8302    _LT_SYS_DYNAMIC_LINKER($1)
8303    _LT_LINKER_HARDCODE_LIBPATH($1)
8304
8305    _LT_CONFIG($1)
8306  fi # test -n "$compiler"
8307
8308  GCC=$lt_save_GCC
8309  CC="$lt_save_CC"
8310  CFLAGS="$lt_save_CFLAGS"
8311fi # test "$_lt_disable_F77" != yes
8312
8313AC_LANG_POP
8314])# _LT_LANG_F77_CONFIG
8315
8316
8317# _LT_LANG_FC_CONFIG([TAG])
8318# -------------------------
8319# Ensure that the configuration variables for a Fortran compiler are
8320# suitably defined.  These variables are subsequently used by _LT_CONFIG
8321# to write the compiler configuration to `libtool'.
8322m4_defun([_LT_LANG_FC_CONFIG],
8323[AC_LANG_PUSH(Fortran)
8324
8325if test -z "$FC" || test "X$FC" = "Xno"; then
8326  _lt_disable_FC=yes
8327fi
8328
8329_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8330_LT_TAGVAR(allow_undefined_flag, $1)=
8331_LT_TAGVAR(always_export_symbols, $1)=no
8332_LT_TAGVAR(archive_expsym_cmds, $1)=
8333_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8334_LT_TAGVAR(hardcode_direct, $1)=no
8335_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8336_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8337_LT_TAGVAR(hardcode_libdir_separator, $1)=
8338_LT_TAGVAR(hardcode_minus_L, $1)=no
8339_LT_TAGVAR(hardcode_automatic, $1)=no
8340_LT_TAGVAR(inherit_rpath, $1)=no
8341_LT_TAGVAR(module_cmds, $1)=
8342_LT_TAGVAR(module_expsym_cmds, $1)=
8343_LT_TAGVAR(link_all_deplibs, $1)=unknown
8344_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8345_LT_TAGVAR(reload_flag, $1)=$reload_flag
8346_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8347_LT_TAGVAR(no_undefined_flag, $1)=
8348_LT_TAGVAR(whole_archive_flag_spec, $1)=
8349_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8350
8351# Source file extension for fc test sources.
8352ac_ext=${ac_fc_srcext-f}
8353
8354# Object file extension for compiled fc test sources.
8355objext=o
8356_LT_TAGVAR(objext, $1)=$objext
8357
8358# No sense in running all these tests if we already determined that
8359# the FC compiler isn't working.  Some variables (like enable_shared)
8360# are currently assumed to apply to all compilers on this platform,
8361# and will be corrupted by setting them based on a non-working compiler.
8362if test "$_lt_disable_FC" != yes; then
8363  # Code to be used in simple compile tests
8364  lt_simple_compile_test_code="\
8365      subroutine t
8366      return
8367      end
8368"
8369
8370  # Code to be used in simple link tests
8371  lt_simple_link_test_code="\
8372      program t
8373      end
8374"
8375
8376  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8377  _LT_TAG_COMPILER
8378
8379  # save warnings/boilerplate of simple test code
8380  _LT_COMPILER_BOILERPLATE
8381  _LT_LINKER_BOILERPLATE
8382
8383  # Allow CC to be a program name with arguments.
8384  lt_save_CC="$CC"
8385  lt_save_GCC=$GCC
8386  lt_save_CFLAGS=$CFLAGS
8387  CC=${FC-"f95"}
8388  CFLAGS=$FCFLAGS
8389  compiler=$CC
8390  GCC=$ac_cv_fc_compiler_gnu
8391
8392  _LT_TAGVAR(compiler, $1)=$CC
8393  _LT_CC_BASENAME([$compiler])
8394
8395  if test -n "$compiler"; then
8396    AC_MSG_CHECKING([if libtool supports shared libraries])
8397    AC_MSG_RESULT([$can_build_shared])
8398
8399    AC_MSG_CHECKING([whether to build shared libraries])
8400    test "$can_build_shared" = "no" && enable_shared=no
8401
8402    # On AIX, shared libraries and static libraries use the same namespace, and
8403    # are all built from PIC.
8404    case $host_os in
8405      aix3*)
8406        test "$enable_shared" = yes && enable_static=no
8407        if test -n "$RANLIB"; then
8408          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8409          postinstall_cmds='$RANLIB $lib'
8410        fi
8411        ;;
8412      aix[[4-9]]*)
8413	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8414	  test "$enable_shared" = yes && enable_static=no
8415	fi
8416        ;;
8417    esac
8418    AC_MSG_RESULT([$enable_shared])
8419
8420    AC_MSG_CHECKING([whether to build static libraries])
8421    # Make sure either enable_shared or enable_static is yes.
8422    test "$enable_shared" = yes || enable_static=yes
8423    AC_MSG_RESULT([$enable_static])
8424
8425    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8426    _LT_TAGVAR(LD, $1)="$LD"
8427
8428    ## CAVEAT EMPTOR:
8429    ## There is no encapsulation within the following macros, do not change
8430    ## the running order or otherwise move them around unless you know exactly
8431    ## what you are doing...
8432    _LT_SYS_HIDDEN_LIBDEPS($1)
8433    _LT_COMPILER_PIC($1)
8434    _LT_COMPILER_C_O($1)
8435    _LT_COMPILER_FILE_LOCKS($1)
8436    _LT_LINKER_SHLIBS($1)
8437    _LT_SYS_DYNAMIC_LINKER($1)
8438    _LT_LINKER_HARDCODE_LIBPATH($1)
8439
8440    _LT_CONFIG($1)
8441  fi # test -n "$compiler"
8442
8443  GCC=$lt_save_GCC
8444  CC=$lt_save_CC
8445  CFLAGS=$lt_save_CFLAGS
8446fi # test "$_lt_disable_FC" != yes
8447
8448AC_LANG_POP
8449])# _LT_LANG_FC_CONFIG
8450
8451
8452# _LT_LANG_GCJ_CONFIG([TAG])
8453# --------------------------
8454# Ensure that the configuration variables for the GNU Java Compiler compiler
8455# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8456# to write the compiler configuration to `libtool'.
8457m4_defun([_LT_LANG_GCJ_CONFIG],
8458[AC_REQUIRE([LT_PROG_GCJ])dnl
8459AC_LANG_SAVE
8460
8461# Source file extension for Java test sources.
8462ac_ext=java
8463
8464# Object file extension for compiled Java test sources.
8465objext=o
8466_LT_TAGVAR(objext, $1)=$objext
8467
8468# Code to be used in simple compile tests
8469lt_simple_compile_test_code="class foo {}"
8470
8471# Code to be used in simple link tests
8472lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8473
8474# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8475_LT_TAG_COMPILER
8476
8477# save warnings/boilerplate of simple test code
8478_LT_COMPILER_BOILERPLATE
8479_LT_LINKER_BOILERPLATE
8480
8481# Allow CC to be a program name with arguments.
8482lt_save_CC=$CC
8483lt_save_CFLAGS=$CFLAGS
8484lt_save_GCC=$GCC
8485GCC=yes
8486CC=${GCJ-"gcj"}
8487CFLAGS=$GCJFLAGS
8488compiler=$CC
8489_LT_TAGVAR(compiler, $1)=$CC
8490_LT_TAGVAR(LD, $1)="$LD"
8491_LT_CC_BASENAME([$compiler])
8492
8493# GCJ did not exist at the time GCC didn't implicitly link libc in.
8494_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8495
8496_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8497_LT_TAGVAR(reload_flag, $1)=$reload_flag
8498_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8499
8500if test -n "$compiler"; then
8501  _LT_COMPILER_NO_RTTI($1)
8502  _LT_COMPILER_PIC($1)
8503  _LT_COMPILER_C_O($1)
8504  _LT_COMPILER_FILE_LOCKS($1)
8505  _LT_LINKER_SHLIBS($1)
8506  _LT_LINKER_HARDCODE_LIBPATH($1)
8507
8508  _LT_CONFIG($1)
8509fi
8510
8511AC_LANG_RESTORE
8512
8513GCC=$lt_save_GCC
8514CC=$lt_save_CC
8515CFLAGS=$lt_save_CFLAGS
8516])# _LT_LANG_GCJ_CONFIG
8517
8518
8519# _LT_LANG_GO_CONFIG([TAG])
8520# --------------------------
8521# Ensure that the configuration variables for the GNU Go compiler
8522# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8523# to write the compiler configuration to `libtool'.
8524m4_defun([_LT_LANG_GO_CONFIG],
8525[AC_REQUIRE([LT_PROG_GO])dnl
8526AC_LANG_SAVE
8527
8528# Source file extension for Go test sources.
8529ac_ext=go
8530
8531# Object file extension for compiled Go test sources.
8532objext=o
8533_LT_TAGVAR(objext, $1)=$objext
8534
8535# Code to be used in simple compile tests
8536lt_simple_compile_test_code="package main; func main() { }"
8537
8538# Code to be used in simple link tests
8539lt_simple_link_test_code='package main; func main() { }'
8540
8541# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8542_LT_TAG_COMPILER
8543
8544# save warnings/boilerplate of simple test code
8545_LT_COMPILER_BOILERPLATE
8546_LT_LINKER_BOILERPLATE
8547
8548# Allow CC to be a program name with arguments.
8549lt_save_CC=$CC
8550lt_save_CFLAGS=$CFLAGS
8551lt_save_GCC=$GCC
8552GCC=yes
8553CC=${GOC-"gccgo"}
8554CFLAGS=$GOFLAGS
8555compiler=$CC
8556_LT_TAGVAR(compiler, $1)=$CC
8557_LT_TAGVAR(LD, $1)="$LD"
8558_LT_CC_BASENAME([$compiler])
8559
8560# Go did not exist at the time GCC didn't implicitly link libc in.
8561_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8562
8563_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8564_LT_TAGVAR(reload_flag, $1)=$reload_flag
8565_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8566
8567if test -n "$compiler"; then
8568  _LT_COMPILER_NO_RTTI($1)
8569  _LT_COMPILER_PIC($1)
8570  _LT_COMPILER_C_O($1)
8571  _LT_COMPILER_FILE_LOCKS($1)
8572  _LT_LINKER_SHLIBS($1)
8573  _LT_LINKER_HARDCODE_LIBPATH($1)
8574
8575  _LT_CONFIG($1)
8576fi
8577
8578AC_LANG_RESTORE
8579
8580GCC=$lt_save_GCC
8581CC=$lt_save_CC
8582CFLAGS=$lt_save_CFLAGS
8583])# _LT_LANG_GO_CONFIG
8584
8585
8586# _LT_LANG_RC_CONFIG([TAG])
8587# -------------------------
8588# Ensure that the configuration variables for the Windows resource compiler
8589# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8590# to write the compiler configuration to `libtool'.
8591m4_defun([_LT_LANG_RC_CONFIG],
8592[AC_REQUIRE([LT_PROG_RC])dnl
8593AC_LANG_SAVE
8594
8595# Source file extension for RC test sources.
8596ac_ext=rc
8597
8598# Object file extension for compiled RC test sources.
8599objext=o
8600_LT_TAGVAR(objext, $1)=$objext
8601
8602# Code to be used in simple compile tests
8603lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8604
8605# Code to be used in simple link tests
8606lt_simple_link_test_code="$lt_simple_compile_test_code"
8607
8608# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8609_LT_TAG_COMPILER
8610
8611# save warnings/boilerplate of simple test code
8612_LT_COMPILER_BOILERPLATE
8613_LT_LINKER_BOILERPLATE
8614
8615# Allow CC to be a program name with arguments.
8616lt_save_CC="$CC"
8617lt_save_CFLAGS=$CFLAGS
8618lt_save_GCC=$GCC
8619GCC=
8620CC=${RC-"windres"}
8621CFLAGS=
8622compiler=$CC
8623_LT_TAGVAR(compiler, $1)=$CC
8624_LT_CC_BASENAME([$compiler])
8625_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8626
8627if test -n "$compiler"; then
8628  :
8629  _LT_CONFIG($1)
8630fi
8631
8632GCC=$lt_save_GCC
8633AC_LANG_RESTORE
8634CC=$lt_save_CC
8635CFLAGS=$lt_save_CFLAGS
8636])# _LT_LANG_RC_CONFIG
8637
8638
8639# LT_PROG_GCJ
8640# -----------
8641AC_DEFUN([LT_PROG_GCJ],
8642[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8643  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8644    [AC_CHECK_TOOL(GCJ, gcj,)
8645      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8646      AC_SUBST(GCJFLAGS)])])[]dnl
8647])
8648
8649# Old name:
8650AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8651dnl aclocal-1.4 backwards compatibility:
8652dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8653
8654
8655# LT_PROG_GO
8656# ----------
8657AC_DEFUN([LT_PROG_GO],
8658[AC_CHECK_TOOL(GOC, gccgo,)
8659])
8660
8661
8662# LT_PROG_RC
8663# ----------
8664AC_DEFUN([LT_PROG_RC],
8665[AC_CHECK_TOOL(RC, windres,)
8666])
8667
8668# Old name:
8669AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8670dnl aclocal-1.4 backwards compatibility:
8671dnl AC_DEFUN([LT_AC_PROG_RC], [])
8672
8673
8674# _LT_DECL_EGREP
8675# --------------
8676# If we don't have a new enough Autoconf to choose the best grep
8677# available, choose the one first in the user's PATH.
8678m4_defun([_LT_DECL_EGREP],
8679[AC_REQUIRE([AC_PROG_EGREP])dnl
8680AC_REQUIRE([AC_PROG_FGREP])dnl
8681test -z "$GREP" && GREP=grep
8682_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8683_LT_DECL([], [EGREP], [1], [An ERE matcher])
8684_LT_DECL([], [FGREP], [1], [A literal string matcher])
8685dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8686AC_SUBST([GREP])
8687])
8688
8689
8690# _LT_DECL_OBJDUMP
8691# --------------
8692# If we don't have a new enough Autoconf to choose the best objdump
8693# available, choose the one first in the user's PATH.
8694m4_defun([_LT_DECL_OBJDUMP],
8695[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8696test -z "$OBJDUMP" && OBJDUMP=objdump
8697_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8698AC_SUBST([OBJDUMP])
8699])
8700
8701# _LT_DECL_DLLTOOL
8702# ----------------
8703# Ensure DLLTOOL variable is set.
8704m4_defun([_LT_DECL_DLLTOOL],
8705[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8706test -z "$DLLTOOL" && DLLTOOL=dlltool
8707_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8708AC_SUBST([DLLTOOL])
8709])
8710
8711# _LT_DECL_SED
8712# ------------
8713# Check for a fully-functional sed program, that truncates
8714# as few characters as possible.  Prefer GNU sed if found.
8715m4_defun([_LT_DECL_SED],
8716[AC_PROG_SED
8717test -z "$SED" && SED=sed
8718Xsed="$SED -e 1s/^X//"
8719_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8720_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8721    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8722])# _LT_DECL_SED
8723
8724m4_ifndef([AC_PROG_SED], [
8725# NOTE: This macro has been submitted for inclusion into   #
8726#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8727#  a released version of Autoconf we should remove this    #
8728#  macro and use it instead.                               #
8729
8730m4_defun([AC_PROG_SED],
8731[AC_MSG_CHECKING([for a sed that does not truncate output])
8732AC_CACHE_VAL(lt_cv_path_SED,
8733[# Loop through the user's path and test for sed and gsed.
8734# Then use that list of sed's as ones to test for truncation.
8735as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8736for as_dir in $PATH
8737do
8738  IFS=$as_save_IFS
8739  test -z "$as_dir" && as_dir=.
8740  for lt_ac_prog in sed gsed; do
8741    for ac_exec_ext in '' $ac_executable_extensions; do
8742      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8743        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8744      fi
8745    done
8746  done
8747done
8748IFS=$as_save_IFS
8749lt_ac_max=0
8750lt_ac_count=0
8751# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8752# along with /bin/sed that truncates output.
8753for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8754  test ! -f $lt_ac_sed && continue
8755  cat /dev/null > conftest.in
8756  lt_ac_count=0
8757  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8758  # Check for GNU sed and select it if it is found.
8759  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8760    lt_cv_path_SED=$lt_ac_sed
8761    break
8762  fi
8763  while true; do
8764    cat conftest.in conftest.in >conftest.tmp
8765    mv conftest.tmp conftest.in
8766    cp conftest.in conftest.nl
8767    echo >>conftest.nl
8768    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8769    cmp -s conftest.out conftest.nl || break
8770    # 10000 chars as input seems more than enough
8771    test $lt_ac_count -gt 10 && break
8772    lt_ac_count=`expr $lt_ac_count + 1`
8773    if test $lt_ac_count -gt $lt_ac_max; then
8774      lt_ac_max=$lt_ac_count
8775      lt_cv_path_SED=$lt_ac_sed
8776    fi
8777  done
8778done
8779])
8780SED=$lt_cv_path_SED
8781AC_SUBST([SED])
8782AC_MSG_RESULT([$SED])
8783])#AC_PROG_SED
8784])#m4_ifndef
8785
8786# Old name:
8787AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8788dnl aclocal-1.4 backwards compatibility:
8789dnl AC_DEFUN([LT_AC_PROG_SED], [])
8790
8791
8792# _LT_CHECK_SHELL_FEATURES
8793# ------------------------
8794# Find out whether the shell is Bourne or XSI compatible,
8795# or has some other useful features.
8796m4_defun([_LT_CHECK_SHELL_FEATURES],
8797[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8798# Try some XSI features
8799xsi_shell=no
8800( _lt_dummy="a/b/c"
8801  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8802      = c,a/b,b/c, \
8803    && eval 'test $(( 1 + 1 )) -eq 2 \
8804    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8805  && xsi_shell=yes
8806AC_MSG_RESULT([$xsi_shell])
8807_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8808
8809AC_MSG_CHECKING([whether the shell understands "+="])
8810lt_shell_append=no
8811( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8812    >/dev/null 2>&1 \
8813  && lt_shell_append=yes
8814AC_MSG_RESULT([$lt_shell_append])
8815_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8816
8817if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8818  lt_unset=unset
8819else
8820  lt_unset=false
8821fi
8822_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8823
8824# test EBCDIC or ASCII
8825case `echo X|tr X '\101'` in
8826 A) # ASCII based system
8827    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8828  lt_SP2NL='tr \040 \012'
8829  lt_NL2SP='tr \015\012 \040\040'
8830  ;;
8831 *) # EBCDIC based system
8832  lt_SP2NL='tr \100 \n'
8833  lt_NL2SP='tr \r\n \100\100'
8834  ;;
8835esac
8836_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8837_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8838])# _LT_CHECK_SHELL_FEATURES
8839
8840
8841# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8842# ------------------------------------------------------
8843# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8844# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8845m4_defun([_LT_PROG_FUNCTION_REPLACE],
8846[dnl {
8847sed -e '/^$1 ()$/,/^} # $1 /c\
8848$1 ()\
8849{\
8850m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8851} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8852  && mv -f "$cfgfile.tmp" "$cfgfile" \
8853    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8854test 0 -eq $? || _lt_function_replace_fail=:
8855])
8856
8857
8858# _LT_PROG_REPLACE_SHELLFNS
8859# -------------------------
8860# Replace existing portable implementations of several shell functions with
8861# equivalent extended shell implementations where those features are available..
8862m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8863[if test x"$xsi_shell" = xyes; then
8864  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8865    case ${1} in
8866      */*) func_dirname_result="${1%/*}${2}" ;;
8867      *  ) func_dirname_result="${3}" ;;
8868    esac])
8869
8870  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8871    func_basename_result="${1##*/}"])
8872
8873  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8874    case ${1} in
8875      */*) func_dirname_result="${1%/*}${2}" ;;
8876      *  ) func_dirname_result="${3}" ;;
8877    esac
8878    func_basename_result="${1##*/}"])
8879
8880  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8881    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8882    # positional parameters, so assign one to ordinary parameter first.
8883    func_stripname_result=${3}
8884    func_stripname_result=${func_stripname_result#"${1}"}
8885    func_stripname_result=${func_stripname_result%"${2}"}])
8886
8887  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8888    func_split_long_opt_name=${1%%=*}
8889    func_split_long_opt_arg=${1#*=}])
8890
8891  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8892    func_split_short_opt_arg=${1#??}
8893    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8894
8895  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8896    case ${1} in
8897      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8898      *)    func_lo2o_result=${1} ;;
8899    esac])
8900
8901  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8902
8903  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8904
8905  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8906fi
8907
8908if test x"$lt_shell_append" = xyes; then
8909  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8910
8911  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8912    func_quote_for_eval "${2}"
8913dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8914    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8915
8916  # Save a `func_append' function call where possible by direct use of '+='
8917  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8918    && mv -f "$cfgfile.tmp" "$cfgfile" \
8919      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8920  test 0 -eq $? || _lt_function_replace_fail=:
8921else
8922  # Save a `func_append' function call even when '+=' is not available
8923  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8924    && mv -f "$cfgfile.tmp" "$cfgfile" \
8925      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8926  test 0 -eq $? || _lt_function_replace_fail=:
8927fi
8928
8929if test x"$_lt_function_replace_fail" = x":"; then
8930  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8931fi
8932])
8933
8934# _LT_PATH_CONVERSION_FUNCTIONS
8935# -----------------------------
8936# Determine which file name conversion functions should be used by
8937# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8938# for certain cross-compile configurations and native mingw.
8939m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8940[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8941AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8942AC_MSG_CHECKING([how to convert $build file names to $host format])
8943AC_CACHE_VAL(lt_cv_to_host_file_cmd,
8944[case $host in
8945  *-*-mingw* )
8946    case $build in
8947      *-*-mingw* ) # actually msys
8948        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8949        ;;
8950      *-*-cygwin* )
8951        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8952        ;;
8953      * ) # otherwise, assume *nix
8954        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8955        ;;
8956    esac
8957    ;;
8958  *-*-cygwin* )
8959    case $build in
8960      *-*-mingw* ) # actually msys
8961        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8962        ;;
8963      *-*-cygwin* )
8964        lt_cv_to_host_file_cmd=func_convert_file_noop
8965        ;;
8966      * ) # otherwise, assume *nix
8967        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8968        ;;
8969    esac
8970    ;;
8971  * ) # unhandled hosts (and "normal" native builds)
8972    lt_cv_to_host_file_cmd=func_convert_file_noop
8973    ;;
8974esac
8975])
8976to_host_file_cmd=$lt_cv_to_host_file_cmd
8977AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8978_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8979         [0], [convert $build file names to $host format])dnl
8980
8981AC_MSG_CHECKING([how to convert $build file names to toolchain format])
8982AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8983[#assume ordinary cross tools, or native build.
8984lt_cv_to_tool_file_cmd=func_convert_file_noop
8985case $host in
8986  *-*-mingw* )
8987    case $build in
8988      *-*-mingw* ) # actually msys
8989        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8990        ;;
8991    esac
8992    ;;
8993esac
8994])
8995to_tool_file_cmd=$lt_cv_to_tool_file_cmd
8996AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8997_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8998         [0], [convert $build files to toolchain format])dnl
8999])# _LT_PATH_CONVERSION_FUNCTIONS
9000
9001# Helper functions for option handling.                    -*- Autoconf -*-
9002#
9003#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9004#   Inc.
9005#   Written by Gary V. Vaughan, 2004
9006#
9007# This file is free software; the Free Software Foundation gives
9008# unlimited permission to copy and/or distribute it, with or without
9009# modifications, as long as this notice is preserved.
9010
9011# serial 7 ltoptions.m4
9012
9013# This is to help aclocal find these macros, as it can't see m4_define.
9014AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9015
9016
9017# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9018# ------------------------------------------
9019m4_define([_LT_MANGLE_OPTION],
9020[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9021
9022
9023# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9024# ---------------------------------------
9025# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9026# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9027# saved as a flag.
9028m4_define([_LT_SET_OPTION],
9029[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9030m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9031        _LT_MANGLE_DEFUN([$1], [$2]),
9032    [m4_warning([Unknown $1 option `$2'])])[]dnl
9033])
9034
9035
9036# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9037# ------------------------------------------------------------
9038# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9039m4_define([_LT_IF_OPTION],
9040[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9041
9042
9043# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9044# -------------------------------------------------------
9045# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9046# are set.
9047m4_define([_LT_UNLESS_OPTIONS],
9048[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9049	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9050		      [m4_define([$0_found])])])[]dnl
9051m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9052])[]dnl
9053])
9054
9055
9056# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9057# ----------------------------------------
9058# OPTION-LIST is a space-separated list of Libtool options associated
9059# with MACRO-NAME.  If any OPTION has a matching handler declared with
9060# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9061# the unknown option and exit.
9062m4_defun([_LT_SET_OPTIONS],
9063[# Set options
9064m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9065    [_LT_SET_OPTION([$1], _LT_Option)])
9066
9067m4_if([$1],[LT_INIT],[
9068  dnl
9069  dnl Simply set some default values (i.e off) if boolean options were not
9070  dnl specified:
9071  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9072  ])
9073  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9074  ])
9075  dnl
9076  dnl If no reference was made to various pairs of opposing options, then
9077  dnl we run the default mode handler for the pair.  For example, if neither
9078  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9079  dnl archives by default:
9080  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9081  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9082  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9083  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9084  		   [_LT_ENABLE_FAST_INSTALL])
9085  ])
9086])# _LT_SET_OPTIONS
9087
9088
9089
9090# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9091# -----------------------------------------
9092m4_define([_LT_MANGLE_DEFUN],
9093[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9094
9095
9096# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9097# -----------------------------------------------
9098m4_define([LT_OPTION_DEFINE],
9099[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9100])# LT_OPTION_DEFINE
9101
9102
9103# dlopen
9104# ------
9105LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9106])
9107
9108AU_DEFUN([AC_LIBTOOL_DLOPEN],
9109[_LT_SET_OPTION([LT_INIT], [dlopen])
9110AC_DIAGNOSE([obsolete],
9111[$0: Remove this warning and the call to _LT_SET_OPTION when you
9112put the `dlopen' option into LT_INIT's first parameter.])
9113])
9114
9115dnl aclocal-1.4 backwards compatibility:
9116dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9117
9118
9119# win32-dll
9120# ---------
9121# Declare package support for building win32 dll's.
9122LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9123[enable_win32_dll=yes
9124
9125case $host in
9126*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9127  AC_CHECK_TOOL(AS, as, false)
9128  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9129  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9130  ;;
9131esac
9132
9133test -z "$AS" && AS=as
9134_LT_DECL([], [AS],      [1], [Assembler program])dnl
9135
9136test -z "$DLLTOOL" && DLLTOOL=dlltool
9137_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9138
9139test -z "$OBJDUMP" && OBJDUMP=objdump
9140_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9141])# win32-dll
9142
9143AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9144[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9145_LT_SET_OPTION([LT_INIT], [win32-dll])
9146AC_DIAGNOSE([obsolete],
9147[$0: Remove this warning and the call to _LT_SET_OPTION when you
9148put the `win32-dll' option into LT_INIT's first parameter.])
9149])
9150
9151dnl aclocal-1.4 backwards compatibility:
9152dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9153
9154
9155# _LT_ENABLE_SHARED([DEFAULT])
9156# ----------------------------
9157# implement the --enable-shared flag, and supports the `shared' and
9158# `disable-shared' LT_INIT options.
9159# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9160m4_define([_LT_ENABLE_SHARED],
9161[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9162AC_ARG_ENABLE([shared],
9163    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9164	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9165    [p=${PACKAGE-default}
9166    case $enableval in
9167    yes) enable_shared=yes ;;
9168    no) enable_shared=no ;;
9169    *)
9170      enable_shared=no
9171      # Look at the argument we got.  We use all the common list separators.
9172      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9173      for pkg in $enableval; do
9174	IFS="$lt_save_ifs"
9175	if test "X$pkg" = "X$p"; then
9176	  enable_shared=yes
9177	fi
9178      done
9179      IFS="$lt_save_ifs"
9180      ;;
9181    esac],
9182    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9183
9184    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9185	[Whether or not to build shared libraries])
9186])# _LT_ENABLE_SHARED
9187
9188LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9189LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9190
9191# Old names:
9192AC_DEFUN([AC_ENABLE_SHARED],
9193[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9194])
9195
9196AC_DEFUN([AC_DISABLE_SHARED],
9197[_LT_SET_OPTION([LT_INIT], [disable-shared])
9198])
9199
9200AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9201AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9202
9203dnl aclocal-1.4 backwards compatibility:
9204dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9205dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9206
9207
9208
9209# _LT_ENABLE_STATIC([DEFAULT])
9210# ----------------------------
9211# implement the --enable-static flag, and support the `static' and
9212# `disable-static' LT_INIT options.
9213# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9214m4_define([_LT_ENABLE_STATIC],
9215[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9216AC_ARG_ENABLE([static],
9217    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9218	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9219    [p=${PACKAGE-default}
9220    case $enableval in
9221    yes) enable_static=yes ;;
9222    no) enable_static=no ;;
9223    *)
9224     enable_static=no
9225      # Look at the argument we got.  We use all the common list separators.
9226      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9227      for pkg in $enableval; do
9228	IFS="$lt_save_ifs"
9229	if test "X$pkg" = "X$p"; then
9230	  enable_static=yes
9231	fi
9232      done
9233      IFS="$lt_save_ifs"
9234      ;;
9235    esac],
9236    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9237
9238    _LT_DECL([build_old_libs], [enable_static], [0],
9239	[Whether or not to build static libraries])
9240])# _LT_ENABLE_STATIC
9241
9242LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9243LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9244
9245# Old names:
9246AC_DEFUN([AC_ENABLE_STATIC],
9247[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9248])
9249
9250AC_DEFUN([AC_DISABLE_STATIC],
9251[_LT_SET_OPTION([LT_INIT], [disable-static])
9252])
9253
9254AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9255AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9256
9257dnl aclocal-1.4 backwards compatibility:
9258dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9259dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9260
9261
9262
9263# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9264# ----------------------------------
9265# implement the --enable-fast-install flag, and support the `fast-install'
9266# and `disable-fast-install' LT_INIT options.
9267# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9268m4_define([_LT_ENABLE_FAST_INSTALL],
9269[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9270AC_ARG_ENABLE([fast-install],
9271    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9272    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9273    [p=${PACKAGE-default}
9274    case $enableval in
9275    yes) enable_fast_install=yes ;;
9276    no) enable_fast_install=no ;;
9277    *)
9278      enable_fast_install=no
9279      # Look at the argument we got.  We use all the common list separators.
9280      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9281      for pkg in $enableval; do
9282	IFS="$lt_save_ifs"
9283	if test "X$pkg" = "X$p"; then
9284	  enable_fast_install=yes
9285	fi
9286      done
9287      IFS="$lt_save_ifs"
9288      ;;
9289    esac],
9290    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9291
9292_LT_DECL([fast_install], [enable_fast_install], [0],
9293	 [Whether or not to optimize for fast installation])dnl
9294])# _LT_ENABLE_FAST_INSTALL
9295
9296LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9297LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9298
9299# Old names:
9300AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9301[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9302AC_DIAGNOSE([obsolete],
9303[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9304the `fast-install' option into LT_INIT's first parameter.])
9305])
9306
9307AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9308[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9309AC_DIAGNOSE([obsolete],
9310[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9311the `disable-fast-install' option into LT_INIT's first parameter.])
9312])
9313
9314dnl aclocal-1.4 backwards compatibility:
9315dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9316dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9317
9318
9319# _LT_WITH_PIC([MODE])
9320# --------------------
9321# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9322# LT_INIT options.
9323# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9324m4_define([_LT_WITH_PIC],
9325[AC_ARG_WITH([pic],
9326    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9327	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9328    [lt_p=${PACKAGE-default}
9329    case $withval in
9330    yes|no) pic_mode=$withval ;;
9331    *)
9332      pic_mode=default
9333      # Look at the argument we got.  We use all the common list separators.
9334      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9335      for lt_pkg in $withval; do
9336	IFS="$lt_save_ifs"
9337	if test "X$lt_pkg" = "X$lt_p"; then
9338	  pic_mode=yes
9339	fi
9340      done
9341      IFS="$lt_save_ifs"
9342      ;;
9343    esac],
9344    [pic_mode=default])
9345
9346test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9347
9348_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9349])# _LT_WITH_PIC
9350
9351LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9352LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9353
9354# Old name:
9355AU_DEFUN([AC_LIBTOOL_PICMODE],
9356[_LT_SET_OPTION([LT_INIT], [pic-only])
9357AC_DIAGNOSE([obsolete],
9358[$0: Remove this warning and the call to _LT_SET_OPTION when you
9359put the `pic-only' option into LT_INIT's first parameter.])
9360])
9361
9362dnl aclocal-1.4 backwards compatibility:
9363dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9364
9365
9366m4_define([_LTDL_MODE], [])
9367LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9368		 [m4_define([_LTDL_MODE], [nonrecursive])])
9369LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9370		 [m4_define([_LTDL_MODE], [recursive])])
9371LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9372		 [m4_define([_LTDL_MODE], [subproject])])
9373
9374m4_define([_LTDL_TYPE], [])
9375LT_OPTION_DEFINE([LTDL_INIT], [installable],
9376		 [m4_define([_LTDL_TYPE], [installable])])
9377LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9378		 [m4_define([_LTDL_TYPE], [convenience])])
9379
9380# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9381#
9382# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9383# Written by Gary V. Vaughan, 2004
9384#
9385# This file is free software; the Free Software Foundation gives
9386# unlimited permission to copy and/or distribute it, with or without
9387# modifications, as long as this notice is preserved.
9388
9389# serial 6 ltsugar.m4
9390
9391# This is to help aclocal find these macros, as it can't see m4_define.
9392AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9393
9394
9395# lt_join(SEP, ARG1, [ARG2...])
9396# -----------------------------
9397# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9398# associated separator.
9399# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9400# versions in m4sugar had bugs.
9401m4_define([lt_join],
9402[m4_if([$#], [1], [],
9403       [$#], [2], [[$2]],
9404       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9405m4_define([_lt_join],
9406[m4_if([$#$2], [2], [],
9407       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9408
9409
9410# lt_car(LIST)
9411# lt_cdr(LIST)
9412# ------------
9413# Manipulate m4 lists.
9414# These macros are necessary as long as will still need to support
9415# Autoconf-2.59 which quotes differently.
9416m4_define([lt_car], [[$1]])
9417m4_define([lt_cdr],
9418[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9419       [$#], 1, [],
9420       [m4_dquote(m4_shift($@))])])
9421m4_define([lt_unquote], $1)
9422
9423
9424# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9425# ------------------------------------------
9426# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9427# Note that neither SEPARATOR nor STRING are expanded; they are appended
9428# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9429# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9430# than defined and empty).
9431#
9432# This macro is needed until we can rely on Autoconf 2.62, since earlier
9433# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9434m4_define([lt_append],
9435[m4_define([$1],
9436	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9437
9438
9439
9440# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9441# ----------------------------------------------------------
9442# Produce a SEP delimited list of all paired combinations of elements of
9443# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9444# has the form PREFIXmINFIXSUFFIXn.
9445# Needed until we can rely on m4_combine added in Autoconf 2.62.
9446m4_define([lt_combine],
9447[m4_if(m4_eval([$# > 3]), [1],
9448       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9449[[m4_foreach([_Lt_prefix], [$2],
9450	     [m4_foreach([_Lt_suffix],
9451		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9452	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9453
9454
9455# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9456# -----------------------------------------------------------------------
9457# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9458# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9459m4_define([lt_if_append_uniq],
9460[m4_ifdef([$1],
9461	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9462		 [lt_append([$1], [$2], [$3])$4],
9463		 [$5])],
9464	  [lt_append([$1], [$2], [$3])$4])])
9465
9466
9467# lt_dict_add(DICT, KEY, VALUE)
9468# -----------------------------
9469m4_define([lt_dict_add],
9470[m4_define([$1($2)], [$3])])
9471
9472
9473# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9474# --------------------------------------------
9475m4_define([lt_dict_add_subkey],
9476[m4_define([$1($2:$3)], [$4])])
9477
9478
9479# lt_dict_fetch(DICT, KEY, [SUBKEY])
9480# ----------------------------------
9481m4_define([lt_dict_fetch],
9482[m4_ifval([$3],
9483	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9484    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9485
9486
9487# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9488# -----------------------------------------------------------------
9489m4_define([lt_if_dict_fetch],
9490[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9491	[$5],
9492    [$6])])
9493
9494
9495# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9496# --------------------------------------------------------------
9497m4_define([lt_dict_filter],
9498[m4_if([$5], [], [],
9499  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9500           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9501		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9502])
9503
9504# ltversion.m4 -- version numbers			-*- Autoconf -*-
9505#
9506#   Copyright (C) 2004 Free Software Foundation, Inc.
9507#   Written by Scott James Remnant, 2004
9508#
9509# This file is free software; the Free Software Foundation gives
9510# unlimited permission to copy and/or distribute it, with or without
9511# modifications, as long as this notice is preserved.
9512
9513# @configure_input@
9514
9515# serial 3337 ltversion.m4
9516# This file is part of GNU Libtool
9517
9518m4_define([LT_PACKAGE_VERSION], [2.4.2])
9519m4_define([LT_PACKAGE_REVISION], [1.3337])
9520
9521AC_DEFUN([LTVERSION_VERSION],
9522[macro_version='2.4.2'
9523macro_revision='1.3337'
9524_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9525_LT_DECL(, macro_revision, 0)
9526])
9527
9528# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9529#
9530#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9531#   Written by Scott James Remnant, 2004.
9532#
9533# This file is free software; the Free Software Foundation gives
9534# unlimited permission to copy and/or distribute it, with or without
9535# modifications, as long as this notice is preserved.
9536
9537# serial 5 lt~obsolete.m4
9538
9539# These exist entirely to fool aclocal when bootstrapping libtool.
9540#
9541# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9542# which have later been changed to m4_define as they aren't part of the
9543# exported API, or moved to Autoconf or Automake where they belong.
9544#
9545# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9546# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9547# using a macro with the same name in our local m4/libtool.m4 it'll
9548# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9549# and doesn't know about Autoconf macros at all.)
9550#
9551# So we provide this file, which has a silly filename so it's always
9552# included after everything else.  This provides aclocal with the
9553# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9554# because those macros already exist, or will be overwritten later.
9555# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9556#
9557# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9558# Yes, that means every name once taken will need to remain here until
9559# we give up compatibility with versions before 1.7, at which point
9560# we need to keep only those names which we still refer to.
9561
9562# This is to help aclocal find these macros, as it can't see m4_define.
9563AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9564
9565m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9566m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9567m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9568m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9569m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9570m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9571m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9572m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9573m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9574m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9575m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9576m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9577m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9578m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9579m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9580m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9581m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9582m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9583m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9584m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9585m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9586m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9587m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9588m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9589m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9590m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9591m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9592m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9593m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9594m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9595m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9596m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9597m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9598m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9599m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9600m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9601m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9602m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9603m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9604m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9605m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9606m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9607m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9608m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9609m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9610m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9611m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9612m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9613m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9614m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9615m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9616m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9617m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9618m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9619m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9620m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9621m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9622m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9623m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9624m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9625m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9626
9627# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9628# serial 1 (pkg-config-0.24)
9629# 
9630# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9631#
9632# This program is free software; you can redistribute it and/or modify
9633# it under the terms of the GNU General Public License as published by
9634# the Free Software Foundation; either version 2 of the License, or
9635# (at your option) any later version.
9636#
9637# This program is distributed in the hope that it will be useful, but
9638# WITHOUT ANY WARRANTY; without even the implied warranty of
9639# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9640# General Public License for more details.
9641#
9642# You should have received a copy of the GNU General Public License
9643# along with this program; if not, write to the Free Software
9644# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9645#
9646# As a special exception to the GNU General Public License, if you
9647# distribute this file as part of a program that contains a
9648# configuration script generated by Autoconf, you may include it under
9649# the same distribution terms that you use for the rest of that program.
9650
9651# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9652# ----------------------------------
9653AC_DEFUN([PKG_PROG_PKG_CONFIG],
9654[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9655m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9656AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
9657AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
9658AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9659
9660if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9661	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9662fi
9663if test -n "$PKG_CONFIG"; then
9664	_pkg_min_version=m4_default([$1], [0.9.0])
9665	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9666	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9667		AC_MSG_RESULT([yes])
9668	else
9669		AC_MSG_RESULT([no])
9670		PKG_CONFIG=""
9671	fi
9672fi[]dnl
9673])# PKG_PROG_PKG_CONFIG
9674
9675# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9676#
9677# Check to see whether a particular set of modules exists.  Similar
9678# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9679#
9680# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9681# only at the first occurence in configure.ac, so if the first place
9682# it's called might be skipped (such as if it is within an "if", you
9683# have to call PKG_CHECK_EXISTS manually
9684# --------------------------------------------------------------
9685AC_DEFUN([PKG_CHECK_EXISTS],
9686[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9687if test -n "$PKG_CONFIG" && \
9688    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9689  m4_default([$2], [:])
9690m4_ifvaln([$3], [else
9691  $3])dnl
9692fi])
9693
9694# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9695# ---------------------------------------------
9696m4_define([_PKG_CONFIG],
9697[if test -n "$$1"; then
9698    pkg_cv_[]$1="$$1"
9699 elif test -n "$PKG_CONFIG"; then
9700    PKG_CHECK_EXISTS([$3],
9701                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9702		     [pkg_failed=yes])
9703 else
9704    pkg_failed=untried
9705fi[]dnl
9706])# _PKG_CONFIG
9707
9708# _PKG_SHORT_ERRORS_SUPPORTED
9709# -----------------------------
9710AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9711[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9712if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9713        _pkg_short_errors_supported=yes
9714else
9715        _pkg_short_errors_supported=no
9716fi[]dnl
9717])# _PKG_SHORT_ERRORS_SUPPORTED
9718
9719
9720# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9721# [ACTION-IF-NOT-FOUND])
9722#
9723#
9724# Note that if there is a possibility the first call to
9725# PKG_CHECK_MODULES might not happen, you should be sure to include an
9726# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9727#
9728#
9729# --------------------------------------------------------------
9730AC_DEFUN([PKG_CHECK_MODULES],
9731[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9732AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9733AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9734
9735pkg_failed=no
9736AC_MSG_CHECKING([for $1])
9737
9738_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9739_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9740
9741m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9742and $1[]_LIBS to avoid the need to call pkg-config.
9743See the pkg-config man page for more details.])
9744
9745if test $pkg_failed = yes; then
9746   	AC_MSG_RESULT([no])
9747        _PKG_SHORT_ERRORS_SUPPORTED
9748        if test $_pkg_short_errors_supported = yes; then
9749	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9750        else 
9751	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9752        fi
9753	# Put the nasty error message in config.log where it belongs
9754	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9755
9756	m4_default([$4], [AC_MSG_ERROR(
9757[Package requirements ($2) were not met:
9758
9759$$1_PKG_ERRORS
9760
9761Consider adjusting the PKG_CONFIG_PATH environment variable if you
9762installed software in a non-standard prefix.
9763
9764_PKG_TEXT])
9765        ])
9766elif test $pkg_failed = untried; then
9767     	AC_MSG_RESULT([no])
9768	m4_default([$4], [AC_MSG_FAILURE(
9769[The pkg-config script could not be found or is too old.  Make sure it
9770is in your PATH or set the PKG_CONFIG environment variable to the full
9771path to pkg-config.
9772
9773_PKG_TEXT
9774
9775To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
9776        ])
9777else
9778	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9779	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9780        AC_MSG_RESULT([yes])
9781	$3
9782fi[]dnl
9783])# PKG_CHECK_MODULES
9784
9785dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9786dnl
9787dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9788dnl 
9789dnl Permission is hereby granted, free of charge, to any person obtaining a
9790dnl copy of this software and associated documentation files (the "Software"),
9791dnl to deal in the Software without restriction, including without limitation
9792dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9793dnl and/or sell copies of the Software, and to permit persons to whom the
9794dnl Software is furnished to do so, subject to the following conditions:
9795dnl
9796dnl The above copyright notice and this permission notice (including the next
9797dnl paragraph) shall be included in all copies or substantial portions of the
9798dnl Software.
9799dnl
9800dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9801dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9802dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9803dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9804dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9805dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9806dnl DEALINGS IN THE SOFTWARE.
9807
9808# XORG_MACROS_VERSION(required-version)
9809# -------------------------------------
9810# Minimum version: 1.1.0
9811#
9812# If you're using a macro added in Version 1.1 or newer, include this in
9813# your configure.ac with the minimum required version, such as:
9814# XORG_MACROS_VERSION(1.1)
9815#
9816# To ensure that this macro is defined, also add:
9817# m4_ifndef([XORG_MACROS_VERSION],
9818#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9819#
9820#
9821# See the "minimum version" comment for each macro you use to see what 
9822# version you require.
9823m4_defun([XORG_MACROS_VERSION],[
9824m4_define([vers_have], [1.17])
9825m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9826m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9827m4_if(m4_cmp(maj_have, maj_needed), 0,,
9828    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9829m4_if(m4_version_compare(vers_have, [$1]), -1,
9830    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9831m4_undefine([vers_have])
9832m4_undefine([maj_have])
9833m4_undefine([maj_needed])
9834]) # XORG_MACROS_VERSION
9835
9836# XORG_PROG_RAWCPP()
9837# ------------------
9838# Minimum version: 1.0.0
9839#
9840# Find cpp program and necessary flags for use in pre-processing text files
9841# such as man pages and config files
9842AC_DEFUN([XORG_PROG_RAWCPP],[
9843AC_REQUIRE([AC_PROG_CPP])
9844AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9845   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9846
9847# Check for flag to avoid builtin definitions - assumes unix is predefined,
9848# which is not the best choice for supporting other OS'es, but covers most
9849# of the ones we need for now.
9850AC_MSG_CHECKING([if $RAWCPP requires -undef])
9851AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9852if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9853	AC_MSG_RESULT([no])
9854else
9855	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9856		RAWCPPFLAGS=-undef
9857		AC_MSG_RESULT([yes])
9858	# under Cygwin unix is still defined even with -undef
9859	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9860		RAWCPPFLAGS="-undef -ansi"
9861		AC_MSG_RESULT([yes, with -ansi])
9862	else
9863		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9864	fi
9865fi
9866rm -f conftest.$ac_ext
9867
9868AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9869AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9870if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9871	AC_MSG_RESULT([no])
9872else
9873	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9874		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9875		AC_MSG_RESULT([yes])
9876	else
9877		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9878	fi
9879fi
9880rm -f conftest.$ac_ext
9881AC_SUBST(RAWCPPFLAGS)
9882]) # XORG_PROG_RAWCPP
9883
9884# XORG_MANPAGE_SECTIONS()
9885# -----------------------
9886# Minimum version: 1.0.0
9887#
9888# Determine which sections man pages go in for the different man page types
9889# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9890# Not sure if there's any better way than just hardcoding by OS name.
9891# Override default settings by setting environment variables
9892# Added MAN_SUBSTS in version 1.8
9893# Added AC_PROG_SED in version 1.8
9894
9895AC_DEFUN([XORG_MANPAGE_SECTIONS],[
9896AC_REQUIRE([AC_CANONICAL_HOST])
9897AC_REQUIRE([AC_PROG_SED])
9898
9899if test x$APP_MAN_SUFFIX = x    ; then
9900    APP_MAN_SUFFIX=1
9901fi
9902if test x$APP_MAN_DIR = x    ; then
9903    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9904fi
9905
9906if test x$LIB_MAN_SUFFIX = x    ; then
9907    LIB_MAN_SUFFIX=3
9908fi
9909if test x$LIB_MAN_DIR = x    ; then
9910    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9911fi
9912
9913if test x$FILE_MAN_SUFFIX = x    ; then
9914    case $host_os in
9915	solaris*)	FILE_MAN_SUFFIX=4  ;;
9916	*)		FILE_MAN_SUFFIX=5  ;;
9917    esac
9918fi
9919if test x$FILE_MAN_DIR = x    ; then
9920    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9921fi
9922
9923if test x$MISC_MAN_SUFFIX = x    ; then
9924    case $host_os in
9925	solaris*)	MISC_MAN_SUFFIX=5  ;;
9926	*)		MISC_MAN_SUFFIX=7  ;;
9927    esac
9928fi
9929if test x$MISC_MAN_DIR = x    ; then
9930    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9931fi
9932
9933if test x$DRIVER_MAN_SUFFIX = x    ; then
9934    case $host_os in
9935	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9936	*)		DRIVER_MAN_SUFFIX=4  ;;
9937    esac
9938fi
9939if test x$DRIVER_MAN_DIR = x    ; then
9940    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9941fi
9942
9943if test x$ADMIN_MAN_SUFFIX = x    ; then
9944    case $host_os in
9945	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9946	*)		ADMIN_MAN_SUFFIX=8  ;;
9947    esac
9948fi
9949if test x$ADMIN_MAN_DIR = x    ; then
9950    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9951fi
9952
9953
9954AC_SUBST([APP_MAN_SUFFIX])
9955AC_SUBST([LIB_MAN_SUFFIX])
9956AC_SUBST([FILE_MAN_SUFFIX])
9957AC_SUBST([MISC_MAN_SUFFIX])
9958AC_SUBST([DRIVER_MAN_SUFFIX])
9959AC_SUBST([ADMIN_MAN_SUFFIX])
9960AC_SUBST([APP_MAN_DIR])
9961AC_SUBST([LIB_MAN_DIR])
9962AC_SUBST([FILE_MAN_DIR])
9963AC_SUBST([MISC_MAN_DIR])
9964AC_SUBST([DRIVER_MAN_DIR])
9965AC_SUBST([ADMIN_MAN_DIR])
9966
9967XORG_MAN_PAGE="X Version 11"
9968AC_SUBST([XORG_MAN_PAGE])
9969MAN_SUBSTS="\
9970	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9971	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9972	-e 's|__xservername__|Xorg|g' \
9973	-e 's|__xconfigfile__|xorg.conf|g' \
9974	-e 's|__xorgconfdir__|xorg.conf.d|g' \
9975	-e 's|__projectroot__|\$(prefix)|g' \
9976	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9977	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9978	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9979	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9980	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9981	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9982	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9983AC_SUBST([MAN_SUBSTS])
9984
9985]) # XORG_MANPAGE_SECTIONS
9986
9987# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9988# ------------------------
9989# Minimum version: 1.7.0
9990#
9991# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9992# provided by xorg-sgml-doctools, if installed.
9993AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9994AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9995XORG_SGML_PATH=
9996PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9997    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9998    [m4_ifval([$1],[:],
9999        [if test x"$cross_compiling" != x"yes" ; then
10000            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
10001                          [XORG_SGML_PATH=$prefix/share/sgml])
10002         fi])
10003    ])
10004
10005# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10006# the path and the name of the doc stylesheet
10007if test "x$XORG_SGML_PATH" != "x" ; then
10008   AC_MSG_RESULT([$XORG_SGML_PATH])
10009   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10010   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10011else
10012   AC_MSG_RESULT([no])
10013fi
10014
10015AC_SUBST(XORG_SGML_PATH)
10016AC_SUBST(STYLESHEET_SRCDIR)
10017AC_SUBST(XSL_STYLESHEET)
10018AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10019]) # XORG_CHECK_SGML_DOCTOOLS
10020
10021# XORG_CHECK_LINUXDOC
10022# -------------------
10023# Minimum version: 1.0.0
10024#
10025# Defines the variable MAKE_TEXT if the necessary tools and
10026# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10027# Whether or not the necessary tools and files are found can be checked
10028# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10029AC_DEFUN([XORG_CHECK_LINUXDOC],[
10030AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10031AC_REQUIRE([XORG_WITH_PS2PDF])
10032
10033AC_PATH_PROG(LINUXDOC, linuxdoc)
10034
10035AC_MSG_CHECKING([whether to build documentation])
10036
10037if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10038   BUILDDOC=yes
10039else
10040   BUILDDOC=no
10041fi
10042
10043AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10044
10045AC_MSG_RESULT([$BUILDDOC])
10046
10047AC_MSG_CHECKING([whether to build pdf documentation])
10048
10049if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10050   BUILDPDFDOC=yes
10051else
10052   BUILDPDFDOC=no
10053fi
10054
10055AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10056
10057AC_MSG_RESULT([$BUILDPDFDOC])
10058
10059MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10060MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10061MAKE_PDF="$PS2PDF"
10062MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10063
10064AC_SUBST(MAKE_TEXT)
10065AC_SUBST(MAKE_PS)
10066AC_SUBST(MAKE_PDF)
10067AC_SUBST(MAKE_HTML)
10068]) # XORG_CHECK_LINUXDOC
10069
10070# XORG_CHECK_DOCBOOK
10071# -------------------
10072# Minimum version: 1.0.0
10073#
10074# Checks for the ability to build output formats from SGML DocBook source.
10075# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10076# indicates whether the necessary tools and files are found and, if set,
10077# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10078AC_DEFUN([XORG_CHECK_DOCBOOK],[
10079AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10080
10081BUILDTXTDOC=no
10082BUILDPDFDOC=no
10083BUILDPSDOC=no
10084BUILDHTMLDOC=no
10085
10086AC_PATH_PROG(DOCBOOKPS, docbook2ps)
10087AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10088AC_PATH_PROG(DOCBOOKHTML, docbook2html)
10089AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10090
10091AC_MSG_CHECKING([whether to build text documentation])
10092if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10093   test x$BUILD_TXTDOC != xno; then
10094	BUILDTXTDOC=yes
10095fi
10096AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10097AC_MSG_RESULT([$BUILDTXTDOC])
10098
10099AC_MSG_CHECKING([whether to build PDF documentation])
10100if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10101   test x$BUILD_PDFDOC != xno; then
10102	BUILDPDFDOC=yes
10103fi
10104AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10105AC_MSG_RESULT([$BUILDPDFDOC])
10106
10107AC_MSG_CHECKING([whether to build PostScript documentation])
10108if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10109   test x$BUILD_PSDOC != xno; then
10110	BUILDPSDOC=yes
10111fi
10112AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10113AC_MSG_RESULT([$BUILDPSDOC])
10114
10115AC_MSG_CHECKING([whether to build HTML documentation])
10116if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10117   test x$BUILD_HTMLDOC != xno; then
10118	BUILDHTMLDOC=yes
10119fi
10120AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10121AC_MSG_RESULT([$BUILDHTMLDOC])
10122
10123MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10124MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10125MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10126MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10127
10128AC_SUBST(MAKE_TEXT)
10129AC_SUBST(MAKE_PS)
10130AC_SUBST(MAKE_PDF)
10131AC_SUBST(MAKE_HTML)
10132]) # XORG_CHECK_DOCBOOK
10133
10134# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10135# ----------------
10136# Minimum version: 1.5.0
10137# Minimum version for optional DEFAULT argument: 1.11.0
10138#
10139# Documentation tools are not always available on all platforms and sometimes
10140# not at the appropriate level. This macro enables a module to test for the
10141# presence of the tool and obtain it's path in separate variables. Coupled with
10142# the --with-xmlto option, it allows maximum flexibilty in making decisions
10143# as whether or not to use the xmlto package. When DEFAULT is not specified,
10144# --with-xmlto assumes 'auto'.
10145#
10146# Interface to module:
10147# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10148# XMLTO:	returns the path of the xmlto program found
10149#		returns the path set by the user in the environment
10150# --with-xmlto:	'yes' user instructs the module to use xmlto
10151#		'no' user instructs the module not to use xmlto
10152#
10153# Added in version 1.10.0
10154# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10155#                  xmlto for text output requires either lynx, links, or w3m browsers
10156#
10157# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10158#
10159AC_DEFUN([XORG_WITH_XMLTO],[
10160AC_ARG_VAR([XMLTO], [Path to xmlto command])
10161m4_define([_defopt], m4_default([$2], [auto]))
10162AC_ARG_WITH(xmlto,
10163	AS_HELP_STRING([--with-xmlto],
10164	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10165	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10166m4_undefine([_defopt])
10167
10168if test "x$use_xmlto" = x"auto"; then
10169   AC_PATH_PROG([XMLTO], [xmlto])
10170   if test "x$XMLTO" = "x"; then
10171        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10172	have_xmlto=no
10173   else
10174        have_xmlto=yes
10175   fi
10176elif test "x$use_xmlto" = x"yes" ; then
10177   AC_PATH_PROG([XMLTO], [xmlto])
10178   if test "x$XMLTO" = "x"; then
10179        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10180   fi
10181   have_xmlto=yes
10182elif test "x$use_xmlto" = x"no" ; then
10183   if test "x$XMLTO" != "x"; then
10184      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10185   fi
10186   have_xmlto=no
10187else
10188   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10189fi
10190
10191# Test for a minimum version of xmlto, if provided.
10192m4_ifval([$1],
10193[if test "$have_xmlto" = yes; then
10194    # scrape the xmlto version
10195    AC_MSG_CHECKING([the xmlto version])
10196    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10197    AC_MSG_RESULT([$xmlto_version])
10198    AS_VERSION_COMPARE([$xmlto_version], [$1],
10199        [if test "x$use_xmlto" = xauto; then
10200            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10201            have_xmlto=no
10202        else
10203            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10204        fi])
10205fi])
10206
10207# Test for the ability of xmlto to generate a text target
10208have_xmlto_text=no
10209cat > conftest.xml << "EOF"
10210EOF
10211AS_IF([test "$have_xmlto" = yes],
10212      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10213             [have_xmlto_text=yes],
10214             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10215rm -f conftest.xml
10216AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10217AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10218]) # XORG_WITH_XMLTO
10219
10220# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10221# --------------------------------------------
10222# Minimum version: 1.12.0
10223# Minimum version for optional DEFAULT argument: 1.12.0
10224#
10225# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10226# XML-based language used for the transformation of XML documents.
10227# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10228# It is used under the cover by xmlto to generate html files from DocBook/XML.
10229# The XSLT processor is often used as a standalone tool for transformations.
10230# It should not be assumed that this tool is used only to work with documnetation.
10231# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10232#
10233# Interface to module:
10234# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10235# XSLTPROC:	 returns the path of the xsltproc program found
10236#		 returns the path set by the user in the environment
10237# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10238#		  'no' user instructs the module not to use xsltproc
10239# have_xsltproc: returns yes if xsltproc found in PATH or no
10240#
10241# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10242#
10243AC_DEFUN([XORG_WITH_XSLTPROC],[
10244AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10245# Preserves the interface, should it be implemented later
10246m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10247m4_define([_defopt], m4_default([$2], [auto]))
10248AC_ARG_WITH(xsltproc,
10249	AS_HELP_STRING([--with-xsltproc],
10250	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10251	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10252m4_undefine([_defopt])
10253
10254if test "x$use_xsltproc" = x"auto"; then
10255   AC_PATH_PROG([XSLTPROC], [xsltproc])
10256   if test "x$XSLTPROC" = "x"; then
10257        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10258	have_xsltproc=no
10259   else
10260        have_xsltproc=yes
10261   fi
10262elif test "x$use_xsltproc" = x"yes" ; then
10263   AC_PATH_PROG([XSLTPROC], [xsltproc])
10264   if test "x$XSLTPROC" = "x"; then
10265        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10266   fi
10267   have_xsltproc=yes
10268elif test "x$use_xsltproc" = x"no" ; then
10269   if test "x$XSLTPROC" != "x"; then
10270      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10271   fi
10272   have_xsltproc=no
10273else
10274   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10275fi
10276
10277AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10278]) # XORG_WITH_XSLTPROC
10279
10280# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10281# ----------------------------------------
10282# Minimum version: 1.15.0
10283#
10284# PERL (Practical Extraction and Report Language) is a language optimized for
10285# scanning arbitrary text files, extracting information from those text files,
10286# and printing reports based on that information.
10287#
10288# When DEFAULT is not specified, --with-perl assumes 'auto'.
10289#
10290# Interface to module:
10291# HAVE_PERL: used in makefiles to conditionally scan text files
10292# PERL:	     returns the path of the perl program found
10293#	     returns the path set by the user in the environment
10294# --with-perl: 'yes' user instructs the module to use perl
10295#	       'no' user instructs the module not to use perl
10296# have_perl: returns yes if perl found in PATH or no
10297#
10298# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10299#
10300AC_DEFUN([XORG_WITH_PERL],[
10301AC_ARG_VAR([PERL], [Path to perl command])
10302# Preserves the interface, should it be implemented later
10303m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10304m4_define([_defopt], m4_default([$2], [auto]))
10305AC_ARG_WITH(perl,
10306	AS_HELP_STRING([--with-perl],
10307	   [Use perl for extracting information from files (default: ]_defopt[)]),
10308	   [use_perl=$withval], [use_perl=]_defopt)
10309m4_undefine([_defopt])
10310
10311if test "x$use_perl" = x"auto"; then
10312   AC_PATH_PROG([PERL], [perl])
10313   if test "x$PERL" = "x"; then
10314        AC_MSG_WARN([perl not found - cannot extract information and report])
10315	have_perl=no
10316   else
10317        have_perl=yes
10318   fi
10319elif test "x$use_perl" = x"yes" ; then
10320   AC_PATH_PROG([PERL], [perl])
10321   if test "x$PERL" = "x"; then
10322        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10323   fi
10324   have_perl=yes
10325elif test "x$use_perl" = x"no" ; then
10326   if test "x$PERL" != "x"; then
10327      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10328   fi
10329   have_perl=no
10330else
10331   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10332fi
10333
10334AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10335]) # XORG_WITH_PERL
10336
10337# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10338# ----------------
10339# Minimum version: 1.5.0
10340# Minimum version for optional DEFAULT argument: 1.11.0
10341#
10342# Documentation tools are not always available on all platforms and sometimes
10343# not at the appropriate level. This macro enables a module to test for the
10344# presence of the tool and obtain it's path in separate variables. Coupled with
10345# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10346# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10347# --with-asciidoc assumes 'auto'.
10348#
10349# Interface to module:
10350# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10351# ASCIIDOC:	 returns the path of the asciidoc program found
10352#		 returns the path set by the user in the environment
10353# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10354#		  'no' user instructs the module not to use asciidoc
10355#
10356# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10357#
10358AC_DEFUN([XORG_WITH_ASCIIDOC],[
10359AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10360m4_define([_defopt], m4_default([$2], [auto]))
10361AC_ARG_WITH(asciidoc,
10362	AS_HELP_STRING([--with-asciidoc],
10363	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10364	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10365m4_undefine([_defopt])
10366
10367if test "x$use_asciidoc" = x"auto"; then
10368   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10369   if test "x$ASCIIDOC" = "x"; then
10370        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10371	have_asciidoc=no
10372   else
10373        have_asciidoc=yes
10374   fi
10375elif test "x$use_asciidoc" = x"yes" ; then
10376   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10377   if test "x$ASCIIDOC" = "x"; then
10378        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10379   fi
10380   have_asciidoc=yes
10381elif test "x$use_asciidoc" = x"no" ; then
10382   if test "x$ASCIIDOC" != "x"; then
10383      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10384   fi
10385   have_asciidoc=no
10386else
10387   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10388fi
10389m4_ifval([$1],
10390[if test "$have_asciidoc" = yes; then
10391    # scrape the asciidoc version
10392    AC_MSG_CHECKING([the asciidoc version])
10393    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10394    AC_MSG_RESULT([$asciidoc_version])
10395    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10396        [if test "x$use_asciidoc" = xauto; then
10397            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10398            have_asciidoc=no
10399        else
10400            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10401        fi])
10402fi])
10403AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10404]) # XORG_WITH_ASCIIDOC
10405
10406# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10407# --------------------------------
10408# Minimum version: 1.5.0
10409# Minimum version for optional DEFAULT argument: 1.11.0
10410#
10411# Documentation tools are not always available on all platforms and sometimes
10412# not at the appropriate level. This macro enables a module to test for the
10413# presence of the tool and obtain it's path in separate variables. Coupled with
10414# the --with-doxygen option, it allows maximum flexibilty in making decisions
10415# as whether or not to use the doxygen package. When DEFAULT is not specified,
10416# --with-doxygen assumes 'auto'.
10417#
10418# Interface to module:
10419# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10420# DOXYGEN:	 returns the path of the doxygen program found
10421#		 returns the path set by the user in the environment
10422# --with-doxygen: 'yes' user instructs the module to use doxygen
10423#		  'no' user instructs the module not to use doxygen
10424#
10425# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10426#
10427AC_DEFUN([XORG_WITH_DOXYGEN],[
10428AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10429m4_define([_defopt], m4_default([$2], [auto]))
10430AC_ARG_WITH(doxygen,
10431	AS_HELP_STRING([--with-doxygen],
10432	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10433	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10434m4_undefine([_defopt])
10435
10436if test "x$use_doxygen" = x"auto"; then
10437   AC_PATH_PROG([DOXYGEN], [doxygen])
10438   if test "x$DOXYGEN" = "x"; then
10439        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10440	have_doxygen=no
10441   else
10442        have_doxygen=yes
10443   fi
10444elif test "x$use_doxygen" = x"yes" ; then
10445   AC_PATH_PROG([DOXYGEN], [doxygen])
10446   if test "x$DOXYGEN" = "x"; then
10447        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10448   fi
10449   have_doxygen=yes
10450elif test "x$use_doxygen" = x"no" ; then
10451   if test "x$DOXYGEN" != "x"; then
10452      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10453   fi
10454   have_doxygen=no
10455else
10456   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10457fi
10458m4_ifval([$1],
10459[if test "$have_doxygen" = yes; then
10460    # scrape the doxygen version
10461    AC_MSG_CHECKING([the doxygen version])
10462    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10463    AC_MSG_RESULT([$doxygen_version])
10464    AS_VERSION_COMPARE([$doxygen_version], [$1],
10465        [if test "x$use_doxygen" = xauto; then
10466            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10467            have_doxygen=no
10468        else
10469            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10470        fi])
10471fi])
10472AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10473]) # XORG_WITH_DOXYGEN
10474
10475# XORG_WITH_GROFF([DEFAULT])
10476# ----------------
10477# Minimum version: 1.6.0
10478# Minimum version for optional DEFAULT argument: 1.11.0
10479#
10480# Documentation tools are not always available on all platforms and sometimes
10481# not at the appropriate level. This macro enables a module to test for the
10482# presence of the tool and obtain it's path in separate variables. Coupled with
10483# the --with-groff option, it allows maximum flexibilty in making decisions
10484# as whether or not to use the groff package. When DEFAULT is not specified,
10485# --with-groff assumes 'auto'.
10486#
10487# Interface to module:
10488# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10489# HAVE_GROFF_MM: the memorandum macros (-mm) package
10490# HAVE_GROFF_MS: the -ms macros package
10491# GROFF:	 returns the path of the groff program found
10492#		 returns the path set by the user in the environment
10493# --with-groff:	 'yes' user instructs the module to use groff
10494#		 'no' user instructs the module not to use groff
10495#
10496# Added in version 1.9.0:
10497# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10498#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10499#		   psselect from the psutils package.
10500#		   the ghostcript package. Refer to the grohtml man pages
10501#
10502# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10503#
10504# OS and distros often splits groff in a basic and full package, the former
10505# having the groff program and the later having devices, fonts and macros
10506# Checking for the groff executable is not enough.
10507#
10508# If macros are missing, we cannot assume that groff is useless, so we don't
10509# unset HAVE_GROFF or GROFF env variables.
10510# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10511#
10512AC_DEFUN([XORG_WITH_GROFF],[
10513AC_ARG_VAR([GROFF], [Path to groff command])
10514m4_define([_defopt], m4_default([$1], [auto]))
10515AC_ARG_WITH(groff,
10516	AS_HELP_STRING([--with-groff],
10517	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10518	   [use_groff=$withval], [use_groff=]_defopt)
10519m4_undefine([_defopt])
10520
10521if test "x$use_groff" = x"auto"; then
10522   AC_PATH_PROG([GROFF], [groff])
10523   if test "x$GROFF" = "x"; then
10524        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10525	have_groff=no
10526   else
10527        have_groff=yes
10528   fi
10529elif test "x$use_groff" = x"yes" ; then
10530   AC_PATH_PROG([GROFF], [groff])
10531   if test "x$GROFF" = "x"; then
10532        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10533   fi
10534   have_groff=yes
10535elif test "x$use_groff" = x"no" ; then
10536   if test "x$GROFF" != "x"; then
10537      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10538   fi
10539   have_groff=no
10540else
10541   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10542fi
10543
10544# We have groff, test for the presence of the macro packages
10545if test "x$have_groff" = x"yes"; then
10546    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10547    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10548        groff_ms_works=yes
10549    else
10550        groff_ms_works=no
10551    fi
10552    AC_MSG_RESULT([$groff_ms_works])
10553    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10554    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10555        groff_mm_works=yes
10556    else
10557        groff_mm_works=no
10558    fi
10559    AC_MSG_RESULT([$groff_mm_works])
10560fi
10561
10562# We have groff, test for HTML dependencies, one command per package
10563if test "x$have_groff" = x"yes"; then
10564   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10565   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10566   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10567   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10568      have_groff_html=yes
10569   else
10570      have_groff_html=no
10571      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10572   fi
10573fi
10574
10575# Set Automake conditionals for Makefiles
10576AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10577AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10578AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10579AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10580]) # XORG_WITH_GROFF
10581
10582# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10583# ---------------------------------------
10584# Minimum version: 1.6.0
10585# Minimum version for optional DEFAULT argument: 1.11.0
10586# Minimum version for optional MIN-VERSION argument: 1.15.0
10587#
10588# Documentation tools are not always available on all platforms and sometimes
10589# not at the appropriate level. This macro enables a module to test for the
10590# presence of the tool and obtain it's path in separate variables. Coupled with
10591# the --with-fop option, it allows maximum flexibilty in making decisions
10592# as whether or not to use the fop package. When DEFAULT is not specified,
10593# --with-fop assumes 'auto'.
10594#
10595# Interface to module:
10596# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10597# FOP:	 	returns the path of the fop program found
10598#		returns the path set by the user in the environment
10599# --with-fop: 	'yes' user instructs the module to use fop
10600#		'no' user instructs the module not to use fop
10601#
10602# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10603#
10604AC_DEFUN([XORG_WITH_FOP],[
10605AC_ARG_VAR([FOP], [Path to fop command])
10606m4_define([_defopt], m4_default([$2], [auto]))
10607AC_ARG_WITH(fop,
10608	AS_HELP_STRING([--with-fop],
10609	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10610	   [use_fop=$withval], [use_fop=]_defopt)
10611m4_undefine([_defopt])
10612
10613if test "x$use_fop" = x"auto"; then
10614   AC_PATH_PROG([FOP], [fop])
10615   if test "x$FOP" = "x"; then
10616        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10617	have_fop=no
10618   else
10619        have_fop=yes
10620   fi
10621elif test "x$use_fop" = x"yes" ; then
10622   AC_PATH_PROG([FOP], [fop])
10623   if test "x$FOP" = "x"; then
10624        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10625   fi
10626   have_fop=yes
10627elif test "x$use_fop" = x"no" ; then
10628   if test "x$FOP" != "x"; then
10629      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10630   fi
10631   have_fop=no
10632else
10633   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10634fi
10635
10636# Test for a minimum version of fop, if provided.
10637m4_ifval([$1],
10638[if test "$have_fop" = yes; then
10639    # scrape the fop version
10640    AC_MSG_CHECKING([for fop minimum version])
10641    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10642    AC_MSG_RESULT([$fop_version])
10643    AS_VERSION_COMPARE([$fop_version], [$1],
10644        [if test "x$use_fop" = xauto; then
10645            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10646            have_fop=no
10647        else
10648            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10649        fi])
10650fi])
10651AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10652]) # XORG_WITH_FOP
10653
10654# XORG_WITH_PS2PDF([DEFAULT])
10655# ----------------
10656# Minimum version: 1.6.0
10657# Minimum version for optional DEFAULT argument: 1.11.0
10658#
10659# Documentation tools are not always available on all platforms and sometimes
10660# not at the appropriate level. This macro enables a module to test for the
10661# presence of the tool and obtain it's path in separate variables. Coupled with
10662# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10663# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10664# --with-ps2pdf assumes 'auto'.
10665#
10666# Interface to module:
10667# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10668# PS2PDF:	returns the path of the ps2pdf program found
10669#		returns the path set by the user in the environment
10670# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10671#		 'no' user instructs the module not to use ps2pdf
10672#
10673# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10674#
10675AC_DEFUN([XORG_WITH_PS2PDF],[
10676AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10677m4_define([_defopt], m4_default([$1], [auto]))
10678AC_ARG_WITH(ps2pdf,
10679	AS_HELP_STRING([--with-ps2pdf],
10680	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10681	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10682m4_undefine([_defopt])
10683
10684if test "x$use_ps2pdf" = x"auto"; then
10685   AC_PATH_PROG([PS2PDF], [ps2pdf])
10686   if test "x$PS2PDF" = "x"; then
10687        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10688	have_ps2pdf=no
10689   else
10690        have_ps2pdf=yes
10691   fi
10692elif test "x$use_ps2pdf" = x"yes" ; then
10693   AC_PATH_PROG([PS2PDF], [ps2pdf])
10694   if test "x$PS2PDF" = "x"; then
10695        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10696   fi
10697   have_ps2pdf=yes
10698elif test "x$use_ps2pdf" = x"no" ; then
10699   if test "x$PS2PDF" != "x"; then
10700      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10701   fi
10702   have_ps2pdf=no
10703else
10704   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10705fi
10706AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10707]) # XORG_WITH_PS2PDF
10708
10709# XORG_ENABLE_DOCS (enable_docs=yes)
10710# ----------------
10711# Minimum version: 1.6.0
10712#
10713# Documentation tools are not always available on all platforms and sometimes
10714# not at the appropriate level. This macro enables a builder to skip all
10715# documentation targets except traditional man pages.
10716# Combined with the specific tool checking macros XORG_WITH_*, it provides
10717# maximum flexibilty in controlling documentation building.
10718# Refer to:
10719# XORG_WITH_XMLTO         --with-xmlto
10720# XORG_WITH_ASCIIDOC      --with-asciidoc
10721# XORG_WITH_DOXYGEN       --with-doxygen
10722# XORG_WITH_FOP           --with-fop
10723# XORG_WITH_GROFF         --with-groff
10724# XORG_WITH_PS2PDF        --with-ps2pdf
10725#
10726# Interface to module:
10727# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10728# --enable-docs: 'yes' user instructs the module to generate docs
10729#		 'no' user instructs the module not to generate docs
10730# parm1:	specify the default value, yes or no.
10731#
10732AC_DEFUN([XORG_ENABLE_DOCS],[
10733m4_define([docs_default], m4_default([$1], [yes]))
10734AC_ARG_ENABLE(docs,
10735	AS_HELP_STRING([--enable-docs],
10736	   [Enable building the documentation (default: ]docs_default[)]),
10737	   [build_docs=$enableval], [build_docs=]docs_default)
10738m4_undefine([docs_default])
10739AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10740AC_MSG_CHECKING([whether to build documentation])
10741AC_MSG_RESULT([$build_docs])
10742]) # XORG_ENABLE_DOCS
10743
10744# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10745# ----------------
10746# Minimum version: 1.6.0
10747#
10748# This macro enables a builder to skip all developer documentation.
10749# Combined with the specific tool checking macros XORG_WITH_*, it provides
10750# maximum flexibilty in controlling documentation building.
10751# Refer to:
10752# XORG_WITH_XMLTO         --with-xmlto
10753# XORG_WITH_ASCIIDOC      --with-asciidoc
10754# XORG_WITH_DOXYGEN       --with-doxygen
10755# XORG_WITH_FOP           --with-fop
10756# XORG_WITH_GROFF         --with-groff
10757# XORG_WITH_PS2PDF        --with-ps2pdf
10758#
10759# Interface to module:
10760# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10761# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10762#			'no' user instructs the module not to generate developer docs
10763# parm1:		specify the default value, yes or no.
10764#
10765AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10766m4_define([devel_default], m4_default([$1], [yes]))
10767AC_ARG_ENABLE(devel-docs,
10768	AS_HELP_STRING([--enable-devel-docs],
10769	   [Enable building the developer documentation (default: ]devel_default[)]),
10770	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10771m4_undefine([devel_default])
10772AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10773AC_MSG_CHECKING([whether to build developer documentation])
10774AC_MSG_RESULT([$build_devel_docs])
10775]) # XORG_ENABLE_DEVEL_DOCS
10776
10777# XORG_ENABLE_SPECS (enable_specs=yes)
10778# ----------------
10779# Minimum version: 1.6.0
10780#
10781# This macro enables a builder to skip all functional specification targets.
10782# Combined with the specific tool checking macros XORG_WITH_*, it provides
10783# maximum flexibilty in controlling documentation building.
10784# Refer to:
10785# XORG_WITH_XMLTO         --with-xmlto
10786# XORG_WITH_ASCIIDOC      --with-asciidoc
10787# XORG_WITH_DOXYGEN       --with-doxygen
10788# XORG_WITH_FOP           --with-fop
10789# XORG_WITH_GROFF         --with-groff
10790# XORG_WITH_PS2PDF        --with-ps2pdf
10791#
10792# Interface to module:
10793# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10794# --enable-specs:	'yes' user instructs the module to generate specs
10795#			'no' user instructs the module not to generate specs
10796# parm1:		specify the default value, yes or no.
10797#
10798AC_DEFUN([XORG_ENABLE_SPECS],[
10799m4_define([spec_default], m4_default([$1], [yes]))
10800AC_ARG_ENABLE(specs,
10801	AS_HELP_STRING([--enable-specs],
10802	   [Enable building the specs (default: ]spec_default[)]),
10803	   [build_specs=$enableval], [build_specs=]spec_default)
10804m4_undefine([spec_default])
10805AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10806AC_MSG_CHECKING([whether to build functional specifications])
10807AC_MSG_RESULT([$build_specs])
10808]) # XORG_ENABLE_SPECS
10809
10810# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10811# ----------------------------------------------
10812# Minimum version: 1.13.0
10813#
10814# This macro enables a builder to enable/disable unit testing
10815# It makes no assumption about the test cases implementation
10816# Test cases may or may not use Automake "Support for test suites"
10817# They may or may not use the software utility library GLib
10818#
10819# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10820# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10821# The variable enable_unit_tests is used by other macros in this file.
10822#
10823# Interface to module:
10824# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10825# enable_unit_tests:    used in configure.ac for additional configuration
10826# --enable-unit-tests:	'yes' user instructs the module to build tests
10827#			'no' user instructs the module not to build tests
10828# parm1:		specify the default value, yes or no.
10829#
10830AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10831AC_BEFORE([$0], [XORG_WITH_GLIB])
10832AC_BEFORE([$0], [XORG_LD_WRAP])
10833AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10834m4_define([_defopt], m4_default([$1], [auto]))
10835AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10836	[Enable building unit test cases (default: ]_defopt[)]),
10837	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10838m4_undefine([_defopt])
10839AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10840AC_MSG_CHECKING([whether to build unit test cases])
10841AC_MSG_RESULT([$enable_unit_tests])
10842]) # XORG_ENABLE_UNIT_TESTS
10843
10844# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10845# ------------------------------------------------------
10846# Minimum version: 1.17.0
10847#
10848# This macro enables a builder to enable/disable integration testing
10849# It makes no assumption about the test cases' implementation
10850# Test cases may or may not use Automake "Support for test suites"
10851#
10852# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10853# usually requires less dependencies and may be built and run under less
10854# stringent environments than integration tests.
10855#
10856# Interface to module:
10857# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10858# enable_integration_tests:   used in configure.ac for additional configuration
10859# --enable-integration-tests: 'yes' user instructs the module to build tests
10860#                             'no' user instructs the module not to build tests
10861# parm1:                      specify the default value, yes or no.
10862#
10863AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10864AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10865m4_define([_defopt], m4_default([$1], [auto]))
10866AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10867	[Enable building integration test cases (default: ]_defopt[)]),
10868	[enable_integration_tests=$enableval],
10869	[enable_integration_tests=]_defopt)
10870m4_undefine([_defopt])
10871AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10872	[test "x$enable_integration_tests" != xno])
10873AC_MSG_CHECKING([whether to build unit test cases])
10874AC_MSG_RESULT([$enable_integration_tests])
10875]) # XORG_ENABLE_INTEGRATION_TESTS
10876
10877# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10878# ----------------------------------------
10879# Minimum version: 1.13.0
10880#
10881# GLib is a library which provides advanced data structures and functions.
10882# This macro enables a module to test for the presence of Glib.
10883#
10884# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10885# Otherwise the value of $enable_unit_tests is blank.
10886#
10887# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10888# test support usually requires less dependencies and may be built and run under
10889# less stringent environments than integration tests.
10890#
10891# Interface to module:
10892# HAVE_GLIB: used in makefiles to conditionally build targets
10893# with_glib: used in configure.ac to know if GLib has been found
10894# --with-glib:	'yes' user instructs the module to use glib
10895#		'no' user instructs the module not to use glib
10896#
10897AC_DEFUN([XORG_WITH_GLIB],[
10898AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10899m4_define([_defopt], m4_default([$2], [auto]))
10900AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10901	[Use GLib library for unit testing (default: ]_defopt[)]),
10902	[with_glib=$withval], [with_glib=]_defopt)
10903m4_undefine([_defopt])
10904
10905have_glib=no
10906# Do not probe GLib if user explicitly disabled unit testing
10907if test "x$enable_unit_tests" != x"no"; then
10908  # Do not probe GLib if user explicitly disabled it
10909  if test "x$with_glib" != x"no"; then
10910    m4_ifval(
10911      [$1],
10912      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10913      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10914    )
10915  fi
10916fi
10917
10918# Not having GLib when unit testing has been explicitly requested is an error
10919if test "x$enable_unit_tests" = x"yes"; then
10920  if test "x$have_glib" = x"no"; then
10921    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10922  fi
10923fi
10924
10925# Having unit testing disabled when GLib has been explicitly requested is an error
10926if test "x$enable_unit_tests" = x"no"; then
10927  if test "x$with_glib" = x"yes"; then
10928    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10929  fi
10930fi
10931
10932# Not having GLib when it has been explicitly requested is an error
10933if test "x$with_glib" = x"yes"; then
10934  if test "x$have_glib" = x"no"; then
10935    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10936  fi
10937fi
10938
10939AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10940]) # XORG_WITH_GLIB
10941
10942# XORG_LD_WRAP([required|optional])
10943# ---------------------------------
10944# Minimum version: 1.13.0
10945#
10946# Check if linker supports -wrap, passed via compiler flags
10947#
10948# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10949# Otherwise the value of $enable_unit_tests is blank.
10950#
10951# Argument added in 1.16.0 - default is "required", to match existing behavior
10952# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10953# available, an argument of "optional" allows use when some unit tests require
10954# ld -wrap and others do not.
10955#
10956AC_DEFUN([XORG_LD_WRAP],[
10957XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10958    [AC_LANG_PROGRAM([#include <stdlib.h>
10959                      void __wrap_exit(int status) { return; }],
10960                     [exit(0);])])
10961# Not having ld wrap when unit testing has been explicitly requested is an error
10962if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10963  if test "x$have_ld_wrap" = x"no"; then
10964    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10965  fi
10966fi
10967AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10968#
10969]) # XORG_LD_WRAP
10970
10971# XORG_CHECK_LINKER_FLAGS
10972# -----------------------
10973# SYNOPSIS
10974#
10975#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10976#
10977# DESCRIPTION
10978#
10979#   Check whether the given linker FLAGS work with the current language's
10980#   linker, or whether they give an error.
10981#
10982#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10983#   success/failure.
10984#
10985#   PROGRAM-SOURCE is the program source to link with, if needed
10986#
10987#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10988#
10989# LICENSE
10990#
10991#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10992#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10993#   Copyright (c) 2009 Matteo Frigo
10994#
10995#   This program is free software: you can redistribute it and/or modify it
10996#   under the terms of the GNU General Public License as published by the
10997#   Free Software Foundation, either version 3 of the License, or (at your
10998#   option) any later version.
10999#
11000#   This program is distributed in the hope that it will be useful, but
11001#   WITHOUT ANY WARRANTY; without even the implied warranty of
11002#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11003#   Public License for more details.
11004#
11005#   You should have received a copy of the GNU General Public License along
11006#   with this program. If not, see <http://www.gnu.org/licenses/>.
11007#
11008#   As a special exception, the respective Autoconf Macro's copyright owner
11009#   gives unlimited permission to copy, distribute and modify the configure
11010#   scripts that are the output of Autoconf when processing the Macro. You
11011#   need not follow the terms of the GNU General Public License when using
11012#   or distributing such scripts, even though portions of the text of the
11013#   Macro appear in them. The GNU General Public License (GPL) does govern
11014#   all other use of the material that constitutes the Autoconf Macro.
11015#
11016#   This special exception to the GPL applies to versions of the Autoconf
11017#   Macro released by the Autoconf Archive. When you make and distribute a
11018#   modified version of the Autoconf Macro, you may extend this special
11019#   exception to the GPL to apply to your modified version as well.#
11020AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11021[AC_MSG_CHECKING([whether the linker accepts $1])
11022dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11023AS_LITERAL_IF([$1],
11024  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11025      ax_save_FLAGS=$LDFLAGS
11026      LDFLAGS="$1"
11027      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11028        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11029        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11030      LDFLAGS=$ax_save_FLAGS])],
11031  [ax_save_FLAGS=$LDFLAGS
11032   LDFLAGS="$1"
11033   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11034     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11035     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11036   LDFLAGS=$ax_save_FLAGS])
11037eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11038AC_MSG_RESULT($xorg_check_linker_flags)
11039if test "x$xorg_check_linker_flags" = xyes; then
11040	m4_default([$2], :)
11041else
11042	m4_default([$3], :)
11043fi
11044]) # XORG_CHECK_LINKER_FLAGS
11045
11046# XORG_MEMORY_CHECK_FLAGS
11047# -----------------------
11048# Minimum version: 1.16.0
11049#
11050# This macro attempts to find appropriate memory checking functionality
11051# for various platforms which unit testing code may use to catch various
11052# forms of memory allocation and access errors in testing.
11053#
11054# Interface to module:
11055# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11056#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11057#
11058# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11059#
11060AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11061
11062AC_REQUIRE([AC_CANONICAL_HOST])
11063AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11064           [Environment variables to enable memory checking in tests])
11065
11066# Check for different types of support on different platforms
11067case $host_os in
11068    solaris*)
11069        AC_CHECK_LIB([umem], [umem_alloc],
11070            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11071        ;;
11072    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11073        # both directly and inverted, so should not be 0 or 255.
11074        malloc_debug_env='MALLOC_PERTURB_=15'
11075        ;;
11076    darwin*)
11077        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11078        ;;
11079    *bsd*)
11080        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11081        ;;
11082esac
11083
11084# User supplied flags override default flags
11085if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11086    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11087fi
11088
11089AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11090]) # XORG_WITH_LINT
11091
11092# XORG_CHECK_MALLOC_ZERO
11093# ----------------------
11094# Minimum version: 1.0.0
11095#
11096# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11097# malloc(0) returns NULL.  Packages should add one of these cflags to
11098# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11099AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11100AC_ARG_ENABLE(malloc0returnsnull,
11101	AS_HELP_STRING([--enable-malloc0returnsnull],
11102		       [malloc(0) returns NULL (default: auto)]),
11103	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11104	[MALLOC_ZERO_RETURNS_NULL=auto])
11105
11106AC_MSG_CHECKING([whether malloc(0) returns NULL])
11107if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11108	AC_RUN_IFELSE([AC_LANG_PROGRAM([
11109#include <stdlib.h>
11110],[
11111    char *m0, *r0, *c0, *p;
11112    m0 = malloc(0);
11113    p = malloc(10);
11114    r0 = realloc(p,0);
11115    c0 = calloc(0,10);
11116    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11117])],
11118		[MALLOC_ZERO_RETURNS_NULL=yes],
11119		[MALLOC_ZERO_RETURNS_NULL=no],
11120		[MALLOC_ZERO_RETURNS_NULL=yes])
11121fi
11122AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11123
11124if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11125	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11126	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11127	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11128else
11129	MALLOC_ZERO_CFLAGS=""
11130	XMALLOC_ZERO_CFLAGS=""
11131	XTMALLOC_ZERO_CFLAGS=""
11132fi
11133
11134AC_SUBST([MALLOC_ZERO_CFLAGS])
11135AC_SUBST([XMALLOC_ZERO_CFLAGS])
11136AC_SUBST([XTMALLOC_ZERO_CFLAGS])
11137]) # XORG_CHECK_MALLOC_ZERO
11138
11139# XORG_WITH_LINT()
11140# ----------------
11141# Minimum version: 1.1.0
11142#
11143# This macro enables the use of a tool that flags some suspicious and
11144# non-portable constructs (likely to be bugs) in C language source code.
11145# It will attempt to locate the tool and use appropriate options.
11146# There are various lint type tools on different platforms.
11147#
11148# Interface to module:
11149# LINT:		returns the path to the tool found on the platform
11150#		or the value set to LINT on the configure cmd line
11151#		also an Automake conditional
11152# LINT_FLAGS:	an Automake variable with appropriate flags
11153#
11154# --with-lint:	'yes' user instructs the module to use lint
11155#		'no' user instructs the module not to use lint (default)
11156#
11157# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11158# If the user sets the value of LINT_FLAGS, they are used verbatim.
11159#
11160AC_DEFUN([XORG_WITH_LINT],[
11161
11162AC_ARG_VAR([LINT], [Path to a lint-style command])
11163AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11164AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11165		[Use a lint-style source code checker (default: disabled)])],
11166		[use_lint=$withval], [use_lint=no])
11167
11168# Obtain platform specific info like program name and options
11169# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11170case $host_os in
11171  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11172	lint_name=splint
11173	lint_options="-badflag"
11174	;;
11175  *freebsd* | *netbsd*)
11176	lint_name=lint
11177	lint_options="-u -b"
11178	;;
11179  *solaris*)
11180	lint_name=lint
11181	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11182	;;
11183esac
11184
11185# Test for the presence of the program (either guessed by the code or spelled out by the user)
11186if test "x$use_lint" = x"yes" ; then
11187   AC_PATH_PROG([LINT], [$lint_name])
11188   if test "x$LINT" = "x"; then
11189        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11190   fi
11191elif test "x$use_lint" = x"no" ; then
11192   if test "x$LINT" != "x"; then
11193      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11194   fi
11195else
11196   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11197fi
11198
11199# User supplied flags override default flags
11200if test "x$LINT_FLAGS" != "x"; then
11201   lint_options=$LINT_FLAGS
11202fi
11203
11204AC_SUBST([LINT_FLAGS],[$lint_options])
11205AM_CONDITIONAL(LINT, [test "x$LINT" != x])
11206
11207]) # XORG_WITH_LINT
11208
11209# XORG_LINT_LIBRARY(LIBNAME)
11210# --------------------------
11211# Minimum version: 1.1.0
11212#
11213# Sets up flags for building lint libraries for checking programs that call
11214# functions in the library.
11215#
11216# Interface to module:
11217# LINTLIB		- Automake variable with the name of lint library file to make
11218# MAKE_LINT_LIB		- Automake conditional
11219#
11220# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11221#			  - 'no' user instructs the module not to create a lint library (default)
11222
11223AC_DEFUN([XORG_LINT_LIBRARY],[
11224AC_REQUIRE([XORG_WITH_LINT])
11225AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11226	[Create lint library (default: disabled)])],
11227	[make_lint_lib=$enableval], [make_lint_lib=no])
11228
11229if test "x$make_lint_lib" = x"yes" ; then
11230   LINTLIB=llib-l$1.ln
11231   if test "x$LINT" = "x"; then
11232        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11233   fi
11234elif test "x$make_lint_lib" != x"no" ; then
11235   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11236fi
11237
11238AC_SUBST(LINTLIB)
11239AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11240
11241]) # XORG_LINT_LIBRARY
11242
11243# XORG_COMPILER_BRAND
11244# -------------------
11245# Minimum version: 1.14.0
11246#
11247# Checks for various brands of compilers and sets flags as appropriate:
11248#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11249#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11250#   clang compiler - sets CLANGCC to "yes"
11251#   Intel compiler - sets INTELCC to "yes"
11252#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11253#
11254AC_DEFUN([XORG_COMPILER_BRAND], [
11255AC_LANG_CASE(
11256	[C], [
11257		AC_REQUIRE([AC_PROG_CC_C99])
11258	],
11259	[C++], [
11260		AC_REQUIRE([AC_PROG_CXX])
11261	]
11262)
11263AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11264AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11265AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11266]) # XORG_COMPILER_BRAND
11267
11268# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11269# ---------------
11270# Minimum version: 1.16.0
11271#
11272# Test if the compiler works when passed the given flag as a command line argument.
11273# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11274# next flag in the list until there are no more options.
11275#
11276# Note that this does not guarantee that the compiler supports the flag as some
11277# compilers will simply ignore arguments that they do not understand, but we do
11278# attempt to weed out false positives by using -Werror=unknown-warning-option and
11279# -Werror=unused-command-line-argument
11280#
11281AC_DEFUN([XORG_TESTSET_CFLAG], [
11282m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11283m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11284
11285AC_LANG_COMPILER_REQUIRE
11286
11287AC_LANG_CASE(
11288	[C], [
11289		AC_REQUIRE([AC_PROG_CC_C99])
11290		define([PREFIX], [C])
11291		define([CACHE_PREFIX], [cc])
11292		define([COMPILER], [$CC])
11293	],
11294	[C++], [
11295		define([PREFIX], [CXX])
11296		define([CACHE_PREFIX], [cxx])
11297		define([COMPILER], [$CXX])
11298	]
11299)
11300
11301[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11302
11303if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11304	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11305	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11306			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11307			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11308					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11309					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11310	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11311	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11312fi
11313
11314if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11315	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11316		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11317	fi
11318	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11319	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11320			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11321			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11322					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11323					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11324	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11325	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11326fi
11327
11328found="no"
11329m4_foreach([flag], m4_cdr($@), [
11330	if test $found = "no" ; then
11331		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11332			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11333		fi
11334
11335		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11336			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11337		fi
11338
11339		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11340
11341dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11342		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11343		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11344		AC_CACHE_VAL($cacheid,
11345			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11346					     [eval $cacheid=yes],
11347					     [eval $cacheid=no])])
11348
11349		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11350
11351		eval supported=\$$cacheid
11352		AC_MSG_RESULT([$supported])
11353		if test "$supported" = "yes" ; then
11354			$1="$$1 ]flag["
11355			found="yes"
11356		fi
11357	fi
11358])
11359]) # XORG_TESTSET_CFLAG
11360
11361# XORG_COMPILER_FLAGS
11362# ---------------
11363# Minimum version: 1.16.0
11364#
11365# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11366# arguments supported by the selected compiler which do NOT alter the generated
11367# code.  These arguments will cause the compiler to print various warnings
11368# during compilation AND turn a conservative set of warnings into errors.
11369#
11370# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11371# future versions of util-macros as options are added to new compilers.
11372#
11373AC_DEFUN([XORG_COMPILER_FLAGS], [
11374AC_REQUIRE([XORG_COMPILER_BRAND])
11375
11376AC_ARG_ENABLE(selective-werror,
11377              AS_HELP_STRING([--disable-selective-werror],
11378                             [Turn off selective compiler errors. (default: enabled)]),
11379              [SELECTIVE_WERROR=$enableval],
11380              [SELECTIVE_WERROR=yes])
11381
11382AC_LANG_CASE(
11383        [C], [
11384                define([PREFIX], [C])
11385        ],
11386        [C++], [
11387                define([PREFIX], [CXX])
11388        ]
11389)
11390# -v is too short to test reliably with XORG_TESTSET_CFLAG
11391if test "x$SUNCC" = "xyes"; then
11392    [BASE_]PREFIX[FLAGS]="-v"
11393else
11394    [BASE_]PREFIX[FLAGS]=""
11395fi
11396
11397# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11398XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11399XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11400XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11401XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11402
11403AC_LANG_CASE(
11404	[C], [
11405		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11406		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11407		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11408		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11409		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11410		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11411	]
11412)
11413
11414# This chunk adds additional warnings that could catch undesired effects.
11415XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11416XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11417XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11418XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11419XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11420XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11421XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11422
11423# These are currently disabled because they are noisy.  They will be enabled
11424# in the future once the codebase is sufficiently modernized to silence
11425# them.  For now, I don't want them to drown out the other warnings.
11426# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11427# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11428# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11429
11430# Turn some warnings into errors, so we don't accidently get successful builds
11431# when there are problems that should be fixed.
11432
11433if test "x$SELECTIVE_WERROR" = "xyes" ; then
11434XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11435XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11436XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11437XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11438XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11439XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11440XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11441XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11442XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11443XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11444XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11445XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11446XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11447else
11448AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
11449XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11450XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11451XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11452XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11453XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11454XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11455XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11456XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11457XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11458XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11459XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11460XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11461XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11462fi
11463
11464AC_SUBST([BASE_]PREFIX[FLAGS])
11465]) # XORG_COMPILER_FLAGS
11466
11467# XORG_CWARNFLAGS
11468# ---------------
11469# Minimum version: 1.2.0
11470# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11471#
11472# Defines CWARNFLAGS to enable C compiler warnings.
11473#
11474# This function is deprecated because it defines -fno-strict-aliasing
11475# which alters the code generated by the compiler.  If -fno-strict-aliasing
11476# is needed, then it should be added explicitly in the module when
11477# it is updated to use BASE_CFLAGS.
11478#
11479AC_DEFUN([XORG_CWARNFLAGS], [
11480AC_REQUIRE([XORG_COMPILER_FLAGS])
11481AC_REQUIRE([XORG_COMPILER_BRAND])
11482AC_LANG_CASE(
11483	[C], [
11484		CWARNFLAGS="$BASE_CFLAGS"
11485		if  test "x$GCC" = xyes ; then
11486		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11487		fi
11488		AC_SUBST(CWARNFLAGS)
11489	]
11490)
11491]) # XORG_CWARNFLAGS
11492
11493# XORG_STRICT_OPTION
11494# -----------------------
11495# Minimum version: 1.3.0
11496#
11497# Add configure option to enable strict compilation flags, such as treating
11498# warnings as fatal errors.
11499# If --enable-strict-compilation is passed to configure, adds strict flags to
11500# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11501#
11502# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11503# when strict compilation is unconditionally desired.
11504AC_DEFUN([XORG_STRICT_OPTION], [
11505AC_REQUIRE([XORG_CWARNFLAGS])
11506AC_REQUIRE([XORG_COMPILER_FLAGS])
11507
11508AC_ARG_ENABLE(strict-compilation,
11509			  AS_HELP_STRING([--enable-strict-compilation],
11510			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11511			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11512
11513AC_LANG_CASE(
11514        [C], [
11515                define([PREFIX], [C])
11516        ],
11517        [C++], [
11518                define([PREFIX], [CXX])
11519        ]
11520)
11521
11522[STRICT_]PREFIX[FLAGS]=""
11523XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11524XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11525
11526# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11527# activate it with -Werror, so we add it here explicitly.
11528XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11529
11530if test "x$STRICT_COMPILE" = "xyes"; then
11531    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11532    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11533fi
11534AC_SUBST([STRICT_]PREFIX[FLAGS])
11535AC_SUBST([BASE_]PREFIX[FLAGS])
11536AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11537]) # XORG_STRICT_OPTION
11538
11539# XORG_DEFAULT_OPTIONS
11540# --------------------
11541# Minimum version: 1.3.0
11542#
11543# Defines default options for X.Org modules.
11544#
11545AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11546AC_REQUIRE([AC_PROG_INSTALL])
11547XORG_COMPILER_FLAGS
11548XORG_CWARNFLAGS
11549XORG_STRICT_OPTION
11550XORG_RELEASE_VERSION
11551XORG_CHANGELOG
11552XORG_INSTALL
11553XORG_MANPAGE_SECTIONS
11554m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11555    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11556]) # XORG_DEFAULT_OPTIONS
11557
11558# XORG_INSTALL()
11559# ----------------
11560# Minimum version: 1.4.0
11561#
11562# Defines the variable INSTALL_CMD as the command to copy
11563# INSTALL from $prefix/share/util-macros.
11564#
11565AC_DEFUN([XORG_INSTALL], [
11566AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11567macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11568INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11569mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11570|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11571echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11572AC_SUBST([INSTALL_CMD])
11573]) # XORG_INSTALL
11574dnl Copyright 2005 Red Hat, Inc
11575dnl
11576dnl Permission to use, copy, modify, distribute, and sell this software and its
11577dnl documentation for any purpose is hereby granted without fee, provided that
11578dnl the above copyright notice appear in all copies and that both that
11579dnl copyright notice and this permission notice appear in supporting
11580dnl documentation.
11581dnl
11582dnl The above copyright notice and this permission notice shall be included
11583dnl in all copies or substantial portions of the Software.
11584dnl
11585dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11586dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11587dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11588dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11589dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11590dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11591dnl OTHER DEALINGS IN THE SOFTWARE.
11592dnl
11593dnl Except as contained in this notice, the name of the copyright holders shall
11594dnl not be used in advertising or otherwise to promote the sale, use or
11595dnl other dealings in this Software without prior written authorization
11596dnl from the copyright holders.
11597dnl
11598
11599# XORG_RELEASE_VERSION
11600# --------------------
11601# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11602 
11603AC_DEFUN([XORG_RELEASE_VERSION],[
11604	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11605		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11606		[Major version of this package])
11607	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11608	if test "x$PVM" = "x"; then
11609		PVM="0"
11610	fi
11611	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11612		[$PVM],
11613		[Minor version of this package])
11614	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11615	if test "x$PVP" = "x"; then
11616		PVP="0"
11617	fi
11618	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11619		[$PVP],
11620		[Patch version of this package])
11621])
11622
11623# XORG_CHANGELOG()
11624# ----------------
11625# Minimum version: 1.2.0
11626#
11627# Defines the variable CHANGELOG_CMD as the command to generate
11628# ChangeLog from git.
11629#
11630#
11631AC_DEFUN([XORG_CHANGELOG], [
11632CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11633mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11634|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11635echo 'git directory not found: installing possibly empty changelog.' >&2)"
11636AC_SUBST([CHANGELOG_CMD])
11637]) # XORG_CHANGELOG
11638
11639