aclocal.m4 revision ac92798b
1# generated automatically by aclocal 1.14 -*- Autoconf -*-
2
3# Copyright (C) 1996-2013 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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15m4_ifndef([AC_AUTOCONF_VERSION],
16  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18[m4_warning([this file was generated for autoconf 2.68.
19You have another version of autoconf.  It may work, but is not guaranteed to.
20If you have problems, you may need to regenerate the build system entirely.
21To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22
23# Copyright (C) 2002-2013 Free Software Foundation, Inc.
24#
25# This file is free software; the Free Software Foundation
26# gives unlimited permission to copy and/or distribute it,
27# with or without modifications, as long as this notice is preserved.
28
29# AM_AUTOMAKE_VERSION(VERSION)
30# ----------------------------
31# Automake X.Y traces this macro to ensure aclocal.m4 has been
32# generated from the m4 files accompanying Automake X.Y.
33# (This private macro should not be called outside this file.)
34AC_DEFUN([AM_AUTOMAKE_VERSION],
35[am__api_version='1.14'
36dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37dnl require some minimum version.  Point them to the right macro.
38m4_if([$1], [1.14], [],
39      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40])
41
42# _AM_AUTOCONF_VERSION(VERSION)
43# -----------------------------
44# aclocal traces this macro to find the Autoconf version.
45# This is a private macro too.  Using m4_define simplifies
46# the logic in aclocal, which can simply ignore this definition.
47m4_define([_AM_AUTOCONF_VERSION], [])
48
49# AM_SET_CURRENT_AUTOMAKE_VERSION
50# -------------------------------
51# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54[AM_AUTOMAKE_VERSION([1.14])dnl
55m4_ifndef([AC_AUTOCONF_VERSION],
56  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58
59# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60
61# Copyright (C) 2001-2013 Free Software Foundation, Inc.
62#
63# This file is free software; the Free Software Foundation
64# gives unlimited permission to copy and/or distribute it,
65# with or without modifications, as long as this notice is preserved.
66
67# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70#
71# Of course, Automake must honor this variable whenever it calls a
72# tool from the auxiliary directory.  The problem is that $srcdir (and
73# therefore $ac_aux_dir as well) can be either absolute or relative,
74# depending on how configure is run.  This is pretty annoying, since
75# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76# source directory, any form will work fine, but in subdirectories a
77# relative path needs to be adjusted first.
78#
79# $ac_aux_dir/missing
80#    fails when called from a subdirectory if $ac_aux_dir is relative
81# $top_srcdir/$ac_aux_dir/missing
82#    fails if $ac_aux_dir is absolute,
83#    fails when called from a subdirectory in a VPATH build with
84#          a relative $ac_aux_dir
85#
86# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87# are both prefixed by $srcdir.  In an in-source build this is usually
88# harmless because $srcdir is '.', but things will broke when you
89# start a VPATH build or use an absolute $srcdir.
90#
91# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94# and then we would define $MISSING as
95#   MISSING="\${SHELL} $am_aux_dir/missing"
96# This will work as long as MISSING is not called from configure, because
97# unfortunately $(top_srcdir) has no meaning in configure.
98# However there are other variables, like CC, which are often used in
99# configure, and could therefore not use this "fixed" $ac_aux_dir.
100#
101# Another solution, used here, is to always expand $ac_aux_dir to an
102# absolute PATH.  The drawback is that using absolute paths prevent a
103# configured tree to be moved without reconfiguration.
104
105AC_DEFUN([AM_AUX_DIR_EXPAND],
106[dnl Rely on autoconf to set up CDPATH properly.
107AC_PREREQ([2.50])dnl
108# expand $ac_aux_dir to an absolute path
109am_aux_dir=`cd $ac_aux_dir && pwd`
110])
111
112# AM_CONDITIONAL                                            -*- Autoconf -*-
113
114# Copyright (C) 1997-2013 Free Software Foundation, Inc.
115#
116# This file is free software; the Free Software Foundation
117# gives unlimited permission to copy and/or distribute it,
118# with or without modifications, as long as this notice is preserved.
119
120# AM_CONDITIONAL(NAME, SHELL-CONDITION)
121# -------------------------------------
122# Define a conditional.
123AC_DEFUN([AM_CONDITIONAL],
124[AC_PREREQ([2.52])dnl
125 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
126       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
127AC_SUBST([$1_TRUE])dnl
128AC_SUBST([$1_FALSE])dnl
129_AM_SUBST_NOTMAKE([$1_TRUE])dnl
130_AM_SUBST_NOTMAKE([$1_FALSE])dnl
131m4_define([_AM_COND_VALUE_$1], [$2])dnl
132if $2; then
133  $1_TRUE=
134  $1_FALSE='#'
135else
136  $1_TRUE='#'
137  $1_FALSE=
138fi
139AC_CONFIG_COMMANDS_PRE(
140[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
141  AC_MSG_ERROR([[conditional "$1" was never defined.
142Usually this means the macro was only invoked conditionally.]])
143fi])])
144
145# Copyright (C) 1999-2013 Free Software Foundation, Inc.
146#
147# This file is free software; the Free Software Foundation
148# gives unlimited permission to copy and/or distribute it,
149# with or without modifications, as long as this notice is preserved.
150
151
152# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
153# written in clear, in which case automake, when reading aclocal.m4,
154# will think it sees a *use*, and therefore will trigger all it's
155# C support machinery.  Also note that it means that autoscan, seeing
156# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
157
158
159# _AM_DEPENDENCIES(NAME)
160# ----------------------
161# See how the compiler implements dependency checking.
162# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
163# We try a few techniques and use that to set a single cache variable.
164#
165# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
166# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
167# dependency, and given that the user is not expected to run this macro,
168# just rely on AC_PROG_CC.
169AC_DEFUN([_AM_DEPENDENCIES],
170[AC_REQUIRE([AM_SET_DEPDIR])dnl
171AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
172AC_REQUIRE([AM_MAKE_INCLUDE])dnl
173AC_REQUIRE([AM_DEP_TRACK])dnl
174
175m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
176      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
177      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
178      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
179      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
180      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
181                    [depcc="$$1"   am_compiler_list=])
182
183AC_CACHE_CHECK([dependency style of $depcc],
184               [am_cv_$1_dependencies_compiler_type],
185[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
186  # We make a subdir and do the tests there.  Otherwise we can end up
187  # making bogus files that we don't know about and never remove.  For
188  # instance it was reported that on HP-UX the gcc test will end up
189  # making a dummy file named 'D' -- because '-MD' means "put the output
190  # in D".
191  rm -rf conftest.dir
192  mkdir conftest.dir
193  # Copy depcomp to subdir because otherwise we won't find it if we're
194  # using a relative directory.
195  cp "$am_depcomp" conftest.dir
196  cd conftest.dir
197  # We will build objects and dependencies in a subdirectory because
198  # it helps to detect inapplicable dependency modes.  For instance
199  # both Tru64's cc and ICC support -MD to output dependencies as a
200  # side effect of compilation, but ICC will put the dependencies in
201  # the current directory while Tru64 will put them in the object
202  # directory.
203  mkdir sub
204
205  am_cv_$1_dependencies_compiler_type=none
206  if test "$am_compiler_list" = ""; then
207     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
208  fi
209  am__universal=false
210  m4_case([$1], [CC],
211    [case " $depcc " in #(
212     *\ -arch\ *\ -arch\ *) am__universal=true ;;
213     esac],
214    [CXX],
215    [case " $depcc " in #(
216     *\ -arch\ *\ -arch\ *) am__universal=true ;;
217     esac])
218
219  for depmode in $am_compiler_list; do
220    # Setup a source with many dependencies, because some compilers
221    # like to wrap large dependency lists on column 80 (with \), and
222    # we should not choose a depcomp mode which is confused by this.
223    #
224    # We need to recreate these files for each test, as the compiler may
225    # overwrite some of them when testing with obscure command lines.
226    # This happens at least with the AIX C compiler.
227    : > sub/conftest.c
228    for i in 1 2 3 4 5 6; do
229      echo '#include "conftst'$i'.h"' >> sub/conftest.c
230      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
231      # Solaris 10 /bin/sh.
232      echo '/* dummy */' > sub/conftst$i.h
233    done
234    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
235
236    # We check with '-c' and '-o' for the sake of the "dashmstdout"
237    # mode.  It turns out that the SunPro C++ compiler does not properly
238    # handle '-M -o', and we need to detect this.  Also, some Intel
239    # versions had trouble with output in subdirs.
240    am__obj=sub/conftest.${OBJEXT-o}
241    am__minus_obj="-o $am__obj"
242    case $depmode in
243    gcc)
244      # This depmode causes a compiler race in universal mode.
245      test "$am__universal" = false || continue
246      ;;
247    nosideeffect)
248      # After this tag, mechanisms are not by side-effect, so they'll
249      # only be used when explicitly requested.
250      if test "x$enable_dependency_tracking" = xyes; then
251	continue
252      else
253	break
254      fi
255      ;;
256    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
257      # This compiler won't grok '-c -o', but also, the minuso test has
258      # not run yet.  These depmodes are late enough in the game, and
259      # so weak that their functioning should not be impacted.
260      am__obj=conftest.${OBJEXT-o}
261      am__minus_obj=
262      ;;
263    none) break ;;
264    esac
265    if depmode=$depmode \
266       source=sub/conftest.c object=$am__obj \
267       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
268       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
269         >/dev/null 2>conftest.err &&
270       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
271       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
272       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
273       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
274      # icc doesn't choke on unknown options, it will just issue warnings
275      # or remarks (even with -Werror).  So we grep stderr for any message
276      # that says an option was ignored or not supported.
277      # When given -MP, icc 7.0 and 7.1 complain thusly:
278      #   icc: Command line warning: ignoring option '-M'; no argument required
279      # The diagnosis changed in icc 8.0:
280      #   icc: Command line remark: option '-MP' not supported
281      if (grep 'ignoring option' conftest.err ||
282          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
283        am_cv_$1_dependencies_compiler_type=$depmode
284        break
285      fi
286    fi
287  done
288
289  cd ..
290  rm -rf conftest.dir
291else
292  am_cv_$1_dependencies_compiler_type=none
293fi
294])
295AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
296AM_CONDITIONAL([am__fastdep$1], [
297  test "x$enable_dependency_tracking" != xno \
298  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
299])
300
301
302# AM_SET_DEPDIR
303# -------------
304# Choose a directory name for dependency files.
305# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
306AC_DEFUN([AM_SET_DEPDIR],
307[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
308AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
309])
310
311
312# AM_DEP_TRACK
313# ------------
314AC_DEFUN([AM_DEP_TRACK],
315[AC_ARG_ENABLE([dependency-tracking], [dnl
316AS_HELP_STRING(
317  [--enable-dependency-tracking],
318  [do not reject slow dependency extractors])
319AS_HELP_STRING(
320  [--disable-dependency-tracking],
321  [speeds up one-time build])])
322if test "x$enable_dependency_tracking" != xno; then
323  am_depcomp="$ac_aux_dir/depcomp"
324  AMDEPBACKSLASH='\'
325  am__nodep='_no'
326fi
327AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
328AC_SUBST([AMDEPBACKSLASH])dnl
329_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
330AC_SUBST([am__nodep])dnl
331_AM_SUBST_NOTMAKE([am__nodep])dnl
332])
333
334# Generate code to set up dependency tracking.              -*- Autoconf -*-
335
336# Copyright (C) 1999-2013 Free Software Foundation, Inc.
337#
338# This file is free software; the Free Software Foundation
339# gives unlimited permission to copy and/or distribute it,
340# with or without modifications, as long as this notice is preserved.
341
342
343# _AM_OUTPUT_DEPENDENCY_COMMANDS
344# ------------------------------
345AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
346[{
347  # Older Autoconf quotes --file arguments for eval, but not when files
348  # are listed without --file.  Let's play safe and only enable the eval
349  # if we detect the quoting.
350  case $CONFIG_FILES in
351  *\'*) eval set x "$CONFIG_FILES" ;;
352  *)   set x $CONFIG_FILES ;;
353  esac
354  shift
355  for mf
356  do
357    # Strip MF so we end up with the name of the file.
358    mf=`echo "$mf" | sed -e 's/:.*$//'`
359    # Check whether this is an Automake generated Makefile or not.
360    # We used to match only the files named 'Makefile.in', but
361    # some people rename them; so instead we look at the file content.
362    # Grep'ing the first line is not enough: some people post-process
363    # each Makefile.in and add a new line on top of each file to say so.
364    # Grep'ing the whole file is not good either: AIX grep has a line
365    # limit of 2048, but all sed's we know have understand at least 4000.
366    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
367      dirpart=`AS_DIRNAME("$mf")`
368    else
369      continue
370    fi
371    # Extract the definition of DEPDIR, am__include, and am__quote
372    # from the Makefile without running 'make'.
373    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
374    test -z "$DEPDIR" && continue
375    am__include=`sed -n 's/^am__include = //p' < "$mf"`
376    test -z "$am__include" && continue
377    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
378    # Find all dependency output files, they are included files with
379    # $(DEPDIR) in their names.  We invoke sed twice because it is the
380    # simplest approach to changing $(DEPDIR) to its actual value in the
381    # expansion.
382    for file in `sed -n "
383      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
384	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
385      # Make sure the directory exists.
386      test -f "$dirpart/$file" && continue
387      fdir=`AS_DIRNAME(["$file"])`
388      AS_MKDIR_P([$dirpart/$fdir])
389      # echo "creating $dirpart/$file"
390      echo '# dummy' > "$dirpart/$file"
391    done
392  done
393}
394])# _AM_OUTPUT_DEPENDENCY_COMMANDS
395
396
397# AM_OUTPUT_DEPENDENCY_COMMANDS
398# -----------------------------
399# This macro should only be invoked once -- use via AC_REQUIRE.
400#
401# This code is only required when automatic dependency tracking
402# is enabled.  FIXME.  This creates each '.P' file that we will
403# need in order to bootstrap the dependency handling code.
404AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
405[AC_CONFIG_COMMANDS([depfiles],
406     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
407     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
408])
409
410# Do all the work for Automake.                             -*- Autoconf -*-
411
412# Copyright (C) 1996-2013 Free Software Foundation, Inc.
413#
414# This file is free software; the Free Software Foundation
415# gives unlimited permission to copy and/or distribute it,
416# with or without modifications, as long as this notice is preserved.
417
418# This macro actually does too much.  Some checks are only needed if
419# your package does certain things.  But this isn't really a big deal.
420
421dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
422m4_define([AC_PROG_CC],
423m4_defn([AC_PROG_CC])
424[_AM_PROG_CC_C_O
425])
426
427# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
428# AM_INIT_AUTOMAKE([OPTIONS])
429# -----------------------------------------------
430# The call with PACKAGE and VERSION arguments is the old style
431# call (pre autoconf-2.50), which is being phased out.  PACKAGE
432# and VERSION should now be passed to AC_INIT and removed from
433# the call to AM_INIT_AUTOMAKE.
434# We support both call styles for the transition.  After
435# the next Automake release, Autoconf can make the AC_INIT
436# arguments mandatory, and then we can depend on a new Autoconf
437# release and drop the old call support.
438AC_DEFUN([AM_INIT_AUTOMAKE],
439[AC_PREREQ([2.65])dnl
440dnl Autoconf wants to disallow AM_ names.  We explicitly allow
441dnl the ones we care about.
442m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
443AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
444AC_REQUIRE([AC_PROG_INSTALL])dnl
445if test "`cd $srcdir && pwd`" != "`pwd`"; then
446  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
447  # is not polluted with repeated "-I."
448  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
449  # test to see if srcdir already configured
450  if test -f $srcdir/config.status; then
451    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
452  fi
453fi
454
455# test whether we have cygpath
456if test -z "$CYGPATH_W"; then
457  if (cygpath --version) >/dev/null 2>/dev/null; then
458    CYGPATH_W='cygpath -w'
459  else
460    CYGPATH_W=echo
461  fi
462fi
463AC_SUBST([CYGPATH_W])
464
465# Define the identity of the package.
466dnl Distinguish between old-style and new-style calls.
467m4_ifval([$2],
468[AC_DIAGNOSE([obsolete],
469             [$0: two- and three-arguments forms are deprecated.])
470m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
471 AC_SUBST([PACKAGE], [$1])dnl
472 AC_SUBST([VERSION], [$2])],
473[_AM_SET_OPTIONS([$1])dnl
474dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
475m4_if(
476  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
477  [ok:ok],,
478  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
479 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
480 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
481
482_AM_IF_OPTION([no-define],,
483[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
484 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
485
486# Some tools Automake needs.
487AC_REQUIRE([AM_SANITY_CHECK])dnl
488AC_REQUIRE([AC_ARG_PROGRAM])dnl
489AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
490AM_MISSING_PROG([AUTOCONF], [autoconf])
491AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
492AM_MISSING_PROG([AUTOHEADER], [autoheader])
493AM_MISSING_PROG([MAKEINFO], [makeinfo])
494AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
495AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
496AC_REQUIRE([AC_PROG_MKDIR_P])dnl
497# For better backward compatibility.  To be removed once Automake 1.9.x
498# dies out for good.  For more background, see:
499# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
500# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
501AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
502# We need awk for the "check" target.  The system "awk" is bad on
503# some platforms.
504AC_REQUIRE([AC_PROG_AWK])dnl
505AC_REQUIRE([AC_PROG_MAKE_SET])dnl
506AC_REQUIRE([AM_SET_LEADING_DOT])dnl
507_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
508	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
509			     [_AM_PROG_TAR([v7])])])
510_AM_IF_OPTION([no-dependencies],,
511[AC_PROVIDE_IFELSE([AC_PROG_CC],
512		  [_AM_DEPENDENCIES([CC])],
513		  [m4_define([AC_PROG_CC],
514			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
515AC_PROVIDE_IFELSE([AC_PROG_CXX],
516		  [_AM_DEPENDENCIES([CXX])],
517		  [m4_define([AC_PROG_CXX],
518			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
519AC_PROVIDE_IFELSE([AC_PROG_OBJC],
520		  [_AM_DEPENDENCIES([OBJC])],
521		  [m4_define([AC_PROG_OBJC],
522			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
523AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
524		  [_AM_DEPENDENCIES([OBJCXX])],
525		  [m4_define([AC_PROG_OBJCXX],
526			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
527])
528AC_REQUIRE([AM_SILENT_RULES])dnl
529dnl The testsuite driver may need to know about EXEEXT, so add the
530dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
531dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
532AC_CONFIG_COMMANDS_PRE(dnl
533[m4_provide_if([_AM_COMPILER_EXEEXT],
534  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
535
536# POSIX will say in a future version that running "rm -f" with no argument
537# is OK; and we want to be able to make that assumption in our Makefile
538# recipes.  So use an aggressive probe to check that the usage we want is
539# actually supported "in the wild" to an acceptable degree.
540# See automake bug#10828.
541# To make any issue more visible, cause the running configure to be aborted
542# by default if the 'rm' program in use doesn't match our expectations; the
543# user can still override this though.
544if rm -f && rm -fr && rm -rf; then : OK; else
545  cat >&2 <<'END'
546Oops!
547
548Your 'rm' program seems unable to run without file operands specified
549on the command line, even when the '-f' option is present.  This is contrary
550to the behaviour of most rm programs out there, and not conforming with
551the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
552
553Please tell bug-automake@gnu.org about your system, including the value
554of your $PATH and any error possibly output before this message.  This
555can help us improve future automake versions.
556
557END
558  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
559    echo 'Configuration will proceed anyway, since you have set the' >&2
560    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
561    echo >&2
562  else
563    cat >&2 <<'END'
564Aborting the configuration process, to ensure you take notice of the issue.
565
566You can download and install GNU coreutils to get an 'rm' implementation
567that behaves properly: <http://www.gnu.org/software/coreutils/>.
568
569If you want to complete the configuration process using your problematic
570'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
571to "yes", and re-run configure.
572
573END
574    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
575  fi
576fi])
577
578dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
579dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
580dnl mangled by Autoconf and run in a shell conditional statement.
581m4_define([_AC_COMPILER_EXEEXT],
582m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
583
584# When config.status generates a header, we must update the stamp-h file.
585# This file resides in the same directory as the config header
586# that is generated.  The stamp files are numbered to have different names.
587
588# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
589# loop where config.status creates the headers, so we can generate
590# our stamp files there.
591AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
592[# Compute $1's index in $config_headers.
593_am_arg=$1
594_am_stamp_count=1
595for _am_header in $config_headers :; do
596  case $_am_header in
597    $_am_arg | $_am_arg:* )
598      break ;;
599    * )
600      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
601  esac
602done
603echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
604
605# Copyright (C) 2001-2013 Free Software Foundation, Inc.
606#
607# This file is free software; the Free Software Foundation
608# gives unlimited permission to copy and/or distribute it,
609# with or without modifications, as long as this notice is preserved.
610
611# AM_PROG_INSTALL_SH
612# ------------------
613# Define $install_sh.
614AC_DEFUN([AM_PROG_INSTALL_SH],
615[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
616if test x"${install_sh}" != xset; then
617  case $am_aux_dir in
618  *\ * | *\	*)
619    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
620  *)
621    install_sh="\${SHELL} $am_aux_dir/install-sh"
622  esac
623fi
624AC_SUBST([install_sh])])
625
626# Copyright (C) 2003-2013 Free Software Foundation, Inc.
627#
628# This file is free software; the Free Software Foundation
629# gives unlimited permission to copy and/or distribute it,
630# with or without modifications, as long as this notice is preserved.
631
632# Check whether the underlying file-system supports filenames
633# with a leading dot.  For instance MS-DOS doesn't.
634AC_DEFUN([AM_SET_LEADING_DOT],
635[rm -rf .tst 2>/dev/null
636mkdir .tst 2>/dev/null
637if test -d .tst; then
638  am__leading_dot=.
639else
640  am__leading_dot=_
641fi
642rmdir .tst 2>/dev/null
643AC_SUBST([am__leading_dot])])
644
645# Check to see how 'make' treats includes.	            -*- Autoconf -*-
646
647# Copyright (C) 2001-2013 Free Software Foundation, Inc.
648#
649# This file is free software; the Free Software Foundation
650# gives unlimited permission to copy and/or distribute it,
651# with or without modifications, as long as this notice is preserved.
652
653# AM_MAKE_INCLUDE()
654# -----------------
655# Check to see how make treats includes.
656AC_DEFUN([AM_MAKE_INCLUDE],
657[am_make=${MAKE-make}
658cat > confinc << 'END'
659am__doit:
660	@echo this is the am__doit target
661.PHONY: am__doit
662END
663# If we don't find an include directive, just comment out the code.
664AC_MSG_CHECKING([for style of include used by $am_make])
665am__include="#"
666am__quote=
667_am_result=none
668# First try GNU make style include.
669echo "include confinc" > confmf
670# Ignore all kinds of additional output from 'make'.
671case `$am_make -s -f confmf 2> /dev/null` in #(
672*the\ am__doit\ target*)
673  am__include=include
674  am__quote=
675  _am_result=GNU
676  ;;
677esac
678# Now try BSD make style include.
679if test "$am__include" = "#"; then
680   echo '.include "confinc"' > confmf
681   case `$am_make -s -f confmf 2> /dev/null` in #(
682   *the\ am__doit\ target*)
683     am__include=.include
684     am__quote="\""
685     _am_result=BSD
686     ;;
687   esac
688fi
689AC_SUBST([am__include])
690AC_SUBST([am__quote])
691AC_MSG_RESULT([$_am_result])
692rm -f confinc confmf
693])
694
695# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
696
697# Copyright (C) 1997-2013 Free Software Foundation, Inc.
698#
699# This file is free software; the Free Software Foundation
700# gives unlimited permission to copy and/or distribute it,
701# with or without modifications, as long as this notice is preserved.
702
703# AM_MISSING_PROG(NAME, PROGRAM)
704# ------------------------------
705AC_DEFUN([AM_MISSING_PROG],
706[AC_REQUIRE([AM_MISSING_HAS_RUN])
707$1=${$1-"${am_missing_run}$2"}
708AC_SUBST($1)])
709
710# AM_MISSING_HAS_RUN
711# ------------------
712# Define MISSING if not defined so far and test if it is modern enough.
713# If it is, set am_missing_run to use it, otherwise, to nothing.
714AC_DEFUN([AM_MISSING_HAS_RUN],
715[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
716AC_REQUIRE_AUX_FILE([missing])dnl
717if test x"${MISSING+set}" != xset; then
718  case $am_aux_dir in
719  *\ * | *\	*)
720    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
721  *)
722    MISSING="\${SHELL} $am_aux_dir/missing" ;;
723  esac
724fi
725# Use eval to expand $SHELL
726if eval "$MISSING --is-lightweight"; then
727  am_missing_run="$MISSING "
728else
729  am_missing_run=
730  AC_MSG_WARN(['missing' script is too old or missing])
731fi
732])
733
734# Helper functions for option handling.                     -*- Autoconf -*-
735
736# Copyright (C) 2001-2013 Free Software Foundation, Inc.
737#
738# This file is free software; the Free Software Foundation
739# gives unlimited permission to copy and/or distribute it,
740# with or without modifications, as long as this notice is preserved.
741
742# _AM_MANGLE_OPTION(NAME)
743# -----------------------
744AC_DEFUN([_AM_MANGLE_OPTION],
745[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
746
747# _AM_SET_OPTION(NAME)
748# --------------------
749# Set option NAME.  Presently that only means defining a flag for this option.
750AC_DEFUN([_AM_SET_OPTION],
751[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
752
753# _AM_SET_OPTIONS(OPTIONS)
754# ------------------------
755# OPTIONS is a space-separated list of Automake options.
756AC_DEFUN([_AM_SET_OPTIONS],
757[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
758
759# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
760# -------------------------------------------
761# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
762AC_DEFUN([_AM_IF_OPTION],
763[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
764
765# Copyright (C) 1999-2013 Free Software Foundation, Inc.
766#
767# This file is free software; the Free Software Foundation
768# gives unlimited permission to copy and/or distribute it,
769# with or without modifications, as long as this notice is preserved.
770
771# _AM_PROG_CC_C_O
772# ---------------
773# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
774# to automatically call this.
775AC_DEFUN([_AM_PROG_CC_C_O],
776[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
777AC_REQUIRE_AUX_FILE([compile])dnl
778AC_LANG_PUSH([C])dnl
779AC_CACHE_CHECK(
780  [whether $CC understands -c and -o together],
781  [am_cv_prog_cc_c_o],
782  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
783  # Make sure it works both with $CC and with simple cc.
784  # Following AC_PROG_CC_C_O, we do the test twice because some
785  # compilers refuse to overwrite an existing .o file with -o,
786  # though they will create one.
787  am_cv_prog_cc_c_o=yes
788  for am_i in 1 2; do
789    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
790         && test -f conftest2.$ac_objext; then
791      : OK
792    else
793      am_cv_prog_cc_c_o=no
794      break
795    fi
796  done
797  rm -f core conftest*
798  unset am_i])
799if test "$am_cv_prog_cc_c_o" != yes; then
800   # Losing compiler, so override with the script.
801   # FIXME: It is wrong to rewrite CC.
802   # But if we don't then we get into trouble of one sort or another.
803   # A longer-term fix would be to have automake use am__CC in this case,
804   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
805   CC="$am_aux_dir/compile $CC"
806fi
807AC_LANG_POP([C])])
808
809# For backward compatibility.
810AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
811
812# Copyright (C) 2001-2013 Free Software Foundation, Inc.
813#
814# This file is free software; the Free Software Foundation
815# gives unlimited permission to copy and/or distribute it,
816# with or without modifications, as long as this notice is preserved.
817
818# AM_RUN_LOG(COMMAND)
819# -------------------
820# Run COMMAND, save the exit status in ac_status, and log it.
821# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
822AC_DEFUN([AM_RUN_LOG],
823[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
824   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
825   ac_status=$?
826   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
827   (exit $ac_status); }])
828
829# Check to make sure that the build environment is sane.    -*- Autoconf -*-
830
831# Copyright (C) 1996-2013 Free Software Foundation, Inc.
832#
833# This file is free software; the Free Software Foundation
834# gives unlimited permission to copy and/or distribute it,
835# with or without modifications, as long as this notice is preserved.
836
837# AM_SANITY_CHECK
838# ---------------
839AC_DEFUN([AM_SANITY_CHECK],
840[AC_MSG_CHECKING([whether build environment is sane])
841# Reject unsafe characters in $srcdir or the absolute working directory
842# name.  Accept space and tab only in the latter.
843am_lf='
844'
845case `pwd` in
846  *[[\\\"\#\$\&\'\`$am_lf]]*)
847    AC_MSG_ERROR([unsafe absolute working directory name]);;
848esac
849case $srcdir in
850  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
851    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
852esac
853
854# Do 'set' in a subshell so we don't clobber the current shell's
855# arguments.  Must try -L first in case configure is actually a
856# symlink; some systems play weird games with the mod time of symlinks
857# (eg FreeBSD returns the mod time of the symlink's containing
858# directory).
859if (
860   am_has_slept=no
861   for am_try in 1 2; do
862     echo "timestamp, slept: $am_has_slept" > conftest.file
863     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
864     if test "$[*]" = "X"; then
865	# -L didn't work.
866	set X `ls -t "$srcdir/configure" conftest.file`
867     fi
868     if test "$[*]" != "X $srcdir/configure conftest.file" \
869	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
870
871	# If neither matched, then we have a broken ls.  This can happen
872	# if, for instance, CONFIG_SHELL is bash and it inherits a
873	# broken ls alias from the environment.  This has actually
874	# happened.  Such a system could not be considered "sane".
875	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
876  alias in your environment])
877     fi
878     if test "$[2]" = conftest.file || test $am_try -eq 2; then
879       break
880     fi
881     # Just in case.
882     sleep 1
883     am_has_slept=yes
884   done
885   test "$[2]" = conftest.file
886   )
887then
888   # Ok.
889   :
890else
891   AC_MSG_ERROR([newly created file is older than distributed files!
892Check your system clock])
893fi
894AC_MSG_RESULT([yes])
895# If we didn't sleep, we still need to ensure time stamps of config.status and
896# generated files are strictly newer.
897am_sleep_pid=
898if grep 'slept: no' conftest.file >/dev/null 2>&1; then
899  ( sleep 1 ) &
900  am_sleep_pid=$!
901fi
902AC_CONFIG_COMMANDS_PRE(
903  [AC_MSG_CHECKING([that generated files are newer than configure])
904   if test -n "$am_sleep_pid"; then
905     # Hide warnings about reused PIDs.
906     wait $am_sleep_pid 2>/dev/null
907   fi
908   AC_MSG_RESULT([done])])
909rm -f conftest.file
910])
911
912# Copyright (C) 2009-2013 Free Software Foundation, Inc.
913#
914# This file is free software; the Free Software Foundation
915# gives unlimited permission to copy and/or distribute it,
916# with or without modifications, as long as this notice is preserved.
917
918# AM_SILENT_RULES([DEFAULT])
919# --------------------------
920# Enable less verbose build rules; with the default set to DEFAULT
921# ("yes" being less verbose, "no" or empty being verbose).
922AC_DEFUN([AM_SILENT_RULES],
923[AC_ARG_ENABLE([silent-rules], [dnl
924AS_HELP_STRING(
925  [--enable-silent-rules],
926  [less verbose build output (undo: "make V=1")])
927AS_HELP_STRING(
928  [--disable-silent-rules],
929  [verbose build output (undo: "make V=0")])dnl
930])
931case $enable_silent_rules in @%:@ (((
932  yes) AM_DEFAULT_VERBOSITY=0;;
933   no) AM_DEFAULT_VERBOSITY=1;;
934    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
935esac
936dnl
937dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
938dnl do not support nested variable expansions.
939dnl See automake bug#9928 and bug#10237.
940am_make=${MAKE-make}
941AC_CACHE_CHECK([whether $am_make supports nested variables],
942   [am_cv_make_support_nested_variables],
943   [if AS_ECHO([['TRUE=$(BAR$(V))
944BAR0=false
945BAR1=true
946V=1
947am__doit:
948	@$(TRUE)
949.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
950  am_cv_make_support_nested_variables=yes
951else
952  am_cv_make_support_nested_variables=no
953fi])
954if test $am_cv_make_support_nested_variables = yes; then
955  dnl Using '$V' instead of '$(V)' breaks IRIX make.
956  AM_V='$(V)'
957  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
958else
959  AM_V=$AM_DEFAULT_VERBOSITY
960  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
961fi
962AC_SUBST([AM_V])dnl
963AM_SUBST_NOTMAKE([AM_V])dnl
964AC_SUBST([AM_DEFAULT_V])dnl
965AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
966AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
967AM_BACKSLASH='\'
968AC_SUBST([AM_BACKSLASH])dnl
969_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
970])
971
972# Copyright (C) 2001-2013 Free Software Foundation, Inc.
973#
974# This file is free software; the Free Software Foundation
975# gives unlimited permission to copy and/or distribute it,
976# with or without modifications, as long as this notice is preserved.
977
978# AM_PROG_INSTALL_STRIP
979# ---------------------
980# One issue with vendor 'install' (even GNU) is that you can't
981# specify the program used to strip binaries.  This is especially
982# annoying in cross-compiling environments, where the build's strip
983# is unlikely to handle the host's binaries.
984# Fortunately install-sh will honor a STRIPPROG variable, so we
985# always use install-sh in "make install-strip", and initialize
986# STRIPPROG with the value of the STRIP variable (set by the user).
987AC_DEFUN([AM_PROG_INSTALL_STRIP],
988[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
989# Installed binaries are usually stripped using 'strip' when the user
990# run "make install-strip".  However 'strip' might not be the right
991# tool to use in cross-compilation environments, therefore Automake
992# will honor the 'STRIP' environment variable to overrule this program.
993dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
994if test "$cross_compiling" != no; then
995  AC_CHECK_TOOL([STRIP], [strip], :)
996fi
997INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
998AC_SUBST([INSTALL_STRIP_PROGRAM])])
999
1000# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1001#
1002# This file is free software; the Free Software Foundation
1003# gives unlimited permission to copy and/or distribute it,
1004# with or without modifications, as long as this notice is preserved.
1005
1006# _AM_SUBST_NOTMAKE(VARIABLE)
1007# ---------------------------
1008# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1009# This macro is traced by Automake.
1010AC_DEFUN([_AM_SUBST_NOTMAKE])
1011
1012# AM_SUBST_NOTMAKE(VARIABLE)
1013# --------------------------
1014# Public sister of _AM_SUBST_NOTMAKE.
1015AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1016
1017# Check how to create a tarball.                            -*- Autoconf -*-
1018
1019# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1020#
1021# This file is free software; the Free Software Foundation
1022# gives unlimited permission to copy and/or distribute it,
1023# with or without modifications, as long as this notice is preserved.
1024
1025# _AM_PROG_TAR(FORMAT)
1026# --------------------
1027# Check how to create a tarball in format FORMAT.
1028# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1029#
1030# Substitute a variable $(am__tar) that is a command
1031# writing to stdout a FORMAT-tarball containing the directory
1032# $tardir.
1033#     tardir=directory && $(am__tar) > result.tar
1034#
1035# Substitute a variable $(am__untar) that extract such
1036# a tarball read from stdin.
1037#     $(am__untar) < result.tar
1038#
1039AC_DEFUN([_AM_PROG_TAR],
1040[# Always define AMTAR for backward compatibility.  Yes, it's still used
1041# in the wild :-(  We should find a proper way to deprecate it ...
1042AC_SUBST([AMTAR], ['$${TAR-tar}'])
1043
1044# We'll loop over all known methods to create a tar archive until one works.
1045_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1046
1047m4_if([$1], [v7],
1048  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1049
1050  [m4_case([$1],
1051    [ustar],
1052     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1053      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1054      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1055      # and bug#13588).
1056      am_max_uid=2097151 # 2^21 - 1
1057      am_max_gid=$am_max_uid
1058      # The $UID and $GID variables are not portable, so we need to resort
1059      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1060      # below are definitely unexpected, so allow the users to see them
1061      # (that is, avoid stderr redirection).
1062      am_uid=`id -u || echo unknown`
1063      am_gid=`id -g || echo unknown`
1064      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1065      if test $am_uid -le $am_max_uid; then
1066         AC_MSG_RESULT([yes])
1067      else
1068         AC_MSG_RESULT([no])
1069         _am_tools=none
1070      fi
1071      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1072      if test $am_gid -le $am_max_gid; then
1073         AC_MSG_RESULT([yes])
1074      else
1075        AC_MSG_RESULT([no])
1076        _am_tools=none
1077      fi],
1078
1079  [pax],
1080    [],
1081
1082  [m4_fatal([Unknown tar format])])
1083
1084  AC_MSG_CHECKING([how to create a $1 tar archive])
1085
1086  # Go ahead even if we have the value already cached.  We do so because we
1087  # need to set the values for the 'am__tar' and 'am__untar' variables.
1088  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1089
1090  for _am_tool in $_am_tools; do
1091    case $_am_tool in
1092    gnutar)
1093      for _am_tar in tar gnutar gtar; do
1094        AM_RUN_LOG([$_am_tar --version]) && break
1095      done
1096      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1097      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1098      am__untar="$_am_tar -xf -"
1099      ;;
1100    plaintar)
1101      # Must skip GNU tar: if it does not support --format= it doesn't create
1102      # ustar tarball either.
1103      (tar --version) >/dev/null 2>&1 && continue
1104      am__tar='tar chf - "$$tardir"'
1105      am__tar_='tar chf - "$tardir"'
1106      am__untar='tar xf -'
1107      ;;
1108    pax)
1109      am__tar='pax -L -x $1 -w "$$tardir"'
1110      am__tar_='pax -L -x $1 -w "$tardir"'
1111      am__untar='pax -r'
1112      ;;
1113    cpio)
1114      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1115      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1116      am__untar='cpio -i -H $1 -d'
1117      ;;
1118    none)
1119      am__tar=false
1120      am__tar_=false
1121      am__untar=false
1122      ;;
1123    esac
1124
1125    # If the value was cached, stop now.  We just wanted to have am__tar
1126    # and am__untar set.
1127    test -n "${am_cv_prog_tar_$1}" && break
1128
1129    # tar/untar a dummy directory, and stop if the command works.
1130    rm -rf conftest.dir
1131    mkdir conftest.dir
1132    echo GrepMe > conftest.dir/file
1133    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1134    rm -rf conftest.dir
1135    if test -s conftest.tar; then
1136      AM_RUN_LOG([$am__untar <conftest.tar])
1137      AM_RUN_LOG([cat conftest.dir/file])
1138      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1139    fi
1140  done
1141  rm -rf conftest.dir
1142
1143  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1144  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1145
1146AC_SUBST([am__tar])
1147AC_SUBST([am__untar])
1148]) # _AM_PROG_TAR
1149
1150m4_include([m4/ax_define_dir.m4])
1151# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1152#
1153#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1154#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1155#                 Foundation, Inc.
1156#   Written by Gordon Matzigkeit, 1996
1157#
1158# This file is free software; the Free Software Foundation gives
1159# unlimited permission to copy and/or distribute it, with or without
1160# modifications, as long as this notice is preserved.
1161
1162m4_define([_LT_COPYING], [dnl
1163#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1164#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1165#                 Foundation, Inc.
1166#   Written by Gordon Matzigkeit, 1996
1167#
1168#   This file is part of GNU Libtool.
1169#
1170# GNU Libtool is free software; you can redistribute it and/or
1171# modify it under the terms of the GNU General Public License as
1172# published by the Free Software Foundation; either version 2 of
1173# the License, or (at your option) any later version.
1174#
1175# As a special exception to the GNU General Public License,
1176# if you distribute this file as part of a program or library that
1177# is built using GNU Libtool, you may include this file under the
1178# same distribution terms that you use for the rest of that program.
1179#
1180# GNU Libtool is distributed in the hope that it will be useful,
1181# but WITHOUT ANY WARRANTY; without even the implied warranty of
1182# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1183# GNU General Public License for more details.
1184#
1185# You should have received a copy of the GNU General Public License
1186# along with GNU Libtool; see the file COPYING.  If not, a copy
1187# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1188# obtained by writing to the Free Software Foundation, Inc.,
1189# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1190])
1191
1192# serial 57 LT_INIT
1193
1194
1195# LT_PREREQ(VERSION)
1196# ------------------
1197# Complain and exit if this libtool version is less that VERSION.
1198m4_defun([LT_PREREQ],
1199[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1200       [m4_default([$3],
1201		   [m4_fatal([Libtool version $1 or higher is required],
1202		             63)])],
1203       [$2])])
1204
1205
1206# _LT_CHECK_BUILDDIR
1207# ------------------
1208# Complain if the absolute build directory name contains unusual characters
1209m4_defun([_LT_CHECK_BUILDDIR],
1210[case `pwd` in
1211  *\ * | *\	*)
1212    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1213esac
1214])
1215
1216
1217# LT_INIT([OPTIONS])
1218# ------------------
1219AC_DEFUN([LT_INIT],
1220[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1221AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1222AC_BEFORE([$0], [LT_LANG])dnl
1223AC_BEFORE([$0], [LT_OUTPUT])dnl
1224AC_BEFORE([$0], [LTDL_INIT])dnl
1225m4_require([_LT_CHECK_BUILDDIR])dnl
1226
1227dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1228m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1229m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1230dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1231dnl unless we require an AC_DEFUNed macro:
1232AC_REQUIRE([LTOPTIONS_VERSION])dnl
1233AC_REQUIRE([LTSUGAR_VERSION])dnl
1234AC_REQUIRE([LTVERSION_VERSION])dnl
1235AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1236m4_require([_LT_PROG_LTMAIN])dnl
1237
1238_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1239
1240dnl Parse OPTIONS
1241_LT_SET_OPTIONS([$0], [$1])
1242
1243# This can be used to rebuild libtool when needed
1244LIBTOOL_DEPS="$ltmain"
1245
1246# Always use our own libtool.
1247LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1248AC_SUBST(LIBTOOL)dnl
1249
1250_LT_SETUP
1251
1252# Only expand once:
1253m4_define([LT_INIT])
1254])# LT_INIT
1255
1256# Old names:
1257AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1258AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1259dnl aclocal-1.4 backwards compatibility:
1260dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1261dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1262
1263
1264# _LT_CC_BASENAME(CC)
1265# -------------------
1266# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1267m4_defun([_LT_CC_BASENAME],
1268[for cc_temp in $1""; do
1269  case $cc_temp in
1270    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1271    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1272    \-*) ;;
1273    *) break;;
1274  esac
1275done
1276cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1277])
1278
1279
1280# _LT_FILEUTILS_DEFAULTS
1281# ----------------------
1282# It is okay to use these file commands and assume they have been set
1283# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1284m4_defun([_LT_FILEUTILS_DEFAULTS],
1285[: ${CP="cp -f"}
1286: ${MV="mv -f"}
1287: ${RM="rm -f"}
1288])# _LT_FILEUTILS_DEFAULTS
1289
1290
1291# _LT_SETUP
1292# ---------
1293m4_defun([_LT_SETUP],
1294[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1295AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1296AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1297AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1298
1299_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1300dnl
1301_LT_DECL([], [host_alias], [0], [The host system])dnl
1302_LT_DECL([], [host], [0])dnl
1303_LT_DECL([], [host_os], [0])dnl
1304dnl
1305_LT_DECL([], [build_alias], [0], [The build system])dnl
1306_LT_DECL([], [build], [0])dnl
1307_LT_DECL([], [build_os], [0])dnl
1308dnl
1309AC_REQUIRE([AC_PROG_CC])dnl
1310AC_REQUIRE([LT_PATH_LD])dnl
1311AC_REQUIRE([LT_PATH_NM])dnl
1312dnl
1313AC_REQUIRE([AC_PROG_LN_S])dnl
1314test -z "$LN_S" && LN_S="ln -s"
1315_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1316dnl
1317AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1318_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1319_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1320dnl
1321m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1322m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1323m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1324m4_require([_LT_CMD_RELOAD])dnl
1325m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1326m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1327m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1328m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1329m4_require([_LT_WITH_SYSROOT])dnl
1330
1331_LT_CONFIG_LIBTOOL_INIT([
1332# See if we are running on zsh, and set the options which allow our
1333# commands through without removal of \ escapes INIT.
1334if test -n "\${ZSH_VERSION+set}" ; then
1335   setopt NO_GLOB_SUBST
1336fi
1337])
1338if test -n "${ZSH_VERSION+set}" ; then
1339   setopt NO_GLOB_SUBST
1340fi
1341
1342_LT_CHECK_OBJDIR
1343
1344m4_require([_LT_TAG_COMPILER])dnl
1345
1346case $host_os in
1347aix3*)
1348  # AIX sometimes has problems with the GCC collect2 program.  For some
1349  # reason, if we set the COLLECT_NAMES environment variable, the problems
1350  # vanish in a puff of smoke.
1351  if test "X${COLLECT_NAMES+set}" != Xset; then
1352    COLLECT_NAMES=
1353    export COLLECT_NAMES
1354  fi
1355  ;;
1356esac
1357
1358# Global variables:
1359ofile=libtool
1360can_build_shared=yes
1361
1362# All known linkers require a `.a' archive for static linking (except MSVC,
1363# which needs '.lib').
1364libext=a
1365
1366with_gnu_ld="$lt_cv_prog_gnu_ld"
1367
1368old_CC="$CC"
1369old_CFLAGS="$CFLAGS"
1370
1371# Set sane defaults for various variables
1372test -z "$CC" && CC=cc
1373test -z "$LTCC" && LTCC=$CC
1374test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1375test -z "$LD" && LD=ld
1376test -z "$ac_objext" && ac_objext=o
1377
1378_LT_CC_BASENAME([$compiler])
1379
1380# Only perform the check for file, if the check method requires it
1381test -z "$MAGIC_CMD" && MAGIC_CMD=file
1382case $deplibs_check_method in
1383file_magic*)
1384  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1385    _LT_PATH_MAGIC
1386  fi
1387  ;;
1388esac
1389
1390# Use C for the default configuration in the libtool script
1391LT_SUPPORTED_TAG([CC])
1392_LT_LANG_C_CONFIG
1393_LT_LANG_DEFAULT_CONFIG
1394_LT_CONFIG_COMMANDS
1395])# _LT_SETUP
1396
1397
1398# _LT_PREPARE_SED_QUOTE_VARS
1399# --------------------------
1400# Define a few sed substitution that help us do robust quoting.
1401m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1402[# Backslashify metacharacters that are still active within
1403# double-quoted strings.
1404sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1405
1406# Same as above, but do not quote variable references.
1407double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1408
1409# Sed substitution to delay expansion of an escaped shell variable in a
1410# double_quote_subst'ed string.
1411delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1412
1413# Sed substitution to delay expansion of an escaped single quote.
1414delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1415
1416# Sed substitution to avoid accidental globbing in evaled expressions
1417no_glob_subst='s/\*/\\\*/g'
1418])
1419
1420# _LT_PROG_LTMAIN
1421# ---------------
1422# Note that this code is called both from `configure', and `config.status'
1423# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1424# `config.status' has no value for ac_aux_dir unless we are using Automake,
1425# so we pass a copy along to make sure it has a sensible value anyway.
1426m4_defun([_LT_PROG_LTMAIN],
1427[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1428_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1429ltmain="$ac_aux_dir/ltmain.sh"
1430])# _LT_PROG_LTMAIN
1431
1432
1433
1434# So that we can recreate a full libtool script including additional
1435# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1436# in macros and then make a single call at the end using the `libtool'
1437# label.
1438
1439
1440# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1441# ----------------------------------------
1442# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1443m4_define([_LT_CONFIG_LIBTOOL_INIT],
1444[m4_ifval([$1],
1445          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1446                     [$1
1447])])])
1448
1449# Initialize.
1450m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1451
1452
1453# _LT_CONFIG_LIBTOOL([COMMANDS])
1454# ------------------------------
1455# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1456m4_define([_LT_CONFIG_LIBTOOL],
1457[m4_ifval([$1],
1458          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1459                     [$1
1460])])])
1461
1462# Initialize.
1463m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1464
1465
1466# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1467# -----------------------------------------------------
1468m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1469[_LT_CONFIG_LIBTOOL([$1])
1470_LT_CONFIG_LIBTOOL_INIT([$2])
1471])
1472
1473
1474# _LT_FORMAT_COMMENT([COMMENT])
1475# -----------------------------
1476# Add leading comment marks to the start of each line, and a trailing
1477# full-stop to the whole comment if one is not present already.
1478m4_define([_LT_FORMAT_COMMENT],
1479[m4_ifval([$1], [
1480m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1481              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1482)])
1483
1484
1485
1486
1487
1488# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1489# -------------------------------------------------------------------
1490# CONFIGNAME is the name given to the value in the libtool script.
1491# VARNAME is the (base) name used in the configure script.
1492# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1493# VARNAME.  Any other value will be used directly.
1494m4_define([_LT_DECL],
1495[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1496    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1497	[m4_ifval([$1], [$1], [$2])])
1498    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1499    m4_ifval([$4],
1500	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1501    lt_dict_add_subkey([lt_decl_dict], [$2],
1502	[tagged?], [m4_ifval([$5], [yes], [no])])])
1503])
1504
1505
1506# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1507# --------------------------------------------------------
1508m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1509
1510
1511# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1512# ------------------------------------------------
1513m4_define([lt_decl_tag_varnames],
1514[_lt_decl_filter([tagged?], [yes], $@)])
1515
1516
1517# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1518# ---------------------------------------------------------
1519m4_define([_lt_decl_filter],
1520[m4_case([$#],
1521  [0], [m4_fatal([$0: too few arguments: $#])],
1522  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1523  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1524  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1525  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1526])
1527
1528
1529# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1530# --------------------------------------------------
1531m4_define([lt_decl_quote_varnames],
1532[_lt_decl_filter([value], [1], $@)])
1533
1534
1535# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1536# ---------------------------------------------------
1537m4_define([lt_decl_dquote_varnames],
1538[_lt_decl_filter([value], [2], $@)])
1539
1540
1541# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1542# ---------------------------------------------------
1543m4_define([lt_decl_varnames_tagged],
1544[m4_assert([$# <= 2])dnl
1545_$0(m4_quote(m4_default([$1], [[, ]])),
1546    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1547    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1548m4_define([_lt_decl_varnames_tagged],
1549[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1550
1551
1552# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1553# ------------------------------------------------
1554m4_define([lt_decl_all_varnames],
1555[_$0(m4_quote(m4_default([$1], [[, ]])),
1556     m4_if([$2], [],
1557	   m4_quote(lt_decl_varnames),
1558	m4_quote(m4_shift($@))))[]dnl
1559])
1560m4_define([_lt_decl_all_varnames],
1561[lt_join($@, lt_decl_varnames_tagged([$1],
1562			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1563])
1564
1565
1566# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1567# ------------------------------------
1568# Quote a variable value, and forward it to `config.status' so that its
1569# declaration there will have the same value as in `configure'.  VARNAME
1570# must have a single quote delimited value for this to work.
1571m4_define([_LT_CONFIG_STATUS_DECLARE],
1572[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1573
1574
1575# _LT_CONFIG_STATUS_DECLARATIONS
1576# ------------------------------
1577# We delimit libtool config variables with single quotes, so when
1578# we write them to config.status, we have to be sure to quote all
1579# embedded single quotes properly.  In configure, this macro expands
1580# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1581#
1582#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1583m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1584[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1585    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1586
1587
1588# _LT_LIBTOOL_TAGS
1589# ----------------
1590# Output comment and list of tags supported by the script
1591m4_defun([_LT_LIBTOOL_TAGS],
1592[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1593available_tags="_LT_TAGS"dnl
1594])
1595
1596
1597# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1598# -----------------------------------
1599# Extract the dictionary values for VARNAME (optionally with TAG) and
1600# expand to a commented shell variable setting:
1601#
1602#    # Some comment about what VAR is for.
1603#    visible_name=$lt_internal_name
1604m4_define([_LT_LIBTOOL_DECLARE],
1605[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1606					   [description])))[]dnl
1607m4_pushdef([_libtool_name],
1608    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1609m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1610    [0], [_libtool_name=[$]$1],
1611    [1], [_libtool_name=$lt_[]$1],
1612    [2], [_libtool_name=$lt_[]$1],
1613    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1614m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1615])
1616
1617
1618# _LT_LIBTOOL_CONFIG_VARS
1619# -----------------------
1620# Produce commented declarations of non-tagged libtool config variables
1621# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1622# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1623# section) are produced by _LT_LIBTOOL_TAG_VARS.
1624m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1625[m4_foreach([_lt_var],
1626    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1627    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1628
1629
1630# _LT_LIBTOOL_TAG_VARS(TAG)
1631# -------------------------
1632m4_define([_LT_LIBTOOL_TAG_VARS],
1633[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1634    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1635
1636
1637# _LT_TAGVAR(VARNAME, [TAGNAME])
1638# ------------------------------
1639m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1640
1641
1642# _LT_CONFIG_COMMANDS
1643# -------------------
1644# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1645# variables for single and double quote escaping we saved from calls
1646# to _LT_DECL, we can put quote escaped variables declarations
1647# into `config.status', and then the shell code to quote escape them in
1648# for loops in `config.status'.  Finally, any additional code accumulated
1649# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1650m4_defun([_LT_CONFIG_COMMANDS],
1651[AC_PROVIDE_IFELSE([LT_OUTPUT],
1652	dnl If the libtool generation code has been placed in $CONFIG_LT,
1653	dnl instead of duplicating it all over again into config.status,
1654	dnl then we will have config.status run $CONFIG_LT later, so it
1655	dnl needs to know what name is stored there:
1656        [AC_CONFIG_COMMANDS([libtool],
1657            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1658    dnl If the libtool generation code is destined for config.status,
1659    dnl expand the accumulated commands and init code now:
1660    [AC_CONFIG_COMMANDS([libtool],
1661        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1662])#_LT_CONFIG_COMMANDS
1663
1664
1665# Initialize.
1666m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1667[
1668
1669# The HP-UX ksh and POSIX shell print the target directory to stdout
1670# if CDPATH is set.
1671(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1672
1673sed_quote_subst='$sed_quote_subst'
1674double_quote_subst='$double_quote_subst'
1675delay_variable_subst='$delay_variable_subst'
1676_LT_CONFIG_STATUS_DECLARATIONS
1677LTCC='$LTCC'
1678LTCFLAGS='$LTCFLAGS'
1679compiler='$compiler_DEFAULT'
1680
1681# A function that is used when there is no print builtin or printf.
1682func_fallback_echo ()
1683{
1684  eval 'cat <<_LTECHO_EOF
1685\$[]1
1686_LTECHO_EOF'
1687}
1688
1689# Quote evaled strings.
1690for var in lt_decl_all_varnames([[ \
1691]], lt_decl_quote_varnames); do
1692    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1693    *[[\\\\\\\`\\"\\\$]]*)
1694      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1695      ;;
1696    *)
1697      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1698      ;;
1699    esac
1700done
1701
1702# Double-quote double-evaled strings.
1703for var in lt_decl_all_varnames([[ \
1704]], lt_decl_dquote_varnames); do
1705    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1706    *[[\\\\\\\`\\"\\\$]]*)
1707      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1708      ;;
1709    *)
1710      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1711      ;;
1712    esac
1713done
1714
1715_LT_OUTPUT_LIBTOOL_INIT
1716])
1717
1718# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1719# ------------------------------------
1720# Generate a child script FILE with all initialization necessary to
1721# reuse the environment learned by the parent script, and make the
1722# file executable.  If COMMENT is supplied, it is inserted after the
1723# `#!' sequence but before initialization text begins.  After this
1724# macro, additional text can be appended to FILE to form the body of
1725# the child script.  The macro ends with non-zero status if the
1726# file could not be fully written (such as if the disk is full).
1727m4_ifdef([AS_INIT_GENERATED],
1728[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1729[m4_defun([_LT_GENERATED_FILE_INIT],
1730[m4_require([AS_PREPARE])]dnl
1731[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1732[lt_write_fail=0
1733cat >$1 <<_ASEOF || lt_write_fail=1
1734#! $SHELL
1735# Generated by $as_me.
1736$2
1737SHELL=\${CONFIG_SHELL-$SHELL}
1738export SHELL
1739_ASEOF
1740cat >>$1 <<\_ASEOF || lt_write_fail=1
1741AS_SHELL_SANITIZE
1742_AS_PREPARE
1743exec AS_MESSAGE_FD>&1
1744_ASEOF
1745test $lt_write_fail = 0 && chmod +x $1[]dnl
1746m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1747
1748# LT_OUTPUT
1749# ---------
1750# This macro allows early generation of the libtool script (before
1751# AC_OUTPUT is called), incase it is used in configure for compilation
1752# tests.
1753AC_DEFUN([LT_OUTPUT],
1754[: ${CONFIG_LT=./config.lt}
1755AC_MSG_NOTICE([creating $CONFIG_LT])
1756_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1757[# Run this file to recreate a libtool stub with the current configuration.])
1758
1759cat >>"$CONFIG_LT" <<\_LTEOF
1760lt_cl_silent=false
1761exec AS_MESSAGE_LOG_FD>>config.log
1762{
1763  echo
1764  AS_BOX([Running $as_me.])
1765} >&AS_MESSAGE_LOG_FD
1766
1767lt_cl_help="\
1768\`$as_me' creates a local libtool stub from the current configuration,
1769for use in further configure time tests before the real libtool is
1770generated.
1771
1772Usage: $[0] [[OPTIONS]]
1773
1774  -h, --help      print this help, then exit
1775  -V, --version   print version number, then exit
1776  -q, --quiet     do not print progress messages
1777  -d, --debug     don't remove temporary files
1778
1779Report bugs to <bug-libtool@gnu.org>."
1780
1781lt_cl_version="\
1782m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1783m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1784configured by $[0], generated by m4_PACKAGE_STRING.
1785
1786Copyright (C) 2011 Free Software Foundation, Inc.
1787This config.lt script is free software; the Free Software Foundation
1788gives unlimited permision to copy, distribute and modify it."
1789
1790while test $[#] != 0
1791do
1792  case $[1] in
1793    --version | --v* | -V )
1794      echo "$lt_cl_version"; exit 0 ;;
1795    --help | --h* | -h )
1796      echo "$lt_cl_help"; exit 0 ;;
1797    --debug | --d* | -d )
1798      debug=: ;;
1799    --quiet | --q* | --silent | --s* | -q )
1800      lt_cl_silent=: ;;
1801
1802    -*) AC_MSG_ERROR([unrecognized option: $[1]
1803Try \`$[0] --help' for more information.]) ;;
1804
1805    *) AC_MSG_ERROR([unrecognized argument: $[1]
1806Try \`$[0] --help' for more information.]) ;;
1807  esac
1808  shift
1809done
1810
1811if $lt_cl_silent; then
1812  exec AS_MESSAGE_FD>/dev/null
1813fi
1814_LTEOF
1815
1816cat >>"$CONFIG_LT" <<_LTEOF
1817_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1818_LTEOF
1819
1820cat >>"$CONFIG_LT" <<\_LTEOF
1821AC_MSG_NOTICE([creating $ofile])
1822_LT_OUTPUT_LIBTOOL_COMMANDS
1823AS_EXIT(0)
1824_LTEOF
1825chmod +x "$CONFIG_LT"
1826
1827# configure is writing to config.log, but config.lt does its own redirection,
1828# appending to config.log, which fails on DOS, as config.log is still kept
1829# open by configure.  Here we exec the FD to /dev/null, effectively closing
1830# config.log, so it can be properly (re)opened and appended to by config.lt.
1831lt_cl_success=:
1832test "$silent" = yes &&
1833  lt_config_lt_args="$lt_config_lt_args --quiet"
1834exec AS_MESSAGE_LOG_FD>/dev/null
1835$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1836exec AS_MESSAGE_LOG_FD>>config.log
1837$lt_cl_success || AS_EXIT(1)
1838])# LT_OUTPUT
1839
1840
1841# _LT_CONFIG(TAG)
1842# ---------------
1843# If TAG is the built-in tag, create an initial libtool script with a
1844# default configuration from the untagged config vars.  Otherwise add code
1845# to config.status for appending the configuration named by TAG from the
1846# matching tagged config vars.
1847m4_defun([_LT_CONFIG],
1848[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1849_LT_CONFIG_SAVE_COMMANDS([
1850  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1851  m4_if(_LT_TAG, [C], [
1852    # See if we are running on zsh, and set the options which allow our
1853    # commands through without removal of \ escapes.
1854    if test -n "${ZSH_VERSION+set}" ; then
1855      setopt NO_GLOB_SUBST
1856    fi
1857
1858    cfgfile="${ofile}T"
1859    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1860    $RM "$cfgfile"
1861
1862    cat <<_LT_EOF >> "$cfgfile"
1863#! $SHELL
1864
1865# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1866# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1867# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1868# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1869#
1870_LT_COPYING
1871_LT_LIBTOOL_TAGS
1872
1873# ### BEGIN LIBTOOL CONFIG
1874_LT_LIBTOOL_CONFIG_VARS
1875_LT_LIBTOOL_TAG_VARS
1876# ### END LIBTOOL CONFIG
1877
1878_LT_EOF
1879
1880  case $host_os in
1881  aix3*)
1882    cat <<\_LT_EOF >> "$cfgfile"
1883# AIX sometimes has problems with the GCC collect2 program.  For some
1884# reason, if we set the COLLECT_NAMES environment variable, the problems
1885# vanish in a puff of smoke.
1886if test "X${COLLECT_NAMES+set}" != Xset; then
1887  COLLECT_NAMES=
1888  export COLLECT_NAMES
1889fi
1890_LT_EOF
1891    ;;
1892  esac
1893
1894  _LT_PROG_LTMAIN
1895
1896  # We use sed instead of cat because bash on DJGPP gets confused if
1897  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1898  # text mode, it properly converts lines to CR/LF.  This bash problem
1899  # is reportedly fixed, but why not run on old versions too?
1900  sed '$q' "$ltmain" >> "$cfgfile" \
1901     || (rm -f "$cfgfile"; exit 1)
1902
1903  _LT_PROG_REPLACE_SHELLFNS
1904
1905   mv -f "$cfgfile" "$ofile" ||
1906    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1907  chmod +x "$ofile"
1908],
1909[cat <<_LT_EOF >> "$ofile"
1910
1911dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1912dnl in a comment (ie after a #).
1913# ### BEGIN LIBTOOL TAG CONFIG: $1
1914_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1915# ### END LIBTOOL TAG CONFIG: $1
1916_LT_EOF
1917])dnl /m4_if
1918],
1919[m4_if([$1], [], [
1920    PACKAGE='$PACKAGE'
1921    VERSION='$VERSION'
1922    TIMESTAMP='$TIMESTAMP'
1923    RM='$RM'
1924    ofile='$ofile'], [])
1925])dnl /_LT_CONFIG_SAVE_COMMANDS
1926])# _LT_CONFIG
1927
1928
1929# LT_SUPPORTED_TAG(TAG)
1930# ---------------------
1931# Trace this macro to discover what tags are supported by the libtool
1932# --tag option, using:
1933#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1934AC_DEFUN([LT_SUPPORTED_TAG], [])
1935
1936
1937# C support is built-in for now
1938m4_define([_LT_LANG_C_enabled], [])
1939m4_define([_LT_TAGS], [])
1940
1941
1942# LT_LANG(LANG)
1943# -------------
1944# Enable libtool support for the given language if not already enabled.
1945AC_DEFUN([LT_LANG],
1946[AC_BEFORE([$0], [LT_OUTPUT])dnl
1947m4_case([$1],
1948  [C],			[_LT_LANG(C)],
1949  [C++],		[_LT_LANG(CXX)],
1950  [Go],			[_LT_LANG(GO)],
1951  [Java],		[_LT_LANG(GCJ)],
1952  [Fortran 77],		[_LT_LANG(F77)],
1953  [Fortran],		[_LT_LANG(FC)],
1954  [Windows Resource],	[_LT_LANG(RC)],
1955  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1956    [_LT_LANG($1)],
1957    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1958])# LT_LANG
1959
1960
1961# _LT_LANG(LANGNAME)
1962# ------------------
1963m4_defun([_LT_LANG],
1964[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1965  [LT_SUPPORTED_TAG([$1])dnl
1966  m4_append([_LT_TAGS], [$1 ])dnl
1967  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1968  _LT_LANG_$1_CONFIG($1)])dnl
1969])# _LT_LANG
1970
1971
1972m4_ifndef([AC_PROG_GO], [
1973# NOTE: This macro has been submitted for inclusion into   #
1974#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1975#  a released version of Autoconf we should remove this    #
1976#  macro and use it instead.                               #
1977m4_defun([AC_PROG_GO],
1978[AC_LANG_PUSH(Go)dnl
1979AC_ARG_VAR([GOC],     [Go compiler command])dnl
1980AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1981_AC_ARG_VAR_LDFLAGS()dnl
1982AC_CHECK_TOOL(GOC, gccgo)
1983if test -z "$GOC"; then
1984  if test -n "$ac_tool_prefix"; then
1985    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1986  fi
1987fi
1988if test -z "$GOC"; then
1989  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1990fi
1991])#m4_defun
1992])#m4_ifndef
1993
1994
1995# _LT_LANG_DEFAULT_CONFIG
1996# -----------------------
1997m4_defun([_LT_LANG_DEFAULT_CONFIG],
1998[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1999  [LT_LANG(CXX)],
2000  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
2001
2002AC_PROVIDE_IFELSE([AC_PROG_F77],
2003  [LT_LANG(F77)],
2004  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
2005
2006AC_PROVIDE_IFELSE([AC_PROG_FC],
2007  [LT_LANG(FC)],
2008  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
2009
2010dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
2011dnl pulling things in needlessly.
2012AC_PROVIDE_IFELSE([AC_PROG_GCJ],
2013  [LT_LANG(GCJ)],
2014  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
2015    [LT_LANG(GCJ)],
2016    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
2017      [LT_LANG(GCJ)],
2018      [m4_ifdef([AC_PROG_GCJ],
2019	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
2020       m4_ifdef([A][M_PROG_GCJ],
2021	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
2022       m4_ifdef([LT_PROG_GCJ],
2023	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
2024
2025AC_PROVIDE_IFELSE([AC_PROG_GO],
2026  [LT_LANG(GO)],
2027  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
2028
2029AC_PROVIDE_IFELSE([LT_PROG_RC],
2030  [LT_LANG(RC)],
2031  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
2032])# _LT_LANG_DEFAULT_CONFIG
2033
2034# Obsolete macros:
2035AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
2036AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
2037AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
2038AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
2039AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
2040dnl aclocal-1.4 backwards compatibility:
2041dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
2042dnl AC_DEFUN([AC_LIBTOOL_F77], [])
2043dnl AC_DEFUN([AC_LIBTOOL_FC], [])
2044dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
2045dnl AC_DEFUN([AC_LIBTOOL_RC], [])
2046
2047
2048# _LT_TAG_COMPILER
2049# ----------------
2050m4_defun([_LT_TAG_COMPILER],
2051[AC_REQUIRE([AC_PROG_CC])dnl
2052
2053_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
2054_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
2055_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
2056_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
2057
2058# If no C compiler was specified, use CC.
2059LTCC=${LTCC-"$CC"}
2060
2061# If no C compiler flags were specified, use CFLAGS.
2062LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2063
2064# Allow CC to be a program name with arguments.
2065compiler=$CC
2066])# _LT_TAG_COMPILER
2067
2068
2069# _LT_COMPILER_BOILERPLATE
2070# ------------------------
2071# Check for compiler boilerplate output or warnings with
2072# the simple compiler test code.
2073m4_defun([_LT_COMPILER_BOILERPLATE],
2074[m4_require([_LT_DECL_SED])dnl
2075ac_outfile=conftest.$ac_objext
2076echo "$lt_simple_compile_test_code" >conftest.$ac_ext
2077eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2078_lt_compiler_boilerplate=`cat conftest.err`
2079$RM conftest*
2080])# _LT_COMPILER_BOILERPLATE
2081
2082
2083# _LT_LINKER_BOILERPLATE
2084# ----------------------
2085# Check for linker boilerplate output or warnings with
2086# the simple link test code.
2087m4_defun([_LT_LINKER_BOILERPLATE],
2088[m4_require([_LT_DECL_SED])dnl
2089ac_outfile=conftest.$ac_objext
2090echo "$lt_simple_link_test_code" >conftest.$ac_ext
2091eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2092_lt_linker_boilerplate=`cat conftest.err`
2093$RM -r conftest*
2094])# _LT_LINKER_BOILERPLATE
2095
2096# _LT_REQUIRED_DARWIN_CHECKS
2097# -------------------------
2098m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
2099  case $host_os in
2100    rhapsody* | darwin*)
2101    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
2102    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
2103    AC_CHECK_TOOL([LIPO], [lipo], [:])
2104    AC_CHECK_TOOL([OTOOL], [otool], [:])
2105    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
2106    _LT_DECL([], [DSYMUTIL], [1],
2107      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
2108    _LT_DECL([], [NMEDIT], [1],
2109      [Tool to change global to local symbols on Mac OS X])
2110    _LT_DECL([], [LIPO], [1],
2111      [Tool to manipulate fat objects and archives on Mac OS X])
2112    _LT_DECL([], [OTOOL], [1],
2113      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2114    _LT_DECL([], [OTOOL64], [1],
2115      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2116
2117    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2118      [lt_cv_apple_cc_single_mod=no
2119      if test -z "${LT_MULTI_MODULE}"; then
2120	# By default we will add the -single_module flag. You can override
2121	# by either setting the environment variable LT_MULTI_MODULE
2122	# non-empty at configure time, or by adding -multi_module to the
2123	# link flags.
2124	rm -rf libconftest.dylib*
2125	echo "int foo(void){return 1;}" > conftest.c
2126	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2127-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2128	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2129	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2130        _lt_result=$?
2131	# If there is a non-empty error log, and "single_module"
2132	# appears in it, assume the flag caused a linker warning
2133        if test -s conftest.err && $GREP single_module conftest.err; then
2134	  cat conftest.err >&AS_MESSAGE_LOG_FD
2135	# Otherwise, if the output was created with a 0 exit code from
2136	# the compiler, it worked.
2137	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2138	  lt_cv_apple_cc_single_mod=yes
2139	else
2140	  cat conftest.err >&AS_MESSAGE_LOG_FD
2141	fi
2142	rm -rf libconftest.dylib*
2143	rm -f conftest.*
2144      fi])
2145
2146    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2147      [lt_cv_ld_exported_symbols_list],
2148      [lt_cv_ld_exported_symbols_list=no
2149      save_LDFLAGS=$LDFLAGS
2150      echo "_main" > conftest.sym
2151      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2152      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2153	[lt_cv_ld_exported_symbols_list=yes],
2154	[lt_cv_ld_exported_symbols_list=no])
2155	LDFLAGS="$save_LDFLAGS"
2156    ])
2157
2158    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2159      [lt_cv_ld_force_load=no
2160      cat > conftest.c << _LT_EOF
2161int forced_loaded() { return 2;}
2162_LT_EOF
2163      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2164      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2165      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2166      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2167      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2168      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2169      cat > conftest.c << _LT_EOF
2170int main() { return 0;}
2171_LT_EOF
2172      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2173      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2174      _lt_result=$?
2175      if test -s conftest.err && $GREP force_load conftest.err; then
2176	cat conftest.err >&AS_MESSAGE_LOG_FD
2177      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2178	lt_cv_ld_force_load=yes
2179      else
2180	cat conftest.err >&AS_MESSAGE_LOG_FD
2181      fi
2182        rm -f conftest.err libconftest.a conftest conftest.c
2183        rm -rf conftest.dSYM
2184    ])
2185    case $host_os in
2186    rhapsody* | darwin1.[[012]])
2187      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2188    darwin1.*)
2189      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2190    darwin*) # darwin 5.x on
2191      # if running on 10.5 or later, the deployment target defaults
2192      # to the OS version, if on x86, and 10.4, the deployment
2193      # target defaults to 10.4. Don't you love it?
2194      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2195	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2196	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2197	10.[[012]]*)
2198	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2199	10.*)
2200	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2201      esac
2202    ;;
2203  esac
2204    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2205      _lt_dar_single_mod='$single_module'
2206    fi
2207    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2208      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2209    else
2210      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2211    fi
2212    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2213      _lt_dsymutil='~$DSYMUTIL $lib || :'
2214    else
2215      _lt_dsymutil=
2216    fi
2217    ;;
2218  esac
2219])
2220
2221
2222# _LT_DARWIN_LINKER_FEATURES([TAG])
2223# ---------------------------------
2224# Checks for linker and compiler features on darwin
2225m4_defun([_LT_DARWIN_LINKER_FEATURES],
2226[
2227  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2228  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2229  _LT_TAGVAR(hardcode_direct, $1)=no
2230  _LT_TAGVAR(hardcode_automatic, $1)=yes
2231  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2232  if test "$lt_cv_ld_force_load" = "yes"; then
2233    _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\"`'
2234    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2235                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2236  else
2237    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2238  fi
2239  _LT_TAGVAR(link_all_deplibs, $1)=yes
2240  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2241  case $cc_basename in
2242     ifort*) _lt_dar_can_shared=yes ;;
2243     *) _lt_dar_can_shared=$GCC ;;
2244  esac
2245  if test "$_lt_dar_can_shared" = "yes"; then
2246    output_verbose_link_cmd=func_echo_all
2247    _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}"
2248    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2249    _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}"
2250    _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}"
2251    m4_if([$1], [CXX],
2252[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2253      _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}"
2254      _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}"
2255    fi
2256],[])
2257  else
2258  _LT_TAGVAR(ld_shlibs, $1)=no
2259  fi
2260])
2261
2262# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2263# ----------------------------------
2264# Links a minimal program and checks the executable
2265# for the system default hardcoded library path. In most cases,
2266# this is /usr/lib:/lib, but when the MPI compilers are used
2267# the location of the communication and MPI libs are included too.
2268# If we don't find anything, use the default library path according
2269# to the aix ld manual.
2270# Store the results from the different compilers for each TAGNAME.
2271# Allow to override them for all tags through lt_cv_aix_libpath.
2272m4_defun([_LT_SYS_MODULE_PATH_AIX],
2273[m4_require([_LT_DECL_SED])dnl
2274if test "${lt_cv_aix_libpath+set}" = set; then
2275  aix_libpath=$lt_cv_aix_libpath
2276else
2277  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2278  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2279  lt_aix_libpath_sed='[
2280      /Import File Strings/,/^$/ {
2281	  /^0/ {
2282	      s/^0  *\([^ ]*\) *$/\1/
2283	      p
2284	  }
2285      }]'
2286  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2287  # Check for a 64-bit object if we didn't find anything.
2288  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2289    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2290  fi],[])
2291  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2292    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2293  fi
2294  ])
2295  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2296fi
2297])# _LT_SYS_MODULE_PATH_AIX
2298
2299
2300# _LT_SHELL_INIT(ARG)
2301# -------------------
2302m4_define([_LT_SHELL_INIT],
2303[m4_divert_text([M4SH-INIT], [$1
2304])])# _LT_SHELL_INIT
2305
2306
2307
2308# _LT_PROG_ECHO_BACKSLASH
2309# -----------------------
2310# Find how we can fake an echo command that does not interpret backslash.
2311# In particular, with Autoconf 2.60 or later we add some code to the start
2312# of the generated configure script which will find a shell with a builtin
2313# printf (which we can use as an echo command).
2314m4_defun([_LT_PROG_ECHO_BACKSLASH],
2315[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2316ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2317ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2318
2319AC_MSG_CHECKING([how to print strings])
2320# Test print first, because it will be a builtin if present.
2321if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2322   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2323  ECHO='print -r --'
2324elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2325  ECHO='printf %s\n'
2326else
2327  # Use this function as a fallback that always works.
2328  func_fallback_echo ()
2329  {
2330    eval 'cat <<_LTECHO_EOF
2331$[]1
2332_LTECHO_EOF'
2333  }
2334  ECHO='func_fallback_echo'
2335fi
2336
2337# func_echo_all arg...
2338# Invoke $ECHO with all args, space-separated.
2339func_echo_all ()
2340{
2341    $ECHO "$*" 
2342}
2343
2344case "$ECHO" in
2345  printf*) AC_MSG_RESULT([printf]) ;;
2346  print*) AC_MSG_RESULT([print -r]) ;;
2347  *) AC_MSG_RESULT([cat]) ;;
2348esac
2349
2350m4_ifdef([_AS_DETECT_SUGGESTED],
2351[_AS_DETECT_SUGGESTED([
2352  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2353    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2354    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2355    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2356    PATH=/empty FPATH=/empty; export PATH FPATH
2357    test "X`printf %s $ECHO`" = "X$ECHO" \
2358      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2359
2360_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2361_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2362])# _LT_PROG_ECHO_BACKSLASH
2363
2364
2365# _LT_WITH_SYSROOT
2366# ----------------
2367AC_DEFUN([_LT_WITH_SYSROOT],
2368[AC_MSG_CHECKING([for sysroot])
2369AC_ARG_WITH([sysroot],
2370[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2371                        (or the compiler's sysroot if not specified).],
2372[], [with_sysroot=no])
2373
2374dnl lt_sysroot will always be passed unquoted.  We quote it here
2375dnl in case the user passed a directory name.
2376lt_sysroot=
2377case ${with_sysroot} in #(
2378 yes)
2379   if test "$GCC" = yes; then
2380     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2381   fi
2382   ;; #(
2383 /*)
2384   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2385   ;; #(
2386 no|'')
2387   ;; #(
2388 *)
2389   AC_MSG_RESULT([${with_sysroot}])
2390   AC_MSG_ERROR([The sysroot must be an absolute path.])
2391   ;;
2392esac
2393
2394 AC_MSG_RESULT([${lt_sysroot:-no}])
2395_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2396[dependent libraries, and in which our libraries should be installed.])])
2397
2398# _LT_ENABLE_LOCK
2399# ---------------
2400m4_defun([_LT_ENABLE_LOCK],
2401[AC_ARG_ENABLE([libtool-lock],
2402  [AS_HELP_STRING([--disable-libtool-lock],
2403    [avoid locking (might break parallel builds)])])
2404test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2405
2406# Some flags need to be propagated to the compiler or linker for good
2407# libtool support.
2408case $host in
2409ia64-*-hpux*)
2410  # Find out which ABI we are using.
2411  echo 'int i;' > conftest.$ac_ext
2412  if AC_TRY_EVAL(ac_compile); then
2413    case `/usr/bin/file conftest.$ac_objext` in
2414      *ELF-32*)
2415	HPUX_IA64_MODE="32"
2416	;;
2417      *ELF-64*)
2418	HPUX_IA64_MODE="64"
2419	;;
2420    esac
2421  fi
2422  rm -rf conftest*
2423  ;;
2424*-*-irix6*)
2425  # Find out which ABI we are using.
2426  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2427  if AC_TRY_EVAL(ac_compile); then
2428    if test "$lt_cv_prog_gnu_ld" = yes; then
2429      case `/usr/bin/file conftest.$ac_objext` in
2430	*32-bit*)
2431	  LD="${LD-ld} -melf32bsmip"
2432	  ;;
2433	*N32*)
2434	  LD="${LD-ld} -melf32bmipn32"
2435	  ;;
2436	*64-bit*)
2437	  LD="${LD-ld} -melf64bmip"
2438	;;
2439      esac
2440    else
2441      case `/usr/bin/file conftest.$ac_objext` in
2442	*32-bit*)
2443	  LD="${LD-ld} -32"
2444	  ;;
2445	*N32*)
2446	  LD="${LD-ld} -n32"
2447	  ;;
2448	*64-bit*)
2449	  LD="${LD-ld} -64"
2450	  ;;
2451      esac
2452    fi
2453  fi
2454  rm -rf conftest*
2455  ;;
2456
2457x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2458s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2459  # Find out which ABI we are using.
2460  echo 'int i;' > conftest.$ac_ext
2461  if AC_TRY_EVAL(ac_compile); then
2462    case `/usr/bin/file conftest.o` in
2463      *32-bit*)
2464	case $host in
2465	  x86_64-*kfreebsd*-gnu)
2466	    LD="${LD-ld} -m elf_i386_fbsd"
2467	    ;;
2468	  x86_64-*linux*)
2469	    LD="${LD-ld} -m elf_i386"
2470	    ;;
2471	  ppc64-*linux*|powerpc64-*linux*)
2472	    LD="${LD-ld} -m elf32ppclinux"
2473	    ;;
2474	  s390x-*linux*)
2475	    LD="${LD-ld} -m elf_s390"
2476	    ;;
2477	  sparc64-*linux*)
2478	    LD="${LD-ld} -m elf32_sparc"
2479	    ;;
2480	esac
2481	;;
2482      *64-bit*)
2483	case $host in
2484	  x86_64-*kfreebsd*-gnu)
2485	    LD="${LD-ld} -m elf_x86_64_fbsd"
2486	    ;;
2487	  x86_64-*linux*)
2488	    LD="${LD-ld} -m elf_x86_64"
2489	    ;;
2490	  ppc*-*linux*|powerpc*-*linux*)
2491	    LD="${LD-ld} -m elf64ppc"
2492	    ;;
2493	  s390*-*linux*|s390*-*tpf*)
2494	    LD="${LD-ld} -m elf64_s390"
2495	    ;;
2496	  sparc*-*linux*)
2497	    LD="${LD-ld} -m elf64_sparc"
2498	    ;;
2499	esac
2500	;;
2501    esac
2502  fi
2503  rm -rf conftest*
2504  ;;
2505
2506*-*-sco3.2v5*)
2507  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2508  SAVE_CFLAGS="$CFLAGS"
2509  CFLAGS="$CFLAGS -belf"
2510  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2511    [AC_LANG_PUSH(C)
2512     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2513     AC_LANG_POP])
2514  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2515    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2516    CFLAGS="$SAVE_CFLAGS"
2517  fi
2518  ;;
2519*-*solaris*)
2520  # Find out which ABI we are using.
2521  echo 'int i;' > conftest.$ac_ext
2522  if AC_TRY_EVAL(ac_compile); then
2523    case `/usr/bin/file conftest.o` in
2524    *64-bit*)
2525      case $lt_cv_prog_gnu_ld in
2526      yes*)
2527        case $host in
2528        i?86-*-solaris*)
2529          LD="${LD-ld} -m elf_x86_64"
2530          ;;
2531        sparc*-*-solaris*)
2532          LD="${LD-ld} -m elf64_sparc"
2533          ;;
2534        esac
2535        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2536        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2537          LD="${LD-ld}_sol2"
2538        fi
2539        ;;
2540      *)
2541	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2542	  LD="${LD-ld} -64"
2543	fi
2544	;;
2545      esac
2546      ;;
2547    esac
2548  fi
2549  rm -rf conftest*
2550  ;;
2551esac
2552
2553need_locks="$enable_libtool_lock"
2554])# _LT_ENABLE_LOCK
2555
2556
2557# _LT_PROG_AR
2558# -----------
2559m4_defun([_LT_PROG_AR],
2560[AC_CHECK_TOOLS(AR, [ar], false)
2561: ${AR=ar}
2562: ${AR_FLAGS=cru}
2563_LT_DECL([], [AR], [1], [The archiver])
2564_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2565
2566AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2567  [lt_cv_ar_at_file=no
2568   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2569     [echo conftest.$ac_objext > conftest.lst
2570      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2571      AC_TRY_EVAL([lt_ar_try])
2572      if test "$ac_status" -eq 0; then
2573	# Ensure the archiver fails upon bogus file names.
2574	rm -f conftest.$ac_objext libconftest.a
2575	AC_TRY_EVAL([lt_ar_try])
2576	if test "$ac_status" -ne 0; then
2577          lt_cv_ar_at_file=@
2578        fi
2579      fi
2580      rm -f conftest.* libconftest.a
2581     ])
2582  ])
2583
2584if test "x$lt_cv_ar_at_file" = xno; then
2585  archiver_list_spec=
2586else
2587  archiver_list_spec=$lt_cv_ar_at_file
2588fi
2589_LT_DECL([], [archiver_list_spec], [1],
2590  [How to feed a file listing to the archiver])
2591])# _LT_PROG_AR
2592
2593
2594# _LT_CMD_OLD_ARCHIVE
2595# -------------------
2596m4_defun([_LT_CMD_OLD_ARCHIVE],
2597[_LT_PROG_AR
2598
2599AC_CHECK_TOOL(STRIP, strip, :)
2600test -z "$STRIP" && STRIP=:
2601_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2602
2603AC_CHECK_TOOL(RANLIB, ranlib, :)
2604test -z "$RANLIB" && RANLIB=:
2605_LT_DECL([], [RANLIB], [1],
2606    [Commands used to install an old-style archive])
2607
2608# Determine commands to create old-style static archives.
2609old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2610old_postinstall_cmds='chmod 644 $oldlib'
2611old_postuninstall_cmds=
2612
2613if test -n "$RANLIB"; then
2614  case $host_os in
2615  openbsd*)
2616    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2617    ;;
2618  *)
2619    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2620    ;;
2621  esac
2622  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2623fi
2624
2625case $host_os in
2626  darwin*)
2627    lock_old_archive_extraction=yes ;;
2628  *)
2629    lock_old_archive_extraction=no ;;
2630esac
2631_LT_DECL([], [old_postinstall_cmds], [2])
2632_LT_DECL([], [old_postuninstall_cmds], [2])
2633_LT_TAGDECL([], [old_archive_cmds], [2],
2634    [Commands used to build an old-style archive])
2635_LT_DECL([], [lock_old_archive_extraction], [0],
2636    [Whether to use a lock for old archive extraction])
2637])# _LT_CMD_OLD_ARCHIVE
2638
2639
2640# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2641#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2642# ----------------------------------------------------------------
2643# Check whether the given compiler option works
2644AC_DEFUN([_LT_COMPILER_OPTION],
2645[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2646m4_require([_LT_DECL_SED])dnl
2647AC_CACHE_CHECK([$1], [$2],
2648  [$2=no
2649   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2650   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2651   lt_compiler_flag="$3"
2652   # Insert the option either (1) after the last *FLAGS variable, or
2653   # (2) before a word containing "conftest.", or (3) at the end.
2654   # Note that $ac_compile itself does not contain backslashes and begins
2655   # with a dollar sign (not a hyphen), so the echo should work correctly.
2656   # The option is referenced via a variable to avoid confusing sed.
2657   lt_compile=`echo "$ac_compile" | $SED \
2658   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2659   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2660   -e 's:$: $lt_compiler_flag:'`
2661   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2662   (eval "$lt_compile" 2>conftest.err)
2663   ac_status=$?
2664   cat conftest.err >&AS_MESSAGE_LOG_FD
2665   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2666   if (exit $ac_status) && test -s "$ac_outfile"; then
2667     # The compiler can only warn and ignore the option if not recognized
2668     # So say no if there are warnings other than the usual output.
2669     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2670     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2671     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2672       $2=yes
2673     fi
2674   fi
2675   $RM conftest*
2676])
2677
2678if test x"[$]$2" = xyes; then
2679    m4_if([$5], , :, [$5])
2680else
2681    m4_if([$6], , :, [$6])
2682fi
2683])# _LT_COMPILER_OPTION
2684
2685# Old name:
2686AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2687dnl aclocal-1.4 backwards compatibility:
2688dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2689
2690
2691# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2692#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2693# ----------------------------------------------------
2694# Check whether the given linker option works
2695AC_DEFUN([_LT_LINKER_OPTION],
2696[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2697m4_require([_LT_DECL_SED])dnl
2698AC_CACHE_CHECK([$1], [$2],
2699  [$2=no
2700   save_LDFLAGS="$LDFLAGS"
2701   LDFLAGS="$LDFLAGS $3"
2702   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2703   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2704     # The linker can only warn and ignore the option if not recognized
2705     # So say no if there are warnings
2706     if test -s conftest.err; then
2707       # Append any errors to the config.log.
2708       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2709       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2710       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2711       if diff conftest.exp conftest.er2 >/dev/null; then
2712         $2=yes
2713       fi
2714     else
2715       $2=yes
2716     fi
2717   fi
2718   $RM -r conftest*
2719   LDFLAGS="$save_LDFLAGS"
2720])
2721
2722if test x"[$]$2" = xyes; then
2723    m4_if([$4], , :, [$4])
2724else
2725    m4_if([$5], , :, [$5])
2726fi
2727])# _LT_LINKER_OPTION
2728
2729# Old name:
2730AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2731dnl aclocal-1.4 backwards compatibility:
2732dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2733
2734
2735# LT_CMD_MAX_LEN
2736#---------------
2737AC_DEFUN([LT_CMD_MAX_LEN],
2738[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2739# find the maximum length of command line arguments
2740AC_MSG_CHECKING([the maximum length of command line arguments])
2741AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2742  i=0
2743  teststring="ABCD"
2744
2745  case $build_os in
2746  msdosdjgpp*)
2747    # On DJGPP, this test can blow up pretty badly due to problems in libc
2748    # (any single argument exceeding 2000 bytes causes a buffer overrun
2749    # during glob expansion).  Even if it were fixed, the result of this
2750    # check would be larger than it should be.
2751    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2752    ;;
2753
2754  gnu*)
2755    # Under GNU Hurd, this test is not required because there is
2756    # no limit to the length of command line arguments.
2757    # Libtool will interpret -1 as no limit whatsoever
2758    lt_cv_sys_max_cmd_len=-1;
2759    ;;
2760
2761  cygwin* | mingw* | cegcc*)
2762    # On Win9x/ME, this test blows up -- it succeeds, but takes
2763    # about 5 minutes as the teststring grows exponentially.
2764    # Worse, since 9x/ME are not pre-emptively multitasking,
2765    # you end up with a "frozen" computer, even though with patience
2766    # the test eventually succeeds (with a max line length of 256k).
2767    # Instead, let's just punt: use the minimum linelength reported by
2768    # all of the supported platforms: 8192 (on NT/2K/XP).
2769    lt_cv_sys_max_cmd_len=8192;
2770    ;;
2771
2772  mint*)
2773    # On MiNT this can take a long time and run out of memory.
2774    lt_cv_sys_max_cmd_len=8192;
2775    ;;
2776
2777  amigaos*)
2778    # On AmigaOS with pdksh, this test takes hours, literally.
2779    # So we just punt and use a minimum line length of 8192.
2780    lt_cv_sys_max_cmd_len=8192;
2781    ;;
2782
2783  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2784    # This has been around since 386BSD, at least.  Likely further.
2785    if test -x /sbin/sysctl; then
2786      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2787    elif test -x /usr/sbin/sysctl; then
2788      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2789    else
2790      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2791    fi
2792    # And add a safety zone
2793    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2794    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2795    ;;
2796
2797  interix*)
2798    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2799    lt_cv_sys_max_cmd_len=196608
2800    ;;
2801
2802  os2*)
2803    # The test takes a long time on OS/2.
2804    lt_cv_sys_max_cmd_len=8192
2805    ;;
2806
2807  osf*)
2808    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2809    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2810    # nice to cause kernel panics so lets avoid the loop below.
2811    # First set a reasonable default.
2812    lt_cv_sys_max_cmd_len=16384
2813    #
2814    if test -x /sbin/sysconfig; then
2815      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2816        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2817      esac
2818    fi
2819    ;;
2820  sco3.2v5*)
2821    lt_cv_sys_max_cmd_len=102400
2822    ;;
2823  sysv5* | sco5v6* | sysv4.2uw2*)
2824    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2825    if test -n "$kargmax"; then
2826      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2827    else
2828      lt_cv_sys_max_cmd_len=32768
2829    fi
2830    ;;
2831  *)
2832    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2833    if test -n "$lt_cv_sys_max_cmd_len"; then
2834      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2835      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2836    else
2837      # Make teststring a little bigger before we do anything with it.
2838      # a 1K string should be a reasonable start.
2839      for i in 1 2 3 4 5 6 7 8 ; do
2840        teststring=$teststring$teststring
2841      done
2842      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2843      # If test is not a shell built-in, we'll probably end up computing a
2844      # maximum length that is only half of the actual maximum length, but
2845      # we can't tell.
2846      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2847	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2848	      test $i != 17 # 1/2 MB should be enough
2849      do
2850        i=`expr $i + 1`
2851        teststring=$teststring$teststring
2852      done
2853      # Only check the string length outside the loop.
2854      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2855      teststring=
2856      # Add a significant safety factor because C++ compilers can tack on
2857      # massive amounts of additional arguments before passing them to the
2858      # linker.  It appears as though 1/2 is a usable value.
2859      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2860    fi
2861    ;;
2862  esac
2863])
2864if test -n $lt_cv_sys_max_cmd_len ; then
2865  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2866else
2867  AC_MSG_RESULT(none)
2868fi
2869max_cmd_len=$lt_cv_sys_max_cmd_len
2870_LT_DECL([], [max_cmd_len], [0],
2871    [What is the maximum length of a command?])
2872])# LT_CMD_MAX_LEN
2873
2874# Old name:
2875AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2876dnl aclocal-1.4 backwards compatibility:
2877dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2878
2879
2880# _LT_HEADER_DLFCN
2881# ----------------
2882m4_defun([_LT_HEADER_DLFCN],
2883[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2884])# _LT_HEADER_DLFCN
2885
2886
2887# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2888#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2889# ----------------------------------------------------------------
2890m4_defun([_LT_TRY_DLOPEN_SELF],
2891[m4_require([_LT_HEADER_DLFCN])dnl
2892if test "$cross_compiling" = yes; then :
2893  [$4]
2894else
2895  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2896  lt_status=$lt_dlunknown
2897  cat > conftest.$ac_ext <<_LT_EOF
2898[#line $LINENO "configure"
2899#include "confdefs.h"
2900
2901#if HAVE_DLFCN_H
2902#include <dlfcn.h>
2903#endif
2904
2905#include <stdio.h>
2906
2907#ifdef RTLD_GLOBAL
2908#  define LT_DLGLOBAL		RTLD_GLOBAL
2909#else
2910#  ifdef DL_GLOBAL
2911#    define LT_DLGLOBAL		DL_GLOBAL
2912#  else
2913#    define LT_DLGLOBAL		0
2914#  endif
2915#endif
2916
2917/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2918   find out it does not work in some platform. */
2919#ifndef LT_DLLAZY_OR_NOW
2920#  ifdef RTLD_LAZY
2921#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2922#  else
2923#    ifdef DL_LAZY
2924#      define LT_DLLAZY_OR_NOW		DL_LAZY
2925#    else
2926#      ifdef RTLD_NOW
2927#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2928#      else
2929#        ifdef DL_NOW
2930#          define LT_DLLAZY_OR_NOW	DL_NOW
2931#        else
2932#          define LT_DLLAZY_OR_NOW	0
2933#        endif
2934#      endif
2935#    endif
2936#  endif
2937#endif
2938
2939/* When -fvisbility=hidden is used, assume the code has been annotated
2940   correspondingly for the symbols needed.  */
2941#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2942int fnord () __attribute__((visibility("default")));
2943#endif
2944
2945int fnord () { return 42; }
2946int main ()
2947{
2948  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2949  int status = $lt_dlunknown;
2950
2951  if (self)
2952    {
2953      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2954      else
2955        {
2956	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2957          else puts (dlerror ());
2958	}
2959      /* dlclose (self); */
2960    }
2961  else
2962    puts (dlerror ());
2963
2964  return status;
2965}]
2966_LT_EOF
2967  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2968    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2969    lt_status=$?
2970    case x$lt_status in
2971      x$lt_dlno_uscore) $1 ;;
2972      x$lt_dlneed_uscore) $2 ;;
2973      x$lt_dlunknown|x*) $3 ;;
2974    esac
2975  else :
2976    # compilation failed
2977    $3
2978  fi
2979fi
2980rm -fr conftest*
2981])# _LT_TRY_DLOPEN_SELF
2982
2983
2984# LT_SYS_DLOPEN_SELF
2985# ------------------
2986AC_DEFUN([LT_SYS_DLOPEN_SELF],
2987[m4_require([_LT_HEADER_DLFCN])dnl
2988if test "x$enable_dlopen" != xyes; then
2989  enable_dlopen=unknown
2990  enable_dlopen_self=unknown
2991  enable_dlopen_self_static=unknown
2992else
2993  lt_cv_dlopen=no
2994  lt_cv_dlopen_libs=
2995
2996  case $host_os in
2997  beos*)
2998    lt_cv_dlopen="load_add_on"
2999    lt_cv_dlopen_libs=
3000    lt_cv_dlopen_self=yes
3001    ;;
3002
3003  mingw* | pw32* | cegcc*)
3004    lt_cv_dlopen="LoadLibrary"
3005    lt_cv_dlopen_libs=
3006    ;;
3007
3008  cygwin*)
3009    lt_cv_dlopen="dlopen"
3010    lt_cv_dlopen_libs=
3011    ;;
3012
3013  darwin*)
3014  # if libdl is installed we need to link against it
3015    AC_CHECK_LIB([dl], [dlopen],
3016		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
3017    lt_cv_dlopen="dyld"
3018    lt_cv_dlopen_libs=
3019    lt_cv_dlopen_self=yes
3020    ])
3021    ;;
3022
3023  *)
3024    AC_CHECK_FUNC([shl_load],
3025	  [lt_cv_dlopen="shl_load"],
3026      [AC_CHECK_LIB([dld], [shl_load],
3027	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
3028	[AC_CHECK_FUNC([dlopen],
3029	      [lt_cv_dlopen="dlopen"],
3030	  [AC_CHECK_LIB([dl], [dlopen],
3031		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
3032	    [AC_CHECK_LIB([svld], [dlopen],
3033		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
3034	      [AC_CHECK_LIB([dld], [dld_link],
3035		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
3036	      ])
3037	    ])
3038	  ])
3039	])
3040      ])
3041    ;;
3042  esac
3043
3044  if test "x$lt_cv_dlopen" != xno; then
3045    enable_dlopen=yes
3046  else
3047    enable_dlopen=no
3048  fi
3049
3050  case $lt_cv_dlopen in
3051  dlopen)
3052    save_CPPFLAGS="$CPPFLAGS"
3053    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
3054
3055    save_LDFLAGS="$LDFLAGS"
3056    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
3057
3058    save_LIBS="$LIBS"
3059    LIBS="$lt_cv_dlopen_libs $LIBS"
3060
3061    AC_CACHE_CHECK([whether a program can dlopen itself],
3062	  lt_cv_dlopen_self, [dnl
3063	  _LT_TRY_DLOPEN_SELF(
3064	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
3065	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
3066    ])
3067
3068    if test "x$lt_cv_dlopen_self" = xyes; then
3069      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
3070      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
3071	  lt_cv_dlopen_self_static, [dnl
3072	  _LT_TRY_DLOPEN_SELF(
3073	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
3074	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
3075      ])
3076    fi
3077
3078    CPPFLAGS="$save_CPPFLAGS"
3079    LDFLAGS="$save_LDFLAGS"
3080    LIBS="$save_LIBS"
3081    ;;
3082  esac
3083
3084  case $lt_cv_dlopen_self in
3085  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
3086  *) enable_dlopen_self=unknown ;;
3087  esac
3088
3089  case $lt_cv_dlopen_self_static in
3090  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
3091  *) enable_dlopen_self_static=unknown ;;
3092  esac
3093fi
3094_LT_DECL([dlopen_support], [enable_dlopen], [0],
3095	 [Whether dlopen is supported])
3096_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
3097	 [Whether dlopen of programs is supported])
3098_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
3099	 [Whether dlopen of statically linked programs is supported])
3100])# LT_SYS_DLOPEN_SELF
3101
3102# Old name:
3103AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
3104dnl aclocal-1.4 backwards compatibility:
3105dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
3106
3107
3108# _LT_COMPILER_C_O([TAGNAME])
3109# ---------------------------
3110# Check to see if options -c and -o are simultaneously supported by compiler.
3111# This macro does not hard code the compiler like AC_PROG_CC_C_O.
3112m4_defun([_LT_COMPILER_C_O],
3113[m4_require([_LT_DECL_SED])dnl
3114m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3115m4_require([_LT_TAG_COMPILER])dnl
3116AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3117  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3118  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3119   $RM -r conftest 2>/dev/null
3120   mkdir conftest
3121   cd conftest
3122   mkdir out
3123   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3124
3125   lt_compiler_flag="-o out/conftest2.$ac_objext"
3126   # Insert the option either (1) after the last *FLAGS variable, or
3127   # (2) before a word containing "conftest.", or (3) at the end.
3128   # Note that $ac_compile itself does not contain backslashes and begins
3129   # with a dollar sign (not a hyphen), so the echo should work correctly.
3130   lt_compile=`echo "$ac_compile" | $SED \
3131   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3132   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3133   -e 's:$: $lt_compiler_flag:'`
3134   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3135   (eval "$lt_compile" 2>out/conftest.err)
3136   ac_status=$?
3137   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3138   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3139   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3140   then
3141     # The compiler can only warn and ignore the option if not recognized
3142     # So say no if there are warnings
3143     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3144     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3145     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3146       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3147     fi
3148   fi
3149   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3150   $RM conftest*
3151   # SGI C++ compiler will create directory out/ii_files/ for
3152   # template instantiation
3153   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3154   $RM out/* && rmdir out
3155   cd ..
3156   $RM -r conftest
3157   $RM conftest*
3158])
3159_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3160	[Does compiler simultaneously support -c and -o options?])
3161])# _LT_COMPILER_C_O
3162
3163
3164# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3165# ----------------------------------
3166# Check to see if we can do hard links to lock some files if needed
3167m4_defun([_LT_COMPILER_FILE_LOCKS],
3168[m4_require([_LT_ENABLE_LOCK])dnl
3169m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3170_LT_COMPILER_C_O([$1])
3171
3172hard_links="nottested"
3173if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3174  # do not overwrite the value of need_locks provided by the user
3175  AC_MSG_CHECKING([if we can lock with hard links])
3176  hard_links=yes
3177  $RM conftest*
3178  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3179  touch conftest.a
3180  ln conftest.a conftest.b 2>&5 || hard_links=no
3181  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3182  AC_MSG_RESULT([$hard_links])
3183  if test "$hard_links" = no; then
3184    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3185    need_locks=warn
3186  fi
3187else
3188  need_locks=no
3189fi
3190_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3191])# _LT_COMPILER_FILE_LOCKS
3192
3193
3194# _LT_CHECK_OBJDIR
3195# ----------------
3196m4_defun([_LT_CHECK_OBJDIR],
3197[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3198[rm -f .libs 2>/dev/null
3199mkdir .libs 2>/dev/null
3200if test -d .libs; then
3201  lt_cv_objdir=.libs
3202else
3203  # MS-DOS does not allow filenames that begin with a dot.
3204  lt_cv_objdir=_libs
3205fi
3206rmdir .libs 2>/dev/null])
3207objdir=$lt_cv_objdir
3208_LT_DECL([], [objdir], [0],
3209         [The name of the directory that contains temporary libtool files])dnl
3210m4_pattern_allow([LT_OBJDIR])dnl
3211AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3212  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3213])# _LT_CHECK_OBJDIR
3214
3215
3216# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3217# --------------------------------------
3218# Check hardcoding attributes.
3219m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3220[AC_MSG_CHECKING([how to hardcode library paths into programs])
3221_LT_TAGVAR(hardcode_action, $1)=
3222if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3223   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3224   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3225
3226  # We can hardcode non-existent directories.
3227  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3228     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3229     # have to relink, otherwise we might link with an installed library
3230     # when we should be linking with a yet-to-be-installed one
3231     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3232     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3233    # Linking always hardcodes the temporary library directory.
3234    _LT_TAGVAR(hardcode_action, $1)=relink
3235  else
3236    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3237    _LT_TAGVAR(hardcode_action, $1)=immediate
3238  fi
3239else
3240  # We cannot hardcode anything, or else we can only hardcode existing
3241  # directories.
3242  _LT_TAGVAR(hardcode_action, $1)=unsupported
3243fi
3244AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3245
3246if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3247   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3248  # Fast installation is not supported
3249  enable_fast_install=no
3250elif test "$shlibpath_overrides_runpath" = yes ||
3251     test "$enable_shared" = no; then
3252  # Fast installation is not necessary
3253  enable_fast_install=needless
3254fi
3255_LT_TAGDECL([], [hardcode_action], [0],
3256    [How to hardcode a shared library path into an executable])
3257])# _LT_LINKER_HARDCODE_LIBPATH
3258
3259
3260# _LT_CMD_STRIPLIB
3261# ----------------
3262m4_defun([_LT_CMD_STRIPLIB],
3263[m4_require([_LT_DECL_EGREP])
3264striplib=
3265old_striplib=
3266AC_MSG_CHECKING([whether stripping libraries is possible])
3267if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3268  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3269  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3270  AC_MSG_RESULT([yes])
3271else
3272# FIXME - insert some real tests, host_os isn't really good enough
3273  case $host_os in
3274  darwin*)
3275    if test -n "$STRIP" ; then
3276      striplib="$STRIP -x"
3277      old_striplib="$STRIP -S"
3278      AC_MSG_RESULT([yes])
3279    else
3280      AC_MSG_RESULT([no])
3281    fi
3282    ;;
3283  *)
3284    AC_MSG_RESULT([no])
3285    ;;
3286  esac
3287fi
3288_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3289_LT_DECL([], [striplib], [1])
3290])# _LT_CMD_STRIPLIB
3291
3292
3293# _LT_SYS_DYNAMIC_LINKER([TAG])
3294# -----------------------------
3295# PORTME Fill in your ld.so characteristics
3296m4_defun([_LT_SYS_DYNAMIC_LINKER],
3297[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3298m4_require([_LT_DECL_EGREP])dnl
3299m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3300m4_require([_LT_DECL_OBJDUMP])dnl
3301m4_require([_LT_DECL_SED])dnl
3302m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3303AC_MSG_CHECKING([dynamic linker characteristics])
3304m4_if([$1],
3305	[], [
3306if test "$GCC" = yes; then
3307  case $host_os in
3308    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3309    *) lt_awk_arg="/^libraries:/" ;;
3310  esac
3311  case $host_os in
3312    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3313    *) lt_sed_strip_eq="s,=/,/,g" ;;
3314  esac
3315  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3316  case $lt_search_path_spec in
3317  *\;*)
3318    # if the path contains ";" then we assume it to be the separator
3319    # otherwise default to the standard path separator (i.e. ":") - it is
3320    # assumed that no part of a normal pathname contains ";" but that should
3321    # okay in the real world where ";" in dirpaths is itself problematic.
3322    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3323    ;;
3324  *)
3325    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3326    ;;
3327  esac
3328  # Ok, now we have the path, separated by spaces, we can step through it
3329  # and add multilib dir if necessary.
3330  lt_tmp_lt_search_path_spec=
3331  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3332  for lt_sys_path in $lt_search_path_spec; do
3333    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3334      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3335    else
3336      test -d "$lt_sys_path" && \
3337	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3338    fi
3339  done
3340  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3341BEGIN {RS=" "; FS="/|\n";} {
3342  lt_foo="";
3343  lt_count=0;
3344  for (lt_i = NF; lt_i > 0; lt_i--) {
3345    if ($lt_i != "" && $lt_i != ".") {
3346      if ($lt_i == "..") {
3347        lt_count++;
3348      } else {
3349        if (lt_count == 0) {
3350          lt_foo="/" $lt_i lt_foo;
3351        } else {
3352          lt_count--;
3353        }
3354      }
3355    }
3356  }
3357  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3358  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3359}'`
3360  # AWK program above erroneously prepends '/' to C:/dos/paths
3361  # for these hosts.
3362  case $host_os in
3363    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3364      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3365  esac
3366  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3367else
3368  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3369fi])
3370library_names_spec=
3371libname_spec='lib$name'
3372soname_spec=
3373shrext_cmds=".so"
3374postinstall_cmds=
3375postuninstall_cmds=
3376finish_cmds=
3377finish_eval=
3378shlibpath_var=
3379shlibpath_overrides_runpath=unknown
3380version_type=none
3381dynamic_linker="$host_os ld.so"
3382sys_lib_dlsearch_path_spec="/lib /usr/lib"
3383need_lib_prefix=unknown
3384hardcode_into_libs=no
3385
3386# when you set need_version to no, make sure it does not cause -set_version
3387# flags to be left without arguments
3388need_version=unknown
3389
3390case $host_os in
3391aix3*)
3392  version_type=linux # correct to gnu/linux during the next big refactor
3393  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3394  shlibpath_var=LIBPATH
3395
3396  # AIX 3 has no versioning support, so we append a major version to the name.
3397  soname_spec='${libname}${release}${shared_ext}$major'
3398  ;;
3399
3400aix[[4-9]]*)
3401  version_type=linux # correct to gnu/linux during the next big refactor
3402  need_lib_prefix=no
3403  need_version=no
3404  hardcode_into_libs=yes
3405  if test "$host_cpu" = ia64; then
3406    # AIX 5 supports IA64
3407    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3408    shlibpath_var=LD_LIBRARY_PATH
3409  else
3410    # With GCC up to 2.95.x, collect2 would create an import file
3411    # for dependence libraries.  The import file would start with
3412    # the line `#! .'.  This would cause the generated library to
3413    # depend on `.', always an invalid library.  This was fixed in
3414    # development snapshots of GCC prior to 3.0.
3415    case $host_os in
3416      aix4 | aix4.[[01]] | aix4.[[01]].*)
3417      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3418	   echo ' yes '
3419	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3420	:
3421      else
3422	can_build_shared=no
3423      fi
3424      ;;
3425    esac
3426    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3427    # soname into executable. Probably we can add versioning support to
3428    # collect2, so additional links can be useful in future.
3429    if test "$aix_use_runtimelinking" = yes; then
3430      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3431      # instead of lib<name>.a to let people know that these are not
3432      # typical AIX shared libraries.
3433      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3434    else
3435      # We preserve .a as extension for shared libraries through AIX4.2
3436      # and later when we are not doing run time linking.
3437      library_names_spec='${libname}${release}.a $libname.a'
3438      soname_spec='${libname}${release}${shared_ext}$major'
3439    fi
3440    shlibpath_var=LIBPATH
3441  fi
3442  ;;
3443
3444amigaos*)
3445  case $host_cpu in
3446  powerpc)
3447    # Since July 2007 AmigaOS4 officially supports .so libraries.
3448    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3449    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3450    ;;
3451  m68k)
3452    library_names_spec='$libname.ixlibrary $libname.a'
3453    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3454    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'
3455    ;;
3456  esac
3457  ;;
3458
3459beos*)
3460  library_names_spec='${libname}${shared_ext}'
3461  dynamic_linker="$host_os ld.so"
3462  shlibpath_var=LIBRARY_PATH
3463  ;;
3464
3465bsdi[[45]]*)
3466  version_type=linux # correct to gnu/linux during the next big refactor
3467  need_version=no
3468  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3469  soname_spec='${libname}${release}${shared_ext}$major'
3470  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3471  shlibpath_var=LD_LIBRARY_PATH
3472  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3473  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3474  # the default ld.so.conf also contains /usr/contrib/lib and
3475  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3476  # libtool to hard-code these into programs
3477  ;;
3478
3479cygwin* | mingw* | pw32* | cegcc*)
3480  version_type=windows
3481  shrext_cmds=".dll"
3482  need_version=no
3483  need_lib_prefix=no
3484
3485  case $GCC,$cc_basename in
3486  yes,*)
3487    # gcc
3488    library_names_spec='$libname.dll.a'
3489    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3490    postinstall_cmds='base_file=`basename \${file}`~
3491      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3492      dldir=$destdir/`dirname \$dlpath`~
3493      test -d \$dldir || mkdir -p \$dldir~
3494      $install_prog $dir/$dlname \$dldir/$dlname~
3495      chmod a+x \$dldir/$dlname~
3496      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3497        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3498      fi'
3499    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3500      dlpath=$dir/\$dldll~
3501       $RM \$dlpath'
3502    shlibpath_overrides_runpath=yes
3503
3504    case $host_os in
3505    cygwin*)
3506      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3507      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3508m4_if([$1], [],[
3509      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3510      ;;
3511    mingw* | cegcc*)
3512      # MinGW DLLs use traditional 'lib' prefix
3513      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3514      ;;
3515    pw32*)
3516      # pw32 DLLs use 'pw' prefix rather than 'lib'
3517      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3518      ;;
3519    esac
3520    dynamic_linker='Win32 ld.exe'
3521    ;;
3522
3523  *,cl*)
3524    # Native MSVC
3525    libname_spec='$name'
3526    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3527    library_names_spec='${libname}.dll.lib'
3528
3529    case $build_os in
3530    mingw*)
3531      sys_lib_search_path_spec=
3532      lt_save_ifs=$IFS
3533      IFS=';'
3534      for lt_path in $LIB
3535      do
3536        IFS=$lt_save_ifs
3537        # Let DOS variable expansion print the short 8.3 style file name.
3538        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3539        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3540      done
3541      IFS=$lt_save_ifs
3542      # Convert to MSYS style.
3543      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3544      ;;
3545    cygwin*)
3546      # Convert to unix form, then to dos form, then back to unix form
3547      # but this time dos style (no spaces!) so that the unix form looks
3548      # like /cygdrive/c/PROGRA~1:/cygdr...
3549      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3550      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3551      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3552      ;;
3553    *)
3554      sys_lib_search_path_spec="$LIB"
3555      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3556        # It is most probably a Windows format PATH.
3557        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3558      else
3559        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3560      fi
3561      # FIXME: find the short name or the path components, as spaces are
3562      # common. (e.g. "Program Files" -> "PROGRA~1")
3563      ;;
3564    esac
3565
3566    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3567    postinstall_cmds='base_file=`basename \${file}`~
3568      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3569      dldir=$destdir/`dirname \$dlpath`~
3570      test -d \$dldir || mkdir -p \$dldir~
3571      $install_prog $dir/$dlname \$dldir/$dlname'
3572    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3573      dlpath=$dir/\$dldll~
3574       $RM \$dlpath'
3575    shlibpath_overrides_runpath=yes
3576    dynamic_linker='Win32 link.exe'
3577    ;;
3578
3579  *)
3580    # Assume MSVC wrapper
3581    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3582    dynamic_linker='Win32 ld.exe'
3583    ;;
3584  esac
3585  # FIXME: first we should search . and the directory the executable is in
3586  shlibpath_var=PATH
3587  ;;
3588
3589darwin* | rhapsody*)
3590  dynamic_linker="$host_os dyld"
3591  version_type=darwin
3592  need_lib_prefix=no
3593  need_version=no
3594  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3595  soname_spec='${libname}${release}${major}$shared_ext'
3596  shlibpath_overrides_runpath=yes
3597  shlibpath_var=DYLD_LIBRARY_PATH
3598  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3599m4_if([$1], [],[
3600  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3601  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3602  ;;
3603
3604dgux*)
3605  version_type=linux # correct to gnu/linux during the next big refactor
3606  need_lib_prefix=no
3607  need_version=no
3608  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3609  soname_spec='${libname}${release}${shared_ext}$major'
3610  shlibpath_var=LD_LIBRARY_PATH
3611  ;;
3612
3613freebsd* | dragonfly*)
3614  # DragonFly does not have aout.  When/if they implement a new
3615  # versioning mechanism, adjust this.
3616  if test -x /usr/bin/objformat; then
3617    objformat=`/usr/bin/objformat`
3618  else
3619    case $host_os in
3620    freebsd[[23]].*) objformat=aout ;;
3621    *) objformat=elf ;;
3622    esac
3623  fi
3624  version_type=freebsd-$objformat
3625  case $version_type in
3626    freebsd-elf*)
3627      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3628      need_version=no
3629      need_lib_prefix=no
3630      ;;
3631    freebsd-*)
3632      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3633      need_version=yes
3634      ;;
3635  esac
3636  shlibpath_var=LD_LIBRARY_PATH
3637  case $host_os in
3638  freebsd2.*)
3639    shlibpath_overrides_runpath=yes
3640    ;;
3641  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3642    shlibpath_overrides_runpath=yes
3643    hardcode_into_libs=yes
3644    ;;
3645  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3646  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3647    shlibpath_overrides_runpath=no
3648    hardcode_into_libs=yes
3649    ;;
3650  *) # from 4.6 on, and DragonFly
3651    shlibpath_overrides_runpath=yes
3652    hardcode_into_libs=yes
3653    ;;
3654  esac
3655  ;;
3656
3657gnu*)
3658  version_type=linux # correct to gnu/linux during the next big refactor
3659  need_lib_prefix=no
3660  need_version=no
3661  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3662  soname_spec='${libname}${release}${shared_ext}$major'
3663  shlibpath_var=LD_LIBRARY_PATH
3664  shlibpath_overrides_runpath=no
3665  hardcode_into_libs=yes
3666  ;;
3667
3668haiku*)
3669  version_type=linux # correct to gnu/linux during the next big refactor
3670  need_lib_prefix=no
3671  need_version=no
3672  dynamic_linker="$host_os runtime_loader"
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  shlibpath_var=LIBRARY_PATH
3676  shlibpath_overrides_runpath=yes
3677  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3678  hardcode_into_libs=yes
3679  ;;
3680
3681hpux9* | hpux10* | hpux11*)
3682  # Give a soname corresponding to the major version so that dld.sl refuses to
3683  # link against other versions.
3684  version_type=sunos
3685  need_lib_prefix=no
3686  need_version=no
3687  case $host_cpu in
3688  ia64*)
3689    shrext_cmds='.so'
3690    hardcode_into_libs=yes
3691    dynamic_linker="$host_os dld.so"
3692    shlibpath_var=LD_LIBRARY_PATH
3693    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3694    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3695    soname_spec='${libname}${release}${shared_ext}$major'
3696    if test "X$HPUX_IA64_MODE" = X32; then
3697      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3698    else
3699      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3700    fi
3701    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3702    ;;
3703  hppa*64*)
3704    shrext_cmds='.sl'
3705    hardcode_into_libs=yes
3706    dynamic_linker="$host_os dld.sl"
3707    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3708    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3709    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3710    soname_spec='${libname}${release}${shared_ext}$major'
3711    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3712    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3713    ;;
3714  *)
3715    shrext_cmds='.sl'
3716    dynamic_linker="$host_os dld.sl"
3717    shlibpath_var=SHLIB_PATH
3718    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3719    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3720    soname_spec='${libname}${release}${shared_ext}$major'
3721    ;;
3722  esac
3723  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3724  postinstall_cmds='chmod 555 $lib'
3725  # or fails outright, so override atomically:
3726  install_override_mode=555
3727  ;;
3728
3729interix[[3-9]]*)
3730  version_type=linux # correct to gnu/linux during the next big refactor
3731  need_lib_prefix=no
3732  need_version=no
3733  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3734  soname_spec='${libname}${release}${shared_ext}$major'
3735  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3736  shlibpath_var=LD_LIBRARY_PATH
3737  shlibpath_overrides_runpath=no
3738  hardcode_into_libs=yes
3739  ;;
3740
3741irix5* | irix6* | nonstopux*)
3742  case $host_os in
3743    nonstopux*) version_type=nonstopux ;;
3744    *)
3745	if test "$lt_cv_prog_gnu_ld" = yes; then
3746		version_type=linux # correct to gnu/linux during the next big refactor
3747	else
3748		version_type=irix
3749	fi ;;
3750  esac
3751  need_lib_prefix=no
3752  need_version=no
3753  soname_spec='${libname}${release}${shared_ext}$major'
3754  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3755  case $host_os in
3756  irix5* | nonstopux*)
3757    libsuff= shlibsuff=
3758    ;;
3759  *)
3760    case $LD in # libtool.m4 will add one of these switches to LD
3761    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3762      libsuff= shlibsuff= libmagic=32-bit;;
3763    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3764      libsuff=32 shlibsuff=N32 libmagic=N32;;
3765    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3766      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3767    *) libsuff= shlibsuff= libmagic=never-match;;
3768    esac
3769    ;;
3770  esac
3771  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3772  shlibpath_overrides_runpath=no
3773  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3774  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3775  hardcode_into_libs=yes
3776  ;;
3777
3778# No shared lib support for Linux oldld, aout, or coff.
3779linux*oldld* | linux*aout* | linux*coff*)
3780  dynamic_linker=no
3781  ;;
3782
3783# This must be glibc/ELF.
3784linux* | k*bsd*-gnu | kopensolaris*-gnu)
3785  version_type=linux # correct to gnu/linux during the next big refactor
3786  need_lib_prefix=no
3787  need_version=no
3788  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3789  soname_spec='${libname}${release}${shared_ext}$major'
3790  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3791  shlibpath_var=LD_LIBRARY_PATH
3792  shlibpath_overrides_runpath=no
3793
3794  # Some binutils ld are patched to set DT_RUNPATH
3795  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3796    [lt_cv_shlibpath_overrides_runpath=no
3797    save_LDFLAGS=$LDFLAGS
3798    save_libdir=$libdir
3799    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3800	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3801    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3802      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3803	 [lt_cv_shlibpath_overrides_runpath=yes])])
3804    LDFLAGS=$save_LDFLAGS
3805    libdir=$save_libdir
3806    ])
3807  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3808
3809  # This implies no fast_install, which is unacceptable.
3810  # Some rework will be needed to allow for fast_install
3811  # before this can be enabled.
3812  hardcode_into_libs=yes
3813
3814  # Append ld.so.conf contents to the search path
3815  if test -f /etc/ld.so.conf; then
3816    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' ' '`
3817    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3818  fi
3819
3820  # We used to test for /lib/ld.so.1 and disable shared libraries on
3821  # powerpc, because MkLinux only supported shared libraries with the
3822  # GNU dynamic linker.  Since this was broken with cross compilers,
3823  # most powerpc-linux boxes support dynamic linking these days and
3824  # people can always --disable-shared, the test was removed, and we
3825  # assume the GNU/Linux dynamic linker is in use.
3826  dynamic_linker='GNU/Linux ld.so'
3827  ;;
3828
3829netbsd*)
3830  version_type=sunos
3831  need_lib_prefix=no
3832  need_version=no
3833  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3834    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3835    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3836    dynamic_linker='NetBSD (a.out) ld.so'
3837  else
3838    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3839    soname_spec='${libname}${release}${shared_ext}$major'
3840    dynamic_linker='NetBSD ld.elf_so'
3841  fi
3842  shlibpath_var=LD_LIBRARY_PATH
3843  shlibpath_overrides_runpath=yes
3844  hardcode_into_libs=yes
3845  ;;
3846
3847newsos6)
3848  version_type=linux # correct to gnu/linux during the next big refactor
3849  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3850  shlibpath_var=LD_LIBRARY_PATH
3851  shlibpath_overrides_runpath=yes
3852  ;;
3853
3854*nto* | *qnx*)
3855  version_type=qnx
3856  need_lib_prefix=no
3857  need_version=no
3858  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3859  soname_spec='${libname}${release}${shared_ext}$major'
3860  shlibpath_var=LD_LIBRARY_PATH
3861  shlibpath_overrides_runpath=no
3862  hardcode_into_libs=yes
3863  dynamic_linker='ldqnx.so'
3864  ;;
3865
3866openbsd*)
3867  version_type=sunos
3868  sys_lib_dlsearch_path_spec="/usr/lib"
3869  need_lib_prefix=no
3870  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3871  case $host_os in
3872    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3873    *)				need_version=no  ;;
3874  esac
3875  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3876  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3877  shlibpath_var=LD_LIBRARY_PATH
3878  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3879    case $host_os in
3880      openbsd2.[[89]] | openbsd2.[[89]].*)
3881	shlibpath_overrides_runpath=no
3882	;;
3883      *)
3884	shlibpath_overrides_runpath=yes
3885	;;
3886      esac
3887  else
3888    shlibpath_overrides_runpath=yes
3889  fi
3890  ;;
3891
3892os2*)
3893  libname_spec='$name'
3894  shrext_cmds=".dll"
3895  need_lib_prefix=no
3896  library_names_spec='$libname${shared_ext} $libname.a'
3897  dynamic_linker='OS/2 ld.exe'
3898  shlibpath_var=LIBPATH
3899  ;;
3900
3901osf3* | osf4* | osf5*)
3902  version_type=osf
3903  need_lib_prefix=no
3904  need_version=no
3905  soname_spec='${libname}${release}${shared_ext}$major'
3906  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3907  shlibpath_var=LD_LIBRARY_PATH
3908  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3909  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3910  ;;
3911
3912rdos*)
3913  dynamic_linker=no
3914  ;;
3915
3916solaris*)
3917  version_type=linux # correct to gnu/linux during the next big refactor
3918  need_lib_prefix=no
3919  need_version=no
3920  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3921  soname_spec='${libname}${release}${shared_ext}$major'
3922  shlibpath_var=LD_LIBRARY_PATH
3923  shlibpath_overrides_runpath=yes
3924  hardcode_into_libs=yes
3925  # ldd complains unless libraries are executable
3926  postinstall_cmds='chmod +x $lib'
3927  ;;
3928
3929sunos4*)
3930  version_type=sunos
3931  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3932  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3933  shlibpath_var=LD_LIBRARY_PATH
3934  shlibpath_overrides_runpath=yes
3935  if test "$with_gnu_ld" = yes; then
3936    need_lib_prefix=no
3937  fi
3938  need_version=yes
3939  ;;
3940
3941sysv4 | sysv4.3*)
3942  version_type=linux # correct to gnu/linux during the next big refactor
3943  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3944  soname_spec='${libname}${release}${shared_ext}$major'
3945  shlibpath_var=LD_LIBRARY_PATH
3946  case $host_vendor in
3947    sni)
3948      shlibpath_overrides_runpath=no
3949      need_lib_prefix=no
3950      runpath_var=LD_RUN_PATH
3951      ;;
3952    siemens)
3953      need_lib_prefix=no
3954      ;;
3955    motorola)
3956      need_lib_prefix=no
3957      need_version=no
3958      shlibpath_overrides_runpath=no
3959      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3960      ;;
3961  esac
3962  ;;
3963
3964sysv4*MP*)
3965  if test -d /usr/nec ;then
3966    version_type=linux # correct to gnu/linux during the next big refactor
3967    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3968    soname_spec='$libname${shared_ext}.$major'
3969    shlibpath_var=LD_LIBRARY_PATH
3970  fi
3971  ;;
3972
3973sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3974  version_type=freebsd-elf
3975  need_lib_prefix=no
3976  need_version=no
3977  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3978  soname_spec='${libname}${release}${shared_ext}$major'
3979  shlibpath_var=LD_LIBRARY_PATH
3980  shlibpath_overrides_runpath=yes
3981  hardcode_into_libs=yes
3982  if test "$with_gnu_ld" = yes; then
3983    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3984  else
3985    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3986    case $host_os in
3987      sco3.2v5*)
3988        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3989	;;
3990    esac
3991  fi
3992  sys_lib_dlsearch_path_spec='/usr/lib'
3993  ;;
3994
3995tpf*)
3996  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3997  version_type=linux # correct to gnu/linux during the next big refactor
3998  need_lib_prefix=no
3999  need_version=no
4000  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4001  shlibpath_var=LD_LIBRARY_PATH
4002  shlibpath_overrides_runpath=no
4003  hardcode_into_libs=yes
4004  ;;
4005
4006uts4*)
4007  version_type=linux # correct to gnu/linux during the next big refactor
4008  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4009  soname_spec='${libname}${release}${shared_ext}$major'
4010  shlibpath_var=LD_LIBRARY_PATH
4011  ;;
4012
4013*)
4014  dynamic_linker=no
4015  ;;
4016esac
4017AC_MSG_RESULT([$dynamic_linker])
4018test "$dynamic_linker" = no && can_build_shared=no
4019
4020variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
4021if test "$GCC" = yes; then
4022  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
4023fi
4024
4025if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
4026  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
4027fi
4028if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
4029  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
4030fi
4031
4032_LT_DECL([], [variables_saved_for_relink], [1],
4033    [Variables whose values should be saved in libtool wrapper scripts and
4034    restored at link time])
4035_LT_DECL([], [need_lib_prefix], [0],
4036    [Do we need the "lib" prefix for modules?])
4037_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
4038_LT_DECL([], [version_type], [0], [Library versioning type])
4039_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
4040_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
4041_LT_DECL([], [shlibpath_overrides_runpath], [0],
4042    [Is shlibpath searched before the hard-coded library search path?])
4043_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
4044_LT_DECL([], [library_names_spec], [1],
4045    [[List of archive names.  First name is the real one, the rest are links.
4046    The last name is the one that the linker finds with -lNAME]])
4047_LT_DECL([], [soname_spec], [1],
4048    [[The coded name of the library, if different from the real name]])
4049_LT_DECL([], [install_override_mode], [1],
4050    [Permission mode override for installation of shared libraries])
4051_LT_DECL([], [postinstall_cmds], [2],
4052    [Command to use after installation of a shared archive])
4053_LT_DECL([], [postuninstall_cmds], [2],
4054    [Command to use after uninstallation of a shared archive])
4055_LT_DECL([], [finish_cmds], [2],
4056    [Commands used to finish a libtool library installation in a directory])
4057_LT_DECL([], [finish_eval], [1],
4058    [[As "finish_cmds", except a single script fragment to be evaled but
4059    not shown]])
4060_LT_DECL([], [hardcode_into_libs], [0],
4061    [Whether we should hardcode library paths into libraries])
4062_LT_DECL([], [sys_lib_search_path_spec], [2],
4063    [Compile-time system search path for libraries])
4064_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
4065    [Run-time system search path for libraries])
4066])# _LT_SYS_DYNAMIC_LINKER
4067
4068
4069# _LT_PATH_TOOL_PREFIX(TOOL)
4070# --------------------------
4071# find a file program which can recognize shared library
4072AC_DEFUN([_LT_PATH_TOOL_PREFIX],
4073[m4_require([_LT_DECL_EGREP])dnl
4074AC_MSG_CHECKING([for $1])
4075AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4076[case $MAGIC_CMD in
4077[[\\/*] |  ?:[\\/]*])
4078  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4079  ;;
4080*)
4081  lt_save_MAGIC_CMD="$MAGIC_CMD"
4082  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4083dnl $ac_dummy forces splitting on constant user-supplied paths.
4084dnl POSIX.2 word splitting is done only on the output of word expansions,
4085dnl not every word.  This closes a longstanding sh security hole.
4086  ac_dummy="m4_if([$2], , $PATH, [$2])"
4087  for ac_dir in $ac_dummy; do
4088    IFS="$lt_save_ifs"
4089    test -z "$ac_dir" && ac_dir=.
4090    if test -f $ac_dir/$1; then
4091      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4092      if test -n "$file_magic_test_file"; then
4093	case $deplibs_check_method in
4094	"file_magic "*)
4095	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
4096	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4097	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4098	    $EGREP "$file_magic_regex" > /dev/null; then
4099	    :
4100	  else
4101	    cat <<_LT_EOF 1>&2
4102
4103*** Warning: the command libtool uses to detect shared libraries,
4104*** $file_magic_cmd, produces output that libtool cannot recognize.
4105*** The result is that libtool may fail to recognize shared libraries
4106*** as such.  This will affect the creation of libtool libraries that
4107*** depend on shared libraries, but programs linked with such libtool
4108*** libraries will work regardless of this problem.  Nevertheless, you
4109*** may want to report the problem to your system manager and/or to
4110*** bug-libtool@gnu.org
4111
4112_LT_EOF
4113	  fi ;;
4114	esac
4115      fi
4116      break
4117    fi
4118  done
4119  IFS="$lt_save_ifs"
4120  MAGIC_CMD="$lt_save_MAGIC_CMD"
4121  ;;
4122esac])
4123MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4124if test -n "$MAGIC_CMD"; then
4125  AC_MSG_RESULT($MAGIC_CMD)
4126else
4127  AC_MSG_RESULT(no)
4128fi
4129_LT_DECL([], [MAGIC_CMD], [0],
4130	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4131])# _LT_PATH_TOOL_PREFIX
4132
4133# Old name:
4134AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4135dnl aclocal-1.4 backwards compatibility:
4136dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4137
4138
4139# _LT_PATH_MAGIC
4140# --------------
4141# find a file program which can recognize a shared library
4142m4_defun([_LT_PATH_MAGIC],
4143[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4144if test -z "$lt_cv_path_MAGIC_CMD"; then
4145  if test -n "$ac_tool_prefix"; then
4146    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4147  else
4148    MAGIC_CMD=:
4149  fi
4150fi
4151])# _LT_PATH_MAGIC
4152
4153
4154# LT_PATH_LD
4155# ----------
4156# find the pathname to the GNU or non-GNU linker
4157AC_DEFUN([LT_PATH_LD],
4158[AC_REQUIRE([AC_PROG_CC])dnl
4159AC_REQUIRE([AC_CANONICAL_HOST])dnl
4160AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4161m4_require([_LT_DECL_SED])dnl
4162m4_require([_LT_DECL_EGREP])dnl
4163m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4164
4165AC_ARG_WITH([gnu-ld],
4166    [AS_HELP_STRING([--with-gnu-ld],
4167	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4168    [test "$withval" = no || with_gnu_ld=yes],
4169    [with_gnu_ld=no])dnl
4170
4171ac_prog=ld
4172if test "$GCC" = yes; then
4173  # Check if gcc -print-prog-name=ld gives a path.
4174  AC_MSG_CHECKING([for ld used by $CC])
4175  case $host in
4176  *-*-mingw*)
4177    # gcc leaves a trailing carriage return which upsets mingw
4178    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4179  *)
4180    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4181  esac
4182  case $ac_prog in
4183    # Accept absolute paths.
4184    [[\\/]]* | ?:[[\\/]]*)
4185      re_direlt='/[[^/]][[^/]]*/\.\./'
4186      # Canonicalize the pathname of ld
4187      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4188      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4189	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4190      done
4191      test -z "$LD" && LD="$ac_prog"
4192      ;;
4193  "")
4194    # If it fails, then pretend we aren't using GCC.
4195    ac_prog=ld
4196    ;;
4197  *)
4198    # If it is relative, then search for the first ld in PATH.
4199    with_gnu_ld=unknown
4200    ;;
4201  esac
4202elif test "$with_gnu_ld" = yes; then
4203  AC_MSG_CHECKING([for GNU ld])
4204else
4205  AC_MSG_CHECKING([for non-GNU ld])
4206fi
4207AC_CACHE_VAL(lt_cv_path_LD,
4208[if test -z "$LD"; then
4209  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4210  for ac_dir in $PATH; do
4211    IFS="$lt_save_ifs"
4212    test -z "$ac_dir" && ac_dir=.
4213    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4214      lt_cv_path_LD="$ac_dir/$ac_prog"
4215      # Check to see if the program is GNU ld.  I'd rather use --version,
4216      # but apparently some variants of GNU ld only accept -v.
4217      # Break only if it was the GNU/non-GNU ld that we prefer.
4218      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4219      *GNU* | *'with BFD'*)
4220	test "$with_gnu_ld" != no && break
4221	;;
4222      *)
4223	test "$with_gnu_ld" != yes && break
4224	;;
4225      esac
4226    fi
4227  done
4228  IFS="$lt_save_ifs"
4229else
4230  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4231fi])
4232LD="$lt_cv_path_LD"
4233if test -n "$LD"; then
4234  AC_MSG_RESULT($LD)
4235else
4236  AC_MSG_RESULT(no)
4237fi
4238test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4239_LT_PATH_LD_GNU
4240AC_SUBST([LD])
4241
4242_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4243])# LT_PATH_LD
4244
4245# Old names:
4246AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4247AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4248dnl aclocal-1.4 backwards compatibility:
4249dnl AC_DEFUN([AM_PROG_LD], [])
4250dnl AC_DEFUN([AC_PROG_LD], [])
4251
4252
4253# _LT_PATH_LD_GNU
4254#- --------------
4255m4_defun([_LT_PATH_LD_GNU],
4256[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4257[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4258case `$LD -v 2>&1 </dev/null` in
4259*GNU* | *'with BFD'*)
4260  lt_cv_prog_gnu_ld=yes
4261  ;;
4262*)
4263  lt_cv_prog_gnu_ld=no
4264  ;;
4265esac])
4266with_gnu_ld=$lt_cv_prog_gnu_ld
4267])# _LT_PATH_LD_GNU
4268
4269
4270# _LT_CMD_RELOAD
4271# --------------
4272# find reload flag for linker
4273#   -- PORTME Some linkers may need a different reload flag.
4274m4_defun([_LT_CMD_RELOAD],
4275[AC_CACHE_CHECK([for $LD option to reload object files],
4276  lt_cv_ld_reload_flag,
4277  [lt_cv_ld_reload_flag='-r'])
4278reload_flag=$lt_cv_ld_reload_flag
4279case $reload_flag in
4280"" | " "*) ;;
4281*) reload_flag=" $reload_flag" ;;
4282esac
4283reload_cmds='$LD$reload_flag -o $output$reload_objs'
4284case $host_os in
4285  cygwin* | mingw* | pw32* | cegcc*)
4286    if test "$GCC" != yes; then
4287      reload_cmds=false
4288    fi
4289    ;;
4290  darwin*)
4291    if test "$GCC" = yes; then
4292      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4293    else
4294      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4295    fi
4296    ;;
4297esac
4298_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4299_LT_TAGDECL([], [reload_cmds], [2])dnl
4300])# _LT_CMD_RELOAD
4301
4302
4303# _LT_CHECK_MAGIC_METHOD
4304# ----------------------
4305# how to check for library dependencies
4306#  -- PORTME fill in with the dynamic library characteristics
4307m4_defun([_LT_CHECK_MAGIC_METHOD],
4308[m4_require([_LT_DECL_EGREP])
4309m4_require([_LT_DECL_OBJDUMP])
4310AC_CACHE_CHECK([how to recognize dependent libraries],
4311lt_cv_deplibs_check_method,
4312[lt_cv_file_magic_cmd='$MAGIC_CMD'
4313lt_cv_file_magic_test_file=
4314lt_cv_deplibs_check_method='unknown'
4315# Need to set the preceding variable on all platforms that support
4316# interlibrary dependencies.
4317# 'none' -- dependencies not supported.
4318# `unknown' -- same as none, but documents that we really don't know.
4319# 'pass_all' -- all dependencies passed with no checks.
4320# 'test_compile' -- check by making test program.
4321# 'file_magic [[regex]]' -- check by looking for files in library path
4322# which responds to the $file_magic_cmd with a given extended regex.
4323# If you have `file' or equivalent on your system and you're not sure
4324# whether `pass_all' will *always* work, you probably want this one.
4325
4326case $host_os in
4327aix[[4-9]]*)
4328  lt_cv_deplibs_check_method=pass_all
4329  ;;
4330
4331beos*)
4332  lt_cv_deplibs_check_method=pass_all
4333  ;;
4334
4335bsdi[[45]]*)
4336  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4337  lt_cv_file_magic_cmd='/usr/bin/file -L'
4338  lt_cv_file_magic_test_file=/shlib/libc.so
4339  ;;
4340
4341cygwin*)
4342  # func_win32_libid is a shell function defined in ltmain.sh
4343  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4344  lt_cv_file_magic_cmd='func_win32_libid'
4345  ;;
4346
4347mingw* | pw32*)
4348  # Base MSYS/MinGW do not provide the 'file' command needed by
4349  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4350  # unless we find 'file', for example because we are cross-compiling.
4351  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4352  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4353    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4354    lt_cv_file_magic_cmd='func_win32_libid'
4355  else
4356    # Keep this pattern in sync with the one in func_win32_libid.
4357    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4358    lt_cv_file_magic_cmd='$OBJDUMP -f'
4359  fi
4360  ;;
4361
4362cegcc*)
4363  # use the weaker test based on 'objdump'. See mingw*.
4364  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4365  lt_cv_file_magic_cmd='$OBJDUMP -f'
4366  ;;
4367
4368darwin* | rhapsody*)
4369  lt_cv_deplibs_check_method=pass_all
4370  ;;
4371
4372freebsd* | dragonfly*)
4373  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4374    case $host_cpu in
4375    i*86 )
4376      # Not sure whether the presence of OpenBSD here was a mistake.
4377      # Let's accept both of them until this is cleared up.
4378      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4379      lt_cv_file_magic_cmd=/usr/bin/file
4380      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4381      ;;
4382    esac
4383  else
4384    lt_cv_deplibs_check_method=pass_all
4385  fi
4386  ;;
4387
4388gnu*)
4389  lt_cv_deplibs_check_method=pass_all
4390  ;;
4391
4392haiku*)
4393  lt_cv_deplibs_check_method=pass_all
4394  ;;
4395
4396hpux10.20* | hpux11*)
4397  lt_cv_file_magic_cmd=/usr/bin/file
4398  case $host_cpu in
4399  ia64*)
4400    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4401    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4402    ;;
4403  hppa*64*)
4404    [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]']
4405    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4406    ;;
4407  *)
4408    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4409    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4410    ;;
4411  esac
4412  ;;
4413
4414interix[[3-9]]*)
4415  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4416  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4417  ;;
4418
4419irix5* | irix6* | nonstopux*)
4420  case $LD in
4421  *-32|*"-32 ") libmagic=32-bit;;
4422  *-n32|*"-n32 ") libmagic=N32;;
4423  *-64|*"-64 ") libmagic=64-bit;;
4424  *) libmagic=never-match;;
4425  esac
4426  lt_cv_deplibs_check_method=pass_all
4427  ;;
4428
4429# This must be glibc/ELF.
4430linux* | k*bsd*-gnu | kopensolaris*-gnu)
4431  lt_cv_deplibs_check_method=pass_all
4432  ;;
4433
4434netbsd*)
4435  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4436    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4437  else
4438    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4439  fi
4440  ;;
4441
4442newos6*)
4443  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4444  lt_cv_file_magic_cmd=/usr/bin/file
4445  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4446  ;;
4447
4448*nto* | *qnx*)
4449  lt_cv_deplibs_check_method=pass_all
4450  ;;
4451
4452openbsd*)
4453  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4454    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4455  else
4456    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4457  fi
4458  ;;
4459
4460osf3* | osf4* | osf5*)
4461  lt_cv_deplibs_check_method=pass_all
4462  ;;
4463
4464rdos*)
4465  lt_cv_deplibs_check_method=pass_all
4466  ;;
4467
4468solaris*)
4469  lt_cv_deplibs_check_method=pass_all
4470  ;;
4471
4472sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4473  lt_cv_deplibs_check_method=pass_all
4474  ;;
4475
4476sysv4 | sysv4.3*)
4477  case $host_vendor in
4478  motorola)
4479    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]]'
4480    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4481    ;;
4482  ncr)
4483    lt_cv_deplibs_check_method=pass_all
4484    ;;
4485  sequent)
4486    lt_cv_file_magic_cmd='/bin/file'
4487    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4488    ;;
4489  sni)
4490    lt_cv_file_magic_cmd='/bin/file'
4491    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4492    lt_cv_file_magic_test_file=/lib/libc.so
4493    ;;
4494  siemens)
4495    lt_cv_deplibs_check_method=pass_all
4496    ;;
4497  pc)
4498    lt_cv_deplibs_check_method=pass_all
4499    ;;
4500  esac
4501  ;;
4502
4503tpf*)
4504  lt_cv_deplibs_check_method=pass_all
4505  ;;
4506esac
4507])
4508
4509file_magic_glob=
4510want_nocaseglob=no
4511if test "$build" = "$host"; then
4512  case $host_os in
4513  mingw* | pw32*)
4514    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4515      want_nocaseglob=yes
4516    else
4517      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4518    fi
4519    ;;
4520  esac
4521fi
4522
4523file_magic_cmd=$lt_cv_file_magic_cmd
4524deplibs_check_method=$lt_cv_deplibs_check_method
4525test -z "$deplibs_check_method" && deplibs_check_method=unknown
4526
4527_LT_DECL([], [deplibs_check_method], [1],
4528    [Method to check whether dependent libraries are shared objects])
4529_LT_DECL([], [file_magic_cmd], [1],
4530    [Command to use when deplibs_check_method = "file_magic"])
4531_LT_DECL([], [file_magic_glob], [1],
4532    [How to find potential files when deplibs_check_method = "file_magic"])
4533_LT_DECL([], [want_nocaseglob], [1],
4534    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4535])# _LT_CHECK_MAGIC_METHOD
4536
4537
4538# LT_PATH_NM
4539# ----------
4540# find the pathname to a BSD- or MS-compatible name lister
4541AC_DEFUN([LT_PATH_NM],
4542[AC_REQUIRE([AC_PROG_CC])dnl
4543AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4544[if test -n "$NM"; then
4545  # Let the user override the test.
4546  lt_cv_path_NM="$NM"
4547else
4548  lt_nm_to_check="${ac_tool_prefix}nm"
4549  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4550    lt_nm_to_check="$lt_nm_to_check nm"
4551  fi
4552  for lt_tmp_nm in $lt_nm_to_check; do
4553    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4554    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4555      IFS="$lt_save_ifs"
4556      test -z "$ac_dir" && ac_dir=.
4557      tmp_nm="$ac_dir/$lt_tmp_nm"
4558      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4559	# Check to see if the nm accepts a BSD-compat flag.
4560	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4561	#   nm: unknown option "B" ignored
4562	# Tru64's nm complains that /dev/null is an invalid object file
4563	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4564	*/dev/null* | *'Invalid file or object type'*)
4565	  lt_cv_path_NM="$tmp_nm -B"
4566	  break
4567	  ;;
4568	*)
4569	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4570	  */dev/null*)
4571	    lt_cv_path_NM="$tmp_nm -p"
4572	    break
4573	    ;;
4574	  *)
4575	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4576	    continue # so that we can try to find one that supports BSD flags
4577	    ;;
4578	  esac
4579	  ;;
4580	esac
4581      fi
4582    done
4583    IFS="$lt_save_ifs"
4584  done
4585  : ${lt_cv_path_NM=no}
4586fi])
4587if test "$lt_cv_path_NM" != "no"; then
4588  NM="$lt_cv_path_NM"
4589else
4590  # Didn't find any BSD compatible name lister, look for dumpbin.
4591  if test -n "$DUMPBIN"; then :
4592    # Let the user override the test.
4593  else
4594    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4595    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4596    *COFF*)
4597      DUMPBIN="$DUMPBIN -symbols"
4598      ;;
4599    *)
4600      DUMPBIN=:
4601      ;;
4602    esac
4603  fi
4604  AC_SUBST([DUMPBIN])
4605  if test "$DUMPBIN" != ":"; then
4606    NM="$DUMPBIN"
4607  fi
4608fi
4609test -z "$NM" && NM=nm
4610AC_SUBST([NM])
4611_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4612
4613AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4614  [lt_cv_nm_interface="BSD nm"
4615  echo "int some_variable = 0;" > conftest.$ac_ext
4616  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4617  (eval "$ac_compile" 2>conftest.err)
4618  cat conftest.err >&AS_MESSAGE_LOG_FD
4619  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4620  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4621  cat conftest.err >&AS_MESSAGE_LOG_FD
4622  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4623  cat conftest.out >&AS_MESSAGE_LOG_FD
4624  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4625    lt_cv_nm_interface="MS dumpbin"
4626  fi
4627  rm -f conftest*])
4628])# LT_PATH_NM
4629
4630# Old names:
4631AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4632AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4633dnl aclocal-1.4 backwards compatibility:
4634dnl AC_DEFUN([AM_PROG_NM], [])
4635dnl AC_DEFUN([AC_PROG_NM], [])
4636
4637# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4638# --------------------------------
4639# how to determine the name of the shared library
4640# associated with a specific link library.
4641#  -- PORTME fill in with the dynamic library characteristics
4642m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4643[m4_require([_LT_DECL_EGREP])
4644m4_require([_LT_DECL_OBJDUMP])
4645m4_require([_LT_DECL_DLLTOOL])
4646AC_CACHE_CHECK([how to associate runtime and link libraries],
4647lt_cv_sharedlib_from_linklib_cmd,
4648[lt_cv_sharedlib_from_linklib_cmd='unknown'
4649
4650case $host_os in
4651cygwin* | mingw* | pw32* | cegcc*)
4652  # two different shell functions defined in ltmain.sh
4653  # decide which to use based on capabilities of $DLLTOOL
4654  case `$DLLTOOL --help 2>&1` in
4655  *--identify-strict*)
4656    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4657    ;;
4658  *)
4659    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4660    ;;
4661  esac
4662  ;;
4663*)
4664  # fallback: assume linklib IS sharedlib
4665  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4666  ;;
4667esac
4668])
4669sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4670test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4671
4672_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4673    [Command to associate shared and link libraries])
4674])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4675
4676
4677# _LT_PATH_MANIFEST_TOOL
4678# ----------------------
4679# locate the manifest tool
4680m4_defun([_LT_PATH_MANIFEST_TOOL],
4681[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4682test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4683AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4684  [lt_cv_path_mainfest_tool=no
4685  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4686  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4687  cat conftest.err >&AS_MESSAGE_LOG_FD
4688  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4689    lt_cv_path_mainfest_tool=yes
4690  fi
4691  rm -f conftest*])
4692if test "x$lt_cv_path_mainfest_tool" != xyes; then
4693  MANIFEST_TOOL=:
4694fi
4695_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4696])# _LT_PATH_MANIFEST_TOOL
4697
4698
4699# LT_LIB_M
4700# --------
4701# check for math library
4702AC_DEFUN([LT_LIB_M],
4703[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4704LIBM=
4705case $host in
4706*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4707  # These system don't have libm, or don't need it
4708  ;;
4709*-ncr-sysv4.3*)
4710  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4711  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4712  ;;
4713*)
4714  AC_CHECK_LIB(m, cos, LIBM="-lm")
4715  ;;
4716esac
4717AC_SUBST([LIBM])
4718])# LT_LIB_M
4719
4720# Old name:
4721AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4722dnl aclocal-1.4 backwards compatibility:
4723dnl AC_DEFUN([AC_CHECK_LIBM], [])
4724
4725
4726# _LT_COMPILER_NO_RTTI([TAGNAME])
4727# -------------------------------
4728m4_defun([_LT_COMPILER_NO_RTTI],
4729[m4_require([_LT_TAG_COMPILER])dnl
4730
4731_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4732
4733if test "$GCC" = yes; then
4734  case $cc_basename in
4735  nvcc*)
4736    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4737  *)
4738    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4739  esac
4740
4741  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4742    lt_cv_prog_compiler_rtti_exceptions,
4743    [-fno-rtti -fno-exceptions], [],
4744    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4745fi
4746_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4747	[Compiler flag to turn off builtin functions])
4748])# _LT_COMPILER_NO_RTTI
4749
4750
4751# _LT_CMD_GLOBAL_SYMBOLS
4752# ----------------------
4753m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4754[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4755AC_REQUIRE([AC_PROG_CC])dnl
4756AC_REQUIRE([AC_PROG_AWK])dnl
4757AC_REQUIRE([LT_PATH_NM])dnl
4758AC_REQUIRE([LT_PATH_LD])dnl
4759m4_require([_LT_DECL_SED])dnl
4760m4_require([_LT_DECL_EGREP])dnl
4761m4_require([_LT_TAG_COMPILER])dnl
4762
4763# Check for command to grab the raw symbol name followed by C symbol from nm.
4764AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4765AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4766[
4767# These are sane defaults that work on at least a few old systems.
4768# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4769
4770# Character class describing NM global symbol codes.
4771symcode='[[BCDEGRST]]'
4772
4773# Regexp to match symbols that can be accessed directly from C.
4774sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4775
4776# Define system-specific variables.
4777case $host_os in
4778aix*)
4779  symcode='[[BCDT]]'
4780  ;;
4781cygwin* | mingw* | pw32* | cegcc*)
4782  symcode='[[ABCDGISTW]]'
4783  ;;
4784hpux*)
4785  if test "$host_cpu" = ia64; then
4786    symcode='[[ABCDEGRST]]'
4787  fi
4788  ;;
4789irix* | nonstopux*)
4790  symcode='[[BCDEGRST]]'
4791  ;;
4792osf*)
4793  symcode='[[BCDEGQRST]]'
4794  ;;
4795solaris*)
4796  symcode='[[BDRT]]'
4797  ;;
4798sco3.2v5*)
4799  symcode='[[DT]]'
4800  ;;
4801sysv4.2uw2*)
4802  symcode='[[DT]]'
4803  ;;
4804sysv5* | sco5v6* | unixware* | OpenUNIX*)
4805  symcode='[[ABDT]]'
4806  ;;
4807sysv4)
4808  symcode='[[DFNSTU]]'
4809  ;;
4810esac
4811
4812# If we're using GNU nm, then use its standard symbol codes.
4813case `$NM -V 2>&1` in
4814*GNU* | *'with BFD'*)
4815  symcode='[[ABCDGIRSTW]]' ;;
4816esac
4817
4818# Transform an extracted symbol line into a proper C declaration.
4819# Some systems (esp. on ia64) link data and code symbols differently,
4820# so use this general approach.
4821lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4822
4823# Transform an extracted symbol line into symbol name and symbol address
4824lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4825lt_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'"
4826
4827# Handle CRLF in mingw tool chain
4828opt_cr=
4829case $build_os in
4830mingw*)
4831  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4832  ;;
4833esac
4834
4835# Try without a prefix underscore, then with it.
4836for ac_symprfx in "" "_"; do
4837
4838  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4839  symxfrm="\\1 $ac_symprfx\\2 \\2"
4840
4841  # Write the raw and C identifiers.
4842  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4843    # Fake it for dumpbin and say T for any non-static function
4844    # and D for any global variable.
4845    # Also find C++ and __fastcall symbols from MSVC++,
4846    # which start with @ or ?.
4847    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4848"     {last_section=section; section=\$ 3};"\
4849"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4850"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4851"     \$ 0!~/External *\|/{next};"\
4852"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4853"     {if(hide[section]) next};"\
4854"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4855"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4856"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4857"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4858"     ' prfx=^$ac_symprfx]"
4859  else
4860    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4861  fi
4862  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4863
4864  # Check to see that the pipe works correctly.
4865  pipe_works=no
4866
4867  rm -f conftest*
4868  cat > conftest.$ac_ext <<_LT_EOF
4869#ifdef __cplusplus
4870extern "C" {
4871#endif
4872char nm_test_var;
4873void nm_test_func(void);
4874void nm_test_func(void){}
4875#ifdef __cplusplus
4876}
4877#endif
4878int main(){nm_test_var='a';nm_test_func();return(0);}
4879_LT_EOF
4880
4881  if AC_TRY_EVAL(ac_compile); then
4882    # Now try to grab the symbols.
4883    nlist=conftest.nm
4884    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4885      # Try sorting and uniquifying the output.
4886      if sort "$nlist" | uniq > "$nlist"T; then
4887	mv -f "$nlist"T "$nlist"
4888      else
4889	rm -f "$nlist"T
4890      fi
4891
4892      # Make sure that we snagged all the symbols we need.
4893      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4894	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4895	  cat <<_LT_EOF > conftest.$ac_ext
4896/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4897#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4898/* DATA imports from DLLs on WIN32 con't be const, because runtime
4899   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4900# define LT@&t@_DLSYM_CONST
4901#elif defined(__osf__)
4902/* This system does not cope well with relocations in const data.  */
4903# define LT@&t@_DLSYM_CONST
4904#else
4905# define LT@&t@_DLSYM_CONST const
4906#endif
4907
4908#ifdef __cplusplus
4909extern "C" {
4910#endif
4911
4912_LT_EOF
4913	  # Now generate the symbol file.
4914	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4915
4916	  cat <<_LT_EOF >> conftest.$ac_ext
4917
4918/* The mapping between symbol names and symbols.  */
4919LT@&t@_DLSYM_CONST struct {
4920  const char *name;
4921  void       *address;
4922}
4923lt__PROGRAM__LTX_preloaded_symbols[[]] =
4924{
4925  { "@PROGRAM@", (void *) 0 },
4926_LT_EOF
4927	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4928	  cat <<\_LT_EOF >> conftest.$ac_ext
4929  {0, (void *) 0}
4930};
4931
4932/* This works around a problem in FreeBSD linker */
4933#ifdef FREEBSD_WORKAROUND
4934static const void *lt_preloaded_setup() {
4935  return lt__PROGRAM__LTX_preloaded_symbols;
4936}
4937#endif
4938
4939#ifdef __cplusplus
4940}
4941#endif
4942_LT_EOF
4943	  # Now try linking the two files.
4944	  mv conftest.$ac_objext conftstm.$ac_objext
4945	  lt_globsym_save_LIBS=$LIBS
4946	  lt_globsym_save_CFLAGS=$CFLAGS
4947	  LIBS="conftstm.$ac_objext"
4948	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4949	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4950	    pipe_works=yes
4951	  fi
4952	  LIBS=$lt_globsym_save_LIBS
4953	  CFLAGS=$lt_globsym_save_CFLAGS
4954	else
4955	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4956	fi
4957      else
4958	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4959      fi
4960    else
4961      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4962    fi
4963  else
4964    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4965    cat conftest.$ac_ext >&5
4966  fi
4967  rm -rf conftest* conftst*
4968
4969  # Do not use the global_symbol_pipe unless it works.
4970  if test "$pipe_works" = yes; then
4971    break
4972  else
4973    lt_cv_sys_global_symbol_pipe=
4974  fi
4975done
4976])
4977if test -z "$lt_cv_sys_global_symbol_pipe"; then
4978  lt_cv_sys_global_symbol_to_cdecl=
4979fi
4980if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4981  AC_MSG_RESULT(failed)
4982else
4983  AC_MSG_RESULT(ok)
4984fi
4985
4986# Response file support.
4987if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4988  nm_file_list_spec='@'
4989elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4990  nm_file_list_spec='@'
4991fi
4992
4993_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4994    [Take the output of nm and produce a listing of raw symbols and C names])
4995_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4996    [Transform the output of nm in a proper C declaration])
4997_LT_DECL([global_symbol_to_c_name_address],
4998    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4999    [Transform the output of nm in a C name address pair])
5000_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
5001    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
5002    [Transform the output of nm in a C name address pair when lib prefix is needed])
5003_LT_DECL([], [nm_file_list_spec], [1],
5004    [Specify filename containing input files for $NM])
5005]) # _LT_CMD_GLOBAL_SYMBOLS
5006
5007
5008# _LT_COMPILER_PIC([TAGNAME])
5009# ---------------------------
5010m4_defun([_LT_COMPILER_PIC],
5011[m4_require([_LT_TAG_COMPILER])dnl
5012_LT_TAGVAR(lt_prog_compiler_wl, $1)=
5013_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5014_LT_TAGVAR(lt_prog_compiler_static, $1)=
5015
5016m4_if([$1], [CXX], [
5017  # C++ specific cases for pic, static, wl, etc.
5018  if test "$GXX" = yes; then
5019    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5020    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5021
5022    case $host_os in
5023    aix*)
5024      # All AIX code is PIC.
5025      if test "$host_cpu" = ia64; then
5026	# AIX 5 now supports IA64 processor
5027	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5028      fi
5029      ;;
5030
5031    amigaos*)
5032      case $host_cpu in
5033      powerpc)
5034            # see comment about AmigaOS4 .so support
5035            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5036        ;;
5037      m68k)
5038            # FIXME: we need at least 68020 code to build shared libraries, but
5039            # adding the `-m68020' flag to GCC prevents building anything better,
5040            # like `-m68040'.
5041            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5042        ;;
5043      esac
5044      ;;
5045
5046    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5047      # PIC is the default for these OSes.
5048      ;;
5049    mingw* | cygwin* | os2* | pw32* | cegcc*)
5050      # This hack is so that the source file can tell whether it is being
5051      # built for inclusion in a dll (and should export symbols for example).
5052      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5053      # (--disable-auto-import) libraries
5054      m4_if([$1], [GCJ], [],
5055	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5056      ;;
5057    darwin* | rhapsody*)
5058      # PIC is the default on this platform
5059      # Common symbols not allowed in MH_DYLIB files
5060      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5061      ;;
5062    *djgpp*)
5063      # DJGPP does not support shared libraries at all
5064      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5065      ;;
5066    haiku*)
5067      # PIC is the default for Haiku.
5068      # The "-static" flag exists, but is broken.
5069      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5070      ;;
5071    interix[[3-9]]*)
5072      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5073      # Instead, we relocate shared libraries at runtime.
5074      ;;
5075    sysv4*MP*)
5076      if test -d /usr/nec; then
5077	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5078      fi
5079      ;;
5080    hpux*)
5081      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5082      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5083      # sets the default TLS model and affects inlining.
5084      case $host_cpu in
5085      hppa*64*)
5086	;;
5087      *)
5088	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5089	;;
5090      esac
5091      ;;
5092    *qnx* | *nto*)
5093      # QNX uses GNU C++, but need to define -shared option too, otherwise
5094      # it will coredump.
5095      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5096      ;;
5097    *)
5098      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5099      ;;
5100    esac
5101  else
5102    case $host_os in
5103      aix[[4-9]]*)
5104	# All AIX code is PIC.
5105	if test "$host_cpu" = ia64; then
5106	  # AIX 5 now supports IA64 processor
5107	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5108	else
5109	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5110	fi
5111	;;
5112      chorus*)
5113	case $cc_basename in
5114	cxch68*)
5115	  # Green Hills C++ Compiler
5116	  # _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"
5117	  ;;
5118	esac
5119	;;
5120      mingw* | cygwin* | os2* | pw32* | cegcc*)
5121	# This hack is so that the source file can tell whether it is being
5122	# built for inclusion in a dll (and should export symbols for example).
5123	m4_if([$1], [GCJ], [],
5124	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5125	;;
5126      dgux*)
5127	case $cc_basename in
5128	  ec++*)
5129	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5130	    ;;
5131	  ghcx*)
5132	    # Green Hills C++ Compiler
5133	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5134	    ;;
5135	  *)
5136	    ;;
5137	esac
5138	;;
5139      freebsd* | dragonfly*)
5140	# FreeBSD uses GNU C++
5141	;;
5142      hpux9* | hpux10* | hpux11*)
5143	case $cc_basename in
5144	  CC*)
5145	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5146	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5147	    if test "$host_cpu" != ia64; then
5148	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5149	    fi
5150	    ;;
5151	  aCC*)
5152	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5153	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5154	    case $host_cpu in
5155	    hppa*64*|ia64*)
5156	      # +Z the default
5157	      ;;
5158	    *)
5159	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5160	      ;;
5161	    esac
5162	    ;;
5163	  *)
5164	    ;;
5165	esac
5166	;;
5167      interix*)
5168	# This is c89, which is MS Visual C++ (no shared libs)
5169	# Anyone wants to do a port?
5170	;;
5171      irix5* | irix6* | nonstopux*)
5172	case $cc_basename in
5173	  CC*)
5174	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5175	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5176	    # CC pic flag -KPIC is the default.
5177	    ;;
5178	  *)
5179	    ;;
5180	esac
5181	;;
5182      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5183	case $cc_basename in
5184	  KCC*)
5185	    # KAI C++ Compiler
5186	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5187	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5188	    ;;
5189	  ecpc* )
5190	    # old Intel C++ for x86_64 which still supported -KPIC.
5191	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5192	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5193	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5194	    ;;
5195	  icpc* )
5196	    # Intel C++, used to be incompatible with GCC.
5197	    # ICC 10 doesn't accept -KPIC any more.
5198	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5199	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5200	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5201	    ;;
5202	  pgCC* | pgcpp*)
5203	    # Portland Group C++ compiler
5204	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5205	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5206	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5207	    ;;
5208	  cxx*)
5209	    # Compaq C++
5210	    # Make sure the PIC flag is empty.  It appears that all Alpha
5211	    # Linux and Compaq Tru64 Unix objects are PIC.
5212	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5213	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5214	    ;;
5215	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5216	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5217	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5218	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5219	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5220	    ;;
5221	  *)
5222	    case `$CC -V 2>&1 | sed 5q` in
5223	    *Sun\ C*)
5224	      # Sun C++ 5.9
5225	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5226	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5227	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5228	      ;;
5229	    esac
5230	    ;;
5231	esac
5232	;;
5233      lynxos*)
5234	;;
5235      m88k*)
5236	;;
5237      mvs*)
5238	case $cc_basename in
5239	  cxx*)
5240	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5241	    ;;
5242	  *)
5243	    ;;
5244	esac
5245	;;
5246      netbsd*)
5247	;;
5248      *qnx* | *nto*)
5249        # QNX uses GNU C++, but need to define -shared option too, otherwise
5250        # it will coredump.
5251        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5252        ;;
5253      osf3* | osf4* | osf5*)
5254	case $cc_basename in
5255	  KCC*)
5256	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5257	    ;;
5258	  RCC*)
5259	    # Rational C++ 2.4.1
5260	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5261	    ;;
5262	  cxx*)
5263	    # Digital/Compaq C++
5264	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5265	    # Make sure the PIC flag is empty.  It appears that all Alpha
5266	    # Linux and Compaq Tru64 Unix objects are PIC.
5267	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5268	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5269	    ;;
5270	  *)
5271	    ;;
5272	esac
5273	;;
5274      psos*)
5275	;;
5276      solaris*)
5277	case $cc_basename in
5278	  CC* | sunCC*)
5279	    # Sun C++ 4.2, 5.x and Centerline C++
5280	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5281	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5282	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5283	    ;;
5284	  gcx*)
5285	    # Green Hills C++ Compiler
5286	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5287	    ;;
5288	  *)
5289	    ;;
5290	esac
5291	;;
5292      sunos4*)
5293	case $cc_basename in
5294	  CC*)
5295	    # Sun C++ 4.x
5296	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5297	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5298	    ;;
5299	  lcc*)
5300	    # Lucid
5301	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5302	    ;;
5303	  *)
5304	    ;;
5305	esac
5306	;;
5307      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5308	case $cc_basename in
5309	  CC*)
5310	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5311	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5312	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5313	    ;;
5314	esac
5315	;;
5316      tandem*)
5317	case $cc_basename in
5318	  NCC*)
5319	    # NonStop-UX NCC 3.20
5320	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5321	    ;;
5322	  *)
5323	    ;;
5324	esac
5325	;;
5326      vxworks*)
5327	;;
5328      *)
5329	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5330	;;
5331    esac
5332  fi
5333],
5334[
5335  if test "$GCC" = yes; then
5336    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5337    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5338
5339    case $host_os in
5340      aix*)
5341      # All AIX code is PIC.
5342      if test "$host_cpu" = ia64; then
5343	# AIX 5 now supports IA64 processor
5344	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5345      fi
5346      ;;
5347
5348    amigaos*)
5349      case $host_cpu in
5350      powerpc)
5351            # see comment about AmigaOS4 .so support
5352            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5353        ;;
5354      m68k)
5355            # FIXME: we need at least 68020 code to build shared libraries, but
5356            # adding the `-m68020' flag to GCC prevents building anything better,
5357            # like `-m68040'.
5358            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5359        ;;
5360      esac
5361      ;;
5362
5363    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5364      # PIC is the default for these OSes.
5365      ;;
5366
5367    mingw* | cygwin* | pw32* | os2* | cegcc*)
5368      # This hack is so that the source file can tell whether it is being
5369      # built for inclusion in a dll (and should export symbols for example).
5370      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5371      # (--disable-auto-import) libraries
5372      m4_if([$1], [GCJ], [],
5373	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5374      ;;
5375
5376    darwin* | rhapsody*)
5377      # PIC is the default on this platform
5378      # Common symbols not allowed in MH_DYLIB files
5379      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5380      ;;
5381
5382    haiku*)
5383      # PIC is the default for Haiku.
5384      # The "-static" flag exists, but is broken.
5385      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5386      ;;
5387
5388    hpux*)
5389      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5390      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5391      # sets the default TLS model and affects inlining.
5392      case $host_cpu in
5393      hppa*64*)
5394	# +Z the default
5395	;;
5396      *)
5397	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5398	;;
5399      esac
5400      ;;
5401
5402    interix[[3-9]]*)
5403      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5404      # Instead, we relocate shared libraries at runtime.
5405      ;;
5406
5407    msdosdjgpp*)
5408      # Just because we use GCC doesn't mean we suddenly get shared libraries
5409      # on systems that don't support them.
5410      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5411      enable_shared=no
5412      ;;
5413
5414    *nto* | *qnx*)
5415      # QNX uses GNU C++, but need to define -shared option too, otherwise
5416      # it will coredump.
5417      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5418      ;;
5419
5420    sysv4*MP*)
5421      if test -d /usr/nec; then
5422	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5423      fi
5424      ;;
5425
5426    *)
5427      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5428      ;;
5429    esac
5430
5431    case $cc_basename in
5432    nvcc*) # Cuda Compiler Driver 2.2
5433      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5434      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5435        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5436      fi
5437      ;;
5438    esac
5439  else
5440    # PORTME Check for flag to pass linker flags through the system compiler.
5441    case $host_os in
5442    aix*)
5443      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5444      if test "$host_cpu" = ia64; then
5445	# AIX 5 now supports IA64 processor
5446	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5447      else
5448	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5449      fi
5450      ;;
5451
5452    mingw* | cygwin* | pw32* | os2* | cegcc*)
5453      # This hack is so that the source file can tell whether it is being
5454      # built for inclusion in a dll (and should export symbols for example).
5455      m4_if([$1], [GCJ], [],
5456	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5457      ;;
5458
5459    hpux9* | hpux10* | hpux11*)
5460      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5461      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5462      # not for PA HP-UX.
5463      case $host_cpu in
5464      hppa*64*|ia64*)
5465	# +Z the default
5466	;;
5467      *)
5468	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5469	;;
5470      esac
5471      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5472      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5473      ;;
5474
5475    irix5* | irix6* | nonstopux*)
5476      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5477      # PIC (with -KPIC) is the default.
5478      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5479      ;;
5480
5481    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5482      case $cc_basename in
5483      # old Intel for x86_64 which still supported -KPIC.
5484      ecc*)
5485	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5486	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5487	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5488        ;;
5489      # icc used to be incompatible with GCC.
5490      # ICC 10 doesn't accept -KPIC any more.
5491      icc* | ifort*)
5492	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5493	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5494	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5495        ;;
5496      # Lahey Fortran 8.1.
5497      lf95*)
5498	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5499	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5500	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5501	;;
5502      nagfor*)
5503	# NAG Fortran compiler
5504	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5505	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5506	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5507	;;
5508      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5509        # Portland Group compilers (*not* the Pentium gcc compiler,
5510	# which looks to be a dead project)
5511	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5512	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5513	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5514        ;;
5515      ccc*)
5516        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5517        # All Alpha code is PIC.
5518        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5519        ;;
5520      xl* | bgxl* | bgf* | mpixl*)
5521	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5522	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5523	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5524	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5525	;;
5526      *)
5527	case `$CC -V 2>&1 | sed 5q` in
5528	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5529	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5530	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5531	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5532	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5533	  ;;
5534	*Sun\ F* | *Sun*Fortran*)
5535	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5536	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5537	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5538	  ;;
5539	*Sun\ C*)
5540	  # Sun C 5.9
5541	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5542	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5543	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5544	  ;;
5545        *Intel*\ [[CF]]*Compiler*)
5546	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5547	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5548	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5549	  ;;
5550	*Portland\ Group*)
5551	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5552	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5553	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5554	  ;;
5555	esac
5556	;;
5557      esac
5558      ;;
5559
5560    newsos6)
5561      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5562      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5563      ;;
5564
5565    *nto* | *qnx*)
5566      # QNX uses GNU C++, but need to define -shared option too, otherwise
5567      # it will coredump.
5568      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5569      ;;
5570
5571    osf3* | osf4* | osf5*)
5572      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5573      # All OSF/1 code is PIC.
5574      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5575      ;;
5576
5577    rdos*)
5578      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5579      ;;
5580
5581    solaris*)
5582      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5583      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5584      case $cc_basename in
5585      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5586	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5587      *)
5588	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5589      esac
5590      ;;
5591
5592    sunos4*)
5593      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5594      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5595      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5596      ;;
5597
5598    sysv4 | sysv4.2uw2* | sysv4.3*)
5599      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5600      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5601      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5602      ;;
5603
5604    sysv4*MP*)
5605      if test -d /usr/nec ;then
5606	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5607	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5608      fi
5609      ;;
5610
5611    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5612      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5613      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5614      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5615      ;;
5616
5617    unicos*)
5618      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5619      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5620      ;;
5621
5622    uts4*)
5623      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5624      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5625      ;;
5626
5627    *)
5628      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5629      ;;
5630    esac
5631  fi
5632])
5633case $host_os in
5634  # For platforms which do not support PIC, -DPIC is meaningless:
5635  *djgpp*)
5636    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5637    ;;
5638  *)
5639    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5640    ;;
5641esac
5642
5643AC_CACHE_CHECK([for $compiler option to produce PIC],
5644  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5645  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5646_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5647
5648#
5649# Check to make sure the PIC flag actually works.
5650#
5651if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5652  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5653    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5654    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5655    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5656     "" | " "*) ;;
5657     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5658     esac],
5659    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5660     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5661fi
5662_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5663	[Additional compiler flags for building library objects])
5664
5665_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5666	[How to pass a linker flag through the compiler])
5667#
5668# Check to make sure the static flag actually works.
5669#
5670wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5671_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5672  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5673  $lt_tmp_static_flag,
5674  [],
5675  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5676_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5677	[Compiler flag to prevent dynamic linking])
5678])# _LT_COMPILER_PIC
5679
5680
5681# _LT_LINKER_SHLIBS([TAGNAME])
5682# ----------------------------
5683# See if the linker supports building shared libraries.
5684m4_defun([_LT_LINKER_SHLIBS],
5685[AC_REQUIRE([LT_PATH_LD])dnl
5686AC_REQUIRE([LT_PATH_NM])dnl
5687m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5688m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5689m4_require([_LT_DECL_EGREP])dnl
5690m4_require([_LT_DECL_SED])dnl
5691m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5692m4_require([_LT_TAG_COMPILER])dnl
5693AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5694m4_if([$1], [CXX], [
5695  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5696  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5697  case $host_os in
5698  aix[[4-9]]*)
5699    # If we're using GNU nm, then we don't want the "-C" option.
5700    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5701    # Also, AIX nm treats weak defined symbols like other global defined
5702    # symbols, whereas GNU nm marks them as "W".
5703    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5704      _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'
5705    else
5706      _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'
5707    fi
5708    ;;
5709  pw32*)
5710    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5711    ;;
5712  cygwin* | mingw* | cegcc*)
5713    case $cc_basename in
5714    cl*)
5715      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5716      ;;
5717    *)
5718      _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'
5719      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5720      ;;
5721    esac
5722    ;;
5723  *)
5724    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5725    ;;
5726  esac
5727], [
5728  runpath_var=
5729  _LT_TAGVAR(allow_undefined_flag, $1)=
5730  _LT_TAGVAR(always_export_symbols, $1)=no
5731  _LT_TAGVAR(archive_cmds, $1)=
5732  _LT_TAGVAR(archive_expsym_cmds, $1)=
5733  _LT_TAGVAR(compiler_needs_object, $1)=no
5734  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5735  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5736  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5737  _LT_TAGVAR(hardcode_automatic, $1)=no
5738  _LT_TAGVAR(hardcode_direct, $1)=no
5739  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5740  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5741  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5742  _LT_TAGVAR(hardcode_minus_L, $1)=no
5743  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5744  _LT_TAGVAR(inherit_rpath, $1)=no
5745  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5746  _LT_TAGVAR(module_cmds, $1)=
5747  _LT_TAGVAR(module_expsym_cmds, $1)=
5748  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5749  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5750  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5751  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5752  # include_expsyms should be a list of space-separated symbols to be *always*
5753  # included in the symbol list
5754  _LT_TAGVAR(include_expsyms, $1)=
5755  # exclude_expsyms can be an extended regexp of symbols to exclude
5756  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5757  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5758  # as well as any symbol that contains `d'.
5759  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5760  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5761  # platforms (ab)use it in PIC code, but their linkers get confused if
5762  # the symbol is explicitly referenced.  Since portable code cannot
5763  # rely on this symbol name, it's probably fine to never include it in
5764  # preloaded symbol tables.
5765  # Exclude shared library initialization/finalization symbols.
5766dnl Note also adjust exclude_expsyms for C++ above.
5767  extract_expsyms_cmds=
5768
5769  case $host_os in
5770  cygwin* | mingw* | pw32* | cegcc*)
5771    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5772    # When not using gcc, we currently assume that we are using
5773    # Microsoft Visual C++.
5774    if test "$GCC" != yes; then
5775      with_gnu_ld=no
5776    fi
5777    ;;
5778  interix*)
5779    # we just hope/assume this is gcc and not c89 (= MSVC++)
5780    with_gnu_ld=yes
5781    ;;
5782  openbsd*)
5783    with_gnu_ld=no
5784    ;;
5785  esac
5786
5787  _LT_TAGVAR(ld_shlibs, $1)=yes
5788
5789  # On some targets, GNU ld is compatible enough with the native linker
5790  # that we're better off using the native interface for both.
5791  lt_use_gnu_ld_interface=no
5792  if test "$with_gnu_ld" = yes; then
5793    case $host_os in
5794      aix*)
5795	# The AIX port of GNU ld has always aspired to compatibility
5796	# with the native linker.  However, as the warning in the GNU ld
5797	# block says, versions before 2.19.5* couldn't really create working
5798	# shared libraries, regardless of the interface used.
5799	case `$LD -v 2>&1` in
5800	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5801	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5802	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5803	  *)
5804	    lt_use_gnu_ld_interface=yes
5805	    ;;
5806	esac
5807	;;
5808      *)
5809	lt_use_gnu_ld_interface=yes
5810	;;
5811    esac
5812  fi
5813
5814  if test "$lt_use_gnu_ld_interface" = yes; then
5815    # If archive_cmds runs LD, not CC, wlarc should be empty
5816    wlarc='${wl}'
5817
5818    # Set some defaults for GNU ld with shared library support. These
5819    # are reset later if shared libraries are not supported. Putting them
5820    # here allows them to be overridden if necessary.
5821    runpath_var=LD_RUN_PATH
5822    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5823    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5824    # ancient GNU ld didn't support --whole-archive et. al.
5825    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5826      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5827    else
5828      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5829    fi
5830    supports_anon_versioning=no
5831    case `$LD -v 2>&1` in
5832      *GNU\ gold*) supports_anon_versioning=yes ;;
5833      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5834      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5835      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5836      *\ 2.11.*) ;; # other 2.11 versions
5837      *) supports_anon_versioning=yes ;;
5838    esac
5839
5840    # See if GNU ld supports shared libraries.
5841    case $host_os in
5842    aix[[3-9]]*)
5843      # On AIX/PPC, the GNU linker is very broken
5844      if test "$host_cpu" != ia64; then
5845	_LT_TAGVAR(ld_shlibs, $1)=no
5846	cat <<_LT_EOF 1>&2
5847
5848*** Warning: the GNU linker, at least up to release 2.19, is reported
5849*** to be unable to reliably create shared libraries on AIX.
5850*** Therefore, libtool is disabling shared libraries support.  If you
5851*** really care for shared libraries, you may want to install binutils
5852*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5853*** You will then need to restart the configuration process.
5854
5855_LT_EOF
5856      fi
5857      ;;
5858
5859    amigaos*)
5860      case $host_cpu in
5861      powerpc)
5862            # see comment about AmigaOS4 .so support
5863            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5864            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5865        ;;
5866      m68k)
5867            _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)'
5868            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5869            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5870        ;;
5871      esac
5872      ;;
5873
5874    beos*)
5875      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5876	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5877	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5878	# support --undefined.  This deserves some investigation.  FIXME
5879	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5880      else
5881	_LT_TAGVAR(ld_shlibs, $1)=no
5882      fi
5883      ;;
5884
5885    cygwin* | mingw* | pw32* | cegcc*)
5886      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5887      # as there is no search path for DLLs.
5888      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5889      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5890      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5891      _LT_TAGVAR(always_export_symbols, $1)=no
5892      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5893      _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'
5894      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5895
5896      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5897        _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'
5898	# If the export-symbols file already is a .def file (1st line
5899	# is EXPORTS), use it as is; otherwise, prepend...
5900	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5901	  cp $export_symbols $output_objdir/$soname.def;
5902	else
5903	  echo EXPORTS > $output_objdir/$soname.def;
5904	  cat $export_symbols >> $output_objdir/$soname.def;
5905	fi~
5906	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5907      else
5908	_LT_TAGVAR(ld_shlibs, $1)=no
5909      fi
5910      ;;
5911
5912    haiku*)
5913      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5914      _LT_TAGVAR(link_all_deplibs, $1)=yes
5915      ;;
5916
5917    interix[[3-9]]*)
5918      _LT_TAGVAR(hardcode_direct, $1)=no
5919      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5920      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5921      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5922      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5923      # Instead, shared libraries are loaded at an image base (0x10000000 by
5924      # default) and relocated if they conflict, which is a slow very memory
5925      # consuming and fragmenting process.  To avoid this, we pick a random,
5926      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5927      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5928      _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'
5929      _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'
5930      ;;
5931
5932    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5933      tmp_diet=no
5934      if test "$host_os" = linux-dietlibc; then
5935	case $cc_basename in
5936	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5937	esac
5938      fi
5939      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5940	 && test "$tmp_diet" = no
5941      then
5942	tmp_addflag=' $pic_flag'
5943	tmp_sharedflag='-shared'
5944	case $cc_basename,$host_cpu in
5945        pgcc*)				# Portland Group C compiler
5946	  _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'
5947	  tmp_addflag=' $pic_flag'
5948	  ;;
5949	pgf77* | pgf90* | pgf95* | pgfortran*)
5950					# Portland Group f77 and f90 compilers
5951	  _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'
5952	  tmp_addflag=' $pic_flag -Mnomain' ;;
5953	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5954	  tmp_addflag=' -i_dynamic' ;;
5955	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5956	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5957	ifc* | ifort*)			# Intel Fortran compiler
5958	  tmp_addflag=' -nofor_main' ;;
5959	lf95*)				# Lahey Fortran 8.1
5960	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5961	  tmp_sharedflag='--shared' ;;
5962	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5963	  tmp_sharedflag='-qmkshrobj'
5964	  tmp_addflag= ;;
5965	nvcc*)	# Cuda Compiler Driver 2.2
5966	  _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'
5967	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5968	  ;;
5969	esac
5970	case `$CC -V 2>&1 | sed 5q` in
5971	*Sun\ C*)			# Sun C 5.9
5972	  _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'
5973	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5974	  tmp_sharedflag='-G' ;;
5975	*Sun\ F*)			# Sun Fortran 8.3
5976	  tmp_sharedflag='-G' ;;
5977	esac
5978	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5979
5980        if test "x$supports_anon_versioning" = xyes; then
5981          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5982	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5983	    echo "local: *; };" >> $output_objdir/$libname.ver~
5984	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5985        fi
5986
5987	case $cc_basename in
5988	xlf* | bgf* | bgxlf* | mpixlf*)
5989	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5990	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5991	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5992	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5993	  if test "x$supports_anon_versioning" = xyes; then
5994	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5995	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5996	      echo "local: *; };" >> $output_objdir/$libname.ver~
5997	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5998	  fi
5999	  ;;
6000	esac
6001      else
6002        _LT_TAGVAR(ld_shlibs, $1)=no
6003      fi
6004      ;;
6005
6006    netbsd*)
6007      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6008	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6009	wlarc=
6010      else
6011	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6012	_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'
6013      fi
6014      ;;
6015
6016    solaris*)
6017      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
6018	_LT_TAGVAR(ld_shlibs, $1)=no
6019	cat <<_LT_EOF 1>&2
6020
6021*** Warning: The releases 2.8.* of the GNU linker cannot reliably
6022*** create shared libraries on Solaris systems.  Therefore, libtool
6023*** is disabling shared libraries support.  We urge you to upgrade GNU
6024*** binutils to release 2.9.1 or newer.  Another option is to modify
6025*** your PATH or compiler configuration so that the native linker is
6026*** used, and then restart.
6027
6028_LT_EOF
6029      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6030	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6031	_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'
6032      else
6033	_LT_TAGVAR(ld_shlibs, $1)=no
6034      fi
6035      ;;
6036
6037    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
6038      case `$LD -v 2>&1` in
6039        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
6040	_LT_TAGVAR(ld_shlibs, $1)=no
6041	cat <<_LT_EOF 1>&2
6042
6043*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
6044*** reliably create shared libraries on SCO systems.  Therefore, libtool
6045*** is disabling shared libraries support.  We urge you to upgrade GNU
6046*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
6047*** your PATH or compiler configuration so that the native linker is
6048*** used, and then restart.
6049
6050_LT_EOF
6051	;;
6052	*)
6053	  # For security reasons, it is highly recommended that you always
6054	  # use absolute paths for naming shared libraries, and exclude the
6055	  # DT_RUNPATH tag from executables and libraries.  But doing so
6056	  # requires that you compile everything twice, which is a pain.
6057	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6058	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6059	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6060	    _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'
6061	  else
6062	    _LT_TAGVAR(ld_shlibs, $1)=no
6063	  fi
6064	;;
6065      esac
6066      ;;
6067
6068    sunos4*)
6069      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6070      wlarc=
6071      _LT_TAGVAR(hardcode_direct, $1)=yes
6072      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6073      ;;
6074
6075    *)
6076      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6077	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6078	_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'
6079      else
6080	_LT_TAGVAR(ld_shlibs, $1)=no
6081      fi
6082      ;;
6083    esac
6084
6085    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
6086      runpath_var=
6087      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6088      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6089      _LT_TAGVAR(whole_archive_flag_spec, $1)=
6090    fi
6091  else
6092    # PORTME fill in a description of your system's linker (not GNU ld)
6093    case $host_os in
6094    aix3*)
6095      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6096      _LT_TAGVAR(always_export_symbols, $1)=yes
6097      _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'
6098      # Note: this linker hardcodes the directories in LIBPATH if there
6099      # are no directories specified by -L.
6100      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6101      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6102	# Neither direct hardcoding nor static linking is supported with a
6103	# broken collect2.
6104	_LT_TAGVAR(hardcode_direct, $1)=unsupported
6105      fi
6106      ;;
6107
6108    aix[[4-9]]*)
6109      if test "$host_cpu" = ia64; then
6110	# On IA64, the linker does run time linking by default, so we don't
6111	# have to do anything special.
6112	aix_use_runtimelinking=no
6113	exp_sym_flag='-Bexport'
6114	no_entry_flag=""
6115      else
6116	# If we're using GNU nm, then we don't want the "-C" option.
6117	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6118	# Also, AIX nm treats weak defined symbols like other global
6119	# defined symbols, whereas GNU nm marks them as "W".
6120	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6121	  _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'
6122	else
6123	  _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'
6124	fi
6125	aix_use_runtimelinking=no
6126
6127	# Test if we are trying to use run time linking or normal
6128	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6129	# need to do runtime linking.
6130	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6131	  for ld_flag in $LDFLAGS; do
6132	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6133	    aix_use_runtimelinking=yes
6134	    break
6135	  fi
6136	  done
6137	  ;;
6138	esac
6139
6140	exp_sym_flag='-bexport'
6141	no_entry_flag='-bnoentry'
6142      fi
6143
6144      # When large executables or shared objects are built, AIX ld can
6145      # have problems creating the table of contents.  If linking a library
6146      # or program results in "error TOC overflow" add -mminimal-toc to
6147      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6148      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6149
6150      _LT_TAGVAR(archive_cmds, $1)=''
6151      _LT_TAGVAR(hardcode_direct, $1)=yes
6152      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6153      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6154      _LT_TAGVAR(link_all_deplibs, $1)=yes
6155      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6156
6157      if test "$GCC" = yes; then
6158	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6159	# We only want to do this on AIX 4.2 and lower, the check
6160	# below for broken collect2 doesn't work under 4.3+
6161	  collect2name=`${CC} -print-prog-name=collect2`
6162	  if test -f "$collect2name" &&
6163	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6164	  then
6165	  # We have reworked collect2
6166	  :
6167	  else
6168	  # We have old collect2
6169	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6170	  # It fails to find uninstalled libraries when the uninstalled
6171	  # path is not listed in the libpath.  Setting hardcode_minus_L
6172	  # to unsupported forces relinking
6173	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6174	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6175	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6176	  fi
6177	  ;;
6178	esac
6179	shared_flag='-shared'
6180	if test "$aix_use_runtimelinking" = yes; then
6181	  shared_flag="$shared_flag "'${wl}-G'
6182	fi
6183      else
6184	# not using gcc
6185	if test "$host_cpu" = ia64; then
6186	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6187	# chokes on -Wl,-G. The following line is correct:
6188	  shared_flag='-G'
6189	else
6190	  if test "$aix_use_runtimelinking" = yes; then
6191	    shared_flag='${wl}-G'
6192	  else
6193	    shared_flag='${wl}-bM:SRE'
6194	  fi
6195	fi
6196      fi
6197
6198      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6199      # It seems that -bexpall does not export symbols beginning with
6200      # underscore (_), so it is better to generate a list of symbols to export.
6201      _LT_TAGVAR(always_export_symbols, $1)=yes
6202      if test "$aix_use_runtimelinking" = yes; then
6203	# Warning - without using the other runtime loading flags (-brtl),
6204	# -berok will link without error, but may produce a broken library.
6205	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6206        # Determine the default libpath from the value encoded in an
6207        # empty executable.
6208        _LT_SYS_MODULE_PATH_AIX([$1])
6209        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6210        _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"
6211      else
6212	if test "$host_cpu" = ia64; then
6213	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6214	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6215	  _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"
6216	else
6217	 # Determine the default libpath from the value encoded in an
6218	 # empty executable.
6219	 _LT_SYS_MODULE_PATH_AIX([$1])
6220	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6221	  # Warning - without using the other run time loading flags,
6222	  # -berok will link without error, but may produce a broken library.
6223	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6224	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6225	  if test "$with_gnu_ld" = yes; then
6226	    # We only use this code for GNU lds that support --whole-archive.
6227	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6228	  else
6229	    # Exported symbols can be pulled into shared objects from archives
6230	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6231	  fi
6232	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6233	  # This is similar to how AIX traditionally builds its shared libraries.
6234	  _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'
6235	fi
6236      fi
6237      ;;
6238
6239    amigaos*)
6240      case $host_cpu in
6241      powerpc)
6242            # see comment about AmigaOS4 .so support
6243            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6244            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6245        ;;
6246      m68k)
6247            _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)'
6248            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6249            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6250        ;;
6251      esac
6252      ;;
6253
6254    bsdi[[45]]*)
6255      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6256      ;;
6257
6258    cygwin* | mingw* | pw32* | cegcc*)
6259      # When not using gcc, we currently assume that we are using
6260      # Microsoft Visual C++.
6261      # hardcode_libdir_flag_spec is actually meaningless, as there is
6262      # no search path for DLLs.
6263      case $cc_basename in
6264      cl*)
6265	# Native MSVC
6266	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6267	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6268	_LT_TAGVAR(always_export_symbols, $1)=yes
6269	_LT_TAGVAR(file_list_spec, $1)='@'
6270	# Tell ltmain to make .lib files, not .a files.
6271	libext=lib
6272	# Tell ltmain to make .dll files, not .so files.
6273	shrext_cmds=".dll"
6274	# FIXME: Setting linknames here is a bad hack.
6275	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6276	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6277	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6278	  else
6279	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6280	  fi~
6281	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6282	  linknames='
6283	# The linker will not automatically build a static lib if we build a DLL.
6284	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6285	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6286	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6287	_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'
6288	# Don't use ranlib
6289	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6290	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6291	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6292	  case $lt_outputfile in
6293	    *.exe|*.EXE) ;;
6294	    *)
6295	      lt_outputfile="$lt_outputfile.exe"
6296	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6297	      ;;
6298	  esac~
6299	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6300	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6301	    $RM "$lt_outputfile.manifest";
6302	  fi'
6303	;;
6304      *)
6305	# Assume MSVC wrapper
6306	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6307	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6308	# Tell ltmain to make .lib files, not .a files.
6309	libext=lib
6310	# Tell ltmain to make .dll files, not .so files.
6311	shrext_cmds=".dll"
6312	# FIXME: Setting linknames here is a bad hack.
6313	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6314	# The linker will automatically build a .lib file if we build a DLL.
6315	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6316	# FIXME: Should let the user specify the lib program.
6317	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6318	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6319	;;
6320      esac
6321      ;;
6322
6323    darwin* | rhapsody*)
6324      _LT_DARWIN_LINKER_FEATURES($1)
6325      ;;
6326
6327    dgux*)
6328      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6329      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6330      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6331      ;;
6332
6333    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6334    # support.  Future versions do this automatically, but an explicit c++rt0.o
6335    # does not break anything, and helps significantly (at the cost of a little
6336    # extra space).
6337    freebsd2.2*)
6338      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6339      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6340      _LT_TAGVAR(hardcode_direct, $1)=yes
6341      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6342      ;;
6343
6344    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6345    freebsd2.*)
6346      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6347      _LT_TAGVAR(hardcode_direct, $1)=yes
6348      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6349      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6350      ;;
6351
6352    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6353    freebsd* | dragonfly*)
6354      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6355      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6356      _LT_TAGVAR(hardcode_direct, $1)=yes
6357      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6358      ;;
6359
6360    hpux9*)
6361      if test "$GCC" = yes; then
6362	_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'
6363      else
6364	_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'
6365      fi
6366      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6367      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6368      _LT_TAGVAR(hardcode_direct, $1)=yes
6369
6370      # hardcode_minus_L: Not really in the search PATH,
6371      # but as the default location of the library.
6372      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6373      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6374      ;;
6375
6376    hpux10*)
6377      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6378	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6379      else
6380	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6381      fi
6382      if test "$with_gnu_ld" = no; then
6383	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6384	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6385	_LT_TAGVAR(hardcode_direct, $1)=yes
6386	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6387	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6388	# hardcode_minus_L: Not really in the search PATH,
6389	# but as the default location of the library.
6390	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6391      fi
6392      ;;
6393
6394    hpux11*)
6395      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6396	case $host_cpu in
6397	hppa*64*)
6398	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6399	  ;;
6400	ia64*)
6401	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6402	  ;;
6403	*)
6404	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6405	  ;;
6406	esac
6407      else
6408	case $host_cpu in
6409	hppa*64*)
6410	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6411	  ;;
6412	ia64*)
6413	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6414	  ;;
6415	*)
6416	m4_if($1, [], [
6417	  # Older versions of the 11.00 compiler do not understand -b yet
6418	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6419	  _LT_LINKER_OPTION([if $CC understands -b],
6420	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6421	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6422	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6423	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6424	  ;;
6425	esac
6426      fi
6427      if test "$with_gnu_ld" = no; then
6428	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6429	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6430
6431	case $host_cpu in
6432	hppa*64*|ia64*)
6433	  _LT_TAGVAR(hardcode_direct, $1)=no
6434	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6435	  ;;
6436	*)
6437	  _LT_TAGVAR(hardcode_direct, $1)=yes
6438	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6439	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6440
6441	  # hardcode_minus_L: Not really in the search PATH,
6442	  # but as the default location of the library.
6443	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6444	  ;;
6445	esac
6446      fi
6447      ;;
6448
6449    irix5* | irix6* | nonstopux*)
6450      if test "$GCC" = yes; then
6451	_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'
6452	# Try to use the -exported_symbol ld option, if it does not
6453	# work, assume that -exports_file does not work either and
6454	# implicitly export all symbols.
6455	# This should be the same for all languages, so no per-tag cache variable.
6456	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6457	  [lt_cv_irix_exported_symbol],
6458	  [save_LDFLAGS="$LDFLAGS"
6459	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6460	   AC_LINK_IFELSE(
6461	     [AC_LANG_SOURCE(
6462	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6463			      [C++], [[int foo (void) { return 0; }]],
6464			      [Fortran 77], [[
6465      subroutine foo
6466      end]],
6467			      [Fortran], [[
6468      subroutine foo
6469      end]])])],
6470	      [lt_cv_irix_exported_symbol=yes],
6471	      [lt_cv_irix_exported_symbol=no])
6472           LDFLAGS="$save_LDFLAGS"])
6473	if test "$lt_cv_irix_exported_symbol" = yes; then
6474          _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'
6475	fi
6476      else
6477	_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'
6478	_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'
6479      fi
6480      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6481      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6482      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6483      _LT_TAGVAR(inherit_rpath, $1)=yes
6484      _LT_TAGVAR(link_all_deplibs, $1)=yes
6485      ;;
6486
6487    netbsd*)
6488      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6489	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6490      else
6491	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6492      fi
6493      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6494      _LT_TAGVAR(hardcode_direct, $1)=yes
6495      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6496      ;;
6497
6498    newsos6)
6499      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6500      _LT_TAGVAR(hardcode_direct, $1)=yes
6501      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6502      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6503      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6504      ;;
6505
6506    *nto* | *qnx*)
6507      ;;
6508
6509    openbsd*)
6510      if test -f /usr/libexec/ld.so; then
6511	_LT_TAGVAR(hardcode_direct, $1)=yes
6512	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6513	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6514	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6515	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6516	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6517	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6518	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6519	else
6520	  case $host_os in
6521	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6522	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6523	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6524	     ;;
6525	   *)
6526	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6527	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6528	     ;;
6529	  esac
6530	fi
6531      else
6532	_LT_TAGVAR(ld_shlibs, $1)=no
6533      fi
6534      ;;
6535
6536    os2*)
6537      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6538      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6539      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6540      _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'
6541      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6542      ;;
6543
6544    osf3*)
6545      if test "$GCC" = yes; then
6546	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6547	_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'
6548      else
6549	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6550	_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'
6551      fi
6552      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6553      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6554      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6555      ;;
6556
6557    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6558      if test "$GCC" = yes; then
6559	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6560	_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'
6561	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6562      else
6563	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6564	_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'
6565	_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~
6566	$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'
6567
6568	# Both c and cxx compiler support -rpath directly
6569	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6570      fi
6571      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6572      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6573      ;;
6574
6575    solaris*)
6576      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6577      if test "$GCC" = yes; then
6578	wlarc='${wl}'
6579	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6580	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6581	  $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'
6582      else
6583	case `$CC -V 2>&1` in
6584	*"Compilers 5.0"*)
6585	  wlarc=''
6586	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6587	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6588	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6589	  ;;
6590	*)
6591	  wlarc='${wl}'
6592	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6593	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6594	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6595	  ;;
6596	esac
6597      fi
6598      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6599      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6600      case $host_os in
6601      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6602      *)
6603	# The compiler driver will combine and reorder linker options,
6604	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6605	# but is careful enough not to reorder.
6606	# Supported since Solaris 2.6 (maybe 2.5.1?)
6607	if test "$GCC" = yes; then
6608	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6609	else
6610	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6611	fi
6612	;;
6613      esac
6614      _LT_TAGVAR(link_all_deplibs, $1)=yes
6615      ;;
6616
6617    sunos4*)
6618      if test "x$host_vendor" = xsequent; then
6619	# Use $CC to link under sequent, because it throws in some extra .o
6620	# files that make .init and .fini sections work.
6621	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6622      else
6623	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6624      fi
6625      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6626      _LT_TAGVAR(hardcode_direct, $1)=yes
6627      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6628      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6629      ;;
6630
6631    sysv4)
6632      case $host_vendor in
6633	sni)
6634	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6635	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6636	;;
6637	siemens)
6638	  ## LD is ld it makes a PLAMLIB
6639	  ## CC just makes a GrossModule.
6640	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6641	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6642	  _LT_TAGVAR(hardcode_direct, $1)=no
6643        ;;
6644	motorola)
6645	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6646	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6647	;;
6648      esac
6649      runpath_var='LD_RUN_PATH'
6650      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6651      ;;
6652
6653    sysv4.3*)
6654      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6655      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6656      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6657      ;;
6658
6659    sysv4*MP*)
6660      if test -d /usr/nec; then
6661	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6662	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6663	runpath_var=LD_RUN_PATH
6664	hardcode_runpath_var=yes
6665	_LT_TAGVAR(ld_shlibs, $1)=yes
6666      fi
6667      ;;
6668
6669    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6670      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6671      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6672      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6673      runpath_var='LD_RUN_PATH'
6674
6675      if test "$GCC" = yes; then
6676	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6677	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6678      else
6679	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6680	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6681      fi
6682      ;;
6683
6684    sysv5* | sco3.2v5* | sco5v6*)
6685      # Note: We can NOT use -z defs as we might desire, because we do not
6686      # link with -lc, and that would cause any symbols used from libc to
6687      # always be unresolved, which means just about no library would
6688      # ever link correctly.  If we're not using GNU ld we use -z text
6689      # though, which does catch some bad symbols but isn't as heavy-handed
6690      # as -z defs.
6691      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6692      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6693      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6694      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6695      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6696      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6697      _LT_TAGVAR(link_all_deplibs, $1)=yes
6698      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6699      runpath_var='LD_RUN_PATH'
6700
6701      if test "$GCC" = yes; then
6702	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6703	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6704      else
6705	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6706	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6707      fi
6708      ;;
6709
6710    uts4*)
6711      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6712      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6713      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6714      ;;
6715
6716    *)
6717      _LT_TAGVAR(ld_shlibs, $1)=no
6718      ;;
6719    esac
6720
6721    if test x$host_vendor = xsni; then
6722      case $host in
6723      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6724	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6725	;;
6726      esac
6727    fi
6728  fi
6729])
6730AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6731test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6732
6733_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6734
6735_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6736_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6737_LT_DECL([], [extract_expsyms_cmds], [2],
6738    [The commands to extract the exported symbol list from a shared archive])
6739
6740#
6741# Do we need to explicitly link libc?
6742#
6743case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6744x|xyes)
6745  # Assume -lc should be added
6746  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6747
6748  if test "$enable_shared" = yes && test "$GCC" = yes; then
6749    case $_LT_TAGVAR(archive_cmds, $1) in
6750    *'~'*)
6751      # FIXME: we may have to deal with multi-command sequences.
6752      ;;
6753    '$CC '*)
6754      # Test whether the compiler implicitly links with -lc since on some
6755      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6756      # to ld, don't add -lc before -lgcc.
6757      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6758	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6759	[$RM conftest*
6760	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6761
6762	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6763	  soname=conftest
6764	  lib=conftest
6765	  libobjs=conftest.$ac_objext
6766	  deplibs=
6767	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6768	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6769	  compiler_flags=-v
6770	  linker_flags=-v
6771	  verstring=
6772	  output_objdir=.
6773	  libname=conftest
6774	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6775	  _LT_TAGVAR(allow_undefined_flag, $1)=
6776	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6777	  then
6778	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6779	  else
6780	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6781	  fi
6782	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6783	else
6784	  cat conftest.err 1>&5
6785	fi
6786	$RM conftest*
6787	])
6788      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6789      ;;
6790    esac
6791  fi
6792  ;;
6793esac
6794
6795_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6796    [Whether or not to add -lc for building shared libraries])
6797_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6798    [enable_shared_with_static_runtimes], [0],
6799    [Whether or not to disallow shared libs when runtime libs are static])
6800_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6801    [Compiler flag to allow reflexive dlopens])
6802_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6803    [Compiler flag to generate shared objects directly from archives])
6804_LT_TAGDECL([], [compiler_needs_object], [1],
6805    [Whether the compiler copes with passing no objects directly])
6806_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6807    [Create an old-style archive from a shared archive])
6808_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6809    [Create a temporary old-style archive to link instead of a shared archive])
6810_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6811_LT_TAGDECL([], [archive_expsym_cmds], [2])
6812_LT_TAGDECL([], [module_cmds], [2],
6813    [Commands used to build a loadable module if different from building
6814    a shared archive.])
6815_LT_TAGDECL([], [module_expsym_cmds], [2])
6816_LT_TAGDECL([], [with_gnu_ld], [1],
6817    [Whether we are building with GNU ld or not])
6818_LT_TAGDECL([], [allow_undefined_flag], [1],
6819    [Flag that allows shared libraries with undefined symbols to be built])
6820_LT_TAGDECL([], [no_undefined_flag], [1],
6821    [Flag that enforces no undefined symbols])
6822_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6823    [Flag to hardcode $libdir into a binary during linking.
6824    This must work even if $libdir does not exist])
6825_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6826    [Whether we need a single "-rpath" flag with a separated argument])
6827_LT_TAGDECL([], [hardcode_direct], [0],
6828    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6829    DIR into the resulting binary])
6830_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6831    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6832    DIR into the resulting binary and the resulting library dependency is
6833    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6834    library is relocated])
6835_LT_TAGDECL([], [hardcode_minus_L], [0],
6836    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6837    into the resulting binary])
6838_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6839    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6840    into the resulting binary])
6841_LT_TAGDECL([], [hardcode_automatic], [0],
6842    [Set to "yes" if building a shared library automatically hardcodes DIR
6843    into the library and all subsequent libraries and executables linked
6844    against it])
6845_LT_TAGDECL([], [inherit_rpath], [0],
6846    [Set to yes if linker adds runtime paths of dependent libraries
6847    to runtime path list])
6848_LT_TAGDECL([], [link_all_deplibs], [0],
6849    [Whether libtool must link a program against all its dependency libraries])
6850_LT_TAGDECL([], [always_export_symbols], [0],
6851    [Set to "yes" if exported symbols are required])
6852_LT_TAGDECL([], [export_symbols_cmds], [2],
6853    [The commands to list exported symbols])
6854_LT_TAGDECL([], [exclude_expsyms], [1],
6855    [Symbols that should not be listed in the preloaded symbols])
6856_LT_TAGDECL([], [include_expsyms], [1],
6857    [Symbols that must always be exported])
6858_LT_TAGDECL([], [prelink_cmds], [2],
6859    [Commands necessary for linking programs (against libraries) with templates])
6860_LT_TAGDECL([], [postlink_cmds], [2],
6861    [Commands necessary for finishing linking programs])
6862_LT_TAGDECL([], [file_list_spec], [1],
6863    [Specify filename containing input files])
6864dnl FIXME: Not yet implemented
6865dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6866dnl    [Compiler flag to generate thread safe objects])
6867])# _LT_LINKER_SHLIBS
6868
6869
6870# _LT_LANG_C_CONFIG([TAG])
6871# ------------------------
6872# Ensure that the configuration variables for a C compiler are suitably
6873# defined.  These variables are subsequently used by _LT_CONFIG to write
6874# the compiler configuration to `libtool'.
6875m4_defun([_LT_LANG_C_CONFIG],
6876[m4_require([_LT_DECL_EGREP])dnl
6877lt_save_CC="$CC"
6878AC_LANG_PUSH(C)
6879
6880# Source file extension for C test sources.
6881ac_ext=c
6882
6883# Object file extension for compiled C test sources.
6884objext=o
6885_LT_TAGVAR(objext, $1)=$objext
6886
6887# Code to be used in simple compile tests
6888lt_simple_compile_test_code="int some_variable = 0;"
6889
6890# Code to be used in simple link tests
6891lt_simple_link_test_code='int main(){return(0);}'
6892
6893_LT_TAG_COMPILER
6894# Save the default compiler, since it gets overwritten when the other
6895# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6896compiler_DEFAULT=$CC
6897
6898# save warnings/boilerplate of simple test code
6899_LT_COMPILER_BOILERPLATE
6900_LT_LINKER_BOILERPLATE
6901
6902if test -n "$compiler"; then
6903  _LT_COMPILER_NO_RTTI($1)
6904  _LT_COMPILER_PIC($1)
6905  _LT_COMPILER_C_O($1)
6906  _LT_COMPILER_FILE_LOCKS($1)
6907  _LT_LINKER_SHLIBS($1)
6908  _LT_SYS_DYNAMIC_LINKER($1)
6909  _LT_LINKER_HARDCODE_LIBPATH($1)
6910  LT_SYS_DLOPEN_SELF
6911  _LT_CMD_STRIPLIB
6912
6913  # Report which library types will actually be built
6914  AC_MSG_CHECKING([if libtool supports shared libraries])
6915  AC_MSG_RESULT([$can_build_shared])
6916
6917  AC_MSG_CHECKING([whether to build shared libraries])
6918  test "$can_build_shared" = "no" && enable_shared=no
6919
6920  # On AIX, shared libraries and static libraries use the same namespace, and
6921  # are all built from PIC.
6922  case $host_os in
6923  aix3*)
6924    test "$enable_shared" = yes && enable_static=no
6925    if test -n "$RANLIB"; then
6926      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6927      postinstall_cmds='$RANLIB $lib'
6928    fi
6929    ;;
6930
6931  aix[[4-9]]*)
6932    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6933      test "$enable_shared" = yes && enable_static=no
6934    fi
6935    ;;
6936  esac
6937  AC_MSG_RESULT([$enable_shared])
6938
6939  AC_MSG_CHECKING([whether to build static libraries])
6940  # Make sure either enable_shared or enable_static is yes.
6941  test "$enable_shared" = yes || enable_static=yes
6942  AC_MSG_RESULT([$enable_static])
6943
6944  _LT_CONFIG($1)
6945fi
6946AC_LANG_POP
6947CC="$lt_save_CC"
6948])# _LT_LANG_C_CONFIG
6949
6950
6951# _LT_LANG_CXX_CONFIG([TAG])
6952# --------------------------
6953# Ensure that the configuration variables for a C++ compiler are suitably
6954# defined.  These variables are subsequently used by _LT_CONFIG to write
6955# the compiler configuration to `libtool'.
6956m4_defun([_LT_LANG_CXX_CONFIG],
6957[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6958m4_require([_LT_DECL_EGREP])dnl
6959m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6960if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6961    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6962    (test "X$CXX" != "Xg++"))) ; then
6963  AC_PROG_CXXCPP
6964else
6965  _lt_caught_CXX_error=yes
6966fi
6967
6968AC_LANG_PUSH(C++)
6969_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6970_LT_TAGVAR(allow_undefined_flag, $1)=
6971_LT_TAGVAR(always_export_symbols, $1)=no
6972_LT_TAGVAR(archive_expsym_cmds, $1)=
6973_LT_TAGVAR(compiler_needs_object, $1)=no
6974_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6975_LT_TAGVAR(hardcode_direct, $1)=no
6976_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6977_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6978_LT_TAGVAR(hardcode_libdir_separator, $1)=
6979_LT_TAGVAR(hardcode_minus_L, $1)=no
6980_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6981_LT_TAGVAR(hardcode_automatic, $1)=no
6982_LT_TAGVAR(inherit_rpath, $1)=no
6983_LT_TAGVAR(module_cmds, $1)=
6984_LT_TAGVAR(module_expsym_cmds, $1)=
6985_LT_TAGVAR(link_all_deplibs, $1)=unknown
6986_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6987_LT_TAGVAR(reload_flag, $1)=$reload_flag
6988_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6989_LT_TAGVAR(no_undefined_flag, $1)=
6990_LT_TAGVAR(whole_archive_flag_spec, $1)=
6991_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6992
6993# Source file extension for C++ test sources.
6994ac_ext=cpp
6995
6996# Object file extension for compiled C++ test sources.
6997objext=o
6998_LT_TAGVAR(objext, $1)=$objext
6999
7000# No sense in running all these tests if we already determined that
7001# the CXX compiler isn't working.  Some variables (like enable_shared)
7002# are currently assumed to apply to all compilers on this platform,
7003# and will be corrupted by setting them based on a non-working compiler.
7004if test "$_lt_caught_CXX_error" != yes; then
7005  # Code to be used in simple compile tests
7006  lt_simple_compile_test_code="int some_variable = 0;"
7007
7008  # Code to be used in simple link tests
7009  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
7010
7011  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7012  _LT_TAG_COMPILER
7013
7014  # save warnings/boilerplate of simple test code
7015  _LT_COMPILER_BOILERPLATE
7016  _LT_LINKER_BOILERPLATE
7017
7018  # Allow CC to be a program name with arguments.
7019  lt_save_CC=$CC
7020  lt_save_CFLAGS=$CFLAGS
7021  lt_save_LD=$LD
7022  lt_save_GCC=$GCC
7023  GCC=$GXX
7024  lt_save_with_gnu_ld=$with_gnu_ld
7025  lt_save_path_LD=$lt_cv_path_LD
7026  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
7027    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
7028  else
7029    $as_unset lt_cv_prog_gnu_ld
7030  fi
7031  if test -n "${lt_cv_path_LDCXX+set}"; then
7032    lt_cv_path_LD=$lt_cv_path_LDCXX
7033  else
7034    $as_unset lt_cv_path_LD
7035  fi
7036  test -z "${LDCXX+set}" || LD=$LDCXX
7037  CC=${CXX-"c++"}
7038  CFLAGS=$CXXFLAGS
7039  compiler=$CC
7040  _LT_TAGVAR(compiler, $1)=$CC
7041  _LT_CC_BASENAME([$compiler])
7042
7043  if test -n "$compiler"; then
7044    # We don't want -fno-exception when compiling C++ code, so set the
7045    # no_builtin_flag separately
7046    if test "$GXX" = yes; then
7047      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7048    else
7049      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7050    fi
7051
7052    if test "$GXX" = yes; then
7053      # Set up default GNU C++ configuration
7054
7055      LT_PATH_LD
7056
7057      # Check if GNU C++ uses GNU ld as the underlying linker, since the
7058      # archiving commands below assume that GNU ld is being used.
7059      if test "$with_gnu_ld" = yes; then
7060        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7061        _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'
7062
7063        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7064        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7065
7066        # If archive_cmds runs LD, not CC, wlarc should be empty
7067        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
7068        #     investigate it a little bit more. (MM)
7069        wlarc='${wl}'
7070
7071        # ancient GNU ld didn't support --whole-archive et. al.
7072        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
7073	  $GREP 'no-whole-archive' > /dev/null; then
7074          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7075        else
7076          _LT_TAGVAR(whole_archive_flag_spec, $1)=
7077        fi
7078      else
7079        with_gnu_ld=no
7080        wlarc=
7081
7082        # A generic and very simple default shared library creation
7083        # command for GNU C++ for the case where it uses the native
7084        # linker, instead of GNU ld.  If possible, this setting should
7085        # overridden to take advantage of the native linker features on
7086        # the platform it is being used on.
7087        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7088      fi
7089
7090      # Commands to make compiler produce verbose output that lists
7091      # what "hidden" libraries, object files and flags are used when
7092      # linking a shared library.
7093      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7094
7095    else
7096      GXX=no
7097      with_gnu_ld=no
7098      wlarc=
7099    fi
7100
7101    # PORTME: fill in a description of your system's C++ link characteristics
7102    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7103    _LT_TAGVAR(ld_shlibs, $1)=yes
7104    case $host_os in
7105      aix3*)
7106        # FIXME: insert proper C++ library support
7107        _LT_TAGVAR(ld_shlibs, $1)=no
7108        ;;
7109      aix[[4-9]]*)
7110        if test "$host_cpu" = ia64; then
7111          # On IA64, the linker does run time linking by default, so we don't
7112          # have to do anything special.
7113          aix_use_runtimelinking=no
7114          exp_sym_flag='-Bexport'
7115          no_entry_flag=""
7116        else
7117          aix_use_runtimelinking=no
7118
7119          # Test if we are trying to use run time linking or normal
7120          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7121          # need to do runtime linking.
7122          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7123	    for ld_flag in $LDFLAGS; do
7124	      case $ld_flag in
7125	      *-brtl*)
7126	        aix_use_runtimelinking=yes
7127	        break
7128	        ;;
7129	      esac
7130	    done
7131	    ;;
7132          esac
7133
7134          exp_sym_flag='-bexport'
7135          no_entry_flag='-bnoentry'
7136        fi
7137
7138        # When large executables or shared objects are built, AIX ld can
7139        # have problems creating the table of contents.  If linking a library
7140        # or program results in "error TOC overflow" add -mminimal-toc to
7141        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7142        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7143
7144        _LT_TAGVAR(archive_cmds, $1)=''
7145        _LT_TAGVAR(hardcode_direct, $1)=yes
7146        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7147        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7148        _LT_TAGVAR(link_all_deplibs, $1)=yes
7149        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7150
7151        if test "$GXX" = yes; then
7152          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7153          # We only want to do this on AIX 4.2 and lower, the check
7154          # below for broken collect2 doesn't work under 4.3+
7155	  collect2name=`${CC} -print-prog-name=collect2`
7156	  if test -f "$collect2name" &&
7157	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7158	  then
7159	    # We have reworked collect2
7160	    :
7161	  else
7162	    # We have old collect2
7163	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7164	    # It fails to find uninstalled libraries when the uninstalled
7165	    # path is not listed in the libpath.  Setting hardcode_minus_L
7166	    # to unsupported forces relinking
7167	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7168	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7169	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7170	  fi
7171          esac
7172          shared_flag='-shared'
7173	  if test "$aix_use_runtimelinking" = yes; then
7174	    shared_flag="$shared_flag "'${wl}-G'
7175	  fi
7176        else
7177          # not using gcc
7178          if test "$host_cpu" = ia64; then
7179	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7180	  # chokes on -Wl,-G. The following line is correct:
7181	  shared_flag='-G'
7182          else
7183	    if test "$aix_use_runtimelinking" = yes; then
7184	      shared_flag='${wl}-G'
7185	    else
7186	      shared_flag='${wl}-bM:SRE'
7187	    fi
7188          fi
7189        fi
7190
7191        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7192        # It seems that -bexpall does not export symbols beginning with
7193        # underscore (_), so it is better to generate a list of symbols to
7194	# export.
7195        _LT_TAGVAR(always_export_symbols, $1)=yes
7196        if test "$aix_use_runtimelinking" = yes; then
7197          # Warning - without using the other runtime loading flags (-brtl),
7198          # -berok will link without error, but may produce a broken library.
7199          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7200          # Determine the default libpath from the value encoded in an empty
7201          # executable.
7202          _LT_SYS_MODULE_PATH_AIX([$1])
7203          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7204
7205          _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"
7206        else
7207          if test "$host_cpu" = ia64; then
7208	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7209	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7210	    _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"
7211          else
7212	    # Determine the default libpath from the value encoded in an
7213	    # empty executable.
7214	    _LT_SYS_MODULE_PATH_AIX([$1])
7215	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7216	    # Warning - without using the other run time loading flags,
7217	    # -berok will link without error, but may produce a broken library.
7218	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7219	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7220	    if test "$with_gnu_ld" = yes; then
7221	      # We only use this code for GNU lds that support --whole-archive.
7222	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7223	    else
7224	      # Exported symbols can be pulled into shared objects from archives
7225	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7226	    fi
7227	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7228	    # This is similar to how AIX traditionally builds its shared
7229	    # libraries.
7230	    _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'
7231          fi
7232        fi
7233        ;;
7234
7235      beos*)
7236	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7237	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7238	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7239	  # support --undefined.  This deserves some investigation.  FIXME
7240	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7241	else
7242	  _LT_TAGVAR(ld_shlibs, $1)=no
7243	fi
7244	;;
7245
7246      chorus*)
7247        case $cc_basename in
7248          *)
7249	  # FIXME: insert proper C++ library support
7250	  _LT_TAGVAR(ld_shlibs, $1)=no
7251	  ;;
7252        esac
7253        ;;
7254
7255      cygwin* | mingw* | pw32* | cegcc*)
7256	case $GXX,$cc_basename in
7257	,cl* | no,cl*)
7258	  # Native MSVC
7259	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7260	  # no search path for DLLs.
7261	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7262	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7263	  _LT_TAGVAR(always_export_symbols, $1)=yes
7264	  _LT_TAGVAR(file_list_spec, $1)='@'
7265	  # Tell ltmain to make .lib files, not .a files.
7266	  libext=lib
7267	  # Tell ltmain to make .dll files, not .so files.
7268	  shrext_cmds=".dll"
7269	  # FIXME: Setting linknames here is a bad hack.
7270	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7271	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7272	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7273	    else
7274	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7275	    fi~
7276	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7277	    linknames='
7278	  # The linker will not automatically build a static lib if we build a DLL.
7279	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7280	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7281	  # Don't use ranlib
7282	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7283	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7284	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7285	    case $lt_outputfile in
7286	      *.exe|*.EXE) ;;
7287	      *)
7288		lt_outputfile="$lt_outputfile.exe"
7289		lt_tool_outputfile="$lt_tool_outputfile.exe"
7290		;;
7291	    esac~
7292	    func_to_tool_file "$lt_outputfile"~
7293	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7294	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7295	      $RM "$lt_outputfile.manifest";
7296	    fi'
7297	  ;;
7298	*)
7299	  # g++
7300	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7301	  # as there is no search path for DLLs.
7302	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7303	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7304	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7305	  _LT_TAGVAR(always_export_symbols, $1)=no
7306	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7307
7308	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7309	    _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'
7310	    # If the export-symbols file already is a .def file (1st line
7311	    # is EXPORTS), use it as is; otherwise, prepend...
7312	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7313	      cp $export_symbols $output_objdir/$soname.def;
7314	    else
7315	      echo EXPORTS > $output_objdir/$soname.def;
7316	      cat $export_symbols >> $output_objdir/$soname.def;
7317	    fi~
7318	    $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'
7319	  else
7320	    _LT_TAGVAR(ld_shlibs, $1)=no
7321	  fi
7322	  ;;
7323	esac
7324	;;
7325      darwin* | rhapsody*)
7326        _LT_DARWIN_LINKER_FEATURES($1)
7327	;;
7328
7329      dgux*)
7330        case $cc_basename in
7331          ec++*)
7332	    # FIXME: insert proper C++ library support
7333	    _LT_TAGVAR(ld_shlibs, $1)=no
7334	    ;;
7335          ghcx*)
7336	    # Green Hills C++ Compiler
7337	    # FIXME: insert proper C++ library support
7338	    _LT_TAGVAR(ld_shlibs, $1)=no
7339	    ;;
7340          *)
7341	    # FIXME: insert proper C++ library support
7342	    _LT_TAGVAR(ld_shlibs, $1)=no
7343	    ;;
7344        esac
7345        ;;
7346
7347      freebsd2.*)
7348        # C++ shared libraries reported to be fairly broken before
7349	# switch to ELF
7350        _LT_TAGVAR(ld_shlibs, $1)=no
7351        ;;
7352
7353      freebsd-elf*)
7354        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7355        ;;
7356
7357      freebsd* | dragonfly*)
7358        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7359        # conventions
7360        _LT_TAGVAR(ld_shlibs, $1)=yes
7361        ;;
7362
7363      gnu*)
7364        ;;
7365
7366      haiku*)
7367        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7368        _LT_TAGVAR(link_all_deplibs, $1)=yes
7369        ;;
7370
7371      hpux9*)
7372        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7373        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7374        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7375        _LT_TAGVAR(hardcode_direct, $1)=yes
7376        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7377				             # but as the default
7378				             # location of the library.
7379
7380        case $cc_basename in
7381          CC*)
7382            # FIXME: insert proper C++ library support
7383            _LT_TAGVAR(ld_shlibs, $1)=no
7384            ;;
7385          aCC*)
7386            _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'
7387            # Commands to make compiler produce verbose output that lists
7388            # what "hidden" libraries, object files and flags are used when
7389            # linking a shared library.
7390            #
7391            # There doesn't appear to be a way to prevent this compiler from
7392            # explicitly linking system object files so we need to strip them
7393            # from the output so that they don't get included in the library
7394            # dependencies.
7395            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"'
7396            ;;
7397          *)
7398            if test "$GXX" = yes; then
7399              _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'
7400            else
7401              # FIXME: insert proper C++ library support
7402              _LT_TAGVAR(ld_shlibs, $1)=no
7403            fi
7404            ;;
7405        esac
7406        ;;
7407
7408      hpux10*|hpux11*)
7409        if test $with_gnu_ld = no; then
7410	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7411	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7412
7413          case $host_cpu in
7414            hppa*64*|ia64*)
7415              ;;
7416            *)
7417	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7418              ;;
7419          esac
7420        fi
7421        case $host_cpu in
7422          hppa*64*|ia64*)
7423            _LT_TAGVAR(hardcode_direct, $1)=no
7424            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7425            ;;
7426          *)
7427            _LT_TAGVAR(hardcode_direct, $1)=yes
7428            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7429            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7430					         # but as the default
7431					         # location of the library.
7432            ;;
7433        esac
7434
7435        case $cc_basename in
7436          CC*)
7437	    # FIXME: insert proper C++ library support
7438	    _LT_TAGVAR(ld_shlibs, $1)=no
7439	    ;;
7440          aCC*)
7441	    case $host_cpu in
7442	      hppa*64*)
7443	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7444	        ;;
7445	      ia64*)
7446	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7447	        ;;
7448	      *)
7449	        _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'
7450	        ;;
7451	    esac
7452	    # Commands to make compiler produce verbose output that lists
7453	    # what "hidden" libraries, object files and flags are used when
7454	    # linking a shared library.
7455	    #
7456	    # There doesn't appear to be a way to prevent this compiler from
7457	    # explicitly linking system object files so we need to strip them
7458	    # from the output so that they don't get included in the library
7459	    # dependencies.
7460	    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"'
7461	    ;;
7462          *)
7463	    if test "$GXX" = yes; then
7464	      if test $with_gnu_ld = no; then
7465	        case $host_cpu in
7466	          hppa*64*)
7467	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7468	            ;;
7469	          ia64*)
7470	            _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'
7471	            ;;
7472	          *)
7473	            _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'
7474	            ;;
7475	        esac
7476	      fi
7477	    else
7478	      # FIXME: insert proper C++ library support
7479	      _LT_TAGVAR(ld_shlibs, $1)=no
7480	    fi
7481	    ;;
7482        esac
7483        ;;
7484
7485      interix[[3-9]]*)
7486	_LT_TAGVAR(hardcode_direct, $1)=no
7487	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7488	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7489	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7490	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7491	# Instead, shared libraries are loaded at an image base (0x10000000 by
7492	# default) and relocated if they conflict, which is a slow very memory
7493	# consuming and fragmenting process.  To avoid this, we pick a random,
7494	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7495	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7496	_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'
7497	_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'
7498	;;
7499      irix5* | irix6*)
7500        case $cc_basename in
7501          CC*)
7502	    # SGI C++
7503	    _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'
7504
7505	    # Archives containing C++ object files must be created using
7506	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7507	    # necessary to make sure instantiated templates are included
7508	    # in the archive.
7509	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7510	    ;;
7511          *)
7512	    if test "$GXX" = yes; then
7513	      if test "$with_gnu_ld" = no; then
7514	        _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'
7515	      else
7516	        _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'
7517	      fi
7518	    fi
7519	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7520	    ;;
7521        esac
7522        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7523        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7524        _LT_TAGVAR(inherit_rpath, $1)=yes
7525        ;;
7526
7527      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7528        case $cc_basename in
7529          KCC*)
7530	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7531
7532	    # KCC will only create a shared library if the output file
7533	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7534	    # to its proper name (with version) after linking.
7535	    _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'
7536	    _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'
7537	    # Commands to make compiler produce verbose output that lists
7538	    # what "hidden" libraries, object files and flags are used when
7539	    # linking a shared library.
7540	    #
7541	    # There doesn't appear to be a way to prevent this compiler from
7542	    # explicitly linking system object files so we need to strip them
7543	    # from the output so that they don't get included in the library
7544	    # dependencies.
7545	    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"'
7546
7547	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7548	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7549
7550	    # Archives containing C++ object files must be created using
7551	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7552	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7553	    ;;
7554	  icpc* | ecpc* )
7555	    # Intel C++
7556	    with_gnu_ld=yes
7557	    # version 8.0 and above of icpc choke on multiply defined symbols
7558	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7559	    # earlier do not add the objects themselves.
7560	    case `$CC -V 2>&1` in
7561	      *"Version 7."*)
7562	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7563		_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'
7564		;;
7565	      *)  # Version 8.0 or newer
7566	        tmp_idyn=
7567	        case $host_cpu in
7568		  ia64*) tmp_idyn=' -i_dynamic';;
7569		esac
7570	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7571		_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'
7572		;;
7573	    esac
7574	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7575	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7576	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7577	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7578	    ;;
7579          pgCC* | pgcpp*)
7580            # Portland Group C++ compiler
7581	    case `$CC -V` in
7582	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7583	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7584		rm -rf $tpldir~
7585		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7586		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7587	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7588		rm -rf $tpldir~
7589		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7590		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7591		$RANLIB $oldlib'
7592	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7593		rm -rf $tpldir~
7594		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7595		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7596	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7597		rm -rf $tpldir~
7598		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7599		$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'
7600	      ;;
7601	    *) # Version 6 and above use weak symbols
7602	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7603	      _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'
7604	      ;;
7605	    esac
7606
7607	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7608	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7609	    _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'
7610            ;;
7611	  cxx*)
7612	    # Compaq C++
7613	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7614	    _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'
7615
7616	    runpath_var=LD_RUN_PATH
7617	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7618	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7619
7620	    # Commands to make compiler produce verbose output that lists
7621	    # what "hidden" libraries, object files and flags are used when
7622	    # linking a shared library.
7623	    #
7624	    # There doesn't appear to be a way to prevent this compiler from
7625	    # explicitly linking system object files so we need to strip them
7626	    # from the output so that they don't get included in the library
7627	    # dependencies.
7628	    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'
7629	    ;;
7630	  xl* | mpixl* | bgxl*)
7631	    # IBM XL 8.0 on PPC, with GNU ld
7632	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7633	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7634	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7635	    if test "x$supports_anon_versioning" = xyes; then
7636	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7637		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7638		echo "local: *; };" >> $output_objdir/$libname.ver~
7639		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7640	    fi
7641	    ;;
7642	  *)
7643	    case `$CC -V 2>&1 | sed 5q` in
7644	    *Sun\ C*)
7645	      # Sun C++ 5.9
7646	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7647	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7648	      _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'
7649	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7650	      _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'
7651	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7652
7653	      # Not sure whether something based on
7654	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7655	      # would be better.
7656	      output_verbose_link_cmd='func_echo_all'
7657
7658	      # Archives containing C++ object files must be created using
7659	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7660	      # necessary to make sure instantiated templates are included
7661	      # in the archive.
7662	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7663	      ;;
7664	    esac
7665	    ;;
7666	esac
7667	;;
7668
7669      lynxos*)
7670        # FIXME: insert proper C++ library support
7671	_LT_TAGVAR(ld_shlibs, $1)=no
7672	;;
7673
7674      m88k*)
7675        # FIXME: insert proper C++ library support
7676        _LT_TAGVAR(ld_shlibs, $1)=no
7677	;;
7678
7679      mvs*)
7680        case $cc_basename in
7681          cxx*)
7682	    # FIXME: insert proper C++ library support
7683	    _LT_TAGVAR(ld_shlibs, $1)=no
7684	    ;;
7685	  *)
7686	    # FIXME: insert proper C++ library support
7687	    _LT_TAGVAR(ld_shlibs, $1)=no
7688	    ;;
7689	esac
7690	;;
7691
7692      netbsd*)
7693        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7694	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7695	  wlarc=
7696	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7697	  _LT_TAGVAR(hardcode_direct, $1)=yes
7698	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7699	fi
7700	# Workaround some broken pre-1.5 toolchains
7701	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7702	;;
7703
7704      *nto* | *qnx*)
7705        _LT_TAGVAR(ld_shlibs, $1)=yes
7706	;;
7707
7708      openbsd2*)
7709        # C++ shared libraries are fairly broken
7710	_LT_TAGVAR(ld_shlibs, $1)=no
7711	;;
7712
7713      openbsd*)
7714	if test -f /usr/libexec/ld.so; then
7715	  _LT_TAGVAR(hardcode_direct, $1)=yes
7716	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7717	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7718	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7719	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7720	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7721	    _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'
7722	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7723	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7724	  fi
7725	  output_verbose_link_cmd=func_echo_all
7726	else
7727	  _LT_TAGVAR(ld_shlibs, $1)=no
7728	fi
7729	;;
7730
7731      osf3* | osf4* | osf5*)
7732        case $cc_basename in
7733          KCC*)
7734	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7735
7736	    # KCC will only create a shared library if the output file
7737	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7738	    # to its proper name (with version) after linking.
7739	    _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'
7740
7741	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7742	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7743
7744	    # Archives containing C++ object files must be created using
7745	    # the KAI C++ compiler.
7746	    case $host in
7747	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7748	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7749	    esac
7750	    ;;
7751          RCC*)
7752	    # Rational C++ 2.4.1
7753	    # FIXME: insert proper C++ library support
7754	    _LT_TAGVAR(ld_shlibs, $1)=no
7755	    ;;
7756          cxx*)
7757	    case $host in
7758	      osf3*)
7759	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7760	        _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'
7761	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7762		;;
7763	      *)
7764	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7765	        _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'
7766	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7767	          echo "-hidden">> $lib.exp~
7768	          $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~
7769	          $RM $lib.exp'
7770	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7771		;;
7772	    esac
7773
7774	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7775
7776	    # Commands to make compiler produce verbose output that lists
7777	    # what "hidden" libraries, object files and flags are used when
7778	    # linking a shared library.
7779	    #
7780	    # There doesn't appear to be a way to prevent this compiler from
7781	    # explicitly linking system object files so we need to strip them
7782	    # from the output so that they don't get included in the library
7783	    # dependencies.
7784	    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"'
7785	    ;;
7786	  *)
7787	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7788	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7789	      case $host in
7790	        osf3*)
7791	          _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'
7792		  ;;
7793	        *)
7794	          _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'
7795		  ;;
7796	      esac
7797
7798	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7799	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7800
7801	      # Commands to make compiler produce verbose output that lists
7802	      # what "hidden" libraries, object files and flags are used when
7803	      # linking a shared library.
7804	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7805
7806	    else
7807	      # FIXME: insert proper C++ library support
7808	      _LT_TAGVAR(ld_shlibs, $1)=no
7809	    fi
7810	    ;;
7811        esac
7812        ;;
7813
7814      psos*)
7815        # FIXME: insert proper C++ library support
7816        _LT_TAGVAR(ld_shlibs, $1)=no
7817        ;;
7818
7819      sunos4*)
7820        case $cc_basename in
7821          CC*)
7822	    # Sun C++ 4.x
7823	    # FIXME: insert proper C++ library support
7824	    _LT_TAGVAR(ld_shlibs, $1)=no
7825	    ;;
7826          lcc*)
7827	    # Lucid
7828	    # FIXME: insert proper C++ library support
7829	    _LT_TAGVAR(ld_shlibs, $1)=no
7830	    ;;
7831          *)
7832	    # FIXME: insert proper C++ library support
7833	    _LT_TAGVAR(ld_shlibs, $1)=no
7834	    ;;
7835        esac
7836        ;;
7837
7838      solaris*)
7839        case $cc_basename in
7840          CC* | sunCC*)
7841	    # Sun C++ 4.2, 5.x and Centerline C++
7842            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7843	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7844	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7845	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7846	      $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'
7847
7848	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7849	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7850	    case $host_os in
7851	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7852	      *)
7853		# The compiler driver will combine and reorder linker options,
7854		# but understands `-z linker_flag'.
7855	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7856		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7857	        ;;
7858	    esac
7859	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7860
7861	    output_verbose_link_cmd='func_echo_all'
7862
7863	    # Archives containing C++ object files must be created using
7864	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7865	    # necessary to make sure instantiated templates are included
7866	    # in the archive.
7867	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7868	    ;;
7869          gcx*)
7870	    # Green Hills C++ Compiler
7871	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7872
7873	    # The C++ compiler must be used to create the archive.
7874	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7875	    ;;
7876          *)
7877	    # GNU C++ compiler with Solaris linker
7878	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7879	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7880	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7881	        _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'
7882	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7883		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7884
7885	        # Commands to make compiler produce verbose output that lists
7886	        # what "hidden" libraries, object files and flags are used when
7887	        # linking a shared library.
7888	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7889	      else
7890	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7891	        # platform.
7892	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7893	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7894		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7895
7896	        # Commands to make compiler produce verbose output that lists
7897	        # what "hidden" libraries, object files and flags are used when
7898	        # linking a shared library.
7899	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7900	      fi
7901
7902	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7903	      case $host_os in
7904		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7905		*)
7906		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7907		  ;;
7908	      esac
7909	    fi
7910	    ;;
7911        esac
7912        ;;
7913
7914    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7915      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7916      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7917      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7918      runpath_var='LD_RUN_PATH'
7919
7920      case $cc_basename in
7921        CC*)
7922	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7923	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7924	  ;;
7925	*)
7926	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7927	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7928	  ;;
7929      esac
7930      ;;
7931
7932      sysv5* | sco3.2v5* | sco5v6*)
7933	# Note: We can NOT use -z defs as we might desire, because we do not
7934	# link with -lc, and that would cause any symbols used from libc to
7935	# always be unresolved, which means just about no library would
7936	# ever link correctly.  If we're not using GNU ld we use -z text
7937	# though, which does catch some bad symbols but isn't as heavy-handed
7938	# as -z defs.
7939	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7940	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7941	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7942	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7943	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7944	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7945	_LT_TAGVAR(link_all_deplibs, $1)=yes
7946	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7947	runpath_var='LD_RUN_PATH'
7948
7949	case $cc_basename in
7950          CC*)
7951	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7952	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7953	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7954	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7955	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7956	      '"$_LT_TAGVAR(reload_cmds, $1)"
7957	    ;;
7958	  *)
7959	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7960	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7961	    ;;
7962	esac
7963      ;;
7964
7965      tandem*)
7966        case $cc_basename in
7967          NCC*)
7968	    # NonStop-UX NCC 3.20
7969	    # FIXME: insert proper C++ library support
7970	    _LT_TAGVAR(ld_shlibs, $1)=no
7971	    ;;
7972          *)
7973	    # FIXME: insert proper C++ library support
7974	    _LT_TAGVAR(ld_shlibs, $1)=no
7975	    ;;
7976        esac
7977        ;;
7978
7979      vxworks*)
7980        # FIXME: insert proper C++ library support
7981        _LT_TAGVAR(ld_shlibs, $1)=no
7982        ;;
7983
7984      *)
7985        # FIXME: insert proper C++ library support
7986        _LT_TAGVAR(ld_shlibs, $1)=no
7987        ;;
7988    esac
7989
7990    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7991    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7992
7993    _LT_TAGVAR(GCC, $1)="$GXX"
7994    _LT_TAGVAR(LD, $1)="$LD"
7995
7996    ## CAVEAT EMPTOR:
7997    ## There is no encapsulation within the following macros, do not change
7998    ## the running order or otherwise move them around unless you know exactly
7999    ## what you are doing...
8000    _LT_SYS_HIDDEN_LIBDEPS($1)
8001    _LT_COMPILER_PIC($1)
8002    _LT_COMPILER_C_O($1)
8003    _LT_COMPILER_FILE_LOCKS($1)
8004    _LT_LINKER_SHLIBS($1)
8005    _LT_SYS_DYNAMIC_LINKER($1)
8006    _LT_LINKER_HARDCODE_LIBPATH($1)
8007
8008    _LT_CONFIG($1)
8009  fi # test -n "$compiler"
8010
8011  CC=$lt_save_CC
8012  CFLAGS=$lt_save_CFLAGS
8013  LDCXX=$LD
8014  LD=$lt_save_LD
8015  GCC=$lt_save_GCC
8016  with_gnu_ld=$lt_save_with_gnu_ld
8017  lt_cv_path_LDCXX=$lt_cv_path_LD
8018  lt_cv_path_LD=$lt_save_path_LD
8019  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
8020  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
8021fi # test "$_lt_caught_CXX_error" != yes
8022
8023AC_LANG_POP
8024])# _LT_LANG_CXX_CONFIG
8025
8026
8027# _LT_FUNC_STRIPNAME_CNF
8028# ----------------------
8029# func_stripname_cnf prefix suffix name
8030# strip PREFIX and SUFFIX off of NAME.
8031# PREFIX and SUFFIX must not contain globbing or regex special
8032# characters, hashes, percent signs, but SUFFIX may contain a leading
8033# dot (in which case that matches only a dot).
8034#
8035# This function is identical to the (non-XSI) version of func_stripname,
8036# except this one can be used by m4 code that may be executed by configure,
8037# rather than the libtool script.
8038m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
8039AC_REQUIRE([_LT_DECL_SED])
8040AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
8041func_stripname_cnf ()
8042{
8043  case ${2} in
8044  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
8045  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
8046  esac
8047} # func_stripname_cnf
8048])# _LT_FUNC_STRIPNAME_CNF
8049
8050# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
8051# ---------------------------------
8052# Figure out "hidden" library dependencies from verbose
8053# compiler output when linking a shared library.
8054# Parse the compiler output and extract the necessary
8055# objects, libraries and library flags.
8056m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
8057[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
8058AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
8059# Dependencies to place before and after the object being linked:
8060_LT_TAGVAR(predep_objects, $1)=
8061_LT_TAGVAR(postdep_objects, $1)=
8062_LT_TAGVAR(predeps, $1)=
8063_LT_TAGVAR(postdeps, $1)=
8064_LT_TAGVAR(compiler_lib_search_path, $1)=
8065
8066dnl we can't use the lt_simple_compile_test_code here,
8067dnl because it contains code intended for an executable,
8068dnl not a library.  It's possible we should let each
8069dnl tag define a new lt_????_link_test_code variable,
8070dnl but it's only used here...
8071m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
8072int a;
8073void foo (void) { a = 0; }
8074_LT_EOF
8075], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
8076class Foo
8077{
8078public:
8079  Foo (void) { a = 0; }
8080private:
8081  int a;
8082};
8083_LT_EOF
8084], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
8085      subroutine foo
8086      implicit none
8087      integer*4 a
8088      a=0
8089      return
8090      end
8091_LT_EOF
8092], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
8093      subroutine foo
8094      implicit none
8095      integer a
8096      a=0
8097      return
8098      end
8099_LT_EOF
8100], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
8101public class foo {
8102  private int a;
8103  public void bar (void) {
8104    a = 0;
8105  }
8106};
8107_LT_EOF
8108], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
8109package foo
8110func foo() {
8111}
8112_LT_EOF
8113])
8114
8115_lt_libdeps_save_CFLAGS=$CFLAGS
8116case "$CC $CFLAGS " in #(
8117*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8118*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8119*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8120esac
8121
8122dnl Parse the compiler output and extract the necessary
8123dnl objects, libraries and library flags.
8124if AC_TRY_EVAL(ac_compile); then
8125  # Parse the compiler output and extract the necessary
8126  # objects, libraries and library flags.
8127
8128  # Sentinel used to keep track of whether or not we are before
8129  # the conftest object file.
8130  pre_test_object_deps_done=no
8131
8132  for p in `eval "$output_verbose_link_cmd"`; do
8133    case ${prev}${p} in
8134
8135    -L* | -R* | -l*)
8136       # Some compilers place space between "-{L,R}" and the path.
8137       # Remove the space.
8138       if test $p = "-L" ||
8139          test $p = "-R"; then
8140	 prev=$p
8141	 continue
8142       fi
8143
8144       # Expand the sysroot to ease extracting the directories later.
8145       if test -z "$prev"; then
8146         case $p in
8147         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8148         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8149         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8150         esac
8151       fi
8152       case $p in
8153       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8154       esac
8155       if test "$pre_test_object_deps_done" = no; then
8156	 case ${prev} in
8157	 -L | -R)
8158	   # Internal compiler library paths should come after those
8159	   # provided the user.  The postdeps already come after the
8160	   # user supplied libs so there is no need to process them.
8161	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8162	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8163	   else
8164	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8165	   fi
8166	   ;;
8167	 # The "-l" case would never come before the object being
8168	 # linked, so don't bother handling this case.
8169	 esac
8170       else
8171	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8172	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8173	 else
8174	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8175	 fi
8176       fi
8177       prev=
8178       ;;
8179
8180    *.lto.$objext) ;; # Ignore GCC LTO objects
8181    *.$objext)
8182       # This assumes that the test object file only shows up
8183       # once in the compiler output.
8184       if test "$p" = "conftest.$objext"; then
8185	 pre_test_object_deps_done=yes
8186	 continue
8187       fi
8188
8189       if test "$pre_test_object_deps_done" = no; then
8190	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8191	   _LT_TAGVAR(predep_objects, $1)="$p"
8192	 else
8193	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8194	 fi
8195       else
8196	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8197	   _LT_TAGVAR(postdep_objects, $1)="$p"
8198	 else
8199	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8200	 fi
8201       fi
8202       ;;
8203
8204    *) ;; # Ignore the rest.
8205
8206    esac
8207  done
8208
8209  # Clean up.
8210  rm -f a.out a.exe
8211else
8212  echo "libtool.m4: error: problem compiling $1 test program"
8213fi
8214
8215$RM -f confest.$objext
8216CFLAGS=$_lt_libdeps_save_CFLAGS
8217
8218# PORTME: override above test on systems where it is broken
8219m4_if([$1], [CXX],
8220[case $host_os in
8221interix[[3-9]]*)
8222  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8223  # hack all around it, let's just trust "g++" to DTRT.
8224  _LT_TAGVAR(predep_objects,$1)=
8225  _LT_TAGVAR(postdep_objects,$1)=
8226  _LT_TAGVAR(postdeps,$1)=
8227  ;;
8228
8229linux*)
8230  case `$CC -V 2>&1 | sed 5q` in
8231  *Sun\ C*)
8232    # Sun C++ 5.9
8233
8234    # The more standards-conforming stlport4 library is
8235    # incompatible with the Cstd library. Avoid specifying
8236    # it if it's in CXXFLAGS. Ignore libCrun as
8237    # -library=stlport4 depends on it.
8238    case " $CXX $CXXFLAGS " in
8239    *" -library=stlport4 "*)
8240      solaris_use_stlport4=yes
8241      ;;
8242    esac
8243
8244    if test "$solaris_use_stlport4" != yes; then
8245      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8246    fi
8247    ;;
8248  esac
8249  ;;
8250
8251solaris*)
8252  case $cc_basename in
8253  CC* | sunCC*)
8254    # The more standards-conforming stlport4 library is
8255    # incompatible with the Cstd library. Avoid specifying
8256    # it if it's in CXXFLAGS. Ignore libCrun as
8257    # -library=stlport4 depends on it.
8258    case " $CXX $CXXFLAGS " in
8259    *" -library=stlport4 "*)
8260      solaris_use_stlport4=yes
8261      ;;
8262    esac
8263
8264    # Adding this requires a known-good setup of shared libraries for
8265    # Sun compiler versions before 5.6, else PIC objects from an old
8266    # archive will be linked into the output, leading to subtle bugs.
8267    if test "$solaris_use_stlport4" != yes; then
8268      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8269    fi
8270    ;;
8271  esac
8272  ;;
8273esac
8274])
8275
8276case " $_LT_TAGVAR(postdeps, $1) " in
8277*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8278esac
8279 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8280if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8281 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8282fi
8283_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8284    [The directories searched by this compiler when creating a shared library])
8285_LT_TAGDECL([], [predep_objects], [1],
8286    [Dependencies to place before and after the objects being linked to
8287    create a shared library])
8288_LT_TAGDECL([], [postdep_objects], [1])
8289_LT_TAGDECL([], [predeps], [1])
8290_LT_TAGDECL([], [postdeps], [1])
8291_LT_TAGDECL([], [compiler_lib_search_path], [1],
8292    [The library search path used internally by the compiler when linking
8293    a shared library])
8294])# _LT_SYS_HIDDEN_LIBDEPS
8295
8296
8297# _LT_LANG_F77_CONFIG([TAG])
8298# --------------------------
8299# Ensure that the configuration variables for a Fortran 77 compiler are
8300# suitably defined.  These variables are subsequently used by _LT_CONFIG
8301# to write the compiler configuration to `libtool'.
8302m4_defun([_LT_LANG_F77_CONFIG],
8303[AC_LANG_PUSH(Fortran 77)
8304if test -z "$F77" || test "X$F77" = "Xno"; then
8305  _lt_disable_F77=yes
8306fi
8307
8308_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8309_LT_TAGVAR(allow_undefined_flag, $1)=
8310_LT_TAGVAR(always_export_symbols, $1)=no
8311_LT_TAGVAR(archive_expsym_cmds, $1)=
8312_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8313_LT_TAGVAR(hardcode_direct, $1)=no
8314_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8315_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8316_LT_TAGVAR(hardcode_libdir_separator, $1)=
8317_LT_TAGVAR(hardcode_minus_L, $1)=no
8318_LT_TAGVAR(hardcode_automatic, $1)=no
8319_LT_TAGVAR(inherit_rpath, $1)=no
8320_LT_TAGVAR(module_cmds, $1)=
8321_LT_TAGVAR(module_expsym_cmds, $1)=
8322_LT_TAGVAR(link_all_deplibs, $1)=unknown
8323_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8324_LT_TAGVAR(reload_flag, $1)=$reload_flag
8325_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8326_LT_TAGVAR(no_undefined_flag, $1)=
8327_LT_TAGVAR(whole_archive_flag_spec, $1)=
8328_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8329
8330# Source file extension for f77 test sources.
8331ac_ext=f
8332
8333# Object file extension for compiled f77 test sources.
8334objext=o
8335_LT_TAGVAR(objext, $1)=$objext
8336
8337# No sense in running all these tests if we already determined that
8338# the F77 compiler isn't working.  Some variables (like enable_shared)
8339# are currently assumed to apply to all compilers on this platform,
8340# and will be corrupted by setting them based on a non-working compiler.
8341if test "$_lt_disable_F77" != yes; then
8342  # Code to be used in simple compile tests
8343  lt_simple_compile_test_code="\
8344      subroutine t
8345      return
8346      end
8347"
8348
8349  # Code to be used in simple link tests
8350  lt_simple_link_test_code="\
8351      program t
8352      end
8353"
8354
8355  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8356  _LT_TAG_COMPILER
8357
8358  # save warnings/boilerplate of simple test code
8359  _LT_COMPILER_BOILERPLATE
8360  _LT_LINKER_BOILERPLATE
8361
8362  # Allow CC to be a program name with arguments.
8363  lt_save_CC="$CC"
8364  lt_save_GCC=$GCC
8365  lt_save_CFLAGS=$CFLAGS
8366  CC=${F77-"f77"}
8367  CFLAGS=$FFLAGS
8368  compiler=$CC
8369  _LT_TAGVAR(compiler, $1)=$CC
8370  _LT_CC_BASENAME([$compiler])
8371  GCC=$G77
8372  if test -n "$compiler"; then
8373    AC_MSG_CHECKING([if libtool supports shared libraries])
8374    AC_MSG_RESULT([$can_build_shared])
8375
8376    AC_MSG_CHECKING([whether to build shared libraries])
8377    test "$can_build_shared" = "no" && enable_shared=no
8378
8379    # On AIX, shared libraries and static libraries use the same namespace, and
8380    # are all built from PIC.
8381    case $host_os in
8382      aix3*)
8383        test "$enable_shared" = yes && enable_static=no
8384        if test -n "$RANLIB"; then
8385          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8386          postinstall_cmds='$RANLIB $lib'
8387        fi
8388        ;;
8389      aix[[4-9]]*)
8390	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8391	  test "$enable_shared" = yes && enable_static=no
8392	fi
8393        ;;
8394    esac
8395    AC_MSG_RESULT([$enable_shared])
8396
8397    AC_MSG_CHECKING([whether to build static libraries])
8398    # Make sure either enable_shared or enable_static is yes.
8399    test "$enable_shared" = yes || enable_static=yes
8400    AC_MSG_RESULT([$enable_static])
8401
8402    _LT_TAGVAR(GCC, $1)="$G77"
8403    _LT_TAGVAR(LD, $1)="$LD"
8404
8405    ## CAVEAT EMPTOR:
8406    ## There is no encapsulation within the following macros, do not change
8407    ## the running order or otherwise move them around unless you know exactly
8408    ## what you are doing...
8409    _LT_COMPILER_PIC($1)
8410    _LT_COMPILER_C_O($1)
8411    _LT_COMPILER_FILE_LOCKS($1)
8412    _LT_LINKER_SHLIBS($1)
8413    _LT_SYS_DYNAMIC_LINKER($1)
8414    _LT_LINKER_HARDCODE_LIBPATH($1)
8415
8416    _LT_CONFIG($1)
8417  fi # test -n "$compiler"
8418
8419  GCC=$lt_save_GCC
8420  CC="$lt_save_CC"
8421  CFLAGS="$lt_save_CFLAGS"
8422fi # test "$_lt_disable_F77" != yes
8423
8424AC_LANG_POP
8425])# _LT_LANG_F77_CONFIG
8426
8427
8428# _LT_LANG_FC_CONFIG([TAG])
8429# -------------------------
8430# Ensure that the configuration variables for a Fortran compiler are
8431# suitably defined.  These variables are subsequently used by _LT_CONFIG
8432# to write the compiler configuration to `libtool'.
8433m4_defun([_LT_LANG_FC_CONFIG],
8434[AC_LANG_PUSH(Fortran)
8435
8436if test -z "$FC" || test "X$FC" = "Xno"; then
8437  _lt_disable_FC=yes
8438fi
8439
8440_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8441_LT_TAGVAR(allow_undefined_flag, $1)=
8442_LT_TAGVAR(always_export_symbols, $1)=no
8443_LT_TAGVAR(archive_expsym_cmds, $1)=
8444_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8445_LT_TAGVAR(hardcode_direct, $1)=no
8446_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8447_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8448_LT_TAGVAR(hardcode_libdir_separator, $1)=
8449_LT_TAGVAR(hardcode_minus_L, $1)=no
8450_LT_TAGVAR(hardcode_automatic, $1)=no
8451_LT_TAGVAR(inherit_rpath, $1)=no
8452_LT_TAGVAR(module_cmds, $1)=
8453_LT_TAGVAR(module_expsym_cmds, $1)=
8454_LT_TAGVAR(link_all_deplibs, $1)=unknown
8455_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8456_LT_TAGVAR(reload_flag, $1)=$reload_flag
8457_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8458_LT_TAGVAR(no_undefined_flag, $1)=
8459_LT_TAGVAR(whole_archive_flag_spec, $1)=
8460_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8461
8462# Source file extension for fc test sources.
8463ac_ext=${ac_fc_srcext-f}
8464
8465# Object file extension for compiled fc test sources.
8466objext=o
8467_LT_TAGVAR(objext, $1)=$objext
8468
8469# No sense in running all these tests if we already determined that
8470# the FC compiler isn't working.  Some variables (like enable_shared)
8471# are currently assumed to apply to all compilers on this platform,
8472# and will be corrupted by setting them based on a non-working compiler.
8473if test "$_lt_disable_FC" != yes; then
8474  # Code to be used in simple compile tests
8475  lt_simple_compile_test_code="\
8476      subroutine t
8477      return
8478      end
8479"
8480
8481  # Code to be used in simple link tests
8482  lt_simple_link_test_code="\
8483      program t
8484      end
8485"
8486
8487  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8488  _LT_TAG_COMPILER
8489
8490  # save warnings/boilerplate of simple test code
8491  _LT_COMPILER_BOILERPLATE
8492  _LT_LINKER_BOILERPLATE
8493
8494  # Allow CC to be a program name with arguments.
8495  lt_save_CC="$CC"
8496  lt_save_GCC=$GCC
8497  lt_save_CFLAGS=$CFLAGS
8498  CC=${FC-"f95"}
8499  CFLAGS=$FCFLAGS
8500  compiler=$CC
8501  GCC=$ac_cv_fc_compiler_gnu
8502
8503  _LT_TAGVAR(compiler, $1)=$CC
8504  _LT_CC_BASENAME([$compiler])
8505
8506  if test -n "$compiler"; then
8507    AC_MSG_CHECKING([if libtool supports shared libraries])
8508    AC_MSG_RESULT([$can_build_shared])
8509
8510    AC_MSG_CHECKING([whether to build shared libraries])
8511    test "$can_build_shared" = "no" && enable_shared=no
8512
8513    # On AIX, shared libraries and static libraries use the same namespace, and
8514    # are all built from PIC.
8515    case $host_os in
8516      aix3*)
8517        test "$enable_shared" = yes && enable_static=no
8518        if test -n "$RANLIB"; then
8519          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8520          postinstall_cmds='$RANLIB $lib'
8521        fi
8522        ;;
8523      aix[[4-9]]*)
8524	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8525	  test "$enable_shared" = yes && enable_static=no
8526	fi
8527        ;;
8528    esac
8529    AC_MSG_RESULT([$enable_shared])
8530
8531    AC_MSG_CHECKING([whether to build static libraries])
8532    # Make sure either enable_shared or enable_static is yes.
8533    test "$enable_shared" = yes || enable_static=yes
8534    AC_MSG_RESULT([$enable_static])
8535
8536    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8537    _LT_TAGVAR(LD, $1)="$LD"
8538
8539    ## CAVEAT EMPTOR:
8540    ## There is no encapsulation within the following macros, do not change
8541    ## the running order or otherwise move them around unless you know exactly
8542    ## what you are doing...
8543    _LT_SYS_HIDDEN_LIBDEPS($1)
8544    _LT_COMPILER_PIC($1)
8545    _LT_COMPILER_C_O($1)
8546    _LT_COMPILER_FILE_LOCKS($1)
8547    _LT_LINKER_SHLIBS($1)
8548    _LT_SYS_DYNAMIC_LINKER($1)
8549    _LT_LINKER_HARDCODE_LIBPATH($1)
8550
8551    _LT_CONFIG($1)
8552  fi # test -n "$compiler"
8553
8554  GCC=$lt_save_GCC
8555  CC=$lt_save_CC
8556  CFLAGS=$lt_save_CFLAGS
8557fi # test "$_lt_disable_FC" != yes
8558
8559AC_LANG_POP
8560])# _LT_LANG_FC_CONFIG
8561
8562
8563# _LT_LANG_GCJ_CONFIG([TAG])
8564# --------------------------
8565# Ensure that the configuration variables for the GNU Java Compiler compiler
8566# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8567# to write the compiler configuration to `libtool'.
8568m4_defun([_LT_LANG_GCJ_CONFIG],
8569[AC_REQUIRE([LT_PROG_GCJ])dnl
8570AC_LANG_SAVE
8571
8572# Source file extension for Java test sources.
8573ac_ext=java
8574
8575# Object file extension for compiled Java test sources.
8576objext=o
8577_LT_TAGVAR(objext, $1)=$objext
8578
8579# Code to be used in simple compile tests
8580lt_simple_compile_test_code="class foo {}"
8581
8582# Code to be used in simple link tests
8583lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8584
8585# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8586_LT_TAG_COMPILER
8587
8588# save warnings/boilerplate of simple test code
8589_LT_COMPILER_BOILERPLATE
8590_LT_LINKER_BOILERPLATE
8591
8592# Allow CC to be a program name with arguments.
8593lt_save_CC=$CC
8594lt_save_CFLAGS=$CFLAGS
8595lt_save_GCC=$GCC
8596GCC=yes
8597CC=${GCJ-"gcj"}
8598CFLAGS=$GCJFLAGS
8599compiler=$CC
8600_LT_TAGVAR(compiler, $1)=$CC
8601_LT_TAGVAR(LD, $1)="$LD"
8602_LT_CC_BASENAME([$compiler])
8603
8604# GCJ did not exist at the time GCC didn't implicitly link libc in.
8605_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8606
8607_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8608_LT_TAGVAR(reload_flag, $1)=$reload_flag
8609_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8610
8611if test -n "$compiler"; then
8612  _LT_COMPILER_NO_RTTI($1)
8613  _LT_COMPILER_PIC($1)
8614  _LT_COMPILER_C_O($1)
8615  _LT_COMPILER_FILE_LOCKS($1)
8616  _LT_LINKER_SHLIBS($1)
8617  _LT_LINKER_HARDCODE_LIBPATH($1)
8618
8619  _LT_CONFIG($1)
8620fi
8621
8622AC_LANG_RESTORE
8623
8624GCC=$lt_save_GCC
8625CC=$lt_save_CC
8626CFLAGS=$lt_save_CFLAGS
8627])# _LT_LANG_GCJ_CONFIG
8628
8629
8630# _LT_LANG_GO_CONFIG([TAG])
8631# --------------------------
8632# Ensure that the configuration variables for the GNU Go compiler
8633# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8634# to write the compiler configuration to `libtool'.
8635m4_defun([_LT_LANG_GO_CONFIG],
8636[AC_REQUIRE([LT_PROG_GO])dnl
8637AC_LANG_SAVE
8638
8639# Source file extension for Go test sources.
8640ac_ext=go
8641
8642# Object file extension for compiled Go test sources.
8643objext=o
8644_LT_TAGVAR(objext, $1)=$objext
8645
8646# Code to be used in simple compile tests
8647lt_simple_compile_test_code="package main; func main() { }"
8648
8649# Code to be used in simple link tests
8650lt_simple_link_test_code='package main; func main() { }'
8651
8652# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8653_LT_TAG_COMPILER
8654
8655# save warnings/boilerplate of simple test code
8656_LT_COMPILER_BOILERPLATE
8657_LT_LINKER_BOILERPLATE
8658
8659# Allow CC to be a program name with arguments.
8660lt_save_CC=$CC
8661lt_save_CFLAGS=$CFLAGS
8662lt_save_GCC=$GCC
8663GCC=yes
8664CC=${GOC-"gccgo"}
8665CFLAGS=$GOFLAGS
8666compiler=$CC
8667_LT_TAGVAR(compiler, $1)=$CC
8668_LT_TAGVAR(LD, $1)="$LD"
8669_LT_CC_BASENAME([$compiler])
8670
8671# Go did not exist at the time GCC didn't implicitly link libc in.
8672_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8673
8674_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8675_LT_TAGVAR(reload_flag, $1)=$reload_flag
8676_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8677
8678if test -n "$compiler"; then
8679  _LT_COMPILER_NO_RTTI($1)
8680  _LT_COMPILER_PIC($1)
8681  _LT_COMPILER_C_O($1)
8682  _LT_COMPILER_FILE_LOCKS($1)
8683  _LT_LINKER_SHLIBS($1)
8684  _LT_LINKER_HARDCODE_LIBPATH($1)
8685
8686  _LT_CONFIG($1)
8687fi
8688
8689AC_LANG_RESTORE
8690
8691GCC=$lt_save_GCC
8692CC=$lt_save_CC
8693CFLAGS=$lt_save_CFLAGS
8694])# _LT_LANG_GO_CONFIG
8695
8696
8697# _LT_LANG_RC_CONFIG([TAG])
8698# -------------------------
8699# Ensure that the configuration variables for the Windows resource compiler
8700# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8701# to write the compiler configuration to `libtool'.
8702m4_defun([_LT_LANG_RC_CONFIG],
8703[AC_REQUIRE([LT_PROG_RC])dnl
8704AC_LANG_SAVE
8705
8706# Source file extension for RC test sources.
8707ac_ext=rc
8708
8709# Object file extension for compiled RC test sources.
8710objext=o
8711_LT_TAGVAR(objext, $1)=$objext
8712
8713# Code to be used in simple compile tests
8714lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8715
8716# Code to be used in simple link tests
8717lt_simple_link_test_code="$lt_simple_compile_test_code"
8718
8719# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8720_LT_TAG_COMPILER
8721
8722# save warnings/boilerplate of simple test code
8723_LT_COMPILER_BOILERPLATE
8724_LT_LINKER_BOILERPLATE
8725
8726# Allow CC to be a program name with arguments.
8727lt_save_CC="$CC"
8728lt_save_CFLAGS=$CFLAGS
8729lt_save_GCC=$GCC
8730GCC=
8731CC=${RC-"windres"}
8732CFLAGS=
8733compiler=$CC
8734_LT_TAGVAR(compiler, $1)=$CC
8735_LT_CC_BASENAME([$compiler])
8736_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8737
8738if test -n "$compiler"; then
8739  :
8740  _LT_CONFIG($1)
8741fi
8742
8743GCC=$lt_save_GCC
8744AC_LANG_RESTORE
8745CC=$lt_save_CC
8746CFLAGS=$lt_save_CFLAGS
8747])# _LT_LANG_RC_CONFIG
8748
8749
8750# LT_PROG_GCJ
8751# -----------
8752AC_DEFUN([LT_PROG_GCJ],
8753[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8754  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8755    [AC_CHECK_TOOL(GCJ, gcj,)
8756      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8757      AC_SUBST(GCJFLAGS)])])[]dnl
8758])
8759
8760# Old name:
8761AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8762dnl aclocal-1.4 backwards compatibility:
8763dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8764
8765
8766# LT_PROG_GO
8767# ----------
8768AC_DEFUN([LT_PROG_GO],
8769[AC_CHECK_TOOL(GOC, gccgo,)
8770])
8771
8772
8773# LT_PROG_RC
8774# ----------
8775AC_DEFUN([LT_PROG_RC],
8776[AC_CHECK_TOOL(RC, windres,)
8777])
8778
8779# Old name:
8780AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8781dnl aclocal-1.4 backwards compatibility:
8782dnl AC_DEFUN([LT_AC_PROG_RC], [])
8783
8784
8785# _LT_DECL_EGREP
8786# --------------
8787# If we don't have a new enough Autoconf to choose the best grep
8788# available, choose the one first in the user's PATH.
8789m4_defun([_LT_DECL_EGREP],
8790[AC_REQUIRE([AC_PROG_EGREP])dnl
8791AC_REQUIRE([AC_PROG_FGREP])dnl
8792test -z "$GREP" && GREP=grep
8793_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8794_LT_DECL([], [EGREP], [1], [An ERE matcher])
8795_LT_DECL([], [FGREP], [1], [A literal string matcher])
8796dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8797AC_SUBST([GREP])
8798])
8799
8800
8801# _LT_DECL_OBJDUMP
8802# --------------
8803# If we don't have a new enough Autoconf to choose the best objdump
8804# available, choose the one first in the user's PATH.
8805m4_defun([_LT_DECL_OBJDUMP],
8806[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8807test -z "$OBJDUMP" && OBJDUMP=objdump
8808_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8809AC_SUBST([OBJDUMP])
8810])
8811
8812# _LT_DECL_DLLTOOL
8813# ----------------
8814# Ensure DLLTOOL variable is set.
8815m4_defun([_LT_DECL_DLLTOOL],
8816[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8817test -z "$DLLTOOL" && DLLTOOL=dlltool
8818_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8819AC_SUBST([DLLTOOL])
8820])
8821
8822# _LT_DECL_SED
8823# ------------
8824# Check for a fully-functional sed program, that truncates
8825# as few characters as possible.  Prefer GNU sed if found.
8826m4_defun([_LT_DECL_SED],
8827[AC_PROG_SED
8828test -z "$SED" && SED=sed
8829Xsed="$SED -e 1s/^X//"
8830_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8831_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8832    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8833])# _LT_DECL_SED
8834
8835m4_ifndef([AC_PROG_SED], [
8836# NOTE: This macro has been submitted for inclusion into   #
8837#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8838#  a released version of Autoconf we should remove this    #
8839#  macro and use it instead.                               #
8840
8841m4_defun([AC_PROG_SED],
8842[AC_MSG_CHECKING([for a sed that does not truncate output])
8843AC_CACHE_VAL(lt_cv_path_SED,
8844[# Loop through the user's path and test for sed and gsed.
8845# Then use that list of sed's as ones to test for truncation.
8846as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8847for as_dir in $PATH
8848do
8849  IFS=$as_save_IFS
8850  test -z "$as_dir" && as_dir=.
8851  for lt_ac_prog in sed gsed; do
8852    for ac_exec_ext in '' $ac_executable_extensions; do
8853      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8854        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8855      fi
8856    done
8857  done
8858done
8859IFS=$as_save_IFS
8860lt_ac_max=0
8861lt_ac_count=0
8862# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8863# along with /bin/sed that truncates output.
8864for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8865  test ! -f $lt_ac_sed && continue
8866  cat /dev/null > conftest.in
8867  lt_ac_count=0
8868  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8869  # Check for GNU sed and select it if it is found.
8870  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8871    lt_cv_path_SED=$lt_ac_sed
8872    break
8873  fi
8874  while true; do
8875    cat conftest.in conftest.in >conftest.tmp
8876    mv conftest.tmp conftest.in
8877    cp conftest.in conftest.nl
8878    echo >>conftest.nl
8879    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8880    cmp -s conftest.out conftest.nl || break
8881    # 10000 chars as input seems more than enough
8882    test $lt_ac_count -gt 10 && break
8883    lt_ac_count=`expr $lt_ac_count + 1`
8884    if test $lt_ac_count -gt $lt_ac_max; then
8885      lt_ac_max=$lt_ac_count
8886      lt_cv_path_SED=$lt_ac_sed
8887    fi
8888  done
8889done
8890])
8891SED=$lt_cv_path_SED
8892AC_SUBST([SED])
8893AC_MSG_RESULT([$SED])
8894])#AC_PROG_SED
8895])#m4_ifndef
8896
8897# Old name:
8898AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8899dnl aclocal-1.4 backwards compatibility:
8900dnl AC_DEFUN([LT_AC_PROG_SED], [])
8901
8902
8903# _LT_CHECK_SHELL_FEATURES
8904# ------------------------
8905# Find out whether the shell is Bourne or XSI compatible,
8906# or has some other useful features.
8907m4_defun([_LT_CHECK_SHELL_FEATURES],
8908[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8909# Try some XSI features
8910xsi_shell=no
8911( _lt_dummy="a/b/c"
8912  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8913      = c,a/b,b/c, \
8914    && eval 'test $(( 1 + 1 )) -eq 2 \
8915    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8916  && xsi_shell=yes
8917AC_MSG_RESULT([$xsi_shell])
8918_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8919
8920AC_MSG_CHECKING([whether the shell understands "+="])
8921lt_shell_append=no
8922( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8923    >/dev/null 2>&1 \
8924  && lt_shell_append=yes
8925AC_MSG_RESULT([$lt_shell_append])
8926_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8927
8928if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8929  lt_unset=unset
8930else
8931  lt_unset=false
8932fi
8933_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8934
8935# test EBCDIC or ASCII
8936case `echo X|tr X '\101'` in
8937 A) # ASCII based system
8938    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8939  lt_SP2NL='tr \040 \012'
8940  lt_NL2SP='tr \015\012 \040\040'
8941  ;;
8942 *) # EBCDIC based system
8943  lt_SP2NL='tr \100 \n'
8944  lt_NL2SP='tr \r\n \100\100'
8945  ;;
8946esac
8947_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8948_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8949])# _LT_CHECK_SHELL_FEATURES
8950
8951
8952# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8953# ------------------------------------------------------
8954# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8955# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8956m4_defun([_LT_PROG_FUNCTION_REPLACE],
8957[dnl {
8958sed -e '/^$1 ()$/,/^} # $1 /c\
8959$1 ()\
8960{\
8961m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8962} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8963  && mv -f "$cfgfile.tmp" "$cfgfile" \
8964    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8965test 0 -eq $? || _lt_function_replace_fail=:
8966])
8967
8968
8969# _LT_PROG_REPLACE_SHELLFNS
8970# -------------------------
8971# Replace existing portable implementations of several shell functions with
8972# equivalent extended shell implementations where those features are available..
8973m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8974[if test x"$xsi_shell" = xyes; then
8975  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8976    case ${1} in
8977      */*) func_dirname_result="${1%/*}${2}" ;;
8978      *  ) func_dirname_result="${3}" ;;
8979    esac])
8980
8981  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8982    func_basename_result="${1##*/}"])
8983
8984  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8985    case ${1} in
8986      */*) func_dirname_result="${1%/*}${2}" ;;
8987      *  ) func_dirname_result="${3}" ;;
8988    esac
8989    func_basename_result="${1##*/}"])
8990
8991  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8992    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8993    # positional parameters, so assign one to ordinary parameter first.
8994    func_stripname_result=${3}
8995    func_stripname_result=${func_stripname_result#"${1}"}
8996    func_stripname_result=${func_stripname_result%"${2}"}])
8997
8998  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8999    func_split_long_opt_name=${1%%=*}
9000    func_split_long_opt_arg=${1#*=}])
9001
9002  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
9003    func_split_short_opt_arg=${1#??}
9004    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
9005
9006  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
9007    case ${1} in
9008      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
9009      *)    func_lo2o_result=${1} ;;
9010    esac])
9011
9012  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
9013
9014  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
9015
9016  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
9017fi
9018
9019if test x"$lt_shell_append" = xyes; then
9020  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
9021
9022  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
9023    func_quote_for_eval "${2}"
9024dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
9025    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
9026
9027  # Save a `func_append' function call where possible by direct use of '+='
9028  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
9029    && mv -f "$cfgfile.tmp" "$cfgfile" \
9030      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
9031  test 0 -eq $? || _lt_function_replace_fail=:
9032else
9033  # Save a `func_append' function call even when '+=' is not available
9034  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
9035    && mv -f "$cfgfile.tmp" "$cfgfile" \
9036      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
9037  test 0 -eq $? || _lt_function_replace_fail=:
9038fi
9039
9040if test x"$_lt_function_replace_fail" = x":"; then
9041  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
9042fi
9043])
9044
9045# _LT_PATH_CONVERSION_FUNCTIONS
9046# -----------------------------
9047# Determine which file name conversion functions should be used by
9048# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
9049# for certain cross-compile configurations and native mingw.
9050m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
9051[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9052AC_REQUIRE([AC_CANONICAL_BUILD])dnl
9053AC_MSG_CHECKING([how to convert $build file names to $host format])
9054AC_CACHE_VAL(lt_cv_to_host_file_cmd,
9055[case $host in
9056  *-*-mingw* )
9057    case $build in
9058      *-*-mingw* ) # actually msys
9059        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
9060        ;;
9061      *-*-cygwin* )
9062        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
9063        ;;
9064      * ) # otherwise, assume *nix
9065        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
9066        ;;
9067    esac
9068    ;;
9069  *-*-cygwin* )
9070    case $build in
9071      *-*-mingw* ) # actually msys
9072        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
9073        ;;
9074      *-*-cygwin* )
9075        lt_cv_to_host_file_cmd=func_convert_file_noop
9076        ;;
9077      * ) # otherwise, assume *nix
9078        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
9079        ;;
9080    esac
9081    ;;
9082  * ) # unhandled hosts (and "normal" native builds)
9083    lt_cv_to_host_file_cmd=func_convert_file_noop
9084    ;;
9085esac
9086])
9087to_host_file_cmd=$lt_cv_to_host_file_cmd
9088AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
9089_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
9090         [0], [convert $build file names to $host format])dnl
9091
9092AC_MSG_CHECKING([how to convert $build file names to toolchain format])
9093AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
9094[#assume ordinary cross tools, or native build.
9095lt_cv_to_tool_file_cmd=func_convert_file_noop
9096case $host in
9097  *-*-mingw* )
9098    case $build in
9099      *-*-mingw* ) # actually msys
9100        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
9101        ;;
9102    esac
9103    ;;
9104esac
9105])
9106to_tool_file_cmd=$lt_cv_to_tool_file_cmd
9107AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
9108_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
9109         [0], [convert $build files to toolchain format])dnl
9110])# _LT_PATH_CONVERSION_FUNCTIONS
9111
9112# Helper functions for option handling.                    -*- Autoconf -*-
9113#
9114#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9115#   Inc.
9116#   Written by Gary V. Vaughan, 2004
9117#
9118# This file is free software; the Free Software Foundation gives
9119# unlimited permission to copy and/or distribute it, with or without
9120# modifications, as long as this notice is preserved.
9121
9122# serial 7 ltoptions.m4
9123
9124# This is to help aclocal find these macros, as it can't see m4_define.
9125AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9126
9127
9128# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9129# ------------------------------------------
9130m4_define([_LT_MANGLE_OPTION],
9131[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9132
9133
9134# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9135# ---------------------------------------
9136# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9137# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9138# saved as a flag.
9139m4_define([_LT_SET_OPTION],
9140[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9141m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9142        _LT_MANGLE_DEFUN([$1], [$2]),
9143    [m4_warning([Unknown $1 option `$2'])])[]dnl
9144])
9145
9146
9147# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9148# ------------------------------------------------------------
9149# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9150m4_define([_LT_IF_OPTION],
9151[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9152
9153
9154# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9155# -------------------------------------------------------
9156# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9157# are set.
9158m4_define([_LT_UNLESS_OPTIONS],
9159[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9160	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9161		      [m4_define([$0_found])])])[]dnl
9162m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9163])[]dnl
9164])
9165
9166
9167# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9168# ----------------------------------------
9169# OPTION-LIST is a space-separated list of Libtool options associated
9170# with MACRO-NAME.  If any OPTION has a matching handler declared with
9171# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9172# the unknown option and exit.
9173m4_defun([_LT_SET_OPTIONS],
9174[# Set options
9175m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9176    [_LT_SET_OPTION([$1], _LT_Option)])
9177
9178m4_if([$1],[LT_INIT],[
9179  dnl
9180  dnl Simply set some default values (i.e off) if boolean options were not
9181  dnl specified:
9182  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9183  ])
9184  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9185  ])
9186  dnl
9187  dnl If no reference was made to various pairs of opposing options, then
9188  dnl we run the default mode handler for the pair.  For example, if neither
9189  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9190  dnl archives by default:
9191  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9192  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9193  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9194  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9195  		   [_LT_ENABLE_FAST_INSTALL])
9196  ])
9197])# _LT_SET_OPTIONS
9198
9199
9200
9201# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9202# -----------------------------------------
9203m4_define([_LT_MANGLE_DEFUN],
9204[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9205
9206
9207# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9208# -----------------------------------------------
9209m4_define([LT_OPTION_DEFINE],
9210[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9211])# LT_OPTION_DEFINE
9212
9213
9214# dlopen
9215# ------
9216LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9217])
9218
9219AU_DEFUN([AC_LIBTOOL_DLOPEN],
9220[_LT_SET_OPTION([LT_INIT], [dlopen])
9221AC_DIAGNOSE([obsolete],
9222[$0: Remove this warning and the call to _LT_SET_OPTION when you
9223put the `dlopen' option into LT_INIT's first parameter.])
9224])
9225
9226dnl aclocal-1.4 backwards compatibility:
9227dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9228
9229
9230# win32-dll
9231# ---------
9232# Declare package support for building win32 dll's.
9233LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9234[enable_win32_dll=yes
9235
9236case $host in
9237*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9238  AC_CHECK_TOOL(AS, as, false)
9239  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9240  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9241  ;;
9242esac
9243
9244test -z "$AS" && AS=as
9245_LT_DECL([], [AS],      [1], [Assembler program])dnl
9246
9247test -z "$DLLTOOL" && DLLTOOL=dlltool
9248_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9249
9250test -z "$OBJDUMP" && OBJDUMP=objdump
9251_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9252])# win32-dll
9253
9254AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9255[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9256_LT_SET_OPTION([LT_INIT], [win32-dll])
9257AC_DIAGNOSE([obsolete],
9258[$0: Remove this warning and the call to _LT_SET_OPTION when you
9259put the `win32-dll' option into LT_INIT's first parameter.])
9260])
9261
9262dnl aclocal-1.4 backwards compatibility:
9263dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9264
9265
9266# _LT_ENABLE_SHARED([DEFAULT])
9267# ----------------------------
9268# implement the --enable-shared flag, and supports the `shared' and
9269# `disable-shared' LT_INIT options.
9270# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9271m4_define([_LT_ENABLE_SHARED],
9272[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9273AC_ARG_ENABLE([shared],
9274    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9275	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9276    [p=${PACKAGE-default}
9277    case $enableval in
9278    yes) enable_shared=yes ;;
9279    no) enable_shared=no ;;
9280    *)
9281      enable_shared=no
9282      # Look at the argument we got.  We use all the common list separators.
9283      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9284      for pkg in $enableval; do
9285	IFS="$lt_save_ifs"
9286	if test "X$pkg" = "X$p"; then
9287	  enable_shared=yes
9288	fi
9289      done
9290      IFS="$lt_save_ifs"
9291      ;;
9292    esac],
9293    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9294
9295    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9296	[Whether or not to build shared libraries])
9297])# _LT_ENABLE_SHARED
9298
9299LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9300LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9301
9302# Old names:
9303AC_DEFUN([AC_ENABLE_SHARED],
9304[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9305])
9306
9307AC_DEFUN([AC_DISABLE_SHARED],
9308[_LT_SET_OPTION([LT_INIT], [disable-shared])
9309])
9310
9311AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9312AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9313
9314dnl aclocal-1.4 backwards compatibility:
9315dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9316dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9317
9318
9319
9320# _LT_ENABLE_STATIC([DEFAULT])
9321# ----------------------------
9322# implement the --enable-static flag, and support the `static' and
9323# `disable-static' LT_INIT options.
9324# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9325m4_define([_LT_ENABLE_STATIC],
9326[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9327AC_ARG_ENABLE([static],
9328    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9329	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9330    [p=${PACKAGE-default}
9331    case $enableval in
9332    yes) enable_static=yes ;;
9333    no) enable_static=no ;;
9334    *)
9335     enable_static=no
9336      # Look at the argument we got.  We use all the common list separators.
9337      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9338      for pkg in $enableval; do
9339	IFS="$lt_save_ifs"
9340	if test "X$pkg" = "X$p"; then
9341	  enable_static=yes
9342	fi
9343      done
9344      IFS="$lt_save_ifs"
9345      ;;
9346    esac],
9347    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9348
9349    _LT_DECL([build_old_libs], [enable_static], [0],
9350	[Whether or not to build static libraries])
9351])# _LT_ENABLE_STATIC
9352
9353LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9354LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9355
9356# Old names:
9357AC_DEFUN([AC_ENABLE_STATIC],
9358[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9359])
9360
9361AC_DEFUN([AC_DISABLE_STATIC],
9362[_LT_SET_OPTION([LT_INIT], [disable-static])
9363])
9364
9365AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9366AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9367
9368dnl aclocal-1.4 backwards compatibility:
9369dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9370dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9371
9372
9373
9374# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9375# ----------------------------------
9376# implement the --enable-fast-install flag, and support the `fast-install'
9377# and `disable-fast-install' LT_INIT options.
9378# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9379m4_define([_LT_ENABLE_FAST_INSTALL],
9380[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9381AC_ARG_ENABLE([fast-install],
9382    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9383    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9384    [p=${PACKAGE-default}
9385    case $enableval in
9386    yes) enable_fast_install=yes ;;
9387    no) enable_fast_install=no ;;
9388    *)
9389      enable_fast_install=no
9390      # Look at the argument we got.  We use all the common list separators.
9391      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9392      for pkg in $enableval; do
9393	IFS="$lt_save_ifs"
9394	if test "X$pkg" = "X$p"; then
9395	  enable_fast_install=yes
9396	fi
9397      done
9398      IFS="$lt_save_ifs"
9399      ;;
9400    esac],
9401    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9402
9403_LT_DECL([fast_install], [enable_fast_install], [0],
9404	 [Whether or not to optimize for fast installation])dnl
9405])# _LT_ENABLE_FAST_INSTALL
9406
9407LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9408LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9409
9410# Old names:
9411AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9412[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9413AC_DIAGNOSE([obsolete],
9414[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9415the `fast-install' option into LT_INIT's first parameter.])
9416])
9417
9418AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9419[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9420AC_DIAGNOSE([obsolete],
9421[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9422the `disable-fast-install' option into LT_INIT's first parameter.])
9423])
9424
9425dnl aclocal-1.4 backwards compatibility:
9426dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9427dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9428
9429
9430# _LT_WITH_PIC([MODE])
9431# --------------------
9432# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9433# LT_INIT options.
9434# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9435m4_define([_LT_WITH_PIC],
9436[AC_ARG_WITH([pic],
9437    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9438	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9439    [lt_p=${PACKAGE-default}
9440    case $withval in
9441    yes|no) pic_mode=$withval ;;
9442    *)
9443      pic_mode=default
9444      # Look at the argument we got.  We use all the common list separators.
9445      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9446      for lt_pkg in $withval; do
9447	IFS="$lt_save_ifs"
9448	if test "X$lt_pkg" = "X$lt_p"; then
9449	  pic_mode=yes
9450	fi
9451      done
9452      IFS="$lt_save_ifs"
9453      ;;
9454    esac],
9455    [pic_mode=default])
9456
9457test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9458
9459_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9460])# _LT_WITH_PIC
9461
9462LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9463LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9464
9465# Old name:
9466AU_DEFUN([AC_LIBTOOL_PICMODE],
9467[_LT_SET_OPTION([LT_INIT], [pic-only])
9468AC_DIAGNOSE([obsolete],
9469[$0: Remove this warning and the call to _LT_SET_OPTION when you
9470put the `pic-only' option into LT_INIT's first parameter.])
9471])
9472
9473dnl aclocal-1.4 backwards compatibility:
9474dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9475
9476
9477m4_define([_LTDL_MODE], [])
9478LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9479		 [m4_define([_LTDL_MODE], [nonrecursive])])
9480LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9481		 [m4_define([_LTDL_MODE], [recursive])])
9482LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9483		 [m4_define([_LTDL_MODE], [subproject])])
9484
9485m4_define([_LTDL_TYPE], [])
9486LT_OPTION_DEFINE([LTDL_INIT], [installable],
9487		 [m4_define([_LTDL_TYPE], [installable])])
9488LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9489		 [m4_define([_LTDL_TYPE], [convenience])])
9490
9491# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9492#
9493# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9494# Written by Gary V. Vaughan, 2004
9495#
9496# This file is free software; the Free Software Foundation gives
9497# unlimited permission to copy and/or distribute it, with or without
9498# modifications, as long as this notice is preserved.
9499
9500# serial 6 ltsugar.m4
9501
9502# This is to help aclocal find these macros, as it can't see m4_define.
9503AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9504
9505
9506# lt_join(SEP, ARG1, [ARG2...])
9507# -----------------------------
9508# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9509# associated separator.
9510# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9511# versions in m4sugar had bugs.
9512m4_define([lt_join],
9513[m4_if([$#], [1], [],
9514       [$#], [2], [[$2]],
9515       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9516m4_define([_lt_join],
9517[m4_if([$#$2], [2], [],
9518       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9519
9520
9521# lt_car(LIST)
9522# lt_cdr(LIST)
9523# ------------
9524# Manipulate m4 lists.
9525# These macros are necessary as long as will still need to support
9526# Autoconf-2.59 which quotes differently.
9527m4_define([lt_car], [[$1]])
9528m4_define([lt_cdr],
9529[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9530       [$#], 1, [],
9531       [m4_dquote(m4_shift($@))])])
9532m4_define([lt_unquote], $1)
9533
9534
9535# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9536# ------------------------------------------
9537# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9538# Note that neither SEPARATOR nor STRING are expanded; they are appended
9539# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9540# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9541# than defined and empty).
9542#
9543# This macro is needed until we can rely on Autoconf 2.62, since earlier
9544# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9545m4_define([lt_append],
9546[m4_define([$1],
9547	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9548
9549
9550
9551# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9552# ----------------------------------------------------------
9553# Produce a SEP delimited list of all paired combinations of elements of
9554# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9555# has the form PREFIXmINFIXSUFFIXn.
9556# Needed until we can rely on m4_combine added in Autoconf 2.62.
9557m4_define([lt_combine],
9558[m4_if(m4_eval([$# > 3]), [1],
9559       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9560[[m4_foreach([_Lt_prefix], [$2],
9561	     [m4_foreach([_Lt_suffix],
9562		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9563	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9564
9565
9566# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9567# -----------------------------------------------------------------------
9568# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9569# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9570m4_define([lt_if_append_uniq],
9571[m4_ifdef([$1],
9572	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9573		 [lt_append([$1], [$2], [$3])$4],
9574		 [$5])],
9575	  [lt_append([$1], [$2], [$3])$4])])
9576
9577
9578# lt_dict_add(DICT, KEY, VALUE)
9579# -----------------------------
9580m4_define([lt_dict_add],
9581[m4_define([$1($2)], [$3])])
9582
9583
9584# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9585# --------------------------------------------
9586m4_define([lt_dict_add_subkey],
9587[m4_define([$1($2:$3)], [$4])])
9588
9589
9590# lt_dict_fetch(DICT, KEY, [SUBKEY])
9591# ----------------------------------
9592m4_define([lt_dict_fetch],
9593[m4_ifval([$3],
9594	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9595    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9596
9597
9598# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9599# -----------------------------------------------------------------
9600m4_define([lt_if_dict_fetch],
9601[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9602	[$5],
9603    [$6])])
9604
9605
9606# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9607# --------------------------------------------------------------
9608m4_define([lt_dict_filter],
9609[m4_if([$5], [], [],
9610  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9611           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9612		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9613])
9614
9615# ltversion.m4 -- version numbers			-*- Autoconf -*-
9616#
9617#   Copyright (C) 2004 Free Software Foundation, Inc.
9618#   Written by Scott James Remnant, 2004
9619#
9620# This file is free software; the Free Software Foundation gives
9621# unlimited permission to copy and/or distribute it, with or without
9622# modifications, as long as this notice is preserved.
9623
9624# @configure_input@
9625
9626# serial 3337 ltversion.m4
9627# This file is part of GNU Libtool
9628
9629m4_define([LT_PACKAGE_VERSION], [2.4.2])
9630m4_define([LT_PACKAGE_REVISION], [1.3337])
9631
9632AC_DEFUN([LTVERSION_VERSION],
9633[macro_version='2.4.2'
9634macro_revision='1.3337'
9635_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9636_LT_DECL(, macro_revision, 0)
9637])
9638
9639# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9640#
9641#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9642#   Written by Scott James Remnant, 2004.
9643#
9644# This file is free software; the Free Software Foundation gives
9645# unlimited permission to copy and/or distribute it, with or without
9646# modifications, as long as this notice is preserved.
9647
9648# serial 5 lt~obsolete.m4
9649
9650# These exist entirely to fool aclocal when bootstrapping libtool.
9651#
9652# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9653# which have later been changed to m4_define as they aren't part of the
9654# exported API, or moved to Autoconf or Automake where they belong.
9655#
9656# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9657# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9658# using a macro with the same name in our local m4/libtool.m4 it'll
9659# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9660# and doesn't know about Autoconf macros at all.)
9661#
9662# So we provide this file, which has a silly filename so it's always
9663# included after everything else.  This provides aclocal with the
9664# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9665# because those macros already exist, or will be overwritten later.
9666# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9667#
9668# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9669# Yes, that means every name once taken will need to remain here until
9670# we give up compatibility with versions before 1.7, at which point
9671# we need to keep only those names which we still refer to.
9672
9673# This is to help aclocal find these macros, as it can't see m4_define.
9674AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9675
9676m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9677m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9678m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9679m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9680m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9681m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9682m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9683m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9684m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9685m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9686m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9687m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9688m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9689m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9690m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9691m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9692m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9693m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9694m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9695m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9696m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9697m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9698m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9699m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9700m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9701m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9702m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9703m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9704m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9705m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9706m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9707m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9708m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9709m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9710m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9711m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9712m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9713m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9714m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9715m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9716m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9717m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9718m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9719m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9720m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9721m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9722m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9723m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9724m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9725m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9726m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9727m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9728m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9729m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9730m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9731m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9732m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9733m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9734m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9735m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9736m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9737
9738# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9739# 
9740# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9741#
9742# This program is free software; you can redistribute it and/or modify
9743# it under the terms of the GNU General Public License as published by
9744# the Free Software Foundation; either version 2 of the License, or
9745# (at your option) any later version.
9746#
9747# This program is distributed in the hope that it will be useful, but
9748# WITHOUT ANY WARRANTY; without even the implied warranty of
9749# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9750# General Public License for more details.
9751#
9752# You should have received a copy of the GNU General Public License
9753# along with this program; if not, write to the Free Software
9754# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9755#
9756# As a special exception to the GNU General Public License, if you
9757# distribute this file as part of a program that contains a
9758# configuration script generated by Autoconf, you may include it under
9759# the same distribution terms that you use for the rest of that program.
9760
9761# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9762# ----------------------------------
9763AC_DEFUN([PKG_PROG_PKG_CONFIG],
9764[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9765m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9766AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9767if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9768	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9769fi
9770if test -n "$PKG_CONFIG"; then
9771	_pkg_min_version=m4_default([$1], [0.9.0])
9772	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9773	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9774		AC_MSG_RESULT([yes])
9775	else
9776		AC_MSG_RESULT([no])
9777		PKG_CONFIG=""
9778	fi
9779		
9780fi[]dnl
9781])# PKG_PROG_PKG_CONFIG
9782
9783# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9784#
9785# Check to see whether a particular set of modules exists.  Similar
9786# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9787#
9788#
9789# Similar to PKG_CHECK_MODULES, make sure that the first instance of
9790# this or PKG_CHECK_MODULES is called, or make sure to call
9791# PKG_CHECK_EXISTS manually
9792# --------------------------------------------------------------
9793AC_DEFUN([PKG_CHECK_EXISTS],
9794[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9795if test -n "$PKG_CONFIG" && \
9796    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9797  m4_ifval([$2], [$2], [:])
9798m4_ifvaln([$3], [else
9799  $3])dnl
9800fi])
9801
9802
9803# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9804# ---------------------------------------------
9805m4_define([_PKG_CONFIG],
9806[if test -n "$$1"; then
9807    pkg_cv_[]$1="$$1"
9808 elif test -n "$PKG_CONFIG"; then
9809    PKG_CHECK_EXISTS([$3],
9810                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9811		     [pkg_failed=yes])
9812 else
9813    pkg_failed=untried
9814fi[]dnl
9815])# _PKG_CONFIG
9816
9817# _PKG_SHORT_ERRORS_SUPPORTED
9818# -----------------------------
9819AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9820[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9821if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9822        _pkg_short_errors_supported=yes
9823else
9824        _pkg_short_errors_supported=no
9825fi[]dnl
9826])# _PKG_SHORT_ERRORS_SUPPORTED
9827
9828
9829# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9830# [ACTION-IF-NOT-FOUND])
9831#
9832#
9833# Note that if there is a possibility the first call to
9834# PKG_CHECK_MODULES might not happen, you should be sure to include an
9835# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9836#
9837#
9838# --------------------------------------------------------------
9839AC_DEFUN([PKG_CHECK_MODULES],
9840[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9841AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9842AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9843
9844pkg_failed=no
9845AC_MSG_CHECKING([for $1])
9846
9847_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9848_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9849
9850m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9851and $1[]_LIBS to avoid the need to call pkg-config.
9852See the pkg-config man page for more details.])
9853
9854if test $pkg_failed = yes; then
9855        _PKG_SHORT_ERRORS_SUPPORTED
9856        if test $_pkg_short_errors_supported = yes; then
9857	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9858        else 
9859	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9860        fi
9861	# Put the nasty error message in config.log where it belongs
9862	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9863
9864	ifelse([$4], , [AC_MSG_ERROR(dnl
9865[Package requirements ($2) were not met:
9866
9867$$1_PKG_ERRORS
9868
9869Consider adjusting the PKG_CONFIG_PATH environment variable if you
9870installed software in a non-standard prefix.
9871
9872_PKG_TEXT
9873])],
9874		[AC_MSG_RESULT([no])
9875                $4])
9876elif test $pkg_failed = untried; then
9877	ifelse([$4], , [AC_MSG_FAILURE(dnl
9878[The pkg-config script could not be found or is too old.  Make sure it
9879is in your PATH or set the PKG_CONFIG environment variable to the full
9880path to pkg-config.
9881
9882_PKG_TEXT
9883
9884To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9885		[$4])
9886else
9887	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9888	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9889        AC_MSG_RESULT([yes])
9890	ifelse([$3], , :, [$3])
9891fi[]dnl
9892])# PKG_CHECK_MODULES
9893
9894dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9895dnl
9896dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9897dnl
9898dnl Permission is hereby granted, free of charge, to any person obtaining a
9899dnl copy of this software and associated documentation files (the "Software"),
9900dnl to deal in the Software without restriction, including without limitation
9901dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9902dnl and/or sell copies of the Software, and to permit persons to whom the
9903dnl Software is furnished to do so, subject to the following conditions:
9904dnl
9905dnl The above copyright notice and this permission notice (including the next
9906dnl paragraph) shall be included in all copies or substantial portions of the
9907dnl Software.
9908dnl
9909dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9910dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9911dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9912dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9913dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9914dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9915dnl DEALINGS IN THE SOFTWARE.
9916
9917# XORG_MACROS_VERSION(required-version)
9918# -------------------------------------
9919# Minimum version: 1.1.0
9920#
9921# If you're using a macro added in Version 1.1 or newer, include this in
9922# your configure.ac with the minimum required version, such as:
9923# XORG_MACROS_VERSION(1.1)
9924#
9925# To ensure that this macro is defined, also add:
9926# m4_ifndef([XORG_MACROS_VERSION],
9927#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9928#
9929#
9930# See the "minimum version" comment for each macro you use to see what
9931# version you require.
9932m4_defun([XORG_MACROS_VERSION],[
9933m4_define([vers_have], [1.17.1])
9934m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9935m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9936m4_if(m4_cmp(maj_have, maj_needed), 0,,
9937    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9938m4_if(m4_version_compare(vers_have, [$1]), -1,
9939    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9940m4_undefine([vers_have])
9941m4_undefine([maj_have])
9942m4_undefine([maj_needed])
9943]) # XORG_MACROS_VERSION
9944
9945# XORG_PROG_RAWCPP()
9946# ------------------
9947# Minimum version: 1.0.0
9948#
9949# Find cpp program and necessary flags for use in pre-processing text files
9950# such as man pages and config files
9951AC_DEFUN([XORG_PROG_RAWCPP],[
9952AC_REQUIRE([AC_PROG_CPP])
9953AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9954   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9955
9956# Check for flag to avoid builtin definitions - assumes unix is predefined,
9957# which is not the best choice for supporting other OS'es, but covers most
9958# of the ones we need for now.
9959AC_MSG_CHECKING([if $RAWCPP requires -undef])
9960AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9961if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9962	AC_MSG_RESULT([no])
9963else
9964	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9965		RAWCPPFLAGS=-undef
9966		AC_MSG_RESULT([yes])
9967	# under Cygwin unix is still defined even with -undef
9968	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9969		RAWCPPFLAGS="-undef -ansi"
9970		AC_MSG_RESULT([yes, with -ansi])
9971	else
9972		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9973	fi
9974fi
9975rm -f conftest.$ac_ext
9976
9977AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9978AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9979if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9980	AC_MSG_RESULT([no])
9981else
9982	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9983		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9984		AC_MSG_RESULT([yes])
9985	else
9986		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9987	fi
9988fi
9989rm -f conftest.$ac_ext
9990AC_SUBST(RAWCPPFLAGS)
9991]) # XORG_PROG_RAWCPP
9992
9993# XORG_MANPAGE_SECTIONS()
9994# -----------------------
9995# Minimum version: 1.0.0
9996#
9997# Determine which sections man pages go in for the different man page types
9998# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9999# Not sure if there's any better way than just hardcoding by OS name.
10000# Override default settings by setting environment variables
10001# Added MAN_SUBSTS in version 1.8
10002# Added AC_PROG_SED in version 1.8
10003
10004AC_DEFUN([XORG_MANPAGE_SECTIONS],[
10005AC_REQUIRE([AC_CANONICAL_HOST])
10006AC_REQUIRE([AC_PROG_SED])
10007
10008if test x$APP_MAN_SUFFIX = x    ; then
10009    APP_MAN_SUFFIX=1
10010fi
10011if test x$APP_MAN_DIR = x    ; then
10012    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10013fi
10014
10015if test x$LIB_MAN_SUFFIX = x    ; then
10016    LIB_MAN_SUFFIX=3
10017fi
10018if test x$LIB_MAN_DIR = x    ; then
10019    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10020fi
10021
10022if test x$FILE_MAN_SUFFIX = x    ; then
10023    case $host_os in
10024	solaris*)	FILE_MAN_SUFFIX=4  ;;
10025	*)		FILE_MAN_SUFFIX=5  ;;
10026    esac
10027fi
10028if test x$FILE_MAN_DIR = x    ; then
10029    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10030fi
10031
10032if test x$MISC_MAN_SUFFIX = x    ; then
10033    case $host_os in
10034	solaris*)	MISC_MAN_SUFFIX=5  ;;
10035	*)		MISC_MAN_SUFFIX=7  ;;
10036    esac
10037fi
10038if test x$MISC_MAN_DIR = x    ; then
10039    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10040fi
10041
10042if test x$DRIVER_MAN_SUFFIX = x    ; then
10043    case $host_os in
10044	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10045	*)		DRIVER_MAN_SUFFIX=4  ;;
10046    esac
10047fi
10048if test x$DRIVER_MAN_DIR = x    ; then
10049    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10050fi
10051
10052if test x$ADMIN_MAN_SUFFIX = x    ; then
10053    case $host_os in
10054	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10055	*)		ADMIN_MAN_SUFFIX=8  ;;
10056    esac
10057fi
10058if test x$ADMIN_MAN_DIR = x    ; then
10059    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10060fi
10061
10062
10063AC_SUBST([APP_MAN_SUFFIX])
10064AC_SUBST([LIB_MAN_SUFFIX])
10065AC_SUBST([FILE_MAN_SUFFIX])
10066AC_SUBST([MISC_MAN_SUFFIX])
10067AC_SUBST([DRIVER_MAN_SUFFIX])
10068AC_SUBST([ADMIN_MAN_SUFFIX])
10069AC_SUBST([APP_MAN_DIR])
10070AC_SUBST([LIB_MAN_DIR])
10071AC_SUBST([FILE_MAN_DIR])
10072AC_SUBST([MISC_MAN_DIR])
10073AC_SUBST([DRIVER_MAN_DIR])
10074AC_SUBST([ADMIN_MAN_DIR])
10075
10076XORG_MAN_PAGE="X Version 11"
10077AC_SUBST([XORG_MAN_PAGE])
10078MAN_SUBSTS="\
10079	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10080	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10081	-e 's|__xservername__|Xorg|g' \
10082	-e 's|__xconfigfile__|xorg.conf|g' \
10083	-e 's|__projectroot__|\$(prefix)|g' \
10084	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
10085	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
10086	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
10087	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
10088	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
10089	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
10090	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
10091AC_SUBST([MAN_SUBSTS])
10092
10093]) # XORG_MANPAGE_SECTIONS
10094
10095# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
10096# ------------------------
10097# Minimum version: 1.7.0
10098#
10099# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
10100# provided by xorg-sgml-doctools, if installed.
10101AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
10102AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
10103XORG_SGML_PATH=
10104PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
10105    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
10106    [m4_ifval([$1],[:],
10107        [if test x"$cross_compiling" != x"yes" ; then
10108            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
10109                          [XORG_SGML_PATH=$prefix/share/sgml])
10110         fi])
10111    ])
10112
10113# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10114# the path and the name of the doc stylesheet
10115if test "x$XORG_SGML_PATH" != "x" ; then
10116   AC_MSG_RESULT([$XORG_SGML_PATH])
10117   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10118   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10119else
10120   AC_MSG_RESULT([no])
10121fi
10122
10123AC_SUBST(XORG_SGML_PATH)
10124AC_SUBST(STYLESHEET_SRCDIR)
10125AC_SUBST(XSL_STYLESHEET)
10126AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10127]) # XORG_CHECK_SGML_DOCTOOLS
10128
10129# XORG_CHECK_LINUXDOC
10130# -------------------
10131# Minimum version: 1.0.0
10132#
10133# Defines the variable MAKE_TEXT if the necessary tools and
10134# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10135# Whether or not the necessary tools and files are found can be checked
10136# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10137AC_DEFUN([XORG_CHECK_LINUXDOC],[
10138AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10139AC_REQUIRE([XORG_WITH_PS2PDF])
10140
10141AC_PATH_PROG(LINUXDOC, linuxdoc)
10142
10143AC_MSG_CHECKING([whether to build documentation])
10144
10145if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10146   BUILDDOC=yes
10147else
10148   BUILDDOC=no
10149fi
10150
10151AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10152
10153AC_MSG_RESULT([$BUILDDOC])
10154
10155AC_MSG_CHECKING([whether to build pdf documentation])
10156
10157if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10158   BUILDPDFDOC=yes
10159else
10160   BUILDPDFDOC=no
10161fi
10162
10163AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10164
10165AC_MSG_RESULT([$BUILDPDFDOC])
10166
10167MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10168MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10169MAKE_PDF="$PS2PDF"
10170MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10171
10172AC_SUBST(MAKE_TEXT)
10173AC_SUBST(MAKE_PS)
10174AC_SUBST(MAKE_PDF)
10175AC_SUBST(MAKE_HTML)
10176]) # XORG_CHECK_LINUXDOC
10177
10178# XORG_CHECK_DOCBOOK
10179# -------------------
10180# Minimum version: 1.0.0
10181#
10182# Checks for the ability to build output formats from SGML DocBook source.
10183# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10184# indicates whether the necessary tools and files are found and, if set,
10185# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10186AC_DEFUN([XORG_CHECK_DOCBOOK],[
10187AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10188
10189BUILDTXTDOC=no
10190BUILDPDFDOC=no
10191BUILDPSDOC=no
10192BUILDHTMLDOC=no
10193
10194AC_PATH_PROG(DOCBOOKPS, docbook2ps)
10195AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10196AC_PATH_PROG(DOCBOOKHTML, docbook2html)
10197AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10198
10199AC_MSG_CHECKING([whether to build text documentation])
10200if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10201   test x$BUILD_TXTDOC != xno; then
10202	BUILDTXTDOC=yes
10203fi
10204AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10205AC_MSG_RESULT([$BUILDTXTDOC])
10206
10207AC_MSG_CHECKING([whether to build PDF documentation])
10208if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10209   test x$BUILD_PDFDOC != xno; then
10210	BUILDPDFDOC=yes
10211fi
10212AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10213AC_MSG_RESULT([$BUILDPDFDOC])
10214
10215AC_MSG_CHECKING([whether to build PostScript documentation])
10216if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10217   test x$BUILD_PSDOC != xno; then
10218	BUILDPSDOC=yes
10219fi
10220AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10221AC_MSG_RESULT([$BUILDPSDOC])
10222
10223AC_MSG_CHECKING([whether to build HTML documentation])
10224if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10225   test x$BUILD_HTMLDOC != xno; then
10226	BUILDHTMLDOC=yes
10227fi
10228AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10229AC_MSG_RESULT([$BUILDHTMLDOC])
10230
10231MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10232MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10233MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10234MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10235
10236AC_SUBST(MAKE_TEXT)
10237AC_SUBST(MAKE_PS)
10238AC_SUBST(MAKE_PDF)
10239AC_SUBST(MAKE_HTML)
10240]) # XORG_CHECK_DOCBOOK
10241
10242# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10243# ----------------
10244# Minimum version: 1.5.0
10245# Minimum version for optional DEFAULT argument: 1.11.0
10246#
10247# Documentation tools are not always available on all platforms and sometimes
10248# not at the appropriate level. This macro enables a module to test for the
10249# presence of the tool and obtain it's path in separate variables. Coupled with
10250# the --with-xmlto option, it allows maximum flexibilty in making decisions
10251# as whether or not to use the xmlto package. When DEFAULT is not specified,
10252# --with-xmlto assumes 'auto'.
10253#
10254# Interface to module:
10255# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10256# XMLTO:	returns the path of the xmlto program found
10257#		returns the path set by the user in the environment
10258# --with-xmlto:	'yes' user instructs the module to use xmlto
10259#		'no' user instructs the module not to use xmlto
10260#
10261# Added in version 1.10.0
10262# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10263#                  xmlto for text output requires either lynx, links, or w3m browsers
10264#
10265# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10266#
10267AC_DEFUN([XORG_WITH_XMLTO],[
10268AC_ARG_VAR([XMLTO], [Path to xmlto command])
10269m4_define([_defopt], m4_default([$2], [auto]))
10270AC_ARG_WITH(xmlto,
10271	AS_HELP_STRING([--with-xmlto],
10272	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10273	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10274m4_undefine([_defopt])
10275
10276if test "x$use_xmlto" = x"auto"; then
10277   AC_PATH_PROG([XMLTO], [xmlto])
10278   if test "x$XMLTO" = "x"; then
10279        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10280	have_xmlto=no
10281   else
10282        have_xmlto=yes
10283   fi
10284elif test "x$use_xmlto" = x"yes" ; then
10285   AC_PATH_PROG([XMLTO], [xmlto])
10286   if test "x$XMLTO" = "x"; then
10287        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10288   fi
10289   have_xmlto=yes
10290elif test "x$use_xmlto" = x"no" ; then
10291   if test "x$XMLTO" != "x"; then
10292      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10293   fi
10294   have_xmlto=no
10295else
10296   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10297fi
10298
10299# Test for a minimum version of xmlto, if provided.
10300m4_ifval([$1],
10301[if test "$have_xmlto" = yes; then
10302    # scrape the xmlto version
10303    AC_MSG_CHECKING([the xmlto version])
10304    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10305    AC_MSG_RESULT([$xmlto_version])
10306    AS_VERSION_COMPARE([$xmlto_version], [$1],
10307        [if test "x$use_xmlto" = xauto; then
10308            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10309            have_xmlto=no
10310        else
10311            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10312        fi])
10313fi])
10314
10315# Test for the ability of xmlto to generate a text target
10316have_xmlto_text=no
10317cat > conftest.xml << "EOF"
10318EOF
10319AS_IF([test "$have_xmlto" = yes],
10320      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10321             [have_xmlto_text=yes],
10322             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10323rm -f conftest.xml
10324AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10325AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10326]) # XORG_WITH_XMLTO
10327
10328# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10329# --------------------------------------------
10330# Minimum version: 1.12.0
10331# Minimum version for optional DEFAULT argument: 1.12.0
10332#
10333# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10334# XML-based language used for the transformation of XML documents.
10335# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10336# It is used under the cover by xmlto to generate html files from DocBook/XML.
10337# The XSLT processor is often used as a standalone tool for transformations.
10338# It should not be assumed that this tool is used only to work with documnetation.
10339# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10340#
10341# Interface to module:
10342# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10343# XSLTPROC:	 returns the path of the xsltproc program found
10344#		 returns the path set by the user in the environment
10345# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10346#		  'no' user instructs the module not to use xsltproc
10347# have_xsltproc: returns yes if xsltproc found in PATH or no
10348#
10349# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10350#
10351AC_DEFUN([XORG_WITH_XSLTPROC],[
10352AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10353# Preserves the interface, should it be implemented later
10354m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10355m4_define([_defopt], m4_default([$2], [auto]))
10356AC_ARG_WITH(xsltproc,
10357	AS_HELP_STRING([--with-xsltproc],
10358	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10359	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10360m4_undefine([_defopt])
10361
10362if test "x$use_xsltproc" = x"auto"; then
10363   AC_PATH_PROG([XSLTPROC], [xsltproc])
10364   if test "x$XSLTPROC" = "x"; then
10365        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10366	have_xsltproc=no
10367   else
10368        have_xsltproc=yes
10369   fi
10370elif test "x$use_xsltproc" = x"yes" ; then
10371   AC_PATH_PROG([XSLTPROC], [xsltproc])
10372   if test "x$XSLTPROC" = "x"; then
10373        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10374   fi
10375   have_xsltproc=yes
10376elif test "x$use_xsltproc" = x"no" ; then
10377   if test "x$XSLTPROC" != "x"; then
10378      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10379   fi
10380   have_xsltproc=no
10381else
10382   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10383fi
10384
10385AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10386]) # XORG_WITH_XSLTPROC
10387
10388# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10389# ----------------------------------------
10390# Minimum version: 1.15.0
10391#
10392# PERL (Practical Extraction and Report Language) is a language optimized for
10393# scanning arbitrary text files, extracting information from those text files,
10394# and printing reports based on that information.
10395#
10396# When DEFAULT is not specified, --with-perl assumes 'auto'.
10397#
10398# Interface to module:
10399# HAVE_PERL: used in makefiles to conditionally scan text files
10400# PERL:	     returns the path of the perl program found
10401#	     returns the path set by the user in the environment
10402# --with-perl: 'yes' user instructs the module to use perl
10403#	       'no' user instructs the module not to use perl
10404# have_perl: returns yes if perl found in PATH or no
10405#
10406# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10407#
10408AC_DEFUN([XORG_WITH_PERL],[
10409AC_ARG_VAR([PERL], [Path to perl command])
10410# Preserves the interface, should it be implemented later
10411m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10412m4_define([_defopt], m4_default([$2], [auto]))
10413AC_ARG_WITH(perl,
10414	AS_HELP_STRING([--with-perl],
10415	   [Use perl for extracting information from files (default: ]_defopt[)]),
10416	   [use_perl=$withval], [use_perl=]_defopt)
10417m4_undefine([_defopt])
10418
10419if test "x$use_perl" = x"auto"; then
10420   AC_PATH_PROG([PERL], [perl])
10421   if test "x$PERL" = "x"; then
10422        AC_MSG_WARN([perl not found - cannot extract information and report])
10423	have_perl=no
10424   else
10425        have_perl=yes
10426   fi
10427elif test "x$use_perl" = x"yes" ; then
10428   AC_PATH_PROG([PERL], [perl])
10429   if test "x$PERL" = "x"; then
10430        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10431   fi
10432   have_perl=yes
10433elif test "x$use_perl" = x"no" ; then
10434   if test "x$PERL" != "x"; then
10435      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10436   fi
10437   have_perl=no
10438else
10439   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10440fi
10441
10442AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10443]) # XORG_WITH_PERL
10444
10445# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10446# ----------------
10447# Minimum version: 1.5.0
10448# Minimum version for optional DEFAULT argument: 1.11.0
10449#
10450# Documentation tools are not always available on all platforms and sometimes
10451# not at the appropriate level. This macro enables a module to test for the
10452# presence of the tool and obtain it's path in separate variables. Coupled with
10453# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10454# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10455# --with-asciidoc assumes 'auto'.
10456#
10457# Interface to module:
10458# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10459# ASCIIDOC:	 returns the path of the asciidoc program found
10460#		 returns the path set by the user in the environment
10461# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10462#		  'no' user instructs the module not to use asciidoc
10463#
10464# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10465#
10466AC_DEFUN([XORG_WITH_ASCIIDOC],[
10467AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10468m4_define([_defopt], m4_default([$2], [auto]))
10469AC_ARG_WITH(asciidoc,
10470	AS_HELP_STRING([--with-asciidoc],
10471	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10472	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10473m4_undefine([_defopt])
10474
10475if test "x$use_asciidoc" = x"auto"; then
10476   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10477   if test "x$ASCIIDOC" = "x"; then
10478        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10479	have_asciidoc=no
10480   else
10481        have_asciidoc=yes
10482   fi
10483elif test "x$use_asciidoc" = x"yes" ; then
10484   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10485   if test "x$ASCIIDOC" = "x"; then
10486        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10487   fi
10488   have_asciidoc=yes
10489elif test "x$use_asciidoc" = x"no" ; then
10490   if test "x$ASCIIDOC" != "x"; then
10491      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10492   fi
10493   have_asciidoc=no
10494else
10495   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10496fi
10497m4_ifval([$1],
10498[if test "$have_asciidoc" = yes; then
10499    # scrape the asciidoc version
10500    AC_MSG_CHECKING([the asciidoc version])
10501    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10502    AC_MSG_RESULT([$asciidoc_version])
10503    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10504        [if test "x$use_asciidoc" = xauto; then
10505            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10506            have_asciidoc=no
10507        else
10508            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10509        fi])
10510fi])
10511AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10512]) # XORG_WITH_ASCIIDOC
10513
10514# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10515# --------------------------------
10516# Minimum version: 1.5.0
10517# Minimum version for optional DEFAULT argument: 1.11.0
10518#
10519# Documentation tools are not always available on all platforms and sometimes
10520# not at the appropriate level. This macro enables a module to test for the
10521# presence of the tool and obtain it's path in separate variables. Coupled with
10522# the --with-doxygen option, it allows maximum flexibilty in making decisions
10523# as whether or not to use the doxygen package. When DEFAULT is not specified,
10524# --with-doxygen assumes 'auto'.
10525#
10526# Interface to module:
10527# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10528# DOXYGEN:	 returns the path of the doxygen program found
10529#		 returns the path set by the user in the environment
10530# --with-doxygen: 'yes' user instructs the module to use doxygen
10531#		  'no' user instructs the module not to use doxygen
10532#
10533# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10534#
10535AC_DEFUN([XORG_WITH_DOXYGEN],[
10536AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10537m4_define([_defopt], m4_default([$2], [auto]))
10538AC_ARG_WITH(doxygen,
10539	AS_HELP_STRING([--with-doxygen],
10540	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10541	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10542m4_undefine([_defopt])
10543
10544if test "x$use_doxygen" = x"auto"; then
10545   AC_PATH_PROG([DOXYGEN], [doxygen])
10546   if test "x$DOXYGEN" = "x"; then
10547        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10548	have_doxygen=no
10549   else
10550        have_doxygen=yes
10551   fi
10552elif test "x$use_doxygen" = x"yes" ; then
10553   AC_PATH_PROG([DOXYGEN], [doxygen])
10554   if test "x$DOXYGEN" = "x"; then
10555        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10556   fi
10557   have_doxygen=yes
10558elif test "x$use_doxygen" = x"no" ; then
10559   if test "x$DOXYGEN" != "x"; then
10560      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10561   fi
10562   have_doxygen=no
10563else
10564   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10565fi
10566m4_ifval([$1],
10567[if test "$have_doxygen" = yes; then
10568    # scrape the doxygen version
10569    AC_MSG_CHECKING([the doxygen version])
10570    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10571    AC_MSG_RESULT([$doxygen_version])
10572    AS_VERSION_COMPARE([$doxygen_version], [$1],
10573        [if test "x$use_doxygen" = xauto; then
10574            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10575            have_doxygen=no
10576        else
10577            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10578        fi])
10579fi])
10580AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10581]) # XORG_WITH_DOXYGEN
10582
10583# XORG_WITH_GROFF([DEFAULT])
10584# ----------------
10585# Minimum version: 1.6.0
10586# Minimum version for optional DEFAULT argument: 1.11.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-groff option, it allows maximum flexibilty in making decisions
10592# as whether or not to use the groff package. When DEFAULT is not specified,
10593# --with-groff assumes 'auto'.
10594#
10595# Interface to module:
10596# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10597# HAVE_GROFF_MM: the memorandum macros (-mm) package
10598# HAVE_GROFF_MS: the -ms macros package
10599# GROFF:	 returns the path of the groff program found
10600#		 returns the path set by the user in the environment
10601# --with-groff:	 'yes' user instructs the module to use groff
10602#		 'no' user instructs the module not to use groff
10603#
10604# Added in version 1.9.0:
10605# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10606#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10607#		   psselect from the psutils package.
10608#		   the ghostcript package. Refer to the grohtml man pages
10609#
10610# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10611#
10612# OS and distros often splits groff in a basic and full package, the former
10613# having the groff program and the later having devices, fonts and macros
10614# Checking for the groff executable is not enough.
10615#
10616# If macros are missing, we cannot assume that groff is useless, so we don't
10617# unset HAVE_GROFF or GROFF env variables.
10618# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10619#
10620AC_DEFUN([XORG_WITH_GROFF],[
10621AC_ARG_VAR([GROFF], [Path to groff command])
10622m4_define([_defopt], m4_default([$1], [auto]))
10623AC_ARG_WITH(groff,
10624	AS_HELP_STRING([--with-groff],
10625	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10626	   [use_groff=$withval], [use_groff=]_defopt)
10627m4_undefine([_defopt])
10628
10629if test "x$use_groff" = x"auto"; then
10630   AC_PATH_PROG([GROFF], [groff])
10631   if test "x$GROFF" = "x"; then
10632        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10633	have_groff=no
10634   else
10635        have_groff=yes
10636   fi
10637elif test "x$use_groff" = x"yes" ; then
10638   AC_PATH_PROG([GROFF], [groff])
10639   if test "x$GROFF" = "x"; then
10640        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10641   fi
10642   have_groff=yes
10643elif test "x$use_groff" = x"no" ; then
10644   if test "x$GROFF" != "x"; then
10645      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10646   fi
10647   have_groff=no
10648else
10649   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10650fi
10651
10652# We have groff, test for the presence of the macro packages
10653if test "x$have_groff" = x"yes"; then
10654    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10655    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10656        groff_ms_works=yes
10657    else
10658        groff_ms_works=no
10659    fi
10660    AC_MSG_RESULT([$groff_ms_works])
10661    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10662    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10663        groff_mm_works=yes
10664    else
10665        groff_mm_works=no
10666    fi
10667    AC_MSG_RESULT([$groff_mm_works])
10668fi
10669
10670# We have groff, test for HTML dependencies, one command per package
10671if test "x$have_groff" = x"yes"; then
10672   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10673   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10674   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10675   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10676      have_groff_html=yes
10677   else
10678      have_groff_html=no
10679      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10680   fi
10681fi
10682
10683# Set Automake conditionals for Makefiles
10684AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10685AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10686AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10687AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10688]) # XORG_WITH_GROFF
10689
10690# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10691# ---------------------------------------
10692# Minimum version: 1.6.0
10693# Minimum version for optional DEFAULT argument: 1.11.0
10694# Minimum version for optional MIN-VERSION argument: 1.15.0
10695#
10696# Documentation tools are not always available on all platforms and sometimes
10697# not at the appropriate level. This macro enables a module to test for the
10698# presence of the tool and obtain it's path in separate variables. Coupled with
10699# the --with-fop option, it allows maximum flexibilty in making decisions
10700# as whether or not to use the fop package. When DEFAULT is not specified,
10701# --with-fop assumes 'auto'.
10702#
10703# Interface to module:
10704# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10705# FOP:	 	returns the path of the fop program found
10706#		returns the path set by the user in the environment
10707# --with-fop: 	'yes' user instructs the module to use fop
10708#		'no' user instructs the module not to use fop
10709#
10710# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10711#
10712AC_DEFUN([XORG_WITH_FOP],[
10713AC_ARG_VAR([FOP], [Path to fop command])
10714m4_define([_defopt], m4_default([$2], [auto]))
10715AC_ARG_WITH(fop,
10716	AS_HELP_STRING([--with-fop],
10717	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10718	   [use_fop=$withval], [use_fop=]_defopt)
10719m4_undefine([_defopt])
10720
10721if test "x$use_fop" = x"auto"; then
10722   AC_PATH_PROG([FOP], [fop])
10723   if test "x$FOP" = "x"; then
10724        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10725	have_fop=no
10726   else
10727        have_fop=yes
10728   fi
10729elif test "x$use_fop" = x"yes" ; then
10730   AC_PATH_PROG([FOP], [fop])
10731   if test "x$FOP" = "x"; then
10732        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10733   fi
10734   have_fop=yes
10735elif test "x$use_fop" = x"no" ; then
10736   if test "x$FOP" != "x"; then
10737      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10738   fi
10739   have_fop=no
10740else
10741   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10742fi
10743
10744# Test for a minimum version of fop, if provided.
10745m4_ifval([$1],
10746[if test "$have_fop" = yes; then
10747    # scrape the fop version
10748    AC_MSG_CHECKING([for fop minimum version])
10749    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10750    AC_MSG_RESULT([$fop_version])
10751    AS_VERSION_COMPARE([$fop_version], [$1],
10752        [if test "x$use_fop" = xauto; then
10753            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10754            have_fop=no
10755        else
10756            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10757        fi])
10758fi])
10759AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10760]) # XORG_WITH_FOP
10761
10762# XORG_WITH_PS2PDF([DEFAULT])
10763# ----------------
10764# Minimum version: 1.6.0
10765# Minimum version for optional DEFAULT argument: 1.11.0
10766#
10767# Documentation tools are not always available on all platforms and sometimes
10768# not at the appropriate level. This macro enables a module to test for the
10769# presence of the tool and obtain it's path in separate variables. Coupled with
10770# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10771# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10772# --with-ps2pdf assumes 'auto'.
10773#
10774# Interface to module:
10775# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10776# PS2PDF:	returns the path of the ps2pdf program found
10777#		returns the path set by the user in the environment
10778# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10779#		 'no' user instructs the module not to use ps2pdf
10780#
10781# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10782#
10783AC_DEFUN([XORG_WITH_PS2PDF],[
10784AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10785m4_define([_defopt], m4_default([$1], [auto]))
10786AC_ARG_WITH(ps2pdf,
10787	AS_HELP_STRING([--with-ps2pdf],
10788	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10789	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10790m4_undefine([_defopt])
10791
10792if test "x$use_ps2pdf" = x"auto"; then
10793   AC_PATH_PROG([PS2PDF], [ps2pdf])
10794   if test "x$PS2PDF" = "x"; then
10795        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10796	have_ps2pdf=no
10797   else
10798        have_ps2pdf=yes
10799   fi
10800elif test "x$use_ps2pdf" = x"yes" ; then
10801   AC_PATH_PROG([PS2PDF], [ps2pdf])
10802   if test "x$PS2PDF" = "x"; then
10803        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10804   fi
10805   have_ps2pdf=yes
10806elif test "x$use_ps2pdf" = x"no" ; then
10807   if test "x$PS2PDF" != "x"; then
10808      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10809   fi
10810   have_ps2pdf=no
10811else
10812   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10813fi
10814AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10815]) # XORG_WITH_PS2PDF
10816
10817# XORG_ENABLE_DOCS (enable_docs=yes)
10818# ----------------
10819# Minimum version: 1.6.0
10820#
10821# Documentation tools are not always available on all platforms and sometimes
10822# not at the appropriate level. This macro enables a builder to skip all
10823# documentation targets except traditional man pages.
10824# Combined with the specific tool checking macros XORG_WITH_*, it provides
10825# maximum flexibilty in controlling documentation building.
10826# Refer to:
10827# XORG_WITH_XMLTO         --with-xmlto
10828# XORG_WITH_ASCIIDOC      --with-asciidoc
10829# XORG_WITH_DOXYGEN       --with-doxygen
10830# XORG_WITH_FOP           --with-fop
10831# XORG_WITH_GROFF         --with-groff
10832# XORG_WITH_PS2PDF        --with-ps2pdf
10833#
10834# Interface to module:
10835# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10836# --enable-docs: 'yes' user instructs the module to generate docs
10837#		 'no' user instructs the module not to generate docs
10838# parm1:	specify the default value, yes or no.
10839#
10840AC_DEFUN([XORG_ENABLE_DOCS],[
10841m4_define([docs_default], m4_default([$1], [yes]))
10842AC_ARG_ENABLE(docs,
10843	AS_HELP_STRING([--enable-docs],
10844	   [Enable building the documentation (default: ]docs_default[)]),
10845	   [build_docs=$enableval], [build_docs=]docs_default)
10846m4_undefine([docs_default])
10847AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10848AC_MSG_CHECKING([whether to build documentation])
10849AC_MSG_RESULT([$build_docs])
10850]) # XORG_ENABLE_DOCS
10851
10852# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10853# ----------------
10854# Minimum version: 1.6.0
10855#
10856# This macro enables a builder to skip all developer documentation.
10857# Combined with the specific tool checking macros XORG_WITH_*, it provides
10858# maximum flexibilty in controlling documentation building.
10859# Refer to:
10860# XORG_WITH_XMLTO         --with-xmlto
10861# XORG_WITH_ASCIIDOC      --with-asciidoc
10862# XORG_WITH_DOXYGEN       --with-doxygen
10863# XORG_WITH_FOP           --with-fop
10864# XORG_WITH_GROFF         --with-groff
10865# XORG_WITH_PS2PDF        --with-ps2pdf
10866#
10867# Interface to module:
10868# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10869# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10870#			'no' user instructs the module not to generate developer docs
10871# parm1:		specify the default value, yes or no.
10872#
10873AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10874m4_define([devel_default], m4_default([$1], [yes]))
10875AC_ARG_ENABLE(devel-docs,
10876	AS_HELP_STRING([--enable-devel-docs],
10877	   [Enable building the developer documentation (default: ]devel_default[)]),
10878	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10879m4_undefine([devel_default])
10880AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10881AC_MSG_CHECKING([whether to build developer documentation])
10882AC_MSG_RESULT([$build_devel_docs])
10883]) # XORG_ENABLE_DEVEL_DOCS
10884
10885# XORG_ENABLE_SPECS (enable_specs=yes)
10886# ----------------
10887# Minimum version: 1.6.0
10888#
10889# This macro enables a builder to skip all functional specification targets.
10890# Combined with the specific tool checking macros XORG_WITH_*, it provides
10891# maximum flexibilty in controlling documentation building.
10892# Refer to:
10893# XORG_WITH_XMLTO         --with-xmlto
10894# XORG_WITH_ASCIIDOC      --with-asciidoc
10895# XORG_WITH_DOXYGEN       --with-doxygen
10896# XORG_WITH_FOP           --with-fop
10897# XORG_WITH_GROFF         --with-groff
10898# XORG_WITH_PS2PDF        --with-ps2pdf
10899#
10900# Interface to module:
10901# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10902# --enable-specs:	'yes' user instructs the module to generate specs
10903#			'no' user instructs the module not to generate specs
10904# parm1:		specify the default value, yes or no.
10905#
10906AC_DEFUN([XORG_ENABLE_SPECS],[
10907m4_define([spec_default], m4_default([$1], [yes]))
10908AC_ARG_ENABLE(specs,
10909	AS_HELP_STRING([--enable-specs],
10910	   [Enable building the specs (default: ]spec_default[)]),
10911	   [build_specs=$enableval], [build_specs=]spec_default)
10912m4_undefine([spec_default])
10913AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10914AC_MSG_CHECKING([whether to build functional specifications])
10915AC_MSG_RESULT([$build_specs])
10916]) # XORG_ENABLE_SPECS
10917
10918# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10919# ----------------------------------------------
10920# Minimum version: 1.13.0
10921#
10922# This macro enables a builder to enable/disable unit testing
10923# It makes no assumption about the test cases implementation
10924# Test cases may or may not use Automake "Support for test suites"
10925# They may or may not use the software utility library GLib
10926#
10927# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10928# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10929# The variable enable_unit_tests is used by other macros in this file.
10930#
10931# Interface to module:
10932# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10933# enable_unit_tests:    used in configure.ac for additional configuration
10934# --enable-unit-tests:	'yes' user instructs the module to build tests
10935#			'no' user instructs the module not to build tests
10936# parm1:		specify the default value, yes or no.
10937#
10938AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10939AC_BEFORE([$0], [XORG_WITH_GLIB])
10940AC_BEFORE([$0], [XORG_LD_WRAP])
10941AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10942m4_define([_defopt], m4_default([$1], [auto]))
10943AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10944	[Enable building unit test cases (default: ]_defopt[)]),
10945	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10946m4_undefine([_defopt])
10947AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10948AC_MSG_CHECKING([whether to build unit test cases])
10949AC_MSG_RESULT([$enable_unit_tests])
10950]) # XORG_ENABLE_UNIT_TESTS
10951
10952# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10953# ------------------------------------------------------
10954# Minimum version: 1.17.0
10955#
10956# This macro enables a builder to enable/disable integration testing
10957# It makes no assumption about the test cases' implementation
10958# Test cases may or may not use Automake "Support for test suites"
10959#
10960# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10961# usually requires less dependencies and may be built and run under less
10962# stringent environments than integration tests.
10963#
10964# Interface to module:
10965# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10966# enable_integration_tests:   used in configure.ac for additional configuration
10967# --enable-integration-tests: 'yes' user instructs the module to build tests
10968#                             'no' user instructs the module not to build tests
10969# parm1:                      specify the default value, yes or no.
10970#
10971AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10972AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10973m4_define([_defopt], m4_default([$1], [auto]))
10974AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10975	[Enable building integration test cases (default: ]_defopt[)]),
10976	[enable_integration_tests=$enableval],
10977	[enable_integration_tests=]_defopt)
10978m4_undefine([_defopt])
10979AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10980	[test "x$enable_integration_tests" != xno])
10981AC_MSG_CHECKING([whether to build unit test cases])
10982AC_MSG_RESULT([$enable_integration_tests])
10983]) # XORG_ENABLE_INTEGRATION_TESTS
10984
10985# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10986# ----------------------------------------
10987# Minimum version: 1.13.0
10988#
10989# GLib is a library which provides advanced data structures and functions.
10990# This macro enables a module to test for the presence of Glib.
10991#
10992# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10993# Otherwise the value of $enable_unit_tests is blank.
10994#
10995# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10996# test support usually requires less dependencies and may be built and run under
10997# less stringent environments than integration tests.
10998#
10999# Interface to module:
11000# HAVE_GLIB: used in makefiles to conditionally build targets
11001# with_glib: used in configure.ac to know if GLib has been found
11002# --with-glib:	'yes' user instructs the module to use glib
11003#		'no' user instructs the module not to use glib
11004#
11005AC_DEFUN([XORG_WITH_GLIB],[
11006AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11007m4_define([_defopt], m4_default([$2], [auto]))
11008AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
11009	[Use GLib library for unit testing (default: ]_defopt[)]),
11010	[with_glib=$withval], [with_glib=]_defopt)
11011m4_undefine([_defopt])
11012
11013have_glib=no
11014# Do not probe GLib if user explicitly disabled unit testing
11015if test "x$enable_unit_tests" != x"no"; then
11016  # Do not probe GLib if user explicitly disabled it
11017  if test "x$with_glib" != x"no"; then
11018    m4_ifval(
11019      [$1],
11020      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
11021      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
11022    )
11023  fi
11024fi
11025
11026# Not having GLib when unit testing has been explicitly requested is an error
11027if test "x$enable_unit_tests" = x"yes"; then
11028  if test "x$have_glib" = x"no"; then
11029    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11030  fi
11031fi
11032
11033# Having unit testing disabled when GLib has been explicitly requested is an error
11034if test "x$enable_unit_tests" = x"no"; then
11035  if test "x$with_glib" = x"yes"; then
11036    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11037  fi
11038fi
11039
11040# Not having GLib when it has been explicitly requested is an error
11041if test "x$with_glib" = x"yes"; then
11042  if test "x$have_glib" = x"no"; then
11043    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
11044  fi
11045fi
11046
11047AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
11048]) # XORG_WITH_GLIB
11049
11050# XORG_LD_WRAP([required|optional])
11051# ---------------------------------
11052# Minimum version: 1.13.0
11053#
11054# Check if linker supports -wrap, passed via compiler flags
11055#
11056# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
11057# Otherwise the value of $enable_unit_tests is blank.
11058#
11059# Argument added in 1.16.0 - default is "required", to match existing behavior
11060# of returning an error if enable_unit_tests is yes, and ld -wrap is not
11061# available, an argument of "optional" allows use when some unit tests require
11062# ld -wrap and others do not.
11063#
11064AC_DEFUN([XORG_LD_WRAP],[
11065XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
11066    [AC_LANG_PROGRAM([#include <stdlib.h>
11067                      void __wrap_exit(int status) { return; }],
11068                     [exit(0);])])
11069# Not having ld wrap when unit testing has been explicitly requested is an error
11070if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
11071  if test "x$have_ld_wrap" = x"no"; then
11072    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
11073  fi
11074fi
11075AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
11076#
11077]) # XORG_LD_WRAP
11078
11079# XORG_CHECK_LINKER_FLAGS
11080# -----------------------
11081# SYNOPSIS
11082#
11083#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
11084#
11085# DESCRIPTION
11086#
11087#   Check whether the given linker FLAGS work with the current language's
11088#   linker, or whether they give an error.
11089#
11090#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
11091#   success/failure.
11092#
11093#   PROGRAM-SOURCE is the program source to link with, if needed
11094#
11095#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
11096#
11097# LICENSE
11098#
11099#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
11100#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
11101#   Copyright (c) 2009 Matteo Frigo
11102#
11103#   This program is free software: you can redistribute it and/or modify it
11104#   under the terms of the GNU General Public License as published by the
11105#   Free Software Foundation, either version 3 of the License, or (at your
11106#   option) any later version.
11107#
11108#   This program is distributed in the hope that it will be useful, but
11109#   WITHOUT ANY WARRANTY; without even the implied warranty of
11110#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11111#   Public License for more details.
11112#
11113#   You should have received a copy of the GNU General Public License along
11114#   with this program. If not, see <http://www.gnu.org/licenses/>.
11115#
11116#   As a special exception, the respective Autoconf Macro's copyright owner
11117#   gives unlimited permission to copy, distribute and modify the configure
11118#   scripts that are the output of Autoconf when processing the Macro. You
11119#   need not follow the terms of the GNU General Public License when using
11120#   or distributing such scripts, even though portions of the text of the
11121#   Macro appear in them. The GNU General Public License (GPL) does govern
11122#   all other use of the material that constitutes the Autoconf Macro.
11123#
11124#   This special exception to the GPL applies to versions of the Autoconf
11125#   Macro released by the Autoconf Archive. When you make and distribute a
11126#   modified version of the Autoconf Macro, you may extend this special
11127#   exception to the GPL to apply to your modified version as well.#
11128AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11129[AC_MSG_CHECKING([whether the linker accepts $1])
11130dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11131AS_LITERAL_IF([$1],
11132  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11133      ax_save_FLAGS=$LDFLAGS
11134      LDFLAGS="$1"
11135      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11136        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11137        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11138      LDFLAGS=$ax_save_FLAGS])],
11139  [ax_save_FLAGS=$LDFLAGS
11140   LDFLAGS="$1"
11141   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11142     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11143     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11144   LDFLAGS=$ax_save_FLAGS])
11145eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11146AC_MSG_RESULT($xorg_check_linker_flags)
11147if test "x$xorg_check_linker_flags" = xyes; then
11148	m4_default([$2], :)
11149else
11150	m4_default([$3], :)
11151fi
11152]) # XORG_CHECK_LINKER_FLAGS
11153
11154# XORG_MEMORY_CHECK_FLAGS
11155# -----------------------
11156# Minimum version: 1.16.0
11157#
11158# This macro attempts to find appropriate memory checking functionality
11159# for various platforms which unit testing code may use to catch various
11160# forms of memory allocation and access errors in testing.
11161#
11162# Interface to module:
11163# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11164#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11165#
11166# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11167#
11168AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11169
11170AC_REQUIRE([AC_CANONICAL_HOST])
11171AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11172           [Environment variables to enable memory checking in tests])
11173
11174# Check for different types of support on different platforms
11175case $host_os in
11176    solaris*)
11177        AC_CHECK_LIB([umem], [umem_alloc],
11178            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11179        ;;
11180    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11181        # both directly and inverted, so should not be 0 or 255.
11182        malloc_debug_env='MALLOC_PERTURB_=15'
11183        ;;
11184    darwin*)
11185        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11186        ;;
11187    *bsd*)
11188        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11189        ;;
11190esac
11191
11192# User supplied flags override default flags
11193if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11194    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11195fi
11196
11197AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11198]) # XORG_WITH_LINT
11199
11200# XORG_CHECK_MALLOC_ZERO
11201# ----------------------
11202# Minimum version: 1.0.0
11203#
11204# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11205# malloc(0) returns NULL.  Packages should add one of these cflags to
11206# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11207AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11208AC_ARG_ENABLE(malloc0returnsnull,
11209	AS_HELP_STRING([--enable-malloc0returnsnull],
11210		       [malloc(0) returns NULL (default: auto)]),
11211	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11212	[MALLOC_ZERO_RETURNS_NULL=auto])
11213
11214AC_MSG_CHECKING([whether malloc(0) returns NULL])
11215if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11216	AC_RUN_IFELSE([AC_LANG_PROGRAM([
11217#include <stdlib.h>
11218],[
11219    char *m0, *r0, *c0, *p;
11220    m0 = malloc(0);
11221    p = malloc(10);
11222    r0 = realloc(p,0);
11223    c0 = calloc(0,10);
11224    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11225])],
11226		[MALLOC_ZERO_RETURNS_NULL=yes],
11227		[MALLOC_ZERO_RETURNS_NULL=no],
11228		[MALLOC_ZERO_RETURNS_NULL=yes])
11229fi
11230AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11231
11232if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11233	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11234	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11235	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11236else
11237	MALLOC_ZERO_CFLAGS=""
11238	XMALLOC_ZERO_CFLAGS=""
11239	XTMALLOC_ZERO_CFLAGS=""
11240fi
11241
11242AC_SUBST([MALLOC_ZERO_CFLAGS])
11243AC_SUBST([XMALLOC_ZERO_CFLAGS])
11244AC_SUBST([XTMALLOC_ZERO_CFLAGS])
11245]) # XORG_CHECK_MALLOC_ZERO
11246
11247# XORG_WITH_LINT()
11248# ----------------
11249# Minimum version: 1.1.0
11250#
11251# This macro enables the use of a tool that flags some suspicious and
11252# non-portable constructs (likely to be bugs) in C language source code.
11253# It will attempt to locate the tool and use appropriate options.
11254# There are various lint type tools on different platforms.
11255#
11256# Interface to module:
11257# LINT:		returns the path to the tool found on the platform
11258#		or the value set to LINT on the configure cmd line
11259#		also an Automake conditional
11260# LINT_FLAGS:	an Automake variable with appropriate flags
11261#
11262# --with-lint:	'yes' user instructs the module to use lint
11263#		'no' user instructs the module not to use lint (default)
11264#
11265# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11266# If the user sets the value of LINT_FLAGS, they are used verbatim.
11267#
11268AC_DEFUN([XORG_WITH_LINT],[
11269
11270AC_ARG_VAR([LINT], [Path to a lint-style command])
11271AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11272AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11273		[Use a lint-style source code checker (default: disabled)])],
11274		[use_lint=$withval], [use_lint=no])
11275
11276# Obtain platform specific info like program name and options
11277# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11278case $host_os in
11279  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11280	lint_name=splint
11281	lint_options="-badflag"
11282	;;
11283  *freebsd* | *netbsd*)
11284	lint_name=lint
11285	lint_options="-u -b"
11286	;;
11287  *solaris*)
11288	lint_name=lint
11289	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11290	;;
11291esac
11292
11293# Test for the presence of the program (either guessed by the code or spelled out by the user)
11294if test "x$use_lint" = x"yes" ; then
11295   AC_PATH_PROG([LINT], [$lint_name])
11296   if test "x$LINT" = "x"; then
11297        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11298   fi
11299elif test "x$use_lint" = x"no" ; then
11300   if test "x$LINT" != "x"; then
11301      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11302   fi
11303else
11304   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11305fi
11306
11307# User supplied flags override default flags
11308if test "x$LINT_FLAGS" != "x"; then
11309   lint_options=$LINT_FLAGS
11310fi
11311
11312AC_SUBST([LINT_FLAGS],[$lint_options])
11313AM_CONDITIONAL(LINT, [test "x$LINT" != x])
11314
11315]) # XORG_WITH_LINT
11316
11317# XORG_LINT_LIBRARY(LIBNAME)
11318# --------------------------
11319# Minimum version: 1.1.0
11320#
11321# Sets up flags for building lint libraries for checking programs that call
11322# functions in the library.
11323#
11324# Interface to module:
11325# LINTLIB		- Automake variable with the name of lint library file to make
11326# MAKE_LINT_LIB		- Automake conditional
11327#
11328# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11329#			  - 'no' user instructs the module not to create a lint library (default)
11330
11331AC_DEFUN([XORG_LINT_LIBRARY],[
11332AC_REQUIRE([XORG_WITH_LINT])
11333AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11334	[Create lint library (default: disabled)])],
11335	[make_lint_lib=$enableval], [make_lint_lib=no])
11336
11337if test "x$make_lint_lib" = x"yes" ; then
11338   LINTLIB=llib-l$1.ln
11339   if test "x$LINT" = "x"; then
11340        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11341   fi
11342elif test "x$make_lint_lib" != x"no" ; then
11343   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11344fi
11345
11346AC_SUBST(LINTLIB)
11347AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11348
11349]) # XORG_LINT_LIBRARY
11350
11351# XORG_COMPILER_BRAND
11352# -------------------
11353# Minimum version: 1.14.0
11354#
11355# Checks for various brands of compilers and sets flags as appropriate:
11356#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11357#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11358#   clang compiler - sets CLANGCC to "yes"
11359#   Intel compiler - sets INTELCC to "yes"
11360#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11361#
11362AC_DEFUN([XORG_COMPILER_BRAND], [
11363AC_LANG_CASE(
11364	[C], [
11365		AC_REQUIRE([AC_PROG_CC_C99])
11366	],
11367	[C++], [
11368		AC_REQUIRE([AC_PROG_CXX])
11369	]
11370)
11371AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11372AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11373AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11374]) # XORG_COMPILER_BRAND
11375
11376# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11377# ---------------
11378# Minimum version: 1.16.0
11379#
11380# Test if the compiler works when passed the given flag as a command line argument.
11381# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11382# next flag in the list until there are no more options.
11383#
11384# Note that this does not guarantee that the compiler supports the flag as some
11385# compilers will simply ignore arguments that they do not understand, but we do
11386# attempt to weed out false positives by using -Werror=unknown-warning-option and
11387# -Werror=unused-command-line-argument
11388#
11389AC_DEFUN([XORG_TESTSET_CFLAG], [
11390m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11391m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11392
11393AC_LANG_COMPILER_REQUIRE
11394
11395AC_LANG_CASE(
11396	[C], [
11397		AC_REQUIRE([AC_PROG_CC_C99])
11398		define([PREFIX], [C])
11399		define([CACHE_PREFIX], [cc])
11400		define([COMPILER], [$CC])
11401	],
11402	[C++], [
11403		define([PREFIX], [CXX])
11404		define([CACHE_PREFIX], [cxx])
11405		define([COMPILER], [$CXX])
11406	]
11407)
11408
11409[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11410
11411if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11412	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11413	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11414			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11415			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11416					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11417					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11418	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11419	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11420fi
11421
11422if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11423	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11424		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11425	fi
11426	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11427	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11428			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11429			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11430					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11431					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11432	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11433	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11434fi
11435
11436found="no"
11437m4_foreach([flag], m4_cdr($@), [
11438	if test $found = "no" ; then
11439		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
11440			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11441		fi
11442
11443		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
11444			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11445		fi
11446
11447		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11448
11449dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11450		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11451		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11452		AC_CACHE_VAL($cacheid,
11453			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11454					     [eval $cacheid=yes],
11455					     [eval $cacheid=no])])
11456
11457		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11458
11459		eval supported=\$$cacheid
11460		AC_MSG_RESULT([$supported])
11461		if test "$supported" = "yes" ; then
11462			$1="$$1 ]flag["
11463			found="yes"
11464		fi
11465	fi
11466])
11467]) # XORG_TESTSET_CFLAG
11468
11469# XORG_COMPILER_FLAGS
11470# ---------------
11471# Minimum version: 1.16.0
11472#
11473# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11474# arguments supported by the selected compiler which do NOT alter the generated
11475# code.  These arguments will cause the compiler to print various warnings
11476# during compilation AND turn a conservative set of warnings into errors.
11477#
11478# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11479# future versions of util-macros as options are added to new compilers.
11480#
11481AC_DEFUN([XORG_COMPILER_FLAGS], [
11482AC_REQUIRE([XORG_COMPILER_BRAND])
11483
11484AC_ARG_ENABLE(selective-werror,
11485              AS_HELP_STRING([--disable-selective-werror],
11486                             [Turn off selective compiler errors. (default: enabled)]),
11487              [SELECTIVE_WERROR=$enableval],
11488              [SELECTIVE_WERROR=yes])
11489
11490AC_LANG_CASE(
11491        [C], [
11492                define([PREFIX], [C])
11493        ],
11494        [C++], [
11495                define([PREFIX], [CXX])
11496        ]
11497)
11498# -v is too short to test reliably with XORG_TESTSET_CFLAG
11499if test "x$SUNCC" = "xyes"; then
11500    [BASE_]PREFIX[FLAGS]="-v"
11501else
11502    [BASE_]PREFIX[FLAGS]=""
11503fi
11504
11505# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11506XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11507XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11508XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11509XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11510
11511AC_LANG_CASE(
11512	[C], [
11513		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11514		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11515		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11516		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11517		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11518		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11519	]
11520)
11521
11522# This chunk adds additional warnings that could catch undesired effects.
11523XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11524XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11525XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11526XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11527XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11528XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11529XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11530
11531# These are currently disabled because they are noisy.  They will be enabled
11532# in the future once the codebase is sufficiently modernized to silence
11533# them.  For now, I don't want them to drown out the other warnings.
11534# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11535# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11536# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11537
11538# Turn some warnings into errors, so we don't accidently get successful builds
11539# when there are problems that should be fixed.
11540
11541if test "x$SELECTIVE_WERROR" = "xyes" ; then
11542XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11543XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11544XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11545XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11546XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11547XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11548XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11549XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11550XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11551XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11552XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11553XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11554XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11555else
11556AC_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])
11557XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11558XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11559XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11560XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11561XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11562XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11563XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11564XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11565XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11566XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11567XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11568XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11569XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11570fi
11571
11572AC_SUBST([BASE_]PREFIX[FLAGS])
11573]) # XORG_COMPILER_FLAGS
11574
11575# XORG_CWARNFLAGS
11576# ---------------
11577# Minimum version: 1.2.0
11578# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11579#
11580# Defines CWARNFLAGS to enable C compiler warnings.
11581#
11582# This function is deprecated because it defines -fno-strict-aliasing
11583# which alters the code generated by the compiler.  If -fno-strict-aliasing
11584# is needed, then it should be added explicitly in the module when
11585# it is updated to use BASE_CFLAGS.
11586#
11587AC_DEFUN([XORG_CWARNFLAGS], [
11588AC_REQUIRE([XORG_COMPILER_FLAGS])
11589AC_REQUIRE([XORG_COMPILER_BRAND])
11590AC_LANG_CASE(
11591	[C], [
11592		CWARNFLAGS="$BASE_CFLAGS"
11593		if  test "x$GCC" = xyes ; then
11594		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11595		fi
11596		AC_SUBST(CWARNFLAGS)
11597	]
11598)
11599]) # XORG_CWARNFLAGS
11600
11601# XORG_STRICT_OPTION
11602# -----------------------
11603# Minimum version: 1.3.0
11604#
11605# Add configure option to enable strict compilation flags, such as treating
11606# warnings as fatal errors.
11607# If --enable-strict-compilation is passed to configure, adds strict flags to
11608# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11609#
11610# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11611# when strict compilation is unconditionally desired.
11612AC_DEFUN([XORG_STRICT_OPTION], [
11613AC_REQUIRE([XORG_CWARNFLAGS])
11614AC_REQUIRE([XORG_COMPILER_FLAGS])
11615
11616AC_ARG_ENABLE(strict-compilation,
11617			  AS_HELP_STRING([--enable-strict-compilation],
11618			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11619			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11620
11621AC_LANG_CASE(
11622        [C], [
11623                define([PREFIX], [C])
11624        ],
11625        [C++], [
11626                define([PREFIX], [CXX])
11627        ]
11628)
11629
11630[STRICT_]PREFIX[FLAGS]=""
11631XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11632XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11633
11634# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11635# activate it with -Werror, so we add it here explicitly.
11636XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11637
11638if test "x$STRICT_COMPILE" = "xyes"; then
11639    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11640    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11641fi
11642AC_SUBST([STRICT_]PREFIX[FLAGS])
11643AC_SUBST([BASE_]PREFIX[FLAGS])
11644AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11645]) # XORG_STRICT_OPTION
11646
11647# XORG_DEFAULT_OPTIONS
11648# --------------------
11649# Minimum version: 1.3.0
11650#
11651# Defines default options for X.Org modules.
11652#
11653AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11654AC_REQUIRE([AC_PROG_INSTALL])
11655XORG_COMPILER_FLAGS
11656XORG_CWARNFLAGS
11657XORG_STRICT_OPTION
11658XORG_RELEASE_VERSION
11659XORG_CHANGELOG
11660XORG_INSTALL
11661XORG_MANPAGE_SECTIONS
11662m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11663    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11664]) # XORG_DEFAULT_OPTIONS
11665
11666# XORG_INSTALL()
11667# ----------------
11668# Minimum version: 1.4.0
11669#
11670# Defines the variable INSTALL_CMD as the command to copy
11671# INSTALL from $prefix/share/util-macros.
11672#
11673AC_DEFUN([XORG_INSTALL], [
11674AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11675macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11676INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11677mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11678|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11679echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11680AC_SUBST([INSTALL_CMD])
11681]) # XORG_INSTALL
11682dnl Copyright 2005 Red Hat, Inc
11683dnl
11684dnl Permission to use, copy, modify, distribute, and sell this software and its
11685dnl documentation for any purpose is hereby granted without fee, provided that
11686dnl the above copyright notice appear in all copies and that both that
11687dnl copyright notice and this permission notice appear in supporting
11688dnl documentation.
11689dnl
11690dnl The above copyright notice and this permission notice shall be included
11691dnl in all copies or substantial portions of the Software.
11692dnl
11693dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11694dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11695dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11696dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11697dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11698dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11699dnl OTHER DEALINGS IN THE SOFTWARE.
11700dnl
11701dnl Except as contained in this notice, the name of the copyright holders shall
11702dnl not be used in advertising or otherwise to promote the sale, use or
11703dnl other dealings in this Software without prior written authorization
11704dnl from the copyright holders.
11705dnl
11706
11707# XORG_RELEASE_VERSION
11708# --------------------
11709# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11710
11711AC_DEFUN([XORG_RELEASE_VERSION],[
11712	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11713		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11714		[Major version of this package])
11715	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11716	if test "x$PVM" = "x"; then
11717		PVM="0"
11718	fi
11719	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11720		[$PVM],
11721		[Minor version of this package])
11722	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11723	if test "x$PVP" = "x"; then
11724		PVP="0"
11725	fi
11726	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11727		[$PVP],
11728		[Patch version of this package])
11729])
11730
11731# XORG_CHANGELOG()
11732# ----------------
11733# Minimum version: 1.2.0
11734#
11735# Defines the variable CHANGELOG_CMD as the command to generate
11736# ChangeLog from git.
11737#
11738#
11739AC_DEFUN([XORG_CHANGELOG], [
11740CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11741mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11742|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11743echo 'git directory not found: installing possibly empty changelog.' >&2)"
11744AC_SUBST([CHANGELOG_CMD])
11745]) # XORG_CHANGELOG
11746
11747