aclocal.m4 revision 6af7124f
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
1150# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1151#
1152#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1153#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1154#                 Foundation, Inc.
1155#   Written by Gordon Matzigkeit, 1996
1156#
1157# This file is free software; the Free Software Foundation gives
1158# unlimited permission to copy and/or distribute it, with or without
1159# modifications, as long as this notice is preserved.
1160
1161m4_define([_LT_COPYING], [dnl
1162#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1163#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1164#                 Foundation, Inc.
1165#   Written by Gordon Matzigkeit, 1996
1166#
1167#   This file is part of GNU Libtool.
1168#
1169# GNU Libtool is free software; you can redistribute it and/or
1170# modify it under the terms of the GNU General Public License as
1171# published by the Free Software Foundation; either version 2 of
1172# the License, or (at your option) any later version.
1173#
1174# As a special exception to the GNU General Public License,
1175# if you distribute this file as part of a program or library that
1176# is built using GNU Libtool, you may include this file under the
1177# same distribution terms that you use for the rest of that program.
1178#
1179# GNU Libtool is distributed in the hope that it will be useful,
1180# but WITHOUT ANY WARRANTY; without even the implied warranty of
1181# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1182# GNU General Public License for more details.
1183#
1184# You should have received a copy of the GNU General Public License
1185# along with GNU Libtool; see the file COPYING.  If not, a copy
1186# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1187# obtained by writing to the Free Software Foundation, Inc.,
1188# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1189])
1190
1191# serial 57 LT_INIT
1192
1193
1194# LT_PREREQ(VERSION)
1195# ------------------
1196# Complain and exit if this libtool version is less that VERSION.
1197m4_defun([LT_PREREQ],
1198[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1199       [m4_default([$3],
1200		   [m4_fatal([Libtool version $1 or higher is required],
1201		             63)])],
1202       [$2])])
1203
1204
1205# _LT_CHECK_BUILDDIR
1206# ------------------
1207# Complain if the absolute build directory name contains unusual characters
1208m4_defun([_LT_CHECK_BUILDDIR],
1209[case `pwd` in
1210  *\ * | *\	*)
1211    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1212esac
1213])
1214
1215
1216# LT_INIT([OPTIONS])
1217# ------------------
1218AC_DEFUN([LT_INIT],
1219[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1220AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1221AC_BEFORE([$0], [LT_LANG])dnl
1222AC_BEFORE([$0], [LT_OUTPUT])dnl
1223AC_BEFORE([$0], [LTDL_INIT])dnl
1224m4_require([_LT_CHECK_BUILDDIR])dnl
1225
1226dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1227m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1228m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1229dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1230dnl unless we require an AC_DEFUNed macro:
1231AC_REQUIRE([LTOPTIONS_VERSION])dnl
1232AC_REQUIRE([LTSUGAR_VERSION])dnl
1233AC_REQUIRE([LTVERSION_VERSION])dnl
1234AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1235m4_require([_LT_PROG_LTMAIN])dnl
1236
1237_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1238
1239dnl Parse OPTIONS
1240_LT_SET_OPTIONS([$0], [$1])
1241
1242# This can be used to rebuild libtool when needed
1243LIBTOOL_DEPS="$ltmain"
1244
1245# Always use our own libtool.
1246LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1247AC_SUBST(LIBTOOL)dnl
1248
1249_LT_SETUP
1250
1251# Only expand once:
1252m4_define([LT_INIT])
1253])# LT_INIT
1254
1255# Old names:
1256AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1257AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1258dnl aclocal-1.4 backwards compatibility:
1259dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1260dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1261
1262
1263# _LT_CC_BASENAME(CC)
1264# -------------------
1265# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1266m4_defun([_LT_CC_BASENAME],
1267[for cc_temp in $1""; do
1268  case $cc_temp in
1269    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1270    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1271    \-*) ;;
1272    *) break;;
1273  esac
1274done
1275cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1276])
1277
1278
1279# _LT_FILEUTILS_DEFAULTS
1280# ----------------------
1281# It is okay to use these file commands and assume they have been set
1282# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1283m4_defun([_LT_FILEUTILS_DEFAULTS],
1284[: ${CP="cp -f"}
1285: ${MV="mv -f"}
1286: ${RM="rm -f"}
1287])# _LT_FILEUTILS_DEFAULTS
1288
1289
1290# _LT_SETUP
1291# ---------
1292m4_defun([_LT_SETUP],
1293[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1294AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1295AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1296AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1297
1298_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1299dnl
1300_LT_DECL([], [host_alias], [0], [The host system])dnl
1301_LT_DECL([], [host], [0])dnl
1302_LT_DECL([], [host_os], [0])dnl
1303dnl
1304_LT_DECL([], [build_alias], [0], [The build system])dnl
1305_LT_DECL([], [build], [0])dnl
1306_LT_DECL([], [build_os], [0])dnl
1307dnl
1308AC_REQUIRE([AC_PROG_CC])dnl
1309AC_REQUIRE([LT_PATH_LD])dnl
1310AC_REQUIRE([LT_PATH_NM])dnl
1311dnl
1312AC_REQUIRE([AC_PROG_LN_S])dnl
1313test -z "$LN_S" && LN_S="ln -s"
1314_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1315dnl
1316AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1317_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1318_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1319dnl
1320m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1321m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1322m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1323m4_require([_LT_CMD_RELOAD])dnl
1324m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1325m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1326m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1327m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1328m4_require([_LT_WITH_SYSROOT])dnl
1329
1330_LT_CONFIG_LIBTOOL_INIT([
1331# See if we are running on zsh, and set the options which allow our
1332# commands through without removal of \ escapes INIT.
1333if test -n "\${ZSH_VERSION+set}" ; then
1334   setopt NO_GLOB_SUBST
1335fi
1336])
1337if test -n "${ZSH_VERSION+set}" ; then
1338   setopt NO_GLOB_SUBST
1339fi
1340
1341_LT_CHECK_OBJDIR
1342
1343m4_require([_LT_TAG_COMPILER])dnl
1344
1345case $host_os in
1346aix3*)
1347  # AIX sometimes has problems with the GCC collect2 program.  For some
1348  # reason, if we set the COLLECT_NAMES environment variable, the problems
1349  # vanish in a puff of smoke.
1350  if test "X${COLLECT_NAMES+set}" != Xset; then
1351    COLLECT_NAMES=
1352    export COLLECT_NAMES
1353  fi
1354  ;;
1355esac
1356
1357# Global variables:
1358ofile=libtool
1359can_build_shared=yes
1360
1361# All known linkers require a `.a' archive for static linking (except MSVC,
1362# which needs '.lib').
1363libext=a
1364
1365with_gnu_ld="$lt_cv_prog_gnu_ld"
1366
1367old_CC="$CC"
1368old_CFLAGS="$CFLAGS"
1369
1370# Set sane defaults for various variables
1371test -z "$CC" && CC=cc
1372test -z "$LTCC" && LTCC=$CC
1373test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1374test -z "$LD" && LD=ld
1375test -z "$ac_objext" && ac_objext=o
1376
1377_LT_CC_BASENAME([$compiler])
1378
1379# Only perform the check for file, if the check method requires it
1380test -z "$MAGIC_CMD" && MAGIC_CMD=file
1381case $deplibs_check_method in
1382file_magic*)
1383  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1384    _LT_PATH_MAGIC
1385  fi
1386  ;;
1387esac
1388
1389# Use C for the default configuration in the libtool script
1390LT_SUPPORTED_TAG([CC])
1391_LT_LANG_C_CONFIG
1392_LT_LANG_DEFAULT_CONFIG
1393_LT_CONFIG_COMMANDS
1394])# _LT_SETUP
1395
1396
1397# _LT_PREPARE_SED_QUOTE_VARS
1398# --------------------------
1399# Define a few sed substitution that help us do robust quoting.
1400m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1401[# Backslashify metacharacters that are still active within
1402# double-quoted strings.
1403sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1404
1405# Same as above, but do not quote variable references.
1406double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1407
1408# Sed substitution to delay expansion of an escaped shell variable in a
1409# double_quote_subst'ed string.
1410delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1411
1412# Sed substitution to delay expansion of an escaped single quote.
1413delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1414
1415# Sed substitution to avoid accidental globbing in evaled expressions
1416no_glob_subst='s/\*/\\\*/g'
1417])
1418
1419# _LT_PROG_LTMAIN
1420# ---------------
1421# Note that this code is called both from `configure', and `config.status'
1422# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1423# `config.status' has no value for ac_aux_dir unless we are using Automake,
1424# so we pass a copy along to make sure it has a sensible value anyway.
1425m4_defun([_LT_PROG_LTMAIN],
1426[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1427_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1428ltmain="$ac_aux_dir/ltmain.sh"
1429])# _LT_PROG_LTMAIN
1430
1431
1432
1433# So that we can recreate a full libtool script including additional
1434# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1435# in macros and then make a single call at the end using the `libtool'
1436# label.
1437
1438
1439# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1440# ----------------------------------------
1441# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1442m4_define([_LT_CONFIG_LIBTOOL_INIT],
1443[m4_ifval([$1],
1444          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1445                     [$1
1446])])])
1447
1448# Initialize.
1449m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1450
1451
1452# _LT_CONFIG_LIBTOOL([COMMANDS])
1453# ------------------------------
1454# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1455m4_define([_LT_CONFIG_LIBTOOL],
1456[m4_ifval([$1],
1457          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1458                     [$1
1459])])])
1460
1461# Initialize.
1462m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1463
1464
1465# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1466# -----------------------------------------------------
1467m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1468[_LT_CONFIG_LIBTOOL([$1])
1469_LT_CONFIG_LIBTOOL_INIT([$2])
1470])
1471
1472
1473# _LT_FORMAT_COMMENT([COMMENT])
1474# -----------------------------
1475# Add leading comment marks to the start of each line, and a trailing
1476# full-stop to the whole comment if one is not present already.
1477m4_define([_LT_FORMAT_COMMENT],
1478[m4_ifval([$1], [
1479m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1480              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1481)])
1482
1483
1484
1485
1486
1487# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1488# -------------------------------------------------------------------
1489# CONFIGNAME is the name given to the value in the libtool script.
1490# VARNAME is the (base) name used in the configure script.
1491# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1492# VARNAME.  Any other value will be used directly.
1493m4_define([_LT_DECL],
1494[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1495    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1496	[m4_ifval([$1], [$1], [$2])])
1497    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1498    m4_ifval([$4],
1499	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1500    lt_dict_add_subkey([lt_decl_dict], [$2],
1501	[tagged?], [m4_ifval([$5], [yes], [no])])])
1502])
1503
1504
1505# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1506# --------------------------------------------------------
1507m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1508
1509
1510# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1511# ------------------------------------------------
1512m4_define([lt_decl_tag_varnames],
1513[_lt_decl_filter([tagged?], [yes], $@)])
1514
1515
1516# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1517# ---------------------------------------------------------
1518m4_define([_lt_decl_filter],
1519[m4_case([$#],
1520  [0], [m4_fatal([$0: too few arguments: $#])],
1521  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1522  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1523  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1524  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1525])
1526
1527
1528# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1529# --------------------------------------------------
1530m4_define([lt_decl_quote_varnames],
1531[_lt_decl_filter([value], [1], $@)])
1532
1533
1534# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1535# ---------------------------------------------------
1536m4_define([lt_decl_dquote_varnames],
1537[_lt_decl_filter([value], [2], $@)])
1538
1539
1540# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1541# ---------------------------------------------------
1542m4_define([lt_decl_varnames_tagged],
1543[m4_assert([$# <= 2])dnl
1544_$0(m4_quote(m4_default([$1], [[, ]])),
1545    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1546    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1547m4_define([_lt_decl_varnames_tagged],
1548[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1549
1550
1551# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1552# ------------------------------------------------
1553m4_define([lt_decl_all_varnames],
1554[_$0(m4_quote(m4_default([$1], [[, ]])),
1555     m4_if([$2], [],
1556	   m4_quote(lt_decl_varnames),
1557	m4_quote(m4_shift($@))))[]dnl
1558])
1559m4_define([_lt_decl_all_varnames],
1560[lt_join($@, lt_decl_varnames_tagged([$1],
1561			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1562])
1563
1564
1565# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1566# ------------------------------------
1567# Quote a variable value, and forward it to `config.status' so that its
1568# declaration there will have the same value as in `configure'.  VARNAME
1569# must have a single quote delimited value for this to work.
1570m4_define([_LT_CONFIG_STATUS_DECLARE],
1571[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1572
1573
1574# _LT_CONFIG_STATUS_DECLARATIONS
1575# ------------------------------
1576# We delimit libtool config variables with single quotes, so when
1577# we write them to config.status, we have to be sure to quote all
1578# embedded single quotes properly.  In configure, this macro expands
1579# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1580#
1581#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1582m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1583[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1584    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1585
1586
1587# _LT_LIBTOOL_TAGS
1588# ----------------
1589# Output comment and list of tags supported by the script
1590m4_defun([_LT_LIBTOOL_TAGS],
1591[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1592available_tags="_LT_TAGS"dnl
1593])
1594
1595
1596# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1597# -----------------------------------
1598# Extract the dictionary values for VARNAME (optionally with TAG) and
1599# expand to a commented shell variable setting:
1600#
1601#    # Some comment about what VAR is for.
1602#    visible_name=$lt_internal_name
1603m4_define([_LT_LIBTOOL_DECLARE],
1604[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1605					   [description])))[]dnl
1606m4_pushdef([_libtool_name],
1607    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1608m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1609    [0], [_libtool_name=[$]$1],
1610    [1], [_libtool_name=$lt_[]$1],
1611    [2], [_libtool_name=$lt_[]$1],
1612    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1613m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1614])
1615
1616
1617# _LT_LIBTOOL_CONFIG_VARS
1618# -----------------------
1619# Produce commented declarations of non-tagged libtool config variables
1620# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1621# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1622# section) are produced by _LT_LIBTOOL_TAG_VARS.
1623m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1624[m4_foreach([_lt_var],
1625    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1626    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1627
1628
1629# _LT_LIBTOOL_TAG_VARS(TAG)
1630# -------------------------
1631m4_define([_LT_LIBTOOL_TAG_VARS],
1632[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1633    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1634
1635
1636# _LT_TAGVAR(VARNAME, [TAGNAME])
1637# ------------------------------
1638m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1639
1640
1641# _LT_CONFIG_COMMANDS
1642# -------------------
1643# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1644# variables for single and double quote escaping we saved from calls
1645# to _LT_DECL, we can put quote escaped variables declarations
1646# into `config.status', and then the shell code to quote escape them in
1647# for loops in `config.status'.  Finally, any additional code accumulated
1648# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1649m4_defun([_LT_CONFIG_COMMANDS],
1650[AC_PROVIDE_IFELSE([LT_OUTPUT],
1651	dnl If the libtool generation code has been placed in $CONFIG_LT,
1652	dnl instead of duplicating it all over again into config.status,
1653	dnl then we will have config.status run $CONFIG_LT later, so it
1654	dnl needs to know what name is stored there:
1655        [AC_CONFIG_COMMANDS([libtool],
1656            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1657    dnl If the libtool generation code is destined for config.status,
1658    dnl expand the accumulated commands and init code now:
1659    [AC_CONFIG_COMMANDS([libtool],
1660        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1661])#_LT_CONFIG_COMMANDS
1662
1663
1664# Initialize.
1665m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1666[
1667
1668# The HP-UX ksh and POSIX shell print the target directory to stdout
1669# if CDPATH is set.
1670(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1671
1672sed_quote_subst='$sed_quote_subst'
1673double_quote_subst='$double_quote_subst'
1674delay_variable_subst='$delay_variable_subst'
1675_LT_CONFIG_STATUS_DECLARATIONS
1676LTCC='$LTCC'
1677LTCFLAGS='$LTCFLAGS'
1678compiler='$compiler_DEFAULT'
1679
1680# A function that is used when there is no print builtin or printf.
1681func_fallback_echo ()
1682{
1683  eval 'cat <<_LTECHO_EOF
1684\$[]1
1685_LTECHO_EOF'
1686}
1687
1688# Quote evaled strings.
1689for var in lt_decl_all_varnames([[ \
1690]], lt_decl_quote_varnames); do
1691    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1692    *[[\\\\\\\`\\"\\\$]]*)
1693      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1694      ;;
1695    *)
1696      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1697      ;;
1698    esac
1699done
1700
1701# Double-quote double-evaled strings.
1702for var in lt_decl_all_varnames([[ \
1703]], lt_decl_dquote_varnames); do
1704    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1705    *[[\\\\\\\`\\"\\\$]]*)
1706      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1707      ;;
1708    *)
1709      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1710      ;;
1711    esac
1712done
1713
1714_LT_OUTPUT_LIBTOOL_INIT
1715])
1716
1717# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1718# ------------------------------------
1719# Generate a child script FILE with all initialization necessary to
1720# reuse the environment learned by the parent script, and make the
1721# file executable.  If COMMENT is supplied, it is inserted after the
1722# `#!' sequence but before initialization text begins.  After this
1723# macro, additional text can be appended to FILE to form the body of
1724# the child script.  The macro ends with non-zero status if the
1725# file could not be fully written (such as if the disk is full).
1726m4_ifdef([AS_INIT_GENERATED],
1727[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1728[m4_defun([_LT_GENERATED_FILE_INIT],
1729[m4_require([AS_PREPARE])]dnl
1730[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1731[lt_write_fail=0
1732cat >$1 <<_ASEOF || lt_write_fail=1
1733#! $SHELL
1734# Generated by $as_me.
1735$2
1736SHELL=\${CONFIG_SHELL-$SHELL}
1737export SHELL
1738_ASEOF
1739cat >>$1 <<\_ASEOF || lt_write_fail=1
1740AS_SHELL_SANITIZE
1741_AS_PREPARE
1742exec AS_MESSAGE_FD>&1
1743_ASEOF
1744test $lt_write_fail = 0 && chmod +x $1[]dnl
1745m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1746
1747# LT_OUTPUT
1748# ---------
1749# This macro allows early generation of the libtool script (before
1750# AC_OUTPUT is called), incase it is used in configure for compilation
1751# tests.
1752AC_DEFUN([LT_OUTPUT],
1753[: ${CONFIG_LT=./config.lt}
1754AC_MSG_NOTICE([creating $CONFIG_LT])
1755_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1756[# Run this file to recreate a libtool stub with the current configuration.])
1757
1758cat >>"$CONFIG_LT" <<\_LTEOF
1759lt_cl_silent=false
1760exec AS_MESSAGE_LOG_FD>>config.log
1761{
1762  echo
1763  AS_BOX([Running $as_me.])
1764} >&AS_MESSAGE_LOG_FD
1765
1766lt_cl_help="\
1767\`$as_me' creates a local libtool stub from the current configuration,
1768for use in further configure time tests before the real libtool is
1769generated.
1770
1771Usage: $[0] [[OPTIONS]]
1772
1773  -h, --help      print this help, then exit
1774  -V, --version   print version number, then exit
1775  -q, --quiet     do not print progress messages
1776  -d, --debug     don't remove temporary files
1777
1778Report bugs to <bug-libtool@gnu.org>."
1779
1780lt_cl_version="\
1781m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1782m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1783configured by $[0], generated by m4_PACKAGE_STRING.
1784
1785Copyright (C) 2011 Free Software Foundation, Inc.
1786This config.lt script is free software; the Free Software Foundation
1787gives unlimited permision to copy, distribute and modify it."
1788
1789while test $[#] != 0
1790do
1791  case $[1] in
1792    --version | --v* | -V )
1793      echo "$lt_cl_version"; exit 0 ;;
1794    --help | --h* | -h )
1795      echo "$lt_cl_help"; exit 0 ;;
1796    --debug | --d* | -d )
1797      debug=: ;;
1798    --quiet | --q* | --silent | --s* | -q )
1799      lt_cl_silent=: ;;
1800
1801    -*) AC_MSG_ERROR([unrecognized option: $[1]
1802Try \`$[0] --help' for more information.]) ;;
1803
1804    *) AC_MSG_ERROR([unrecognized argument: $[1]
1805Try \`$[0] --help' for more information.]) ;;
1806  esac
1807  shift
1808done
1809
1810if $lt_cl_silent; then
1811  exec AS_MESSAGE_FD>/dev/null
1812fi
1813_LTEOF
1814
1815cat >>"$CONFIG_LT" <<_LTEOF
1816_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1817_LTEOF
1818
1819cat >>"$CONFIG_LT" <<\_LTEOF
1820AC_MSG_NOTICE([creating $ofile])
1821_LT_OUTPUT_LIBTOOL_COMMANDS
1822AS_EXIT(0)
1823_LTEOF
1824chmod +x "$CONFIG_LT"
1825
1826# configure is writing to config.log, but config.lt does its own redirection,
1827# appending to config.log, which fails on DOS, as config.log is still kept
1828# open by configure.  Here we exec the FD to /dev/null, effectively closing
1829# config.log, so it can be properly (re)opened and appended to by config.lt.
1830lt_cl_success=:
1831test "$silent" = yes &&
1832  lt_config_lt_args="$lt_config_lt_args --quiet"
1833exec AS_MESSAGE_LOG_FD>/dev/null
1834$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1835exec AS_MESSAGE_LOG_FD>>config.log
1836$lt_cl_success || AS_EXIT(1)
1837])# LT_OUTPUT
1838
1839
1840# _LT_CONFIG(TAG)
1841# ---------------
1842# If TAG is the built-in tag, create an initial libtool script with a
1843# default configuration from the untagged config vars.  Otherwise add code
1844# to config.status for appending the configuration named by TAG from the
1845# matching tagged config vars.
1846m4_defun([_LT_CONFIG],
1847[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1848_LT_CONFIG_SAVE_COMMANDS([
1849  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1850  m4_if(_LT_TAG, [C], [
1851    # See if we are running on zsh, and set the options which allow our
1852    # commands through without removal of \ escapes.
1853    if test -n "${ZSH_VERSION+set}" ; then
1854      setopt NO_GLOB_SUBST
1855    fi
1856
1857    cfgfile="${ofile}T"
1858    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1859    $RM "$cfgfile"
1860
1861    cat <<_LT_EOF >> "$cfgfile"
1862#! $SHELL
1863
1864# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1865# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1866# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1867# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1868#
1869_LT_COPYING
1870_LT_LIBTOOL_TAGS
1871
1872# ### BEGIN LIBTOOL CONFIG
1873_LT_LIBTOOL_CONFIG_VARS
1874_LT_LIBTOOL_TAG_VARS
1875# ### END LIBTOOL CONFIG
1876
1877_LT_EOF
1878
1879  case $host_os in
1880  aix3*)
1881    cat <<\_LT_EOF >> "$cfgfile"
1882# AIX sometimes has problems with the GCC collect2 program.  For some
1883# reason, if we set the COLLECT_NAMES environment variable, the problems
1884# vanish in a puff of smoke.
1885if test "X${COLLECT_NAMES+set}" != Xset; then
1886  COLLECT_NAMES=
1887  export COLLECT_NAMES
1888fi
1889_LT_EOF
1890    ;;
1891  esac
1892
1893  _LT_PROG_LTMAIN
1894
1895  # We use sed instead of cat because bash on DJGPP gets confused if
1896  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1897  # text mode, it properly converts lines to CR/LF.  This bash problem
1898  # is reportedly fixed, but why not run on old versions too?
1899  sed '$q' "$ltmain" >> "$cfgfile" \
1900     || (rm -f "$cfgfile"; exit 1)
1901
1902  _LT_PROG_REPLACE_SHELLFNS
1903
1904   mv -f "$cfgfile" "$ofile" ||
1905    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1906  chmod +x "$ofile"
1907],
1908[cat <<_LT_EOF >> "$ofile"
1909
1910dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1911dnl in a comment (ie after a #).
1912# ### BEGIN LIBTOOL TAG CONFIG: $1
1913_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1914# ### END LIBTOOL TAG CONFIG: $1
1915_LT_EOF
1916])dnl /m4_if
1917],
1918[m4_if([$1], [], [
1919    PACKAGE='$PACKAGE'
1920    VERSION='$VERSION'
1921    TIMESTAMP='$TIMESTAMP'
1922    RM='$RM'
1923    ofile='$ofile'], [])
1924])dnl /_LT_CONFIG_SAVE_COMMANDS
1925])# _LT_CONFIG
1926
1927
1928# LT_SUPPORTED_TAG(TAG)
1929# ---------------------
1930# Trace this macro to discover what tags are supported by the libtool
1931# --tag option, using:
1932#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1933AC_DEFUN([LT_SUPPORTED_TAG], [])
1934
1935
1936# C support is built-in for now
1937m4_define([_LT_LANG_C_enabled], [])
1938m4_define([_LT_TAGS], [])
1939
1940
1941# LT_LANG(LANG)
1942# -------------
1943# Enable libtool support for the given language if not already enabled.
1944AC_DEFUN([LT_LANG],
1945[AC_BEFORE([$0], [LT_OUTPUT])dnl
1946m4_case([$1],
1947  [C],			[_LT_LANG(C)],
1948  [C++],		[_LT_LANG(CXX)],
1949  [Go],			[_LT_LANG(GO)],
1950  [Java],		[_LT_LANG(GCJ)],
1951  [Fortran 77],		[_LT_LANG(F77)],
1952  [Fortran],		[_LT_LANG(FC)],
1953  [Windows Resource],	[_LT_LANG(RC)],
1954  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1955    [_LT_LANG($1)],
1956    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1957])# LT_LANG
1958
1959
1960# _LT_LANG(LANGNAME)
1961# ------------------
1962m4_defun([_LT_LANG],
1963[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1964  [LT_SUPPORTED_TAG([$1])dnl
1965  m4_append([_LT_TAGS], [$1 ])dnl
1966  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1967  _LT_LANG_$1_CONFIG($1)])dnl
1968])# _LT_LANG
1969
1970
1971m4_ifndef([AC_PROG_GO], [
1972# NOTE: This macro has been submitted for inclusion into   #
1973#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1974#  a released version of Autoconf we should remove this    #
1975#  macro and use it instead.                               #
1976m4_defun([AC_PROG_GO],
1977[AC_LANG_PUSH(Go)dnl
1978AC_ARG_VAR([GOC],     [Go compiler command])dnl
1979AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1980_AC_ARG_VAR_LDFLAGS()dnl
1981AC_CHECK_TOOL(GOC, gccgo)
1982if test -z "$GOC"; then
1983  if test -n "$ac_tool_prefix"; then
1984    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1985  fi
1986fi
1987if test -z "$GOC"; then
1988  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1989fi
1990])#m4_defun
1991])#m4_ifndef
1992
1993
1994# _LT_LANG_DEFAULT_CONFIG
1995# -----------------------
1996m4_defun([_LT_LANG_DEFAULT_CONFIG],
1997[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1998  [LT_LANG(CXX)],
1999  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
2000
2001AC_PROVIDE_IFELSE([AC_PROG_F77],
2002  [LT_LANG(F77)],
2003  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
2004
2005AC_PROVIDE_IFELSE([AC_PROG_FC],
2006  [LT_LANG(FC)],
2007  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
2008
2009dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
2010dnl pulling things in needlessly.
2011AC_PROVIDE_IFELSE([AC_PROG_GCJ],
2012  [LT_LANG(GCJ)],
2013  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
2014    [LT_LANG(GCJ)],
2015    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
2016      [LT_LANG(GCJ)],
2017      [m4_ifdef([AC_PROG_GCJ],
2018	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
2019       m4_ifdef([A][M_PROG_GCJ],
2020	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
2021       m4_ifdef([LT_PROG_GCJ],
2022	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
2023
2024AC_PROVIDE_IFELSE([AC_PROG_GO],
2025  [LT_LANG(GO)],
2026  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
2027
2028AC_PROVIDE_IFELSE([LT_PROG_RC],
2029  [LT_LANG(RC)],
2030  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
2031])# _LT_LANG_DEFAULT_CONFIG
2032
2033# Obsolete macros:
2034AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
2035AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
2036AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
2037AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
2038AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
2039dnl aclocal-1.4 backwards compatibility:
2040dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
2041dnl AC_DEFUN([AC_LIBTOOL_F77], [])
2042dnl AC_DEFUN([AC_LIBTOOL_FC], [])
2043dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
2044dnl AC_DEFUN([AC_LIBTOOL_RC], [])
2045
2046
2047# _LT_TAG_COMPILER
2048# ----------------
2049m4_defun([_LT_TAG_COMPILER],
2050[AC_REQUIRE([AC_PROG_CC])dnl
2051
2052_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
2053_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
2054_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
2055_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
2056
2057# If no C compiler was specified, use CC.
2058LTCC=${LTCC-"$CC"}
2059
2060# If no C compiler flags were specified, use CFLAGS.
2061LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2062
2063# Allow CC to be a program name with arguments.
2064compiler=$CC
2065])# _LT_TAG_COMPILER
2066
2067
2068# _LT_COMPILER_BOILERPLATE
2069# ------------------------
2070# Check for compiler boilerplate output or warnings with
2071# the simple compiler test code.
2072m4_defun([_LT_COMPILER_BOILERPLATE],
2073[m4_require([_LT_DECL_SED])dnl
2074ac_outfile=conftest.$ac_objext
2075echo "$lt_simple_compile_test_code" >conftest.$ac_ext
2076eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2077_lt_compiler_boilerplate=`cat conftest.err`
2078$RM conftest*
2079])# _LT_COMPILER_BOILERPLATE
2080
2081
2082# _LT_LINKER_BOILERPLATE
2083# ----------------------
2084# Check for linker boilerplate output or warnings with
2085# the simple link test code.
2086m4_defun([_LT_LINKER_BOILERPLATE],
2087[m4_require([_LT_DECL_SED])dnl
2088ac_outfile=conftest.$ac_objext
2089echo "$lt_simple_link_test_code" >conftest.$ac_ext
2090eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2091_lt_linker_boilerplate=`cat conftest.err`
2092$RM -r conftest*
2093])# _LT_LINKER_BOILERPLATE
2094
2095# _LT_REQUIRED_DARWIN_CHECKS
2096# -------------------------
2097m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
2098  case $host_os in
2099    rhapsody* | darwin*)
2100    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
2101    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
2102    AC_CHECK_TOOL([LIPO], [lipo], [:])
2103    AC_CHECK_TOOL([OTOOL], [otool], [:])
2104    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
2105    _LT_DECL([], [DSYMUTIL], [1],
2106      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
2107    _LT_DECL([], [NMEDIT], [1],
2108      [Tool to change global to local symbols on Mac OS X])
2109    _LT_DECL([], [LIPO], [1],
2110      [Tool to manipulate fat objects and archives on Mac OS X])
2111    _LT_DECL([], [OTOOL], [1],
2112      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2113    _LT_DECL([], [OTOOL64], [1],
2114      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2115
2116    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2117      [lt_cv_apple_cc_single_mod=no
2118      if test -z "${LT_MULTI_MODULE}"; then
2119	# By default we will add the -single_module flag. You can override
2120	# by either setting the environment variable LT_MULTI_MODULE
2121	# non-empty at configure time, or by adding -multi_module to the
2122	# link flags.
2123	rm -rf libconftest.dylib*
2124	echo "int foo(void){return 1;}" > conftest.c
2125	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2126-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2127	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2128	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2129        _lt_result=$?
2130	# If there is a non-empty error log, and "single_module"
2131	# appears in it, assume the flag caused a linker warning
2132        if test -s conftest.err && $GREP single_module conftest.err; then
2133	  cat conftest.err >&AS_MESSAGE_LOG_FD
2134	# Otherwise, if the output was created with a 0 exit code from
2135	# the compiler, it worked.
2136	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2137	  lt_cv_apple_cc_single_mod=yes
2138	else
2139	  cat conftest.err >&AS_MESSAGE_LOG_FD
2140	fi
2141	rm -rf libconftest.dylib*
2142	rm -f conftest.*
2143      fi])
2144
2145    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2146      [lt_cv_ld_exported_symbols_list],
2147      [lt_cv_ld_exported_symbols_list=no
2148      save_LDFLAGS=$LDFLAGS
2149      echo "_main" > conftest.sym
2150      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2151      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2152	[lt_cv_ld_exported_symbols_list=yes],
2153	[lt_cv_ld_exported_symbols_list=no])
2154	LDFLAGS="$save_LDFLAGS"
2155    ])
2156
2157    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2158      [lt_cv_ld_force_load=no
2159      cat > conftest.c << _LT_EOF
2160int forced_loaded() { return 2;}
2161_LT_EOF
2162      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2163      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2164      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2165      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2166      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2167      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2168      cat > conftest.c << _LT_EOF
2169int main() { return 0;}
2170_LT_EOF
2171      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2172      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2173      _lt_result=$?
2174      if test -s conftest.err && $GREP force_load conftest.err; then
2175	cat conftest.err >&AS_MESSAGE_LOG_FD
2176      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2177	lt_cv_ld_force_load=yes
2178      else
2179	cat conftest.err >&AS_MESSAGE_LOG_FD
2180      fi
2181        rm -f conftest.err libconftest.a conftest conftest.c
2182        rm -rf conftest.dSYM
2183    ])
2184    case $host_os in
2185    rhapsody* | darwin1.[[012]])
2186      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2187    darwin1.*)
2188      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2189    darwin*) # darwin 5.x on
2190      # if running on 10.5 or later, the deployment target defaults
2191      # to the OS version, if on x86, and 10.4, the deployment
2192      # target defaults to 10.4. Don't you love it?
2193      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2194	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2195	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2196	10.[[012]]*)
2197	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2198	10.*)
2199	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2200      esac
2201    ;;
2202  esac
2203    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2204      _lt_dar_single_mod='$single_module'
2205    fi
2206    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2207      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2208    else
2209      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2210    fi
2211    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2212      _lt_dsymutil='~$DSYMUTIL $lib || :'
2213    else
2214      _lt_dsymutil=
2215    fi
2216    ;;
2217  esac
2218])
2219
2220
2221# _LT_DARWIN_LINKER_FEATURES([TAG])
2222# ---------------------------------
2223# Checks for linker and compiler features on darwin
2224m4_defun([_LT_DARWIN_LINKER_FEATURES],
2225[
2226  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2227  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2228  _LT_TAGVAR(hardcode_direct, $1)=no
2229  _LT_TAGVAR(hardcode_automatic, $1)=yes
2230  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2231  if test "$lt_cv_ld_force_load" = "yes"; then
2232    _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\"`'
2233    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2234                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2235  else
2236    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2237  fi
2238  _LT_TAGVAR(link_all_deplibs, $1)=yes
2239  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2240  case $cc_basename in
2241     ifort*) _lt_dar_can_shared=yes ;;
2242     *) _lt_dar_can_shared=$GCC ;;
2243  esac
2244  if test "$_lt_dar_can_shared" = "yes"; then
2245    output_verbose_link_cmd=func_echo_all
2246    _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}"
2247    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2248    _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}"
2249    _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}"
2250    m4_if([$1], [CXX],
2251[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2252      _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}"
2253      _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}"
2254    fi
2255],[])
2256  else
2257  _LT_TAGVAR(ld_shlibs, $1)=no
2258  fi
2259])
2260
2261# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2262# ----------------------------------
2263# Links a minimal program and checks the executable
2264# for the system default hardcoded library path. In most cases,
2265# this is /usr/lib:/lib, but when the MPI compilers are used
2266# the location of the communication and MPI libs are included too.
2267# If we don't find anything, use the default library path according
2268# to the aix ld manual.
2269# Store the results from the different compilers for each TAGNAME.
2270# Allow to override them for all tags through lt_cv_aix_libpath.
2271m4_defun([_LT_SYS_MODULE_PATH_AIX],
2272[m4_require([_LT_DECL_SED])dnl
2273if test "${lt_cv_aix_libpath+set}" = set; then
2274  aix_libpath=$lt_cv_aix_libpath
2275else
2276  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2277  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2278  lt_aix_libpath_sed='[
2279      /Import File Strings/,/^$/ {
2280	  /^0/ {
2281	      s/^0  *\([^ ]*\) *$/\1/
2282	      p
2283	  }
2284      }]'
2285  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2286  # Check for a 64-bit object if we didn't find anything.
2287  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2288    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2289  fi],[])
2290  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2291    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2292  fi
2293  ])
2294  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2295fi
2296])# _LT_SYS_MODULE_PATH_AIX
2297
2298
2299# _LT_SHELL_INIT(ARG)
2300# -------------------
2301m4_define([_LT_SHELL_INIT],
2302[m4_divert_text([M4SH-INIT], [$1
2303])])# _LT_SHELL_INIT
2304
2305
2306
2307# _LT_PROG_ECHO_BACKSLASH
2308# -----------------------
2309# Find how we can fake an echo command that does not interpret backslash.
2310# In particular, with Autoconf 2.60 or later we add some code to the start
2311# of the generated configure script which will find a shell with a builtin
2312# printf (which we can use as an echo command).
2313m4_defun([_LT_PROG_ECHO_BACKSLASH],
2314[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2315ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2316ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2317
2318AC_MSG_CHECKING([how to print strings])
2319# Test print first, because it will be a builtin if present.
2320if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2321   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2322  ECHO='print -r --'
2323elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2324  ECHO='printf %s\n'
2325else
2326  # Use this function as a fallback that always works.
2327  func_fallback_echo ()
2328  {
2329    eval 'cat <<_LTECHO_EOF
2330$[]1
2331_LTECHO_EOF'
2332  }
2333  ECHO='func_fallback_echo'
2334fi
2335
2336# func_echo_all arg...
2337# Invoke $ECHO with all args, space-separated.
2338func_echo_all ()
2339{
2340    $ECHO "$*" 
2341}
2342
2343case "$ECHO" in
2344  printf*) AC_MSG_RESULT([printf]) ;;
2345  print*) AC_MSG_RESULT([print -r]) ;;
2346  *) AC_MSG_RESULT([cat]) ;;
2347esac
2348
2349m4_ifdef([_AS_DETECT_SUGGESTED],
2350[_AS_DETECT_SUGGESTED([
2351  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2352    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2353    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2354    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2355    PATH=/empty FPATH=/empty; export PATH FPATH
2356    test "X`printf %s $ECHO`" = "X$ECHO" \
2357      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2358
2359_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2360_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2361])# _LT_PROG_ECHO_BACKSLASH
2362
2363
2364# _LT_WITH_SYSROOT
2365# ----------------
2366AC_DEFUN([_LT_WITH_SYSROOT],
2367[AC_MSG_CHECKING([for sysroot])
2368AC_ARG_WITH([sysroot],
2369[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2370                        (or the compiler's sysroot if not specified).],
2371[], [with_sysroot=no])
2372
2373dnl lt_sysroot will always be passed unquoted.  We quote it here
2374dnl in case the user passed a directory name.
2375lt_sysroot=
2376case ${with_sysroot} in #(
2377 yes)
2378   if test "$GCC" = yes; then
2379     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2380   fi
2381   ;; #(
2382 /*)
2383   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2384   ;; #(
2385 no|'')
2386   ;; #(
2387 *)
2388   AC_MSG_RESULT([${with_sysroot}])
2389   AC_MSG_ERROR([The sysroot must be an absolute path.])
2390   ;;
2391esac
2392
2393 AC_MSG_RESULT([${lt_sysroot:-no}])
2394_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2395[dependent libraries, and in which our libraries should be installed.])])
2396
2397# _LT_ENABLE_LOCK
2398# ---------------
2399m4_defun([_LT_ENABLE_LOCK],
2400[AC_ARG_ENABLE([libtool-lock],
2401  [AS_HELP_STRING([--disable-libtool-lock],
2402    [avoid locking (might break parallel builds)])])
2403test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2404
2405# Some flags need to be propagated to the compiler or linker for good
2406# libtool support.
2407case $host in
2408ia64-*-hpux*)
2409  # Find out which ABI we are using.
2410  echo 'int i;' > conftest.$ac_ext
2411  if AC_TRY_EVAL(ac_compile); then
2412    case `/usr/bin/file conftest.$ac_objext` in
2413      *ELF-32*)
2414	HPUX_IA64_MODE="32"
2415	;;
2416      *ELF-64*)
2417	HPUX_IA64_MODE="64"
2418	;;
2419    esac
2420  fi
2421  rm -rf conftest*
2422  ;;
2423*-*-irix6*)
2424  # Find out which ABI we are using.
2425  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2426  if AC_TRY_EVAL(ac_compile); then
2427    if test "$lt_cv_prog_gnu_ld" = yes; then
2428      case `/usr/bin/file conftest.$ac_objext` in
2429	*32-bit*)
2430	  LD="${LD-ld} -melf32bsmip"
2431	  ;;
2432	*N32*)
2433	  LD="${LD-ld} -melf32bmipn32"
2434	  ;;
2435	*64-bit*)
2436	  LD="${LD-ld} -melf64bmip"
2437	;;
2438      esac
2439    else
2440      case `/usr/bin/file conftest.$ac_objext` in
2441	*32-bit*)
2442	  LD="${LD-ld} -32"
2443	  ;;
2444	*N32*)
2445	  LD="${LD-ld} -n32"
2446	  ;;
2447	*64-bit*)
2448	  LD="${LD-ld} -64"
2449	  ;;
2450      esac
2451    fi
2452  fi
2453  rm -rf conftest*
2454  ;;
2455
2456x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2457s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2458  # Find out which ABI we are using.
2459  echo 'int i;' > conftest.$ac_ext
2460  if AC_TRY_EVAL(ac_compile); then
2461    case `/usr/bin/file conftest.o` in
2462      *32-bit*)
2463	case $host in
2464	  x86_64-*kfreebsd*-gnu)
2465	    LD="${LD-ld} -m elf_i386_fbsd"
2466	    ;;
2467	  x86_64-*linux*)
2468	    LD="${LD-ld} -m elf_i386"
2469	    ;;
2470	  ppc64-*linux*|powerpc64-*linux*)
2471	    LD="${LD-ld} -m elf32ppclinux"
2472	    ;;
2473	  s390x-*linux*)
2474	    LD="${LD-ld} -m elf_s390"
2475	    ;;
2476	  sparc64-*linux*)
2477	    LD="${LD-ld} -m elf32_sparc"
2478	    ;;
2479	esac
2480	;;
2481      *64-bit*)
2482	case $host in
2483	  x86_64-*kfreebsd*-gnu)
2484	    LD="${LD-ld} -m elf_x86_64_fbsd"
2485	    ;;
2486	  x86_64-*linux*)
2487	    LD="${LD-ld} -m elf_x86_64"
2488	    ;;
2489	  ppc*-*linux*|powerpc*-*linux*)
2490	    LD="${LD-ld} -m elf64ppc"
2491	    ;;
2492	  s390*-*linux*|s390*-*tpf*)
2493	    LD="${LD-ld} -m elf64_s390"
2494	    ;;
2495	  sparc*-*linux*)
2496	    LD="${LD-ld} -m elf64_sparc"
2497	    ;;
2498	esac
2499	;;
2500    esac
2501  fi
2502  rm -rf conftest*
2503  ;;
2504
2505*-*-sco3.2v5*)
2506  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2507  SAVE_CFLAGS="$CFLAGS"
2508  CFLAGS="$CFLAGS -belf"
2509  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2510    [AC_LANG_PUSH(C)
2511     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2512     AC_LANG_POP])
2513  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2514    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2515    CFLAGS="$SAVE_CFLAGS"
2516  fi
2517  ;;
2518*-*solaris*)
2519  # Find out which ABI we are using.
2520  echo 'int i;' > conftest.$ac_ext
2521  if AC_TRY_EVAL(ac_compile); then
2522    case `/usr/bin/file conftest.o` in
2523    *64-bit*)
2524      case $lt_cv_prog_gnu_ld in
2525      yes*)
2526        case $host in
2527        i?86-*-solaris*)
2528          LD="${LD-ld} -m elf_x86_64"
2529          ;;
2530        sparc*-*-solaris*)
2531          LD="${LD-ld} -m elf64_sparc"
2532          ;;
2533        esac
2534        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2535        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2536          LD="${LD-ld}_sol2"
2537        fi
2538        ;;
2539      *)
2540	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2541	  LD="${LD-ld} -64"
2542	fi
2543	;;
2544      esac
2545      ;;
2546    esac
2547  fi
2548  rm -rf conftest*
2549  ;;
2550esac
2551
2552need_locks="$enable_libtool_lock"
2553])# _LT_ENABLE_LOCK
2554
2555
2556# _LT_PROG_AR
2557# -----------
2558m4_defun([_LT_PROG_AR],
2559[AC_CHECK_TOOLS(AR, [ar], false)
2560: ${AR=ar}
2561: ${AR_FLAGS=cru}
2562_LT_DECL([], [AR], [1], [The archiver])
2563_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2564
2565AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2566  [lt_cv_ar_at_file=no
2567   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2568     [echo conftest.$ac_objext > conftest.lst
2569      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2570      AC_TRY_EVAL([lt_ar_try])
2571      if test "$ac_status" -eq 0; then
2572	# Ensure the archiver fails upon bogus file names.
2573	rm -f conftest.$ac_objext libconftest.a
2574	AC_TRY_EVAL([lt_ar_try])
2575	if test "$ac_status" -ne 0; then
2576          lt_cv_ar_at_file=@
2577        fi
2578      fi
2579      rm -f conftest.* libconftest.a
2580     ])
2581  ])
2582
2583if test "x$lt_cv_ar_at_file" = xno; then
2584  archiver_list_spec=
2585else
2586  archiver_list_spec=$lt_cv_ar_at_file
2587fi
2588_LT_DECL([], [archiver_list_spec], [1],
2589  [How to feed a file listing to the archiver])
2590])# _LT_PROG_AR
2591
2592
2593# _LT_CMD_OLD_ARCHIVE
2594# -------------------
2595m4_defun([_LT_CMD_OLD_ARCHIVE],
2596[_LT_PROG_AR
2597
2598AC_CHECK_TOOL(STRIP, strip, :)
2599test -z "$STRIP" && STRIP=:
2600_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2601
2602AC_CHECK_TOOL(RANLIB, ranlib, :)
2603test -z "$RANLIB" && RANLIB=:
2604_LT_DECL([], [RANLIB], [1],
2605    [Commands used to install an old-style archive])
2606
2607# Determine commands to create old-style static archives.
2608old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2609old_postinstall_cmds='chmod 644 $oldlib'
2610old_postuninstall_cmds=
2611
2612if test -n "$RANLIB"; then
2613  case $host_os in
2614  openbsd*)
2615    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2616    ;;
2617  *)
2618    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2619    ;;
2620  esac
2621  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2622fi
2623
2624case $host_os in
2625  darwin*)
2626    lock_old_archive_extraction=yes ;;
2627  *)
2628    lock_old_archive_extraction=no ;;
2629esac
2630_LT_DECL([], [old_postinstall_cmds], [2])
2631_LT_DECL([], [old_postuninstall_cmds], [2])
2632_LT_TAGDECL([], [old_archive_cmds], [2],
2633    [Commands used to build an old-style archive])
2634_LT_DECL([], [lock_old_archive_extraction], [0],
2635    [Whether to use a lock for old archive extraction])
2636])# _LT_CMD_OLD_ARCHIVE
2637
2638
2639# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2640#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2641# ----------------------------------------------------------------
2642# Check whether the given compiler option works
2643AC_DEFUN([_LT_COMPILER_OPTION],
2644[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2645m4_require([_LT_DECL_SED])dnl
2646AC_CACHE_CHECK([$1], [$2],
2647  [$2=no
2648   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2649   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2650   lt_compiler_flag="$3"
2651   # Insert the option either (1) after the last *FLAGS variable, or
2652   # (2) before a word containing "conftest.", or (3) at the end.
2653   # Note that $ac_compile itself does not contain backslashes and begins
2654   # with a dollar sign (not a hyphen), so the echo should work correctly.
2655   # The option is referenced via a variable to avoid confusing sed.
2656   lt_compile=`echo "$ac_compile" | $SED \
2657   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2658   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2659   -e 's:$: $lt_compiler_flag:'`
2660   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2661   (eval "$lt_compile" 2>conftest.err)
2662   ac_status=$?
2663   cat conftest.err >&AS_MESSAGE_LOG_FD
2664   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2665   if (exit $ac_status) && test -s "$ac_outfile"; then
2666     # The compiler can only warn and ignore the option if not recognized
2667     # So say no if there are warnings other than the usual output.
2668     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2669     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2670     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2671       $2=yes
2672     fi
2673   fi
2674   $RM conftest*
2675])
2676
2677if test x"[$]$2" = xyes; then
2678    m4_if([$5], , :, [$5])
2679else
2680    m4_if([$6], , :, [$6])
2681fi
2682])# _LT_COMPILER_OPTION
2683
2684# Old name:
2685AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2686dnl aclocal-1.4 backwards compatibility:
2687dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2688
2689
2690# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2691#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2692# ----------------------------------------------------
2693# Check whether the given linker option works
2694AC_DEFUN([_LT_LINKER_OPTION],
2695[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2696m4_require([_LT_DECL_SED])dnl
2697AC_CACHE_CHECK([$1], [$2],
2698  [$2=no
2699   save_LDFLAGS="$LDFLAGS"
2700   LDFLAGS="$LDFLAGS $3"
2701   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2702   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2703     # The linker can only warn and ignore the option if not recognized
2704     # So say no if there are warnings
2705     if test -s conftest.err; then
2706       # Append any errors to the config.log.
2707       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2708       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2709       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2710       if diff conftest.exp conftest.er2 >/dev/null; then
2711         $2=yes
2712       fi
2713     else
2714       $2=yes
2715     fi
2716   fi
2717   $RM -r conftest*
2718   LDFLAGS="$save_LDFLAGS"
2719])
2720
2721if test x"[$]$2" = xyes; then
2722    m4_if([$4], , :, [$4])
2723else
2724    m4_if([$5], , :, [$5])
2725fi
2726])# _LT_LINKER_OPTION
2727
2728# Old name:
2729AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2730dnl aclocal-1.4 backwards compatibility:
2731dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2732
2733
2734# LT_CMD_MAX_LEN
2735#---------------
2736AC_DEFUN([LT_CMD_MAX_LEN],
2737[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2738# find the maximum length of command line arguments
2739AC_MSG_CHECKING([the maximum length of command line arguments])
2740AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2741  i=0
2742  teststring="ABCD"
2743
2744  case $build_os in
2745  msdosdjgpp*)
2746    # On DJGPP, this test can blow up pretty badly due to problems in libc
2747    # (any single argument exceeding 2000 bytes causes a buffer overrun
2748    # during glob expansion).  Even if it were fixed, the result of this
2749    # check would be larger than it should be.
2750    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2751    ;;
2752
2753  gnu*)
2754    # Under GNU Hurd, this test is not required because there is
2755    # no limit to the length of command line arguments.
2756    # Libtool will interpret -1 as no limit whatsoever
2757    lt_cv_sys_max_cmd_len=-1;
2758    ;;
2759
2760  cygwin* | mingw* | cegcc*)
2761    # On Win9x/ME, this test blows up -- it succeeds, but takes
2762    # about 5 minutes as the teststring grows exponentially.
2763    # Worse, since 9x/ME are not pre-emptively multitasking,
2764    # you end up with a "frozen" computer, even though with patience
2765    # the test eventually succeeds (with a max line length of 256k).
2766    # Instead, let's just punt: use the minimum linelength reported by
2767    # all of the supported platforms: 8192 (on NT/2K/XP).
2768    lt_cv_sys_max_cmd_len=8192;
2769    ;;
2770
2771  mint*)
2772    # On MiNT this can take a long time and run out of memory.
2773    lt_cv_sys_max_cmd_len=8192;
2774    ;;
2775
2776  amigaos*)
2777    # On AmigaOS with pdksh, this test takes hours, literally.
2778    # So we just punt and use a minimum line length of 8192.
2779    lt_cv_sys_max_cmd_len=8192;
2780    ;;
2781
2782  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2783    # This has been around since 386BSD, at least.  Likely further.
2784    if test -x /sbin/sysctl; then
2785      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2786    elif test -x /usr/sbin/sysctl; then
2787      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2788    else
2789      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2790    fi
2791    # And add a safety zone
2792    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2793    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2794    ;;
2795
2796  interix*)
2797    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2798    lt_cv_sys_max_cmd_len=196608
2799    ;;
2800
2801  os2*)
2802    # The test takes a long time on OS/2.
2803    lt_cv_sys_max_cmd_len=8192
2804    ;;
2805
2806  osf*)
2807    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2808    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2809    # nice to cause kernel panics so lets avoid the loop below.
2810    # First set a reasonable default.
2811    lt_cv_sys_max_cmd_len=16384
2812    #
2813    if test -x /sbin/sysconfig; then
2814      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2815        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2816      esac
2817    fi
2818    ;;
2819  sco3.2v5*)
2820    lt_cv_sys_max_cmd_len=102400
2821    ;;
2822  sysv5* | sco5v6* | sysv4.2uw2*)
2823    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2824    if test -n "$kargmax"; then
2825      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2826    else
2827      lt_cv_sys_max_cmd_len=32768
2828    fi
2829    ;;
2830  *)
2831    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2832    if test -n "$lt_cv_sys_max_cmd_len"; then
2833      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2834      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2835    else
2836      # Make teststring a little bigger before we do anything with it.
2837      # a 1K string should be a reasonable start.
2838      for i in 1 2 3 4 5 6 7 8 ; do
2839        teststring=$teststring$teststring
2840      done
2841      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2842      # If test is not a shell built-in, we'll probably end up computing a
2843      # maximum length that is only half of the actual maximum length, but
2844      # we can't tell.
2845      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2846	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2847	      test $i != 17 # 1/2 MB should be enough
2848      do
2849        i=`expr $i + 1`
2850        teststring=$teststring$teststring
2851      done
2852      # Only check the string length outside the loop.
2853      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2854      teststring=
2855      # Add a significant safety factor because C++ compilers can tack on
2856      # massive amounts of additional arguments before passing them to the
2857      # linker.  It appears as though 1/2 is a usable value.
2858      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2859    fi
2860    ;;
2861  esac
2862])
2863if test -n $lt_cv_sys_max_cmd_len ; then
2864  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2865else
2866  AC_MSG_RESULT(none)
2867fi
2868max_cmd_len=$lt_cv_sys_max_cmd_len
2869_LT_DECL([], [max_cmd_len], [0],
2870    [What is the maximum length of a command?])
2871])# LT_CMD_MAX_LEN
2872
2873# Old name:
2874AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2875dnl aclocal-1.4 backwards compatibility:
2876dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2877
2878
2879# _LT_HEADER_DLFCN
2880# ----------------
2881m4_defun([_LT_HEADER_DLFCN],
2882[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2883])# _LT_HEADER_DLFCN
2884
2885
2886# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2887#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2888# ----------------------------------------------------------------
2889m4_defun([_LT_TRY_DLOPEN_SELF],
2890[m4_require([_LT_HEADER_DLFCN])dnl
2891if test "$cross_compiling" = yes; then :
2892  [$4]
2893else
2894  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2895  lt_status=$lt_dlunknown
2896  cat > conftest.$ac_ext <<_LT_EOF
2897[#line $LINENO "configure"
2898#include "confdefs.h"
2899
2900#if HAVE_DLFCN_H
2901#include <dlfcn.h>
2902#endif
2903
2904#include <stdio.h>
2905
2906#ifdef RTLD_GLOBAL
2907#  define LT_DLGLOBAL		RTLD_GLOBAL
2908#else
2909#  ifdef DL_GLOBAL
2910#    define LT_DLGLOBAL		DL_GLOBAL
2911#  else
2912#    define LT_DLGLOBAL		0
2913#  endif
2914#endif
2915
2916/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2917   find out it does not work in some platform. */
2918#ifndef LT_DLLAZY_OR_NOW
2919#  ifdef RTLD_LAZY
2920#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2921#  else
2922#    ifdef DL_LAZY
2923#      define LT_DLLAZY_OR_NOW		DL_LAZY
2924#    else
2925#      ifdef RTLD_NOW
2926#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2927#      else
2928#        ifdef DL_NOW
2929#          define LT_DLLAZY_OR_NOW	DL_NOW
2930#        else
2931#          define LT_DLLAZY_OR_NOW	0
2932#        endif
2933#      endif
2934#    endif
2935#  endif
2936#endif
2937
2938/* When -fvisbility=hidden is used, assume the code has been annotated
2939   correspondingly for the symbols needed.  */
2940#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2941int fnord () __attribute__((visibility("default")));
2942#endif
2943
2944int fnord () { return 42; }
2945int main ()
2946{
2947  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2948  int status = $lt_dlunknown;
2949
2950  if (self)
2951    {
2952      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2953      else
2954        {
2955	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2956          else puts (dlerror ());
2957	}
2958      /* dlclose (self); */
2959    }
2960  else
2961    puts (dlerror ());
2962
2963  return status;
2964}]
2965_LT_EOF
2966  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2967    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2968    lt_status=$?
2969    case x$lt_status in
2970      x$lt_dlno_uscore) $1 ;;
2971      x$lt_dlneed_uscore) $2 ;;
2972      x$lt_dlunknown|x*) $3 ;;
2973    esac
2974  else :
2975    # compilation failed
2976    $3
2977  fi
2978fi
2979rm -fr conftest*
2980])# _LT_TRY_DLOPEN_SELF
2981
2982
2983# LT_SYS_DLOPEN_SELF
2984# ------------------
2985AC_DEFUN([LT_SYS_DLOPEN_SELF],
2986[m4_require([_LT_HEADER_DLFCN])dnl
2987if test "x$enable_dlopen" != xyes; then
2988  enable_dlopen=unknown
2989  enable_dlopen_self=unknown
2990  enable_dlopen_self_static=unknown
2991else
2992  lt_cv_dlopen=no
2993  lt_cv_dlopen_libs=
2994
2995  case $host_os in
2996  beos*)
2997    lt_cv_dlopen="load_add_on"
2998    lt_cv_dlopen_libs=
2999    lt_cv_dlopen_self=yes
3000    ;;
3001
3002  mingw* | pw32* | cegcc*)
3003    lt_cv_dlopen="LoadLibrary"
3004    lt_cv_dlopen_libs=
3005    ;;
3006
3007  cygwin*)
3008    lt_cv_dlopen="dlopen"
3009    lt_cv_dlopen_libs=
3010    ;;
3011
3012  darwin*)
3013  # if libdl is installed we need to link against it
3014    AC_CHECK_LIB([dl], [dlopen],
3015		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
3016    lt_cv_dlopen="dyld"
3017    lt_cv_dlopen_libs=
3018    lt_cv_dlopen_self=yes
3019    ])
3020    ;;
3021
3022  *)
3023    AC_CHECK_FUNC([shl_load],
3024	  [lt_cv_dlopen="shl_load"],
3025      [AC_CHECK_LIB([dld], [shl_load],
3026	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
3027	[AC_CHECK_FUNC([dlopen],
3028	      [lt_cv_dlopen="dlopen"],
3029	  [AC_CHECK_LIB([dl], [dlopen],
3030		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
3031	    [AC_CHECK_LIB([svld], [dlopen],
3032		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
3033	      [AC_CHECK_LIB([dld], [dld_link],
3034		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
3035	      ])
3036	    ])
3037	  ])
3038	])
3039      ])
3040    ;;
3041  esac
3042
3043  if test "x$lt_cv_dlopen" != xno; then
3044    enable_dlopen=yes
3045  else
3046    enable_dlopen=no
3047  fi
3048
3049  case $lt_cv_dlopen in
3050  dlopen)
3051    save_CPPFLAGS="$CPPFLAGS"
3052    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
3053
3054    save_LDFLAGS="$LDFLAGS"
3055    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
3056
3057    save_LIBS="$LIBS"
3058    LIBS="$lt_cv_dlopen_libs $LIBS"
3059
3060    AC_CACHE_CHECK([whether a program can dlopen itself],
3061	  lt_cv_dlopen_self, [dnl
3062	  _LT_TRY_DLOPEN_SELF(
3063	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
3064	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
3065    ])
3066
3067    if test "x$lt_cv_dlopen_self" = xyes; then
3068      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
3069      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
3070	  lt_cv_dlopen_self_static, [dnl
3071	  _LT_TRY_DLOPEN_SELF(
3072	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
3073	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
3074      ])
3075    fi
3076
3077    CPPFLAGS="$save_CPPFLAGS"
3078    LDFLAGS="$save_LDFLAGS"
3079    LIBS="$save_LIBS"
3080    ;;
3081  esac
3082
3083  case $lt_cv_dlopen_self in
3084  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
3085  *) enable_dlopen_self=unknown ;;
3086  esac
3087
3088  case $lt_cv_dlopen_self_static in
3089  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
3090  *) enable_dlopen_self_static=unknown ;;
3091  esac
3092fi
3093_LT_DECL([dlopen_support], [enable_dlopen], [0],
3094	 [Whether dlopen is supported])
3095_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
3096	 [Whether dlopen of programs is supported])
3097_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
3098	 [Whether dlopen of statically linked programs is supported])
3099])# LT_SYS_DLOPEN_SELF
3100
3101# Old name:
3102AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
3103dnl aclocal-1.4 backwards compatibility:
3104dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
3105
3106
3107# _LT_COMPILER_C_O([TAGNAME])
3108# ---------------------------
3109# Check to see if options -c and -o are simultaneously supported by compiler.
3110# This macro does not hard code the compiler like AC_PROG_CC_C_O.
3111m4_defun([_LT_COMPILER_C_O],
3112[m4_require([_LT_DECL_SED])dnl
3113m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3114m4_require([_LT_TAG_COMPILER])dnl
3115AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3116  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3117  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3118   $RM -r conftest 2>/dev/null
3119   mkdir conftest
3120   cd conftest
3121   mkdir out
3122   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3123
3124   lt_compiler_flag="-o out/conftest2.$ac_objext"
3125   # Insert the option either (1) after the last *FLAGS variable, or
3126   # (2) before a word containing "conftest.", or (3) at the end.
3127   # Note that $ac_compile itself does not contain backslashes and begins
3128   # with a dollar sign (not a hyphen), so the echo should work correctly.
3129   lt_compile=`echo "$ac_compile" | $SED \
3130   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3131   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3132   -e 's:$: $lt_compiler_flag:'`
3133   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3134   (eval "$lt_compile" 2>out/conftest.err)
3135   ac_status=$?
3136   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3137   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3138   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3139   then
3140     # The compiler can only warn and ignore the option if not recognized
3141     # So say no if there are warnings
3142     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3143     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3144     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3145       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3146     fi
3147   fi
3148   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3149   $RM conftest*
3150   # SGI C++ compiler will create directory out/ii_files/ for
3151   # template instantiation
3152   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3153   $RM out/* && rmdir out
3154   cd ..
3155   $RM -r conftest
3156   $RM conftest*
3157])
3158_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3159	[Does compiler simultaneously support -c and -o options?])
3160])# _LT_COMPILER_C_O
3161
3162
3163# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3164# ----------------------------------
3165# Check to see if we can do hard links to lock some files if needed
3166m4_defun([_LT_COMPILER_FILE_LOCKS],
3167[m4_require([_LT_ENABLE_LOCK])dnl
3168m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3169_LT_COMPILER_C_O([$1])
3170
3171hard_links="nottested"
3172if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3173  # do not overwrite the value of need_locks provided by the user
3174  AC_MSG_CHECKING([if we can lock with hard links])
3175  hard_links=yes
3176  $RM conftest*
3177  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3178  touch conftest.a
3179  ln conftest.a conftest.b 2>&5 || hard_links=no
3180  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3181  AC_MSG_RESULT([$hard_links])
3182  if test "$hard_links" = no; then
3183    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3184    need_locks=warn
3185  fi
3186else
3187  need_locks=no
3188fi
3189_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3190])# _LT_COMPILER_FILE_LOCKS
3191
3192
3193# _LT_CHECK_OBJDIR
3194# ----------------
3195m4_defun([_LT_CHECK_OBJDIR],
3196[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3197[rm -f .libs 2>/dev/null
3198mkdir .libs 2>/dev/null
3199if test -d .libs; then
3200  lt_cv_objdir=.libs
3201else
3202  # MS-DOS does not allow filenames that begin with a dot.
3203  lt_cv_objdir=_libs
3204fi
3205rmdir .libs 2>/dev/null])
3206objdir=$lt_cv_objdir
3207_LT_DECL([], [objdir], [0],
3208         [The name of the directory that contains temporary libtool files])dnl
3209m4_pattern_allow([LT_OBJDIR])dnl
3210AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3211  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3212])# _LT_CHECK_OBJDIR
3213
3214
3215# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3216# --------------------------------------
3217# Check hardcoding attributes.
3218m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3219[AC_MSG_CHECKING([how to hardcode library paths into programs])
3220_LT_TAGVAR(hardcode_action, $1)=
3221if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3222   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3223   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3224
3225  # We can hardcode non-existent directories.
3226  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3227     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3228     # have to relink, otherwise we might link with an installed library
3229     # when we should be linking with a yet-to-be-installed one
3230     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3231     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3232    # Linking always hardcodes the temporary library directory.
3233    _LT_TAGVAR(hardcode_action, $1)=relink
3234  else
3235    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3236    _LT_TAGVAR(hardcode_action, $1)=immediate
3237  fi
3238else
3239  # We cannot hardcode anything, or else we can only hardcode existing
3240  # directories.
3241  _LT_TAGVAR(hardcode_action, $1)=unsupported
3242fi
3243AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3244
3245if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3246   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3247  # Fast installation is not supported
3248  enable_fast_install=no
3249elif test "$shlibpath_overrides_runpath" = yes ||
3250     test "$enable_shared" = no; then
3251  # Fast installation is not necessary
3252  enable_fast_install=needless
3253fi
3254_LT_TAGDECL([], [hardcode_action], [0],
3255    [How to hardcode a shared library path into an executable])
3256])# _LT_LINKER_HARDCODE_LIBPATH
3257
3258
3259# _LT_CMD_STRIPLIB
3260# ----------------
3261m4_defun([_LT_CMD_STRIPLIB],
3262[m4_require([_LT_DECL_EGREP])
3263striplib=
3264old_striplib=
3265AC_MSG_CHECKING([whether stripping libraries is possible])
3266if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3267  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3268  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3269  AC_MSG_RESULT([yes])
3270else
3271# FIXME - insert some real tests, host_os isn't really good enough
3272  case $host_os in
3273  darwin*)
3274    if test -n "$STRIP" ; then
3275      striplib="$STRIP -x"
3276      old_striplib="$STRIP -S"
3277      AC_MSG_RESULT([yes])
3278    else
3279      AC_MSG_RESULT([no])
3280    fi
3281    ;;
3282  *)
3283    AC_MSG_RESULT([no])
3284    ;;
3285  esac
3286fi
3287_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3288_LT_DECL([], [striplib], [1])
3289])# _LT_CMD_STRIPLIB
3290
3291
3292# _LT_SYS_DYNAMIC_LINKER([TAG])
3293# -----------------------------
3294# PORTME Fill in your ld.so characteristics
3295m4_defun([_LT_SYS_DYNAMIC_LINKER],
3296[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3297m4_require([_LT_DECL_EGREP])dnl
3298m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3299m4_require([_LT_DECL_OBJDUMP])dnl
3300m4_require([_LT_DECL_SED])dnl
3301m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3302AC_MSG_CHECKING([dynamic linker characteristics])
3303m4_if([$1],
3304	[], [
3305if test "$GCC" = yes; then
3306  case $host_os in
3307    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3308    *) lt_awk_arg="/^libraries:/" ;;
3309  esac
3310  case $host_os in
3311    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3312    *) lt_sed_strip_eq="s,=/,/,g" ;;
3313  esac
3314  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3315  case $lt_search_path_spec in
3316  *\;*)
3317    # if the path contains ";" then we assume it to be the separator
3318    # otherwise default to the standard path separator (i.e. ":") - it is
3319    # assumed that no part of a normal pathname contains ";" but that should
3320    # okay in the real world where ";" in dirpaths is itself problematic.
3321    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3322    ;;
3323  *)
3324    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3325    ;;
3326  esac
3327  # Ok, now we have the path, separated by spaces, we can step through it
3328  # and add multilib dir if necessary.
3329  lt_tmp_lt_search_path_spec=
3330  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3331  for lt_sys_path in $lt_search_path_spec; do
3332    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3333      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3334    else
3335      test -d "$lt_sys_path" && \
3336	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3337    fi
3338  done
3339  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3340BEGIN {RS=" "; FS="/|\n";} {
3341  lt_foo="";
3342  lt_count=0;
3343  for (lt_i = NF; lt_i > 0; lt_i--) {
3344    if ($lt_i != "" && $lt_i != ".") {
3345      if ($lt_i == "..") {
3346        lt_count++;
3347      } else {
3348        if (lt_count == 0) {
3349          lt_foo="/" $lt_i lt_foo;
3350        } else {
3351          lt_count--;
3352        }
3353      }
3354    }
3355  }
3356  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3357  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3358}'`
3359  # AWK program above erroneously prepends '/' to C:/dos/paths
3360  # for these hosts.
3361  case $host_os in
3362    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3363      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3364  esac
3365  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3366else
3367  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3368fi])
3369library_names_spec=
3370libname_spec='lib$name'
3371soname_spec=
3372shrext_cmds=".so"
3373postinstall_cmds=
3374postuninstall_cmds=
3375finish_cmds=
3376finish_eval=
3377shlibpath_var=
3378shlibpath_overrides_runpath=unknown
3379version_type=none
3380dynamic_linker="$host_os ld.so"
3381sys_lib_dlsearch_path_spec="/lib /usr/lib"
3382need_lib_prefix=unknown
3383hardcode_into_libs=no
3384
3385# when you set need_version to no, make sure it does not cause -set_version
3386# flags to be left without arguments
3387need_version=unknown
3388
3389case $host_os in
3390aix3*)
3391  version_type=linux # correct to gnu/linux during the next big refactor
3392  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3393  shlibpath_var=LIBPATH
3394
3395  # AIX 3 has no versioning support, so we append a major version to the name.
3396  soname_spec='${libname}${release}${shared_ext}$major'
3397  ;;
3398
3399aix[[4-9]]*)
3400  version_type=linux # correct to gnu/linux during the next big refactor
3401  need_lib_prefix=no
3402  need_version=no
3403  hardcode_into_libs=yes
3404  if test "$host_cpu" = ia64; then
3405    # AIX 5 supports IA64
3406    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3407    shlibpath_var=LD_LIBRARY_PATH
3408  else
3409    # With GCC up to 2.95.x, collect2 would create an import file
3410    # for dependence libraries.  The import file would start with
3411    # the line `#! .'.  This would cause the generated library to
3412    # depend on `.', always an invalid library.  This was fixed in
3413    # development snapshots of GCC prior to 3.0.
3414    case $host_os in
3415      aix4 | aix4.[[01]] | aix4.[[01]].*)
3416      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3417	   echo ' yes '
3418	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3419	:
3420      else
3421	can_build_shared=no
3422      fi
3423      ;;
3424    esac
3425    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3426    # soname into executable. Probably we can add versioning support to
3427    # collect2, so additional links can be useful in future.
3428    if test "$aix_use_runtimelinking" = yes; then
3429      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3430      # instead of lib<name>.a to let people know that these are not
3431      # typical AIX shared libraries.
3432      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3433    else
3434      # We preserve .a as extension for shared libraries through AIX4.2
3435      # and later when we are not doing run time linking.
3436      library_names_spec='${libname}${release}.a $libname.a'
3437      soname_spec='${libname}${release}${shared_ext}$major'
3438    fi
3439    shlibpath_var=LIBPATH
3440  fi
3441  ;;
3442
3443amigaos*)
3444  case $host_cpu in
3445  powerpc)
3446    # Since July 2007 AmigaOS4 officially supports .so libraries.
3447    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3448    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3449    ;;
3450  m68k)
3451    library_names_spec='$libname.ixlibrary $libname.a'
3452    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3453    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'
3454    ;;
3455  esac
3456  ;;
3457
3458beos*)
3459  library_names_spec='${libname}${shared_ext}'
3460  dynamic_linker="$host_os ld.so"
3461  shlibpath_var=LIBRARY_PATH
3462  ;;
3463
3464bsdi[[45]]*)
3465  version_type=linux # correct to gnu/linux during the next big refactor
3466  need_version=no
3467  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3468  soname_spec='${libname}${release}${shared_ext}$major'
3469  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3470  shlibpath_var=LD_LIBRARY_PATH
3471  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3472  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3473  # the default ld.so.conf also contains /usr/contrib/lib and
3474  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3475  # libtool to hard-code these into programs
3476  ;;
3477
3478cygwin* | mingw* | pw32* | cegcc*)
3479  version_type=windows
3480  shrext_cmds=".dll"
3481  need_version=no
3482  need_lib_prefix=no
3483
3484  case $GCC,$cc_basename in
3485  yes,*)
3486    # gcc
3487    library_names_spec='$libname.dll.a'
3488    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3489    postinstall_cmds='base_file=`basename \${file}`~
3490      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3491      dldir=$destdir/`dirname \$dlpath`~
3492      test -d \$dldir || mkdir -p \$dldir~
3493      $install_prog $dir/$dlname \$dldir/$dlname~
3494      chmod a+x \$dldir/$dlname~
3495      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3496        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3497      fi'
3498    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3499      dlpath=$dir/\$dldll~
3500       $RM \$dlpath'
3501    shlibpath_overrides_runpath=yes
3502
3503    case $host_os in
3504    cygwin*)
3505      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3506      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3507m4_if([$1], [],[
3508      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3509      ;;
3510    mingw* | cegcc*)
3511      # MinGW DLLs use traditional 'lib' prefix
3512      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3513      ;;
3514    pw32*)
3515      # pw32 DLLs use 'pw' prefix rather than 'lib'
3516      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3517      ;;
3518    esac
3519    dynamic_linker='Win32 ld.exe'
3520    ;;
3521
3522  *,cl*)
3523    # Native MSVC
3524    libname_spec='$name'
3525    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3526    library_names_spec='${libname}.dll.lib'
3527
3528    case $build_os in
3529    mingw*)
3530      sys_lib_search_path_spec=
3531      lt_save_ifs=$IFS
3532      IFS=';'
3533      for lt_path in $LIB
3534      do
3535        IFS=$lt_save_ifs
3536        # Let DOS variable expansion print the short 8.3 style file name.
3537        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3538        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3539      done
3540      IFS=$lt_save_ifs
3541      # Convert to MSYS style.
3542      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3543      ;;
3544    cygwin*)
3545      # Convert to unix form, then to dos form, then back to unix form
3546      # but this time dos style (no spaces!) so that the unix form looks
3547      # like /cygdrive/c/PROGRA~1:/cygdr...
3548      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3549      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3550      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3551      ;;
3552    *)
3553      sys_lib_search_path_spec="$LIB"
3554      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3555        # It is most probably a Windows format PATH.
3556        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3557      else
3558        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3559      fi
3560      # FIXME: find the short name or the path components, as spaces are
3561      # common. (e.g. "Program Files" -> "PROGRA~1")
3562      ;;
3563    esac
3564
3565    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3566    postinstall_cmds='base_file=`basename \${file}`~
3567      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3568      dldir=$destdir/`dirname \$dlpath`~
3569      test -d \$dldir || mkdir -p \$dldir~
3570      $install_prog $dir/$dlname \$dldir/$dlname'
3571    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3572      dlpath=$dir/\$dldll~
3573       $RM \$dlpath'
3574    shlibpath_overrides_runpath=yes
3575    dynamic_linker='Win32 link.exe'
3576    ;;
3577
3578  *)
3579    # Assume MSVC wrapper
3580    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3581    dynamic_linker='Win32 ld.exe'
3582    ;;
3583  esac
3584  # FIXME: first we should search . and the directory the executable is in
3585  shlibpath_var=PATH
3586  ;;
3587
3588darwin* | rhapsody*)
3589  dynamic_linker="$host_os dyld"
3590  version_type=darwin
3591  need_lib_prefix=no
3592  need_version=no
3593  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3594  soname_spec='${libname}${release}${major}$shared_ext'
3595  shlibpath_overrides_runpath=yes
3596  shlibpath_var=DYLD_LIBRARY_PATH
3597  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3598m4_if([$1], [],[
3599  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3600  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3601  ;;
3602
3603dgux*)
3604  version_type=linux # correct to gnu/linux during the next big refactor
3605  need_lib_prefix=no
3606  need_version=no
3607  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3608  soname_spec='${libname}${release}${shared_ext}$major'
3609  shlibpath_var=LD_LIBRARY_PATH
3610  ;;
3611
3612freebsd* | dragonfly*)
3613  # DragonFly does not have aout.  When/if they implement a new
3614  # versioning mechanism, adjust this.
3615  if test -x /usr/bin/objformat; then
3616    objformat=`/usr/bin/objformat`
3617  else
3618    case $host_os in
3619    freebsd[[23]].*) objformat=aout ;;
3620    *) objformat=elf ;;
3621    esac
3622  fi
3623  version_type=freebsd-$objformat
3624  case $version_type in
3625    freebsd-elf*)
3626      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3627      need_version=no
3628      need_lib_prefix=no
3629      ;;
3630    freebsd-*)
3631      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3632      need_version=yes
3633      ;;
3634  esac
3635  shlibpath_var=LD_LIBRARY_PATH
3636  case $host_os in
3637  freebsd2.*)
3638    shlibpath_overrides_runpath=yes
3639    ;;
3640  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3641    shlibpath_overrides_runpath=yes
3642    hardcode_into_libs=yes
3643    ;;
3644  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3645  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3646    shlibpath_overrides_runpath=no
3647    hardcode_into_libs=yes
3648    ;;
3649  *) # from 4.6 on, and DragonFly
3650    shlibpath_overrides_runpath=yes
3651    hardcode_into_libs=yes
3652    ;;
3653  esac
3654  ;;
3655
3656gnu*)
3657  version_type=linux # correct to gnu/linux during the next big refactor
3658  need_lib_prefix=no
3659  need_version=no
3660  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3661  soname_spec='${libname}${release}${shared_ext}$major'
3662  shlibpath_var=LD_LIBRARY_PATH
3663  shlibpath_overrides_runpath=no
3664  hardcode_into_libs=yes
3665  ;;
3666
3667haiku*)
3668  version_type=linux # correct to gnu/linux during the next big refactor
3669  need_lib_prefix=no
3670  need_version=no
3671  dynamic_linker="$host_os runtime_loader"
3672  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3673  soname_spec='${libname}${release}${shared_ext}$major'
3674  shlibpath_var=LIBRARY_PATH
3675  shlibpath_overrides_runpath=yes
3676  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3677  hardcode_into_libs=yes
3678  ;;
3679
3680hpux9* | hpux10* | hpux11*)
3681  # Give a soname corresponding to the major version so that dld.sl refuses to
3682  # link against other versions.
3683  version_type=sunos
3684  need_lib_prefix=no
3685  need_version=no
3686  case $host_cpu in
3687  ia64*)
3688    shrext_cmds='.so'
3689    hardcode_into_libs=yes
3690    dynamic_linker="$host_os dld.so"
3691    shlibpath_var=LD_LIBRARY_PATH
3692    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3693    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3694    soname_spec='${libname}${release}${shared_ext}$major'
3695    if test "X$HPUX_IA64_MODE" = X32; then
3696      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3697    else
3698      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3699    fi
3700    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3701    ;;
3702  hppa*64*)
3703    shrext_cmds='.sl'
3704    hardcode_into_libs=yes
3705    dynamic_linker="$host_os dld.sl"
3706    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3707    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3708    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3709    soname_spec='${libname}${release}${shared_ext}$major'
3710    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3711    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3712    ;;
3713  *)
3714    shrext_cmds='.sl'
3715    dynamic_linker="$host_os dld.sl"
3716    shlibpath_var=SHLIB_PATH
3717    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3718    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3719    soname_spec='${libname}${release}${shared_ext}$major'
3720    ;;
3721  esac
3722  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3723  postinstall_cmds='chmod 555 $lib'
3724  # or fails outright, so override atomically:
3725  install_override_mode=555
3726  ;;
3727
3728interix[[3-9]]*)
3729  version_type=linux # correct to gnu/linux during the next big refactor
3730  need_lib_prefix=no
3731  need_version=no
3732  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3733  soname_spec='${libname}${release}${shared_ext}$major'
3734  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3735  shlibpath_var=LD_LIBRARY_PATH
3736  shlibpath_overrides_runpath=no
3737  hardcode_into_libs=yes
3738  ;;
3739
3740irix5* | irix6* | nonstopux*)
3741  case $host_os in
3742    nonstopux*) version_type=nonstopux ;;
3743    *)
3744	if test "$lt_cv_prog_gnu_ld" = yes; then
3745		version_type=linux # correct to gnu/linux during the next big refactor
3746	else
3747		version_type=irix
3748	fi ;;
3749  esac
3750  need_lib_prefix=no
3751  need_version=no
3752  soname_spec='${libname}${release}${shared_ext}$major'
3753  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3754  case $host_os in
3755  irix5* | nonstopux*)
3756    libsuff= shlibsuff=
3757    ;;
3758  *)
3759    case $LD in # libtool.m4 will add one of these switches to LD
3760    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3761      libsuff= shlibsuff= libmagic=32-bit;;
3762    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3763      libsuff=32 shlibsuff=N32 libmagic=N32;;
3764    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3765      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3766    *) libsuff= shlibsuff= libmagic=never-match;;
3767    esac
3768    ;;
3769  esac
3770  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3771  shlibpath_overrides_runpath=no
3772  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3773  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3774  hardcode_into_libs=yes
3775  ;;
3776
3777# No shared lib support for Linux oldld, aout, or coff.
3778linux*oldld* | linux*aout* | linux*coff*)
3779  dynamic_linker=no
3780  ;;
3781
3782# This must be glibc/ELF.
3783linux* | k*bsd*-gnu | kopensolaris*-gnu)
3784  version_type=linux # correct to gnu/linux during the next big refactor
3785  need_lib_prefix=no
3786  need_version=no
3787  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3788  soname_spec='${libname}${release}${shared_ext}$major'
3789  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3790  shlibpath_var=LD_LIBRARY_PATH
3791  shlibpath_overrides_runpath=no
3792
3793  # Some binutils ld are patched to set DT_RUNPATH
3794  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3795    [lt_cv_shlibpath_overrides_runpath=no
3796    save_LDFLAGS=$LDFLAGS
3797    save_libdir=$libdir
3798    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3799	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3800    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3801      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3802	 [lt_cv_shlibpath_overrides_runpath=yes])])
3803    LDFLAGS=$save_LDFLAGS
3804    libdir=$save_libdir
3805    ])
3806  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3807
3808  # This implies no fast_install, which is unacceptable.
3809  # Some rework will be needed to allow for fast_install
3810  # before this can be enabled.
3811  hardcode_into_libs=yes
3812
3813  # Append ld.so.conf contents to the search path
3814  if test -f /etc/ld.so.conf; then
3815    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' ' '`
3816    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3817  fi
3818
3819  # We used to test for /lib/ld.so.1 and disable shared libraries on
3820  # powerpc, because MkLinux only supported shared libraries with the
3821  # GNU dynamic linker.  Since this was broken with cross compilers,
3822  # most powerpc-linux boxes support dynamic linking these days and
3823  # people can always --disable-shared, the test was removed, and we
3824  # assume the GNU/Linux dynamic linker is in use.
3825  dynamic_linker='GNU/Linux ld.so'
3826  ;;
3827
3828netbsd*)
3829  version_type=sunos
3830  need_lib_prefix=no
3831  need_version=no
3832  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3833    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3834    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3835    dynamic_linker='NetBSD (a.out) ld.so'
3836  else
3837    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3838    soname_spec='${libname}${release}${shared_ext}$major'
3839    dynamic_linker='NetBSD ld.elf_so'
3840  fi
3841  shlibpath_var=LD_LIBRARY_PATH
3842  shlibpath_overrides_runpath=yes
3843  hardcode_into_libs=yes
3844  ;;
3845
3846newsos6)
3847  version_type=linux # correct to gnu/linux during the next big refactor
3848  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3849  shlibpath_var=LD_LIBRARY_PATH
3850  shlibpath_overrides_runpath=yes
3851  ;;
3852
3853*nto* | *qnx*)
3854  version_type=qnx
3855  need_lib_prefix=no
3856  need_version=no
3857  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3858  soname_spec='${libname}${release}${shared_ext}$major'
3859  shlibpath_var=LD_LIBRARY_PATH
3860  shlibpath_overrides_runpath=no
3861  hardcode_into_libs=yes
3862  dynamic_linker='ldqnx.so'
3863  ;;
3864
3865openbsd*)
3866  version_type=sunos
3867  sys_lib_dlsearch_path_spec="/usr/lib"
3868  need_lib_prefix=no
3869  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3870  case $host_os in
3871    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3872    *)				need_version=no  ;;
3873  esac
3874  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3875  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3876  shlibpath_var=LD_LIBRARY_PATH
3877  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3878    case $host_os in
3879      openbsd2.[[89]] | openbsd2.[[89]].*)
3880	shlibpath_overrides_runpath=no
3881	;;
3882      *)
3883	shlibpath_overrides_runpath=yes
3884	;;
3885      esac
3886  else
3887    shlibpath_overrides_runpath=yes
3888  fi
3889  ;;
3890
3891os2*)
3892  libname_spec='$name'
3893  shrext_cmds=".dll"
3894  need_lib_prefix=no
3895  library_names_spec='$libname${shared_ext} $libname.a'
3896  dynamic_linker='OS/2 ld.exe'
3897  shlibpath_var=LIBPATH
3898  ;;
3899
3900osf3* | osf4* | osf5*)
3901  version_type=osf
3902  need_lib_prefix=no
3903  need_version=no
3904  soname_spec='${libname}${release}${shared_ext}$major'
3905  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3906  shlibpath_var=LD_LIBRARY_PATH
3907  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3908  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3909  ;;
3910
3911rdos*)
3912  dynamic_linker=no
3913  ;;
3914
3915solaris*)
3916  version_type=linux # correct to gnu/linux during the next big refactor
3917  need_lib_prefix=no
3918  need_version=no
3919  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3920  soname_spec='${libname}${release}${shared_ext}$major'
3921  shlibpath_var=LD_LIBRARY_PATH
3922  shlibpath_overrides_runpath=yes
3923  hardcode_into_libs=yes
3924  # ldd complains unless libraries are executable
3925  postinstall_cmds='chmod +x $lib'
3926  ;;
3927
3928sunos4*)
3929  version_type=sunos
3930  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3931  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3932  shlibpath_var=LD_LIBRARY_PATH
3933  shlibpath_overrides_runpath=yes
3934  if test "$with_gnu_ld" = yes; then
3935    need_lib_prefix=no
3936  fi
3937  need_version=yes
3938  ;;
3939
3940sysv4 | sysv4.3*)
3941  version_type=linux # correct to gnu/linux during the next big refactor
3942  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3943  soname_spec='${libname}${release}${shared_ext}$major'
3944  shlibpath_var=LD_LIBRARY_PATH
3945  case $host_vendor in
3946    sni)
3947      shlibpath_overrides_runpath=no
3948      need_lib_prefix=no
3949      runpath_var=LD_RUN_PATH
3950      ;;
3951    siemens)
3952      need_lib_prefix=no
3953      ;;
3954    motorola)
3955      need_lib_prefix=no
3956      need_version=no
3957      shlibpath_overrides_runpath=no
3958      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3959      ;;
3960  esac
3961  ;;
3962
3963sysv4*MP*)
3964  if test -d /usr/nec ;then
3965    version_type=linux # correct to gnu/linux during the next big refactor
3966    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3967    soname_spec='$libname${shared_ext}.$major'
3968    shlibpath_var=LD_LIBRARY_PATH
3969  fi
3970  ;;
3971
3972sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3973  version_type=freebsd-elf
3974  need_lib_prefix=no
3975  need_version=no
3976  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3977  soname_spec='${libname}${release}${shared_ext}$major'
3978  shlibpath_var=LD_LIBRARY_PATH
3979  shlibpath_overrides_runpath=yes
3980  hardcode_into_libs=yes
3981  if test "$with_gnu_ld" = yes; then
3982    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3983  else
3984    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3985    case $host_os in
3986      sco3.2v5*)
3987        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3988	;;
3989    esac
3990  fi
3991  sys_lib_dlsearch_path_spec='/usr/lib'
3992  ;;
3993
3994tpf*)
3995  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3996  version_type=linux # correct to gnu/linux during the next big refactor
3997  need_lib_prefix=no
3998  need_version=no
3999  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4000  shlibpath_var=LD_LIBRARY_PATH
4001  shlibpath_overrides_runpath=no
4002  hardcode_into_libs=yes
4003  ;;
4004
4005uts4*)
4006  version_type=linux # correct to gnu/linux during the next big refactor
4007  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4008  soname_spec='${libname}${release}${shared_ext}$major'
4009  shlibpath_var=LD_LIBRARY_PATH
4010  ;;
4011
4012*)
4013  dynamic_linker=no
4014  ;;
4015esac
4016AC_MSG_RESULT([$dynamic_linker])
4017test "$dynamic_linker" = no && can_build_shared=no
4018
4019variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
4020if test "$GCC" = yes; then
4021  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
4022fi
4023
4024if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
4025  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
4026fi
4027if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
4028  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
4029fi
4030
4031_LT_DECL([], [variables_saved_for_relink], [1],
4032    [Variables whose values should be saved in libtool wrapper scripts and
4033    restored at link time])
4034_LT_DECL([], [need_lib_prefix], [0],
4035    [Do we need the "lib" prefix for modules?])
4036_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
4037_LT_DECL([], [version_type], [0], [Library versioning type])
4038_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
4039_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
4040_LT_DECL([], [shlibpath_overrides_runpath], [0],
4041    [Is shlibpath searched before the hard-coded library search path?])
4042_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
4043_LT_DECL([], [library_names_spec], [1],
4044    [[List of archive names.  First name is the real one, the rest are links.
4045    The last name is the one that the linker finds with -lNAME]])
4046_LT_DECL([], [soname_spec], [1],
4047    [[The coded name of the library, if different from the real name]])
4048_LT_DECL([], [install_override_mode], [1],
4049    [Permission mode override for installation of shared libraries])
4050_LT_DECL([], [postinstall_cmds], [2],
4051    [Command to use after installation of a shared archive])
4052_LT_DECL([], [postuninstall_cmds], [2],
4053    [Command to use after uninstallation of a shared archive])
4054_LT_DECL([], [finish_cmds], [2],
4055    [Commands used to finish a libtool library installation in a directory])
4056_LT_DECL([], [finish_eval], [1],
4057    [[As "finish_cmds", except a single script fragment to be evaled but
4058    not shown]])
4059_LT_DECL([], [hardcode_into_libs], [0],
4060    [Whether we should hardcode library paths into libraries])
4061_LT_DECL([], [sys_lib_search_path_spec], [2],
4062    [Compile-time system search path for libraries])
4063_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
4064    [Run-time system search path for libraries])
4065])# _LT_SYS_DYNAMIC_LINKER
4066
4067
4068# _LT_PATH_TOOL_PREFIX(TOOL)
4069# --------------------------
4070# find a file program which can recognize shared library
4071AC_DEFUN([_LT_PATH_TOOL_PREFIX],
4072[m4_require([_LT_DECL_EGREP])dnl
4073AC_MSG_CHECKING([for $1])
4074AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4075[case $MAGIC_CMD in
4076[[\\/*] |  ?:[\\/]*])
4077  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4078  ;;
4079*)
4080  lt_save_MAGIC_CMD="$MAGIC_CMD"
4081  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4082dnl $ac_dummy forces splitting on constant user-supplied paths.
4083dnl POSIX.2 word splitting is done only on the output of word expansions,
4084dnl not every word.  This closes a longstanding sh security hole.
4085  ac_dummy="m4_if([$2], , $PATH, [$2])"
4086  for ac_dir in $ac_dummy; do
4087    IFS="$lt_save_ifs"
4088    test -z "$ac_dir" && ac_dir=.
4089    if test -f $ac_dir/$1; then
4090      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4091      if test -n "$file_magic_test_file"; then
4092	case $deplibs_check_method in
4093	"file_magic "*)
4094	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
4095	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4096	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4097	    $EGREP "$file_magic_regex" > /dev/null; then
4098	    :
4099	  else
4100	    cat <<_LT_EOF 1>&2
4101
4102*** Warning: the command libtool uses to detect shared libraries,
4103*** $file_magic_cmd, produces output that libtool cannot recognize.
4104*** The result is that libtool may fail to recognize shared libraries
4105*** as such.  This will affect the creation of libtool libraries that
4106*** depend on shared libraries, but programs linked with such libtool
4107*** libraries will work regardless of this problem.  Nevertheless, you
4108*** may want to report the problem to your system manager and/or to
4109*** bug-libtool@gnu.org
4110
4111_LT_EOF
4112	  fi ;;
4113	esac
4114      fi
4115      break
4116    fi
4117  done
4118  IFS="$lt_save_ifs"
4119  MAGIC_CMD="$lt_save_MAGIC_CMD"
4120  ;;
4121esac])
4122MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4123if test -n "$MAGIC_CMD"; then
4124  AC_MSG_RESULT($MAGIC_CMD)
4125else
4126  AC_MSG_RESULT(no)
4127fi
4128_LT_DECL([], [MAGIC_CMD], [0],
4129	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4130])# _LT_PATH_TOOL_PREFIX
4131
4132# Old name:
4133AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4134dnl aclocal-1.4 backwards compatibility:
4135dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4136
4137
4138# _LT_PATH_MAGIC
4139# --------------
4140# find a file program which can recognize a shared library
4141m4_defun([_LT_PATH_MAGIC],
4142[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4143if test -z "$lt_cv_path_MAGIC_CMD"; then
4144  if test -n "$ac_tool_prefix"; then
4145    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4146  else
4147    MAGIC_CMD=:
4148  fi
4149fi
4150])# _LT_PATH_MAGIC
4151
4152
4153# LT_PATH_LD
4154# ----------
4155# find the pathname to the GNU or non-GNU linker
4156AC_DEFUN([LT_PATH_LD],
4157[AC_REQUIRE([AC_PROG_CC])dnl
4158AC_REQUIRE([AC_CANONICAL_HOST])dnl
4159AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4160m4_require([_LT_DECL_SED])dnl
4161m4_require([_LT_DECL_EGREP])dnl
4162m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4163
4164AC_ARG_WITH([gnu-ld],
4165    [AS_HELP_STRING([--with-gnu-ld],
4166	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4167    [test "$withval" = no || with_gnu_ld=yes],
4168    [with_gnu_ld=no])dnl
4169
4170ac_prog=ld
4171if test "$GCC" = yes; then
4172  # Check if gcc -print-prog-name=ld gives a path.
4173  AC_MSG_CHECKING([for ld used by $CC])
4174  case $host in
4175  *-*-mingw*)
4176    # gcc leaves a trailing carriage return which upsets mingw
4177    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4178  *)
4179    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4180  esac
4181  case $ac_prog in
4182    # Accept absolute paths.
4183    [[\\/]]* | ?:[[\\/]]*)
4184      re_direlt='/[[^/]][[^/]]*/\.\./'
4185      # Canonicalize the pathname of ld
4186      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4187      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4188	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4189      done
4190      test -z "$LD" && LD="$ac_prog"
4191      ;;
4192  "")
4193    # If it fails, then pretend we aren't using GCC.
4194    ac_prog=ld
4195    ;;
4196  *)
4197    # If it is relative, then search for the first ld in PATH.
4198    with_gnu_ld=unknown
4199    ;;
4200  esac
4201elif test "$with_gnu_ld" = yes; then
4202  AC_MSG_CHECKING([for GNU ld])
4203else
4204  AC_MSG_CHECKING([for non-GNU ld])
4205fi
4206AC_CACHE_VAL(lt_cv_path_LD,
4207[if test -z "$LD"; then
4208  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4209  for ac_dir in $PATH; do
4210    IFS="$lt_save_ifs"
4211    test -z "$ac_dir" && ac_dir=.
4212    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4213      lt_cv_path_LD="$ac_dir/$ac_prog"
4214      # Check to see if the program is GNU ld.  I'd rather use --version,
4215      # but apparently some variants of GNU ld only accept -v.
4216      # Break only if it was the GNU/non-GNU ld that we prefer.
4217      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4218      *GNU* | *'with BFD'*)
4219	test "$with_gnu_ld" != no && break
4220	;;
4221      *)
4222	test "$with_gnu_ld" != yes && break
4223	;;
4224      esac
4225    fi
4226  done
4227  IFS="$lt_save_ifs"
4228else
4229  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4230fi])
4231LD="$lt_cv_path_LD"
4232if test -n "$LD"; then
4233  AC_MSG_RESULT($LD)
4234else
4235  AC_MSG_RESULT(no)
4236fi
4237test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4238_LT_PATH_LD_GNU
4239AC_SUBST([LD])
4240
4241_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4242])# LT_PATH_LD
4243
4244# Old names:
4245AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4246AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4247dnl aclocal-1.4 backwards compatibility:
4248dnl AC_DEFUN([AM_PROG_LD], [])
4249dnl AC_DEFUN([AC_PROG_LD], [])
4250
4251
4252# _LT_PATH_LD_GNU
4253#- --------------
4254m4_defun([_LT_PATH_LD_GNU],
4255[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4256[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4257case `$LD -v 2>&1 </dev/null` in
4258*GNU* | *'with BFD'*)
4259  lt_cv_prog_gnu_ld=yes
4260  ;;
4261*)
4262  lt_cv_prog_gnu_ld=no
4263  ;;
4264esac])
4265with_gnu_ld=$lt_cv_prog_gnu_ld
4266])# _LT_PATH_LD_GNU
4267
4268
4269# _LT_CMD_RELOAD
4270# --------------
4271# find reload flag for linker
4272#   -- PORTME Some linkers may need a different reload flag.
4273m4_defun([_LT_CMD_RELOAD],
4274[AC_CACHE_CHECK([for $LD option to reload object files],
4275  lt_cv_ld_reload_flag,
4276  [lt_cv_ld_reload_flag='-r'])
4277reload_flag=$lt_cv_ld_reload_flag
4278case $reload_flag in
4279"" | " "*) ;;
4280*) reload_flag=" $reload_flag" ;;
4281esac
4282reload_cmds='$LD$reload_flag -o $output$reload_objs'
4283case $host_os in
4284  cygwin* | mingw* | pw32* | cegcc*)
4285    if test "$GCC" != yes; then
4286      reload_cmds=false
4287    fi
4288    ;;
4289  darwin*)
4290    if test "$GCC" = yes; then
4291      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4292    else
4293      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4294    fi
4295    ;;
4296esac
4297_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4298_LT_TAGDECL([], [reload_cmds], [2])dnl
4299])# _LT_CMD_RELOAD
4300
4301
4302# _LT_CHECK_MAGIC_METHOD
4303# ----------------------
4304# how to check for library dependencies
4305#  -- PORTME fill in with the dynamic library characteristics
4306m4_defun([_LT_CHECK_MAGIC_METHOD],
4307[m4_require([_LT_DECL_EGREP])
4308m4_require([_LT_DECL_OBJDUMP])
4309AC_CACHE_CHECK([how to recognize dependent libraries],
4310lt_cv_deplibs_check_method,
4311[lt_cv_file_magic_cmd='$MAGIC_CMD'
4312lt_cv_file_magic_test_file=
4313lt_cv_deplibs_check_method='unknown'
4314# Need to set the preceding variable on all platforms that support
4315# interlibrary dependencies.
4316# 'none' -- dependencies not supported.
4317# `unknown' -- same as none, but documents that we really don't know.
4318# 'pass_all' -- all dependencies passed with no checks.
4319# 'test_compile' -- check by making test program.
4320# 'file_magic [[regex]]' -- check by looking for files in library path
4321# which responds to the $file_magic_cmd with a given extended regex.
4322# If you have `file' or equivalent on your system and you're not sure
4323# whether `pass_all' will *always* work, you probably want this one.
4324
4325case $host_os in
4326aix[[4-9]]*)
4327  lt_cv_deplibs_check_method=pass_all
4328  ;;
4329
4330beos*)
4331  lt_cv_deplibs_check_method=pass_all
4332  ;;
4333
4334bsdi[[45]]*)
4335  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4336  lt_cv_file_magic_cmd='/usr/bin/file -L'
4337  lt_cv_file_magic_test_file=/shlib/libc.so
4338  ;;
4339
4340cygwin*)
4341  # func_win32_libid is a shell function defined in ltmain.sh
4342  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4343  lt_cv_file_magic_cmd='func_win32_libid'
4344  ;;
4345
4346mingw* | pw32*)
4347  # Base MSYS/MinGW do not provide the 'file' command needed by
4348  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4349  # unless we find 'file', for example because we are cross-compiling.
4350  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4351  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4352    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4353    lt_cv_file_magic_cmd='func_win32_libid'
4354  else
4355    # Keep this pattern in sync with the one in func_win32_libid.
4356    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4357    lt_cv_file_magic_cmd='$OBJDUMP -f'
4358  fi
4359  ;;
4360
4361cegcc*)
4362  # use the weaker test based on 'objdump'. See mingw*.
4363  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4364  lt_cv_file_magic_cmd='$OBJDUMP -f'
4365  ;;
4366
4367darwin* | rhapsody*)
4368  lt_cv_deplibs_check_method=pass_all
4369  ;;
4370
4371freebsd* | dragonfly*)
4372  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4373    case $host_cpu in
4374    i*86 )
4375      # Not sure whether the presence of OpenBSD here was a mistake.
4376      # Let's accept both of them until this is cleared up.
4377      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4378      lt_cv_file_magic_cmd=/usr/bin/file
4379      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4380      ;;
4381    esac
4382  else
4383    lt_cv_deplibs_check_method=pass_all
4384  fi
4385  ;;
4386
4387gnu*)
4388  lt_cv_deplibs_check_method=pass_all
4389  ;;
4390
4391haiku*)
4392  lt_cv_deplibs_check_method=pass_all
4393  ;;
4394
4395hpux10.20* | hpux11*)
4396  lt_cv_file_magic_cmd=/usr/bin/file
4397  case $host_cpu in
4398  ia64*)
4399    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4400    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4401    ;;
4402  hppa*64*)
4403    [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]']
4404    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4405    ;;
4406  *)
4407    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4408    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4409    ;;
4410  esac
4411  ;;
4412
4413interix[[3-9]]*)
4414  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4415  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4416  ;;
4417
4418irix5* | irix6* | nonstopux*)
4419  case $LD in
4420  *-32|*"-32 ") libmagic=32-bit;;
4421  *-n32|*"-n32 ") libmagic=N32;;
4422  *-64|*"-64 ") libmagic=64-bit;;
4423  *) libmagic=never-match;;
4424  esac
4425  lt_cv_deplibs_check_method=pass_all
4426  ;;
4427
4428# This must be glibc/ELF.
4429linux* | k*bsd*-gnu | kopensolaris*-gnu)
4430  lt_cv_deplibs_check_method=pass_all
4431  ;;
4432
4433netbsd*)
4434  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4435    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4436  else
4437    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4438  fi
4439  ;;
4440
4441newos6*)
4442  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4443  lt_cv_file_magic_cmd=/usr/bin/file
4444  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4445  ;;
4446
4447*nto* | *qnx*)
4448  lt_cv_deplibs_check_method=pass_all
4449  ;;
4450
4451openbsd*)
4452  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4453    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4454  else
4455    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4456  fi
4457  ;;
4458
4459osf3* | osf4* | osf5*)
4460  lt_cv_deplibs_check_method=pass_all
4461  ;;
4462
4463rdos*)
4464  lt_cv_deplibs_check_method=pass_all
4465  ;;
4466
4467solaris*)
4468  lt_cv_deplibs_check_method=pass_all
4469  ;;
4470
4471sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4472  lt_cv_deplibs_check_method=pass_all
4473  ;;
4474
4475sysv4 | sysv4.3*)
4476  case $host_vendor in
4477  motorola)
4478    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]]'
4479    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4480    ;;
4481  ncr)
4482    lt_cv_deplibs_check_method=pass_all
4483    ;;
4484  sequent)
4485    lt_cv_file_magic_cmd='/bin/file'
4486    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4487    ;;
4488  sni)
4489    lt_cv_file_magic_cmd='/bin/file'
4490    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4491    lt_cv_file_magic_test_file=/lib/libc.so
4492    ;;
4493  siemens)
4494    lt_cv_deplibs_check_method=pass_all
4495    ;;
4496  pc)
4497    lt_cv_deplibs_check_method=pass_all
4498    ;;
4499  esac
4500  ;;
4501
4502tpf*)
4503  lt_cv_deplibs_check_method=pass_all
4504  ;;
4505esac
4506])
4507
4508file_magic_glob=
4509want_nocaseglob=no
4510if test "$build" = "$host"; then
4511  case $host_os in
4512  mingw* | pw32*)
4513    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4514      want_nocaseglob=yes
4515    else
4516      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4517    fi
4518    ;;
4519  esac
4520fi
4521
4522file_magic_cmd=$lt_cv_file_magic_cmd
4523deplibs_check_method=$lt_cv_deplibs_check_method
4524test -z "$deplibs_check_method" && deplibs_check_method=unknown
4525
4526_LT_DECL([], [deplibs_check_method], [1],
4527    [Method to check whether dependent libraries are shared objects])
4528_LT_DECL([], [file_magic_cmd], [1],
4529    [Command to use when deplibs_check_method = "file_magic"])
4530_LT_DECL([], [file_magic_glob], [1],
4531    [How to find potential files when deplibs_check_method = "file_magic"])
4532_LT_DECL([], [want_nocaseglob], [1],
4533    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4534])# _LT_CHECK_MAGIC_METHOD
4535
4536
4537# LT_PATH_NM
4538# ----------
4539# find the pathname to a BSD- or MS-compatible name lister
4540AC_DEFUN([LT_PATH_NM],
4541[AC_REQUIRE([AC_PROG_CC])dnl
4542AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4543[if test -n "$NM"; then
4544  # Let the user override the test.
4545  lt_cv_path_NM="$NM"
4546else
4547  lt_nm_to_check="${ac_tool_prefix}nm"
4548  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4549    lt_nm_to_check="$lt_nm_to_check nm"
4550  fi
4551  for lt_tmp_nm in $lt_nm_to_check; do
4552    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4553    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4554      IFS="$lt_save_ifs"
4555      test -z "$ac_dir" && ac_dir=.
4556      tmp_nm="$ac_dir/$lt_tmp_nm"
4557      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4558	# Check to see if the nm accepts a BSD-compat flag.
4559	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4560	#   nm: unknown option "B" ignored
4561	# Tru64's nm complains that /dev/null is an invalid object file
4562	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4563	*/dev/null* | *'Invalid file or object type'*)
4564	  lt_cv_path_NM="$tmp_nm -B"
4565	  break
4566	  ;;
4567	*)
4568	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4569	  */dev/null*)
4570	    lt_cv_path_NM="$tmp_nm -p"
4571	    break
4572	    ;;
4573	  *)
4574	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4575	    continue # so that we can try to find one that supports BSD flags
4576	    ;;
4577	  esac
4578	  ;;
4579	esac
4580      fi
4581    done
4582    IFS="$lt_save_ifs"
4583  done
4584  : ${lt_cv_path_NM=no}
4585fi])
4586if test "$lt_cv_path_NM" != "no"; then
4587  NM="$lt_cv_path_NM"
4588else
4589  # Didn't find any BSD compatible name lister, look for dumpbin.
4590  if test -n "$DUMPBIN"; then :
4591    # Let the user override the test.
4592  else
4593    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4594    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4595    *COFF*)
4596      DUMPBIN="$DUMPBIN -symbols"
4597      ;;
4598    *)
4599      DUMPBIN=:
4600      ;;
4601    esac
4602  fi
4603  AC_SUBST([DUMPBIN])
4604  if test "$DUMPBIN" != ":"; then
4605    NM="$DUMPBIN"
4606  fi
4607fi
4608test -z "$NM" && NM=nm
4609AC_SUBST([NM])
4610_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4611
4612AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4613  [lt_cv_nm_interface="BSD nm"
4614  echo "int some_variable = 0;" > conftest.$ac_ext
4615  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4616  (eval "$ac_compile" 2>conftest.err)
4617  cat conftest.err >&AS_MESSAGE_LOG_FD
4618  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4619  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4620  cat conftest.err >&AS_MESSAGE_LOG_FD
4621  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4622  cat conftest.out >&AS_MESSAGE_LOG_FD
4623  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4624    lt_cv_nm_interface="MS dumpbin"
4625  fi
4626  rm -f conftest*])
4627])# LT_PATH_NM
4628
4629# Old names:
4630AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4631AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4632dnl aclocal-1.4 backwards compatibility:
4633dnl AC_DEFUN([AM_PROG_NM], [])
4634dnl AC_DEFUN([AC_PROG_NM], [])
4635
4636# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4637# --------------------------------
4638# how to determine the name of the shared library
4639# associated with a specific link library.
4640#  -- PORTME fill in with the dynamic library characteristics
4641m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4642[m4_require([_LT_DECL_EGREP])
4643m4_require([_LT_DECL_OBJDUMP])
4644m4_require([_LT_DECL_DLLTOOL])
4645AC_CACHE_CHECK([how to associate runtime and link libraries],
4646lt_cv_sharedlib_from_linklib_cmd,
4647[lt_cv_sharedlib_from_linklib_cmd='unknown'
4648
4649case $host_os in
4650cygwin* | mingw* | pw32* | cegcc*)
4651  # two different shell functions defined in ltmain.sh
4652  # decide which to use based on capabilities of $DLLTOOL
4653  case `$DLLTOOL --help 2>&1` in
4654  *--identify-strict*)
4655    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4656    ;;
4657  *)
4658    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4659    ;;
4660  esac
4661  ;;
4662*)
4663  # fallback: assume linklib IS sharedlib
4664  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4665  ;;
4666esac
4667])
4668sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4669test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4670
4671_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4672    [Command to associate shared and link libraries])
4673])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4674
4675
4676# _LT_PATH_MANIFEST_TOOL
4677# ----------------------
4678# locate the manifest tool
4679m4_defun([_LT_PATH_MANIFEST_TOOL],
4680[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4681test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4682AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4683  [lt_cv_path_mainfest_tool=no
4684  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4685  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4686  cat conftest.err >&AS_MESSAGE_LOG_FD
4687  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4688    lt_cv_path_mainfest_tool=yes
4689  fi
4690  rm -f conftest*])
4691if test "x$lt_cv_path_mainfest_tool" != xyes; then
4692  MANIFEST_TOOL=:
4693fi
4694_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4695])# _LT_PATH_MANIFEST_TOOL
4696
4697
4698# LT_LIB_M
4699# --------
4700# check for math library
4701AC_DEFUN([LT_LIB_M],
4702[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4703LIBM=
4704case $host in
4705*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4706  # These system don't have libm, or don't need it
4707  ;;
4708*-ncr-sysv4.3*)
4709  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4710  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4711  ;;
4712*)
4713  AC_CHECK_LIB(m, cos, LIBM="-lm")
4714  ;;
4715esac
4716AC_SUBST([LIBM])
4717])# LT_LIB_M
4718
4719# Old name:
4720AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4721dnl aclocal-1.4 backwards compatibility:
4722dnl AC_DEFUN([AC_CHECK_LIBM], [])
4723
4724
4725# _LT_COMPILER_NO_RTTI([TAGNAME])
4726# -------------------------------
4727m4_defun([_LT_COMPILER_NO_RTTI],
4728[m4_require([_LT_TAG_COMPILER])dnl
4729
4730_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4731
4732if test "$GCC" = yes; then
4733  case $cc_basename in
4734  nvcc*)
4735    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4736  *)
4737    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4738  esac
4739
4740  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4741    lt_cv_prog_compiler_rtti_exceptions,
4742    [-fno-rtti -fno-exceptions], [],
4743    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4744fi
4745_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4746	[Compiler flag to turn off builtin functions])
4747])# _LT_COMPILER_NO_RTTI
4748
4749
4750# _LT_CMD_GLOBAL_SYMBOLS
4751# ----------------------
4752m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4753[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4754AC_REQUIRE([AC_PROG_CC])dnl
4755AC_REQUIRE([AC_PROG_AWK])dnl
4756AC_REQUIRE([LT_PATH_NM])dnl
4757AC_REQUIRE([LT_PATH_LD])dnl
4758m4_require([_LT_DECL_SED])dnl
4759m4_require([_LT_DECL_EGREP])dnl
4760m4_require([_LT_TAG_COMPILER])dnl
4761
4762# Check for command to grab the raw symbol name followed by C symbol from nm.
4763AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4764AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4765[
4766# These are sane defaults that work on at least a few old systems.
4767# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4768
4769# Character class describing NM global symbol codes.
4770symcode='[[BCDEGRST]]'
4771
4772# Regexp to match symbols that can be accessed directly from C.
4773sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4774
4775# Define system-specific variables.
4776case $host_os in
4777aix*)
4778  symcode='[[BCDT]]'
4779  ;;
4780cygwin* | mingw* | pw32* | cegcc*)
4781  symcode='[[ABCDGISTW]]'
4782  ;;
4783hpux*)
4784  if test "$host_cpu" = ia64; then
4785    symcode='[[ABCDEGRST]]'
4786  fi
4787  ;;
4788irix* | nonstopux*)
4789  symcode='[[BCDEGRST]]'
4790  ;;
4791osf*)
4792  symcode='[[BCDEGQRST]]'
4793  ;;
4794solaris*)
4795  symcode='[[BDRT]]'
4796  ;;
4797sco3.2v5*)
4798  symcode='[[DT]]'
4799  ;;
4800sysv4.2uw2*)
4801  symcode='[[DT]]'
4802  ;;
4803sysv5* | sco5v6* | unixware* | OpenUNIX*)
4804  symcode='[[ABDT]]'
4805  ;;
4806sysv4)
4807  symcode='[[DFNSTU]]'
4808  ;;
4809esac
4810
4811# If we're using GNU nm, then use its standard symbol codes.
4812case `$NM -V 2>&1` in
4813*GNU* | *'with BFD'*)
4814  symcode='[[ABCDGIRSTW]]' ;;
4815esac
4816
4817# Transform an extracted symbol line into a proper C declaration.
4818# Some systems (esp. on ia64) link data and code symbols differently,
4819# so use this general approach.
4820lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4821
4822# Transform an extracted symbol line into symbol name and symbol address
4823lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4824lt_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'"
4825
4826# Handle CRLF in mingw tool chain
4827opt_cr=
4828case $build_os in
4829mingw*)
4830  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4831  ;;
4832esac
4833
4834# Try without a prefix underscore, then with it.
4835for ac_symprfx in "" "_"; do
4836
4837  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4838  symxfrm="\\1 $ac_symprfx\\2 \\2"
4839
4840  # Write the raw and C identifiers.
4841  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4842    # Fake it for dumpbin and say T for any non-static function
4843    # and D for any global variable.
4844    # Also find C++ and __fastcall symbols from MSVC++,
4845    # which start with @ or ?.
4846    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4847"     {last_section=section; section=\$ 3};"\
4848"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4849"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4850"     \$ 0!~/External *\|/{next};"\
4851"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4852"     {if(hide[section]) next};"\
4853"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4854"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4855"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4856"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4857"     ' prfx=^$ac_symprfx]"
4858  else
4859    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4860  fi
4861  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4862
4863  # Check to see that the pipe works correctly.
4864  pipe_works=no
4865
4866  rm -f conftest*
4867  cat > conftest.$ac_ext <<_LT_EOF
4868#ifdef __cplusplus
4869extern "C" {
4870#endif
4871char nm_test_var;
4872void nm_test_func(void);
4873void nm_test_func(void){}
4874#ifdef __cplusplus
4875}
4876#endif
4877int main(){nm_test_var='a';nm_test_func();return(0);}
4878_LT_EOF
4879
4880  if AC_TRY_EVAL(ac_compile); then
4881    # Now try to grab the symbols.
4882    nlist=conftest.nm
4883    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4884      # Try sorting and uniquifying the output.
4885      if sort "$nlist" | uniq > "$nlist"T; then
4886	mv -f "$nlist"T "$nlist"
4887      else
4888	rm -f "$nlist"T
4889      fi
4890
4891      # Make sure that we snagged all the symbols we need.
4892      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4893	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4894	  cat <<_LT_EOF > conftest.$ac_ext
4895/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4896#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4897/* DATA imports from DLLs on WIN32 con't be const, because runtime
4898   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4899# define LT@&t@_DLSYM_CONST
4900#elif defined(__osf__)
4901/* This system does not cope well with relocations in const data.  */
4902# define LT@&t@_DLSYM_CONST
4903#else
4904# define LT@&t@_DLSYM_CONST const
4905#endif
4906
4907#ifdef __cplusplus
4908extern "C" {
4909#endif
4910
4911_LT_EOF
4912	  # Now generate the symbol file.
4913	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4914
4915	  cat <<_LT_EOF >> conftest.$ac_ext
4916
4917/* The mapping between symbol names and symbols.  */
4918LT@&t@_DLSYM_CONST struct {
4919  const char *name;
4920  void       *address;
4921}
4922lt__PROGRAM__LTX_preloaded_symbols[[]] =
4923{
4924  { "@PROGRAM@", (void *) 0 },
4925_LT_EOF
4926	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4927	  cat <<\_LT_EOF >> conftest.$ac_ext
4928  {0, (void *) 0}
4929};
4930
4931/* This works around a problem in FreeBSD linker */
4932#ifdef FREEBSD_WORKAROUND
4933static const void *lt_preloaded_setup() {
4934  return lt__PROGRAM__LTX_preloaded_symbols;
4935}
4936#endif
4937
4938#ifdef __cplusplus
4939}
4940#endif
4941_LT_EOF
4942	  # Now try linking the two files.
4943	  mv conftest.$ac_objext conftstm.$ac_objext
4944	  lt_globsym_save_LIBS=$LIBS
4945	  lt_globsym_save_CFLAGS=$CFLAGS
4946	  LIBS="conftstm.$ac_objext"
4947	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4948	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4949	    pipe_works=yes
4950	  fi
4951	  LIBS=$lt_globsym_save_LIBS
4952	  CFLAGS=$lt_globsym_save_CFLAGS
4953	else
4954	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4955	fi
4956      else
4957	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4958      fi
4959    else
4960      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4961    fi
4962  else
4963    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4964    cat conftest.$ac_ext >&5
4965  fi
4966  rm -rf conftest* conftst*
4967
4968  # Do not use the global_symbol_pipe unless it works.
4969  if test "$pipe_works" = yes; then
4970    break
4971  else
4972    lt_cv_sys_global_symbol_pipe=
4973  fi
4974done
4975])
4976if test -z "$lt_cv_sys_global_symbol_pipe"; then
4977  lt_cv_sys_global_symbol_to_cdecl=
4978fi
4979if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4980  AC_MSG_RESULT(failed)
4981else
4982  AC_MSG_RESULT(ok)
4983fi
4984
4985# Response file support.
4986if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4987  nm_file_list_spec='@'
4988elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4989  nm_file_list_spec='@'
4990fi
4991
4992_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4993    [Take the output of nm and produce a listing of raw symbols and C names])
4994_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4995    [Transform the output of nm in a proper C declaration])
4996_LT_DECL([global_symbol_to_c_name_address],
4997    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4998    [Transform the output of nm in a C name address pair])
4999_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
5000    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
5001    [Transform the output of nm in a C name address pair when lib prefix is needed])
5002_LT_DECL([], [nm_file_list_spec], [1],
5003    [Specify filename containing input files for $NM])
5004]) # _LT_CMD_GLOBAL_SYMBOLS
5005
5006
5007# _LT_COMPILER_PIC([TAGNAME])
5008# ---------------------------
5009m4_defun([_LT_COMPILER_PIC],
5010[m4_require([_LT_TAG_COMPILER])dnl
5011_LT_TAGVAR(lt_prog_compiler_wl, $1)=
5012_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5013_LT_TAGVAR(lt_prog_compiler_static, $1)=
5014
5015m4_if([$1], [CXX], [
5016  # C++ specific cases for pic, static, wl, etc.
5017  if test "$GXX" = yes; then
5018    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5019    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5020
5021    case $host_os in
5022    aix*)
5023      # All AIX code is PIC.
5024      if test "$host_cpu" = ia64; then
5025	# AIX 5 now supports IA64 processor
5026	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5027      fi
5028      ;;
5029
5030    amigaos*)
5031      case $host_cpu in
5032      powerpc)
5033            # see comment about AmigaOS4 .so support
5034            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5035        ;;
5036      m68k)
5037            # FIXME: we need at least 68020 code to build shared libraries, but
5038            # adding the `-m68020' flag to GCC prevents building anything better,
5039            # like `-m68040'.
5040            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5041        ;;
5042      esac
5043      ;;
5044
5045    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5046      # PIC is the default for these OSes.
5047      ;;
5048    mingw* | cygwin* | os2* | pw32* | cegcc*)
5049      # This hack is so that the source file can tell whether it is being
5050      # built for inclusion in a dll (and should export symbols for example).
5051      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5052      # (--disable-auto-import) libraries
5053      m4_if([$1], [GCJ], [],
5054	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5055      ;;
5056    darwin* | rhapsody*)
5057      # PIC is the default on this platform
5058      # Common symbols not allowed in MH_DYLIB files
5059      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5060      ;;
5061    *djgpp*)
5062      # DJGPP does not support shared libraries at all
5063      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5064      ;;
5065    haiku*)
5066      # PIC is the default for Haiku.
5067      # The "-static" flag exists, but is broken.
5068      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5069      ;;
5070    interix[[3-9]]*)
5071      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5072      # Instead, we relocate shared libraries at runtime.
5073      ;;
5074    sysv4*MP*)
5075      if test -d /usr/nec; then
5076	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5077      fi
5078      ;;
5079    hpux*)
5080      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5081      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5082      # sets the default TLS model and affects inlining.
5083      case $host_cpu in
5084      hppa*64*)
5085	;;
5086      *)
5087	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5088	;;
5089      esac
5090      ;;
5091    *qnx* | *nto*)
5092      # QNX uses GNU C++, but need to define -shared option too, otherwise
5093      # it will coredump.
5094      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5095      ;;
5096    *)
5097      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5098      ;;
5099    esac
5100  else
5101    case $host_os in
5102      aix[[4-9]]*)
5103	# All AIX code is PIC.
5104	if test "$host_cpu" = ia64; then
5105	  # AIX 5 now supports IA64 processor
5106	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5107	else
5108	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5109	fi
5110	;;
5111      chorus*)
5112	case $cc_basename in
5113	cxch68*)
5114	  # Green Hills C++ Compiler
5115	  # _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"
5116	  ;;
5117	esac
5118	;;
5119      mingw* | cygwin* | os2* | pw32* | cegcc*)
5120	# This hack is so that the source file can tell whether it is being
5121	# built for inclusion in a dll (and should export symbols for example).
5122	m4_if([$1], [GCJ], [],
5123	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5124	;;
5125      dgux*)
5126	case $cc_basename in
5127	  ec++*)
5128	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5129	    ;;
5130	  ghcx*)
5131	    # Green Hills C++ Compiler
5132	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5133	    ;;
5134	  *)
5135	    ;;
5136	esac
5137	;;
5138      freebsd* | dragonfly*)
5139	# FreeBSD uses GNU C++
5140	;;
5141      hpux9* | hpux10* | hpux11*)
5142	case $cc_basename in
5143	  CC*)
5144	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5145	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5146	    if test "$host_cpu" != ia64; then
5147	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5148	    fi
5149	    ;;
5150	  aCC*)
5151	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5152	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5153	    case $host_cpu in
5154	    hppa*64*|ia64*)
5155	      # +Z the default
5156	      ;;
5157	    *)
5158	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5159	      ;;
5160	    esac
5161	    ;;
5162	  *)
5163	    ;;
5164	esac
5165	;;
5166      interix*)
5167	# This is c89, which is MS Visual C++ (no shared libs)
5168	# Anyone wants to do a port?
5169	;;
5170      irix5* | irix6* | nonstopux*)
5171	case $cc_basename in
5172	  CC*)
5173	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5174	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5175	    # CC pic flag -KPIC is the default.
5176	    ;;
5177	  *)
5178	    ;;
5179	esac
5180	;;
5181      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5182	case $cc_basename in
5183	  KCC*)
5184	    # KAI C++ Compiler
5185	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5186	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5187	    ;;
5188	  ecpc* )
5189	    # old Intel C++ for x86_64 which still supported -KPIC.
5190	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5191	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5192	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5193	    ;;
5194	  icpc* )
5195	    # Intel C++, used to be incompatible with GCC.
5196	    # ICC 10 doesn't accept -KPIC any more.
5197	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5198	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5199	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5200	    ;;
5201	  pgCC* | pgcpp*)
5202	    # Portland Group C++ compiler
5203	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5204	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5205	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5206	    ;;
5207	  cxx*)
5208	    # Compaq C++
5209	    # Make sure the PIC flag is empty.  It appears that all Alpha
5210	    # Linux and Compaq Tru64 Unix objects are PIC.
5211	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5212	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5213	    ;;
5214	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5215	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5216	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5217	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5218	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5219	    ;;
5220	  *)
5221	    case `$CC -V 2>&1 | sed 5q` in
5222	    *Sun\ C*)
5223	      # Sun C++ 5.9
5224	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5225	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5226	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5227	      ;;
5228	    esac
5229	    ;;
5230	esac
5231	;;
5232      lynxos*)
5233	;;
5234      m88k*)
5235	;;
5236      mvs*)
5237	case $cc_basename in
5238	  cxx*)
5239	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5240	    ;;
5241	  *)
5242	    ;;
5243	esac
5244	;;
5245      netbsd*)
5246	;;
5247      *qnx* | *nto*)
5248        # QNX uses GNU C++, but need to define -shared option too, otherwise
5249        # it will coredump.
5250        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5251        ;;
5252      osf3* | osf4* | osf5*)
5253	case $cc_basename in
5254	  KCC*)
5255	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5256	    ;;
5257	  RCC*)
5258	    # Rational C++ 2.4.1
5259	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5260	    ;;
5261	  cxx*)
5262	    # Digital/Compaq C++
5263	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5264	    # Make sure the PIC flag is empty.  It appears that all Alpha
5265	    # Linux and Compaq Tru64 Unix objects are PIC.
5266	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5267	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5268	    ;;
5269	  *)
5270	    ;;
5271	esac
5272	;;
5273      psos*)
5274	;;
5275      solaris*)
5276	case $cc_basename in
5277	  CC* | sunCC*)
5278	    # Sun C++ 4.2, 5.x and Centerline C++
5279	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5280	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5281	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5282	    ;;
5283	  gcx*)
5284	    # Green Hills C++ Compiler
5285	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5286	    ;;
5287	  *)
5288	    ;;
5289	esac
5290	;;
5291      sunos4*)
5292	case $cc_basename in
5293	  CC*)
5294	    # Sun C++ 4.x
5295	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5296	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5297	    ;;
5298	  lcc*)
5299	    # Lucid
5300	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5301	    ;;
5302	  *)
5303	    ;;
5304	esac
5305	;;
5306      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5307	case $cc_basename in
5308	  CC*)
5309	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5310	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5311	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5312	    ;;
5313	esac
5314	;;
5315      tandem*)
5316	case $cc_basename in
5317	  NCC*)
5318	    # NonStop-UX NCC 3.20
5319	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5320	    ;;
5321	  *)
5322	    ;;
5323	esac
5324	;;
5325      vxworks*)
5326	;;
5327      *)
5328	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5329	;;
5330    esac
5331  fi
5332],
5333[
5334  if test "$GCC" = yes; then
5335    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5336    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5337
5338    case $host_os in
5339      aix*)
5340      # All AIX code is PIC.
5341      if test "$host_cpu" = ia64; then
5342	# AIX 5 now supports IA64 processor
5343	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5344      fi
5345      ;;
5346
5347    amigaos*)
5348      case $host_cpu in
5349      powerpc)
5350            # see comment about AmigaOS4 .so support
5351            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5352        ;;
5353      m68k)
5354            # FIXME: we need at least 68020 code to build shared libraries, but
5355            # adding the `-m68020' flag to GCC prevents building anything better,
5356            # like `-m68040'.
5357            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5358        ;;
5359      esac
5360      ;;
5361
5362    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5363      # PIC is the default for these OSes.
5364      ;;
5365
5366    mingw* | cygwin* | pw32* | os2* | cegcc*)
5367      # This hack is so that the source file can tell whether it is being
5368      # built for inclusion in a dll (and should export symbols for example).
5369      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5370      # (--disable-auto-import) libraries
5371      m4_if([$1], [GCJ], [],
5372	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5373      ;;
5374
5375    darwin* | rhapsody*)
5376      # PIC is the default on this platform
5377      # Common symbols not allowed in MH_DYLIB files
5378      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5379      ;;
5380
5381    haiku*)
5382      # PIC is the default for Haiku.
5383      # The "-static" flag exists, but is broken.
5384      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5385      ;;
5386
5387    hpux*)
5388      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5389      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5390      # sets the default TLS model and affects inlining.
5391      case $host_cpu in
5392      hppa*64*)
5393	# +Z the default
5394	;;
5395      *)
5396	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5397	;;
5398      esac
5399      ;;
5400
5401    interix[[3-9]]*)
5402      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5403      # Instead, we relocate shared libraries at runtime.
5404      ;;
5405
5406    msdosdjgpp*)
5407      # Just because we use GCC doesn't mean we suddenly get shared libraries
5408      # on systems that don't support them.
5409      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5410      enable_shared=no
5411      ;;
5412
5413    *nto* | *qnx*)
5414      # QNX uses GNU C++, but need to define -shared option too, otherwise
5415      # it will coredump.
5416      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5417      ;;
5418
5419    sysv4*MP*)
5420      if test -d /usr/nec; then
5421	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5422      fi
5423      ;;
5424
5425    *)
5426      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5427      ;;
5428    esac
5429
5430    case $cc_basename in
5431    nvcc*) # Cuda Compiler Driver 2.2
5432      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5433      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5434        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5435      fi
5436      ;;
5437    esac
5438  else
5439    # PORTME Check for flag to pass linker flags through the system compiler.
5440    case $host_os in
5441    aix*)
5442      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5443      if test "$host_cpu" = ia64; then
5444	# AIX 5 now supports IA64 processor
5445	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5446      else
5447	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5448      fi
5449      ;;
5450
5451    mingw* | cygwin* | pw32* | os2* | cegcc*)
5452      # This hack is so that the source file can tell whether it is being
5453      # built for inclusion in a dll (and should export symbols for example).
5454      m4_if([$1], [GCJ], [],
5455	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5456      ;;
5457
5458    hpux9* | hpux10* | hpux11*)
5459      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5460      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5461      # not for PA HP-UX.
5462      case $host_cpu in
5463      hppa*64*|ia64*)
5464	# +Z the default
5465	;;
5466      *)
5467	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5468	;;
5469      esac
5470      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5471      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5472      ;;
5473
5474    irix5* | irix6* | nonstopux*)
5475      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5476      # PIC (with -KPIC) is the default.
5477      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5478      ;;
5479
5480    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5481      case $cc_basename in
5482      # old Intel for x86_64 which still supported -KPIC.
5483      ecc*)
5484	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5485	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5486	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5487        ;;
5488      # icc used to be incompatible with GCC.
5489      # ICC 10 doesn't accept -KPIC any more.
5490      icc* | ifort*)
5491	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5492	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5493	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5494        ;;
5495      # Lahey Fortran 8.1.
5496      lf95*)
5497	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5498	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5499	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5500	;;
5501      nagfor*)
5502	# NAG Fortran compiler
5503	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5504	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5505	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5506	;;
5507      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5508        # Portland Group compilers (*not* the Pentium gcc compiler,
5509	# which looks to be a dead project)
5510	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5511	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5512	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5513        ;;
5514      ccc*)
5515        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5516        # All Alpha code is PIC.
5517        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5518        ;;
5519      xl* | bgxl* | bgf* | mpixl*)
5520	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5521	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5522	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5523	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5524	;;
5525      *)
5526	case `$CC -V 2>&1 | sed 5q` in
5527	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5528	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5529	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5530	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5531	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5532	  ;;
5533	*Sun\ F* | *Sun*Fortran*)
5534	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5535	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5536	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5537	  ;;
5538	*Sun\ C*)
5539	  # Sun C 5.9
5540	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5541	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5542	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5543	  ;;
5544        *Intel*\ [[CF]]*Compiler*)
5545	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5546	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5547	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5548	  ;;
5549	*Portland\ Group*)
5550	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5551	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5552	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5553	  ;;
5554	esac
5555	;;
5556      esac
5557      ;;
5558
5559    newsos6)
5560      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5561      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5562      ;;
5563
5564    *nto* | *qnx*)
5565      # QNX uses GNU C++, but need to define -shared option too, otherwise
5566      # it will coredump.
5567      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5568      ;;
5569
5570    osf3* | osf4* | osf5*)
5571      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5572      # All OSF/1 code is PIC.
5573      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5574      ;;
5575
5576    rdos*)
5577      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5578      ;;
5579
5580    solaris*)
5581      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5582      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5583      case $cc_basename in
5584      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5585	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5586      *)
5587	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5588      esac
5589      ;;
5590
5591    sunos4*)
5592      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5593      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5594      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5595      ;;
5596
5597    sysv4 | sysv4.2uw2* | sysv4.3*)
5598      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5599      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5600      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5601      ;;
5602
5603    sysv4*MP*)
5604      if test -d /usr/nec ;then
5605	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5606	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5607      fi
5608      ;;
5609
5610    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5611      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5612      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5613      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5614      ;;
5615
5616    unicos*)
5617      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5618      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5619      ;;
5620
5621    uts4*)
5622      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5623      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5624      ;;
5625
5626    *)
5627      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5628      ;;
5629    esac
5630  fi
5631])
5632case $host_os in
5633  # For platforms which do not support PIC, -DPIC is meaningless:
5634  *djgpp*)
5635    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5636    ;;
5637  *)
5638    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5639    ;;
5640esac
5641
5642AC_CACHE_CHECK([for $compiler option to produce PIC],
5643  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5644  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5645_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5646
5647#
5648# Check to make sure the PIC flag actually works.
5649#
5650if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5651  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5652    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5653    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5654    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5655     "" | " "*) ;;
5656     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5657     esac],
5658    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5659     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5660fi
5661_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5662	[Additional compiler flags for building library objects])
5663
5664_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5665	[How to pass a linker flag through the compiler])
5666#
5667# Check to make sure the static flag actually works.
5668#
5669wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5670_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5671  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5672  $lt_tmp_static_flag,
5673  [],
5674  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5675_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5676	[Compiler flag to prevent dynamic linking])
5677])# _LT_COMPILER_PIC
5678
5679
5680# _LT_LINKER_SHLIBS([TAGNAME])
5681# ----------------------------
5682# See if the linker supports building shared libraries.
5683m4_defun([_LT_LINKER_SHLIBS],
5684[AC_REQUIRE([LT_PATH_LD])dnl
5685AC_REQUIRE([LT_PATH_NM])dnl
5686m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5687m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5688m4_require([_LT_DECL_EGREP])dnl
5689m4_require([_LT_DECL_SED])dnl
5690m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5691m4_require([_LT_TAG_COMPILER])dnl
5692AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5693m4_if([$1], [CXX], [
5694  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5695  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5696  case $host_os in
5697  aix[[4-9]]*)
5698    # If we're using GNU nm, then we don't want the "-C" option.
5699    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5700    # Also, AIX nm treats weak defined symbols like other global defined
5701    # symbols, whereas GNU nm marks them as "W".
5702    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5703      _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'
5704    else
5705      _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'
5706    fi
5707    ;;
5708  pw32*)
5709    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5710    ;;
5711  cygwin* | mingw* | cegcc*)
5712    case $cc_basename in
5713    cl*)
5714      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5715      ;;
5716    *)
5717      _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'
5718      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5719      ;;
5720    esac
5721    ;;
5722  *)
5723    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5724    ;;
5725  esac
5726], [
5727  runpath_var=
5728  _LT_TAGVAR(allow_undefined_flag, $1)=
5729  _LT_TAGVAR(always_export_symbols, $1)=no
5730  _LT_TAGVAR(archive_cmds, $1)=
5731  _LT_TAGVAR(archive_expsym_cmds, $1)=
5732  _LT_TAGVAR(compiler_needs_object, $1)=no
5733  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5734  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5735  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5736  _LT_TAGVAR(hardcode_automatic, $1)=no
5737  _LT_TAGVAR(hardcode_direct, $1)=no
5738  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5739  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5740  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5741  _LT_TAGVAR(hardcode_minus_L, $1)=no
5742  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5743  _LT_TAGVAR(inherit_rpath, $1)=no
5744  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5745  _LT_TAGVAR(module_cmds, $1)=
5746  _LT_TAGVAR(module_expsym_cmds, $1)=
5747  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5748  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5749  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5750  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5751  # include_expsyms should be a list of space-separated symbols to be *always*
5752  # included in the symbol list
5753  _LT_TAGVAR(include_expsyms, $1)=
5754  # exclude_expsyms can be an extended regexp of symbols to exclude
5755  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5756  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5757  # as well as any symbol that contains `d'.
5758  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5759  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5760  # platforms (ab)use it in PIC code, but their linkers get confused if
5761  # the symbol is explicitly referenced.  Since portable code cannot
5762  # rely on this symbol name, it's probably fine to never include it in
5763  # preloaded symbol tables.
5764  # Exclude shared library initialization/finalization symbols.
5765dnl Note also adjust exclude_expsyms for C++ above.
5766  extract_expsyms_cmds=
5767
5768  case $host_os in
5769  cygwin* | mingw* | pw32* | cegcc*)
5770    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5771    # When not using gcc, we currently assume that we are using
5772    # Microsoft Visual C++.
5773    if test "$GCC" != yes; then
5774      with_gnu_ld=no
5775    fi
5776    ;;
5777  interix*)
5778    # we just hope/assume this is gcc and not c89 (= MSVC++)
5779    with_gnu_ld=yes
5780    ;;
5781  openbsd*)
5782    with_gnu_ld=no
5783    ;;
5784  esac
5785
5786  _LT_TAGVAR(ld_shlibs, $1)=yes
5787
5788  # On some targets, GNU ld is compatible enough with the native linker
5789  # that we're better off using the native interface for both.
5790  lt_use_gnu_ld_interface=no
5791  if test "$with_gnu_ld" = yes; then
5792    case $host_os in
5793      aix*)
5794	# The AIX port of GNU ld has always aspired to compatibility
5795	# with the native linker.  However, as the warning in the GNU ld
5796	# block says, versions before 2.19.5* couldn't really create working
5797	# shared libraries, regardless of the interface used.
5798	case `$LD -v 2>&1` in
5799	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5800	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5801	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5802	  *)
5803	    lt_use_gnu_ld_interface=yes
5804	    ;;
5805	esac
5806	;;
5807      *)
5808	lt_use_gnu_ld_interface=yes
5809	;;
5810    esac
5811  fi
5812
5813  if test "$lt_use_gnu_ld_interface" = yes; then
5814    # If archive_cmds runs LD, not CC, wlarc should be empty
5815    wlarc='${wl}'
5816
5817    # Set some defaults for GNU ld with shared library support. These
5818    # are reset later if shared libraries are not supported. Putting them
5819    # here allows them to be overridden if necessary.
5820    runpath_var=LD_RUN_PATH
5821    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5822    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5823    # ancient GNU ld didn't support --whole-archive et. al.
5824    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5825      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5826    else
5827      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5828    fi
5829    supports_anon_versioning=no
5830    case `$LD -v 2>&1` in
5831      *GNU\ gold*) supports_anon_versioning=yes ;;
5832      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5833      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5834      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5835      *\ 2.11.*) ;; # other 2.11 versions
5836      *) supports_anon_versioning=yes ;;
5837    esac
5838
5839    # See if GNU ld supports shared libraries.
5840    case $host_os in
5841    aix[[3-9]]*)
5842      # On AIX/PPC, the GNU linker is very broken
5843      if test "$host_cpu" != ia64; then
5844	_LT_TAGVAR(ld_shlibs, $1)=no
5845	cat <<_LT_EOF 1>&2
5846
5847*** Warning: the GNU linker, at least up to release 2.19, is reported
5848*** to be unable to reliably create shared libraries on AIX.
5849*** Therefore, libtool is disabling shared libraries support.  If you
5850*** really care for shared libraries, you may want to install binutils
5851*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5852*** You will then need to restart the configuration process.
5853
5854_LT_EOF
5855      fi
5856      ;;
5857
5858    amigaos*)
5859      case $host_cpu in
5860      powerpc)
5861            # see comment about AmigaOS4 .so support
5862            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5863            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5864        ;;
5865      m68k)
5866            _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)'
5867            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5868            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5869        ;;
5870      esac
5871      ;;
5872
5873    beos*)
5874      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5875	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5876	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5877	# support --undefined.  This deserves some investigation.  FIXME
5878	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5879      else
5880	_LT_TAGVAR(ld_shlibs, $1)=no
5881      fi
5882      ;;
5883
5884    cygwin* | mingw* | pw32* | cegcc*)
5885      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5886      # as there is no search path for DLLs.
5887      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5888      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5889      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5890      _LT_TAGVAR(always_export_symbols, $1)=no
5891      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5892      _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'
5893      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5894
5895      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5896        _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'
5897	# If the export-symbols file already is a .def file (1st line
5898	# is EXPORTS), use it as is; otherwise, prepend...
5899	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5900	  cp $export_symbols $output_objdir/$soname.def;
5901	else
5902	  echo EXPORTS > $output_objdir/$soname.def;
5903	  cat $export_symbols >> $output_objdir/$soname.def;
5904	fi~
5905	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5906      else
5907	_LT_TAGVAR(ld_shlibs, $1)=no
5908      fi
5909      ;;
5910
5911    haiku*)
5912      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5913      _LT_TAGVAR(link_all_deplibs, $1)=yes
5914      ;;
5915
5916    interix[[3-9]]*)
5917      _LT_TAGVAR(hardcode_direct, $1)=no
5918      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5919      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5920      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5921      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5922      # Instead, shared libraries are loaded at an image base (0x10000000 by
5923      # default) and relocated if they conflict, which is a slow very memory
5924      # consuming and fragmenting process.  To avoid this, we pick a random,
5925      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5926      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5927      _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'
5928      _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'
5929      ;;
5930
5931    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5932      tmp_diet=no
5933      if test "$host_os" = linux-dietlibc; then
5934	case $cc_basename in
5935	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5936	esac
5937      fi
5938      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5939	 && test "$tmp_diet" = no
5940      then
5941	tmp_addflag=' $pic_flag'
5942	tmp_sharedflag='-shared'
5943	case $cc_basename,$host_cpu in
5944        pgcc*)				# Portland Group C compiler
5945	  _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'
5946	  tmp_addflag=' $pic_flag'
5947	  ;;
5948	pgf77* | pgf90* | pgf95* | pgfortran*)
5949					# Portland Group f77 and f90 compilers
5950	  _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'
5951	  tmp_addflag=' $pic_flag -Mnomain' ;;
5952	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5953	  tmp_addflag=' -i_dynamic' ;;
5954	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5955	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5956	ifc* | ifort*)			# Intel Fortran compiler
5957	  tmp_addflag=' -nofor_main' ;;
5958	lf95*)				# Lahey Fortran 8.1
5959	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5960	  tmp_sharedflag='--shared' ;;
5961	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5962	  tmp_sharedflag='-qmkshrobj'
5963	  tmp_addflag= ;;
5964	nvcc*)	# Cuda Compiler Driver 2.2
5965	  _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'
5966	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5967	  ;;
5968	esac
5969	case `$CC -V 2>&1 | sed 5q` in
5970	*Sun\ C*)			# Sun C 5.9
5971	  _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'
5972	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5973	  tmp_sharedflag='-G' ;;
5974	*Sun\ F*)			# Sun Fortran 8.3
5975	  tmp_sharedflag='-G' ;;
5976	esac
5977	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5978
5979        if test "x$supports_anon_versioning" = xyes; then
5980          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5981	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5982	    echo "local: *; };" >> $output_objdir/$libname.ver~
5983	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5984        fi
5985
5986	case $cc_basename in
5987	xlf* | bgf* | bgxlf* | mpixlf*)
5988	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5989	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5990	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5991	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5992	  if test "x$supports_anon_versioning" = xyes; then
5993	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5994	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5995	      echo "local: *; };" >> $output_objdir/$libname.ver~
5996	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5997	  fi
5998	  ;;
5999	esac
6000      else
6001        _LT_TAGVAR(ld_shlibs, $1)=no
6002      fi
6003      ;;
6004
6005    netbsd*)
6006      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6007	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6008	wlarc=
6009      else
6010	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6011	_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'
6012      fi
6013      ;;
6014
6015    solaris*)
6016      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
6017	_LT_TAGVAR(ld_shlibs, $1)=no
6018	cat <<_LT_EOF 1>&2
6019
6020*** Warning: The releases 2.8.* of the GNU linker cannot reliably
6021*** create shared libraries on Solaris systems.  Therefore, libtool
6022*** is disabling shared libraries support.  We urge you to upgrade GNU
6023*** binutils to release 2.9.1 or newer.  Another option is to modify
6024*** your PATH or compiler configuration so that the native linker is
6025*** used, and then restart.
6026
6027_LT_EOF
6028      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6029	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6030	_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'
6031      else
6032	_LT_TAGVAR(ld_shlibs, $1)=no
6033      fi
6034      ;;
6035
6036    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
6037      case `$LD -v 2>&1` in
6038        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
6039	_LT_TAGVAR(ld_shlibs, $1)=no
6040	cat <<_LT_EOF 1>&2
6041
6042*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
6043*** reliably create shared libraries on SCO systems.  Therefore, libtool
6044*** is disabling shared libraries support.  We urge you to upgrade GNU
6045*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
6046*** your PATH or compiler configuration so that the native linker is
6047*** used, and then restart.
6048
6049_LT_EOF
6050	;;
6051	*)
6052	  # For security reasons, it is highly recommended that you always
6053	  # use absolute paths for naming shared libraries, and exclude the
6054	  # DT_RUNPATH tag from executables and libraries.  But doing so
6055	  # requires that you compile everything twice, which is a pain.
6056	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6057	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6058	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6059	    _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'
6060	  else
6061	    _LT_TAGVAR(ld_shlibs, $1)=no
6062	  fi
6063	;;
6064      esac
6065      ;;
6066
6067    sunos4*)
6068      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6069      wlarc=
6070      _LT_TAGVAR(hardcode_direct, $1)=yes
6071      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6072      ;;
6073
6074    *)
6075      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6076	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6077	_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'
6078      else
6079	_LT_TAGVAR(ld_shlibs, $1)=no
6080      fi
6081      ;;
6082    esac
6083
6084    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
6085      runpath_var=
6086      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6087      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6088      _LT_TAGVAR(whole_archive_flag_spec, $1)=
6089    fi
6090  else
6091    # PORTME fill in a description of your system's linker (not GNU ld)
6092    case $host_os in
6093    aix3*)
6094      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6095      _LT_TAGVAR(always_export_symbols, $1)=yes
6096      _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'
6097      # Note: this linker hardcodes the directories in LIBPATH if there
6098      # are no directories specified by -L.
6099      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6100      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6101	# Neither direct hardcoding nor static linking is supported with a
6102	# broken collect2.
6103	_LT_TAGVAR(hardcode_direct, $1)=unsupported
6104      fi
6105      ;;
6106
6107    aix[[4-9]]*)
6108      if test "$host_cpu" = ia64; then
6109	# On IA64, the linker does run time linking by default, so we don't
6110	# have to do anything special.
6111	aix_use_runtimelinking=no
6112	exp_sym_flag='-Bexport'
6113	no_entry_flag=""
6114      else
6115	# If we're using GNU nm, then we don't want the "-C" option.
6116	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6117	# Also, AIX nm treats weak defined symbols like other global
6118	# defined symbols, whereas GNU nm marks them as "W".
6119	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6120	  _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'
6121	else
6122	  _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'
6123	fi
6124	aix_use_runtimelinking=no
6125
6126	# Test if we are trying to use run time linking or normal
6127	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6128	# need to do runtime linking.
6129	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6130	  for ld_flag in $LDFLAGS; do
6131	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6132	    aix_use_runtimelinking=yes
6133	    break
6134	  fi
6135	  done
6136	  ;;
6137	esac
6138
6139	exp_sym_flag='-bexport'
6140	no_entry_flag='-bnoentry'
6141      fi
6142
6143      # When large executables or shared objects are built, AIX ld can
6144      # have problems creating the table of contents.  If linking a library
6145      # or program results in "error TOC overflow" add -mminimal-toc to
6146      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6147      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6148
6149      _LT_TAGVAR(archive_cmds, $1)=''
6150      _LT_TAGVAR(hardcode_direct, $1)=yes
6151      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6152      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6153      _LT_TAGVAR(link_all_deplibs, $1)=yes
6154      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6155
6156      if test "$GCC" = yes; then
6157	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6158	# We only want to do this on AIX 4.2 and lower, the check
6159	# below for broken collect2 doesn't work under 4.3+
6160	  collect2name=`${CC} -print-prog-name=collect2`
6161	  if test -f "$collect2name" &&
6162	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6163	  then
6164	  # We have reworked collect2
6165	  :
6166	  else
6167	  # We have old collect2
6168	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6169	  # It fails to find uninstalled libraries when the uninstalled
6170	  # path is not listed in the libpath.  Setting hardcode_minus_L
6171	  # to unsupported forces relinking
6172	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6173	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6174	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6175	  fi
6176	  ;;
6177	esac
6178	shared_flag='-shared'
6179	if test "$aix_use_runtimelinking" = yes; then
6180	  shared_flag="$shared_flag "'${wl}-G'
6181	fi
6182      else
6183	# not using gcc
6184	if test "$host_cpu" = ia64; then
6185	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6186	# chokes on -Wl,-G. The following line is correct:
6187	  shared_flag='-G'
6188	else
6189	  if test "$aix_use_runtimelinking" = yes; then
6190	    shared_flag='${wl}-G'
6191	  else
6192	    shared_flag='${wl}-bM:SRE'
6193	  fi
6194	fi
6195      fi
6196
6197      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6198      # It seems that -bexpall does not export symbols beginning with
6199      # underscore (_), so it is better to generate a list of symbols to export.
6200      _LT_TAGVAR(always_export_symbols, $1)=yes
6201      if test "$aix_use_runtimelinking" = yes; then
6202	# Warning - without using the other runtime loading flags (-brtl),
6203	# -berok will link without error, but may produce a broken library.
6204	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6205        # Determine the default libpath from the value encoded in an
6206        # empty executable.
6207        _LT_SYS_MODULE_PATH_AIX([$1])
6208        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6209        _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"
6210      else
6211	if test "$host_cpu" = ia64; then
6212	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6213	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6214	  _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"
6215	else
6216	 # Determine the default libpath from the value encoded in an
6217	 # empty executable.
6218	 _LT_SYS_MODULE_PATH_AIX([$1])
6219	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6220	  # Warning - without using the other run time loading flags,
6221	  # -berok will link without error, but may produce a broken library.
6222	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6223	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6224	  if test "$with_gnu_ld" = yes; then
6225	    # We only use this code for GNU lds that support --whole-archive.
6226	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6227	  else
6228	    # Exported symbols can be pulled into shared objects from archives
6229	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6230	  fi
6231	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6232	  # This is similar to how AIX traditionally builds its shared libraries.
6233	  _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'
6234	fi
6235      fi
6236      ;;
6237
6238    amigaos*)
6239      case $host_cpu in
6240      powerpc)
6241            # see comment about AmigaOS4 .so support
6242            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6243            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6244        ;;
6245      m68k)
6246            _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)'
6247            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6248            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6249        ;;
6250      esac
6251      ;;
6252
6253    bsdi[[45]]*)
6254      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6255      ;;
6256
6257    cygwin* | mingw* | pw32* | cegcc*)
6258      # When not using gcc, we currently assume that we are using
6259      # Microsoft Visual C++.
6260      # hardcode_libdir_flag_spec is actually meaningless, as there is
6261      # no search path for DLLs.
6262      case $cc_basename in
6263      cl*)
6264	# Native MSVC
6265	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6266	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6267	_LT_TAGVAR(always_export_symbols, $1)=yes
6268	_LT_TAGVAR(file_list_spec, $1)='@'
6269	# Tell ltmain to make .lib files, not .a files.
6270	libext=lib
6271	# Tell ltmain to make .dll files, not .so files.
6272	shrext_cmds=".dll"
6273	# FIXME: Setting linknames here is a bad hack.
6274	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6275	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6276	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6277	  else
6278	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6279	  fi~
6280	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6281	  linknames='
6282	# The linker will not automatically build a static lib if we build a DLL.
6283	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6284	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6285	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6286	_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'
6287	# Don't use ranlib
6288	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6289	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6290	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6291	  case $lt_outputfile in
6292	    *.exe|*.EXE) ;;
6293	    *)
6294	      lt_outputfile="$lt_outputfile.exe"
6295	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6296	      ;;
6297	  esac~
6298	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6299	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6300	    $RM "$lt_outputfile.manifest";
6301	  fi'
6302	;;
6303      *)
6304	# Assume MSVC wrapper
6305	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6306	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6307	# Tell ltmain to make .lib files, not .a files.
6308	libext=lib
6309	# Tell ltmain to make .dll files, not .so files.
6310	shrext_cmds=".dll"
6311	# FIXME: Setting linknames here is a bad hack.
6312	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6313	# The linker will automatically build a .lib file if we build a DLL.
6314	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6315	# FIXME: Should let the user specify the lib program.
6316	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6317	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6318	;;
6319      esac
6320      ;;
6321
6322    darwin* | rhapsody*)
6323      _LT_DARWIN_LINKER_FEATURES($1)
6324      ;;
6325
6326    dgux*)
6327      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6328      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6329      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6330      ;;
6331
6332    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6333    # support.  Future versions do this automatically, but an explicit c++rt0.o
6334    # does not break anything, and helps significantly (at the cost of a little
6335    # extra space).
6336    freebsd2.2*)
6337      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6338      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6339      _LT_TAGVAR(hardcode_direct, $1)=yes
6340      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6341      ;;
6342
6343    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6344    freebsd2.*)
6345      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6346      _LT_TAGVAR(hardcode_direct, $1)=yes
6347      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6348      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6349      ;;
6350
6351    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6352    freebsd* | dragonfly*)
6353      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6354      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6355      _LT_TAGVAR(hardcode_direct, $1)=yes
6356      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6357      ;;
6358
6359    hpux9*)
6360      if test "$GCC" = yes; then
6361	_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'
6362      else
6363	_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'
6364      fi
6365      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6366      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6367      _LT_TAGVAR(hardcode_direct, $1)=yes
6368
6369      # hardcode_minus_L: Not really in the search PATH,
6370      # but as the default location of the library.
6371      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6372      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6373      ;;
6374
6375    hpux10*)
6376      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6377	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6378      else
6379	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6380      fi
6381      if test "$with_gnu_ld" = no; then
6382	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6383	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6384	_LT_TAGVAR(hardcode_direct, $1)=yes
6385	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6386	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6387	# hardcode_minus_L: Not really in the search PATH,
6388	# but as the default location of the library.
6389	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6390      fi
6391      ;;
6392
6393    hpux11*)
6394      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6395	case $host_cpu in
6396	hppa*64*)
6397	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6398	  ;;
6399	ia64*)
6400	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6401	  ;;
6402	*)
6403	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6404	  ;;
6405	esac
6406      else
6407	case $host_cpu in
6408	hppa*64*)
6409	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6410	  ;;
6411	ia64*)
6412	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6413	  ;;
6414	*)
6415	m4_if($1, [], [
6416	  # Older versions of the 11.00 compiler do not understand -b yet
6417	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6418	  _LT_LINKER_OPTION([if $CC understands -b],
6419	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6420	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6421	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6422	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6423	  ;;
6424	esac
6425      fi
6426      if test "$with_gnu_ld" = no; then
6427	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6428	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6429
6430	case $host_cpu in
6431	hppa*64*|ia64*)
6432	  _LT_TAGVAR(hardcode_direct, $1)=no
6433	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6434	  ;;
6435	*)
6436	  _LT_TAGVAR(hardcode_direct, $1)=yes
6437	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6438	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6439
6440	  # hardcode_minus_L: Not really in the search PATH,
6441	  # but as the default location of the library.
6442	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6443	  ;;
6444	esac
6445      fi
6446      ;;
6447
6448    irix5* | irix6* | nonstopux*)
6449      if test "$GCC" = yes; then
6450	_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'
6451	# Try to use the -exported_symbol ld option, if it does not
6452	# work, assume that -exports_file does not work either and
6453	# implicitly export all symbols.
6454	# This should be the same for all languages, so no per-tag cache variable.
6455	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6456	  [lt_cv_irix_exported_symbol],
6457	  [save_LDFLAGS="$LDFLAGS"
6458	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6459	   AC_LINK_IFELSE(
6460	     [AC_LANG_SOURCE(
6461	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6462			      [C++], [[int foo (void) { return 0; }]],
6463			      [Fortran 77], [[
6464      subroutine foo
6465      end]],
6466			      [Fortran], [[
6467      subroutine foo
6468      end]])])],
6469	      [lt_cv_irix_exported_symbol=yes],
6470	      [lt_cv_irix_exported_symbol=no])
6471           LDFLAGS="$save_LDFLAGS"])
6472	if test "$lt_cv_irix_exported_symbol" = yes; then
6473          _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'
6474	fi
6475      else
6476	_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'
6477	_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'
6478      fi
6479      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6480      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6481      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6482      _LT_TAGVAR(inherit_rpath, $1)=yes
6483      _LT_TAGVAR(link_all_deplibs, $1)=yes
6484      ;;
6485
6486    netbsd*)
6487      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6488	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6489      else
6490	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6491      fi
6492      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6493      _LT_TAGVAR(hardcode_direct, $1)=yes
6494      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6495      ;;
6496
6497    newsos6)
6498      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6499      _LT_TAGVAR(hardcode_direct, $1)=yes
6500      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6501      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6502      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6503      ;;
6504
6505    *nto* | *qnx*)
6506      ;;
6507
6508    openbsd*)
6509      if test -f /usr/libexec/ld.so; then
6510	_LT_TAGVAR(hardcode_direct, $1)=yes
6511	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6512	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6513	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6514	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6515	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6516	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6517	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6518	else
6519	  case $host_os in
6520	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6521	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6522	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6523	     ;;
6524	   *)
6525	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6526	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6527	     ;;
6528	  esac
6529	fi
6530      else
6531	_LT_TAGVAR(ld_shlibs, $1)=no
6532      fi
6533      ;;
6534
6535    os2*)
6536      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6537      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6538      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6539      _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'
6540      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6541      ;;
6542
6543    osf3*)
6544      if test "$GCC" = yes; then
6545	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6546	_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'
6547      else
6548	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6549	_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'
6550      fi
6551      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6552      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6553      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6554      ;;
6555
6556    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6557      if test "$GCC" = yes; then
6558	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6559	_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'
6560	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6561      else
6562	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6563	_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'
6564	_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~
6565	$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'
6566
6567	# Both c and cxx compiler support -rpath directly
6568	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6569      fi
6570      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6571      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6572      ;;
6573
6574    solaris*)
6575      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6576      if test "$GCC" = yes; then
6577	wlarc='${wl}'
6578	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6579	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6580	  $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'
6581      else
6582	case `$CC -V 2>&1` in
6583	*"Compilers 5.0"*)
6584	  wlarc=''
6585	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6586	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6587	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6588	  ;;
6589	*)
6590	  wlarc='${wl}'
6591	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6592	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6593	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6594	  ;;
6595	esac
6596      fi
6597      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6598      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6599      case $host_os in
6600      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6601      *)
6602	# The compiler driver will combine and reorder linker options,
6603	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6604	# but is careful enough not to reorder.
6605	# Supported since Solaris 2.6 (maybe 2.5.1?)
6606	if test "$GCC" = yes; then
6607	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6608	else
6609	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6610	fi
6611	;;
6612      esac
6613      _LT_TAGVAR(link_all_deplibs, $1)=yes
6614      ;;
6615
6616    sunos4*)
6617      if test "x$host_vendor" = xsequent; then
6618	# Use $CC to link under sequent, because it throws in some extra .o
6619	# files that make .init and .fini sections work.
6620	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6621      else
6622	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6623      fi
6624      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6625      _LT_TAGVAR(hardcode_direct, $1)=yes
6626      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6627      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6628      ;;
6629
6630    sysv4)
6631      case $host_vendor in
6632	sni)
6633	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6634	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6635	;;
6636	siemens)
6637	  ## LD is ld it makes a PLAMLIB
6638	  ## CC just makes a GrossModule.
6639	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6640	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6641	  _LT_TAGVAR(hardcode_direct, $1)=no
6642        ;;
6643	motorola)
6644	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6645	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6646	;;
6647      esac
6648      runpath_var='LD_RUN_PATH'
6649      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6650      ;;
6651
6652    sysv4.3*)
6653      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6654      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6655      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6656      ;;
6657
6658    sysv4*MP*)
6659      if test -d /usr/nec; then
6660	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6661	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6662	runpath_var=LD_RUN_PATH
6663	hardcode_runpath_var=yes
6664	_LT_TAGVAR(ld_shlibs, $1)=yes
6665      fi
6666      ;;
6667
6668    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6669      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6670      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6671      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6672      runpath_var='LD_RUN_PATH'
6673
6674      if test "$GCC" = yes; then
6675	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6676	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6677      else
6678	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6679	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6680      fi
6681      ;;
6682
6683    sysv5* | sco3.2v5* | sco5v6*)
6684      # Note: We can NOT use -z defs as we might desire, because we do not
6685      # link with -lc, and that would cause any symbols used from libc to
6686      # always be unresolved, which means just about no library would
6687      # ever link correctly.  If we're not using GNU ld we use -z text
6688      # though, which does catch some bad symbols but isn't as heavy-handed
6689      # as -z defs.
6690      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6691      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6692      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6693      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6694      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6695      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6696      _LT_TAGVAR(link_all_deplibs, $1)=yes
6697      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6698      runpath_var='LD_RUN_PATH'
6699
6700      if test "$GCC" = yes; then
6701	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6702	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6703      else
6704	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6705	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6706      fi
6707      ;;
6708
6709    uts4*)
6710      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6711      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6712      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6713      ;;
6714
6715    *)
6716      _LT_TAGVAR(ld_shlibs, $1)=no
6717      ;;
6718    esac
6719
6720    if test x$host_vendor = xsni; then
6721      case $host in
6722      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6723	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6724	;;
6725      esac
6726    fi
6727  fi
6728])
6729AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6730test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6731
6732_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6733
6734_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6735_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6736_LT_DECL([], [extract_expsyms_cmds], [2],
6737    [The commands to extract the exported symbol list from a shared archive])
6738
6739#
6740# Do we need to explicitly link libc?
6741#
6742case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6743x|xyes)
6744  # Assume -lc should be added
6745  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6746
6747  if test "$enable_shared" = yes && test "$GCC" = yes; then
6748    case $_LT_TAGVAR(archive_cmds, $1) in
6749    *'~'*)
6750      # FIXME: we may have to deal with multi-command sequences.
6751      ;;
6752    '$CC '*)
6753      # Test whether the compiler implicitly links with -lc since on some
6754      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6755      # to ld, don't add -lc before -lgcc.
6756      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6757	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6758	[$RM conftest*
6759	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6760
6761	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6762	  soname=conftest
6763	  lib=conftest
6764	  libobjs=conftest.$ac_objext
6765	  deplibs=
6766	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6767	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6768	  compiler_flags=-v
6769	  linker_flags=-v
6770	  verstring=
6771	  output_objdir=.
6772	  libname=conftest
6773	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6774	  _LT_TAGVAR(allow_undefined_flag, $1)=
6775	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6776	  then
6777	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6778	  else
6779	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6780	  fi
6781	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6782	else
6783	  cat conftest.err 1>&5
6784	fi
6785	$RM conftest*
6786	])
6787      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6788      ;;
6789    esac
6790  fi
6791  ;;
6792esac
6793
6794_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6795    [Whether or not to add -lc for building shared libraries])
6796_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6797    [enable_shared_with_static_runtimes], [0],
6798    [Whether or not to disallow shared libs when runtime libs are static])
6799_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6800    [Compiler flag to allow reflexive dlopens])
6801_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6802    [Compiler flag to generate shared objects directly from archives])
6803_LT_TAGDECL([], [compiler_needs_object], [1],
6804    [Whether the compiler copes with passing no objects directly])
6805_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6806    [Create an old-style archive from a shared archive])
6807_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6808    [Create a temporary old-style archive to link instead of a shared archive])
6809_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6810_LT_TAGDECL([], [archive_expsym_cmds], [2])
6811_LT_TAGDECL([], [module_cmds], [2],
6812    [Commands used to build a loadable module if different from building
6813    a shared archive.])
6814_LT_TAGDECL([], [module_expsym_cmds], [2])
6815_LT_TAGDECL([], [with_gnu_ld], [1],
6816    [Whether we are building with GNU ld or not])
6817_LT_TAGDECL([], [allow_undefined_flag], [1],
6818    [Flag that allows shared libraries with undefined symbols to be built])
6819_LT_TAGDECL([], [no_undefined_flag], [1],
6820    [Flag that enforces no undefined symbols])
6821_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6822    [Flag to hardcode $libdir into a binary during linking.
6823    This must work even if $libdir does not exist])
6824_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6825    [Whether we need a single "-rpath" flag with a separated argument])
6826_LT_TAGDECL([], [hardcode_direct], [0],
6827    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6828    DIR into the resulting binary])
6829_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6830    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6831    DIR into the resulting binary and the resulting library dependency is
6832    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6833    library is relocated])
6834_LT_TAGDECL([], [hardcode_minus_L], [0],
6835    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6836    into the resulting binary])
6837_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6838    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6839    into the resulting binary])
6840_LT_TAGDECL([], [hardcode_automatic], [0],
6841    [Set to "yes" if building a shared library automatically hardcodes DIR
6842    into the library and all subsequent libraries and executables linked
6843    against it])
6844_LT_TAGDECL([], [inherit_rpath], [0],
6845    [Set to yes if linker adds runtime paths of dependent libraries
6846    to runtime path list])
6847_LT_TAGDECL([], [link_all_deplibs], [0],
6848    [Whether libtool must link a program against all its dependency libraries])
6849_LT_TAGDECL([], [always_export_symbols], [0],
6850    [Set to "yes" if exported symbols are required])
6851_LT_TAGDECL([], [export_symbols_cmds], [2],
6852    [The commands to list exported symbols])
6853_LT_TAGDECL([], [exclude_expsyms], [1],
6854    [Symbols that should not be listed in the preloaded symbols])
6855_LT_TAGDECL([], [include_expsyms], [1],
6856    [Symbols that must always be exported])
6857_LT_TAGDECL([], [prelink_cmds], [2],
6858    [Commands necessary for linking programs (against libraries) with templates])
6859_LT_TAGDECL([], [postlink_cmds], [2],
6860    [Commands necessary for finishing linking programs])
6861_LT_TAGDECL([], [file_list_spec], [1],
6862    [Specify filename containing input files])
6863dnl FIXME: Not yet implemented
6864dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6865dnl    [Compiler flag to generate thread safe objects])
6866])# _LT_LINKER_SHLIBS
6867
6868
6869# _LT_LANG_C_CONFIG([TAG])
6870# ------------------------
6871# Ensure that the configuration variables for a C compiler are suitably
6872# defined.  These variables are subsequently used by _LT_CONFIG to write
6873# the compiler configuration to `libtool'.
6874m4_defun([_LT_LANG_C_CONFIG],
6875[m4_require([_LT_DECL_EGREP])dnl
6876lt_save_CC="$CC"
6877AC_LANG_PUSH(C)
6878
6879# Source file extension for C test sources.
6880ac_ext=c
6881
6882# Object file extension for compiled C test sources.
6883objext=o
6884_LT_TAGVAR(objext, $1)=$objext
6885
6886# Code to be used in simple compile tests
6887lt_simple_compile_test_code="int some_variable = 0;"
6888
6889# Code to be used in simple link tests
6890lt_simple_link_test_code='int main(){return(0);}'
6891
6892_LT_TAG_COMPILER
6893# Save the default compiler, since it gets overwritten when the other
6894# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6895compiler_DEFAULT=$CC
6896
6897# save warnings/boilerplate of simple test code
6898_LT_COMPILER_BOILERPLATE
6899_LT_LINKER_BOILERPLATE
6900
6901if test -n "$compiler"; then
6902  _LT_COMPILER_NO_RTTI($1)
6903  _LT_COMPILER_PIC($1)
6904  _LT_COMPILER_C_O($1)
6905  _LT_COMPILER_FILE_LOCKS($1)
6906  _LT_LINKER_SHLIBS($1)
6907  _LT_SYS_DYNAMIC_LINKER($1)
6908  _LT_LINKER_HARDCODE_LIBPATH($1)
6909  LT_SYS_DLOPEN_SELF
6910  _LT_CMD_STRIPLIB
6911
6912  # Report which library types will actually be built
6913  AC_MSG_CHECKING([if libtool supports shared libraries])
6914  AC_MSG_RESULT([$can_build_shared])
6915
6916  AC_MSG_CHECKING([whether to build shared libraries])
6917  test "$can_build_shared" = "no" && enable_shared=no
6918
6919  # On AIX, shared libraries and static libraries use the same namespace, and
6920  # are all built from PIC.
6921  case $host_os in
6922  aix3*)
6923    test "$enable_shared" = yes && enable_static=no
6924    if test -n "$RANLIB"; then
6925      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6926      postinstall_cmds='$RANLIB $lib'
6927    fi
6928    ;;
6929
6930  aix[[4-9]]*)
6931    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6932      test "$enable_shared" = yes && enable_static=no
6933    fi
6934    ;;
6935  esac
6936  AC_MSG_RESULT([$enable_shared])
6937
6938  AC_MSG_CHECKING([whether to build static libraries])
6939  # Make sure either enable_shared or enable_static is yes.
6940  test "$enable_shared" = yes || enable_static=yes
6941  AC_MSG_RESULT([$enable_static])
6942
6943  _LT_CONFIG($1)
6944fi
6945AC_LANG_POP
6946CC="$lt_save_CC"
6947])# _LT_LANG_C_CONFIG
6948
6949
6950# _LT_LANG_CXX_CONFIG([TAG])
6951# --------------------------
6952# Ensure that the configuration variables for a C++ compiler are suitably
6953# defined.  These variables are subsequently used by _LT_CONFIG to write
6954# the compiler configuration to `libtool'.
6955m4_defun([_LT_LANG_CXX_CONFIG],
6956[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6957m4_require([_LT_DECL_EGREP])dnl
6958m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6959if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6960    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6961    (test "X$CXX" != "Xg++"))) ; then
6962  AC_PROG_CXXCPP
6963else
6964  _lt_caught_CXX_error=yes
6965fi
6966
6967AC_LANG_PUSH(C++)
6968_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6969_LT_TAGVAR(allow_undefined_flag, $1)=
6970_LT_TAGVAR(always_export_symbols, $1)=no
6971_LT_TAGVAR(archive_expsym_cmds, $1)=
6972_LT_TAGVAR(compiler_needs_object, $1)=no
6973_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6974_LT_TAGVAR(hardcode_direct, $1)=no
6975_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6976_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6977_LT_TAGVAR(hardcode_libdir_separator, $1)=
6978_LT_TAGVAR(hardcode_minus_L, $1)=no
6979_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6980_LT_TAGVAR(hardcode_automatic, $1)=no
6981_LT_TAGVAR(inherit_rpath, $1)=no
6982_LT_TAGVAR(module_cmds, $1)=
6983_LT_TAGVAR(module_expsym_cmds, $1)=
6984_LT_TAGVAR(link_all_deplibs, $1)=unknown
6985_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6986_LT_TAGVAR(reload_flag, $1)=$reload_flag
6987_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6988_LT_TAGVAR(no_undefined_flag, $1)=
6989_LT_TAGVAR(whole_archive_flag_spec, $1)=
6990_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6991
6992# Source file extension for C++ test sources.
6993ac_ext=cpp
6994
6995# Object file extension for compiled C++ test sources.
6996objext=o
6997_LT_TAGVAR(objext, $1)=$objext
6998
6999# No sense in running all these tests if we already determined that
7000# the CXX compiler isn't working.  Some variables (like enable_shared)
7001# are currently assumed to apply to all compilers on this platform,
7002# and will be corrupted by setting them based on a non-working compiler.
7003if test "$_lt_caught_CXX_error" != yes; then
7004  # Code to be used in simple compile tests
7005  lt_simple_compile_test_code="int some_variable = 0;"
7006
7007  # Code to be used in simple link tests
7008  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
7009
7010  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7011  _LT_TAG_COMPILER
7012
7013  # save warnings/boilerplate of simple test code
7014  _LT_COMPILER_BOILERPLATE
7015  _LT_LINKER_BOILERPLATE
7016
7017  # Allow CC to be a program name with arguments.
7018  lt_save_CC=$CC
7019  lt_save_CFLAGS=$CFLAGS
7020  lt_save_LD=$LD
7021  lt_save_GCC=$GCC
7022  GCC=$GXX
7023  lt_save_with_gnu_ld=$with_gnu_ld
7024  lt_save_path_LD=$lt_cv_path_LD
7025  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
7026    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
7027  else
7028    $as_unset lt_cv_prog_gnu_ld
7029  fi
7030  if test -n "${lt_cv_path_LDCXX+set}"; then
7031    lt_cv_path_LD=$lt_cv_path_LDCXX
7032  else
7033    $as_unset lt_cv_path_LD
7034  fi
7035  test -z "${LDCXX+set}" || LD=$LDCXX
7036  CC=${CXX-"c++"}
7037  CFLAGS=$CXXFLAGS
7038  compiler=$CC
7039  _LT_TAGVAR(compiler, $1)=$CC
7040  _LT_CC_BASENAME([$compiler])
7041
7042  if test -n "$compiler"; then
7043    # We don't want -fno-exception when compiling C++ code, so set the
7044    # no_builtin_flag separately
7045    if test "$GXX" = yes; then
7046      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7047    else
7048      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7049    fi
7050
7051    if test "$GXX" = yes; then
7052      # Set up default GNU C++ configuration
7053
7054      LT_PATH_LD
7055
7056      # Check if GNU C++ uses GNU ld as the underlying linker, since the
7057      # archiving commands below assume that GNU ld is being used.
7058      if test "$with_gnu_ld" = yes; then
7059        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7060        _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'
7061
7062        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7063        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7064
7065        # If archive_cmds runs LD, not CC, wlarc should be empty
7066        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
7067        #     investigate it a little bit more. (MM)
7068        wlarc='${wl}'
7069
7070        # ancient GNU ld didn't support --whole-archive et. al.
7071        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
7072	  $GREP 'no-whole-archive' > /dev/null; then
7073          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7074        else
7075          _LT_TAGVAR(whole_archive_flag_spec, $1)=
7076        fi
7077      else
7078        with_gnu_ld=no
7079        wlarc=
7080
7081        # A generic and very simple default shared library creation
7082        # command for GNU C++ for the case where it uses the native
7083        # linker, instead of GNU ld.  If possible, this setting should
7084        # overridden to take advantage of the native linker features on
7085        # the platform it is being used on.
7086        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7087      fi
7088
7089      # Commands to make compiler produce verbose output that lists
7090      # what "hidden" libraries, object files and flags are used when
7091      # linking a shared library.
7092      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7093
7094    else
7095      GXX=no
7096      with_gnu_ld=no
7097      wlarc=
7098    fi
7099
7100    # PORTME: fill in a description of your system's C++ link characteristics
7101    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7102    _LT_TAGVAR(ld_shlibs, $1)=yes
7103    case $host_os in
7104      aix3*)
7105        # FIXME: insert proper C++ library support
7106        _LT_TAGVAR(ld_shlibs, $1)=no
7107        ;;
7108      aix[[4-9]]*)
7109        if test "$host_cpu" = ia64; then
7110          # On IA64, the linker does run time linking by default, so we don't
7111          # have to do anything special.
7112          aix_use_runtimelinking=no
7113          exp_sym_flag='-Bexport'
7114          no_entry_flag=""
7115        else
7116          aix_use_runtimelinking=no
7117
7118          # Test if we are trying to use run time linking or normal
7119          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7120          # need to do runtime linking.
7121          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7122	    for ld_flag in $LDFLAGS; do
7123	      case $ld_flag in
7124	      *-brtl*)
7125	        aix_use_runtimelinking=yes
7126	        break
7127	        ;;
7128	      esac
7129	    done
7130	    ;;
7131          esac
7132
7133          exp_sym_flag='-bexport'
7134          no_entry_flag='-bnoentry'
7135        fi
7136
7137        # When large executables or shared objects are built, AIX ld can
7138        # have problems creating the table of contents.  If linking a library
7139        # or program results in "error TOC overflow" add -mminimal-toc to
7140        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7141        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7142
7143        _LT_TAGVAR(archive_cmds, $1)=''
7144        _LT_TAGVAR(hardcode_direct, $1)=yes
7145        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7146        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7147        _LT_TAGVAR(link_all_deplibs, $1)=yes
7148        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7149
7150        if test "$GXX" = yes; then
7151          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7152          # We only want to do this on AIX 4.2 and lower, the check
7153          # below for broken collect2 doesn't work under 4.3+
7154	  collect2name=`${CC} -print-prog-name=collect2`
7155	  if test -f "$collect2name" &&
7156	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7157	  then
7158	    # We have reworked collect2
7159	    :
7160	  else
7161	    # We have old collect2
7162	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7163	    # It fails to find uninstalled libraries when the uninstalled
7164	    # path is not listed in the libpath.  Setting hardcode_minus_L
7165	    # to unsupported forces relinking
7166	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7167	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7168	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7169	  fi
7170          esac
7171          shared_flag='-shared'
7172	  if test "$aix_use_runtimelinking" = yes; then
7173	    shared_flag="$shared_flag "'${wl}-G'
7174	  fi
7175        else
7176          # not using gcc
7177          if test "$host_cpu" = ia64; then
7178	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7179	  # chokes on -Wl,-G. The following line is correct:
7180	  shared_flag='-G'
7181          else
7182	    if test "$aix_use_runtimelinking" = yes; then
7183	      shared_flag='${wl}-G'
7184	    else
7185	      shared_flag='${wl}-bM:SRE'
7186	    fi
7187          fi
7188        fi
7189
7190        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7191        # It seems that -bexpall does not export symbols beginning with
7192        # underscore (_), so it is better to generate a list of symbols to
7193	# export.
7194        _LT_TAGVAR(always_export_symbols, $1)=yes
7195        if test "$aix_use_runtimelinking" = yes; then
7196          # Warning - without using the other runtime loading flags (-brtl),
7197          # -berok will link without error, but may produce a broken library.
7198          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7199          # Determine the default libpath from the value encoded in an empty
7200          # executable.
7201          _LT_SYS_MODULE_PATH_AIX([$1])
7202          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7203
7204          _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"
7205        else
7206          if test "$host_cpu" = ia64; then
7207	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7208	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7209	    _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"
7210          else
7211	    # Determine the default libpath from the value encoded in an
7212	    # empty executable.
7213	    _LT_SYS_MODULE_PATH_AIX([$1])
7214	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7215	    # Warning - without using the other run time loading flags,
7216	    # -berok will link without error, but may produce a broken library.
7217	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7218	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7219	    if test "$with_gnu_ld" = yes; then
7220	      # We only use this code for GNU lds that support --whole-archive.
7221	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7222	    else
7223	      # Exported symbols can be pulled into shared objects from archives
7224	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7225	    fi
7226	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7227	    # This is similar to how AIX traditionally builds its shared
7228	    # libraries.
7229	    _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'
7230          fi
7231        fi
7232        ;;
7233
7234      beos*)
7235	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7236	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7237	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7238	  # support --undefined.  This deserves some investigation.  FIXME
7239	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7240	else
7241	  _LT_TAGVAR(ld_shlibs, $1)=no
7242	fi
7243	;;
7244
7245      chorus*)
7246        case $cc_basename in
7247          *)
7248	  # FIXME: insert proper C++ library support
7249	  _LT_TAGVAR(ld_shlibs, $1)=no
7250	  ;;
7251        esac
7252        ;;
7253
7254      cygwin* | mingw* | pw32* | cegcc*)
7255	case $GXX,$cc_basename in
7256	,cl* | no,cl*)
7257	  # Native MSVC
7258	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7259	  # no search path for DLLs.
7260	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7261	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7262	  _LT_TAGVAR(always_export_symbols, $1)=yes
7263	  _LT_TAGVAR(file_list_spec, $1)='@'
7264	  # Tell ltmain to make .lib files, not .a files.
7265	  libext=lib
7266	  # Tell ltmain to make .dll files, not .so files.
7267	  shrext_cmds=".dll"
7268	  # FIXME: Setting linknames here is a bad hack.
7269	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7270	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7271	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7272	    else
7273	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7274	    fi~
7275	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7276	    linknames='
7277	  # The linker will not automatically build a static lib if we build a DLL.
7278	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7279	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7280	  # Don't use ranlib
7281	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7282	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7283	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7284	    case $lt_outputfile in
7285	      *.exe|*.EXE) ;;
7286	      *)
7287		lt_outputfile="$lt_outputfile.exe"
7288		lt_tool_outputfile="$lt_tool_outputfile.exe"
7289		;;
7290	    esac~
7291	    func_to_tool_file "$lt_outputfile"~
7292	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7293	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7294	      $RM "$lt_outputfile.manifest";
7295	    fi'
7296	  ;;
7297	*)
7298	  # g++
7299	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7300	  # as there is no search path for DLLs.
7301	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7302	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7303	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7304	  _LT_TAGVAR(always_export_symbols, $1)=no
7305	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7306
7307	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7308	    _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'
7309	    # If the export-symbols file already is a .def file (1st line
7310	    # is EXPORTS), use it as is; otherwise, prepend...
7311	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7312	      cp $export_symbols $output_objdir/$soname.def;
7313	    else
7314	      echo EXPORTS > $output_objdir/$soname.def;
7315	      cat $export_symbols >> $output_objdir/$soname.def;
7316	    fi~
7317	    $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'
7318	  else
7319	    _LT_TAGVAR(ld_shlibs, $1)=no
7320	  fi
7321	  ;;
7322	esac
7323	;;
7324      darwin* | rhapsody*)
7325        _LT_DARWIN_LINKER_FEATURES($1)
7326	;;
7327
7328      dgux*)
7329        case $cc_basename in
7330          ec++*)
7331	    # FIXME: insert proper C++ library support
7332	    _LT_TAGVAR(ld_shlibs, $1)=no
7333	    ;;
7334          ghcx*)
7335	    # Green Hills C++ Compiler
7336	    # FIXME: insert proper C++ library support
7337	    _LT_TAGVAR(ld_shlibs, $1)=no
7338	    ;;
7339          *)
7340	    # FIXME: insert proper C++ library support
7341	    _LT_TAGVAR(ld_shlibs, $1)=no
7342	    ;;
7343        esac
7344        ;;
7345
7346      freebsd2.*)
7347        # C++ shared libraries reported to be fairly broken before
7348	# switch to ELF
7349        _LT_TAGVAR(ld_shlibs, $1)=no
7350        ;;
7351
7352      freebsd-elf*)
7353        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7354        ;;
7355
7356      freebsd* | dragonfly*)
7357        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7358        # conventions
7359        _LT_TAGVAR(ld_shlibs, $1)=yes
7360        ;;
7361
7362      gnu*)
7363        ;;
7364
7365      haiku*)
7366        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7367        _LT_TAGVAR(link_all_deplibs, $1)=yes
7368        ;;
7369
7370      hpux9*)
7371        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7372        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7373        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7374        _LT_TAGVAR(hardcode_direct, $1)=yes
7375        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7376				             # but as the default
7377				             # location of the library.
7378
7379        case $cc_basename in
7380          CC*)
7381            # FIXME: insert proper C++ library support
7382            _LT_TAGVAR(ld_shlibs, $1)=no
7383            ;;
7384          aCC*)
7385            _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'
7386            # Commands to make compiler produce verbose output that lists
7387            # what "hidden" libraries, object files and flags are used when
7388            # linking a shared library.
7389            #
7390            # There doesn't appear to be a way to prevent this compiler from
7391            # explicitly linking system object files so we need to strip them
7392            # from the output so that they don't get included in the library
7393            # dependencies.
7394            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"'
7395            ;;
7396          *)
7397            if test "$GXX" = yes; then
7398              _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'
7399            else
7400              # FIXME: insert proper C++ library support
7401              _LT_TAGVAR(ld_shlibs, $1)=no
7402            fi
7403            ;;
7404        esac
7405        ;;
7406
7407      hpux10*|hpux11*)
7408        if test $with_gnu_ld = no; then
7409	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7410	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7411
7412          case $host_cpu in
7413            hppa*64*|ia64*)
7414              ;;
7415            *)
7416	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7417              ;;
7418          esac
7419        fi
7420        case $host_cpu in
7421          hppa*64*|ia64*)
7422            _LT_TAGVAR(hardcode_direct, $1)=no
7423            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7424            ;;
7425          *)
7426            _LT_TAGVAR(hardcode_direct, $1)=yes
7427            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7428            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7429					         # but as the default
7430					         # location of the library.
7431            ;;
7432        esac
7433
7434        case $cc_basename in
7435          CC*)
7436	    # FIXME: insert proper C++ library support
7437	    _LT_TAGVAR(ld_shlibs, $1)=no
7438	    ;;
7439          aCC*)
7440	    case $host_cpu in
7441	      hppa*64*)
7442	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7443	        ;;
7444	      ia64*)
7445	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7446	        ;;
7447	      *)
7448	        _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'
7449	        ;;
7450	    esac
7451	    # Commands to make compiler produce verbose output that lists
7452	    # what "hidden" libraries, object files and flags are used when
7453	    # linking a shared library.
7454	    #
7455	    # There doesn't appear to be a way to prevent this compiler from
7456	    # explicitly linking system object files so we need to strip them
7457	    # from the output so that they don't get included in the library
7458	    # dependencies.
7459	    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"'
7460	    ;;
7461          *)
7462	    if test "$GXX" = yes; then
7463	      if test $with_gnu_ld = no; then
7464	        case $host_cpu in
7465	          hppa*64*)
7466	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7467	            ;;
7468	          ia64*)
7469	            _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'
7470	            ;;
7471	          *)
7472	            _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'
7473	            ;;
7474	        esac
7475	      fi
7476	    else
7477	      # FIXME: insert proper C++ library support
7478	      _LT_TAGVAR(ld_shlibs, $1)=no
7479	    fi
7480	    ;;
7481        esac
7482        ;;
7483
7484      interix[[3-9]]*)
7485	_LT_TAGVAR(hardcode_direct, $1)=no
7486	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7487	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7488	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7489	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7490	# Instead, shared libraries are loaded at an image base (0x10000000 by
7491	# default) and relocated if they conflict, which is a slow very memory
7492	# consuming and fragmenting process.  To avoid this, we pick a random,
7493	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7494	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7495	_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'
7496	_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'
7497	;;
7498      irix5* | irix6*)
7499        case $cc_basename in
7500          CC*)
7501	    # SGI C++
7502	    _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'
7503
7504	    # Archives containing C++ object files must be created using
7505	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7506	    # necessary to make sure instantiated templates are included
7507	    # in the archive.
7508	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7509	    ;;
7510          *)
7511	    if test "$GXX" = yes; then
7512	      if test "$with_gnu_ld" = no; then
7513	        _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'
7514	      else
7515	        _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'
7516	      fi
7517	    fi
7518	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7519	    ;;
7520        esac
7521        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7522        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7523        _LT_TAGVAR(inherit_rpath, $1)=yes
7524        ;;
7525
7526      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7527        case $cc_basename in
7528          KCC*)
7529	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7530
7531	    # KCC will only create a shared library if the output file
7532	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7533	    # to its proper name (with version) after linking.
7534	    _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'
7535	    _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'
7536	    # Commands to make compiler produce verbose output that lists
7537	    # what "hidden" libraries, object files and flags are used when
7538	    # linking a shared library.
7539	    #
7540	    # There doesn't appear to be a way to prevent this compiler from
7541	    # explicitly linking system object files so we need to strip them
7542	    # from the output so that they don't get included in the library
7543	    # dependencies.
7544	    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"'
7545
7546	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7547	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7548
7549	    # Archives containing C++ object files must be created using
7550	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7551	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7552	    ;;
7553	  icpc* | ecpc* )
7554	    # Intel C++
7555	    with_gnu_ld=yes
7556	    # version 8.0 and above of icpc choke on multiply defined symbols
7557	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7558	    # earlier do not add the objects themselves.
7559	    case `$CC -V 2>&1` in
7560	      *"Version 7."*)
7561	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7562		_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'
7563		;;
7564	      *)  # Version 8.0 or newer
7565	        tmp_idyn=
7566	        case $host_cpu in
7567		  ia64*) tmp_idyn=' -i_dynamic';;
7568		esac
7569	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7570		_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'
7571		;;
7572	    esac
7573	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7574	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7575	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7576	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7577	    ;;
7578          pgCC* | pgcpp*)
7579            # Portland Group C++ compiler
7580	    case `$CC -V` in
7581	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7582	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7583		rm -rf $tpldir~
7584		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7585		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7586	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7587		rm -rf $tpldir~
7588		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7589		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7590		$RANLIB $oldlib'
7591	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7592		rm -rf $tpldir~
7593		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7594		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7595	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7596		rm -rf $tpldir~
7597		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7598		$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'
7599	      ;;
7600	    *) # Version 6 and above use weak symbols
7601	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7602	      _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'
7603	      ;;
7604	    esac
7605
7606	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7607	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7608	    _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'
7609            ;;
7610	  cxx*)
7611	    # Compaq C++
7612	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7613	    _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'
7614
7615	    runpath_var=LD_RUN_PATH
7616	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7617	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7618
7619	    # Commands to make compiler produce verbose output that lists
7620	    # what "hidden" libraries, object files and flags are used when
7621	    # linking a shared library.
7622	    #
7623	    # There doesn't appear to be a way to prevent this compiler from
7624	    # explicitly linking system object files so we need to strip them
7625	    # from the output so that they don't get included in the library
7626	    # dependencies.
7627	    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'
7628	    ;;
7629	  xl* | mpixl* | bgxl*)
7630	    # IBM XL 8.0 on PPC, with GNU ld
7631	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7632	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7633	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7634	    if test "x$supports_anon_versioning" = xyes; then
7635	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7636		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7637		echo "local: *; };" >> $output_objdir/$libname.ver~
7638		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7639	    fi
7640	    ;;
7641	  *)
7642	    case `$CC -V 2>&1 | sed 5q` in
7643	    *Sun\ C*)
7644	      # Sun C++ 5.9
7645	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7646	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7647	      _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'
7648	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7649	      _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'
7650	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7651
7652	      # Not sure whether something based on
7653	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7654	      # would be better.
7655	      output_verbose_link_cmd='func_echo_all'
7656
7657	      # Archives containing C++ object files must be created using
7658	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7659	      # necessary to make sure instantiated templates are included
7660	      # in the archive.
7661	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7662	      ;;
7663	    esac
7664	    ;;
7665	esac
7666	;;
7667
7668      lynxos*)
7669        # FIXME: insert proper C++ library support
7670	_LT_TAGVAR(ld_shlibs, $1)=no
7671	;;
7672
7673      m88k*)
7674        # FIXME: insert proper C++ library support
7675        _LT_TAGVAR(ld_shlibs, $1)=no
7676	;;
7677
7678      mvs*)
7679        case $cc_basename in
7680          cxx*)
7681	    # FIXME: insert proper C++ library support
7682	    _LT_TAGVAR(ld_shlibs, $1)=no
7683	    ;;
7684	  *)
7685	    # FIXME: insert proper C++ library support
7686	    _LT_TAGVAR(ld_shlibs, $1)=no
7687	    ;;
7688	esac
7689	;;
7690
7691      netbsd*)
7692        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7693	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7694	  wlarc=
7695	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7696	  _LT_TAGVAR(hardcode_direct, $1)=yes
7697	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7698	fi
7699	# Workaround some broken pre-1.5 toolchains
7700	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7701	;;
7702
7703      *nto* | *qnx*)
7704        _LT_TAGVAR(ld_shlibs, $1)=yes
7705	;;
7706
7707      openbsd2*)
7708        # C++ shared libraries are fairly broken
7709	_LT_TAGVAR(ld_shlibs, $1)=no
7710	;;
7711
7712      openbsd*)
7713	if test -f /usr/libexec/ld.so; then
7714	  _LT_TAGVAR(hardcode_direct, $1)=yes
7715	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7716	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7717	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7718	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7719	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7720	    _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'
7721	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7722	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7723	  fi
7724	  output_verbose_link_cmd=func_echo_all
7725	else
7726	  _LT_TAGVAR(ld_shlibs, $1)=no
7727	fi
7728	;;
7729
7730      osf3* | osf4* | osf5*)
7731        case $cc_basename in
7732          KCC*)
7733	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7734
7735	    # KCC will only create a shared library if the output file
7736	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7737	    # to its proper name (with version) after linking.
7738	    _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'
7739
7740	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7741	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7742
7743	    # Archives containing C++ object files must be created using
7744	    # the KAI C++ compiler.
7745	    case $host in
7746	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7747	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7748	    esac
7749	    ;;
7750          RCC*)
7751	    # Rational C++ 2.4.1
7752	    # FIXME: insert proper C++ library support
7753	    _LT_TAGVAR(ld_shlibs, $1)=no
7754	    ;;
7755          cxx*)
7756	    case $host in
7757	      osf3*)
7758	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7759	        _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'
7760	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7761		;;
7762	      *)
7763	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7764	        _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'
7765	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7766	          echo "-hidden">> $lib.exp~
7767	          $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~
7768	          $RM $lib.exp'
7769	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7770		;;
7771	    esac
7772
7773	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7774
7775	    # Commands to make compiler produce verbose output that lists
7776	    # what "hidden" libraries, object files and flags are used when
7777	    # linking a shared library.
7778	    #
7779	    # There doesn't appear to be a way to prevent this compiler from
7780	    # explicitly linking system object files so we need to strip them
7781	    # from the output so that they don't get included in the library
7782	    # dependencies.
7783	    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"'
7784	    ;;
7785	  *)
7786	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7787	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7788	      case $host in
7789	        osf3*)
7790	          _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'
7791		  ;;
7792	        *)
7793	          _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'
7794		  ;;
7795	      esac
7796
7797	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7798	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7799
7800	      # Commands to make compiler produce verbose output that lists
7801	      # what "hidden" libraries, object files and flags are used when
7802	      # linking a shared library.
7803	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7804
7805	    else
7806	      # FIXME: insert proper C++ library support
7807	      _LT_TAGVAR(ld_shlibs, $1)=no
7808	    fi
7809	    ;;
7810        esac
7811        ;;
7812
7813      psos*)
7814        # FIXME: insert proper C++ library support
7815        _LT_TAGVAR(ld_shlibs, $1)=no
7816        ;;
7817
7818      sunos4*)
7819        case $cc_basename in
7820          CC*)
7821	    # Sun C++ 4.x
7822	    # FIXME: insert proper C++ library support
7823	    _LT_TAGVAR(ld_shlibs, $1)=no
7824	    ;;
7825          lcc*)
7826	    # Lucid
7827	    # FIXME: insert proper C++ library support
7828	    _LT_TAGVAR(ld_shlibs, $1)=no
7829	    ;;
7830          *)
7831	    # FIXME: insert proper C++ library support
7832	    _LT_TAGVAR(ld_shlibs, $1)=no
7833	    ;;
7834        esac
7835        ;;
7836
7837      solaris*)
7838        case $cc_basename in
7839          CC* | sunCC*)
7840	    # Sun C++ 4.2, 5.x and Centerline C++
7841            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7842	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7843	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7844	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7845	      $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'
7846
7847	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7848	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7849	    case $host_os in
7850	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7851	      *)
7852		# The compiler driver will combine and reorder linker options,
7853		# but understands `-z linker_flag'.
7854	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7855		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7856	        ;;
7857	    esac
7858	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7859
7860	    output_verbose_link_cmd='func_echo_all'
7861
7862	    # Archives containing C++ object files must be created using
7863	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7864	    # necessary to make sure instantiated templates are included
7865	    # in the archive.
7866	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7867	    ;;
7868          gcx*)
7869	    # Green Hills C++ Compiler
7870	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7871
7872	    # The C++ compiler must be used to create the archive.
7873	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7874	    ;;
7875          *)
7876	    # GNU C++ compiler with Solaris linker
7877	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7878	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7879	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7880	        _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'
7881	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7882		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7883
7884	        # Commands to make compiler produce verbose output that lists
7885	        # what "hidden" libraries, object files and flags are used when
7886	        # linking a shared library.
7887	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7888	      else
7889	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7890	        # platform.
7891	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7892	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7893		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7894
7895	        # Commands to make compiler produce verbose output that lists
7896	        # what "hidden" libraries, object files and flags are used when
7897	        # linking a shared library.
7898	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7899	      fi
7900
7901	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7902	      case $host_os in
7903		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7904		*)
7905		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7906		  ;;
7907	      esac
7908	    fi
7909	    ;;
7910        esac
7911        ;;
7912
7913    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7914      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7915      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7916      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7917      runpath_var='LD_RUN_PATH'
7918
7919      case $cc_basename in
7920        CC*)
7921	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7922	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7923	  ;;
7924	*)
7925	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7926	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7927	  ;;
7928      esac
7929      ;;
7930
7931      sysv5* | sco3.2v5* | sco5v6*)
7932	# Note: We can NOT use -z defs as we might desire, because we do not
7933	# link with -lc, and that would cause any symbols used from libc to
7934	# always be unresolved, which means just about no library would
7935	# ever link correctly.  If we're not using GNU ld we use -z text
7936	# though, which does catch some bad symbols but isn't as heavy-handed
7937	# as -z defs.
7938	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7939	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7940	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7941	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7942	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7943	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7944	_LT_TAGVAR(link_all_deplibs, $1)=yes
7945	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7946	runpath_var='LD_RUN_PATH'
7947
7948	case $cc_basename in
7949          CC*)
7950	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7951	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7952	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7953	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7954	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7955	      '"$_LT_TAGVAR(reload_cmds, $1)"
7956	    ;;
7957	  *)
7958	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7959	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7960	    ;;
7961	esac
7962      ;;
7963
7964      tandem*)
7965        case $cc_basename in
7966          NCC*)
7967	    # NonStop-UX NCC 3.20
7968	    # FIXME: insert proper C++ library support
7969	    _LT_TAGVAR(ld_shlibs, $1)=no
7970	    ;;
7971          *)
7972	    # FIXME: insert proper C++ library support
7973	    _LT_TAGVAR(ld_shlibs, $1)=no
7974	    ;;
7975        esac
7976        ;;
7977
7978      vxworks*)
7979        # FIXME: insert proper C++ library support
7980        _LT_TAGVAR(ld_shlibs, $1)=no
7981        ;;
7982
7983      *)
7984        # FIXME: insert proper C++ library support
7985        _LT_TAGVAR(ld_shlibs, $1)=no
7986        ;;
7987    esac
7988
7989    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7990    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7991
7992    _LT_TAGVAR(GCC, $1)="$GXX"
7993    _LT_TAGVAR(LD, $1)="$LD"
7994
7995    ## CAVEAT EMPTOR:
7996    ## There is no encapsulation within the following macros, do not change
7997    ## the running order or otherwise move them around unless you know exactly
7998    ## what you are doing...
7999    _LT_SYS_HIDDEN_LIBDEPS($1)
8000    _LT_COMPILER_PIC($1)
8001    _LT_COMPILER_C_O($1)
8002    _LT_COMPILER_FILE_LOCKS($1)
8003    _LT_LINKER_SHLIBS($1)
8004    _LT_SYS_DYNAMIC_LINKER($1)
8005    _LT_LINKER_HARDCODE_LIBPATH($1)
8006
8007    _LT_CONFIG($1)
8008  fi # test -n "$compiler"
8009
8010  CC=$lt_save_CC
8011  CFLAGS=$lt_save_CFLAGS
8012  LDCXX=$LD
8013  LD=$lt_save_LD
8014  GCC=$lt_save_GCC
8015  with_gnu_ld=$lt_save_with_gnu_ld
8016  lt_cv_path_LDCXX=$lt_cv_path_LD
8017  lt_cv_path_LD=$lt_save_path_LD
8018  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
8019  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
8020fi # test "$_lt_caught_CXX_error" != yes
8021
8022AC_LANG_POP
8023])# _LT_LANG_CXX_CONFIG
8024
8025
8026# _LT_FUNC_STRIPNAME_CNF
8027# ----------------------
8028# func_stripname_cnf prefix suffix name
8029# strip PREFIX and SUFFIX off of NAME.
8030# PREFIX and SUFFIX must not contain globbing or regex special
8031# characters, hashes, percent signs, but SUFFIX may contain a leading
8032# dot (in which case that matches only a dot).
8033#
8034# This function is identical to the (non-XSI) version of func_stripname,
8035# except this one can be used by m4 code that may be executed by configure,
8036# rather than the libtool script.
8037m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
8038AC_REQUIRE([_LT_DECL_SED])
8039AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
8040func_stripname_cnf ()
8041{
8042  case ${2} in
8043  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
8044  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
8045  esac
8046} # func_stripname_cnf
8047])# _LT_FUNC_STRIPNAME_CNF
8048
8049# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
8050# ---------------------------------
8051# Figure out "hidden" library dependencies from verbose
8052# compiler output when linking a shared library.
8053# Parse the compiler output and extract the necessary
8054# objects, libraries and library flags.
8055m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
8056[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
8057AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
8058# Dependencies to place before and after the object being linked:
8059_LT_TAGVAR(predep_objects, $1)=
8060_LT_TAGVAR(postdep_objects, $1)=
8061_LT_TAGVAR(predeps, $1)=
8062_LT_TAGVAR(postdeps, $1)=
8063_LT_TAGVAR(compiler_lib_search_path, $1)=
8064
8065dnl we can't use the lt_simple_compile_test_code here,
8066dnl because it contains code intended for an executable,
8067dnl not a library.  It's possible we should let each
8068dnl tag define a new lt_????_link_test_code variable,
8069dnl but it's only used here...
8070m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
8071int a;
8072void foo (void) { a = 0; }
8073_LT_EOF
8074], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
8075class Foo
8076{
8077public:
8078  Foo (void) { a = 0; }
8079private:
8080  int a;
8081};
8082_LT_EOF
8083], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
8084      subroutine foo
8085      implicit none
8086      integer*4 a
8087      a=0
8088      return
8089      end
8090_LT_EOF
8091], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
8092      subroutine foo
8093      implicit none
8094      integer a
8095      a=0
8096      return
8097      end
8098_LT_EOF
8099], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
8100public class foo {
8101  private int a;
8102  public void bar (void) {
8103    a = 0;
8104  }
8105};
8106_LT_EOF
8107], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
8108package foo
8109func foo() {
8110}
8111_LT_EOF
8112])
8113
8114_lt_libdeps_save_CFLAGS=$CFLAGS
8115case "$CC $CFLAGS " in #(
8116*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8117*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8118*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8119esac
8120
8121dnl Parse the compiler output and extract the necessary
8122dnl objects, libraries and library flags.
8123if AC_TRY_EVAL(ac_compile); then
8124  # Parse the compiler output and extract the necessary
8125  # objects, libraries and library flags.
8126
8127  # Sentinel used to keep track of whether or not we are before
8128  # the conftest object file.
8129  pre_test_object_deps_done=no
8130
8131  for p in `eval "$output_verbose_link_cmd"`; do
8132    case ${prev}${p} in
8133
8134    -L* | -R* | -l*)
8135       # Some compilers place space between "-{L,R}" and the path.
8136       # Remove the space.
8137       if test $p = "-L" ||
8138          test $p = "-R"; then
8139	 prev=$p
8140	 continue
8141       fi
8142
8143       # Expand the sysroot to ease extracting the directories later.
8144       if test -z "$prev"; then
8145         case $p in
8146         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8147         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8148         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8149         esac
8150       fi
8151       case $p in
8152       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8153       esac
8154       if test "$pre_test_object_deps_done" = no; then
8155	 case ${prev} in
8156	 -L | -R)
8157	   # Internal compiler library paths should come after those
8158	   # provided the user.  The postdeps already come after the
8159	   # user supplied libs so there is no need to process them.
8160	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8161	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8162	   else
8163	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8164	   fi
8165	   ;;
8166	 # The "-l" case would never come before the object being
8167	 # linked, so don't bother handling this case.
8168	 esac
8169       else
8170	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8171	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8172	 else
8173	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8174	 fi
8175       fi
8176       prev=
8177       ;;
8178
8179    *.lto.$objext) ;; # Ignore GCC LTO objects
8180    *.$objext)
8181       # This assumes that the test object file only shows up
8182       # once in the compiler output.
8183       if test "$p" = "conftest.$objext"; then
8184	 pre_test_object_deps_done=yes
8185	 continue
8186       fi
8187
8188       if test "$pre_test_object_deps_done" = no; then
8189	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8190	   _LT_TAGVAR(predep_objects, $1)="$p"
8191	 else
8192	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8193	 fi
8194       else
8195	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8196	   _LT_TAGVAR(postdep_objects, $1)="$p"
8197	 else
8198	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8199	 fi
8200       fi
8201       ;;
8202
8203    *) ;; # Ignore the rest.
8204
8205    esac
8206  done
8207
8208  # Clean up.
8209  rm -f a.out a.exe
8210else
8211  echo "libtool.m4: error: problem compiling $1 test program"
8212fi
8213
8214$RM -f confest.$objext
8215CFLAGS=$_lt_libdeps_save_CFLAGS
8216
8217# PORTME: override above test on systems where it is broken
8218m4_if([$1], [CXX],
8219[case $host_os in
8220interix[[3-9]]*)
8221  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8222  # hack all around it, let's just trust "g++" to DTRT.
8223  _LT_TAGVAR(predep_objects,$1)=
8224  _LT_TAGVAR(postdep_objects,$1)=
8225  _LT_TAGVAR(postdeps,$1)=
8226  ;;
8227
8228linux*)
8229  case `$CC -V 2>&1 | sed 5q` in
8230  *Sun\ C*)
8231    # Sun C++ 5.9
8232
8233    # The more standards-conforming stlport4 library is
8234    # incompatible with the Cstd library. Avoid specifying
8235    # it if it's in CXXFLAGS. Ignore libCrun as
8236    # -library=stlport4 depends on it.
8237    case " $CXX $CXXFLAGS " in
8238    *" -library=stlport4 "*)
8239      solaris_use_stlport4=yes
8240      ;;
8241    esac
8242
8243    if test "$solaris_use_stlport4" != yes; then
8244      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8245    fi
8246    ;;
8247  esac
8248  ;;
8249
8250solaris*)
8251  case $cc_basename in
8252  CC* | sunCC*)
8253    # The more standards-conforming stlport4 library is
8254    # incompatible with the Cstd library. Avoid specifying
8255    # it if it's in CXXFLAGS. Ignore libCrun as
8256    # -library=stlport4 depends on it.
8257    case " $CXX $CXXFLAGS " in
8258    *" -library=stlport4 "*)
8259      solaris_use_stlport4=yes
8260      ;;
8261    esac
8262
8263    # Adding this requires a known-good setup of shared libraries for
8264    # Sun compiler versions before 5.6, else PIC objects from an old
8265    # archive will be linked into the output, leading to subtle bugs.
8266    if test "$solaris_use_stlport4" != yes; then
8267      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8268    fi
8269    ;;
8270  esac
8271  ;;
8272esac
8273])
8274
8275case " $_LT_TAGVAR(postdeps, $1) " in
8276*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8277esac
8278 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8279if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8280 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8281fi
8282_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8283    [The directories searched by this compiler when creating a shared library])
8284_LT_TAGDECL([], [predep_objects], [1],
8285    [Dependencies to place before and after the objects being linked to
8286    create a shared library])
8287_LT_TAGDECL([], [postdep_objects], [1])
8288_LT_TAGDECL([], [predeps], [1])
8289_LT_TAGDECL([], [postdeps], [1])
8290_LT_TAGDECL([], [compiler_lib_search_path], [1],
8291    [The library search path used internally by the compiler when linking
8292    a shared library])
8293])# _LT_SYS_HIDDEN_LIBDEPS
8294
8295
8296# _LT_LANG_F77_CONFIG([TAG])
8297# --------------------------
8298# Ensure that the configuration variables for a Fortran 77 compiler are
8299# suitably defined.  These variables are subsequently used by _LT_CONFIG
8300# to write the compiler configuration to `libtool'.
8301m4_defun([_LT_LANG_F77_CONFIG],
8302[AC_LANG_PUSH(Fortran 77)
8303if test -z "$F77" || test "X$F77" = "Xno"; then
8304  _lt_disable_F77=yes
8305fi
8306
8307_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8308_LT_TAGVAR(allow_undefined_flag, $1)=
8309_LT_TAGVAR(always_export_symbols, $1)=no
8310_LT_TAGVAR(archive_expsym_cmds, $1)=
8311_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8312_LT_TAGVAR(hardcode_direct, $1)=no
8313_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8314_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8315_LT_TAGVAR(hardcode_libdir_separator, $1)=
8316_LT_TAGVAR(hardcode_minus_L, $1)=no
8317_LT_TAGVAR(hardcode_automatic, $1)=no
8318_LT_TAGVAR(inherit_rpath, $1)=no
8319_LT_TAGVAR(module_cmds, $1)=
8320_LT_TAGVAR(module_expsym_cmds, $1)=
8321_LT_TAGVAR(link_all_deplibs, $1)=unknown
8322_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8323_LT_TAGVAR(reload_flag, $1)=$reload_flag
8324_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8325_LT_TAGVAR(no_undefined_flag, $1)=
8326_LT_TAGVAR(whole_archive_flag_spec, $1)=
8327_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8328
8329# Source file extension for f77 test sources.
8330ac_ext=f
8331
8332# Object file extension for compiled f77 test sources.
8333objext=o
8334_LT_TAGVAR(objext, $1)=$objext
8335
8336# No sense in running all these tests if we already determined that
8337# the F77 compiler isn't working.  Some variables (like enable_shared)
8338# are currently assumed to apply to all compilers on this platform,
8339# and will be corrupted by setting them based on a non-working compiler.
8340if test "$_lt_disable_F77" != yes; then
8341  # Code to be used in simple compile tests
8342  lt_simple_compile_test_code="\
8343      subroutine t
8344      return
8345      end
8346"
8347
8348  # Code to be used in simple link tests
8349  lt_simple_link_test_code="\
8350      program t
8351      end
8352"
8353
8354  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8355  _LT_TAG_COMPILER
8356
8357  # save warnings/boilerplate of simple test code
8358  _LT_COMPILER_BOILERPLATE
8359  _LT_LINKER_BOILERPLATE
8360
8361  # Allow CC to be a program name with arguments.
8362  lt_save_CC="$CC"
8363  lt_save_GCC=$GCC
8364  lt_save_CFLAGS=$CFLAGS
8365  CC=${F77-"f77"}
8366  CFLAGS=$FFLAGS
8367  compiler=$CC
8368  _LT_TAGVAR(compiler, $1)=$CC
8369  _LT_CC_BASENAME([$compiler])
8370  GCC=$G77
8371  if test -n "$compiler"; then
8372    AC_MSG_CHECKING([if libtool supports shared libraries])
8373    AC_MSG_RESULT([$can_build_shared])
8374
8375    AC_MSG_CHECKING([whether to build shared libraries])
8376    test "$can_build_shared" = "no" && enable_shared=no
8377
8378    # On AIX, shared libraries and static libraries use the same namespace, and
8379    # are all built from PIC.
8380    case $host_os in
8381      aix3*)
8382        test "$enable_shared" = yes && enable_static=no
8383        if test -n "$RANLIB"; then
8384          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8385          postinstall_cmds='$RANLIB $lib'
8386        fi
8387        ;;
8388      aix[[4-9]]*)
8389	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8390	  test "$enable_shared" = yes && enable_static=no
8391	fi
8392        ;;
8393    esac
8394    AC_MSG_RESULT([$enable_shared])
8395
8396    AC_MSG_CHECKING([whether to build static libraries])
8397    # Make sure either enable_shared or enable_static is yes.
8398    test "$enable_shared" = yes || enable_static=yes
8399    AC_MSG_RESULT([$enable_static])
8400
8401    _LT_TAGVAR(GCC, $1)="$G77"
8402    _LT_TAGVAR(LD, $1)="$LD"
8403
8404    ## CAVEAT EMPTOR:
8405    ## There is no encapsulation within the following macros, do not change
8406    ## the running order or otherwise move them around unless you know exactly
8407    ## what you are doing...
8408    _LT_COMPILER_PIC($1)
8409    _LT_COMPILER_C_O($1)
8410    _LT_COMPILER_FILE_LOCKS($1)
8411    _LT_LINKER_SHLIBS($1)
8412    _LT_SYS_DYNAMIC_LINKER($1)
8413    _LT_LINKER_HARDCODE_LIBPATH($1)
8414
8415    _LT_CONFIG($1)
8416  fi # test -n "$compiler"
8417
8418  GCC=$lt_save_GCC
8419  CC="$lt_save_CC"
8420  CFLAGS="$lt_save_CFLAGS"
8421fi # test "$_lt_disable_F77" != yes
8422
8423AC_LANG_POP
8424])# _LT_LANG_F77_CONFIG
8425
8426
8427# _LT_LANG_FC_CONFIG([TAG])
8428# -------------------------
8429# Ensure that the configuration variables for a Fortran compiler are
8430# suitably defined.  These variables are subsequently used by _LT_CONFIG
8431# to write the compiler configuration to `libtool'.
8432m4_defun([_LT_LANG_FC_CONFIG],
8433[AC_LANG_PUSH(Fortran)
8434
8435if test -z "$FC" || test "X$FC" = "Xno"; then
8436  _lt_disable_FC=yes
8437fi
8438
8439_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8440_LT_TAGVAR(allow_undefined_flag, $1)=
8441_LT_TAGVAR(always_export_symbols, $1)=no
8442_LT_TAGVAR(archive_expsym_cmds, $1)=
8443_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8444_LT_TAGVAR(hardcode_direct, $1)=no
8445_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8446_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8447_LT_TAGVAR(hardcode_libdir_separator, $1)=
8448_LT_TAGVAR(hardcode_minus_L, $1)=no
8449_LT_TAGVAR(hardcode_automatic, $1)=no
8450_LT_TAGVAR(inherit_rpath, $1)=no
8451_LT_TAGVAR(module_cmds, $1)=
8452_LT_TAGVAR(module_expsym_cmds, $1)=
8453_LT_TAGVAR(link_all_deplibs, $1)=unknown
8454_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8455_LT_TAGVAR(reload_flag, $1)=$reload_flag
8456_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8457_LT_TAGVAR(no_undefined_flag, $1)=
8458_LT_TAGVAR(whole_archive_flag_spec, $1)=
8459_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8460
8461# Source file extension for fc test sources.
8462ac_ext=${ac_fc_srcext-f}
8463
8464# Object file extension for compiled fc test sources.
8465objext=o
8466_LT_TAGVAR(objext, $1)=$objext
8467
8468# No sense in running all these tests if we already determined that
8469# the FC compiler isn't working.  Some variables (like enable_shared)
8470# are currently assumed to apply to all compilers on this platform,
8471# and will be corrupted by setting them based on a non-working compiler.
8472if test "$_lt_disable_FC" != yes; then
8473  # Code to be used in simple compile tests
8474  lt_simple_compile_test_code="\
8475      subroutine t
8476      return
8477      end
8478"
8479
8480  # Code to be used in simple link tests
8481  lt_simple_link_test_code="\
8482      program t
8483      end
8484"
8485
8486  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8487  _LT_TAG_COMPILER
8488
8489  # save warnings/boilerplate of simple test code
8490  _LT_COMPILER_BOILERPLATE
8491  _LT_LINKER_BOILERPLATE
8492
8493  # Allow CC to be a program name with arguments.
8494  lt_save_CC="$CC"
8495  lt_save_GCC=$GCC
8496  lt_save_CFLAGS=$CFLAGS
8497  CC=${FC-"f95"}
8498  CFLAGS=$FCFLAGS
8499  compiler=$CC
8500  GCC=$ac_cv_fc_compiler_gnu
8501
8502  _LT_TAGVAR(compiler, $1)=$CC
8503  _LT_CC_BASENAME([$compiler])
8504
8505  if test -n "$compiler"; then
8506    AC_MSG_CHECKING([if libtool supports shared libraries])
8507    AC_MSG_RESULT([$can_build_shared])
8508
8509    AC_MSG_CHECKING([whether to build shared libraries])
8510    test "$can_build_shared" = "no" && enable_shared=no
8511
8512    # On AIX, shared libraries and static libraries use the same namespace, and
8513    # are all built from PIC.
8514    case $host_os in
8515      aix3*)
8516        test "$enable_shared" = yes && enable_static=no
8517        if test -n "$RANLIB"; then
8518          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8519          postinstall_cmds='$RANLIB $lib'
8520        fi
8521        ;;
8522      aix[[4-9]]*)
8523	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8524	  test "$enable_shared" = yes && enable_static=no
8525	fi
8526        ;;
8527    esac
8528    AC_MSG_RESULT([$enable_shared])
8529
8530    AC_MSG_CHECKING([whether to build static libraries])
8531    # Make sure either enable_shared or enable_static is yes.
8532    test "$enable_shared" = yes || enable_static=yes
8533    AC_MSG_RESULT([$enable_static])
8534
8535    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8536    _LT_TAGVAR(LD, $1)="$LD"
8537
8538    ## CAVEAT EMPTOR:
8539    ## There is no encapsulation within the following macros, do not change
8540    ## the running order or otherwise move them around unless you know exactly
8541    ## what you are doing...
8542    _LT_SYS_HIDDEN_LIBDEPS($1)
8543    _LT_COMPILER_PIC($1)
8544    _LT_COMPILER_C_O($1)
8545    _LT_COMPILER_FILE_LOCKS($1)
8546    _LT_LINKER_SHLIBS($1)
8547    _LT_SYS_DYNAMIC_LINKER($1)
8548    _LT_LINKER_HARDCODE_LIBPATH($1)
8549
8550    _LT_CONFIG($1)
8551  fi # test -n "$compiler"
8552
8553  GCC=$lt_save_GCC
8554  CC=$lt_save_CC
8555  CFLAGS=$lt_save_CFLAGS
8556fi # test "$_lt_disable_FC" != yes
8557
8558AC_LANG_POP
8559])# _LT_LANG_FC_CONFIG
8560
8561
8562# _LT_LANG_GCJ_CONFIG([TAG])
8563# --------------------------
8564# Ensure that the configuration variables for the GNU Java Compiler compiler
8565# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8566# to write the compiler configuration to `libtool'.
8567m4_defun([_LT_LANG_GCJ_CONFIG],
8568[AC_REQUIRE([LT_PROG_GCJ])dnl
8569AC_LANG_SAVE
8570
8571# Source file extension for Java test sources.
8572ac_ext=java
8573
8574# Object file extension for compiled Java test sources.
8575objext=o
8576_LT_TAGVAR(objext, $1)=$objext
8577
8578# Code to be used in simple compile tests
8579lt_simple_compile_test_code="class foo {}"
8580
8581# Code to be used in simple link tests
8582lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8583
8584# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8585_LT_TAG_COMPILER
8586
8587# save warnings/boilerplate of simple test code
8588_LT_COMPILER_BOILERPLATE
8589_LT_LINKER_BOILERPLATE
8590
8591# Allow CC to be a program name with arguments.
8592lt_save_CC=$CC
8593lt_save_CFLAGS=$CFLAGS
8594lt_save_GCC=$GCC
8595GCC=yes
8596CC=${GCJ-"gcj"}
8597CFLAGS=$GCJFLAGS
8598compiler=$CC
8599_LT_TAGVAR(compiler, $1)=$CC
8600_LT_TAGVAR(LD, $1)="$LD"
8601_LT_CC_BASENAME([$compiler])
8602
8603# GCJ did not exist at the time GCC didn't implicitly link libc in.
8604_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8605
8606_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8607_LT_TAGVAR(reload_flag, $1)=$reload_flag
8608_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8609
8610if test -n "$compiler"; then
8611  _LT_COMPILER_NO_RTTI($1)
8612  _LT_COMPILER_PIC($1)
8613  _LT_COMPILER_C_O($1)
8614  _LT_COMPILER_FILE_LOCKS($1)
8615  _LT_LINKER_SHLIBS($1)
8616  _LT_LINKER_HARDCODE_LIBPATH($1)
8617
8618  _LT_CONFIG($1)
8619fi
8620
8621AC_LANG_RESTORE
8622
8623GCC=$lt_save_GCC
8624CC=$lt_save_CC
8625CFLAGS=$lt_save_CFLAGS
8626])# _LT_LANG_GCJ_CONFIG
8627
8628
8629# _LT_LANG_GO_CONFIG([TAG])
8630# --------------------------
8631# Ensure that the configuration variables for the GNU Go compiler
8632# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8633# to write the compiler configuration to `libtool'.
8634m4_defun([_LT_LANG_GO_CONFIG],
8635[AC_REQUIRE([LT_PROG_GO])dnl
8636AC_LANG_SAVE
8637
8638# Source file extension for Go test sources.
8639ac_ext=go
8640
8641# Object file extension for compiled Go test sources.
8642objext=o
8643_LT_TAGVAR(objext, $1)=$objext
8644
8645# Code to be used in simple compile tests
8646lt_simple_compile_test_code="package main; func main() { }"
8647
8648# Code to be used in simple link tests
8649lt_simple_link_test_code='package main; func main() { }'
8650
8651# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8652_LT_TAG_COMPILER
8653
8654# save warnings/boilerplate of simple test code
8655_LT_COMPILER_BOILERPLATE
8656_LT_LINKER_BOILERPLATE
8657
8658# Allow CC to be a program name with arguments.
8659lt_save_CC=$CC
8660lt_save_CFLAGS=$CFLAGS
8661lt_save_GCC=$GCC
8662GCC=yes
8663CC=${GOC-"gccgo"}
8664CFLAGS=$GOFLAGS
8665compiler=$CC
8666_LT_TAGVAR(compiler, $1)=$CC
8667_LT_TAGVAR(LD, $1)="$LD"
8668_LT_CC_BASENAME([$compiler])
8669
8670# Go did not exist at the time GCC didn't implicitly link libc in.
8671_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8672
8673_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8674_LT_TAGVAR(reload_flag, $1)=$reload_flag
8675_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8676
8677if test -n "$compiler"; then
8678  _LT_COMPILER_NO_RTTI($1)
8679  _LT_COMPILER_PIC($1)
8680  _LT_COMPILER_C_O($1)
8681  _LT_COMPILER_FILE_LOCKS($1)
8682  _LT_LINKER_SHLIBS($1)
8683  _LT_LINKER_HARDCODE_LIBPATH($1)
8684
8685  _LT_CONFIG($1)
8686fi
8687
8688AC_LANG_RESTORE
8689
8690GCC=$lt_save_GCC
8691CC=$lt_save_CC
8692CFLAGS=$lt_save_CFLAGS
8693])# _LT_LANG_GO_CONFIG
8694
8695
8696# _LT_LANG_RC_CONFIG([TAG])
8697# -------------------------
8698# Ensure that the configuration variables for the Windows resource compiler
8699# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8700# to write the compiler configuration to `libtool'.
8701m4_defun([_LT_LANG_RC_CONFIG],
8702[AC_REQUIRE([LT_PROG_RC])dnl
8703AC_LANG_SAVE
8704
8705# Source file extension for RC test sources.
8706ac_ext=rc
8707
8708# Object file extension for compiled RC test sources.
8709objext=o
8710_LT_TAGVAR(objext, $1)=$objext
8711
8712# Code to be used in simple compile tests
8713lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8714
8715# Code to be used in simple link tests
8716lt_simple_link_test_code="$lt_simple_compile_test_code"
8717
8718# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8719_LT_TAG_COMPILER
8720
8721# save warnings/boilerplate of simple test code
8722_LT_COMPILER_BOILERPLATE
8723_LT_LINKER_BOILERPLATE
8724
8725# Allow CC to be a program name with arguments.
8726lt_save_CC="$CC"
8727lt_save_CFLAGS=$CFLAGS
8728lt_save_GCC=$GCC
8729GCC=
8730CC=${RC-"windres"}
8731CFLAGS=
8732compiler=$CC
8733_LT_TAGVAR(compiler, $1)=$CC
8734_LT_CC_BASENAME([$compiler])
8735_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8736
8737if test -n "$compiler"; then
8738  :
8739  _LT_CONFIG($1)
8740fi
8741
8742GCC=$lt_save_GCC
8743AC_LANG_RESTORE
8744CC=$lt_save_CC
8745CFLAGS=$lt_save_CFLAGS
8746])# _LT_LANG_RC_CONFIG
8747
8748
8749# LT_PROG_GCJ
8750# -----------
8751AC_DEFUN([LT_PROG_GCJ],
8752[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8753  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8754    [AC_CHECK_TOOL(GCJ, gcj,)
8755      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8756      AC_SUBST(GCJFLAGS)])])[]dnl
8757])
8758
8759# Old name:
8760AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8761dnl aclocal-1.4 backwards compatibility:
8762dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8763
8764
8765# LT_PROG_GO
8766# ----------
8767AC_DEFUN([LT_PROG_GO],
8768[AC_CHECK_TOOL(GOC, gccgo,)
8769])
8770
8771
8772# LT_PROG_RC
8773# ----------
8774AC_DEFUN([LT_PROG_RC],
8775[AC_CHECK_TOOL(RC, windres,)
8776])
8777
8778# Old name:
8779AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8780dnl aclocal-1.4 backwards compatibility:
8781dnl AC_DEFUN([LT_AC_PROG_RC], [])
8782
8783
8784# _LT_DECL_EGREP
8785# --------------
8786# If we don't have a new enough Autoconf to choose the best grep
8787# available, choose the one first in the user's PATH.
8788m4_defun([_LT_DECL_EGREP],
8789[AC_REQUIRE([AC_PROG_EGREP])dnl
8790AC_REQUIRE([AC_PROG_FGREP])dnl
8791test -z "$GREP" && GREP=grep
8792_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8793_LT_DECL([], [EGREP], [1], [An ERE matcher])
8794_LT_DECL([], [FGREP], [1], [A literal string matcher])
8795dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8796AC_SUBST([GREP])
8797])
8798
8799
8800# _LT_DECL_OBJDUMP
8801# --------------
8802# If we don't have a new enough Autoconf to choose the best objdump
8803# available, choose the one first in the user's PATH.
8804m4_defun([_LT_DECL_OBJDUMP],
8805[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8806test -z "$OBJDUMP" && OBJDUMP=objdump
8807_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8808AC_SUBST([OBJDUMP])
8809])
8810
8811# _LT_DECL_DLLTOOL
8812# ----------------
8813# Ensure DLLTOOL variable is set.
8814m4_defun([_LT_DECL_DLLTOOL],
8815[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8816test -z "$DLLTOOL" && DLLTOOL=dlltool
8817_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8818AC_SUBST([DLLTOOL])
8819])
8820
8821# _LT_DECL_SED
8822# ------------
8823# Check for a fully-functional sed program, that truncates
8824# as few characters as possible.  Prefer GNU sed if found.
8825m4_defun([_LT_DECL_SED],
8826[AC_PROG_SED
8827test -z "$SED" && SED=sed
8828Xsed="$SED -e 1s/^X//"
8829_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8830_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8831    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8832])# _LT_DECL_SED
8833
8834m4_ifndef([AC_PROG_SED], [
8835# NOTE: This macro has been submitted for inclusion into   #
8836#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8837#  a released version of Autoconf we should remove this    #
8838#  macro and use it instead.                               #
8839
8840m4_defun([AC_PROG_SED],
8841[AC_MSG_CHECKING([for a sed that does not truncate output])
8842AC_CACHE_VAL(lt_cv_path_SED,
8843[# Loop through the user's path and test for sed and gsed.
8844# Then use that list of sed's as ones to test for truncation.
8845as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8846for as_dir in $PATH
8847do
8848  IFS=$as_save_IFS
8849  test -z "$as_dir" && as_dir=.
8850  for lt_ac_prog in sed gsed; do
8851    for ac_exec_ext in '' $ac_executable_extensions; do
8852      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8853        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8854      fi
8855    done
8856  done
8857done
8858IFS=$as_save_IFS
8859lt_ac_max=0
8860lt_ac_count=0
8861# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8862# along with /bin/sed that truncates output.
8863for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8864  test ! -f $lt_ac_sed && continue
8865  cat /dev/null > conftest.in
8866  lt_ac_count=0
8867  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8868  # Check for GNU sed and select it if it is found.
8869  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8870    lt_cv_path_SED=$lt_ac_sed
8871    break
8872  fi
8873  while true; do
8874    cat conftest.in conftest.in >conftest.tmp
8875    mv conftest.tmp conftest.in
8876    cp conftest.in conftest.nl
8877    echo >>conftest.nl
8878    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8879    cmp -s conftest.out conftest.nl || break
8880    # 10000 chars as input seems more than enough
8881    test $lt_ac_count -gt 10 && break
8882    lt_ac_count=`expr $lt_ac_count + 1`
8883    if test $lt_ac_count -gt $lt_ac_max; then
8884      lt_ac_max=$lt_ac_count
8885      lt_cv_path_SED=$lt_ac_sed
8886    fi
8887  done
8888done
8889])
8890SED=$lt_cv_path_SED
8891AC_SUBST([SED])
8892AC_MSG_RESULT([$SED])
8893])#AC_PROG_SED
8894])#m4_ifndef
8895
8896# Old name:
8897AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8898dnl aclocal-1.4 backwards compatibility:
8899dnl AC_DEFUN([LT_AC_PROG_SED], [])
8900
8901
8902# _LT_CHECK_SHELL_FEATURES
8903# ------------------------
8904# Find out whether the shell is Bourne or XSI compatible,
8905# or has some other useful features.
8906m4_defun([_LT_CHECK_SHELL_FEATURES],
8907[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8908# Try some XSI features
8909xsi_shell=no
8910( _lt_dummy="a/b/c"
8911  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8912      = c,a/b,b/c, \
8913    && eval 'test $(( 1 + 1 )) -eq 2 \
8914    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8915  && xsi_shell=yes
8916AC_MSG_RESULT([$xsi_shell])
8917_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8918
8919AC_MSG_CHECKING([whether the shell understands "+="])
8920lt_shell_append=no
8921( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8922    >/dev/null 2>&1 \
8923  && lt_shell_append=yes
8924AC_MSG_RESULT([$lt_shell_append])
8925_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8926
8927if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8928  lt_unset=unset
8929else
8930  lt_unset=false
8931fi
8932_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8933
8934# test EBCDIC or ASCII
8935case `echo X|tr X '\101'` in
8936 A) # ASCII based system
8937    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8938  lt_SP2NL='tr \040 \012'
8939  lt_NL2SP='tr \015\012 \040\040'
8940  ;;
8941 *) # EBCDIC based system
8942  lt_SP2NL='tr \100 \n'
8943  lt_NL2SP='tr \r\n \100\100'
8944  ;;
8945esac
8946_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8947_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8948])# _LT_CHECK_SHELL_FEATURES
8949
8950
8951# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8952# ------------------------------------------------------
8953# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8954# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8955m4_defun([_LT_PROG_FUNCTION_REPLACE],
8956[dnl {
8957sed -e '/^$1 ()$/,/^} # $1 /c\
8958$1 ()\
8959{\
8960m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8961} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8962  && mv -f "$cfgfile.tmp" "$cfgfile" \
8963    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8964test 0 -eq $? || _lt_function_replace_fail=:
8965])
8966
8967
8968# _LT_PROG_REPLACE_SHELLFNS
8969# -------------------------
8970# Replace existing portable implementations of several shell functions with
8971# equivalent extended shell implementations where those features are available..
8972m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8973[if test x"$xsi_shell" = xyes; then
8974  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8975    case ${1} in
8976      */*) func_dirname_result="${1%/*}${2}" ;;
8977      *  ) func_dirname_result="${3}" ;;
8978    esac])
8979
8980  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8981    func_basename_result="${1##*/}"])
8982
8983  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8984    case ${1} in
8985      */*) func_dirname_result="${1%/*}${2}" ;;
8986      *  ) func_dirname_result="${3}" ;;
8987    esac
8988    func_basename_result="${1##*/}"])
8989
8990  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8991    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8992    # positional parameters, so assign one to ordinary parameter first.
8993    func_stripname_result=${3}
8994    func_stripname_result=${func_stripname_result#"${1}"}
8995    func_stripname_result=${func_stripname_result%"${2}"}])
8996
8997  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8998    func_split_long_opt_name=${1%%=*}
8999    func_split_long_opt_arg=${1#*=}])
9000
9001  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
9002    func_split_short_opt_arg=${1#??}
9003    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
9004
9005  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
9006    case ${1} in
9007      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
9008      *)    func_lo2o_result=${1} ;;
9009    esac])
9010
9011  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
9012
9013  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
9014
9015  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
9016fi
9017
9018if test x"$lt_shell_append" = xyes; then
9019  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
9020
9021  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
9022    func_quote_for_eval "${2}"
9023dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
9024    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
9025
9026  # Save a `func_append' function call where possible by direct use of '+='
9027  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
9028    && mv -f "$cfgfile.tmp" "$cfgfile" \
9029      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
9030  test 0 -eq $? || _lt_function_replace_fail=:
9031else
9032  # Save a `func_append' function call even when '+=' is not available
9033  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
9034    && mv -f "$cfgfile.tmp" "$cfgfile" \
9035      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
9036  test 0 -eq $? || _lt_function_replace_fail=:
9037fi
9038
9039if test x"$_lt_function_replace_fail" = x":"; then
9040  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
9041fi
9042])
9043
9044# _LT_PATH_CONVERSION_FUNCTIONS
9045# -----------------------------
9046# Determine which file name conversion functions should be used by
9047# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
9048# for certain cross-compile configurations and native mingw.
9049m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
9050[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9051AC_REQUIRE([AC_CANONICAL_BUILD])dnl
9052AC_MSG_CHECKING([how to convert $build file names to $host format])
9053AC_CACHE_VAL(lt_cv_to_host_file_cmd,
9054[case $host in
9055  *-*-mingw* )
9056    case $build in
9057      *-*-mingw* ) # actually msys
9058        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
9059        ;;
9060      *-*-cygwin* )
9061        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
9062        ;;
9063      * ) # otherwise, assume *nix
9064        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
9065        ;;
9066    esac
9067    ;;
9068  *-*-cygwin* )
9069    case $build in
9070      *-*-mingw* ) # actually msys
9071        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
9072        ;;
9073      *-*-cygwin* )
9074        lt_cv_to_host_file_cmd=func_convert_file_noop
9075        ;;
9076      * ) # otherwise, assume *nix
9077        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
9078        ;;
9079    esac
9080    ;;
9081  * ) # unhandled hosts (and "normal" native builds)
9082    lt_cv_to_host_file_cmd=func_convert_file_noop
9083    ;;
9084esac
9085])
9086to_host_file_cmd=$lt_cv_to_host_file_cmd
9087AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
9088_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
9089         [0], [convert $build file names to $host format])dnl
9090
9091AC_MSG_CHECKING([how to convert $build file names to toolchain format])
9092AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
9093[#assume ordinary cross tools, or native build.
9094lt_cv_to_tool_file_cmd=func_convert_file_noop
9095case $host in
9096  *-*-mingw* )
9097    case $build in
9098      *-*-mingw* ) # actually msys
9099        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
9100        ;;
9101    esac
9102    ;;
9103esac
9104])
9105to_tool_file_cmd=$lt_cv_to_tool_file_cmd
9106AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
9107_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
9108         [0], [convert $build files to toolchain format])dnl
9109])# _LT_PATH_CONVERSION_FUNCTIONS
9110
9111# Helper functions for option handling.                    -*- Autoconf -*-
9112#
9113#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9114#   Inc.
9115#   Written by Gary V. Vaughan, 2004
9116#
9117# This file is free software; the Free Software Foundation gives
9118# unlimited permission to copy and/or distribute it, with or without
9119# modifications, as long as this notice is preserved.
9120
9121# serial 7 ltoptions.m4
9122
9123# This is to help aclocal find these macros, as it can't see m4_define.
9124AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9125
9126
9127# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9128# ------------------------------------------
9129m4_define([_LT_MANGLE_OPTION],
9130[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9131
9132
9133# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9134# ---------------------------------------
9135# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9136# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9137# saved as a flag.
9138m4_define([_LT_SET_OPTION],
9139[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9140m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9141        _LT_MANGLE_DEFUN([$1], [$2]),
9142    [m4_warning([Unknown $1 option `$2'])])[]dnl
9143])
9144
9145
9146# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9147# ------------------------------------------------------------
9148# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9149m4_define([_LT_IF_OPTION],
9150[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9151
9152
9153# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9154# -------------------------------------------------------
9155# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9156# are set.
9157m4_define([_LT_UNLESS_OPTIONS],
9158[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9159	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9160		      [m4_define([$0_found])])])[]dnl
9161m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9162])[]dnl
9163])
9164
9165
9166# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9167# ----------------------------------------
9168# OPTION-LIST is a space-separated list of Libtool options associated
9169# with MACRO-NAME.  If any OPTION has a matching handler declared with
9170# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9171# the unknown option and exit.
9172m4_defun([_LT_SET_OPTIONS],
9173[# Set options
9174m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9175    [_LT_SET_OPTION([$1], _LT_Option)])
9176
9177m4_if([$1],[LT_INIT],[
9178  dnl
9179  dnl Simply set some default values (i.e off) if boolean options were not
9180  dnl specified:
9181  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9182  ])
9183  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9184  ])
9185  dnl
9186  dnl If no reference was made to various pairs of opposing options, then
9187  dnl we run the default mode handler for the pair.  For example, if neither
9188  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9189  dnl archives by default:
9190  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9191  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9192  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9193  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9194  		   [_LT_ENABLE_FAST_INSTALL])
9195  ])
9196])# _LT_SET_OPTIONS
9197
9198
9199
9200# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9201# -----------------------------------------
9202m4_define([_LT_MANGLE_DEFUN],
9203[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9204
9205
9206# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9207# -----------------------------------------------
9208m4_define([LT_OPTION_DEFINE],
9209[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9210])# LT_OPTION_DEFINE
9211
9212
9213# dlopen
9214# ------
9215LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9216])
9217
9218AU_DEFUN([AC_LIBTOOL_DLOPEN],
9219[_LT_SET_OPTION([LT_INIT], [dlopen])
9220AC_DIAGNOSE([obsolete],
9221[$0: Remove this warning and the call to _LT_SET_OPTION when you
9222put the `dlopen' option into LT_INIT's first parameter.])
9223])
9224
9225dnl aclocal-1.4 backwards compatibility:
9226dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9227
9228
9229# win32-dll
9230# ---------
9231# Declare package support for building win32 dll's.
9232LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9233[enable_win32_dll=yes
9234
9235case $host in
9236*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9237  AC_CHECK_TOOL(AS, as, false)
9238  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9239  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9240  ;;
9241esac
9242
9243test -z "$AS" && AS=as
9244_LT_DECL([], [AS],      [1], [Assembler program])dnl
9245
9246test -z "$DLLTOOL" && DLLTOOL=dlltool
9247_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9248
9249test -z "$OBJDUMP" && OBJDUMP=objdump
9250_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9251])# win32-dll
9252
9253AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9254[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9255_LT_SET_OPTION([LT_INIT], [win32-dll])
9256AC_DIAGNOSE([obsolete],
9257[$0: Remove this warning and the call to _LT_SET_OPTION when you
9258put the `win32-dll' option into LT_INIT's first parameter.])
9259])
9260
9261dnl aclocal-1.4 backwards compatibility:
9262dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9263
9264
9265# _LT_ENABLE_SHARED([DEFAULT])
9266# ----------------------------
9267# implement the --enable-shared flag, and supports the `shared' and
9268# `disable-shared' LT_INIT options.
9269# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9270m4_define([_LT_ENABLE_SHARED],
9271[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9272AC_ARG_ENABLE([shared],
9273    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9274	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9275    [p=${PACKAGE-default}
9276    case $enableval in
9277    yes) enable_shared=yes ;;
9278    no) enable_shared=no ;;
9279    *)
9280      enable_shared=no
9281      # Look at the argument we got.  We use all the common list separators.
9282      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9283      for pkg in $enableval; do
9284	IFS="$lt_save_ifs"
9285	if test "X$pkg" = "X$p"; then
9286	  enable_shared=yes
9287	fi
9288      done
9289      IFS="$lt_save_ifs"
9290      ;;
9291    esac],
9292    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9293
9294    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9295	[Whether or not to build shared libraries])
9296])# _LT_ENABLE_SHARED
9297
9298LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9299LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9300
9301# Old names:
9302AC_DEFUN([AC_ENABLE_SHARED],
9303[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9304])
9305
9306AC_DEFUN([AC_DISABLE_SHARED],
9307[_LT_SET_OPTION([LT_INIT], [disable-shared])
9308])
9309
9310AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9311AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9312
9313dnl aclocal-1.4 backwards compatibility:
9314dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9315dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9316
9317
9318
9319# _LT_ENABLE_STATIC([DEFAULT])
9320# ----------------------------
9321# implement the --enable-static flag, and support the `static' and
9322# `disable-static' LT_INIT options.
9323# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9324m4_define([_LT_ENABLE_STATIC],
9325[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9326AC_ARG_ENABLE([static],
9327    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9328	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9329    [p=${PACKAGE-default}
9330    case $enableval in
9331    yes) enable_static=yes ;;
9332    no) enable_static=no ;;
9333    *)
9334     enable_static=no
9335      # Look at the argument we got.  We use all the common list separators.
9336      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9337      for pkg in $enableval; do
9338	IFS="$lt_save_ifs"
9339	if test "X$pkg" = "X$p"; then
9340	  enable_static=yes
9341	fi
9342      done
9343      IFS="$lt_save_ifs"
9344      ;;
9345    esac],
9346    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9347
9348    _LT_DECL([build_old_libs], [enable_static], [0],
9349	[Whether or not to build static libraries])
9350])# _LT_ENABLE_STATIC
9351
9352LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9353LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9354
9355# Old names:
9356AC_DEFUN([AC_ENABLE_STATIC],
9357[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9358])
9359
9360AC_DEFUN([AC_DISABLE_STATIC],
9361[_LT_SET_OPTION([LT_INIT], [disable-static])
9362])
9363
9364AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9365AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9366
9367dnl aclocal-1.4 backwards compatibility:
9368dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9369dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9370
9371
9372
9373# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9374# ----------------------------------
9375# implement the --enable-fast-install flag, and support the `fast-install'
9376# and `disable-fast-install' LT_INIT options.
9377# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9378m4_define([_LT_ENABLE_FAST_INSTALL],
9379[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9380AC_ARG_ENABLE([fast-install],
9381    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9382    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9383    [p=${PACKAGE-default}
9384    case $enableval in
9385    yes) enable_fast_install=yes ;;
9386    no) enable_fast_install=no ;;
9387    *)
9388      enable_fast_install=no
9389      # Look at the argument we got.  We use all the common list separators.
9390      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9391      for pkg in $enableval; do
9392	IFS="$lt_save_ifs"
9393	if test "X$pkg" = "X$p"; then
9394	  enable_fast_install=yes
9395	fi
9396      done
9397      IFS="$lt_save_ifs"
9398      ;;
9399    esac],
9400    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9401
9402_LT_DECL([fast_install], [enable_fast_install], [0],
9403	 [Whether or not to optimize for fast installation])dnl
9404])# _LT_ENABLE_FAST_INSTALL
9405
9406LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9407LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9408
9409# Old names:
9410AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9411[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9412AC_DIAGNOSE([obsolete],
9413[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9414the `fast-install' option into LT_INIT's first parameter.])
9415])
9416
9417AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9418[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9419AC_DIAGNOSE([obsolete],
9420[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9421the `disable-fast-install' option into LT_INIT's first parameter.])
9422])
9423
9424dnl aclocal-1.4 backwards compatibility:
9425dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9426dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9427
9428
9429# _LT_WITH_PIC([MODE])
9430# --------------------
9431# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9432# LT_INIT options.
9433# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9434m4_define([_LT_WITH_PIC],
9435[AC_ARG_WITH([pic],
9436    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9437	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9438    [lt_p=${PACKAGE-default}
9439    case $withval in
9440    yes|no) pic_mode=$withval ;;
9441    *)
9442      pic_mode=default
9443      # Look at the argument we got.  We use all the common list separators.
9444      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9445      for lt_pkg in $withval; do
9446	IFS="$lt_save_ifs"
9447	if test "X$lt_pkg" = "X$lt_p"; then
9448	  pic_mode=yes
9449	fi
9450      done
9451      IFS="$lt_save_ifs"
9452      ;;
9453    esac],
9454    [pic_mode=default])
9455
9456test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9457
9458_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9459])# _LT_WITH_PIC
9460
9461LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9462LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9463
9464# Old name:
9465AU_DEFUN([AC_LIBTOOL_PICMODE],
9466[_LT_SET_OPTION([LT_INIT], [pic-only])
9467AC_DIAGNOSE([obsolete],
9468[$0: Remove this warning and the call to _LT_SET_OPTION when you
9469put the `pic-only' option into LT_INIT's first parameter.])
9470])
9471
9472dnl aclocal-1.4 backwards compatibility:
9473dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9474
9475
9476m4_define([_LTDL_MODE], [])
9477LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9478		 [m4_define([_LTDL_MODE], [nonrecursive])])
9479LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9480		 [m4_define([_LTDL_MODE], [recursive])])
9481LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9482		 [m4_define([_LTDL_MODE], [subproject])])
9483
9484m4_define([_LTDL_TYPE], [])
9485LT_OPTION_DEFINE([LTDL_INIT], [installable],
9486		 [m4_define([_LTDL_TYPE], [installable])])
9487LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9488		 [m4_define([_LTDL_TYPE], [convenience])])
9489
9490# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9491#
9492# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9493# Written by Gary V. Vaughan, 2004
9494#
9495# This file is free software; the Free Software Foundation gives
9496# unlimited permission to copy and/or distribute it, with or without
9497# modifications, as long as this notice is preserved.
9498
9499# serial 6 ltsugar.m4
9500
9501# This is to help aclocal find these macros, as it can't see m4_define.
9502AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9503
9504
9505# lt_join(SEP, ARG1, [ARG2...])
9506# -----------------------------
9507# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9508# associated separator.
9509# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9510# versions in m4sugar had bugs.
9511m4_define([lt_join],
9512[m4_if([$#], [1], [],
9513       [$#], [2], [[$2]],
9514       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9515m4_define([_lt_join],
9516[m4_if([$#$2], [2], [],
9517       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9518
9519
9520# lt_car(LIST)
9521# lt_cdr(LIST)
9522# ------------
9523# Manipulate m4 lists.
9524# These macros are necessary as long as will still need to support
9525# Autoconf-2.59 which quotes differently.
9526m4_define([lt_car], [[$1]])
9527m4_define([lt_cdr],
9528[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9529       [$#], 1, [],
9530       [m4_dquote(m4_shift($@))])])
9531m4_define([lt_unquote], $1)
9532
9533
9534# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9535# ------------------------------------------
9536# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9537# Note that neither SEPARATOR nor STRING are expanded; they are appended
9538# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9539# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9540# than defined and empty).
9541#
9542# This macro is needed until we can rely on Autoconf 2.62, since earlier
9543# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9544m4_define([lt_append],
9545[m4_define([$1],
9546	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9547
9548
9549
9550# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9551# ----------------------------------------------------------
9552# Produce a SEP delimited list of all paired combinations of elements of
9553# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9554# has the form PREFIXmINFIXSUFFIXn.
9555# Needed until we can rely on m4_combine added in Autoconf 2.62.
9556m4_define([lt_combine],
9557[m4_if(m4_eval([$# > 3]), [1],
9558       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9559[[m4_foreach([_Lt_prefix], [$2],
9560	     [m4_foreach([_Lt_suffix],
9561		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9562	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9563
9564
9565# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9566# -----------------------------------------------------------------------
9567# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9568# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9569m4_define([lt_if_append_uniq],
9570[m4_ifdef([$1],
9571	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9572		 [lt_append([$1], [$2], [$3])$4],
9573		 [$5])],
9574	  [lt_append([$1], [$2], [$3])$4])])
9575
9576
9577# lt_dict_add(DICT, KEY, VALUE)
9578# -----------------------------
9579m4_define([lt_dict_add],
9580[m4_define([$1($2)], [$3])])
9581
9582
9583# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9584# --------------------------------------------
9585m4_define([lt_dict_add_subkey],
9586[m4_define([$1($2:$3)], [$4])])
9587
9588
9589# lt_dict_fetch(DICT, KEY, [SUBKEY])
9590# ----------------------------------
9591m4_define([lt_dict_fetch],
9592[m4_ifval([$3],
9593	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9594    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9595
9596
9597# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9598# -----------------------------------------------------------------
9599m4_define([lt_if_dict_fetch],
9600[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9601	[$5],
9602    [$6])])
9603
9604
9605# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9606# --------------------------------------------------------------
9607m4_define([lt_dict_filter],
9608[m4_if([$5], [], [],
9609  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9610           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9611		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9612])
9613
9614# ltversion.m4 -- version numbers			-*- Autoconf -*-
9615#
9616#   Copyright (C) 2004 Free Software Foundation, Inc.
9617#   Written by Scott James Remnant, 2004
9618#
9619# This file is free software; the Free Software Foundation gives
9620# unlimited permission to copy and/or distribute it, with or without
9621# modifications, as long as this notice is preserved.
9622
9623# @configure_input@
9624
9625# serial 3337 ltversion.m4
9626# This file is part of GNU Libtool
9627
9628m4_define([LT_PACKAGE_VERSION], [2.4.2])
9629m4_define([LT_PACKAGE_REVISION], [1.3337])
9630
9631AC_DEFUN([LTVERSION_VERSION],
9632[macro_version='2.4.2'
9633macro_revision='1.3337'
9634_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9635_LT_DECL(, macro_revision, 0)
9636])
9637
9638# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9639#
9640#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9641#   Written by Scott James Remnant, 2004.
9642#
9643# This file is free software; the Free Software Foundation gives
9644# unlimited permission to copy and/or distribute it, with or without
9645# modifications, as long as this notice is preserved.
9646
9647# serial 5 lt~obsolete.m4
9648
9649# These exist entirely to fool aclocal when bootstrapping libtool.
9650#
9651# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9652# which have later been changed to m4_define as they aren't part of the
9653# exported API, or moved to Autoconf or Automake where they belong.
9654#
9655# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9656# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9657# using a macro with the same name in our local m4/libtool.m4 it'll
9658# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9659# and doesn't know about Autoconf macros at all.)
9660#
9661# So we provide this file, which has a silly filename so it's always
9662# included after everything else.  This provides aclocal with the
9663# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9664# because those macros already exist, or will be overwritten later.
9665# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9666#
9667# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9668# Yes, that means every name once taken will need to remain here until
9669# we give up compatibility with versions before 1.7, at which point
9670# we need to keep only those names which we still refer to.
9671
9672# This is to help aclocal find these macros, as it can't see m4_define.
9673AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9674
9675m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9676m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9677m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9678m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9679m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9680m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9681m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9682m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9683m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9684m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9685m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9686m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9687m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9688m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9689m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9690m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9691m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9692m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9693m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9694m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9695m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9696m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9697m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9698m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9699m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9700m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9701m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9702m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9703m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9704m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9705m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9706m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9707m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9708m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9709m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9710m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9711m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9712m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9713m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9714m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9715m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9716m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9717m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9718m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9719m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9720m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9721m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9722m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9723m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9724m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9725m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9726m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9727m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9728m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9729m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9730m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9731m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9732m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9733m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9734m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9735m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9736
9737# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9738# 
9739# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9740#
9741# This program is free software; you can redistribute it and/or modify
9742# it under the terms of the GNU General Public License as published by
9743# the Free Software Foundation; either version 2 of the License, or
9744# (at your option) any later version.
9745#
9746# This program is distributed in the hope that it will be useful, but
9747# WITHOUT ANY WARRANTY; without even the implied warranty of
9748# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9749# General Public License for more details.
9750#
9751# You should have received a copy of the GNU General Public License
9752# along with this program; if not, write to the Free Software
9753# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9754#
9755# As a special exception to the GNU General Public License, if you
9756# distribute this file as part of a program that contains a
9757# configuration script generated by Autoconf, you may include it under
9758# the same distribution terms that you use for the rest of that program.
9759
9760# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9761# ----------------------------------
9762AC_DEFUN([PKG_PROG_PKG_CONFIG],
9763[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9764m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9765AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9766if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9767	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9768fi
9769if test -n "$PKG_CONFIG"; then
9770	_pkg_min_version=m4_default([$1], [0.9.0])
9771	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9772	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9773		AC_MSG_RESULT([yes])
9774	else
9775		AC_MSG_RESULT([no])
9776		PKG_CONFIG=""
9777	fi
9778		
9779fi[]dnl
9780])# PKG_PROG_PKG_CONFIG
9781
9782# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9783#
9784# Check to see whether a particular set of modules exists.  Similar
9785# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9786#
9787#
9788# Similar to PKG_CHECK_MODULES, make sure that the first instance of
9789# this or PKG_CHECK_MODULES is called, or make sure to call
9790# PKG_CHECK_EXISTS manually
9791# --------------------------------------------------------------
9792AC_DEFUN([PKG_CHECK_EXISTS],
9793[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9794if test -n "$PKG_CONFIG" && \
9795    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9796  m4_ifval([$2], [$2], [:])
9797m4_ifvaln([$3], [else
9798  $3])dnl
9799fi])
9800
9801
9802# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9803# ---------------------------------------------
9804m4_define([_PKG_CONFIG],
9805[if test -n "$$1"; then
9806    pkg_cv_[]$1="$$1"
9807 elif test -n "$PKG_CONFIG"; then
9808    PKG_CHECK_EXISTS([$3],
9809                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9810		     [pkg_failed=yes])
9811 else
9812    pkg_failed=untried
9813fi[]dnl
9814])# _PKG_CONFIG
9815
9816# _PKG_SHORT_ERRORS_SUPPORTED
9817# -----------------------------
9818AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9819[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9820if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9821        _pkg_short_errors_supported=yes
9822else
9823        _pkg_short_errors_supported=no
9824fi[]dnl
9825])# _PKG_SHORT_ERRORS_SUPPORTED
9826
9827
9828# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9829# [ACTION-IF-NOT-FOUND])
9830#
9831#
9832# Note that if there is a possibility the first call to
9833# PKG_CHECK_MODULES might not happen, you should be sure to include an
9834# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9835#
9836#
9837# --------------------------------------------------------------
9838AC_DEFUN([PKG_CHECK_MODULES],
9839[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9840AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9841AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9842
9843pkg_failed=no
9844AC_MSG_CHECKING([for $1])
9845
9846_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9847_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9848
9849m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9850and $1[]_LIBS to avoid the need to call pkg-config.
9851See the pkg-config man page for more details.])
9852
9853if test $pkg_failed = yes; then
9854        _PKG_SHORT_ERRORS_SUPPORTED
9855        if test $_pkg_short_errors_supported = yes; then
9856	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9857        else 
9858	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9859        fi
9860	# Put the nasty error message in config.log where it belongs
9861	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9862
9863	ifelse([$4], , [AC_MSG_ERROR(dnl
9864[Package requirements ($2) were not met:
9865
9866$$1_PKG_ERRORS
9867
9868Consider adjusting the PKG_CONFIG_PATH environment variable if you
9869installed software in a non-standard prefix.
9870
9871_PKG_TEXT
9872])],
9873		[AC_MSG_RESULT([no])
9874                $4])
9875elif test $pkg_failed = untried; then
9876	ifelse([$4], , [AC_MSG_FAILURE(dnl
9877[The pkg-config script could not be found or is too old.  Make sure it
9878is in your PATH or set the PKG_CONFIG environment variable to the full
9879path to pkg-config.
9880
9881_PKG_TEXT
9882
9883To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9884		[$4])
9885else
9886	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9887	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9888        AC_MSG_RESULT([yes])
9889	ifelse([$3], , :, [$3])
9890fi[]dnl
9891])# PKG_CHECK_MODULES
9892
9893dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9894dnl
9895dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9896dnl
9897dnl Permission is hereby granted, free of charge, to any person obtaining a
9898dnl copy of this software and associated documentation files (the "Software"),
9899dnl to deal in the Software without restriction, including without limitation
9900dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9901dnl and/or sell copies of the Software, and to permit persons to whom the
9902dnl Software is furnished to do so, subject to the following conditions:
9903dnl
9904dnl The above copyright notice and this permission notice (including the next
9905dnl paragraph) shall be included in all copies or substantial portions of the
9906dnl Software.
9907dnl
9908dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9909dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9910dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9911dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9912dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9913dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9914dnl DEALINGS IN THE SOFTWARE.
9915
9916# XORG_MACROS_VERSION(required-version)
9917# -------------------------------------
9918# Minimum version: 1.1.0
9919#
9920# If you're using a macro added in Version 1.1 or newer, include this in
9921# your configure.ac with the minimum required version, such as:
9922# XORG_MACROS_VERSION(1.1)
9923#
9924# To ensure that this macro is defined, also add:
9925# m4_ifndef([XORG_MACROS_VERSION],
9926#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9927#
9928#
9929# See the "minimum version" comment for each macro you use to see what
9930# version you require.
9931m4_defun([XORG_MACROS_VERSION],[
9932m4_define([vers_have], [1.18.0])
9933m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9934m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9935m4_if(m4_cmp(maj_have, maj_needed), 0,,
9936    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9937m4_if(m4_version_compare(vers_have, [$1]), -1,
9938    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9939m4_undefine([vers_have])
9940m4_undefine([maj_have])
9941m4_undefine([maj_needed])
9942]) # XORG_MACROS_VERSION
9943
9944# XORG_PROG_RAWCPP()
9945# ------------------
9946# Minimum version: 1.0.0
9947#
9948# Find cpp program and necessary flags for use in pre-processing text files
9949# such as man pages and config files
9950AC_DEFUN([XORG_PROG_RAWCPP],[
9951AC_REQUIRE([AC_PROG_CPP])
9952AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9953   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9954
9955# Check for flag to avoid builtin definitions - assumes unix is predefined,
9956# which is not the best choice for supporting other OS'es, but covers most
9957# of the ones we need for now.
9958AC_MSG_CHECKING([if $RAWCPP requires -undef])
9959AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9960if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9961	AC_MSG_RESULT([no])
9962else
9963	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9964		RAWCPPFLAGS=-undef
9965		AC_MSG_RESULT([yes])
9966	# under Cygwin unix is still defined even with -undef
9967	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9968		RAWCPPFLAGS="-undef -ansi"
9969		AC_MSG_RESULT([yes, with -ansi])
9970	else
9971		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9972	fi
9973fi
9974rm -f conftest.$ac_ext
9975
9976AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9977AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9978if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9979	AC_MSG_RESULT([no])
9980else
9981	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9982		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9983		AC_MSG_RESULT([yes])
9984	else
9985		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9986	fi
9987fi
9988rm -f conftest.$ac_ext
9989AC_SUBST(RAWCPPFLAGS)
9990]) # XORG_PROG_RAWCPP
9991
9992# XORG_MANPAGE_SECTIONS()
9993# -----------------------
9994# Minimum version: 1.0.0
9995#
9996# Determine which sections man pages go in for the different man page types
9997# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9998# Not sure if there's any better way than just hardcoding by OS name.
9999# Override default settings by setting environment variables
10000# Added MAN_SUBSTS in version 1.8
10001# Added AC_PROG_SED in version 1.8
10002
10003AC_DEFUN([XORG_MANPAGE_SECTIONS],[
10004AC_REQUIRE([AC_CANONICAL_HOST])
10005AC_REQUIRE([AC_PROG_SED])
10006
10007if test x$APP_MAN_SUFFIX = x    ; then
10008    APP_MAN_SUFFIX=1
10009fi
10010if test x$APP_MAN_DIR = x    ; then
10011    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10012fi
10013
10014if test x$LIB_MAN_SUFFIX = x    ; then
10015    LIB_MAN_SUFFIX=3
10016fi
10017if test x$LIB_MAN_DIR = x    ; then
10018    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10019fi
10020
10021if test x$FILE_MAN_SUFFIX = x    ; then
10022    case $host_os in
10023	solaris*)	FILE_MAN_SUFFIX=4  ;;
10024	*)		FILE_MAN_SUFFIX=5  ;;
10025    esac
10026fi
10027if test x$FILE_MAN_DIR = x    ; then
10028    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10029fi
10030
10031if test x$MISC_MAN_SUFFIX = x    ; then
10032    case $host_os in
10033	solaris*)	MISC_MAN_SUFFIX=5  ;;
10034	*)		MISC_MAN_SUFFIX=7  ;;
10035    esac
10036fi
10037if test x$MISC_MAN_DIR = x    ; then
10038    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10039fi
10040
10041if test x$DRIVER_MAN_SUFFIX = x    ; then
10042    case $host_os in
10043	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10044	*)		DRIVER_MAN_SUFFIX=4  ;;
10045    esac
10046fi
10047if test x$DRIVER_MAN_DIR = x    ; then
10048    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10049fi
10050
10051if test x$ADMIN_MAN_SUFFIX = x    ; then
10052    case $host_os in
10053	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10054	*)		ADMIN_MAN_SUFFIX=8  ;;
10055    esac
10056fi
10057if test x$ADMIN_MAN_DIR = x    ; then
10058    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10059fi
10060
10061
10062AC_SUBST([APP_MAN_SUFFIX])
10063AC_SUBST([LIB_MAN_SUFFIX])
10064AC_SUBST([FILE_MAN_SUFFIX])
10065AC_SUBST([MISC_MAN_SUFFIX])
10066AC_SUBST([DRIVER_MAN_SUFFIX])
10067AC_SUBST([ADMIN_MAN_SUFFIX])
10068AC_SUBST([APP_MAN_DIR])
10069AC_SUBST([LIB_MAN_DIR])
10070AC_SUBST([FILE_MAN_DIR])
10071AC_SUBST([MISC_MAN_DIR])
10072AC_SUBST([DRIVER_MAN_DIR])
10073AC_SUBST([ADMIN_MAN_DIR])
10074
10075XORG_MAN_PAGE="X Version 11"
10076AC_SUBST([XORG_MAN_PAGE])
10077MAN_SUBSTS="\
10078	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10079	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10080	-e 's|__xservername__|Xorg|g' \
10081	-e 's|__xconfigfile__|xorg.conf|g' \
10082	-e 's|__projectroot__|\$(prefix)|g' \
10083	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
10084	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
10085	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
10086	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
10087	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
10088	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
10089	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
10090AC_SUBST([MAN_SUBSTS])
10091
10092]) # XORG_MANPAGE_SECTIONS
10093
10094# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
10095# ------------------------
10096# Minimum version: 1.7.0
10097#
10098# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
10099# provided by xorg-sgml-doctools, if installed.
10100AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
10101AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
10102XORG_SGML_PATH=
10103PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
10104    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
10105    [m4_ifval([$1],[:],
10106        [if test x"$cross_compiling" != x"yes" ; then
10107            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
10108                          [XORG_SGML_PATH=$prefix/share/sgml])
10109         fi])
10110    ])
10111
10112# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10113# the path and the name of the doc stylesheet
10114if test "x$XORG_SGML_PATH" != "x" ; then
10115   AC_MSG_RESULT([$XORG_SGML_PATH])
10116   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10117   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10118else
10119   AC_MSG_RESULT([no])
10120fi
10121
10122AC_SUBST(XORG_SGML_PATH)
10123AC_SUBST(STYLESHEET_SRCDIR)
10124AC_SUBST(XSL_STYLESHEET)
10125AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10126]) # XORG_CHECK_SGML_DOCTOOLS
10127
10128# XORG_CHECK_LINUXDOC
10129# -------------------
10130# Minimum version: 1.0.0
10131#
10132# Defines the variable MAKE_TEXT if the necessary tools and
10133# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10134# Whether or not the necessary tools and files are found can be checked
10135# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10136AC_DEFUN([XORG_CHECK_LINUXDOC],[
10137AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10138AC_REQUIRE([XORG_WITH_PS2PDF])
10139
10140AC_PATH_PROG(LINUXDOC, linuxdoc)
10141
10142AC_MSG_CHECKING([whether to build documentation])
10143
10144if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10145   BUILDDOC=yes
10146else
10147   BUILDDOC=no
10148fi
10149
10150AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10151
10152AC_MSG_RESULT([$BUILDDOC])
10153
10154AC_MSG_CHECKING([whether to build pdf documentation])
10155
10156if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10157   BUILDPDFDOC=yes
10158else
10159   BUILDPDFDOC=no
10160fi
10161
10162AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10163
10164AC_MSG_RESULT([$BUILDPDFDOC])
10165
10166MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10167MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10168MAKE_PDF="$PS2PDF"
10169MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10170
10171AC_SUBST(MAKE_TEXT)
10172AC_SUBST(MAKE_PS)
10173AC_SUBST(MAKE_PDF)
10174AC_SUBST(MAKE_HTML)
10175]) # XORG_CHECK_LINUXDOC
10176
10177# XORG_CHECK_DOCBOOK
10178# -------------------
10179# Minimum version: 1.0.0
10180#
10181# Checks for the ability to build output formats from SGML DocBook source.
10182# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10183# indicates whether the necessary tools and files are found and, if set,
10184# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10185AC_DEFUN([XORG_CHECK_DOCBOOK],[
10186AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10187
10188BUILDTXTDOC=no
10189BUILDPDFDOC=no
10190BUILDPSDOC=no
10191BUILDHTMLDOC=no
10192
10193AC_PATH_PROG(DOCBOOKPS, docbook2ps)
10194AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10195AC_PATH_PROG(DOCBOOKHTML, docbook2html)
10196AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10197
10198AC_MSG_CHECKING([whether to build text documentation])
10199if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10200   test x$BUILD_TXTDOC != xno; then
10201	BUILDTXTDOC=yes
10202fi
10203AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10204AC_MSG_RESULT([$BUILDTXTDOC])
10205
10206AC_MSG_CHECKING([whether to build PDF documentation])
10207if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10208   test x$BUILD_PDFDOC != xno; then
10209	BUILDPDFDOC=yes
10210fi
10211AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10212AC_MSG_RESULT([$BUILDPDFDOC])
10213
10214AC_MSG_CHECKING([whether to build PostScript documentation])
10215if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10216   test x$BUILD_PSDOC != xno; then
10217	BUILDPSDOC=yes
10218fi
10219AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10220AC_MSG_RESULT([$BUILDPSDOC])
10221
10222AC_MSG_CHECKING([whether to build HTML documentation])
10223if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10224   test x$BUILD_HTMLDOC != xno; then
10225	BUILDHTMLDOC=yes
10226fi
10227AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10228AC_MSG_RESULT([$BUILDHTMLDOC])
10229
10230MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10231MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10232MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10233MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10234
10235AC_SUBST(MAKE_TEXT)
10236AC_SUBST(MAKE_PS)
10237AC_SUBST(MAKE_PDF)
10238AC_SUBST(MAKE_HTML)
10239]) # XORG_CHECK_DOCBOOK
10240
10241# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10242# ----------------
10243# Minimum version: 1.5.0
10244# Minimum version for optional DEFAULT argument: 1.11.0
10245#
10246# Documentation tools are not always available on all platforms and sometimes
10247# not at the appropriate level. This macro enables a module to test for the
10248# presence of the tool and obtain it's path in separate variables. Coupled with
10249# the --with-xmlto option, it allows maximum flexibilty in making decisions
10250# as whether or not to use the xmlto package. When DEFAULT is not specified,
10251# --with-xmlto assumes 'auto'.
10252#
10253# Interface to module:
10254# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10255# XMLTO:	returns the path of the xmlto program found
10256#		returns the path set by the user in the environment
10257# --with-xmlto:	'yes' user instructs the module to use xmlto
10258#		'no' user instructs the module not to use xmlto
10259#
10260# Added in version 1.10.0
10261# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10262#                  xmlto for text output requires either lynx, links, or w3m browsers
10263#
10264# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10265#
10266AC_DEFUN([XORG_WITH_XMLTO],[
10267AC_ARG_VAR([XMLTO], [Path to xmlto command])
10268m4_define([_defopt], m4_default([$2], [auto]))
10269AC_ARG_WITH(xmlto,
10270	AS_HELP_STRING([--with-xmlto],
10271	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10272	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10273m4_undefine([_defopt])
10274
10275if test "x$use_xmlto" = x"auto"; then
10276   AC_PATH_PROG([XMLTO], [xmlto])
10277   if test "x$XMLTO" = "x"; then
10278        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10279	have_xmlto=no
10280   else
10281        have_xmlto=yes
10282   fi
10283elif test "x$use_xmlto" = x"yes" ; then
10284   AC_PATH_PROG([XMLTO], [xmlto])
10285   if test "x$XMLTO" = "x"; then
10286        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10287   fi
10288   have_xmlto=yes
10289elif test "x$use_xmlto" = x"no" ; then
10290   if test "x$XMLTO" != "x"; then
10291      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10292   fi
10293   have_xmlto=no
10294else
10295   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10296fi
10297
10298# Test for a minimum version of xmlto, if provided.
10299m4_ifval([$1],
10300[if test "$have_xmlto" = yes; then
10301    # scrape the xmlto version
10302    AC_MSG_CHECKING([the xmlto version])
10303    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10304    AC_MSG_RESULT([$xmlto_version])
10305    AS_VERSION_COMPARE([$xmlto_version], [$1],
10306        [if test "x$use_xmlto" = xauto; then
10307            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10308            have_xmlto=no
10309        else
10310            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10311        fi])
10312fi])
10313
10314# Test for the ability of xmlto to generate a text target
10315have_xmlto_text=no
10316cat > conftest.xml << "EOF"
10317EOF
10318AS_IF([test "$have_xmlto" = yes],
10319      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10320             [have_xmlto_text=yes],
10321             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10322rm -f conftest.xml
10323AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10324AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10325]) # XORG_WITH_XMLTO
10326
10327# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10328# --------------------------------------------
10329# Minimum version: 1.12.0
10330# Minimum version for optional DEFAULT argument: 1.12.0
10331#
10332# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10333# XML-based language used for the transformation of XML documents.
10334# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10335# It is used under the cover by xmlto to generate html files from DocBook/XML.
10336# The XSLT processor is often used as a standalone tool for transformations.
10337# It should not be assumed that this tool is used only to work with documnetation.
10338# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10339#
10340# Interface to module:
10341# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10342# XSLTPROC:	 returns the path of the xsltproc program found
10343#		 returns the path set by the user in the environment
10344# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10345#		  'no' user instructs the module not to use xsltproc
10346# have_xsltproc: returns yes if xsltproc found in PATH or no
10347#
10348# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10349#
10350AC_DEFUN([XORG_WITH_XSLTPROC],[
10351AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10352# Preserves the interface, should it be implemented later
10353m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10354m4_define([_defopt], m4_default([$2], [auto]))
10355AC_ARG_WITH(xsltproc,
10356	AS_HELP_STRING([--with-xsltproc],
10357	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10358	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10359m4_undefine([_defopt])
10360
10361if test "x$use_xsltproc" = x"auto"; then
10362   AC_PATH_PROG([XSLTPROC], [xsltproc])
10363   if test "x$XSLTPROC" = "x"; then
10364        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10365	have_xsltproc=no
10366   else
10367        have_xsltproc=yes
10368   fi
10369elif test "x$use_xsltproc" = x"yes" ; then
10370   AC_PATH_PROG([XSLTPROC], [xsltproc])
10371   if test "x$XSLTPROC" = "x"; then
10372        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10373   fi
10374   have_xsltproc=yes
10375elif test "x$use_xsltproc" = x"no" ; then
10376   if test "x$XSLTPROC" != "x"; then
10377      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10378   fi
10379   have_xsltproc=no
10380else
10381   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10382fi
10383
10384AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10385]) # XORG_WITH_XSLTPROC
10386
10387# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10388# ----------------------------------------
10389# Minimum version: 1.15.0
10390#
10391# PERL (Practical Extraction and Report Language) is a language optimized for
10392# scanning arbitrary text files, extracting information from those text files,
10393# and printing reports based on that information.
10394#
10395# When DEFAULT is not specified, --with-perl assumes 'auto'.
10396#
10397# Interface to module:
10398# HAVE_PERL: used in makefiles to conditionally scan text files
10399# PERL:	     returns the path of the perl program found
10400#	     returns the path set by the user in the environment
10401# --with-perl: 'yes' user instructs the module to use perl
10402#	       'no' user instructs the module not to use perl
10403# have_perl: returns yes if perl found in PATH or no
10404#
10405# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10406#
10407AC_DEFUN([XORG_WITH_PERL],[
10408AC_ARG_VAR([PERL], [Path to perl command])
10409# Preserves the interface, should it be implemented later
10410m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10411m4_define([_defopt], m4_default([$2], [auto]))
10412AC_ARG_WITH(perl,
10413	AS_HELP_STRING([--with-perl],
10414	   [Use perl for extracting information from files (default: ]_defopt[)]),
10415	   [use_perl=$withval], [use_perl=]_defopt)
10416m4_undefine([_defopt])
10417
10418if test "x$use_perl" = x"auto"; then
10419   AC_PATH_PROG([PERL], [perl])
10420   if test "x$PERL" = "x"; then
10421        AC_MSG_WARN([perl not found - cannot extract information and report])
10422	have_perl=no
10423   else
10424        have_perl=yes
10425   fi
10426elif test "x$use_perl" = x"yes" ; then
10427   AC_PATH_PROG([PERL], [perl])
10428   if test "x$PERL" = "x"; then
10429        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10430   fi
10431   have_perl=yes
10432elif test "x$use_perl" = x"no" ; then
10433   if test "x$PERL" != "x"; then
10434      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10435   fi
10436   have_perl=no
10437else
10438   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10439fi
10440
10441AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10442]) # XORG_WITH_PERL
10443
10444# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10445# ----------------
10446# Minimum version: 1.5.0
10447# Minimum version for optional DEFAULT argument: 1.11.0
10448#
10449# Documentation tools are not always available on all platforms and sometimes
10450# not at the appropriate level. This macro enables a module to test for the
10451# presence of the tool and obtain it's path in separate variables. Coupled with
10452# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10453# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10454# --with-asciidoc assumes 'auto'.
10455#
10456# Interface to module:
10457# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10458# ASCIIDOC:	 returns the path of the asciidoc program found
10459#		 returns the path set by the user in the environment
10460# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10461#		  'no' user instructs the module not to use asciidoc
10462#
10463# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10464#
10465AC_DEFUN([XORG_WITH_ASCIIDOC],[
10466AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10467m4_define([_defopt], m4_default([$2], [auto]))
10468AC_ARG_WITH(asciidoc,
10469	AS_HELP_STRING([--with-asciidoc],
10470	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10471	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10472m4_undefine([_defopt])
10473
10474if test "x$use_asciidoc" = x"auto"; then
10475   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10476   if test "x$ASCIIDOC" = "x"; then
10477        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10478	have_asciidoc=no
10479   else
10480        have_asciidoc=yes
10481   fi
10482elif test "x$use_asciidoc" = x"yes" ; then
10483   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10484   if test "x$ASCIIDOC" = "x"; then
10485        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10486   fi
10487   have_asciidoc=yes
10488elif test "x$use_asciidoc" = x"no" ; then
10489   if test "x$ASCIIDOC" != "x"; then
10490      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10491   fi
10492   have_asciidoc=no
10493else
10494   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10495fi
10496m4_ifval([$1],
10497[if test "$have_asciidoc" = yes; then
10498    # scrape the asciidoc version
10499    AC_MSG_CHECKING([the asciidoc version])
10500    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10501    AC_MSG_RESULT([$asciidoc_version])
10502    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10503        [if test "x$use_asciidoc" = xauto; then
10504            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10505            have_asciidoc=no
10506        else
10507            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10508        fi])
10509fi])
10510AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10511]) # XORG_WITH_ASCIIDOC
10512
10513# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10514# -------------------------------------------
10515# Minimum version: 1.5.0
10516# Minimum version for optional DEFAULT argument: 1.11.0
10517# Minimum version for optional DOT checking: 1.18.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])
10537AC_ARG_VAR([DOT], [Path to the dot graphics utility])
10538m4_define([_defopt], m4_default([$2], [auto]))
10539AC_ARG_WITH(doxygen,
10540	AS_HELP_STRING([--with-doxygen],
10541	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10542	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10543m4_undefine([_defopt])
10544
10545if test "x$use_doxygen" = x"auto"; then
10546   AC_PATH_PROG([DOXYGEN], [doxygen])
10547   if test "x$DOXYGEN" = "x"; then
10548        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10549	have_doxygen=no
10550   else
10551        have_doxygen=yes
10552   fi
10553elif test "x$use_doxygen" = x"yes" ; then
10554   AC_PATH_PROG([DOXYGEN], [doxygen])
10555   if test "x$DOXYGEN" = "x"; then
10556        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10557   fi
10558   have_doxygen=yes
10559elif test "x$use_doxygen" = x"no" ; then
10560   if test "x$DOXYGEN" != "x"; then
10561      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10562   fi
10563   have_doxygen=no
10564else
10565   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10566fi
10567m4_ifval([$1],
10568[if test "$have_doxygen" = yes; then
10569    # scrape the doxygen version
10570    AC_MSG_CHECKING([the doxygen version])
10571    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10572    AC_MSG_RESULT([$doxygen_version])
10573    AS_VERSION_COMPARE([$doxygen_version], [$1],
10574        [if test "x$use_doxygen" = xauto; then
10575            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10576            have_doxygen=no
10577        else
10578            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10579        fi])
10580fi])
10581
10582dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10583dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10584dnl 	HAVE_DOT = @HAVE_DOT@
10585HAVE_DOT=no
10586if test "x$have_doxygen" = "xyes"; then
10587  AC_PATH_PROG([DOT], [dot])
10588    if test "x$DOT" != "x"; then
10589      HAVE_DOT=yes
10590    fi
10591fi
10592
10593AC_SUBST([HAVE_DOT])
10594AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
10595AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10596]) # XORG_WITH_DOXYGEN
10597
10598# XORG_WITH_GROFF([DEFAULT])
10599# ----------------
10600# Minimum version: 1.6.0
10601# Minimum version for optional DEFAULT argument: 1.11.0
10602#
10603# Documentation tools are not always available on all platforms and sometimes
10604# not at the appropriate level. This macro enables a module to test for the
10605# presence of the tool and obtain it's path in separate variables. Coupled with
10606# the --with-groff option, it allows maximum flexibilty in making decisions
10607# as whether or not to use the groff package. When DEFAULT is not specified,
10608# --with-groff assumes 'auto'.
10609#
10610# Interface to module:
10611# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10612# HAVE_GROFF_MM: the memorandum macros (-mm) package
10613# HAVE_GROFF_MS: the -ms macros package
10614# GROFF:	 returns the path of the groff program found
10615#		 returns the path set by the user in the environment
10616# --with-groff:	 'yes' user instructs the module to use groff
10617#		 'no' user instructs the module not to use groff
10618#
10619# Added in version 1.9.0:
10620# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10621#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10622#		   psselect from the psutils package.
10623#		   the ghostcript package. Refer to the grohtml man pages
10624#
10625# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10626#
10627# OS and distros often splits groff in a basic and full package, the former
10628# having the groff program and the later having devices, fonts and macros
10629# Checking for the groff executable is not enough.
10630#
10631# If macros are missing, we cannot assume that groff is useless, so we don't
10632# unset HAVE_GROFF or GROFF env variables.
10633# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10634#
10635AC_DEFUN([XORG_WITH_GROFF],[
10636AC_ARG_VAR([GROFF], [Path to groff command])
10637m4_define([_defopt], m4_default([$1], [auto]))
10638AC_ARG_WITH(groff,
10639	AS_HELP_STRING([--with-groff],
10640	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10641	   [use_groff=$withval], [use_groff=]_defopt)
10642m4_undefine([_defopt])
10643
10644if test "x$use_groff" = x"auto"; then
10645   AC_PATH_PROG([GROFF], [groff])
10646   if test "x$GROFF" = "x"; then
10647        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10648	have_groff=no
10649   else
10650        have_groff=yes
10651   fi
10652elif test "x$use_groff" = x"yes" ; then
10653   AC_PATH_PROG([GROFF], [groff])
10654   if test "x$GROFF" = "x"; then
10655        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10656   fi
10657   have_groff=yes
10658elif test "x$use_groff" = x"no" ; then
10659   if test "x$GROFF" != "x"; then
10660      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10661   fi
10662   have_groff=no
10663else
10664   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10665fi
10666
10667# We have groff, test for the presence of the macro packages
10668if test "x$have_groff" = x"yes"; then
10669    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10670    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10671        groff_ms_works=yes
10672    else
10673        groff_ms_works=no
10674    fi
10675    AC_MSG_RESULT([$groff_ms_works])
10676    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10677    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10678        groff_mm_works=yes
10679    else
10680        groff_mm_works=no
10681    fi
10682    AC_MSG_RESULT([$groff_mm_works])
10683fi
10684
10685# We have groff, test for HTML dependencies, one command per package
10686if test "x$have_groff" = x"yes"; then
10687   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10688   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10689   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10690   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10691      have_groff_html=yes
10692   else
10693      have_groff_html=no
10694      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10695   fi
10696fi
10697
10698# Set Automake conditionals for Makefiles
10699AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10700AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10701AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10702AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10703]) # XORG_WITH_GROFF
10704
10705# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10706# ---------------------------------------
10707# Minimum version: 1.6.0
10708# Minimum version for optional DEFAULT argument: 1.11.0
10709# Minimum version for optional MIN-VERSION argument: 1.15.0
10710#
10711# Documentation tools are not always available on all platforms and sometimes
10712# not at the appropriate level. This macro enables a module to test for the
10713# presence of the tool and obtain it's path in separate variables. Coupled with
10714# the --with-fop option, it allows maximum flexibilty in making decisions
10715# as whether or not to use the fop package. When DEFAULT is not specified,
10716# --with-fop assumes 'auto'.
10717#
10718# Interface to module:
10719# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10720# FOP:	 	returns the path of the fop program found
10721#		returns the path set by the user in the environment
10722# --with-fop: 	'yes' user instructs the module to use fop
10723#		'no' user instructs the module not to use fop
10724#
10725# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10726#
10727AC_DEFUN([XORG_WITH_FOP],[
10728AC_ARG_VAR([FOP], [Path to fop command])
10729m4_define([_defopt], m4_default([$2], [auto]))
10730AC_ARG_WITH(fop,
10731	AS_HELP_STRING([--with-fop],
10732	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10733	   [use_fop=$withval], [use_fop=]_defopt)
10734m4_undefine([_defopt])
10735
10736if test "x$use_fop" = x"auto"; then
10737   AC_PATH_PROG([FOP], [fop])
10738   if test "x$FOP" = "x"; then
10739        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10740	have_fop=no
10741   else
10742        have_fop=yes
10743   fi
10744elif test "x$use_fop" = x"yes" ; then
10745   AC_PATH_PROG([FOP], [fop])
10746   if test "x$FOP" = "x"; then
10747        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10748   fi
10749   have_fop=yes
10750elif test "x$use_fop" = x"no" ; then
10751   if test "x$FOP" != "x"; then
10752      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10753   fi
10754   have_fop=no
10755else
10756   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10757fi
10758
10759# Test for a minimum version of fop, if provided.
10760m4_ifval([$1],
10761[if test "$have_fop" = yes; then
10762    # scrape the fop version
10763    AC_MSG_CHECKING([for fop minimum version])
10764    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10765    AC_MSG_RESULT([$fop_version])
10766    AS_VERSION_COMPARE([$fop_version], [$1],
10767        [if test "x$use_fop" = xauto; then
10768            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10769            have_fop=no
10770        else
10771            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10772        fi])
10773fi])
10774AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10775]) # XORG_WITH_FOP
10776
10777# XORG_WITH_M4([MIN-VERSION])
10778# ---------------------------
10779# Minimum version: 1.19.0
10780#
10781# This macro attempts to locate an m4 macro processor which supports
10782# -I option and is only useful for modules relying on M4 in order to
10783# expand macros in source code files.
10784#
10785# Interface to module:
10786# M4:	 	returns the path of the m4 program found
10787#		returns the path set by the user in the environment
10788#
10789AC_DEFUN([XORG_WITH_M4], [
10790AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10791   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10792       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10793         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10794   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10795   [$PATH:/usr/gnu/bin])])
10796
10797AC_SUBST([M4], [$ac_cv_path_M4])
10798]) # XORG_WITH_M4
10799
10800# XORG_WITH_PS2PDF([DEFAULT])
10801# ----------------
10802# Minimum version: 1.6.0
10803# Minimum version for optional DEFAULT argument: 1.11.0
10804#
10805# Documentation tools are not always available on all platforms and sometimes
10806# not at the appropriate level. This macro enables a module to test for the
10807# presence of the tool and obtain it's path in separate variables. Coupled with
10808# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10809# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10810# --with-ps2pdf assumes 'auto'.
10811#
10812# Interface to module:
10813# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10814# PS2PDF:	returns the path of the ps2pdf program found
10815#		returns the path set by the user in the environment
10816# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10817#		 'no' user instructs the module not to use ps2pdf
10818#
10819# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10820#
10821AC_DEFUN([XORG_WITH_PS2PDF],[
10822AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10823m4_define([_defopt], m4_default([$1], [auto]))
10824AC_ARG_WITH(ps2pdf,
10825	AS_HELP_STRING([--with-ps2pdf],
10826	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10827	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10828m4_undefine([_defopt])
10829
10830if test "x$use_ps2pdf" = x"auto"; then
10831   AC_PATH_PROG([PS2PDF], [ps2pdf])
10832   if test "x$PS2PDF" = "x"; then
10833        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10834	have_ps2pdf=no
10835   else
10836        have_ps2pdf=yes
10837   fi
10838elif test "x$use_ps2pdf" = x"yes" ; then
10839   AC_PATH_PROG([PS2PDF], [ps2pdf])
10840   if test "x$PS2PDF" = "x"; then
10841        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10842   fi
10843   have_ps2pdf=yes
10844elif test "x$use_ps2pdf" = x"no" ; then
10845   if test "x$PS2PDF" != "x"; then
10846      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10847   fi
10848   have_ps2pdf=no
10849else
10850   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10851fi
10852AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10853]) # XORG_WITH_PS2PDF
10854
10855# XORG_ENABLE_DOCS (enable_docs=yes)
10856# ----------------
10857# Minimum version: 1.6.0
10858#
10859# Documentation tools are not always available on all platforms and sometimes
10860# not at the appropriate level. This macro enables a builder to skip all
10861# documentation targets except traditional man pages.
10862# Combined with the specific tool checking macros XORG_WITH_*, it provides
10863# maximum flexibilty in controlling documentation building.
10864# Refer to:
10865# XORG_WITH_XMLTO         --with-xmlto
10866# XORG_WITH_ASCIIDOC      --with-asciidoc
10867# XORG_WITH_DOXYGEN       --with-doxygen
10868# XORG_WITH_FOP           --with-fop
10869# XORG_WITH_GROFF         --with-groff
10870# XORG_WITH_PS2PDF        --with-ps2pdf
10871#
10872# Interface to module:
10873# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10874# --enable-docs: 'yes' user instructs the module to generate docs
10875#		 'no' user instructs the module not to generate docs
10876# parm1:	specify the default value, yes or no.
10877#
10878AC_DEFUN([XORG_ENABLE_DOCS],[
10879m4_define([docs_default], m4_default([$1], [yes]))
10880AC_ARG_ENABLE(docs,
10881	AS_HELP_STRING([--enable-docs],
10882	   [Enable building the documentation (default: ]docs_default[)]),
10883	   [build_docs=$enableval], [build_docs=]docs_default)
10884m4_undefine([docs_default])
10885AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10886AC_MSG_CHECKING([whether to build documentation])
10887AC_MSG_RESULT([$build_docs])
10888]) # XORG_ENABLE_DOCS
10889
10890# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10891# ----------------
10892# Minimum version: 1.6.0
10893#
10894# This macro enables a builder to skip all developer documentation.
10895# Combined with the specific tool checking macros XORG_WITH_*, it provides
10896# maximum flexibilty in controlling documentation building.
10897# Refer to:
10898# XORG_WITH_XMLTO         --with-xmlto
10899# XORG_WITH_ASCIIDOC      --with-asciidoc
10900# XORG_WITH_DOXYGEN       --with-doxygen
10901# XORG_WITH_FOP           --with-fop
10902# XORG_WITH_GROFF         --with-groff
10903# XORG_WITH_PS2PDF        --with-ps2pdf
10904#
10905# Interface to module:
10906# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10907# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10908#			'no' user instructs the module not to generate developer docs
10909# parm1:		specify the default value, yes or no.
10910#
10911AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10912m4_define([devel_default], m4_default([$1], [yes]))
10913AC_ARG_ENABLE(devel-docs,
10914	AS_HELP_STRING([--enable-devel-docs],
10915	   [Enable building the developer documentation (default: ]devel_default[)]),
10916	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10917m4_undefine([devel_default])
10918AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10919AC_MSG_CHECKING([whether to build developer documentation])
10920AC_MSG_RESULT([$build_devel_docs])
10921]) # XORG_ENABLE_DEVEL_DOCS
10922
10923# XORG_ENABLE_SPECS (enable_specs=yes)
10924# ----------------
10925# Minimum version: 1.6.0
10926#
10927# This macro enables a builder to skip all functional specification targets.
10928# Combined with the specific tool checking macros XORG_WITH_*, it provides
10929# maximum flexibilty in controlling documentation building.
10930# Refer to:
10931# XORG_WITH_XMLTO         --with-xmlto
10932# XORG_WITH_ASCIIDOC      --with-asciidoc
10933# XORG_WITH_DOXYGEN       --with-doxygen
10934# XORG_WITH_FOP           --with-fop
10935# XORG_WITH_GROFF         --with-groff
10936# XORG_WITH_PS2PDF        --with-ps2pdf
10937#
10938# Interface to module:
10939# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10940# --enable-specs:	'yes' user instructs the module to generate specs
10941#			'no' user instructs the module not to generate specs
10942# parm1:		specify the default value, yes or no.
10943#
10944AC_DEFUN([XORG_ENABLE_SPECS],[
10945m4_define([spec_default], m4_default([$1], [yes]))
10946AC_ARG_ENABLE(specs,
10947	AS_HELP_STRING([--enable-specs],
10948	   [Enable building the specs (default: ]spec_default[)]),
10949	   [build_specs=$enableval], [build_specs=]spec_default)
10950m4_undefine([spec_default])
10951AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10952AC_MSG_CHECKING([whether to build functional specifications])
10953AC_MSG_RESULT([$build_specs])
10954]) # XORG_ENABLE_SPECS
10955
10956# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10957# ----------------------------------------------
10958# Minimum version: 1.13.0
10959#
10960# This macro enables a builder to enable/disable unit testing
10961# It makes no assumption about the test cases implementation
10962# Test cases may or may not use Automake "Support for test suites"
10963# They may or may not use the software utility library GLib
10964#
10965# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10966# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10967# The variable enable_unit_tests is used by other macros in this file.
10968#
10969# Interface to module:
10970# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10971# enable_unit_tests:    used in configure.ac for additional configuration
10972# --enable-unit-tests:	'yes' user instructs the module to build tests
10973#			'no' user instructs the module not to build tests
10974# parm1:		specify the default value, yes or no.
10975#
10976AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10977AC_BEFORE([$0], [XORG_WITH_GLIB])
10978AC_BEFORE([$0], [XORG_LD_WRAP])
10979AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10980m4_define([_defopt], m4_default([$1], [auto]))
10981AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10982	[Enable building unit test cases (default: ]_defopt[)]),
10983	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10984m4_undefine([_defopt])
10985AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10986AC_MSG_CHECKING([whether to build unit test cases])
10987AC_MSG_RESULT([$enable_unit_tests])
10988]) # XORG_ENABLE_UNIT_TESTS
10989
10990# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10991# ------------------------------------------------------
10992# Minimum version: 1.17.0
10993#
10994# This macro enables a builder to enable/disable integration testing
10995# It makes no assumption about the test cases' implementation
10996# Test cases may or may not use Automake "Support for test suites"
10997#
10998# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10999# usually requires less dependencies and may be built and run under less
11000# stringent environments than integration tests.
11001#
11002# Interface to module:
11003# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
11004# enable_integration_tests:   used in configure.ac for additional configuration
11005# --enable-integration-tests: 'yes' user instructs the module to build tests
11006#                             'no' user instructs the module not to build tests
11007# parm1:                      specify the default value, yes or no.
11008#
11009AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
11010AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
11011m4_define([_defopt], m4_default([$1], [auto]))
11012AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
11013	[Enable building integration test cases (default: ]_defopt[)]),
11014	[enable_integration_tests=$enableval],
11015	[enable_integration_tests=]_defopt)
11016m4_undefine([_defopt])
11017AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
11018	[test "x$enable_integration_tests" != xno])
11019AC_MSG_CHECKING([whether to build unit test cases])
11020AC_MSG_RESULT([$enable_integration_tests])
11021]) # XORG_ENABLE_INTEGRATION_TESTS
11022
11023# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
11024# ----------------------------------------
11025# Minimum version: 1.13.0
11026#
11027# GLib is a library which provides advanced data structures and functions.
11028# This macro enables a module to test for the presence of Glib.
11029#
11030# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
11031# Otherwise the value of $enable_unit_tests is blank.
11032#
11033# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
11034# test support usually requires less dependencies and may be built and run under
11035# less stringent environments than integration tests.
11036#
11037# Interface to module:
11038# HAVE_GLIB: used in makefiles to conditionally build targets
11039# with_glib: used in configure.ac to know if GLib has been found
11040# --with-glib:	'yes' user instructs the module to use glib
11041#		'no' user instructs the module not to use glib
11042#
11043AC_DEFUN([XORG_WITH_GLIB],[
11044AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11045m4_define([_defopt], m4_default([$2], [auto]))
11046AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
11047	[Use GLib library for unit testing (default: ]_defopt[)]),
11048	[with_glib=$withval], [with_glib=]_defopt)
11049m4_undefine([_defopt])
11050
11051have_glib=no
11052# Do not probe GLib if user explicitly disabled unit testing
11053if test "x$enable_unit_tests" != x"no"; then
11054  # Do not probe GLib if user explicitly disabled it
11055  if test "x$with_glib" != x"no"; then
11056    m4_ifval(
11057      [$1],
11058      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
11059      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
11060    )
11061  fi
11062fi
11063
11064# Not having GLib when unit testing has been explicitly requested is an error
11065if test "x$enable_unit_tests" = x"yes"; then
11066  if test "x$have_glib" = x"no"; then
11067    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11068  fi
11069fi
11070
11071# Having unit testing disabled when GLib has been explicitly requested is an error
11072if test "x$enable_unit_tests" = x"no"; then
11073  if test "x$with_glib" = x"yes"; then
11074    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11075  fi
11076fi
11077
11078# Not having GLib when it has been explicitly requested is an error
11079if test "x$with_glib" = x"yes"; then
11080  if test "x$have_glib" = x"no"; then
11081    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
11082  fi
11083fi
11084
11085AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
11086]) # XORG_WITH_GLIB
11087
11088# XORG_LD_WRAP([required|optional])
11089# ---------------------------------
11090# Minimum version: 1.13.0
11091#
11092# Check if linker supports -wrap, passed via compiler flags
11093#
11094# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
11095# Otherwise the value of $enable_unit_tests is blank.
11096#
11097# Argument added in 1.16.0 - default is "required", to match existing behavior
11098# of returning an error if enable_unit_tests is yes, and ld -wrap is not
11099# available, an argument of "optional" allows use when some unit tests require
11100# ld -wrap and others do not.
11101#
11102AC_DEFUN([XORG_LD_WRAP],[
11103XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
11104    [AC_LANG_PROGRAM([#include <stdlib.h>
11105                      void __wrap_exit(int status) { return; }],
11106                     [exit(0);])])
11107# Not having ld wrap when unit testing has been explicitly requested is an error
11108if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
11109  if test "x$have_ld_wrap" = x"no"; then
11110    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
11111  fi
11112fi
11113AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
11114#
11115]) # XORG_LD_WRAP
11116
11117# XORG_CHECK_LINKER_FLAGS
11118# -----------------------
11119# SYNOPSIS
11120#
11121#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
11122#
11123# DESCRIPTION
11124#
11125#   Check whether the given linker FLAGS work with the current language's
11126#   linker, or whether they give an error.
11127#
11128#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
11129#   success/failure.
11130#
11131#   PROGRAM-SOURCE is the program source to link with, if needed
11132#
11133#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
11134#
11135# LICENSE
11136#
11137#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
11138#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
11139#   Copyright (c) 2009 Matteo Frigo
11140#
11141#   This program is free software: you can redistribute it and/or modify it
11142#   under the terms of the GNU General Public License as published by the
11143#   Free Software Foundation, either version 3 of the License, or (at your
11144#   option) any later version.
11145#
11146#   This program is distributed in the hope that it will be useful, but
11147#   WITHOUT ANY WARRANTY; without even the implied warranty of
11148#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11149#   Public License for more details.
11150#
11151#   You should have received a copy of the GNU General Public License along
11152#   with this program. If not, see <http://www.gnu.org/licenses/>.
11153#
11154#   As a special exception, the respective Autoconf Macro's copyright owner
11155#   gives unlimited permission to copy, distribute and modify the configure
11156#   scripts that are the output of Autoconf when processing the Macro. You
11157#   need not follow the terms of the GNU General Public License when using
11158#   or distributing such scripts, even though portions of the text of the
11159#   Macro appear in them. The GNU General Public License (GPL) does govern
11160#   all other use of the material that constitutes the Autoconf Macro.
11161#
11162#   This special exception to the GPL applies to versions of the Autoconf
11163#   Macro released by the Autoconf Archive. When you make and distribute a
11164#   modified version of the Autoconf Macro, you may extend this special
11165#   exception to the GPL to apply to your modified version as well.#
11166AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11167[AC_MSG_CHECKING([whether the linker accepts $1])
11168dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11169AS_LITERAL_IF([$1],
11170  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11171      ax_save_FLAGS=$LDFLAGS
11172      LDFLAGS="$1"
11173      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11174        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11175        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11176      LDFLAGS=$ax_save_FLAGS])],
11177  [ax_save_FLAGS=$LDFLAGS
11178   LDFLAGS="$1"
11179   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11180     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11181     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11182   LDFLAGS=$ax_save_FLAGS])
11183eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11184AC_MSG_RESULT($xorg_check_linker_flags)
11185if test "x$xorg_check_linker_flags" = xyes; then
11186	m4_default([$2], :)
11187else
11188	m4_default([$3], :)
11189fi
11190]) # XORG_CHECK_LINKER_FLAGS
11191
11192# XORG_MEMORY_CHECK_FLAGS
11193# -----------------------
11194# Minimum version: 1.16.0
11195#
11196# This macro attempts to find appropriate memory checking functionality
11197# for various platforms which unit testing code may use to catch various
11198# forms of memory allocation and access errors in testing.
11199#
11200# Interface to module:
11201# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11202#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11203#
11204# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11205#
11206AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11207
11208AC_REQUIRE([AC_CANONICAL_HOST])
11209AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11210           [Environment variables to enable memory checking in tests])
11211
11212# Check for different types of support on different platforms
11213case $host_os in
11214    solaris*)
11215        AC_CHECK_LIB([umem], [umem_alloc],
11216            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11217        ;;
11218    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11219        # both directly and inverted, so should not be 0 or 255.
11220        malloc_debug_env='MALLOC_PERTURB_=15'
11221        ;;
11222    darwin*)
11223        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11224        ;;
11225    *bsd*)
11226        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11227        ;;
11228esac
11229
11230# User supplied flags override default flags
11231if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11232    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11233fi
11234
11235AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11236]) # XORG_WITH_LINT
11237
11238# XORG_CHECK_MALLOC_ZERO
11239# ----------------------
11240# Minimum version: 1.0.0
11241#
11242# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11243# malloc(0) returns NULL.  Packages should add one of these cflags to
11244# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11245AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11246AC_ARG_ENABLE(malloc0returnsnull,
11247	AS_HELP_STRING([--enable-malloc0returnsnull],
11248		       [malloc(0) returns NULL (default: auto)]),
11249	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11250	[MALLOC_ZERO_RETURNS_NULL=auto])
11251
11252AC_MSG_CHECKING([whether malloc(0) returns NULL])
11253if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11254AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
11255	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
11256#include <stdlib.h>
11257],[
11258    char *m0, *r0, *c0, *p;
11259    m0 = malloc(0);
11260    p = malloc(10);
11261    r0 = realloc(p,0);
11262    c0 = calloc(0,10);
11263    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11264])],
11265		[xorg_cv_malloc0_returns_null=yes],
11266		[xorg_cv_malloc0_returns_null=no])])
11267MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
11268fi
11269AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11270
11271if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11272	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11273	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11274	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11275else
11276	MALLOC_ZERO_CFLAGS=""
11277	XMALLOC_ZERO_CFLAGS=""
11278	XTMALLOC_ZERO_CFLAGS=""
11279fi
11280
11281AC_SUBST([MALLOC_ZERO_CFLAGS])
11282AC_SUBST([XMALLOC_ZERO_CFLAGS])
11283AC_SUBST([XTMALLOC_ZERO_CFLAGS])
11284]) # XORG_CHECK_MALLOC_ZERO
11285
11286# XORG_WITH_LINT()
11287# ----------------
11288# Minimum version: 1.1.0
11289#
11290# This macro enables the use of a tool that flags some suspicious and
11291# non-portable constructs (likely to be bugs) in C language source code.
11292# It will attempt to locate the tool and use appropriate options.
11293# There are various lint type tools on different platforms.
11294#
11295# Interface to module:
11296# LINT:		returns the path to the tool found on the platform
11297#		or the value set to LINT on the configure cmd line
11298#		also an Automake conditional
11299# LINT_FLAGS:	an Automake variable with appropriate flags
11300#
11301# --with-lint:	'yes' user instructs the module to use lint
11302#		'no' user instructs the module not to use lint (default)
11303#
11304# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11305# If the user sets the value of LINT_FLAGS, they are used verbatim.
11306#
11307AC_DEFUN([XORG_WITH_LINT],[
11308
11309AC_ARG_VAR([LINT], [Path to a lint-style command])
11310AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11311AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11312		[Use a lint-style source code checker (default: disabled)])],
11313		[use_lint=$withval], [use_lint=no])
11314
11315# Obtain platform specific info like program name and options
11316# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11317case $host_os in
11318  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11319	lint_name=splint
11320	lint_options="-badflag"
11321	;;
11322  *freebsd* | *netbsd*)
11323	lint_name=lint
11324	lint_options="-u -b"
11325	;;
11326  *solaris*)
11327	lint_name=lint
11328	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11329	;;
11330esac
11331
11332# Test for the presence of the program (either guessed by the code or spelled out by the user)
11333if test "x$use_lint" = x"yes" ; then
11334   AC_PATH_PROG([LINT], [$lint_name])
11335   if test "x$LINT" = "x"; then
11336        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11337   fi
11338elif test "x$use_lint" = x"no" ; then
11339   if test "x$LINT" != "x"; then
11340      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11341   fi
11342else
11343   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11344fi
11345
11346# User supplied flags override default flags
11347if test "x$LINT_FLAGS" != "x"; then
11348   lint_options=$LINT_FLAGS
11349fi
11350
11351AC_SUBST([LINT_FLAGS],[$lint_options])
11352AM_CONDITIONAL(LINT, [test "x$LINT" != x])
11353
11354]) # XORG_WITH_LINT
11355
11356# XORG_LINT_LIBRARY(LIBNAME)
11357# --------------------------
11358# Minimum version: 1.1.0
11359#
11360# Sets up flags for building lint libraries for checking programs that call
11361# functions in the library.
11362#
11363# Interface to module:
11364# LINTLIB		- Automake variable with the name of lint library file to make
11365# MAKE_LINT_LIB		- Automake conditional
11366#
11367# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11368#			  - 'no' user instructs the module not to create a lint library (default)
11369
11370AC_DEFUN([XORG_LINT_LIBRARY],[
11371AC_REQUIRE([XORG_WITH_LINT])
11372AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11373	[Create lint library (default: disabled)])],
11374	[make_lint_lib=$enableval], [make_lint_lib=no])
11375
11376if test "x$make_lint_lib" = x"yes" ; then
11377   LINTLIB=llib-l$1.ln
11378   if test "x$LINT" = "x"; then
11379        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11380   fi
11381elif test "x$make_lint_lib" != x"no" ; then
11382   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11383fi
11384
11385AC_SUBST(LINTLIB)
11386AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11387
11388]) # XORG_LINT_LIBRARY
11389
11390# XORG_COMPILER_BRAND
11391# -------------------
11392# Minimum version: 1.14.0
11393#
11394# Checks for various brands of compilers and sets flags as appropriate:
11395#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11396#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11397#   clang compiler - sets CLANGCC to "yes"
11398#   Intel compiler - sets INTELCC to "yes"
11399#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11400#
11401AC_DEFUN([XORG_COMPILER_BRAND], [
11402AC_LANG_CASE(
11403	[C], [
11404		AC_REQUIRE([AC_PROG_CC_C99])
11405	],
11406	[C++], [
11407		AC_REQUIRE([AC_PROG_CXX])
11408	]
11409)
11410AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11411AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11412AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11413]) # XORG_COMPILER_BRAND
11414
11415# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11416# ---------------
11417# Minimum version: 1.16.0
11418#
11419# Test if the compiler works when passed the given flag as a command line argument.
11420# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11421# next flag in the list until there are no more options.
11422#
11423# Note that this does not guarantee that the compiler supports the flag as some
11424# compilers will simply ignore arguments that they do not understand, but we do
11425# attempt to weed out false positives by using -Werror=unknown-warning-option and
11426# -Werror=unused-command-line-argument
11427#
11428AC_DEFUN([XORG_TESTSET_CFLAG], [
11429m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11430m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11431
11432AC_LANG_COMPILER_REQUIRE
11433
11434AC_LANG_CASE(
11435	[C], [
11436		AC_REQUIRE([AC_PROG_CC_C99])
11437		define([PREFIX], [C])
11438		define([CACHE_PREFIX], [cc])
11439		define([COMPILER], [$CC])
11440	],
11441	[C++], [
11442		define([PREFIX], [CXX])
11443		define([CACHE_PREFIX], [cxx])
11444		define([COMPILER], [$CXX])
11445	]
11446)
11447
11448[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11449
11450if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11451	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11452	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11453			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11454			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11455					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11456					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11457	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11458	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11459fi
11460
11461if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11462	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11463		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11464	fi
11465	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11466	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11467			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11468			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11469					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11470					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11471	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11472	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11473fi
11474
11475found="no"
11476m4_foreach([flag], m4_cdr($@), [
11477	if test $found = "no" ; then
11478		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
11479			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11480		fi
11481
11482		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
11483			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11484		fi
11485
11486		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11487
11488dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11489		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11490		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11491		AC_CACHE_VAL($cacheid,
11492			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11493					     [eval $cacheid=yes],
11494					     [eval $cacheid=no])])
11495
11496		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11497
11498		eval supported=\$$cacheid
11499		AC_MSG_RESULT([$supported])
11500		if test "$supported" = "yes" ; then
11501			$1="$$1 ]flag["
11502			found="yes"
11503		fi
11504	fi
11505])
11506]) # XORG_TESTSET_CFLAG
11507
11508# XORG_COMPILER_FLAGS
11509# ---------------
11510# Minimum version: 1.16.0
11511#
11512# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11513# arguments supported by the selected compiler which do NOT alter the generated
11514# code.  These arguments will cause the compiler to print various warnings
11515# during compilation AND turn a conservative set of warnings into errors.
11516#
11517# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11518# future versions of util-macros as options are added to new compilers.
11519#
11520AC_DEFUN([XORG_COMPILER_FLAGS], [
11521AC_REQUIRE([XORG_COMPILER_BRAND])
11522
11523AC_ARG_ENABLE(selective-werror,
11524              AS_HELP_STRING([--disable-selective-werror],
11525                             [Turn off selective compiler errors. (default: enabled)]),
11526              [SELECTIVE_WERROR=$enableval],
11527              [SELECTIVE_WERROR=yes])
11528
11529AC_LANG_CASE(
11530        [C], [
11531                define([PREFIX], [C])
11532        ],
11533        [C++], [
11534                define([PREFIX], [CXX])
11535        ]
11536)
11537# -v is too short to test reliably with XORG_TESTSET_CFLAG
11538if test "x$SUNCC" = "xyes"; then
11539    [BASE_]PREFIX[FLAGS]="-v"
11540else
11541    [BASE_]PREFIX[FLAGS]=""
11542fi
11543
11544# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11545XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11546XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11547XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11548XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11549
11550AC_LANG_CASE(
11551	[C], [
11552		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11553		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11554		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11555		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11556		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
11557		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11558	]
11559)
11560
11561# This chunk adds additional warnings that could catch undesired effects.
11562XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11563XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11564XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11565XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11566XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11567XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11568XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11569
11570# These are currently disabled because they are noisy.  They will be enabled
11571# in the future once the codebase is sufficiently modernized to silence
11572# them.  For now, I don't want them to drown out the other warnings.
11573# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11574# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11575# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11576
11577# Turn some warnings into errors, so we don't accidently get successful builds
11578# when there are problems that should be fixed.
11579
11580if test "x$SELECTIVE_WERROR" = "xyes" ; then
11581XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11582XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11583XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11584XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11585XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11586XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11587XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11588XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11589XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11590XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11591XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11592XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11593XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11594else
11595AC_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])
11596XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11597XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11598XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11599XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11600XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11601XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11602XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11603XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11604XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11605XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11606XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11607XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11608XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11609fi
11610
11611AC_SUBST([BASE_]PREFIX[FLAGS])
11612]) # XORG_COMPILER_FLAGS
11613
11614# XORG_CWARNFLAGS
11615# ---------------
11616# Minimum version: 1.2.0
11617# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11618#
11619# Defines CWARNFLAGS to enable C compiler warnings.
11620#
11621# This function is deprecated because it defines -fno-strict-aliasing
11622# which alters the code generated by the compiler.  If -fno-strict-aliasing
11623# is needed, then it should be added explicitly in the module when
11624# it is updated to use BASE_CFLAGS.
11625#
11626AC_DEFUN([XORG_CWARNFLAGS], [
11627AC_REQUIRE([XORG_COMPILER_FLAGS])
11628AC_REQUIRE([XORG_COMPILER_BRAND])
11629AC_LANG_CASE(
11630	[C], [
11631		CWARNFLAGS="$BASE_CFLAGS"
11632		if  test "x$GCC" = xyes ; then
11633		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11634		fi
11635		AC_SUBST(CWARNFLAGS)
11636	]
11637)
11638]) # XORG_CWARNFLAGS
11639
11640# XORG_STRICT_OPTION
11641# -----------------------
11642# Minimum version: 1.3.0
11643#
11644# Add configure option to enable strict compilation flags, such as treating
11645# warnings as fatal errors.
11646# If --enable-strict-compilation is passed to configure, adds strict flags to
11647# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11648#
11649# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11650# when strict compilation is unconditionally desired.
11651AC_DEFUN([XORG_STRICT_OPTION], [
11652AC_REQUIRE([XORG_CWARNFLAGS])
11653AC_REQUIRE([XORG_COMPILER_FLAGS])
11654
11655AC_ARG_ENABLE(strict-compilation,
11656			  AS_HELP_STRING([--enable-strict-compilation],
11657			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11658			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11659
11660AC_LANG_CASE(
11661        [C], [
11662                define([PREFIX], [C])
11663        ],
11664        [C++], [
11665                define([PREFIX], [CXX])
11666        ]
11667)
11668
11669[STRICT_]PREFIX[FLAGS]=""
11670XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11671XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11672
11673# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11674# activate it with -Werror, so we add it here explicitly.
11675XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11676
11677if test "x$STRICT_COMPILE" = "xyes"; then
11678    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11679    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11680fi
11681AC_SUBST([STRICT_]PREFIX[FLAGS])
11682AC_SUBST([BASE_]PREFIX[FLAGS])
11683AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11684]) # XORG_STRICT_OPTION
11685
11686# XORG_DEFAULT_OPTIONS
11687# --------------------
11688# Minimum version: 1.3.0
11689#
11690# Defines default options for X.Org modules.
11691#
11692AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11693AC_REQUIRE([AC_PROG_INSTALL])
11694XORG_COMPILER_FLAGS
11695XORG_CWARNFLAGS
11696XORG_STRICT_OPTION
11697XORG_RELEASE_VERSION
11698XORG_CHANGELOG
11699XORG_INSTALL
11700XORG_MANPAGE_SECTIONS
11701m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11702    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11703]) # XORG_DEFAULT_OPTIONS
11704
11705# XORG_INSTALL()
11706# ----------------
11707# Minimum version: 1.4.0
11708#
11709# Defines the variable INSTALL_CMD as the command to copy
11710# INSTALL from $prefix/share/util-macros.
11711#
11712AC_DEFUN([XORG_INSTALL], [
11713AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11714macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11715INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11716mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11717|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11718echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11719AC_SUBST([INSTALL_CMD])
11720]) # XORG_INSTALL
11721dnl Copyright 2005 Red Hat, Inc
11722dnl
11723dnl Permission to use, copy, modify, distribute, and sell this software and its
11724dnl documentation for any purpose is hereby granted without fee, provided that
11725dnl the above copyright notice appear in all copies and that both that
11726dnl copyright notice and this permission notice appear in supporting
11727dnl documentation.
11728dnl
11729dnl The above copyright notice and this permission notice shall be included
11730dnl in all copies or substantial portions of the Software.
11731dnl
11732dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11733dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11734dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11735dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11736dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11737dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11738dnl OTHER DEALINGS IN THE SOFTWARE.
11739dnl
11740dnl Except as contained in this notice, the name of the copyright holders shall
11741dnl not be used in advertising or otherwise to promote the sale, use or
11742dnl other dealings in this Software without prior written authorization
11743dnl from the copyright holders.
11744dnl
11745
11746# XORG_RELEASE_VERSION
11747# --------------------
11748# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11749
11750AC_DEFUN([XORG_RELEASE_VERSION],[
11751	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11752		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11753		[Major version of this package])
11754	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11755	if test "x$PVM" = "x"; then
11756		PVM="0"
11757	fi
11758	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11759		[$PVM],
11760		[Minor version of this package])
11761	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11762	if test "x$PVP" = "x"; then
11763		PVP="0"
11764	fi
11765	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11766		[$PVP],
11767		[Patch version of this package])
11768])
11769
11770# XORG_CHANGELOG()
11771# ----------------
11772# Minimum version: 1.2.0
11773#
11774# Defines the variable CHANGELOG_CMD as the command to generate
11775# ChangeLog from git.
11776#
11777#
11778AC_DEFUN([XORG_CHANGELOG], [
11779CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11780mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11781|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11782echo 'git directory not found: installing possibly empty changelog.' >&2)"
11783AC_SUBST([CHANGELOG_CMD])
11784]) # XORG_CHANGELOG
11785
11786dnl
11787dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
11788dnl
11789dnl Permission is hereby granted, free of charge, to any person obtaining a
11790dnl copy of this software and associated documentation files (the "Software"),
11791dnl to deal in the Software without restriction, including without limitation
11792dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
11793dnl and/or sell copies of the Software, and to permit persons to whom the
11794dnl Software is furnished to do so, subject to the following conditions:
11795dnl
11796dnl The above copyright notice and this permission notice (including the next
11797dnl paragraph) shall be included in all copies or substantial portions of the
11798dnl Software.
11799dnl
11800dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11801dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11802dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
11803dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11804dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
11805dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
11806dnl DEALINGS IN THE SOFTWARE.
11807dnl
11808
11809# XTRANS_TCP_FLAGS()
11810# ------------------
11811# Find needed libraries for TCP sockets, and check for IPv6 support
11812AC_DEFUN([XTRANS_TCP_FLAGS],[
11813 # SVR4 hides these in libraries other than libc
11814 AC_SEARCH_LIBS(socket, [socket])
11815 AC_SEARCH_LIBS(gethostbyname, [nsl])
11816 if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
11817   AC_CHECK_LIB([ws2_32],[main])
11818 fi
11819
11820 # Needs to come after above checks for libsocket & libnsl for SVR4 systems
11821 AC_ARG_ENABLE(ipv6,
11822	AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
11823	[IPV6CONN=$enableval],
11824	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
11825 AC_MSG_CHECKING([if IPv6 support should be built])
11826 if test "$IPV6CONN" = "yes"; then
11827	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
11828 fi
11829 AC_MSG_RESULT($IPV6CONN)
11830
11831 # 4.3BSD-Reno added a new member to struct sockaddr_in
11832 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
11833	AC_DEFINE([BSD44SOCKETS],1,
11834 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
11835#include <sys/types.h>
11836#include <sys/socket.h>
11837#include <netinet/in.h>
11838 ])
11839
11840 # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
11841 AC_CHECK_TYPES([socklen_t], [], [], [
11842AC_INCLUDES_DEFAULT
11843#include <sys/socket.h>])
11844
11845 # XPG4v2/UNIX95 added msg_control - check to see if we need to define
11846 # _XOPEN_SOURCE to get it (such as on Solaris)
11847 AC_CHECK_MEMBER([struct msghdr.msg_control], [], [],
11848                 [
11849AC_INCLUDES_DEFAULT
11850#include <sys/socket.h>
11851                 ])
11852 # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03
11853 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
11854     unset ac_cv_member_struct_msghdr_msg_control
11855     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600])
11856     AC_CHECK_MEMBER([struct msghdr.msg_control],
11857                     [AC_DEFINE([_XOPEN_SOURCE], [600],
11858                       [Defined if needed to expose struct msghdr.msg_control])
11859                     ], [], [
11860#define _XOPEN_SOURCE 600
11861AC_INCLUDES_DEFAULT
11862#include <sys/socket.h>
11863                     ])
11864 fi
11865 # If that didn't work, fall back to XPG5/UNIX98 with C89
11866 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
11867     unset ac_cv_member_struct_msghdr_msg_control
11868     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500])
11869     AC_CHECK_MEMBER([struct msghdr.msg_control],
11870                     [AC_DEFINE([_XOPEN_SOURCE], [500],
11871                       [Defined if needed to expose struct msghdr.msg_control])
11872                     ], [], [
11873#define _XOPEN_SOURCE 500
11874AC_INCLUDES_DEFAULT
11875#include <sys/socket.h>
11876                     ])
11877 fi
11878
11879
11880]) # XTRANS_TCP_FLAGS
11881
11882# XTRANS_CONNECTION_FLAGS()
11883# -------------------------
11884# Standard checks for which Xtrans transports to use by the Xorg packages
11885# that use Xtrans functions
11886AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
11887 AC_REQUIRE([AC_CANONICAL_HOST])
11888 [case $host_os in
11889	mingw*)	unixdef="no"   ;;
11890	*)	unixdef="yes"  ;;
11891 esac]
11892 AC_ARG_ENABLE(unix-transport,
11893	AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
11894	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
11895 AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
11896 if test "$UNIXCONN" = "yes"; then
11897	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
11898 fi
11899 AC_MSG_RESULT($UNIXCONN)
11900 AC_ARG_ENABLE(tcp-transport,
11901	AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
11902	[TCPCONN=$enableval], [TCPCONN=yes])
11903 AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
11904 AC_MSG_RESULT($TCPCONN)
11905 if test "$TCPCONN" = "yes"; then
11906	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
11907	XTRANS_TCP_FLAGS
11908 fi
11909 [case $host_os in
11910	solaris*|sco*|sysv4*)	localdef="yes" ;;
11911	*)			localdef="no"  ;;
11912 esac]
11913 AC_ARG_ENABLE(local-transport,
11914	AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
11915	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
11916 AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
11917 AC_MSG_RESULT($LOCALCONN)
11918 if test "$LOCALCONN" = "yes"; then
11919	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
11920 fi
11921
11922]) # XTRANS_CONNECTION_FLAGS
11923
11924
11925# XTRANS_SECURE_RPC_FLAGS()
11926# -------------------------
11927# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
11928# so that any necessary networking libraries are already found
11929AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
11930[AC_REQUIRE([XTRANS_TCP_FLAGS])
11931 AC_ARG_ENABLE(secure-rpc,
11932	AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
11933        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
11934
11935 if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
11936	FOUND_SECURE_RPC="no"
11937	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
11938			[FOUND_SECURE_RPC="yes"])
11939	if test "x$FOUND_SECURE_RPC" = "xno" ; then
11940		if test "x$SECURE_RPC" = "xyes" ; then
11941	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
11942		fi
11943		SECURE_RPC="no"
11944	else
11945		dnl FreeBSD keeps getsecretkey in librpcsvc
11946		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
11947		SECURE_RPC="yes"
11948	fi
11949 fi
11950 AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
11951 if test "x$SECURE_RPC" = "xyes" ; then
11952	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
11953 fi
11954 AC_MSG_RESULT($SECURE_RPC)
11955]) # XTRANS_SECURE_RPC_FLAGS
11956
11957
11958