aclocal.m4 revision 9e7bcd65
1# generated automatically by aclocal 1.13.2 -*- 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.13'
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.13.2], [],
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.13.2])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
421# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
422# AM_INIT_AUTOMAKE([OPTIONS])
423# -----------------------------------------------
424# The call with PACKAGE and VERSION arguments is the old style
425# call (pre autoconf-2.50), which is being phased out.  PACKAGE
426# and VERSION should now be passed to AC_INIT and removed from
427# the call to AM_INIT_AUTOMAKE.
428# We support both call styles for the transition.  After
429# the next Automake release, Autoconf can make the AC_INIT
430# arguments mandatory, and then we can depend on a new Autoconf
431# release and drop the old call support.
432AC_DEFUN([AM_INIT_AUTOMAKE],
433[AC_PREREQ([2.65])dnl
434dnl Autoconf wants to disallow AM_ names.  We explicitly allow
435dnl the ones we care about.
436m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
437AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
438AC_REQUIRE([AC_PROG_INSTALL])dnl
439if test "`cd $srcdir && pwd`" != "`pwd`"; then
440  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
441  # is not polluted with repeated "-I."
442  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
443  # test to see if srcdir already configured
444  if test -f $srcdir/config.status; then
445    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
446  fi
447fi
448
449# test whether we have cygpath
450if test -z "$CYGPATH_W"; then
451  if (cygpath --version) >/dev/null 2>/dev/null; then
452    CYGPATH_W='cygpath -w'
453  else
454    CYGPATH_W=echo
455  fi
456fi
457AC_SUBST([CYGPATH_W])
458
459# Define the identity of the package.
460dnl Distinguish between old-style and new-style calls.
461m4_ifval([$2],
462[AC_DIAGNOSE([obsolete],
463             [$0: two- and three-arguments forms are deprecated.])
464m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465 AC_SUBST([PACKAGE], [$1])dnl
466 AC_SUBST([VERSION], [$2])],
467[_AM_SET_OPTIONS([$1])dnl
468dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469m4_if(
470  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
471  [ok:ok],,
472  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
473 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
474 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
475
476_AM_IF_OPTION([no-define],,
477[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
478 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
479
480# Some tools Automake needs.
481AC_REQUIRE([AM_SANITY_CHECK])dnl
482AC_REQUIRE([AC_ARG_PROGRAM])dnl
483AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
484AM_MISSING_PROG([AUTOCONF], [autoconf])
485AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
486AM_MISSING_PROG([AUTOHEADER], [autoheader])
487AM_MISSING_PROG([MAKEINFO], [makeinfo])
488AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
489AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
490AC_REQUIRE([AC_PROG_MKDIR_P])dnl
491# For better backward compatibility.  To be removed once Automake 1.9.x
492# dies out for good.  For more background, see:
493# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
494# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
495AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
496# We need awk for the "check" target.  The system "awk" is bad on
497# some platforms.
498AC_REQUIRE([AC_PROG_AWK])dnl
499AC_REQUIRE([AC_PROG_MAKE_SET])dnl
500AC_REQUIRE([AM_SET_LEADING_DOT])dnl
501_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
502	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
503			     [_AM_PROG_TAR([v7])])])
504_AM_IF_OPTION([no-dependencies],,
505[AC_PROVIDE_IFELSE([AC_PROG_CC],
506		  [_AM_DEPENDENCIES([CC])],
507		  [m4_define([AC_PROG_CC],
508			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
509AC_PROVIDE_IFELSE([AC_PROG_CXX],
510		  [_AM_DEPENDENCIES([CXX])],
511		  [m4_define([AC_PROG_CXX],
512			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
513AC_PROVIDE_IFELSE([AC_PROG_OBJC],
514		  [_AM_DEPENDENCIES([OBJC])],
515		  [m4_define([AC_PROG_OBJC],
516			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
517AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
518		  [_AM_DEPENDENCIES([OBJCXX])],
519		  [m4_define([AC_PROG_OBJCXX],
520			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
521])
522AC_REQUIRE([AM_SILENT_RULES])dnl
523dnl The testsuite driver may need to know about EXEEXT, so add the
524dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
525dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
526AC_CONFIG_COMMANDS_PRE(dnl
527[m4_provide_if([_AM_COMPILER_EXEEXT],
528  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
529])
530
531dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
532dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
533dnl mangled by Autoconf and run in a shell conditional statement.
534m4_define([_AC_COMPILER_EXEEXT],
535m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
536
537
538# When config.status generates a header, we must update the stamp-h file.
539# This file resides in the same directory as the config header
540# that is generated.  The stamp files are numbered to have different names.
541
542# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
543# loop where config.status creates the headers, so we can generate
544# our stamp files there.
545AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
546[# Compute $1's index in $config_headers.
547_am_arg=$1
548_am_stamp_count=1
549for _am_header in $config_headers :; do
550  case $_am_header in
551    $_am_arg | $_am_arg:* )
552      break ;;
553    * )
554      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
555  esac
556done
557echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
558
559# Copyright (C) 2001-2013 Free Software Foundation, Inc.
560#
561# This file is free software; the Free Software Foundation
562# gives unlimited permission to copy and/or distribute it,
563# with or without modifications, as long as this notice is preserved.
564
565# AM_PROG_INSTALL_SH
566# ------------------
567# Define $install_sh.
568AC_DEFUN([AM_PROG_INSTALL_SH],
569[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
570if test x"${install_sh}" != xset; then
571  case $am_aux_dir in
572  *\ * | *\	*)
573    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
574  *)
575    install_sh="\${SHELL} $am_aux_dir/install-sh"
576  esac
577fi
578AC_SUBST([install_sh])])
579
580# Copyright (C) 2003-2013 Free Software Foundation, Inc.
581#
582# This file is free software; the Free Software Foundation
583# gives unlimited permission to copy and/or distribute it,
584# with or without modifications, as long as this notice is preserved.
585
586# Check whether the underlying file-system supports filenames
587# with a leading dot.  For instance MS-DOS doesn't.
588AC_DEFUN([AM_SET_LEADING_DOT],
589[rm -rf .tst 2>/dev/null
590mkdir .tst 2>/dev/null
591if test -d .tst; then
592  am__leading_dot=.
593else
594  am__leading_dot=_
595fi
596rmdir .tst 2>/dev/null
597AC_SUBST([am__leading_dot])])
598
599# Check to see how 'make' treats includes.	            -*- Autoconf -*-
600
601# Copyright (C) 2001-2013 Free Software Foundation, Inc.
602#
603# This file is free software; the Free Software Foundation
604# gives unlimited permission to copy and/or distribute it,
605# with or without modifications, as long as this notice is preserved.
606
607# AM_MAKE_INCLUDE()
608# -----------------
609# Check to see how make treats includes.
610AC_DEFUN([AM_MAKE_INCLUDE],
611[am_make=${MAKE-make}
612cat > confinc << 'END'
613am__doit:
614	@echo this is the am__doit target
615.PHONY: am__doit
616END
617# If we don't find an include directive, just comment out the code.
618AC_MSG_CHECKING([for style of include used by $am_make])
619am__include="#"
620am__quote=
621_am_result=none
622# First try GNU make style include.
623echo "include confinc" > confmf
624# Ignore all kinds of additional output from 'make'.
625case `$am_make -s -f confmf 2> /dev/null` in #(
626*the\ am__doit\ target*)
627  am__include=include
628  am__quote=
629  _am_result=GNU
630  ;;
631esac
632# Now try BSD make style include.
633if test "$am__include" = "#"; then
634   echo '.include "confinc"' > confmf
635   case `$am_make -s -f confmf 2> /dev/null` in #(
636   *the\ am__doit\ target*)
637     am__include=.include
638     am__quote="\""
639     _am_result=BSD
640     ;;
641   esac
642fi
643AC_SUBST([am__include])
644AC_SUBST([am__quote])
645AC_MSG_RESULT([$_am_result])
646rm -f confinc confmf
647])
648
649# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
650
651# Copyright (C) 1997-2013 Free Software Foundation, Inc.
652#
653# This file is free software; the Free Software Foundation
654# gives unlimited permission to copy and/or distribute it,
655# with or without modifications, as long as this notice is preserved.
656
657# AM_MISSING_PROG(NAME, PROGRAM)
658# ------------------------------
659AC_DEFUN([AM_MISSING_PROG],
660[AC_REQUIRE([AM_MISSING_HAS_RUN])
661$1=${$1-"${am_missing_run}$2"}
662AC_SUBST($1)])
663
664# AM_MISSING_HAS_RUN
665# ------------------
666# Define MISSING if not defined so far and test if it is modern enough.
667# If it is, set am_missing_run to use it, otherwise, to nothing.
668AC_DEFUN([AM_MISSING_HAS_RUN],
669[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
670AC_REQUIRE_AUX_FILE([missing])dnl
671if test x"${MISSING+set}" != xset; then
672  case $am_aux_dir in
673  *\ * | *\	*)
674    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
675  *)
676    MISSING="\${SHELL} $am_aux_dir/missing" ;;
677  esac
678fi
679# Use eval to expand $SHELL
680if eval "$MISSING --is-lightweight"; then
681  am_missing_run="$MISSING "
682else
683  am_missing_run=
684  AC_MSG_WARN(['missing' script is too old or missing])
685fi
686])
687
688# Helper functions for option handling.                     -*- Autoconf -*-
689
690# Copyright (C) 2001-2013 Free Software Foundation, Inc.
691#
692# This file is free software; the Free Software Foundation
693# gives unlimited permission to copy and/or distribute it,
694# with or without modifications, as long as this notice is preserved.
695
696# _AM_MANGLE_OPTION(NAME)
697# -----------------------
698AC_DEFUN([_AM_MANGLE_OPTION],
699[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
700
701# _AM_SET_OPTION(NAME)
702# --------------------
703# Set option NAME.  Presently that only means defining a flag for this option.
704AC_DEFUN([_AM_SET_OPTION],
705[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
706
707# _AM_SET_OPTIONS(OPTIONS)
708# ------------------------
709# OPTIONS is a space-separated list of Automake options.
710AC_DEFUN([_AM_SET_OPTIONS],
711[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
712
713# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
714# -------------------------------------------
715# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
716AC_DEFUN([_AM_IF_OPTION],
717[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
718
719# Check to make sure that the build environment is sane.    -*- Autoconf -*-
720
721# Copyright (C) 1996-2013 Free Software Foundation, Inc.
722#
723# This file is free software; the Free Software Foundation
724# gives unlimited permission to copy and/or distribute it,
725# with or without modifications, as long as this notice is preserved.
726
727# AM_SANITY_CHECK
728# ---------------
729AC_DEFUN([AM_SANITY_CHECK],
730[AC_MSG_CHECKING([whether build environment is sane])
731# Reject unsafe characters in $srcdir or the absolute working directory
732# name.  Accept space and tab only in the latter.
733am_lf='
734'
735case `pwd` in
736  *[[\\\"\#\$\&\'\`$am_lf]]*)
737    AC_MSG_ERROR([unsafe absolute working directory name]);;
738esac
739case $srcdir in
740  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
741    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
742esac
743
744# Do 'set' in a subshell so we don't clobber the current shell's
745# arguments.  Must try -L first in case configure is actually a
746# symlink; some systems play weird games with the mod time of symlinks
747# (eg FreeBSD returns the mod time of the symlink's containing
748# directory).
749if (
750   am_has_slept=no
751   for am_try in 1 2; do
752     echo "timestamp, slept: $am_has_slept" > conftest.file
753     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
754     if test "$[*]" = "X"; then
755	# -L didn't work.
756	set X `ls -t "$srcdir/configure" conftest.file`
757     fi
758     if test "$[*]" != "X $srcdir/configure conftest.file" \
759	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
760
761	# If neither matched, then we have a broken ls.  This can happen
762	# if, for instance, CONFIG_SHELL is bash and it inherits a
763	# broken ls alias from the environment.  This has actually
764	# happened.  Such a system could not be considered "sane".
765	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
766  alias in your environment])
767     fi
768     if test "$[2]" = conftest.file || test $am_try -eq 2; then
769       break
770     fi
771     # Just in case.
772     sleep 1
773     am_has_slept=yes
774   done
775   test "$[2]" = conftest.file
776   )
777then
778   # Ok.
779   :
780else
781   AC_MSG_ERROR([newly created file is older than distributed files!
782Check your system clock])
783fi
784AC_MSG_RESULT([yes])
785# If we didn't sleep, we still need to ensure time stamps of config.status and
786# generated files are strictly newer.
787am_sleep_pid=
788if grep 'slept: no' conftest.file >/dev/null 2>&1; then
789  ( sleep 1 ) &
790  am_sleep_pid=$!
791fi
792AC_CONFIG_COMMANDS_PRE(
793  [AC_MSG_CHECKING([that generated files are newer than configure])
794   if test -n "$am_sleep_pid"; then
795     # Hide warnings about reused PIDs.
796     wait $am_sleep_pid 2>/dev/null
797   fi
798   AC_MSG_RESULT([done])])
799rm -f conftest.file
800])
801
802# Copyright (C) 2009-2013 Free Software Foundation, Inc.
803#
804# This file is free software; the Free Software Foundation
805# gives unlimited permission to copy and/or distribute it,
806# with or without modifications, as long as this notice is preserved.
807
808# AM_SILENT_RULES([DEFAULT])
809# --------------------------
810# Enable less verbose build rules; with the default set to DEFAULT
811# ("yes" being less verbose, "no" or empty being verbose).
812AC_DEFUN([AM_SILENT_RULES],
813[AC_ARG_ENABLE([silent-rules], [dnl
814AS_HELP_STRING(
815  [--enable-silent-rules],
816  [less verbose build output (undo: "make V=1")])
817AS_HELP_STRING(
818  [--disable-silent-rules],
819  [verbose build output (undo: "make V=0")])dnl
820])
821case $enable_silent_rules in @%:@ (((
822  yes) AM_DEFAULT_VERBOSITY=0;;
823   no) AM_DEFAULT_VERBOSITY=1;;
824    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
825esac
826dnl
827dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
828dnl do not support nested variable expansions.
829dnl See automake bug#9928 and bug#10237.
830am_make=${MAKE-make}
831AC_CACHE_CHECK([whether $am_make supports nested variables],
832   [am_cv_make_support_nested_variables],
833   [if AS_ECHO([['TRUE=$(BAR$(V))
834BAR0=false
835BAR1=true
836V=1
837am__doit:
838	@$(TRUE)
839.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
840  am_cv_make_support_nested_variables=yes
841else
842  am_cv_make_support_nested_variables=no
843fi])
844if test $am_cv_make_support_nested_variables = yes; then
845  dnl Using '$V' instead of '$(V)' breaks IRIX make.
846  AM_V='$(V)'
847  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
848else
849  AM_V=$AM_DEFAULT_VERBOSITY
850  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
851fi
852AC_SUBST([AM_V])dnl
853AM_SUBST_NOTMAKE([AM_V])dnl
854AC_SUBST([AM_DEFAULT_V])dnl
855AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
856AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
857AM_BACKSLASH='\'
858AC_SUBST([AM_BACKSLASH])dnl
859_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
860])
861
862# Copyright (C) 2001-2013 Free Software Foundation, Inc.
863#
864# This file is free software; the Free Software Foundation
865# gives unlimited permission to copy and/or distribute it,
866# with or without modifications, as long as this notice is preserved.
867
868# AM_PROG_INSTALL_STRIP
869# ---------------------
870# One issue with vendor 'install' (even GNU) is that you can't
871# specify the program used to strip binaries.  This is especially
872# annoying in cross-compiling environments, where the build's strip
873# is unlikely to handle the host's binaries.
874# Fortunately install-sh will honor a STRIPPROG variable, so we
875# always use install-sh in "make install-strip", and initialize
876# STRIPPROG with the value of the STRIP variable (set by the user).
877AC_DEFUN([AM_PROG_INSTALL_STRIP],
878[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
879# Installed binaries are usually stripped using 'strip' when the user
880# run "make install-strip".  However 'strip' might not be the right
881# tool to use in cross-compilation environments, therefore Automake
882# will honor the 'STRIP' environment variable to overrule this program.
883dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
884if test "$cross_compiling" != no; then
885  AC_CHECK_TOOL([STRIP], [strip], :)
886fi
887INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
888AC_SUBST([INSTALL_STRIP_PROGRAM])])
889
890# Copyright (C) 2006-2013 Free Software Foundation, Inc.
891#
892# This file is free software; the Free Software Foundation
893# gives unlimited permission to copy and/or distribute it,
894# with or without modifications, as long as this notice is preserved.
895
896# _AM_SUBST_NOTMAKE(VARIABLE)
897# ---------------------------
898# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
899# This macro is traced by Automake.
900AC_DEFUN([_AM_SUBST_NOTMAKE])
901
902# AM_SUBST_NOTMAKE(VARIABLE)
903# --------------------------
904# Public sister of _AM_SUBST_NOTMAKE.
905AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
906
907# Check how to create a tarball.                            -*- Autoconf -*-
908
909# Copyright (C) 2004-2013 Free Software Foundation, Inc.
910#
911# This file is free software; the Free Software Foundation
912# gives unlimited permission to copy and/or distribute it,
913# with or without modifications, as long as this notice is preserved.
914
915# _AM_PROG_TAR(FORMAT)
916# --------------------
917# Check how to create a tarball in format FORMAT.
918# FORMAT should be one of 'v7', 'ustar', or 'pax'.
919#
920# Substitute a variable $(am__tar) that is a command
921# writing to stdout a FORMAT-tarball containing the directory
922# $tardir.
923#     tardir=directory && $(am__tar) > result.tar
924#
925# Substitute a variable $(am__untar) that extract such
926# a tarball read from stdin.
927#     $(am__untar) < result.tar
928#
929AC_DEFUN([_AM_PROG_TAR],
930[# Always define AMTAR for backward compatibility.  Yes, it's still used
931# in the wild :-(  We should find a proper way to deprecate it ...
932AC_SUBST([AMTAR], ['$${TAR-tar}'])
933
934# We'll loop over all known methods to create a tar archive until one works.
935_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
936
937m4_if([$1], [v7],
938  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
939
940  [m4_case([$1],
941    [ustar],
942     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
943      # There is notably a 21 bits limit for the UID and the GID.  In fact,
944      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
945      # and bug#13588).
946      am_max_uid=2097151 # 2^21 - 1
947      am_max_gid=$am_max_uid
948      # The $UID and $GID variables are not portable, so we need to resort
949      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
950      # below are definitely unexpected, so allow the users to see them
951      # (that is, avoid stderr redirection).
952      am_uid=`id -u || echo unknown`
953      am_gid=`id -g || echo unknown`
954      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
955      if test $am_uid -le $am_max_uid; then
956         AC_MSG_RESULT([yes])
957      else
958         AC_MSG_RESULT([no])
959         _am_tools=none
960      fi
961      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
962      if test $am_gid -le $am_max_gid; then
963         AC_MSG_RESULT([yes])
964      else
965        AC_MSG_RESULT([no])
966        _am_tools=none
967      fi],
968
969  [pax],
970    [],
971
972  [m4_fatal([Unknown tar format])])
973
974  AC_MSG_CHECKING([how to create a $1 tar archive])
975
976  # Go ahead even if we have the value already cached.  We do so because we
977  # need to set the values for the 'am__tar' and 'am__untar' variables.
978  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
979
980  for _am_tool in $_am_tools; do
981    case $_am_tool in
982    gnutar)
983      for _am_tar in tar gnutar gtar; do
984        AM_RUN_LOG([$_am_tar --version]) && break
985      done
986      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
987      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
988      am__untar="$_am_tar -xf -"
989      ;;
990    plaintar)
991      # Must skip GNU tar: if it does not support --format= it doesn't create
992      # ustar tarball either.
993      (tar --version) >/dev/null 2>&1 && continue
994      am__tar='tar chf - "$$tardir"'
995      am__tar_='tar chf - "$tardir"'
996      am__untar='tar xf -'
997      ;;
998    pax)
999      am__tar='pax -L -x $1 -w "$$tardir"'
1000      am__tar_='pax -L -x $1 -w "$tardir"'
1001      am__untar='pax -r'
1002      ;;
1003    cpio)
1004      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1005      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1006      am__untar='cpio -i -H $1 -d'
1007      ;;
1008    none)
1009      am__tar=false
1010      am__tar_=false
1011      am__untar=false
1012      ;;
1013    esac
1014
1015    # If the value was cached, stop now.  We just wanted to have am__tar
1016    # and am__untar set.
1017    test -n "${am_cv_prog_tar_$1}" && break
1018
1019    # tar/untar a dummy directory, and stop if the command works.
1020    rm -rf conftest.dir
1021    mkdir conftest.dir
1022    echo GrepMe > conftest.dir/file
1023    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1024    rm -rf conftest.dir
1025    if test -s conftest.tar; then
1026      AM_RUN_LOG([$am__untar <conftest.tar])
1027      AM_RUN_LOG([cat conftest.dir/file])
1028      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1029    fi
1030  done
1031  rm -rf conftest.dir
1032
1033  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1034  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1035
1036AC_SUBST([am__tar])
1037AC_SUBST([am__untar])
1038]) # _AM_PROG_TAR
1039
1040m4_include([m4/ax_define_dir.m4])
1041# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1042#
1043#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1044#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1045#                 Foundation, Inc.
1046#   Written by Gordon Matzigkeit, 1996
1047#
1048# This file is free software; the Free Software Foundation gives
1049# unlimited permission to copy and/or distribute it, with or without
1050# modifications, as long as this notice is preserved.
1051
1052m4_define([_LT_COPYING], [dnl
1053#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1054#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1055#                 Foundation, Inc.
1056#   Written by Gordon Matzigkeit, 1996
1057#
1058#   This file is part of GNU Libtool.
1059#
1060# GNU Libtool is free software; you can redistribute it and/or
1061# modify it under the terms of the GNU General Public License as
1062# published by the Free Software Foundation; either version 2 of
1063# the License, or (at your option) any later version.
1064#
1065# As a special exception to the GNU General Public License,
1066# if you distribute this file as part of a program or library that
1067# is built using GNU Libtool, you may include this file under the
1068# same distribution terms that you use for the rest of that program.
1069#
1070# GNU Libtool is distributed in the hope that it will be useful,
1071# but WITHOUT ANY WARRANTY; without even the implied warranty of
1072# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1073# GNU General Public License for more details.
1074#
1075# You should have received a copy of the GNU General Public License
1076# along with GNU Libtool; see the file COPYING.  If not, a copy
1077# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1078# obtained by writing to the Free Software Foundation, Inc.,
1079# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1080])
1081
1082# serial 57 LT_INIT
1083
1084
1085# LT_PREREQ(VERSION)
1086# ------------------
1087# Complain and exit if this libtool version is less that VERSION.
1088m4_defun([LT_PREREQ],
1089[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1090       [m4_default([$3],
1091		   [m4_fatal([Libtool version $1 or higher is required],
1092		             63)])],
1093       [$2])])
1094
1095
1096# _LT_CHECK_BUILDDIR
1097# ------------------
1098# Complain if the absolute build directory name contains unusual characters
1099m4_defun([_LT_CHECK_BUILDDIR],
1100[case `pwd` in
1101  *\ * | *\	*)
1102    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1103esac
1104])
1105
1106
1107# LT_INIT([OPTIONS])
1108# ------------------
1109AC_DEFUN([LT_INIT],
1110[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1111AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1112AC_BEFORE([$0], [LT_LANG])dnl
1113AC_BEFORE([$0], [LT_OUTPUT])dnl
1114AC_BEFORE([$0], [LTDL_INIT])dnl
1115m4_require([_LT_CHECK_BUILDDIR])dnl
1116
1117dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1118m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1119m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1120dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1121dnl unless we require an AC_DEFUNed macro:
1122AC_REQUIRE([LTOPTIONS_VERSION])dnl
1123AC_REQUIRE([LTSUGAR_VERSION])dnl
1124AC_REQUIRE([LTVERSION_VERSION])dnl
1125AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1126m4_require([_LT_PROG_LTMAIN])dnl
1127
1128_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1129
1130dnl Parse OPTIONS
1131_LT_SET_OPTIONS([$0], [$1])
1132
1133# This can be used to rebuild libtool when needed
1134LIBTOOL_DEPS="$ltmain"
1135
1136# Always use our own libtool.
1137LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1138AC_SUBST(LIBTOOL)dnl
1139
1140_LT_SETUP
1141
1142# Only expand once:
1143m4_define([LT_INIT])
1144])# LT_INIT
1145
1146# Old names:
1147AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1148AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1149dnl aclocal-1.4 backwards compatibility:
1150dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1151dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1152
1153
1154# _LT_CC_BASENAME(CC)
1155# -------------------
1156# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1157m4_defun([_LT_CC_BASENAME],
1158[for cc_temp in $1""; do
1159  case $cc_temp in
1160    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1161    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1162    \-*) ;;
1163    *) break;;
1164  esac
1165done
1166cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1167])
1168
1169
1170# _LT_FILEUTILS_DEFAULTS
1171# ----------------------
1172# It is okay to use these file commands and assume they have been set
1173# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1174m4_defun([_LT_FILEUTILS_DEFAULTS],
1175[: ${CP="cp -f"}
1176: ${MV="mv -f"}
1177: ${RM="rm -f"}
1178])# _LT_FILEUTILS_DEFAULTS
1179
1180
1181# _LT_SETUP
1182# ---------
1183m4_defun([_LT_SETUP],
1184[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1185AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1186AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1187AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1188
1189_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1190dnl
1191_LT_DECL([], [host_alias], [0], [The host system])dnl
1192_LT_DECL([], [host], [0])dnl
1193_LT_DECL([], [host_os], [0])dnl
1194dnl
1195_LT_DECL([], [build_alias], [0], [The build system])dnl
1196_LT_DECL([], [build], [0])dnl
1197_LT_DECL([], [build_os], [0])dnl
1198dnl
1199AC_REQUIRE([AC_PROG_CC])dnl
1200AC_REQUIRE([LT_PATH_LD])dnl
1201AC_REQUIRE([LT_PATH_NM])dnl
1202dnl
1203AC_REQUIRE([AC_PROG_LN_S])dnl
1204test -z "$LN_S" && LN_S="ln -s"
1205_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1206dnl
1207AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1208_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1209_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1210dnl
1211m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1212m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1213m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1214m4_require([_LT_CMD_RELOAD])dnl
1215m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1216m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1217m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1218m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1219m4_require([_LT_WITH_SYSROOT])dnl
1220
1221_LT_CONFIG_LIBTOOL_INIT([
1222# See if we are running on zsh, and set the options which allow our
1223# commands through without removal of \ escapes INIT.
1224if test -n "\${ZSH_VERSION+set}" ; then
1225   setopt NO_GLOB_SUBST
1226fi
1227])
1228if test -n "${ZSH_VERSION+set}" ; then
1229   setopt NO_GLOB_SUBST
1230fi
1231
1232_LT_CHECK_OBJDIR
1233
1234m4_require([_LT_TAG_COMPILER])dnl
1235
1236case $host_os in
1237aix3*)
1238  # AIX sometimes has problems with the GCC collect2 program.  For some
1239  # reason, if we set the COLLECT_NAMES environment variable, the problems
1240  # vanish in a puff of smoke.
1241  if test "X${COLLECT_NAMES+set}" != Xset; then
1242    COLLECT_NAMES=
1243    export COLLECT_NAMES
1244  fi
1245  ;;
1246esac
1247
1248# Global variables:
1249ofile=libtool
1250can_build_shared=yes
1251
1252# All known linkers require a `.a' archive for static linking (except MSVC,
1253# which needs '.lib').
1254libext=a
1255
1256with_gnu_ld="$lt_cv_prog_gnu_ld"
1257
1258old_CC="$CC"
1259old_CFLAGS="$CFLAGS"
1260
1261# Set sane defaults for various variables
1262test -z "$CC" && CC=cc
1263test -z "$LTCC" && LTCC=$CC
1264test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1265test -z "$LD" && LD=ld
1266test -z "$ac_objext" && ac_objext=o
1267
1268_LT_CC_BASENAME([$compiler])
1269
1270# Only perform the check for file, if the check method requires it
1271test -z "$MAGIC_CMD" && MAGIC_CMD=file
1272case $deplibs_check_method in
1273file_magic*)
1274  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1275    _LT_PATH_MAGIC
1276  fi
1277  ;;
1278esac
1279
1280# Use C for the default configuration in the libtool script
1281LT_SUPPORTED_TAG([CC])
1282_LT_LANG_C_CONFIG
1283_LT_LANG_DEFAULT_CONFIG
1284_LT_CONFIG_COMMANDS
1285])# _LT_SETUP
1286
1287
1288# _LT_PREPARE_SED_QUOTE_VARS
1289# --------------------------
1290# Define a few sed substitution that help us do robust quoting.
1291m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1292[# Backslashify metacharacters that are still active within
1293# double-quoted strings.
1294sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1295
1296# Same as above, but do not quote variable references.
1297double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1298
1299# Sed substitution to delay expansion of an escaped shell variable in a
1300# double_quote_subst'ed string.
1301delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1302
1303# Sed substitution to delay expansion of an escaped single quote.
1304delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1305
1306# Sed substitution to avoid accidental globbing in evaled expressions
1307no_glob_subst='s/\*/\\\*/g'
1308])
1309
1310# _LT_PROG_LTMAIN
1311# ---------------
1312# Note that this code is called both from `configure', and `config.status'
1313# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1314# `config.status' has no value for ac_aux_dir unless we are using Automake,
1315# so we pass a copy along to make sure it has a sensible value anyway.
1316m4_defun([_LT_PROG_LTMAIN],
1317[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1318_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1319ltmain="$ac_aux_dir/ltmain.sh"
1320])# _LT_PROG_LTMAIN
1321
1322
1323
1324# So that we can recreate a full libtool script including additional
1325# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1326# in macros and then make a single call at the end using the `libtool'
1327# label.
1328
1329
1330# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1331# ----------------------------------------
1332# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1333m4_define([_LT_CONFIG_LIBTOOL_INIT],
1334[m4_ifval([$1],
1335          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1336                     [$1
1337])])])
1338
1339# Initialize.
1340m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1341
1342
1343# _LT_CONFIG_LIBTOOL([COMMANDS])
1344# ------------------------------
1345# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1346m4_define([_LT_CONFIG_LIBTOOL],
1347[m4_ifval([$1],
1348          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1349                     [$1
1350])])])
1351
1352# Initialize.
1353m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1354
1355
1356# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1357# -----------------------------------------------------
1358m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1359[_LT_CONFIG_LIBTOOL([$1])
1360_LT_CONFIG_LIBTOOL_INIT([$2])
1361])
1362
1363
1364# _LT_FORMAT_COMMENT([COMMENT])
1365# -----------------------------
1366# Add leading comment marks to the start of each line, and a trailing
1367# full-stop to the whole comment if one is not present already.
1368m4_define([_LT_FORMAT_COMMENT],
1369[m4_ifval([$1], [
1370m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1371              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1372)])
1373
1374
1375
1376
1377
1378# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1379# -------------------------------------------------------------------
1380# CONFIGNAME is the name given to the value in the libtool script.
1381# VARNAME is the (base) name used in the configure script.
1382# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1383# VARNAME.  Any other value will be used directly.
1384m4_define([_LT_DECL],
1385[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1386    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1387	[m4_ifval([$1], [$1], [$2])])
1388    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1389    m4_ifval([$4],
1390	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1391    lt_dict_add_subkey([lt_decl_dict], [$2],
1392	[tagged?], [m4_ifval([$5], [yes], [no])])])
1393])
1394
1395
1396# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1397# --------------------------------------------------------
1398m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1399
1400
1401# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1402# ------------------------------------------------
1403m4_define([lt_decl_tag_varnames],
1404[_lt_decl_filter([tagged?], [yes], $@)])
1405
1406
1407# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1408# ---------------------------------------------------------
1409m4_define([_lt_decl_filter],
1410[m4_case([$#],
1411  [0], [m4_fatal([$0: too few arguments: $#])],
1412  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1413  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1414  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1415  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1416])
1417
1418
1419# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1420# --------------------------------------------------
1421m4_define([lt_decl_quote_varnames],
1422[_lt_decl_filter([value], [1], $@)])
1423
1424
1425# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1426# ---------------------------------------------------
1427m4_define([lt_decl_dquote_varnames],
1428[_lt_decl_filter([value], [2], $@)])
1429
1430
1431# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1432# ---------------------------------------------------
1433m4_define([lt_decl_varnames_tagged],
1434[m4_assert([$# <= 2])dnl
1435_$0(m4_quote(m4_default([$1], [[, ]])),
1436    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1437    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1438m4_define([_lt_decl_varnames_tagged],
1439[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1440
1441
1442# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1443# ------------------------------------------------
1444m4_define([lt_decl_all_varnames],
1445[_$0(m4_quote(m4_default([$1], [[, ]])),
1446     m4_if([$2], [],
1447	   m4_quote(lt_decl_varnames),
1448	m4_quote(m4_shift($@))))[]dnl
1449])
1450m4_define([_lt_decl_all_varnames],
1451[lt_join($@, lt_decl_varnames_tagged([$1],
1452			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1453])
1454
1455
1456# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1457# ------------------------------------
1458# Quote a variable value, and forward it to `config.status' so that its
1459# declaration there will have the same value as in `configure'.  VARNAME
1460# must have a single quote delimited value for this to work.
1461m4_define([_LT_CONFIG_STATUS_DECLARE],
1462[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1463
1464
1465# _LT_CONFIG_STATUS_DECLARATIONS
1466# ------------------------------
1467# We delimit libtool config variables with single quotes, so when
1468# we write them to config.status, we have to be sure to quote all
1469# embedded single quotes properly.  In configure, this macro expands
1470# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1471#
1472#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1473m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1474[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1475    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1476
1477
1478# _LT_LIBTOOL_TAGS
1479# ----------------
1480# Output comment and list of tags supported by the script
1481m4_defun([_LT_LIBTOOL_TAGS],
1482[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1483available_tags="_LT_TAGS"dnl
1484])
1485
1486
1487# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1488# -----------------------------------
1489# Extract the dictionary values for VARNAME (optionally with TAG) and
1490# expand to a commented shell variable setting:
1491#
1492#    # Some comment about what VAR is for.
1493#    visible_name=$lt_internal_name
1494m4_define([_LT_LIBTOOL_DECLARE],
1495[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1496					   [description])))[]dnl
1497m4_pushdef([_libtool_name],
1498    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1499m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1500    [0], [_libtool_name=[$]$1],
1501    [1], [_libtool_name=$lt_[]$1],
1502    [2], [_libtool_name=$lt_[]$1],
1503    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1504m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1505])
1506
1507
1508# _LT_LIBTOOL_CONFIG_VARS
1509# -----------------------
1510# Produce commented declarations of non-tagged libtool config variables
1511# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1512# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1513# section) are produced by _LT_LIBTOOL_TAG_VARS.
1514m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1515[m4_foreach([_lt_var],
1516    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1517    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1518
1519
1520# _LT_LIBTOOL_TAG_VARS(TAG)
1521# -------------------------
1522m4_define([_LT_LIBTOOL_TAG_VARS],
1523[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1524    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1525
1526
1527# _LT_TAGVAR(VARNAME, [TAGNAME])
1528# ------------------------------
1529m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1530
1531
1532# _LT_CONFIG_COMMANDS
1533# -------------------
1534# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1535# variables for single and double quote escaping we saved from calls
1536# to _LT_DECL, we can put quote escaped variables declarations
1537# into `config.status', and then the shell code to quote escape them in
1538# for loops in `config.status'.  Finally, any additional code accumulated
1539# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1540m4_defun([_LT_CONFIG_COMMANDS],
1541[AC_PROVIDE_IFELSE([LT_OUTPUT],
1542	dnl If the libtool generation code has been placed in $CONFIG_LT,
1543	dnl instead of duplicating it all over again into config.status,
1544	dnl then we will have config.status run $CONFIG_LT later, so it
1545	dnl needs to know what name is stored there:
1546        [AC_CONFIG_COMMANDS([libtool],
1547            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1548    dnl If the libtool generation code is destined for config.status,
1549    dnl expand the accumulated commands and init code now:
1550    [AC_CONFIG_COMMANDS([libtool],
1551        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1552])#_LT_CONFIG_COMMANDS
1553
1554
1555# Initialize.
1556m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1557[
1558
1559# The HP-UX ksh and POSIX shell print the target directory to stdout
1560# if CDPATH is set.
1561(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1562
1563sed_quote_subst='$sed_quote_subst'
1564double_quote_subst='$double_quote_subst'
1565delay_variable_subst='$delay_variable_subst'
1566_LT_CONFIG_STATUS_DECLARATIONS
1567LTCC='$LTCC'
1568LTCFLAGS='$LTCFLAGS'
1569compiler='$compiler_DEFAULT'
1570
1571# A function that is used when there is no print builtin or printf.
1572func_fallback_echo ()
1573{
1574  eval 'cat <<_LTECHO_EOF
1575\$[]1
1576_LTECHO_EOF'
1577}
1578
1579# Quote evaled strings.
1580for var in lt_decl_all_varnames([[ \
1581]], lt_decl_quote_varnames); do
1582    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1583    *[[\\\\\\\`\\"\\\$]]*)
1584      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1585      ;;
1586    *)
1587      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1588      ;;
1589    esac
1590done
1591
1592# Double-quote double-evaled strings.
1593for var in lt_decl_all_varnames([[ \
1594]], lt_decl_dquote_varnames); do
1595    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1596    *[[\\\\\\\`\\"\\\$]]*)
1597      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1598      ;;
1599    *)
1600      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1601      ;;
1602    esac
1603done
1604
1605_LT_OUTPUT_LIBTOOL_INIT
1606])
1607
1608# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1609# ------------------------------------
1610# Generate a child script FILE with all initialization necessary to
1611# reuse the environment learned by the parent script, and make the
1612# file executable.  If COMMENT is supplied, it is inserted after the
1613# `#!' sequence but before initialization text begins.  After this
1614# macro, additional text can be appended to FILE to form the body of
1615# the child script.  The macro ends with non-zero status if the
1616# file could not be fully written (such as if the disk is full).
1617m4_ifdef([AS_INIT_GENERATED],
1618[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1619[m4_defun([_LT_GENERATED_FILE_INIT],
1620[m4_require([AS_PREPARE])]dnl
1621[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1622[lt_write_fail=0
1623cat >$1 <<_ASEOF || lt_write_fail=1
1624#! $SHELL
1625# Generated by $as_me.
1626$2
1627SHELL=\${CONFIG_SHELL-$SHELL}
1628export SHELL
1629_ASEOF
1630cat >>$1 <<\_ASEOF || lt_write_fail=1
1631AS_SHELL_SANITIZE
1632_AS_PREPARE
1633exec AS_MESSAGE_FD>&1
1634_ASEOF
1635test $lt_write_fail = 0 && chmod +x $1[]dnl
1636m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1637
1638# LT_OUTPUT
1639# ---------
1640# This macro allows early generation of the libtool script (before
1641# AC_OUTPUT is called), incase it is used in configure for compilation
1642# tests.
1643AC_DEFUN([LT_OUTPUT],
1644[: ${CONFIG_LT=./config.lt}
1645AC_MSG_NOTICE([creating $CONFIG_LT])
1646_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1647[# Run this file to recreate a libtool stub with the current configuration.])
1648
1649cat >>"$CONFIG_LT" <<\_LTEOF
1650lt_cl_silent=false
1651exec AS_MESSAGE_LOG_FD>>config.log
1652{
1653  echo
1654  AS_BOX([Running $as_me.])
1655} >&AS_MESSAGE_LOG_FD
1656
1657lt_cl_help="\
1658\`$as_me' creates a local libtool stub from the current configuration,
1659for use in further configure time tests before the real libtool is
1660generated.
1661
1662Usage: $[0] [[OPTIONS]]
1663
1664  -h, --help      print this help, then exit
1665  -V, --version   print version number, then exit
1666  -q, --quiet     do not print progress messages
1667  -d, --debug     don't remove temporary files
1668
1669Report bugs to <bug-libtool@gnu.org>."
1670
1671lt_cl_version="\
1672m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1673m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1674configured by $[0], generated by m4_PACKAGE_STRING.
1675
1676Copyright (C) 2011 Free Software Foundation, Inc.
1677This config.lt script is free software; the Free Software Foundation
1678gives unlimited permision to copy, distribute and modify it."
1679
1680while test $[#] != 0
1681do
1682  case $[1] in
1683    --version | --v* | -V )
1684      echo "$lt_cl_version"; exit 0 ;;
1685    --help | --h* | -h )
1686      echo "$lt_cl_help"; exit 0 ;;
1687    --debug | --d* | -d )
1688      debug=: ;;
1689    --quiet | --q* | --silent | --s* | -q )
1690      lt_cl_silent=: ;;
1691
1692    -*) AC_MSG_ERROR([unrecognized option: $[1]
1693Try \`$[0] --help' for more information.]) ;;
1694
1695    *) AC_MSG_ERROR([unrecognized argument: $[1]
1696Try \`$[0] --help' for more information.]) ;;
1697  esac
1698  shift
1699done
1700
1701if $lt_cl_silent; then
1702  exec AS_MESSAGE_FD>/dev/null
1703fi
1704_LTEOF
1705
1706cat >>"$CONFIG_LT" <<_LTEOF
1707_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1708_LTEOF
1709
1710cat >>"$CONFIG_LT" <<\_LTEOF
1711AC_MSG_NOTICE([creating $ofile])
1712_LT_OUTPUT_LIBTOOL_COMMANDS
1713AS_EXIT(0)
1714_LTEOF
1715chmod +x "$CONFIG_LT"
1716
1717# configure is writing to config.log, but config.lt does its own redirection,
1718# appending to config.log, which fails on DOS, as config.log is still kept
1719# open by configure.  Here we exec the FD to /dev/null, effectively closing
1720# config.log, so it can be properly (re)opened and appended to by config.lt.
1721lt_cl_success=:
1722test "$silent" = yes &&
1723  lt_config_lt_args="$lt_config_lt_args --quiet"
1724exec AS_MESSAGE_LOG_FD>/dev/null
1725$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1726exec AS_MESSAGE_LOG_FD>>config.log
1727$lt_cl_success || AS_EXIT(1)
1728])# LT_OUTPUT
1729
1730
1731# _LT_CONFIG(TAG)
1732# ---------------
1733# If TAG is the built-in tag, create an initial libtool script with a
1734# default configuration from the untagged config vars.  Otherwise add code
1735# to config.status for appending the configuration named by TAG from the
1736# matching tagged config vars.
1737m4_defun([_LT_CONFIG],
1738[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1739_LT_CONFIG_SAVE_COMMANDS([
1740  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1741  m4_if(_LT_TAG, [C], [
1742    # See if we are running on zsh, and set the options which allow our
1743    # commands through without removal of \ escapes.
1744    if test -n "${ZSH_VERSION+set}" ; then
1745      setopt NO_GLOB_SUBST
1746    fi
1747
1748    cfgfile="${ofile}T"
1749    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1750    $RM "$cfgfile"
1751
1752    cat <<_LT_EOF >> "$cfgfile"
1753#! $SHELL
1754
1755# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1756# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1757# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1758# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1759#
1760_LT_COPYING
1761_LT_LIBTOOL_TAGS
1762
1763# ### BEGIN LIBTOOL CONFIG
1764_LT_LIBTOOL_CONFIG_VARS
1765_LT_LIBTOOL_TAG_VARS
1766# ### END LIBTOOL CONFIG
1767
1768_LT_EOF
1769
1770  case $host_os in
1771  aix3*)
1772    cat <<\_LT_EOF >> "$cfgfile"
1773# AIX sometimes has problems with the GCC collect2 program.  For some
1774# reason, if we set the COLLECT_NAMES environment variable, the problems
1775# vanish in a puff of smoke.
1776if test "X${COLLECT_NAMES+set}" != Xset; then
1777  COLLECT_NAMES=
1778  export COLLECT_NAMES
1779fi
1780_LT_EOF
1781    ;;
1782  esac
1783
1784  _LT_PROG_LTMAIN
1785
1786  # We use sed instead of cat because bash on DJGPP gets confused if
1787  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1788  # text mode, it properly converts lines to CR/LF.  This bash problem
1789  # is reportedly fixed, but why not run on old versions too?
1790  sed '$q' "$ltmain" >> "$cfgfile" \
1791     || (rm -f "$cfgfile"; exit 1)
1792
1793  _LT_PROG_REPLACE_SHELLFNS
1794
1795   mv -f "$cfgfile" "$ofile" ||
1796    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1797  chmod +x "$ofile"
1798],
1799[cat <<_LT_EOF >> "$ofile"
1800
1801dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1802dnl in a comment (ie after a #).
1803# ### BEGIN LIBTOOL TAG CONFIG: $1
1804_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1805# ### END LIBTOOL TAG CONFIG: $1
1806_LT_EOF
1807])dnl /m4_if
1808],
1809[m4_if([$1], [], [
1810    PACKAGE='$PACKAGE'
1811    VERSION='$VERSION'
1812    TIMESTAMP='$TIMESTAMP'
1813    RM='$RM'
1814    ofile='$ofile'], [])
1815])dnl /_LT_CONFIG_SAVE_COMMANDS
1816])# _LT_CONFIG
1817
1818
1819# LT_SUPPORTED_TAG(TAG)
1820# ---------------------
1821# Trace this macro to discover what tags are supported by the libtool
1822# --tag option, using:
1823#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1824AC_DEFUN([LT_SUPPORTED_TAG], [])
1825
1826
1827# C support is built-in for now
1828m4_define([_LT_LANG_C_enabled], [])
1829m4_define([_LT_TAGS], [])
1830
1831
1832# LT_LANG(LANG)
1833# -------------
1834# Enable libtool support for the given language if not already enabled.
1835AC_DEFUN([LT_LANG],
1836[AC_BEFORE([$0], [LT_OUTPUT])dnl
1837m4_case([$1],
1838  [C],			[_LT_LANG(C)],
1839  [C++],		[_LT_LANG(CXX)],
1840  [Go],			[_LT_LANG(GO)],
1841  [Java],		[_LT_LANG(GCJ)],
1842  [Fortran 77],		[_LT_LANG(F77)],
1843  [Fortran],		[_LT_LANG(FC)],
1844  [Windows Resource],	[_LT_LANG(RC)],
1845  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1846    [_LT_LANG($1)],
1847    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1848])# LT_LANG
1849
1850
1851# _LT_LANG(LANGNAME)
1852# ------------------
1853m4_defun([_LT_LANG],
1854[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1855  [LT_SUPPORTED_TAG([$1])dnl
1856  m4_append([_LT_TAGS], [$1 ])dnl
1857  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1858  _LT_LANG_$1_CONFIG($1)])dnl
1859])# _LT_LANG
1860
1861
1862m4_ifndef([AC_PROG_GO], [
1863# NOTE: This macro has been submitted for inclusion into   #
1864#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1865#  a released version of Autoconf we should remove this    #
1866#  macro and use it instead.                               #
1867m4_defun([AC_PROG_GO],
1868[AC_LANG_PUSH(Go)dnl
1869AC_ARG_VAR([GOC],     [Go compiler command])dnl
1870AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1871_AC_ARG_VAR_LDFLAGS()dnl
1872AC_CHECK_TOOL(GOC, gccgo)
1873if test -z "$GOC"; then
1874  if test -n "$ac_tool_prefix"; then
1875    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1876  fi
1877fi
1878if test -z "$GOC"; then
1879  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1880fi
1881])#m4_defun
1882])#m4_ifndef
1883
1884
1885# _LT_LANG_DEFAULT_CONFIG
1886# -----------------------
1887m4_defun([_LT_LANG_DEFAULT_CONFIG],
1888[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1889  [LT_LANG(CXX)],
1890  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1891
1892AC_PROVIDE_IFELSE([AC_PROG_F77],
1893  [LT_LANG(F77)],
1894  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
1895
1896AC_PROVIDE_IFELSE([AC_PROG_FC],
1897  [LT_LANG(FC)],
1898  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
1899
1900dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
1901dnl pulling things in needlessly.
1902AC_PROVIDE_IFELSE([AC_PROG_GCJ],
1903  [LT_LANG(GCJ)],
1904  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1905    [LT_LANG(GCJ)],
1906    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
1907      [LT_LANG(GCJ)],
1908      [m4_ifdef([AC_PROG_GCJ],
1909	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
1910       m4_ifdef([A][M_PROG_GCJ],
1911	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
1912       m4_ifdef([LT_PROG_GCJ],
1913	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
1914
1915AC_PROVIDE_IFELSE([AC_PROG_GO],
1916  [LT_LANG(GO)],
1917  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
1918
1919AC_PROVIDE_IFELSE([LT_PROG_RC],
1920  [LT_LANG(RC)],
1921  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
1922])# _LT_LANG_DEFAULT_CONFIG
1923
1924# Obsolete macros:
1925AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
1926AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
1927AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
1928AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
1929AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
1930dnl aclocal-1.4 backwards compatibility:
1931dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
1932dnl AC_DEFUN([AC_LIBTOOL_F77], [])
1933dnl AC_DEFUN([AC_LIBTOOL_FC], [])
1934dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
1935dnl AC_DEFUN([AC_LIBTOOL_RC], [])
1936
1937
1938# _LT_TAG_COMPILER
1939# ----------------
1940m4_defun([_LT_TAG_COMPILER],
1941[AC_REQUIRE([AC_PROG_CC])dnl
1942
1943_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
1944_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
1945_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
1946_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
1947
1948# If no C compiler was specified, use CC.
1949LTCC=${LTCC-"$CC"}
1950
1951# If no C compiler flags were specified, use CFLAGS.
1952LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1953
1954# Allow CC to be a program name with arguments.
1955compiler=$CC
1956])# _LT_TAG_COMPILER
1957
1958
1959# _LT_COMPILER_BOILERPLATE
1960# ------------------------
1961# Check for compiler boilerplate output or warnings with
1962# the simple compiler test code.
1963m4_defun([_LT_COMPILER_BOILERPLATE],
1964[m4_require([_LT_DECL_SED])dnl
1965ac_outfile=conftest.$ac_objext
1966echo "$lt_simple_compile_test_code" >conftest.$ac_ext
1967eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1968_lt_compiler_boilerplate=`cat conftest.err`
1969$RM conftest*
1970])# _LT_COMPILER_BOILERPLATE
1971
1972
1973# _LT_LINKER_BOILERPLATE
1974# ----------------------
1975# Check for linker boilerplate output or warnings with
1976# the simple link test code.
1977m4_defun([_LT_LINKER_BOILERPLATE],
1978[m4_require([_LT_DECL_SED])dnl
1979ac_outfile=conftest.$ac_objext
1980echo "$lt_simple_link_test_code" >conftest.$ac_ext
1981eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1982_lt_linker_boilerplate=`cat conftest.err`
1983$RM -r conftest*
1984])# _LT_LINKER_BOILERPLATE
1985
1986# _LT_REQUIRED_DARWIN_CHECKS
1987# -------------------------
1988m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
1989  case $host_os in
1990    rhapsody* | darwin*)
1991    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
1992    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
1993    AC_CHECK_TOOL([LIPO], [lipo], [:])
1994    AC_CHECK_TOOL([OTOOL], [otool], [:])
1995    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1996    _LT_DECL([], [DSYMUTIL], [1],
1997      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1998    _LT_DECL([], [NMEDIT], [1],
1999      [Tool to change global to local symbols on Mac OS X])
2000    _LT_DECL([], [LIPO], [1],
2001      [Tool to manipulate fat objects and archives on Mac OS X])
2002    _LT_DECL([], [OTOOL], [1],
2003      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2004    _LT_DECL([], [OTOOL64], [1],
2005      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2006
2007    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2008      [lt_cv_apple_cc_single_mod=no
2009      if test -z "${LT_MULTI_MODULE}"; then
2010	# By default we will add the -single_module flag. You can override
2011	# by either setting the environment variable LT_MULTI_MODULE
2012	# non-empty at configure time, or by adding -multi_module to the
2013	# link flags.
2014	rm -rf libconftest.dylib*
2015	echo "int foo(void){return 1;}" > conftest.c
2016	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2017-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2018	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2019	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2020        _lt_result=$?
2021	# If there is a non-empty error log, and "single_module"
2022	# appears in it, assume the flag caused a linker warning
2023        if test -s conftest.err && $GREP single_module conftest.err; then
2024	  cat conftest.err >&AS_MESSAGE_LOG_FD
2025	# Otherwise, if the output was created with a 0 exit code from
2026	# the compiler, it worked.
2027	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2028	  lt_cv_apple_cc_single_mod=yes
2029	else
2030	  cat conftest.err >&AS_MESSAGE_LOG_FD
2031	fi
2032	rm -rf libconftest.dylib*
2033	rm -f conftest.*
2034      fi])
2035
2036    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2037      [lt_cv_ld_exported_symbols_list],
2038      [lt_cv_ld_exported_symbols_list=no
2039      save_LDFLAGS=$LDFLAGS
2040      echo "_main" > conftest.sym
2041      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2042      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2043	[lt_cv_ld_exported_symbols_list=yes],
2044	[lt_cv_ld_exported_symbols_list=no])
2045	LDFLAGS="$save_LDFLAGS"
2046    ])
2047
2048    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2049      [lt_cv_ld_force_load=no
2050      cat > conftest.c << _LT_EOF
2051int forced_loaded() { return 2;}
2052_LT_EOF
2053      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2054      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2055      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2056      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2057      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2058      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2059      cat > conftest.c << _LT_EOF
2060int main() { return 0;}
2061_LT_EOF
2062      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2063      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2064      _lt_result=$?
2065      if test -s conftest.err && $GREP force_load conftest.err; then
2066	cat conftest.err >&AS_MESSAGE_LOG_FD
2067      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2068	lt_cv_ld_force_load=yes
2069      else
2070	cat conftest.err >&AS_MESSAGE_LOG_FD
2071      fi
2072        rm -f conftest.err libconftest.a conftest conftest.c
2073        rm -rf conftest.dSYM
2074    ])
2075    case $host_os in
2076    rhapsody* | darwin1.[[012]])
2077      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2078    darwin1.*)
2079      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2080    darwin*) # darwin 5.x on
2081      # if running on 10.5 or later, the deployment target defaults
2082      # to the OS version, if on x86, and 10.4, the deployment
2083      # target defaults to 10.4. Don't you love it?
2084      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2085	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2086	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2087	10.[[012]]*)
2088	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2089	10.*)
2090	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2091      esac
2092    ;;
2093  esac
2094    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2095      _lt_dar_single_mod='$single_module'
2096    fi
2097    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2098      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2099    else
2100      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2101    fi
2102    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2103      _lt_dsymutil='~$DSYMUTIL $lib || :'
2104    else
2105      _lt_dsymutil=
2106    fi
2107    ;;
2108  esac
2109])
2110
2111
2112# _LT_DARWIN_LINKER_FEATURES([TAG])
2113# ---------------------------------
2114# Checks for linker and compiler features on darwin
2115m4_defun([_LT_DARWIN_LINKER_FEATURES],
2116[
2117  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2118  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2119  _LT_TAGVAR(hardcode_direct, $1)=no
2120  _LT_TAGVAR(hardcode_automatic, $1)=yes
2121  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2122  if test "$lt_cv_ld_force_load" = "yes"; then
2123    _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\"`'
2124    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2125                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2126  else
2127    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2128  fi
2129  _LT_TAGVAR(link_all_deplibs, $1)=yes
2130  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2131  case $cc_basename in
2132     ifort*) _lt_dar_can_shared=yes ;;
2133     *) _lt_dar_can_shared=$GCC ;;
2134  esac
2135  if test "$_lt_dar_can_shared" = "yes"; then
2136    output_verbose_link_cmd=func_echo_all
2137    _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}"
2138    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2139    _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}"
2140    _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}"
2141    m4_if([$1], [CXX],
2142[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2143      _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}"
2144      _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}"
2145    fi
2146],[])
2147  else
2148  _LT_TAGVAR(ld_shlibs, $1)=no
2149  fi
2150])
2151
2152# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2153# ----------------------------------
2154# Links a minimal program and checks the executable
2155# for the system default hardcoded library path. In most cases,
2156# this is /usr/lib:/lib, but when the MPI compilers are used
2157# the location of the communication and MPI libs are included too.
2158# If we don't find anything, use the default library path according
2159# to the aix ld manual.
2160# Store the results from the different compilers for each TAGNAME.
2161# Allow to override them for all tags through lt_cv_aix_libpath.
2162m4_defun([_LT_SYS_MODULE_PATH_AIX],
2163[m4_require([_LT_DECL_SED])dnl
2164if test "${lt_cv_aix_libpath+set}" = set; then
2165  aix_libpath=$lt_cv_aix_libpath
2166else
2167  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2168  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2169  lt_aix_libpath_sed='[
2170      /Import File Strings/,/^$/ {
2171	  /^0/ {
2172	      s/^0  *\([^ ]*\) *$/\1/
2173	      p
2174	  }
2175      }]'
2176  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2177  # Check for a 64-bit object if we didn't find anything.
2178  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2179    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2180  fi],[])
2181  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2182    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2183  fi
2184  ])
2185  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2186fi
2187])# _LT_SYS_MODULE_PATH_AIX
2188
2189
2190# _LT_SHELL_INIT(ARG)
2191# -------------------
2192m4_define([_LT_SHELL_INIT],
2193[m4_divert_text([M4SH-INIT], [$1
2194])])# _LT_SHELL_INIT
2195
2196
2197
2198# _LT_PROG_ECHO_BACKSLASH
2199# -----------------------
2200# Find how we can fake an echo command that does not interpret backslash.
2201# In particular, with Autoconf 2.60 or later we add some code to the start
2202# of the generated configure script which will find a shell with a builtin
2203# printf (which we can use as an echo command).
2204m4_defun([_LT_PROG_ECHO_BACKSLASH],
2205[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2206ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2207ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2208
2209AC_MSG_CHECKING([how to print strings])
2210# Test print first, because it will be a builtin if present.
2211if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2212   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2213  ECHO='print -r --'
2214elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2215  ECHO='printf %s\n'
2216else
2217  # Use this function as a fallback that always works.
2218  func_fallback_echo ()
2219  {
2220    eval 'cat <<_LTECHO_EOF
2221$[]1
2222_LTECHO_EOF'
2223  }
2224  ECHO='func_fallback_echo'
2225fi
2226
2227# func_echo_all arg...
2228# Invoke $ECHO with all args, space-separated.
2229func_echo_all ()
2230{
2231    $ECHO "$*" 
2232}
2233
2234case "$ECHO" in
2235  printf*) AC_MSG_RESULT([printf]) ;;
2236  print*) AC_MSG_RESULT([print -r]) ;;
2237  *) AC_MSG_RESULT([cat]) ;;
2238esac
2239
2240m4_ifdef([_AS_DETECT_SUGGESTED],
2241[_AS_DETECT_SUGGESTED([
2242  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2243    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2244    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2245    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2246    PATH=/empty FPATH=/empty; export PATH FPATH
2247    test "X`printf %s $ECHO`" = "X$ECHO" \
2248      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2249
2250_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2251_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2252])# _LT_PROG_ECHO_BACKSLASH
2253
2254
2255# _LT_WITH_SYSROOT
2256# ----------------
2257AC_DEFUN([_LT_WITH_SYSROOT],
2258[AC_MSG_CHECKING([for sysroot])
2259AC_ARG_WITH([sysroot],
2260[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2261                        (or the compiler's sysroot if not specified).],
2262[], [with_sysroot=no])
2263
2264dnl lt_sysroot will always be passed unquoted.  We quote it here
2265dnl in case the user passed a directory name.
2266lt_sysroot=
2267case ${with_sysroot} in #(
2268 yes)
2269   if test "$GCC" = yes; then
2270     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2271   fi
2272   ;; #(
2273 /*)
2274   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2275   ;; #(
2276 no|'')
2277   ;; #(
2278 *)
2279   AC_MSG_RESULT([${with_sysroot}])
2280   AC_MSG_ERROR([The sysroot must be an absolute path.])
2281   ;;
2282esac
2283
2284 AC_MSG_RESULT([${lt_sysroot:-no}])
2285_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2286[dependent libraries, and in which our libraries should be installed.])])
2287
2288# _LT_ENABLE_LOCK
2289# ---------------
2290m4_defun([_LT_ENABLE_LOCK],
2291[AC_ARG_ENABLE([libtool-lock],
2292  [AS_HELP_STRING([--disable-libtool-lock],
2293    [avoid locking (might break parallel builds)])])
2294test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2295
2296# Some flags need to be propagated to the compiler or linker for good
2297# libtool support.
2298case $host in
2299ia64-*-hpux*)
2300  # Find out which ABI we are using.
2301  echo 'int i;' > conftest.$ac_ext
2302  if AC_TRY_EVAL(ac_compile); then
2303    case `/usr/bin/file conftest.$ac_objext` in
2304      *ELF-32*)
2305	HPUX_IA64_MODE="32"
2306	;;
2307      *ELF-64*)
2308	HPUX_IA64_MODE="64"
2309	;;
2310    esac
2311  fi
2312  rm -rf conftest*
2313  ;;
2314*-*-irix6*)
2315  # Find out which ABI we are using.
2316  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2317  if AC_TRY_EVAL(ac_compile); then
2318    if test "$lt_cv_prog_gnu_ld" = yes; then
2319      case `/usr/bin/file conftest.$ac_objext` in
2320	*32-bit*)
2321	  LD="${LD-ld} -melf32bsmip"
2322	  ;;
2323	*N32*)
2324	  LD="${LD-ld} -melf32bmipn32"
2325	  ;;
2326	*64-bit*)
2327	  LD="${LD-ld} -melf64bmip"
2328	;;
2329      esac
2330    else
2331      case `/usr/bin/file conftest.$ac_objext` in
2332	*32-bit*)
2333	  LD="${LD-ld} -32"
2334	  ;;
2335	*N32*)
2336	  LD="${LD-ld} -n32"
2337	  ;;
2338	*64-bit*)
2339	  LD="${LD-ld} -64"
2340	  ;;
2341      esac
2342    fi
2343  fi
2344  rm -rf conftest*
2345  ;;
2346
2347x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2348s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2349  # Find out which ABI we are using.
2350  echo 'int i;' > conftest.$ac_ext
2351  if AC_TRY_EVAL(ac_compile); then
2352    case `/usr/bin/file conftest.o` in
2353      *32-bit*)
2354	case $host in
2355	  x86_64-*kfreebsd*-gnu)
2356	    LD="${LD-ld} -m elf_i386_fbsd"
2357	    ;;
2358	  x86_64-*linux*)
2359	    LD="${LD-ld} -m elf_i386"
2360	    ;;
2361	  ppc64-*linux*|powerpc64-*linux*)
2362	    LD="${LD-ld} -m elf32ppclinux"
2363	    ;;
2364	  s390x-*linux*)
2365	    LD="${LD-ld} -m elf_s390"
2366	    ;;
2367	  sparc64-*linux*)
2368	    LD="${LD-ld} -m elf32_sparc"
2369	    ;;
2370	esac
2371	;;
2372      *64-bit*)
2373	case $host in
2374	  x86_64-*kfreebsd*-gnu)
2375	    LD="${LD-ld} -m elf_x86_64_fbsd"
2376	    ;;
2377	  x86_64-*linux*)
2378	    LD="${LD-ld} -m elf_x86_64"
2379	    ;;
2380	  ppc*-*linux*|powerpc*-*linux*)
2381	    LD="${LD-ld} -m elf64ppc"
2382	    ;;
2383	  s390*-*linux*|s390*-*tpf*)
2384	    LD="${LD-ld} -m elf64_s390"
2385	    ;;
2386	  sparc*-*linux*)
2387	    LD="${LD-ld} -m elf64_sparc"
2388	    ;;
2389	esac
2390	;;
2391    esac
2392  fi
2393  rm -rf conftest*
2394  ;;
2395
2396*-*-sco3.2v5*)
2397  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2398  SAVE_CFLAGS="$CFLAGS"
2399  CFLAGS="$CFLAGS -belf"
2400  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2401    [AC_LANG_PUSH(C)
2402     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2403     AC_LANG_POP])
2404  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2405    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2406    CFLAGS="$SAVE_CFLAGS"
2407  fi
2408  ;;
2409*-*solaris*)
2410  # Find out which ABI we are using.
2411  echo 'int i;' > conftest.$ac_ext
2412  if AC_TRY_EVAL(ac_compile); then
2413    case `/usr/bin/file conftest.o` in
2414    *64-bit*)
2415      case $lt_cv_prog_gnu_ld in
2416      yes*)
2417        case $host in
2418        i?86-*-solaris*)
2419          LD="${LD-ld} -m elf_x86_64"
2420          ;;
2421        sparc*-*-solaris*)
2422          LD="${LD-ld} -m elf64_sparc"
2423          ;;
2424        esac
2425        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2426        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2427          LD="${LD-ld}_sol2"
2428        fi
2429        ;;
2430      *)
2431	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2432	  LD="${LD-ld} -64"
2433	fi
2434	;;
2435      esac
2436      ;;
2437    esac
2438  fi
2439  rm -rf conftest*
2440  ;;
2441esac
2442
2443need_locks="$enable_libtool_lock"
2444])# _LT_ENABLE_LOCK
2445
2446
2447# _LT_PROG_AR
2448# -----------
2449m4_defun([_LT_PROG_AR],
2450[AC_CHECK_TOOLS(AR, [ar], false)
2451: ${AR=ar}
2452: ${AR_FLAGS=cru}
2453_LT_DECL([], [AR], [1], [The archiver])
2454_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2455
2456AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2457  [lt_cv_ar_at_file=no
2458   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2459     [echo conftest.$ac_objext > conftest.lst
2460      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2461      AC_TRY_EVAL([lt_ar_try])
2462      if test "$ac_status" -eq 0; then
2463	# Ensure the archiver fails upon bogus file names.
2464	rm -f conftest.$ac_objext libconftest.a
2465	AC_TRY_EVAL([lt_ar_try])
2466	if test "$ac_status" -ne 0; then
2467          lt_cv_ar_at_file=@
2468        fi
2469      fi
2470      rm -f conftest.* libconftest.a
2471     ])
2472  ])
2473
2474if test "x$lt_cv_ar_at_file" = xno; then
2475  archiver_list_spec=
2476else
2477  archiver_list_spec=$lt_cv_ar_at_file
2478fi
2479_LT_DECL([], [archiver_list_spec], [1],
2480  [How to feed a file listing to the archiver])
2481])# _LT_PROG_AR
2482
2483
2484# _LT_CMD_OLD_ARCHIVE
2485# -------------------
2486m4_defun([_LT_CMD_OLD_ARCHIVE],
2487[_LT_PROG_AR
2488
2489AC_CHECK_TOOL(STRIP, strip, :)
2490test -z "$STRIP" && STRIP=:
2491_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2492
2493AC_CHECK_TOOL(RANLIB, ranlib, :)
2494test -z "$RANLIB" && RANLIB=:
2495_LT_DECL([], [RANLIB], [1],
2496    [Commands used to install an old-style archive])
2497
2498# Determine commands to create old-style static archives.
2499old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2500old_postinstall_cmds='chmod 644 $oldlib'
2501old_postuninstall_cmds=
2502
2503if test -n "$RANLIB"; then
2504  case $host_os in
2505  openbsd*)
2506    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2507    ;;
2508  *)
2509    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2510    ;;
2511  esac
2512  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2513fi
2514
2515case $host_os in
2516  darwin*)
2517    lock_old_archive_extraction=yes ;;
2518  *)
2519    lock_old_archive_extraction=no ;;
2520esac
2521_LT_DECL([], [old_postinstall_cmds], [2])
2522_LT_DECL([], [old_postuninstall_cmds], [2])
2523_LT_TAGDECL([], [old_archive_cmds], [2],
2524    [Commands used to build an old-style archive])
2525_LT_DECL([], [lock_old_archive_extraction], [0],
2526    [Whether to use a lock for old archive extraction])
2527])# _LT_CMD_OLD_ARCHIVE
2528
2529
2530# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2531#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2532# ----------------------------------------------------------------
2533# Check whether the given compiler option works
2534AC_DEFUN([_LT_COMPILER_OPTION],
2535[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2536m4_require([_LT_DECL_SED])dnl
2537AC_CACHE_CHECK([$1], [$2],
2538  [$2=no
2539   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2540   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2541   lt_compiler_flag="$3"
2542   # Insert the option either (1) after the last *FLAGS variable, or
2543   # (2) before a word containing "conftest.", or (3) at the end.
2544   # Note that $ac_compile itself does not contain backslashes and begins
2545   # with a dollar sign (not a hyphen), so the echo should work correctly.
2546   # The option is referenced via a variable to avoid confusing sed.
2547   lt_compile=`echo "$ac_compile" | $SED \
2548   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2549   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2550   -e 's:$: $lt_compiler_flag:'`
2551   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2552   (eval "$lt_compile" 2>conftest.err)
2553   ac_status=$?
2554   cat conftest.err >&AS_MESSAGE_LOG_FD
2555   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2556   if (exit $ac_status) && test -s "$ac_outfile"; then
2557     # The compiler can only warn and ignore the option if not recognized
2558     # So say no if there are warnings other than the usual output.
2559     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2560     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2561     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2562       $2=yes
2563     fi
2564   fi
2565   $RM conftest*
2566])
2567
2568if test x"[$]$2" = xyes; then
2569    m4_if([$5], , :, [$5])
2570else
2571    m4_if([$6], , :, [$6])
2572fi
2573])# _LT_COMPILER_OPTION
2574
2575# Old name:
2576AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2577dnl aclocal-1.4 backwards compatibility:
2578dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2579
2580
2581# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2582#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2583# ----------------------------------------------------
2584# Check whether the given linker option works
2585AC_DEFUN([_LT_LINKER_OPTION],
2586[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2587m4_require([_LT_DECL_SED])dnl
2588AC_CACHE_CHECK([$1], [$2],
2589  [$2=no
2590   save_LDFLAGS="$LDFLAGS"
2591   LDFLAGS="$LDFLAGS $3"
2592   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2593   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2594     # The linker can only warn and ignore the option if not recognized
2595     # So say no if there are warnings
2596     if test -s conftest.err; then
2597       # Append any errors to the config.log.
2598       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2599       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2600       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2601       if diff conftest.exp conftest.er2 >/dev/null; then
2602         $2=yes
2603       fi
2604     else
2605       $2=yes
2606     fi
2607   fi
2608   $RM -r conftest*
2609   LDFLAGS="$save_LDFLAGS"
2610])
2611
2612if test x"[$]$2" = xyes; then
2613    m4_if([$4], , :, [$4])
2614else
2615    m4_if([$5], , :, [$5])
2616fi
2617])# _LT_LINKER_OPTION
2618
2619# Old name:
2620AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2621dnl aclocal-1.4 backwards compatibility:
2622dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2623
2624
2625# LT_CMD_MAX_LEN
2626#---------------
2627AC_DEFUN([LT_CMD_MAX_LEN],
2628[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2629# find the maximum length of command line arguments
2630AC_MSG_CHECKING([the maximum length of command line arguments])
2631AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2632  i=0
2633  teststring="ABCD"
2634
2635  case $build_os in
2636  msdosdjgpp*)
2637    # On DJGPP, this test can blow up pretty badly due to problems in libc
2638    # (any single argument exceeding 2000 bytes causes a buffer overrun
2639    # during glob expansion).  Even if it were fixed, the result of this
2640    # check would be larger than it should be.
2641    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2642    ;;
2643
2644  gnu*)
2645    # Under GNU Hurd, this test is not required because there is
2646    # no limit to the length of command line arguments.
2647    # Libtool will interpret -1 as no limit whatsoever
2648    lt_cv_sys_max_cmd_len=-1;
2649    ;;
2650
2651  cygwin* | mingw* | cegcc*)
2652    # On Win9x/ME, this test blows up -- it succeeds, but takes
2653    # about 5 minutes as the teststring grows exponentially.
2654    # Worse, since 9x/ME are not pre-emptively multitasking,
2655    # you end up with a "frozen" computer, even though with patience
2656    # the test eventually succeeds (with a max line length of 256k).
2657    # Instead, let's just punt: use the minimum linelength reported by
2658    # all of the supported platforms: 8192 (on NT/2K/XP).
2659    lt_cv_sys_max_cmd_len=8192;
2660    ;;
2661
2662  mint*)
2663    # On MiNT this can take a long time and run out of memory.
2664    lt_cv_sys_max_cmd_len=8192;
2665    ;;
2666
2667  amigaos*)
2668    # On AmigaOS with pdksh, this test takes hours, literally.
2669    # So we just punt and use a minimum line length of 8192.
2670    lt_cv_sys_max_cmd_len=8192;
2671    ;;
2672
2673  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2674    # This has been around since 386BSD, at least.  Likely further.
2675    if test -x /sbin/sysctl; then
2676      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2677    elif test -x /usr/sbin/sysctl; then
2678      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2679    else
2680      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2681    fi
2682    # And add a safety zone
2683    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2684    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2685    ;;
2686
2687  interix*)
2688    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2689    lt_cv_sys_max_cmd_len=196608
2690    ;;
2691
2692  os2*)
2693    # The test takes a long time on OS/2.
2694    lt_cv_sys_max_cmd_len=8192
2695    ;;
2696
2697  osf*)
2698    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2699    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2700    # nice to cause kernel panics so lets avoid the loop below.
2701    # First set a reasonable default.
2702    lt_cv_sys_max_cmd_len=16384
2703    #
2704    if test -x /sbin/sysconfig; then
2705      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2706        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2707      esac
2708    fi
2709    ;;
2710  sco3.2v5*)
2711    lt_cv_sys_max_cmd_len=102400
2712    ;;
2713  sysv5* | sco5v6* | sysv4.2uw2*)
2714    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2715    if test -n "$kargmax"; then
2716      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2717    else
2718      lt_cv_sys_max_cmd_len=32768
2719    fi
2720    ;;
2721  *)
2722    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2723    if test -n "$lt_cv_sys_max_cmd_len"; then
2724      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2725      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2726    else
2727      # Make teststring a little bigger before we do anything with it.
2728      # a 1K string should be a reasonable start.
2729      for i in 1 2 3 4 5 6 7 8 ; do
2730        teststring=$teststring$teststring
2731      done
2732      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2733      # If test is not a shell built-in, we'll probably end up computing a
2734      # maximum length that is only half of the actual maximum length, but
2735      # we can't tell.
2736      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2737	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2738	      test $i != 17 # 1/2 MB should be enough
2739      do
2740        i=`expr $i + 1`
2741        teststring=$teststring$teststring
2742      done
2743      # Only check the string length outside the loop.
2744      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2745      teststring=
2746      # Add a significant safety factor because C++ compilers can tack on
2747      # massive amounts of additional arguments before passing them to the
2748      # linker.  It appears as though 1/2 is a usable value.
2749      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2750    fi
2751    ;;
2752  esac
2753])
2754if test -n $lt_cv_sys_max_cmd_len ; then
2755  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2756else
2757  AC_MSG_RESULT(none)
2758fi
2759max_cmd_len=$lt_cv_sys_max_cmd_len
2760_LT_DECL([], [max_cmd_len], [0],
2761    [What is the maximum length of a command?])
2762])# LT_CMD_MAX_LEN
2763
2764# Old name:
2765AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2766dnl aclocal-1.4 backwards compatibility:
2767dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2768
2769
2770# _LT_HEADER_DLFCN
2771# ----------------
2772m4_defun([_LT_HEADER_DLFCN],
2773[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2774])# _LT_HEADER_DLFCN
2775
2776
2777# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2778#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2779# ----------------------------------------------------------------
2780m4_defun([_LT_TRY_DLOPEN_SELF],
2781[m4_require([_LT_HEADER_DLFCN])dnl
2782if test "$cross_compiling" = yes; then :
2783  [$4]
2784else
2785  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2786  lt_status=$lt_dlunknown
2787  cat > conftest.$ac_ext <<_LT_EOF
2788[#line $LINENO "configure"
2789#include "confdefs.h"
2790
2791#if HAVE_DLFCN_H
2792#include <dlfcn.h>
2793#endif
2794
2795#include <stdio.h>
2796
2797#ifdef RTLD_GLOBAL
2798#  define LT_DLGLOBAL		RTLD_GLOBAL
2799#else
2800#  ifdef DL_GLOBAL
2801#    define LT_DLGLOBAL		DL_GLOBAL
2802#  else
2803#    define LT_DLGLOBAL		0
2804#  endif
2805#endif
2806
2807/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2808   find out it does not work in some platform. */
2809#ifndef LT_DLLAZY_OR_NOW
2810#  ifdef RTLD_LAZY
2811#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2812#  else
2813#    ifdef DL_LAZY
2814#      define LT_DLLAZY_OR_NOW		DL_LAZY
2815#    else
2816#      ifdef RTLD_NOW
2817#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2818#      else
2819#        ifdef DL_NOW
2820#          define LT_DLLAZY_OR_NOW	DL_NOW
2821#        else
2822#          define LT_DLLAZY_OR_NOW	0
2823#        endif
2824#      endif
2825#    endif
2826#  endif
2827#endif
2828
2829/* When -fvisbility=hidden is used, assume the code has been annotated
2830   correspondingly for the symbols needed.  */
2831#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2832int fnord () __attribute__((visibility("default")));
2833#endif
2834
2835int fnord () { return 42; }
2836int main ()
2837{
2838  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2839  int status = $lt_dlunknown;
2840
2841  if (self)
2842    {
2843      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2844      else
2845        {
2846	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2847          else puts (dlerror ());
2848	}
2849      /* dlclose (self); */
2850    }
2851  else
2852    puts (dlerror ());
2853
2854  return status;
2855}]
2856_LT_EOF
2857  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2858    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2859    lt_status=$?
2860    case x$lt_status in
2861      x$lt_dlno_uscore) $1 ;;
2862      x$lt_dlneed_uscore) $2 ;;
2863      x$lt_dlunknown|x*) $3 ;;
2864    esac
2865  else :
2866    # compilation failed
2867    $3
2868  fi
2869fi
2870rm -fr conftest*
2871])# _LT_TRY_DLOPEN_SELF
2872
2873
2874# LT_SYS_DLOPEN_SELF
2875# ------------------
2876AC_DEFUN([LT_SYS_DLOPEN_SELF],
2877[m4_require([_LT_HEADER_DLFCN])dnl
2878if test "x$enable_dlopen" != xyes; then
2879  enable_dlopen=unknown
2880  enable_dlopen_self=unknown
2881  enable_dlopen_self_static=unknown
2882else
2883  lt_cv_dlopen=no
2884  lt_cv_dlopen_libs=
2885
2886  case $host_os in
2887  beos*)
2888    lt_cv_dlopen="load_add_on"
2889    lt_cv_dlopen_libs=
2890    lt_cv_dlopen_self=yes
2891    ;;
2892
2893  mingw* | pw32* | cegcc*)
2894    lt_cv_dlopen="LoadLibrary"
2895    lt_cv_dlopen_libs=
2896    ;;
2897
2898  cygwin*)
2899    lt_cv_dlopen="dlopen"
2900    lt_cv_dlopen_libs=
2901    ;;
2902
2903  darwin*)
2904  # if libdl is installed we need to link against it
2905    AC_CHECK_LIB([dl], [dlopen],
2906		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2907    lt_cv_dlopen="dyld"
2908    lt_cv_dlopen_libs=
2909    lt_cv_dlopen_self=yes
2910    ])
2911    ;;
2912
2913  *)
2914    AC_CHECK_FUNC([shl_load],
2915	  [lt_cv_dlopen="shl_load"],
2916      [AC_CHECK_LIB([dld], [shl_load],
2917	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2918	[AC_CHECK_FUNC([dlopen],
2919	      [lt_cv_dlopen="dlopen"],
2920	  [AC_CHECK_LIB([dl], [dlopen],
2921		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2922	    [AC_CHECK_LIB([svld], [dlopen],
2923		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2924	      [AC_CHECK_LIB([dld], [dld_link],
2925		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
2926	      ])
2927	    ])
2928	  ])
2929	])
2930      ])
2931    ;;
2932  esac
2933
2934  if test "x$lt_cv_dlopen" != xno; then
2935    enable_dlopen=yes
2936  else
2937    enable_dlopen=no
2938  fi
2939
2940  case $lt_cv_dlopen in
2941  dlopen)
2942    save_CPPFLAGS="$CPPFLAGS"
2943    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2944
2945    save_LDFLAGS="$LDFLAGS"
2946    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2947
2948    save_LIBS="$LIBS"
2949    LIBS="$lt_cv_dlopen_libs $LIBS"
2950
2951    AC_CACHE_CHECK([whether a program can dlopen itself],
2952	  lt_cv_dlopen_self, [dnl
2953	  _LT_TRY_DLOPEN_SELF(
2954	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2955	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2956    ])
2957
2958    if test "x$lt_cv_dlopen_self" = xyes; then
2959      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2960      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2961	  lt_cv_dlopen_self_static, [dnl
2962	  _LT_TRY_DLOPEN_SELF(
2963	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2964	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2965      ])
2966    fi
2967
2968    CPPFLAGS="$save_CPPFLAGS"
2969    LDFLAGS="$save_LDFLAGS"
2970    LIBS="$save_LIBS"
2971    ;;
2972  esac
2973
2974  case $lt_cv_dlopen_self in
2975  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2976  *) enable_dlopen_self=unknown ;;
2977  esac
2978
2979  case $lt_cv_dlopen_self_static in
2980  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2981  *) enable_dlopen_self_static=unknown ;;
2982  esac
2983fi
2984_LT_DECL([dlopen_support], [enable_dlopen], [0],
2985	 [Whether dlopen is supported])
2986_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2987	 [Whether dlopen of programs is supported])
2988_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2989	 [Whether dlopen of statically linked programs is supported])
2990])# LT_SYS_DLOPEN_SELF
2991
2992# Old name:
2993AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2994dnl aclocal-1.4 backwards compatibility:
2995dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2996
2997
2998# _LT_COMPILER_C_O([TAGNAME])
2999# ---------------------------
3000# Check to see if options -c and -o are simultaneously supported by compiler.
3001# This macro does not hard code the compiler like AC_PROG_CC_C_O.
3002m4_defun([_LT_COMPILER_C_O],
3003[m4_require([_LT_DECL_SED])dnl
3004m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3005m4_require([_LT_TAG_COMPILER])dnl
3006AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3007  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3008  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3009   $RM -r conftest 2>/dev/null
3010   mkdir conftest
3011   cd conftest
3012   mkdir out
3013   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3014
3015   lt_compiler_flag="-o out/conftest2.$ac_objext"
3016   # Insert the option either (1) after the last *FLAGS variable, or
3017   # (2) before a word containing "conftest.", or (3) at the end.
3018   # Note that $ac_compile itself does not contain backslashes and begins
3019   # with a dollar sign (not a hyphen), so the echo should work correctly.
3020   lt_compile=`echo "$ac_compile" | $SED \
3021   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3022   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3023   -e 's:$: $lt_compiler_flag:'`
3024   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3025   (eval "$lt_compile" 2>out/conftest.err)
3026   ac_status=$?
3027   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3028   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3029   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3030   then
3031     # The compiler can only warn and ignore the option if not recognized
3032     # So say no if there are warnings
3033     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3034     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3035     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3036       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3037     fi
3038   fi
3039   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3040   $RM conftest*
3041   # SGI C++ compiler will create directory out/ii_files/ for
3042   # template instantiation
3043   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3044   $RM out/* && rmdir out
3045   cd ..
3046   $RM -r conftest
3047   $RM conftest*
3048])
3049_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3050	[Does compiler simultaneously support -c and -o options?])
3051])# _LT_COMPILER_C_O
3052
3053
3054# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3055# ----------------------------------
3056# Check to see if we can do hard links to lock some files if needed
3057m4_defun([_LT_COMPILER_FILE_LOCKS],
3058[m4_require([_LT_ENABLE_LOCK])dnl
3059m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3060_LT_COMPILER_C_O([$1])
3061
3062hard_links="nottested"
3063if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3064  # do not overwrite the value of need_locks provided by the user
3065  AC_MSG_CHECKING([if we can lock with hard links])
3066  hard_links=yes
3067  $RM conftest*
3068  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3069  touch conftest.a
3070  ln conftest.a conftest.b 2>&5 || hard_links=no
3071  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3072  AC_MSG_RESULT([$hard_links])
3073  if test "$hard_links" = no; then
3074    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3075    need_locks=warn
3076  fi
3077else
3078  need_locks=no
3079fi
3080_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3081])# _LT_COMPILER_FILE_LOCKS
3082
3083
3084# _LT_CHECK_OBJDIR
3085# ----------------
3086m4_defun([_LT_CHECK_OBJDIR],
3087[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3088[rm -f .libs 2>/dev/null
3089mkdir .libs 2>/dev/null
3090if test -d .libs; then
3091  lt_cv_objdir=.libs
3092else
3093  # MS-DOS does not allow filenames that begin with a dot.
3094  lt_cv_objdir=_libs
3095fi
3096rmdir .libs 2>/dev/null])
3097objdir=$lt_cv_objdir
3098_LT_DECL([], [objdir], [0],
3099         [The name of the directory that contains temporary libtool files])dnl
3100m4_pattern_allow([LT_OBJDIR])dnl
3101AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3102  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3103])# _LT_CHECK_OBJDIR
3104
3105
3106# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3107# --------------------------------------
3108# Check hardcoding attributes.
3109m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3110[AC_MSG_CHECKING([how to hardcode library paths into programs])
3111_LT_TAGVAR(hardcode_action, $1)=
3112if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3113   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3114   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3115
3116  # We can hardcode non-existent directories.
3117  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3118     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3119     # have to relink, otherwise we might link with an installed library
3120     # when we should be linking with a yet-to-be-installed one
3121     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3122     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3123    # Linking always hardcodes the temporary library directory.
3124    _LT_TAGVAR(hardcode_action, $1)=relink
3125  else
3126    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3127    _LT_TAGVAR(hardcode_action, $1)=immediate
3128  fi
3129else
3130  # We cannot hardcode anything, or else we can only hardcode existing
3131  # directories.
3132  _LT_TAGVAR(hardcode_action, $1)=unsupported
3133fi
3134AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3135
3136if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3137   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3138  # Fast installation is not supported
3139  enable_fast_install=no
3140elif test "$shlibpath_overrides_runpath" = yes ||
3141     test "$enable_shared" = no; then
3142  # Fast installation is not necessary
3143  enable_fast_install=needless
3144fi
3145_LT_TAGDECL([], [hardcode_action], [0],
3146    [How to hardcode a shared library path into an executable])
3147])# _LT_LINKER_HARDCODE_LIBPATH
3148
3149
3150# _LT_CMD_STRIPLIB
3151# ----------------
3152m4_defun([_LT_CMD_STRIPLIB],
3153[m4_require([_LT_DECL_EGREP])
3154striplib=
3155old_striplib=
3156AC_MSG_CHECKING([whether stripping libraries is possible])
3157if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3158  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3159  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3160  AC_MSG_RESULT([yes])
3161else
3162# FIXME - insert some real tests, host_os isn't really good enough
3163  case $host_os in
3164  darwin*)
3165    if test -n "$STRIP" ; then
3166      striplib="$STRIP -x"
3167      old_striplib="$STRIP -S"
3168      AC_MSG_RESULT([yes])
3169    else
3170      AC_MSG_RESULT([no])
3171    fi
3172    ;;
3173  *)
3174    AC_MSG_RESULT([no])
3175    ;;
3176  esac
3177fi
3178_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3179_LT_DECL([], [striplib], [1])
3180])# _LT_CMD_STRIPLIB
3181
3182
3183# _LT_SYS_DYNAMIC_LINKER([TAG])
3184# -----------------------------
3185# PORTME Fill in your ld.so characteristics
3186m4_defun([_LT_SYS_DYNAMIC_LINKER],
3187[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3188m4_require([_LT_DECL_EGREP])dnl
3189m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3190m4_require([_LT_DECL_OBJDUMP])dnl
3191m4_require([_LT_DECL_SED])dnl
3192m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3193AC_MSG_CHECKING([dynamic linker characteristics])
3194m4_if([$1],
3195	[], [
3196if test "$GCC" = yes; then
3197  case $host_os in
3198    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3199    *) lt_awk_arg="/^libraries:/" ;;
3200  esac
3201  case $host_os in
3202    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3203    *) lt_sed_strip_eq="s,=/,/,g" ;;
3204  esac
3205  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3206  case $lt_search_path_spec in
3207  *\;*)
3208    # if the path contains ";" then we assume it to be the separator
3209    # otherwise default to the standard path separator (i.e. ":") - it is
3210    # assumed that no part of a normal pathname contains ";" but that should
3211    # okay in the real world where ";" in dirpaths is itself problematic.
3212    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3213    ;;
3214  *)
3215    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3216    ;;
3217  esac
3218  # Ok, now we have the path, separated by spaces, we can step through it
3219  # and add multilib dir if necessary.
3220  lt_tmp_lt_search_path_spec=
3221  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3222  for lt_sys_path in $lt_search_path_spec; do
3223    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3224      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3225    else
3226      test -d "$lt_sys_path" && \
3227	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3228    fi
3229  done
3230  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3231BEGIN {RS=" "; FS="/|\n";} {
3232  lt_foo="";
3233  lt_count=0;
3234  for (lt_i = NF; lt_i > 0; lt_i--) {
3235    if ($lt_i != "" && $lt_i != ".") {
3236      if ($lt_i == "..") {
3237        lt_count++;
3238      } else {
3239        if (lt_count == 0) {
3240          lt_foo="/" $lt_i lt_foo;
3241        } else {
3242          lt_count--;
3243        }
3244      }
3245    }
3246  }
3247  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3248  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3249}'`
3250  # AWK program above erroneously prepends '/' to C:/dos/paths
3251  # for these hosts.
3252  case $host_os in
3253    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3254      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3255  esac
3256  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3257else
3258  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3259fi])
3260library_names_spec=
3261libname_spec='lib$name'
3262soname_spec=
3263shrext_cmds=".so"
3264postinstall_cmds=
3265postuninstall_cmds=
3266finish_cmds=
3267finish_eval=
3268shlibpath_var=
3269shlibpath_overrides_runpath=unknown
3270version_type=none
3271dynamic_linker="$host_os ld.so"
3272sys_lib_dlsearch_path_spec="/lib /usr/lib"
3273need_lib_prefix=unknown
3274hardcode_into_libs=no
3275
3276# when you set need_version to no, make sure it does not cause -set_version
3277# flags to be left without arguments
3278need_version=unknown
3279
3280case $host_os in
3281aix3*)
3282  version_type=linux # correct to gnu/linux during the next big refactor
3283  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3284  shlibpath_var=LIBPATH
3285
3286  # AIX 3 has no versioning support, so we append a major version to the name.
3287  soname_spec='${libname}${release}${shared_ext}$major'
3288  ;;
3289
3290aix[[4-9]]*)
3291  version_type=linux # correct to gnu/linux during the next big refactor
3292  need_lib_prefix=no
3293  need_version=no
3294  hardcode_into_libs=yes
3295  if test "$host_cpu" = ia64; then
3296    # AIX 5 supports IA64
3297    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3298    shlibpath_var=LD_LIBRARY_PATH
3299  else
3300    # With GCC up to 2.95.x, collect2 would create an import file
3301    # for dependence libraries.  The import file would start with
3302    # the line `#! .'.  This would cause the generated library to
3303    # depend on `.', always an invalid library.  This was fixed in
3304    # development snapshots of GCC prior to 3.0.
3305    case $host_os in
3306      aix4 | aix4.[[01]] | aix4.[[01]].*)
3307      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3308	   echo ' yes '
3309	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3310	:
3311      else
3312	can_build_shared=no
3313      fi
3314      ;;
3315    esac
3316    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3317    # soname into executable. Probably we can add versioning support to
3318    # collect2, so additional links can be useful in future.
3319    if test "$aix_use_runtimelinking" = yes; then
3320      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3321      # instead of lib<name>.a to let people know that these are not
3322      # typical AIX shared libraries.
3323      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3324    else
3325      # We preserve .a as extension for shared libraries through AIX4.2
3326      # and later when we are not doing run time linking.
3327      library_names_spec='${libname}${release}.a $libname.a'
3328      soname_spec='${libname}${release}${shared_ext}$major'
3329    fi
3330    shlibpath_var=LIBPATH
3331  fi
3332  ;;
3333
3334amigaos*)
3335  case $host_cpu in
3336  powerpc)
3337    # Since July 2007 AmigaOS4 officially supports .so libraries.
3338    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3339    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3340    ;;
3341  m68k)
3342    library_names_spec='$libname.ixlibrary $libname.a'
3343    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3344    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'
3345    ;;
3346  esac
3347  ;;
3348
3349beos*)
3350  library_names_spec='${libname}${shared_ext}'
3351  dynamic_linker="$host_os ld.so"
3352  shlibpath_var=LIBRARY_PATH
3353  ;;
3354
3355bsdi[[45]]*)
3356  version_type=linux # correct to gnu/linux during the next big refactor
3357  need_version=no
3358  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3359  soname_spec='${libname}${release}${shared_ext}$major'
3360  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3361  shlibpath_var=LD_LIBRARY_PATH
3362  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3363  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3364  # the default ld.so.conf also contains /usr/contrib/lib and
3365  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3366  # libtool to hard-code these into programs
3367  ;;
3368
3369cygwin* | mingw* | pw32* | cegcc*)
3370  version_type=windows
3371  shrext_cmds=".dll"
3372  need_version=no
3373  need_lib_prefix=no
3374
3375  case $GCC,$cc_basename in
3376  yes,*)
3377    # gcc
3378    library_names_spec='$libname.dll.a'
3379    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3380    postinstall_cmds='base_file=`basename \${file}`~
3381      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3382      dldir=$destdir/`dirname \$dlpath`~
3383      test -d \$dldir || mkdir -p \$dldir~
3384      $install_prog $dir/$dlname \$dldir/$dlname~
3385      chmod a+x \$dldir/$dlname~
3386      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3387        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3388      fi'
3389    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3390      dlpath=$dir/\$dldll~
3391       $RM \$dlpath'
3392    shlibpath_overrides_runpath=yes
3393
3394    case $host_os in
3395    cygwin*)
3396      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3397      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3398m4_if([$1], [],[
3399      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3400      ;;
3401    mingw* | cegcc*)
3402      # MinGW DLLs use traditional 'lib' prefix
3403      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3404      ;;
3405    pw32*)
3406      # pw32 DLLs use 'pw' prefix rather than 'lib'
3407      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3408      ;;
3409    esac
3410    dynamic_linker='Win32 ld.exe'
3411    ;;
3412
3413  *,cl*)
3414    # Native MSVC
3415    libname_spec='$name'
3416    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3417    library_names_spec='${libname}.dll.lib'
3418
3419    case $build_os in
3420    mingw*)
3421      sys_lib_search_path_spec=
3422      lt_save_ifs=$IFS
3423      IFS=';'
3424      for lt_path in $LIB
3425      do
3426        IFS=$lt_save_ifs
3427        # Let DOS variable expansion print the short 8.3 style file name.
3428        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3429        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3430      done
3431      IFS=$lt_save_ifs
3432      # Convert to MSYS style.
3433      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3434      ;;
3435    cygwin*)
3436      # Convert to unix form, then to dos form, then back to unix form
3437      # but this time dos style (no spaces!) so that the unix form looks
3438      # like /cygdrive/c/PROGRA~1:/cygdr...
3439      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3440      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3441      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3442      ;;
3443    *)
3444      sys_lib_search_path_spec="$LIB"
3445      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3446        # It is most probably a Windows format PATH.
3447        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3448      else
3449        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3450      fi
3451      # FIXME: find the short name or the path components, as spaces are
3452      # common. (e.g. "Program Files" -> "PROGRA~1")
3453      ;;
3454    esac
3455
3456    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3457    postinstall_cmds='base_file=`basename \${file}`~
3458      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3459      dldir=$destdir/`dirname \$dlpath`~
3460      test -d \$dldir || mkdir -p \$dldir~
3461      $install_prog $dir/$dlname \$dldir/$dlname'
3462    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3463      dlpath=$dir/\$dldll~
3464       $RM \$dlpath'
3465    shlibpath_overrides_runpath=yes
3466    dynamic_linker='Win32 link.exe'
3467    ;;
3468
3469  *)
3470    # Assume MSVC wrapper
3471    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3472    dynamic_linker='Win32 ld.exe'
3473    ;;
3474  esac
3475  # FIXME: first we should search . and the directory the executable is in
3476  shlibpath_var=PATH
3477  ;;
3478
3479darwin* | rhapsody*)
3480  dynamic_linker="$host_os dyld"
3481  version_type=darwin
3482  need_lib_prefix=no
3483  need_version=no
3484  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3485  soname_spec='${libname}${release}${major}$shared_ext'
3486  shlibpath_overrides_runpath=yes
3487  shlibpath_var=DYLD_LIBRARY_PATH
3488  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3489m4_if([$1], [],[
3490  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3491  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3492  ;;
3493
3494dgux*)
3495  version_type=linux # correct to gnu/linux during the next big refactor
3496  need_lib_prefix=no
3497  need_version=no
3498  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3499  soname_spec='${libname}${release}${shared_ext}$major'
3500  shlibpath_var=LD_LIBRARY_PATH
3501  ;;
3502
3503freebsd* | dragonfly*)
3504  # DragonFly does not have aout.  When/if they implement a new
3505  # versioning mechanism, adjust this.
3506  if test -x /usr/bin/objformat; then
3507    objformat=`/usr/bin/objformat`
3508  else
3509    case $host_os in
3510    freebsd[[23]].*) objformat=aout ;;
3511    *) objformat=elf ;;
3512    esac
3513  fi
3514  version_type=freebsd-$objformat
3515  case $version_type in
3516    freebsd-elf*)
3517      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3518      need_version=no
3519      need_lib_prefix=no
3520      ;;
3521    freebsd-*)
3522      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3523      need_version=yes
3524      ;;
3525  esac
3526  shlibpath_var=LD_LIBRARY_PATH
3527  case $host_os in
3528  freebsd2.*)
3529    shlibpath_overrides_runpath=yes
3530    ;;
3531  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3532    shlibpath_overrides_runpath=yes
3533    hardcode_into_libs=yes
3534    ;;
3535  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3536  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3537    shlibpath_overrides_runpath=no
3538    hardcode_into_libs=yes
3539    ;;
3540  *) # from 4.6 on, and DragonFly
3541    shlibpath_overrides_runpath=yes
3542    hardcode_into_libs=yes
3543    ;;
3544  esac
3545  ;;
3546
3547gnu*)
3548  version_type=linux # correct to gnu/linux during the next big refactor
3549  need_lib_prefix=no
3550  need_version=no
3551  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3552  soname_spec='${libname}${release}${shared_ext}$major'
3553  shlibpath_var=LD_LIBRARY_PATH
3554  shlibpath_overrides_runpath=no
3555  hardcode_into_libs=yes
3556  ;;
3557
3558haiku*)
3559  version_type=linux # correct to gnu/linux during the next big refactor
3560  need_lib_prefix=no
3561  need_version=no
3562  dynamic_linker="$host_os runtime_loader"
3563  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3564  soname_spec='${libname}${release}${shared_ext}$major'
3565  shlibpath_var=LIBRARY_PATH
3566  shlibpath_overrides_runpath=yes
3567  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3568  hardcode_into_libs=yes
3569  ;;
3570
3571hpux9* | hpux10* | hpux11*)
3572  # Give a soname corresponding to the major version so that dld.sl refuses to
3573  # link against other versions.
3574  version_type=sunos
3575  need_lib_prefix=no
3576  need_version=no
3577  case $host_cpu in
3578  ia64*)
3579    shrext_cmds='.so'
3580    hardcode_into_libs=yes
3581    dynamic_linker="$host_os dld.so"
3582    shlibpath_var=LD_LIBRARY_PATH
3583    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3584    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3585    soname_spec='${libname}${release}${shared_ext}$major'
3586    if test "X$HPUX_IA64_MODE" = X32; then
3587      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3588    else
3589      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3590    fi
3591    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3592    ;;
3593  hppa*64*)
3594    shrext_cmds='.sl'
3595    hardcode_into_libs=yes
3596    dynamic_linker="$host_os dld.sl"
3597    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3598    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3599    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3600    soname_spec='${libname}${release}${shared_ext}$major'
3601    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3602    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3603    ;;
3604  *)
3605    shrext_cmds='.sl'
3606    dynamic_linker="$host_os dld.sl"
3607    shlibpath_var=SHLIB_PATH
3608    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3609    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3610    soname_spec='${libname}${release}${shared_ext}$major'
3611    ;;
3612  esac
3613  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3614  postinstall_cmds='chmod 555 $lib'
3615  # or fails outright, so override atomically:
3616  install_override_mode=555
3617  ;;
3618
3619interix[[3-9]]*)
3620  version_type=linux # correct to gnu/linux during the next big refactor
3621  need_lib_prefix=no
3622  need_version=no
3623  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3624  soname_spec='${libname}${release}${shared_ext}$major'
3625  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3626  shlibpath_var=LD_LIBRARY_PATH
3627  shlibpath_overrides_runpath=no
3628  hardcode_into_libs=yes
3629  ;;
3630
3631irix5* | irix6* | nonstopux*)
3632  case $host_os in
3633    nonstopux*) version_type=nonstopux ;;
3634    *)
3635	if test "$lt_cv_prog_gnu_ld" = yes; then
3636		version_type=linux # correct to gnu/linux during the next big refactor
3637	else
3638		version_type=irix
3639	fi ;;
3640  esac
3641  need_lib_prefix=no
3642  need_version=no
3643  soname_spec='${libname}${release}${shared_ext}$major'
3644  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3645  case $host_os in
3646  irix5* | nonstopux*)
3647    libsuff= shlibsuff=
3648    ;;
3649  *)
3650    case $LD in # libtool.m4 will add one of these switches to LD
3651    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3652      libsuff= shlibsuff= libmagic=32-bit;;
3653    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3654      libsuff=32 shlibsuff=N32 libmagic=N32;;
3655    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3656      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3657    *) libsuff= shlibsuff= libmagic=never-match;;
3658    esac
3659    ;;
3660  esac
3661  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3662  shlibpath_overrides_runpath=no
3663  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3664  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3665  hardcode_into_libs=yes
3666  ;;
3667
3668# No shared lib support for Linux oldld, aout, or coff.
3669linux*oldld* | linux*aout* | linux*coff*)
3670  dynamic_linker=no
3671  ;;
3672
3673# This must be glibc/ELF.
3674linux* | k*bsd*-gnu | kopensolaris*-gnu)
3675  version_type=linux # correct to gnu/linux during the next big refactor
3676  need_lib_prefix=no
3677  need_version=no
3678  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3679  soname_spec='${libname}${release}${shared_ext}$major'
3680  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3681  shlibpath_var=LD_LIBRARY_PATH
3682  shlibpath_overrides_runpath=no
3683
3684  # Some binutils ld are patched to set DT_RUNPATH
3685  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3686    [lt_cv_shlibpath_overrides_runpath=no
3687    save_LDFLAGS=$LDFLAGS
3688    save_libdir=$libdir
3689    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3690	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3691    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3692      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3693	 [lt_cv_shlibpath_overrides_runpath=yes])])
3694    LDFLAGS=$save_LDFLAGS
3695    libdir=$save_libdir
3696    ])
3697  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3698
3699  # This implies no fast_install, which is unacceptable.
3700  # Some rework will be needed to allow for fast_install
3701  # before this can be enabled.
3702  hardcode_into_libs=yes
3703
3704  # Append ld.so.conf contents to the search path
3705  if test -f /etc/ld.so.conf; then
3706    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' ' '`
3707    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3708  fi
3709
3710  # We used to test for /lib/ld.so.1 and disable shared libraries on
3711  # powerpc, because MkLinux only supported shared libraries with the
3712  # GNU dynamic linker.  Since this was broken with cross compilers,
3713  # most powerpc-linux boxes support dynamic linking these days and
3714  # people can always --disable-shared, the test was removed, and we
3715  # assume the GNU/Linux dynamic linker is in use.
3716  dynamic_linker='GNU/Linux ld.so'
3717  ;;
3718
3719netbsd*)
3720  version_type=sunos
3721  need_lib_prefix=no
3722  need_version=no
3723  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3724    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3725    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3726    dynamic_linker='NetBSD (a.out) ld.so'
3727  else
3728    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3729    soname_spec='${libname}${release}${shared_ext}$major'
3730    dynamic_linker='NetBSD ld.elf_so'
3731  fi
3732  shlibpath_var=LD_LIBRARY_PATH
3733  shlibpath_overrides_runpath=yes
3734  hardcode_into_libs=yes
3735  ;;
3736
3737newsos6)
3738  version_type=linux # correct to gnu/linux during the next big refactor
3739  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3740  shlibpath_var=LD_LIBRARY_PATH
3741  shlibpath_overrides_runpath=yes
3742  ;;
3743
3744*nto* | *qnx*)
3745  version_type=qnx
3746  need_lib_prefix=no
3747  need_version=no
3748  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3749  soname_spec='${libname}${release}${shared_ext}$major'
3750  shlibpath_var=LD_LIBRARY_PATH
3751  shlibpath_overrides_runpath=no
3752  hardcode_into_libs=yes
3753  dynamic_linker='ldqnx.so'
3754  ;;
3755
3756openbsd*)
3757  version_type=sunos
3758  sys_lib_dlsearch_path_spec="/usr/lib"
3759  need_lib_prefix=no
3760  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3761  case $host_os in
3762    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3763    *)				need_version=no  ;;
3764  esac
3765  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3766  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3767  shlibpath_var=LD_LIBRARY_PATH
3768  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3769    case $host_os in
3770      openbsd2.[[89]] | openbsd2.[[89]].*)
3771	shlibpath_overrides_runpath=no
3772	;;
3773      *)
3774	shlibpath_overrides_runpath=yes
3775	;;
3776      esac
3777  else
3778    shlibpath_overrides_runpath=yes
3779  fi
3780  ;;
3781
3782os2*)
3783  libname_spec='$name'
3784  shrext_cmds=".dll"
3785  need_lib_prefix=no
3786  library_names_spec='$libname${shared_ext} $libname.a'
3787  dynamic_linker='OS/2 ld.exe'
3788  shlibpath_var=LIBPATH
3789  ;;
3790
3791osf3* | osf4* | osf5*)
3792  version_type=osf
3793  need_lib_prefix=no
3794  need_version=no
3795  soname_spec='${libname}${release}${shared_ext}$major'
3796  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3797  shlibpath_var=LD_LIBRARY_PATH
3798  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3799  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3800  ;;
3801
3802rdos*)
3803  dynamic_linker=no
3804  ;;
3805
3806solaris*)
3807  version_type=linux # correct to gnu/linux during the next big refactor
3808  need_lib_prefix=no
3809  need_version=no
3810  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3811  soname_spec='${libname}${release}${shared_ext}$major'
3812  shlibpath_var=LD_LIBRARY_PATH
3813  shlibpath_overrides_runpath=yes
3814  hardcode_into_libs=yes
3815  # ldd complains unless libraries are executable
3816  postinstall_cmds='chmod +x $lib'
3817  ;;
3818
3819sunos4*)
3820  version_type=sunos
3821  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3822  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3823  shlibpath_var=LD_LIBRARY_PATH
3824  shlibpath_overrides_runpath=yes
3825  if test "$with_gnu_ld" = yes; then
3826    need_lib_prefix=no
3827  fi
3828  need_version=yes
3829  ;;
3830
3831sysv4 | sysv4.3*)
3832  version_type=linux # correct to gnu/linux during the next big refactor
3833  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3834  soname_spec='${libname}${release}${shared_ext}$major'
3835  shlibpath_var=LD_LIBRARY_PATH
3836  case $host_vendor in
3837    sni)
3838      shlibpath_overrides_runpath=no
3839      need_lib_prefix=no
3840      runpath_var=LD_RUN_PATH
3841      ;;
3842    siemens)
3843      need_lib_prefix=no
3844      ;;
3845    motorola)
3846      need_lib_prefix=no
3847      need_version=no
3848      shlibpath_overrides_runpath=no
3849      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3850      ;;
3851  esac
3852  ;;
3853
3854sysv4*MP*)
3855  if test -d /usr/nec ;then
3856    version_type=linux # correct to gnu/linux during the next big refactor
3857    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3858    soname_spec='$libname${shared_ext}.$major'
3859    shlibpath_var=LD_LIBRARY_PATH
3860  fi
3861  ;;
3862
3863sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3864  version_type=freebsd-elf
3865  need_lib_prefix=no
3866  need_version=no
3867  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3868  soname_spec='${libname}${release}${shared_ext}$major'
3869  shlibpath_var=LD_LIBRARY_PATH
3870  shlibpath_overrides_runpath=yes
3871  hardcode_into_libs=yes
3872  if test "$with_gnu_ld" = yes; then
3873    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3874  else
3875    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3876    case $host_os in
3877      sco3.2v5*)
3878        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3879	;;
3880    esac
3881  fi
3882  sys_lib_dlsearch_path_spec='/usr/lib'
3883  ;;
3884
3885tpf*)
3886  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3887  version_type=linux # correct to gnu/linux during the next big refactor
3888  need_lib_prefix=no
3889  need_version=no
3890  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3891  shlibpath_var=LD_LIBRARY_PATH
3892  shlibpath_overrides_runpath=no
3893  hardcode_into_libs=yes
3894  ;;
3895
3896uts4*)
3897  version_type=linux # correct to gnu/linux during the next big refactor
3898  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3899  soname_spec='${libname}${release}${shared_ext}$major'
3900  shlibpath_var=LD_LIBRARY_PATH
3901  ;;
3902
3903*)
3904  dynamic_linker=no
3905  ;;
3906esac
3907AC_MSG_RESULT([$dynamic_linker])
3908test "$dynamic_linker" = no && can_build_shared=no
3909
3910variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3911if test "$GCC" = yes; then
3912  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3913fi
3914
3915if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3916  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3917fi
3918if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3919  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3920fi
3921
3922_LT_DECL([], [variables_saved_for_relink], [1],
3923    [Variables whose values should be saved in libtool wrapper scripts and
3924    restored at link time])
3925_LT_DECL([], [need_lib_prefix], [0],
3926    [Do we need the "lib" prefix for modules?])
3927_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3928_LT_DECL([], [version_type], [0], [Library versioning type])
3929_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3930_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3931_LT_DECL([], [shlibpath_overrides_runpath], [0],
3932    [Is shlibpath searched before the hard-coded library search path?])
3933_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3934_LT_DECL([], [library_names_spec], [1],
3935    [[List of archive names.  First name is the real one, the rest are links.
3936    The last name is the one that the linker finds with -lNAME]])
3937_LT_DECL([], [soname_spec], [1],
3938    [[The coded name of the library, if different from the real name]])
3939_LT_DECL([], [install_override_mode], [1],
3940    [Permission mode override for installation of shared libraries])
3941_LT_DECL([], [postinstall_cmds], [2],
3942    [Command to use after installation of a shared archive])
3943_LT_DECL([], [postuninstall_cmds], [2],
3944    [Command to use after uninstallation of a shared archive])
3945_LT_DECL([], [finish_cmds], [2],
3946    [Commands used to finish a libtool library installation in a directory])
3947_LT_DECL([], [finish_eval], [1],
3948    [[As "finish_cmds", except a single script fragment to be evaled but
3949    not shown]])
3950_LT_DECL([], [hardcode_into_libs], [0],
3951    [Whether we should hardcode library paths into libraries])
3952_LT_DECL([], [sys_lib_search_path_spec], [2],
3953    [Compile-time system search path for libraries])
3954_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3955    [Run-time system search path for libraries])
3956])# _LT_SYS_DYNAMIC_LINKER
3957
3958
3959# _LT_PATH_TOOL_PREFIX(TOOL)
3960# --------------------------
3961# find a file program which can recognize shared library
3962AC_DEFUN([_LT_PATH_TOOL_PREFIX],
3963[m4_require([_LT_DECL_EGREP])dnl
3964AC_MSG_CHECKING([for $1])
3965AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3966[case $MAGIC_CMD in
3967[[\\/*] |  ?:[\\/]*])
3968  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3969  ;;
3970*)
3971  lt_save_MAGIC_CMD="$MAGIC_CMD"
3972  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3973dnl $ac_dummy forces splitting on constant user-supplied paths.
3974dnl POSIX.2 word splitting is done only on the output of word expansions,
3975dnl not every word.  This closes a longstanding sh security hole.
3976  ac_dummy="m4_if([$2], , $PATH, [$2])"
3977  for ac_dir in $ac_dummy; do
3978    IFS="$lt_save_ifs"
3979    test -z "$ac_dir" && ac_dir=.
3980    if test -f $ac_dir/$1; then
3981      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3982      if test -n "$file_magic_test_file"; then
3983	case $deplibs_check_method in
3984	"file_magic "*)
3985	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3986	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3987	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3988	    $EGREP "$file_magic_regex" > /dev/null; then
3989	    :
3990	  else
3991	    cat <<_LT_EOF 1>&2
3992
3993*** Warning: the command libtool uses to detect shared libraries,
3994*** $file_magic_cmd, produces output that libtool cannot recognize.
3995*** The result is that libtool may fail to recognize shared libraries
3996*** as such.  This will affect the creation of libtool libraries that
3997*** depend on shared libraries, but programs linked with such libtool
3998*** libraries will work regardless of this problem.  Nevertheless, you
3999*** may want to report the problem to your system manager and/or to
4000*** bug-libtool@gnu.org
4001
4002_LT_EOF
4003	  fi ;;
4004	esac
4005      fi
4006      break
4007    fi
4008  done
4009  IFS="$lt_save_ifs"
4010  MAGIC_CMD="$lt_save_MAGIC_CMD"
4011  ;;
4012esac])
4013MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4014if test -n "$MAGIC_CMD"; then
4015  AC_MSG_RESULT($MAGIC_CMD)
4016else
4017  AC_MSG_RESULT(no)
4018fi
4019_LT_DECL([], [MAGIC_CMD], [0],
4020	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4021])# _LT_PATH_TOOL_PREFIX
4022
4023# Old name:
4024AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4025dnl aclocal-1.4 backwards compatibility:
4026dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4027
4028
4029# _LT_PATH_MAGIC
4030# --------------
4031# find a file program which can recognize a shared library
4032m4_defun([_LT_PATH_MAGIC],
4033[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4034if test -z "$lt_cv_path_MAGIC_CMD"; then
4035  if test -n "$ac_tool_prefix"; then
4036    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4037  else
4038    MAGIC_CMD=:
4039  fi
4040fi
4041])# _LT_PATH_MAGIC
4042
4043
4044# LT_PATH_LD
4045# ----------
4046# find the pathname to the GNU or non-GNU linker
4047AC_DEFUN([LT_PATH_LD],
4048[AC_REQUIRE([AC_PROG_CC])dnl
4049AC_REQUIRE([AC_CANONICAL_HOST])dnl
4050AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4051m4_require([_LT_DECL_SED])dnl
4052m4_require([_LT_DECL_EGREP])dnl
4053m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4054
4055AC_ARG_WITH([gnu-ld],
4056    [AS_HELP_STRING([--with-gnu-ld],
4057	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4058    [test "$withval" = no || with_gnu_ld=yes],
4059    [with_gnu_ld=no])dnl
4060
4061ac_prog=ld
4062if test "$GCC" = yes; then
4063  # Check if gcc -print-prog-name=ld gives a path.
4064  AC_MSG_CHECKING([for ld used by $CC])
4065  case $host in
4066  *-*-mingw*)
4067    # gcc leaves a trailing carriage return which upsets mingw
4068    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4069  *)
4070    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4071  esac
4072  case $ac_prog in
4073    # Accept absolute paths.
4074    [[\\/]]* | ?:[[\\/]]*)
4075      re_direlt='/[[^/]][[^/]]*/\.\./'
4076      # Canonicalize the pathname of ld
4077      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4078      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4079	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4080      done
4081      test -z "$LD" && LD="$ac_prog"
4082      ;;
4083  "")
4084    # If it fails, then pretend we aren't using GCC.
4085    ac_prog=ld
4086    ;;
4087  *)
4088    # If it is relative, then search for the first ld in PATH.
4089    with_gnu_ld=unknown
4090    ;;
4091  esac
4092elif test "$with_gnu_ld" = yes; then
4093  AC_MSG_CHECKING([for GNU ld])
4094else
4095  AC_MSG_CHECKING([for non-GNU ld])
4096fi
4097AC_CACHE_VAL(lt_cv_path_LD,
4098[if test -z "$LD"; then
4099  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4100  for ac_dir in $PATH; do
4101    IFS="$lt_save_ifs"
4102    test -z "$ac_dir" && ac_dir=.
4103    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4104      lt_cv_path_LD="$ac_dir/$ac_prog"
4105      # Check to see if the program is GNU ld.  I'd rather use --version,
4106      # but apparently some variants of GNU ld only accept -v.
4107      # Break only if it was the GNU/non-GNU ld that we prefer.
4108      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4109      *GNU* | *'with BFD'*)
4110	test "$with_gnu_ld" != no && break
4111	;;
4112      *)
4113	test "$with_gnu_ld" != yes && break
4114	;;
4115      esac
4116    fi
4117  done
4118  IFS="$lt_save_ifs"
4119else
4120  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4121fi])
4122LD="$lt_cv_path_LD"
4123if test -n "$LD"; then
4124  AC_MSG_RESULT($LD)
4125else
4126  AC_MSG_RESULT(no)
4127fi
4128test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4129_LT_PATH_LD_GNU
4130AC_SUBST([LD])
4131
4132_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4133])# LT_PATH_LD
4134
4135# Old names:
4136AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4137AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4138dnl aclocal-1.4 backwards compatibility:
4139dnl AC_DEFUN([AM_PROG_LD], [])
4140dnl AC_DEFUN([AC_PROG_LD], [])
4141
4142
4143# _LT_PATH_LD_GNU
4144#- --------------
4145m4_defun([_LT_PATH_LD_GNU],
4146[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4147[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4148case `$LD -v 2>&1 </dev/null` in
4149*GNU* | *'with BFD'*)
4150  lt_cv_prog_gnu_ld=yes
4151  ;;
4152*)
4153  lt_cv_prog_gnu_ld=no
4154  ;;
4155esac])
4156with_gnu_ld=$lt_cv_prog_gnu_ld
4157])# _LT_PATH_LD_GNU
4158
4159
4160# _LT_CMD_RELOAD
4161# --------------
4162# find reload flag for linker
4163#   -- PORTME Some linkers may need a different reload flag.
4164m4_defun([_LT_CMD_RELOAD],
4165[AC_CACHE_CHECK([for $LD option to reload object files],
4166  lt_cv_ld_reload_flag,
4167  [lt_cv_ld_reload_flag='-r'])
4168reload_flag=$lt_cv_ld_reload_flag
4169case $reload_flag in
4170"" | " "*) ;;
4171*) reload_flag=" $reload_flag" ;;
4172esac
4173reload_cmds='$LD$reload_flag -o $output$reload_objs'
4174case $host_os in
4175  cygwin* | mingw* | pw32* | cegcc*)
4176    if test "$GCC" != yes; then
4177      reload_cmds=false
4178    fi
4179    ;;
4180  darwin*)
4181    if test "$GCC" = yes; then
4182      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4183    else
4184      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4185    fi
4186    ;;
4187esac
4188_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4189_LT_TAGDECL([], [reload_cmds], [2])dnl
4190])# _LT_CMD_RELOAD
4191
4192
4193# _LT_CHECK_MAGIC_METHOD
4194# ----------------------
4195# how to check for library dependencies
4196#  -- PORTME fill in with the dynamic library characteristics
4197m4_defun([_LT_CHECK_MAGIC_METHOD],
4198[m4_require([_LT_DECL_EGREP])
4199m4_require([_LT_DECL_OBJDUMP])
4200AC_CACHE_CHECK([how to recognize dependent libraries],
4201lt_cv_deplibs_check_method,
4202[lt_cv_file_magic_cmd='$MAGIC_CMD'
4203lt_cv_file_magic_test_file=
4204lt_cv_deplibs_check_method='unknown'
4205# Need to set the preceding variable on all platforms that support
4206# interlibrary dependencies.
4207# 'none' -- dependencies not supported.
4208# `unknown' -- same as none, but documents that we really don't know.
4209# 'pass_all' -- all dependencies passed with no checks.
4210# 'test_compile' -- check by making test program.
4211# 'file_magic [[regex]]' -- check by looking for files in library path
4212# which responds to the $file_magic_cmd with a given extended regex.
4213# If you have `file' or equivalent on your system and you're not sure
4214# whether `pass_all' will *always* work, you probably want this one.
4215
4216case $host_os in
4217aix[[4-9]]*)
4218  lt_cv_deplibs_check_method=pass_all
4219  ;;
4220
4221beos*)
4222  lt_cv_deplibs_check_method=pass_all
4223  ;;
4224
4225bsdi[[45]]*)
4226  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4227  lt_cv_file_magic_cmd='/usr/bin/file -L'
4228  lt_cv_file_magic_test_file=/shlib/libc.so
4229  ;;
4230
4231cygwin*)
4232  # func_win32_libid is a shell function defined in ltmain.sh
4233  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4234  lt_cv_file_magic_cmd='func_win32_libid'
4235  ;;
4236
4237mingw* | pw32*)
4238  # Base MSYS/MinGW do not provide the 'file' command needed by
4239  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4240  # unless we find 'file', for example because we are cross-compiling.
4241  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4242  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4243    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4244    lt_cv_file_magic_cmd='func_win32_libid'
4245  else
4246    # Keep this pattern in sync with the one in func_win32_libid.
4247    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4248    lt_cv_file_magic_cmd='$OBJDUMP -f'
4249  fi
4250  ;;
4251
4252cegcc*)
4253  # use the weaker test based on 'objdump'. See mingw*.
4254  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4255  lt_cv_file_magic_cmd='$OBJDUMP -f'
4256  ;;
4257
4258darwin* | rhapsody*)
4259  lt_cv_deplibs_check_method=pass_all
4260  ;;
4261
4262freebsd* | dragonfly*)
4263  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4264    case $host_cpu in
4265    i*86 )
4266      # Not sure whether the presence of OpenBSD here was a mistake.
4267      # Let's accept both of them until this is cleared up.
4268      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4269      lt_cv_file_magic_cmd=/usr/bin/file
4270      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4271      ;;
4272    esac
4273  else
4274    lt_cv_deplibs_check_method=pass_all
4275  fi
4276  ;;
4277
4278gnu*)
4279  lt_cv_deplibs_check_method=pass_all
4280  ;;
4281
4282haiku*)
4283  lt_cv_deplibs_check_method=pass_all
4284  ;;
4285
4286hpux10.20* | hpux11*)
4287  lt_cv_file_magic_cmd=/usr/bin/file
4288  case $host_cpu in
4289  ia64*)
4290    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4291    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4292    ;;
4293  hppa*64*)
4294    [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]']
4295    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4296    ;;
4297  *)
4298    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4299    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4300    ;;
4301  esac
4302  ;;
4303
4304interix[[3-9]]*)
4305  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4306  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4307  ;;
4308
4309irix5* | irix6* | nonstopux*)
4310  case $LD in
4311  *-32|*"-32 ") libmagic=32-bit;;
4312  *-n32|*"-n32 ") libmagic=N32;;
4313  *-64|*"-64 ") libmagic=64-bit;;
4314  *) libmagic=never-match;;
4315  esac
4316  lt_cv_deplibs_check_method=pass_all
4317  ;;
4318
4319# This must be glibc/ELF.
4320linux* | k*bsd*-gnu | kopensolaris*-gnu)
4321  lt_cv_deplibs_check_method=pass_all
4322  ;;
4323
4324netbsd*)
4325  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4326    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4327  else
4328    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4329  fi
4330  ;;
4331
4332newos6*)
4333  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4334  lt_cv_file_magic_cmd=/usr/bin/file
4335  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4336  ;;
4337
4338*nto* | *qnx*)
4339  lt_cv_deplibs_check_method=pass_all
4340  ;;
4341
4342openbsd*)
4343  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4344    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4345  else
4346    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4347  fi
4348  ;;
4349
4350osf3* | osf4* | osf5*)
4351  lt_cv_deplibs_check_method=pass_all
4352  ;;
4353
4354rdos*)
4355  lt_cv_deplibs_check_method=pass_all
4356  ;;
4357
4358solaris*)
4359  lt_cv_deplibs_check_method=pass_all
4360  ;;
4361
4362sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4363  lt_cv_deplibs_check_method=pass_all
4364  ;;
4365
4366sysv4 | sysv4.3*)
4367  case $host_vendor in
4368  motorola)
4369    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]]'
4370    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4371    ;;
4372  ncr)
4373    lt_cv_deplibs_check_method=pass_all
4374    ;;
4375  sequent)
4376    lt_cv_file_magic_cmd='/bin/file'
4377    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4378    ;;
4379  sni)
4380    lt_cv_file_magic_cmd='/bin/file'
4381    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4382    lt_cv_file_magic_test_file=/lib/libc.so
4383    ;;
4384  siemens)
4385    lt_cv_deplibs_check_method=pass_all
4386    ;;
4387  pc)
4388    lt_cv_deplibs_check_method=pass_all
4389    ;;
4390  esac
4391  ;;
4392
4393tpf*)
4394  lt_cv_deplibs_check_method=pass_all
4395  ;;
4396esac
4397])
4398
4399file_magic_glob=
4400want_nocaseglob=no
4401if test "$build" = "$host"; then
4402  case $host_os in
4403  mingw* | pw32*)
4404    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4405      want_nocaseglob=yes
4406    else
4407      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4408    fi
4409    ;;
4410  esac
4411fi
4412
4413file_magic_cmd=$lt_cv_file_magic_cmd
4414deplibs_check_method=$lt_cv_deplibs_check_method
4415test -z "$deplibs_check_method" && deplibs_check_method=unknown
4416
4417_LT_DECL([], [deplibs_check_method], [1],
4418    [Method to check whether dependent libraries are shared objects])
4419_LT_DECL([], [file_magic_cmd], [1],
4420    [Command to use when deplibs_check_method = "file_magic"])
4421_LT_DECL([], [file_magic_glob], [1],
4422    [How to find potential files when deplibs_check_method = "file_magic"])
4423_LT_DECL([], [want_nocaseglob], [1],
4424    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4425])# _LT_CHECK_MAGIC_METHOD
4426
4427
4428# LT_PATH_NM
4429# ----------
4430# find the pathname to a BSD- or MS-compatible name lister
4431AC_DEFUN([LT_PATH_NM],
4432[AC_REQUIRE([AC_PROG_CC])dnl
4433AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4434[if test -n "$NM"; then
4435  # Let the user override the test.
4436  lt_cv_path_NM="$NM"
4437else
4438  lt_nm_to_check="${ac_tool_prefix}nm"
4439  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4440    lt_nm_to_check="$lt_nm_to_check nm"
4441  fi
4442  for lt_tmp_nm in $lt_nm_to_check; do
4443    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4444    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4445      IFS="$lt_save_ifs"
4446      test -z "$ac_dir" && ac_dir=.
4447      tmp_nm="$ac_dir/$lt_tmp_nm"
4448      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4449	# Check to see if the nm accepts a BSD-compat flag.
4450	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4451	#   nm: unknown option "B" ignored
4452	# Tru64's nm complains that /dev/null is an invalid object file
4453	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4454	*/dev/null* | *'Invalid file or object type'*)
4455	  lt_cv_path_NM="$tmp_nm -B"
4456	  break
4457	  ;;
4458	*)
4459	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4460	  */dev/null*)
4461	    lt_cv_path_NM="$tmp_nm -p"
4462	    break
4463	    ;;
4464	  *)
4465	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4466	    continue # so that we can try to find one that supports BSD flags
4467	    ;;
4468	  esac
4469	  ;;
4470	esac
4471      fi
4472    done
4473    IFS="$lt_save_ifs"
4474  done
4475  : ${lt_cv_path_NM=no}
4476fi])
4477if test "$lt_cv_path_NM" != "no"; then
4478  NM="$lt_cv_path_NM"
4479else
4480  # Didn't find any BSD compatible name lister, look for dumpbin.
4481  if test -n "$DUMPBIN"; then :
4482    # Let the user override the test.
4483  else
4484    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4485    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4486    *COFF*)
4487      DUMPBIN="$DUMPBIN -symbols"
4488      ;;
4489    *)
4490      DUMPBIN=:
4491      ;;
4492    esac
4493  fi
4494  AC_SUBST([DUMPBIN])
4495  if test "$DUMPBIN" != ":"; then
4496    NM="$DUMPBIN"
4497  fi
4498fi
4499test -z "$NM" && NM=nm
4500AC_SUBST([NM])
4501_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4502
4503AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4504  [lt_cv_nm_interface="BSD nm"
4505  echo "int some_variable = 0;" > conftest.$ac_ext
4506  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4507  (eval "$ac_compile" 2>conftest.err)
4508  cat conftest.err >&AS_MESSAGE_LOG_FD
4509  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4510  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4511  cat conftest.err >&AS_MESSAGE_LOG_FD
4512  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4513  cat conftest.out >&AS_MESSAGE_LOG_FD
4514  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4515    lt_cv_nm_interface="MS dumpbin"
4516  fi
4517  rm -f conftest*])
4518])# LT_PATH_NM
4519
4520# Old names:
4521AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4522AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4523dnl aclocal-1.4 backwards compatibility:
4524dnl AC_DEFUN([AM_PROG_NM], [])
4525dnl AC_DEFUN([AC_PROG_NM], [])
4526
4527# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4528# --------------------------------
4529# how to determine the name of the shared library
4530# associated with a specific link library.
4531#  -- PORTME fill in with the dynamic library characteristics
4532m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4533[m4_require([_LT_DECL_EGREP])
4534m4_require([_LT_DECL_OBJDUMP])
4535m4_require([_LT_DECL_DLLTOOL])
4536AC_CACHE_CHECK([how to associate runtime and link libraries],
4537lt_cv_sharedlib_from_linklib_cmd,
4538[lt_cv_sharedlib_from_linklib_cmd='unknown'
4539
4540case $host_os in
4541cygwin* | mingw* | pw32* | cegcc*)
4542  # two different shell functions defined in ltmain.sh
4543  # decide which to use based on capabilities of $DLLTOOL
4544  case `$DLLTOOL --help 2>&1` in
4545  *--identify-strict*)
4546    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4547    ;;
4548  *)
4549    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4550    ;;
4551  esac
4552  ;;
4553*)
4554  # fallback: assume linklib IS sharedlib
4555  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4556  ;;
4557esac
4558])
4559sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4560test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4561
4562_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4563    [Command to associate shared and link libraries])
4564])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4565
4566
4567# _LT_PATH_MANIFEST_TOOL
4568# ----------------------
4569# locate the manifest tool
4570m4_defun([_LT_PATH_MANIFEST_TOOL],
4571[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4572test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4573AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4574  [lt_cv_path_mainfest_tool=no
4575  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4576  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4577  cat conftest.err >&AS_MESSAGE_LOG_FD
4578  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4579    lt_cv_path_mainfest_tool=yes
4580  fi
4581  rm -f conftest*])
4582if test "x$lt_cv_path_mainfest_tool" != xyes; then
4583  MANIFEST_TOOL=:
4584fi
4585_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4586])# _LT_PATH_MANIFEST_TOOL
4587
4588
4589# LT_LIB_M
4590# --------
4591# check for math library
4592AC_DEFUN([LT_LIB_M],
4593[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4594LIBM=
4595case $host in
4596*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4597  # These system don't have libm, or don't need it
4598  ;;
4599*-ncr-sysv4.3*)
4600  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4601  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4602  ;;
4603*)
4604  AC_CHECK_LIB(m, cos, LIBM="-lm")
4605  ;;
4606esac
4607AC_SUBST([LIBM])
4608])# LT_LIB_M
4609
4610# Old name:
4611AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4612dnl aclocal-1.4 backwards compatibility:
4613dnl AC_DEFUN([AC_CHECK_LIBM], [])
4614
4615
4616# _LT_COMPILER_NO_RTTI([TAGNAME])
4617# -------------------------------
4618m4_defun([_LT_COMPILER_NO_RTTI],
4619[m4_require([_LT_TAG_COMPILER])dnl
4620
4621_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4622
4623if test "$GCC" = yes; then
4624  case $cc_basename in
4625  nvcc*)
4626    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4627  *)
4628    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4629  esac
4630
4631  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4632    lt_cv_prog_compiler_rtti_exceptions,
4633    [-fno-rtti -fno-exceptions], [],
4634    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4635fi
4636_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4637	[Compiler flag to turn off builtin functions])
4638])# _LT_COMPILER_NO_RTTI
4639
4640
4641# _LT_CMD_GLOBAL_SYMBOLS
4642# ----------------------
4643m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4644[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4645AC_REQUIRE([AC_PROG_CC])dnl
4646AC_REQUIRE([AC_PROG_AWK])dnl
4647AC_REQUIRE([LT_PATH_NM])dnl
4648AC_REQUIRE([LT_PATH_LD])dnl
4649m4_require([_LT_DECL_SED])dnl
4650m4_require([_LT_DECL_EGREP])dnl
4651m4_require([_LT_TAG_COMPILER])dnl
4652
4653# Check for command to grab the raw symbol name followed by C symbol from nm.
4654AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4655AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4656[
4657# These are sane defaults that work on at least a few old systems.
4658# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4659
4660# Character class describing NM global symbol codes.
4661symcode='[[BCDEGRST]]'
4662
4663# Regexp to match symbols that can be accessed directly from C.
4664sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4665
4666# Define system-specific variables.
4667case $host_os in
4668aix*)
4669  symcode='[[BCDT]]'
4670  ;;
4671cygwin* | mingw* | pw32* | cegcc*)
4672  symcode='[[ABCDGISTW]]'
4673  ;;
4674hpux*)
4675  if test "$host_cpu" = ia64; then
4676    symcode='[[ABCDEGRST]]'
4677  fi
4678  ;;
4679irix* | nonstopux*)
4680  symcode='[[BCDEGRST]]'
4681  ;;
4682osf*)
4683  symcode='[[BCDEGQRST]]'
4684  ;;
4685solaris*)
4686  symcode='[[BDRT]]'
4687  ;;
4688sco3.2v5*)
4689  symcode='[[DT]]'
4690  ;;
4691sysv4.2uw2*)
4692  symcode='[[DT]]'
4693  ;;
4694sysv5* | sco5v6* | unixware* | OpenUNIX*)
4695  symcode='[[ABDT]]'
4696  ;;
4697sysv4)
4698  symcode='[[DFNSTU]]'
4699  ;;
4700esac
4701
4702# If we're using GNU nm, then use its standard symbol codes.
4703case `$NM -V 2>&1` in
4704*GNU* | *'with BFD'*)
4705  symcode='[[ABCDGIRSTW]]' ;;
4706esac
4707
4708# Transform an extracted symbol line into a proper C declaration.
4709# Some systems (esp. on ia64) link data and code symbols differently,
4710# so use this general approach.
4711lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4712
4713# Transform an extracted symbol line into symbol name and symbol address
4714lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4715lt_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'"
4716
4717# Handle CRLF in mingw tool chain
4718opt_cr=
4719case $build_os in
4720mingw*)
4721  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4722  ;;
4723esac
4724
4725# Try without a prefix underscore, then with it.
4726for ac_symprfx in "" "_"; do
4727
4728  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4729  symxfrm="\\1 $ac_symprfx\\2 \\2"
4730
4731  # Write the raw and C identifiers.
4732  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4733    # Fake it for dumpbin and say T for any non-static function
4734    # and D for any global variable.
4735    # Also find C++ and __fastcall symbols from MSVC++,
4736    # which start with @ or ?.
4737    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4738"     {last_section=section; section=\$ 3};"\
4739"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4740"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4741"     \$ 0!~/External *\|/{next};"\
4742"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4743"     {if(hide[section]) next};"\
4744"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4745"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4746"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4747"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4748"     ' prfx=^$ac_symprfx]"
4749  else
4750    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4751  fi
4752  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4753
4754  # Check to see that the pipe works correctly.
4755  pipe_works=no
4756
4757  rm -f conftest*
4758  cat > conftest.$ac_ext <<_LT_EOF
4759#ifdef __cplusplus
4760extern "C" {
4761#endif
4762char nm_test_var;
4763void nm_test_func(void);
4764void nm_test_func(void){}
4765#ifdef __cplusplus
4766}
4767#endif
4768int main(){nm_test_var='a';nm_test_func();return(0);}
4769_LT_EOF
4770
4771  if AC_TRY_EVAL(ac_compile); then
4772    # Now try to grab the symbols.
4773    nlist=conftest.nm
4774    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4775      # Try sorting and uniquifying the output.
4776      if sort "$nlist" | uniq > "$nlist"T; then
4777	mv -f "$nlist"T "$nlist"
4778      else
4779	rm -f "$nlist"T
4780      fi
4781
4782      # Make sure that we snagged all the symbols we need.
4783      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4784	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4785	  cat <<_LT_EOF > conftest.$ac_ext
4786/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4787#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4788/* DATA imports from DLLs on WIN32 con't be const, because runtime
4789   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4790# define LT@&t@_DLSYM_CONST
4791#elif defined(__osf__)
4792/* This system does not cope well with relocations in const data.  */
4793# define LT@&t@_DLSYM_CONST
4794#else
4795# define LT@&t@_DLSYM_CONST const
4796#endif
4797
4798#ifdef __cplusplus
4799extern "C" {
4800#endif
4801
4802_LT_EOF
4803	  # Now generate the symbol file.
4804	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4805
4806	  cat <<_LT_EOF >> conftest.$ac_ext
4807
4808/* The mapping between symbol names and symbols.  */
4809LT@&t@_DLSYM_CONST struct {
4810  const char *name;
4811  void       *address;
4812}
4813lt__PROGRAM__LTX_preloaded_symbols[[]] =
4814{
4815  { "@PROGRAM@", (void *) 0 },
4816_LT_EOF
4817	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4818	  cat <<\_LT_EOF >> conftest.$ac_ext
4819  {0, (void *) 0}
4820};
4821
4822/* This works around a problem in FreeBSD linker */
4823#ifdef FREEBSD_WORKAROUND
4824static const void *lt_preloaded_setup() {
4825  return lt__PROGRAM__LTX_preloaded_symbols;
4826}
4827#endif
4828
4829#ifdef __cplusplus
4830}
4831#endif
4832_LT_EOF
4833	  # Now try linking the two files.
4834	  mv conftest.$ac_objext conftstm.$ac_objext
4835	  lt_globsym_save_LIBS=$LIBS
4836	  lt_globsym_save_CFLAGS=$CFLAGS
4837	  LIBS="conftstm.$ac_objext"
4838	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4839	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4840	    pipe_works=yes
4841	  fi
4842	  LIBS=$lt_globsym_save_LIBS
4843	  CFLAGS=$lt_globsym_save_CFLAGS
4844	else
4845	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4846	fi
4847      else
4848	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4849      fi
4850    else
4851      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4852    fi
4853  else
4854    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4855    cat conftest.$ac_ext >&5
4856  fi
4857  rm -rf conftest* conftst*
4858
4859  # Do not use the global_symbol_pipe unless it works.
4860  if test "$pipe_works" = yes; then
4861    break
4862  else
4863    lt_cv_sys_global_symbol_pipe=
4864  fi
4865done
4866])
4867if test -z "$lt_cv_sys_global_symbol_pipe"; then
4868  lt_cv_sys_global_symbol_to_cdecl=
4869fi
4870if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4871  AC_MSG_RESULT(failed)
4872else
4873  AC_MSG_RESULT(ok)
4874fi
4875
4876# Response file support.
4877if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4878  nm_file_list_spec='@'
4879elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4880  nm_file_list_spec='@'
4881fi
4882
4883_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4884    [Take the output of nm and produce a listing of raw symbols and C names])
4885_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4886    [Transform the output of nm in a proper C declaration])
4887_LT_DECL([global_symbol_to_c_name_address],
4888    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4889    [Transform the output of nm in a C name address pair])
4890_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4891    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4892    [Transform the output of nm in a C name address pair when lib prefix is needed])
4893_LT_DECL([], [nm_file_list_spec], [1],
4894    [Specify filename containing input files for $NM])
4895]) # _LT_CMD_GLOBAL_SYMBOLS
4896
4897
4898# _LT_COMPILER_PIC([TAGNAME])
4899# ---------------------------
4900m4_defun([_LT_COMPILER_PIC],
4901[m4_require([_LT_TAG_COMPILER])dnl
4902_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4903_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4904_LT_TAGVAR(lt_prog_compiler_static, $1)=
4905
4906m4_if([$1], [CXX], [
4907  # C++ specific cases for pic, static, wl, etc.
4908  if test "$GXX" = yes; then
4909    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4910    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4911
4912    case $host_os in
4913    aix*)
4914      # All AIX code is PIC.
4915      if test "$host_cpu" = ia64; then
4916	# AIX 5 now supports IA64 processor
4917	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4918      fi
4919      ;;
4920
4921    amigaos*)
4922      case $host_cpu in
4923      powerpc)
4924            # see comment about AmigaOS4 .so support
4925            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4926        ;;
4927      m68k)
4928            # FIXME: we need at least 68020 code to build shared libraries, but
4929            # adding the `-m68020' flag to GCC prevents building anything better,
4930            # like `-m68040'.
4931            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4932        ;;
4933      esac
4934      ;;
4935
4936    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4937      # PIC is the default for these OSes.
4938      ;;
4939    mingw* | cygwin* | os2* | pw32* | cegcc*)
4940      # This hack is so that the source file can tell whether it is being
4941      # built for inclusion in a dll (and should export symbols for example).
4942      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4943      # (--disable-auto-import) libraries
4944      m4_if([$1], [GCJ], [],
4945	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4946      ;;
4947    darwin* | rhapsody*)
4948      # PIC is the default on this platform
4949      # Common symbols not allowed in MH_DYLIB files
4950      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4951      ;;
4952    *djgpp*)
4953      # DJGPP does not support shared libraries at all
4954      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4955      ;;
4956    haiku*)
4957      # PIC is the default for Haiku.
4958      # The "-static" flag exists, but is broken.
4959      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4960      ;;
4961    interix[[3-9]]*)
4962      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4963      # Instead, we relocate shared libraries at runtime.
4964      ;;
4965    sysv4*MP*)
4966      if test -d /usr/nec; then
4967	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4968      fi
4969      ;;
4970    hpux*)
4971      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4972      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4973      # sets the default TLS model and affects inlining.
4974      case $host_cpu in
4975      hppa*64*)
4976	;;
4977      *)
4978	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4979	;;
4980      esac
4981      ;;
4982    *qnx* | *nto*)
4983      # QNX uses GNU C++, but need to define -shared option too, otherwise
4984      # it will coredump.
4985      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4986      ;;
4987    *)
4988      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4989      ;;
4990    esac
4991  else
4992    case $host_os in
4993      aix[[4-9]]*)
4994	# All AIX code is PIC.
4995	if test "$host_cpu" = ia64; then
4996	  # AIX 5 now supports IA64 processor
4997	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4998	else
4999	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5000	fi
5001	;;
5002      chorus*)
5003	case $cc_basename in
5004	cxch68*)
5005	  # Green Hills C++ Compiler
5006	  # _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"
5007	  ;;
5008	esac
5009	;;
5010      mingw* | cygwin* | os2* | pw32* | cegcc*)
5011	# This hack is so that the source file can tell whether it is being
5012	# built for inclusion in a dll (and should export symbols for example).
5013	m4_if([$1], [GCJ], [],
5014	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5015	;;
5016      dgux*)
5017	case $cc_basename in
5018	  ec++*)
5019	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5020	    ;;
5021	  ghcx*)
5022	    # Green Hills C++ Compiler
5023	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5024	    ;;
5025	  *)
5026	    ;;
5027	esac
5028	;;
5029      freebsd* | dragonfly*)
5030	# FreeBSD uses GNU C++
5031	;;
5032      hpux9* | hpux10* | hpux11*)
5033	case $cc_basename in
5034	  CC*)
5035	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5036	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5037	    if test "$host_cpu" != ia64; then
5038	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5039	    fi
5040	    ;;
5041	  aCC*)
5042	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5043	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5044	    case $host_cpu in
5045	    hppa*64*|ia64*)
5046	      # +Z the default
5047	      ;;
5048	    *)
5049	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5050	      ;;
5051	    esac
5052	    ;;
5053	  *)
5054	    ;;
5055	esac
5056	;;
5057      interix*)
5058	# This is c89, which is MS Visual C++ (no shared libs)
5059	# Anyone wants to do a port?
5060	;;
5061      irix5* | irix6* | nonstopux*)
5062	case $cc_basename in
5063	  CC*)
5064	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5065	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5066	    # CC pic flag -KPIC is the default.
5067	    ;;
5068	  *)
5069	    ;;
5070	esac
5071	;;
5072      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5073	case $cc_basename in
5074	  KCC*)
5075	    # KAI C++ Compiler
5076	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5077	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5078	    ;;
5079	  ecpc* )
5080	    # old Intel C++ for x86_64 which still supported -KPIC.
5081	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5082	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5083	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5084	    ;;
5085	  icpc* )
5086	    # Intel C++, used to be incompatible with GCC.
5087	    # ICC 10 doesn't accept -KPIC any more.
5088	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5089	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5090	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5091	    ;;
5092	  pgCC* | pgcpp*)
5093	    # Portland Group C++ compiler
5094	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5095	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5096	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5097	    ;;
5098	  cxx*)
5099	    # Compaq C++
5100	    # Make sure the PIC flag is empty.  It appears that all Alpha
5101	    # Linux and Compaq Tru64 Unix objects are PIC.
5102	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5103	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5104	    ;;
5105	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5106	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5107	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5108	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5109	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5110	    ;;
5111	  *)
5112	    case `$CC -V 2>&1 | sed 5q` in
5113	    *Sun\ C*)
5114	      # Sun C++ 5.9
5115	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5116	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5117	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5118	      ;;
5119	    esac
5120	    ;;
5121	esac
5122	;;
5123      lynxos*)
5124	;;
5125      m88k*)
5126	;;
5127      mvs*)
5128	case $cc_basename in
5129	  cxx*)
5130	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5131	    ;;
5132	  *)
5133	    ;;
5134	esac
5135	;;
5136      netbsd*)
5137	;;
5138      *qnx* | *nto*)
5139        # QNX uses GNU C++, but need to define -shared option too, otherwise
5140        # it will coredump.
5141        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5142        ;;
5143      osf3* | osf4* | osf5*)
5144	case $cc_basename in
5145	  KCC*)
5146	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5147	    ;;
5148	  RCC*)
5149	    # Rational C++ 2.4.1
5150	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5151	    ;;
5152	  cxx*)
5153	    # Digital/Compaq C++
5154	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5155	    # Make sure the PIC flag is empty.  It appears that all Alpha
5156	    # Linux and Compaq Tru64 Unix objects are PIC.
5157	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5158	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5159	    ;;
5160	  *)
5161	    ;;
5162	esac
5163	;;
5164      psos*)
5165	;;
5166      solaris*)
5167	case $cc_basename in
5168	  CC* | sunCC*)
5169	    # Sun C++ 4.2, 5.x and Centerline C++
5170	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5171	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5172	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5173	    ;;
5174	  gcx*)
5175	    # Green Hills C++ Compiler
5176	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5177	    ;;
5178	  *)
5179	    ;;
5180	esac
5181	;;
5182      sunos4*)
5183	case $cc_basename in
5184	  CC*)
5185	    # Sun C++ 4.x
5186	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5187	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5188	    ;;
5189	  lcc*)
5190	    # Lucid
5191	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5192	    ;;
5193	  *)
5194	    ;;
5195	esac
5196	;;
5197      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5198	case $cc_basename in
5199	  CC*)
5200	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5201	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5202	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5203	    ;;
5204	esac
5205	;;
5206      tandem*)
5207	case $cc_basename in
5208	  NCC*)
5209	    # NonStop-UX NCC 3.20
5210	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5211	    ;;
5212	  *)
5213	    ;;
5214	esac
5215	;;
5216      vxworks*)
5217	;;
5218      *)
5219	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5220	;;
5221    esac
5222  fi
5223],
5224[
5225  if test "$GCC" = yes; then
5226    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5227    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5228
5229    case $host_os in
5230      aix*)
5231      # All AIX code is PIC.
5232      if test "$host_cpu" = ia64; then
5233	# AIX 5 now supports IA64 processor
5234	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5235      fi
5236      ;;
5237
5238    amigaos*)
5239      case $host_cpu in
5240      powerpc)
5241            # see comment about AmigaOS4 .so support
5242            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5243        ;;
5244      m68k)
5245            # FIXME: we need at least 68020 code to build shared libraries, but
5246            # adding the `-m68020' flag to GCC prevents building anything better,
5247            # like `-m68040'.
5248            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5249        ;;
5250      esac
5251      ;;
5252
5253    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5254      # PIC is the default for these OSes.
5255      ;;
5256
5257    mingw* | cygwin* | pw32* | os2* | cegcc*)
5258      # This hack is so that the source file can tell whether it is being
5259      # built for inclusion in a dll (and should export symbols for example).
5260      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5261      # (--disable-auto-import) libraries
5262      m4_if([$1], [GCJ], [],
5263	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5264      ;;
5265
5266    darwin* | rhapsody*)
5267      # PIC is the default on this platform
5268      # Common symbols not allowed in MH_DYLIB files
5269      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5270      ;;
5271
5272    haiku*)
5273      # PIC is the default for Haiku.
5274      # The "-static" flag exists, but is broken.
5275      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5276      ;;
5277
5278    hpux*)
5279      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5280      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5281      # sets the default TLS model and affects inlining.
5282      case $host_cpu in
5283      hppa*64*)
5284	# +Z the default
5285	;;
5286      *)
5287	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5288	;;
5289      esac
5290      ;;
5291
5292    interix[[3-9]]*)
5293      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5294      # Instead, we relocate shared libraries at runtime.
5295      ;;
5296
5297    msdosdjgpp*)
5298      # Just because we use GCC doesn't mean we suddenly get shared libraries
5299      # on systems that don't support them.
5300      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5301      enable_shared=no
5302      ;;
5303
5304    *nto* | *qnx*)
5305      # QNX uses GNU C++, but need to define -shared option too, otherwise
5306      # it will coredump.
5307      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5308      ;;
5309
5310    sysv4*MP*)
5311      if test -d /usr/nec; then
5312	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5313      fi
5314      ;;
5315
5316    *)
5317      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5318      ;;
5319    esac
5320
5321    case $cc_basename in
5322    nvcc*) # Cuda Compiler Driver 2.2
5323      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5324      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5325        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5326      fi
5327      ;;
5328    esac
5329  else
5330    # PORTME Check for flag to pass linker flags through the system compiler.
5331    case $host_os in
5332    aix*)
5333      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5334      if test "$host_cpu" = ia64; then
5335	# AIX 5 now supports IA64 processor
5336	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5337      else
5338	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5339      fi
5340      ;;
5341
5342    mingw* | cygwin* | pw32* | os2* | cegcc*)
5343      # This hack is so that the source file can tell whether it is being
5344      # built for inclusion in a dll (and should export symbols for example).
5345      m4_if([$1], [GCJ], [],
5346	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5347      ;;
5348
5349    hpux9* | hpux10* | hpux11*)
5350      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5351      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5352      # not for PA HP-UX.
5353      case $host_cpu in
5354      hppa*64*|ia64*)
5355	# +Z the default
5356	;;
5357      *)
5358	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5359	;;
5360      esac
5361      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5362      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5363      ;;
5364
5365    irix5* | irix6* | nonstopux*)
5366      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5367      # PIC (with -KPIC) is the default.
5368      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5369      ;;
5370
5371    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5372      case $cc_basename in
5373      # old Intel for x86_64 which still supported -KPIC.
5374      ecc*)
5375	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5376	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5377	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5378        ;;
5379      # icc used to be incompatible with GCC.
5380      # ICC 10 doesn't accept -KPIC any more.
5381      icc* | ifort*)
5382	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5383	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5384	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5385        ;;
5386      # Lahey Fortran 8.1.
5387      lf95*)
5388	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5389	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5390	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5391	;;
5392      nagfor*)
5393	# NAG Fortran compiler
5394	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5395	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5396	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5397	;;
5398      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5399        # Portland Group compilers (*not* the Pentium gcc compiler,
5400	# which looks to be a dead project)
5401	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5402	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5403	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5404        ;;
5405      ccc*)
5406        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5407        # All Alpha code is PIC.
5408        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5409        ;;
5410      xl* | bgxl* | bgf* | mpixl*)
5411	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5412	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5413	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5414	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5415	;;
5416      *)
5417	case `$CC -V 2>&1 | sed 5q` in
5418	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5419	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5420	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5421	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5422	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5423	  ;;
5424	*Sun\ F* | *Sun*Fortran*)
5425	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5426	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5427	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5428	  ;;
5429	*Sun\ C*)
5430	  # Sun C 5.9
5431	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5432	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5433	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5434	  ;;
5435        *Intel*\ [[CF]]*Compiler*)
5436	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5437	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5438	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5439	  ;;
5440	*Portland\ Group*)
5441	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5442	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5443	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5444	  ;;
5445	esac
5446	;;
5447      esac
5448      ;;
5449
5450    newsos6)
5451      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5452      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5453      ;;
5454
5455    *nto* | *qnx*)
5456      # QNX uses GNU C++, but need to define -shared option too, otherwise
5457      # it will coredump.
5458      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5459      ;;
5460
5461    osf3* | osf4* | osf5*)
5462      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5463      # All OSF/1 code is PIC.
5464      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5465      ;;
5466
5467    rdos*)
5468      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5469      ;;
5470
5471    solaris*)
5472      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5473      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5474      case $cc_basename in
5475      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5476	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5477      *)
5478	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5479      esac
5480      ;;
5481
5482    sunos4*)
5483      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5484      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5485      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5486      ;;
5487
5488    sysv4 | sysv4.2uw2* | sysv4.3*)
5489      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5490      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5491      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5492      ;;
5493
5494    sysv4*MP*)
5495      if test -d /usr/nec ;then
5496	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5497	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5498      fi
5499      ;;
5500
5501    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5502      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5503      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5504      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5505      ;;
5506
5507    unicos*)
5508      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5509      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5510      ;;
5511
5512    uts4*)
5513      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5514      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5515      ;;
5516
5517    *)
5518      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5519      ;;
5520    esac
5521  fi
5522])
5523case $host_os in
5524  # For platforms which do not support PIC, -DPIC is meaningless:
5525  *djgpp*)
5526    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5527    ;;
5528  *)
5529    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5530    ;;
5531esac
5532
5533AC_CACHE_CHECK([for $compiler option to produce PIC],
5534  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5535  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5536_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5537
5538#
5539# Check to make sure the PIC flag actually works.
5540#
5541if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5542  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5543    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5544    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5545    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5546     "" | " "*) ;;
5547     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5548     esac],
5549    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5550     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5551fi
5552_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5553	[Additional compiler flags for building library objects])
5554
5555_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5556	[How to pass a linker flag through the compiler])
5557#
5558# Check to make sure the static flag actually works.
5559#
5560wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5561_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5562  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5563  $lt_tmp_static_flag,
5564  [],
5565  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5566_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5567	[Compiler flag to prevent dynamic linking])
5568])# _LT_COMPILER_PIC
5569
5570
5571# _LT_LINKER_SHLIBS([TAGNAME])
5572# ----------------------------
5573# See if the linker supports building shared libraries.
5574m4_defun([_LT_LINKER_SHLIBS],
5575[AC_REQUIRE([LT_PATH_LD])dnl
5576AC_REQUIRE([LT_PATH_NM])dnl
5577m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5578m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5579m4_require([_LT_DECL_EGREP])dnl
5580m4_require([_LT_DECL_SED])dnl
5581m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5582m4_require([_LT_TAG_COMPILER])dnl
5583AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5584m4_if([$1], [CXX], [
5585  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5586  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5587  case $host_os in
5588  aix[[4-9]]*)
5589    # If we're using GNU nm, then we don't want the "-C" option.
5590    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5591    # Also, AIX nm treats weak defined symbols like other global defined
5592    # symbols, whereas GNU nm marks them as "W".
5593    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5594      _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'
5595    else
5596      _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'
5597    fi
5598    ;;
5599  pw32*)
5600    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5601    ;;
5602  cygwin* | mingw* | cegcc*)
5603    case $cc_basename in
5604    cl*)
5605      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5606      ;;
5607    *)
5608      _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'
5609      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5610      ;;
5611    esac
5612    ;;
5613  *)
5614    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5615    ;;
5616  esac
5617], [
5618  runpath_var=
5619  _LT_TAGVAR(allow_undefined_flag, $1)=
5620  _LT_TAGVAR(always_export_symbols, $1)=no
5621  _LT_TAGVAR(archive_cmds, $1)=
5622  _LT_TAGVAR(archive_expsym_cmds, $1)=
5623  _LT_TAGVAR(compiler_needs_object, $1)=no
5624  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5625  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5626  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5627  _LT_TAGVAR(hardcode_automatic, $1)=no
5628  _LT_TAGVAR(hardcode_direct, $1)=no
5629  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5630  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5631  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5632  _LT_TAGVAR(hardcode_minus_L, $1)=no
5633  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5634  _LT_TAGVAR(inherit_rpath, $1)=no
5635  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5636  _LT_TAGVAR(module_cmds, $1)=
5637  _LT_TAGVAR(module_expsym_cmds, $1)=
5638  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5639  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5640  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5641  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5642  # include_expsyms should be a list of space-separated symbols to be *always*
5643  # included in the symbol list
5644  _LT_TAGVAR(include_expsyms, $1)=
5645  # exclude_expsyms can be an extended regexp of symbols to exclude
5646  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5647  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5648  # as well as any symbol that contains `d'.
5649  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5650  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5651  # platforms (ab)use it in PIC code, but their linkers get confused if
5652  # the symbol is explicitly referenced.  Since portable code cannot
5653  # rely on this symbol name, it's probably fine to never include it in
5654  # preloaded symbol tables.
5655  # Exclude shared library initialization/finalization symbols.
5656dnl Note also adjust exclude_expsyms for C++ above.
5657  extract_expsyms_cmds=
5658
5659  case $host_os in
5660  cygwin* | mingw* | pw32* | cegcc*)
5661    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5662    # When not using gcc, we currently assume that we are using
5663    # Microsoft Visual C++.
5664    if test "$GCC" != yes; then
5665      with_gnu_ld=no
5666    fi
5667    ;;
5668  interix*)
5669    # we just hope/assume this is gcc and not c89 (= MSVC++)
5670    with_gnu_ld=yes
5671    ;;
5672  openbsd*)
5673    with_gnu_ld=no
5674    ;;
5675  esac
5676
5677  _LT_TAGVAR(ld_shlibs, $1)=yes
5678
5679  # On some targets, GNU ld is compatible enough with the native linker
5680  # that we're better off using the native interface for both.
5681  lt_use_gnu_ld_interface=no
5682  if test "$with_gnu_ld" = yes; then
5683    case $host_os in
5684      aix*)
5685	# The AIX port of GNU ld has always aspired to compatibility
5686	# with the native linker.  However, as the warning in the GNU ld
5687	# block says, versions before 2.19.5* couldn't really create working
5688	# shared libraries, regardless of the interface used.
5689	case `$LD -v 2>&1` in
5690	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5691	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5692	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5693	  *)
5694	    lt_use_gnu_ld_interface=yes
5695	    ;;
5696	esac
5697	;;
5698      *)
5699	lt_use_gnu_ld_interface=yes
5700	;;
5701    esac
5702  fi
5703
5704  if test "$lt_use_gnu_ld_interface" = yes; then
5705    # If archive_cmds runs LD, not CC, wlarc should be empty
5706    wlarc='${wl}'
5707
5708    # Set some defaults for GNU ld with shared library support. These
5709    # are reset later if shared libraries are not supported. Putting them
5710    # here allows them to be overridden if necessary.
5711    runpath_var=LD_RUN_PATH
5712    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5713    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5714    # ancient GNU ld didn't support --whole-archive et. al.
5715    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5716      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5717    else
5718      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5719    fi
5720    supports_anon_versioning=no
5721    case `$LD -v 2>&1` in
5722      *GNU\ gold*) supports_anon_versioning=yes ;;
5723      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5724      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5725      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5726      *\ 2.11.*) ;; # other 2.11 versions
5727      *) supports_anon_versioning=yes ;;
5728    esac
5729
5730    # See if GNU ld supports shared libraries.
5731    case $host_os in
5732    aix[[3-9]]*)
5733      # On AIX/PPC, the GNU linker is very broken
5734      if test "$host_cpu" != ia64; then
5735	_LT_TAGVAR(ld_shlibs, $1)=no
5736	cat <<_LT_EOF 1>&2
5737
5738*** Warning: the GNU linker, at least up to release 2.19, is reported
5739*** to be unable to reliably create shared libraries on AIX.
5740*** Therefore, libtool is disabling shared libraries support.  If you
5741*** really care for shared libraries, you may want to install binutils
5742*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5743*** You will then need to restart the configuration process.
5744
5745_LT_EOF
5746      fi
5747      ;;
5748
5749    amigaos*)
5750      case $host_cpu in
5751      powerpc)
5752            # see comment about AmigaOS4 .so support
5753            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5754            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5755        ;;
5756      m68k)
5757            _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)'
5758            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5759            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5760        ;;
5761      esac
5762      ;;
5763
5764    beos*)
5765      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5766	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5767	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5768	# support --undefined.  This deserves some investigation.  FIXME
5769	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5770      else
5771	_LT_TAGVAR(ld_shlibs, $1)=no
5772      fi
5773      ;;
5774
5775    cygwin* | mingw* | pw32* | cegcc*)
5776      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5777      # as there is no search path for DLLs.
5778      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5779      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5780      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5781      _LT_TAGVAR(always_export_symbols, $1)=no
5782      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5783      _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'
5784      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5785
5786      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5787        _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'
5788	# If the export-symbols file already is a .def file (1st line
5789	# is EXPORTS), use it as is; otherwise, prepend...
5790	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5791	  cp $export_symbols $output_objdir/$soname.def;
5792	else
5793	  echo EXPORTS > $output_objdir/$soname.def;
5794	  cat $export_symbols >> $output_objdir/$soname.def;
5795	fi~
5796	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5797      else
5798	_LT_TAGVAR(ld_shlibs, $1)=no
5799      fi
5800      ;;
5801
5802    haiku*)
5803      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5804      _LT_TAGVAR(link_all_deplibs, $1)=yes
5805      ;;
5806
5807    interix[[3-9]]*)
5808      _LT_TAGVAR(hardcode_direct, $1)=no
5809      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5810      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5811      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5812      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5813      # Instead, shared libraries are loaded at an image base (0x10000000 by
5814      # default) and relocated if they conflict, which is a slow very memory
5815      # consuming and fragmenting process.  To avoid this, we pick a random,
5816      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5817      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5818      _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'
5819      _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'
5820      ;;
5821
5822    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5823      tmp_diet=no
5824      if test "$host_os" = linux-dietlibc; then
5825	case $cc_basename in
5826	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5827	esac
5828      fi
5829      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5830	 && test "$tmp_diet" = no
5831      then
5832	tmp_addflag=' $pic_flag'
5833	tmp_sharedflag='-shared'
5834	case $cc_basename,$host_cpu in
5835        pgcc*)				# Portland Group C compiler
5836	  _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'
5837	  tmp_addflag=' $pic_flag'
5838	  ;;
5839	pgf77* | pgf90* | pgf95* | pgfortran*)
5840					# Portland Group f77 and f90 compilers
5841	  _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'
5842	  tmp_addflag=' $pic_flag -Mnomain' ;;
5843	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5844	  tmp_addflag=' -i_dynamic' ;;
5845	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5846	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5847	ifc* | ifort*)			# Intel Fortran compiler
5848	  tmp_addflag=' -nofor_main' ;;
5849	lf95*)				# Lahey Fortran 8.1
5850	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5851	  tmp_sharedflag='--shared' ;;
5852	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5853	  tmp_sharedflag='-qmkshrobj'
5854	  tmp_addflag= ;;
5855	nvcc*)	# Cuda Compiler Driver 2.2
5856	  _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'
5857	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5858	  ;;
5859	esac
5860	case `$CC -V 2>&1 | sed 5q` in
5861	*Sun\ C*)			# Sun C 5.9
5862	  _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'
5863	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5864	  tmp_sharedflag='-G' ;;
5865	*Sun\ F*)			# Sun Fortran 8.3
5866	  tmp_sharedflag='-G' ;;
5867	esac
5868	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5869
5870        if test "x$supports_anon_versioning" = xyes; then
5871          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5872	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5873	    echo "local: *; };" >> $output_objdir/$libname.ver~
5874	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5875        fi
5876
5877	case $cc_basename in
5878	xlf* | bgf* | bgxlf* | mpixlf*)
5879	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5880	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5881	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5882	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5883	  if test "x$supports_anon_versioning" = xyes; then
5884	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5885	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5886	      echo "local: *; };" >> $output_objdir/$libname.ver~
5887	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5888	  fi
5889	  ;;
5890	esac
5891      else
5892        _LT_TAGVAR(ld_shlibs, $1)=no
5893      fi
5894      ;;
5895
5896    netbsd*)
5897      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5898	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5899	wlarc=
5900      else
5901	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5902	_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'
5903      fi
5904      ;;
5905
5906    solaris*)
5907      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5908	_LT_TAGVAR(ld_shlibs, $1)=no
5909	cat <<_LT_EOF 1>&2
5910
5911*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5912*** create shared libraries on Solaris systems.  Therefore, libtool
5913*** is disabling shared libraries support.  We urge you to upgrade GNU
5914*** binutils to release 2.9.1 or newer.  Another option is to modify
5915*** your PATH or compiler configuration so that the native linker is
5916*** used, and then restart.
5917
5918_LT_EOF
5919      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5920	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5921	_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'
5922      else
5923	_LT_TAGVAR(ld_shlibs, $1)=no
5924      fi
5925      ;;
5926
5927    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5928      case `$LD -v 2>&1` in
5929        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5930	_LT_TAGVAR(ld_shlibs, $1)=no
5931	cat <<_LT_EOF 1>&2
5932
5933*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5934*** reliably create shared libraries on SCO systems.  Therefore, libtool
5935*** is disabling shared libraries support.  We urge you to upgrade GNU
5936*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5937*** your PATH or compiler configuration so that the native linker is
5938*** used, and then restart.
5939
5940_LT_EOF
5941	;;
5942	*)
5943	  # For security reasons, it is highly recommended that you always
5944	  # use absolute paths for naming shared libraries, and exclude the
5945	  # DT_RUNPATH tag from executables and libraries.  But doing so
5946	  # requires that you compile everything twice, which is a pain.
5947	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5948	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5949	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5950	    _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'
5951	  else
5952	    _LT_TAGVAR(ld_shlibs, $1)=no
5953	  fi
5954	;;
5955      esac
5956      ;;
5957
5958    sunos4*)
5959      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5960      wlarc=
5961      _LT_TAGVAR(hardcode_direct, $1)=yes
5962      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5963      ;;
5964
5965    *)
5966      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5967	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5968	_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'
5969      else
5970	_LT_TAGVAR(ld_shlibs, $1)=no
5971      fi
5972      ;;
5973    esac
5974
5975    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
5976      runpath_var=
5977      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5978      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5979      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5980    fi
5981  else
5982    # PORTME fill in a description of your system's linker (not GNU ld)
5983    case $host_os in
5984    aix3*)
5985      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5986      _LT_TAGVAR(always_export_symbols, $1)=yes
5987      _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'
5988      # Note: this linker hardcodes the directories in LIBPATH if there
5989      # are no directories specified by -L.
5990      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5991      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5992	# Neither direct hardcoding nor static linking is supported with a
5993	# broken collect2.
5994	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5995      fi
5996      ;;
5997
5998    aix[[4-9]]*)
5999      if test "$host_cpu" = ia64; then
6000	# On IA64, the linker does run time linking by default, so we don't
6001	# have to do anything special.
6002	aix_use_runtimelinking=no
6003	exp_sym_flag='-Bexport'
6004	no_entry_flag=""
6005      else
6006	# If we're using GNU nm, then we don't want the "-C" option.
6007	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6008	# Also, AIX nm treats weak defined symbols like other global
6009	# defined symbols, whereas GNU nm marks them as "W".
6010	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6011	  _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'
6012	else
6013	  _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'
6014	fi
6015	aix_use_runtimelinking=no
6016
6017	# Test if we are trying to use run time linking or normal
6018	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6019	# need to do runtime linking.
6020	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6021	  for ld_flag in $LDFLAGS; do
6022	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6023	    aix_use_runtimelinking=yes
6024	    break
6025	  fi
6026	  done
6027	  ;;
6028	esac
6029
6030	exp_sym_flag='-bexport'
6031	no_entry_flag='-bnoentry'
6032      fi
6033
6034      # When large executables or shared objects are built, AIX ld can
6035      # have problems creating the table of contents.  If linking a library
6036      # or program results in "error TOC overflow" add -mminimal-toc to
6037      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6038      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6039
6040      _LT_TAGVAR(archive_cmds, $1)=''
6041      _LT_TAGVAR(hardcode_direct, $1)=yes
6042      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6043      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6044      _LT_TAGVAR(link_all_deplibs, $1)=yes
6045      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6046
6047      if test "$GCC" = yes; then
6048	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6049	# We only want to do this on AIX 4.2 and lower, the check
6050	# below for broken collect2 doesn't work under 4.3+
6051	  collect2name=`${CC} -print-prog-name=collect2`
6052	  if test -f "$collect2name" &&
6053	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6054	  then
6055	  # We have reworked collect2
6056	  :
6057	  else
6058	  # We have old collect2
6059	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6060	  # It fails to find uninstalled libraries when the uninstalled
6061	  # path is not listed in the libpath.  Setting hardcode_minus_L
6062	  # to unsupported forces relinking
6063	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6064	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6065	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6066	  fi
6067	  ;;
6068	esac
6069	shared_flag='-shared'
6070	if test "$aix_use_runtimelinking" = yes; then
6071	  shared_flag="$shared_flag "'${wl}-G'
6072	fi
6073      else
6074	# not using gcc
6075	if test "$host_cpu" = ia64; then
6076	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6077	# chokes on -Wl,-G. The following line is correct:
6078	  shared_flag='-G'
6079	else
6080	  if test "$aix_use_runtimelinking" = yes; then
6081	    shared_flag='${wl}-G'
6082	  else
6083	    shared_flag='${wl}-bM:SRE'
6084	  fi
6085	fi
6086      fi
6087
6088      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6089      # It seems that -bexpall does not export symbols beginning with
6090      # underscore (_), so it is better to generate a list of symbols to export.
6091      _LT_TAGVAR(always_export_symbols, $1)=yes
6092      if test "$aix_use_runtimelinking" = yes; then
6093	# Warning - without using the other runtime loading flags (-brtl),
6094	# -berok will link without error, but may produce a broken library.
6095	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6096        # Determine the default libpath from the value encoded in an
6097        # empty executable.
6098        _LT_SYS_MODULE_PATH_AIX([$1])
6099        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6100        _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"
6101      else
6102	if test "$host_cpu" = ia64; then
6103	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6104	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6105	  _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"
6106	else
6107	 # Determine the default libpath from the value encoded in an
6108	 # empty executable.
6109	 _LT_SYS_MODULE_PATH_AIX([$1])
6110	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6111	  # Warning - without using the other run time loading flags,
6112	  # -berok will link without error, but may produce a broken library.
6113	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6114	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6115	  if test "$with_gnu_ld" = yes; then
6116	    # We only use this code for GNU lds that support --whole-archive.
6117	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6118	  else
6119	    # Exported symbols can be pulled into shared objects from archives
6120	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6121	  fi
6122	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6123	  # This is similar to how AIX traditionally builds its shared libraries.
6124	  _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'
6125	fi
6126      fi
6127      ;;
6128
6129    amigaos*)
6130      case $host_cpu in
6131      powerpc)
6132            # see comment about AmigaOS4 .so support
6133            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6134            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6135        ;;
6136      m68k)
6137            _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)'
6138            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6139            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6140        ;;
6141      esac
6142      ;;
6143
6144    bsdi[[45]]*)
6145      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6146      ;;
6147
6148    cygwin* | mingw* | pw32* | cegcc*)
6149      # When not using gcc, we currently assume that we are using
6150      # Microsoft Visual C++.
6151      # hardcode_libdir_flag_spec is actually meaningless, as there is
6152      # no search path for DLLs.
6153      case $cc_basename in
6154      cl*)
6155	# Native MSVC
6156	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6157	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6158	_LT_TAGVAR(always_export_symbols, $1)=yes
6159	_LT_TAGVAR(file_list_spec, $1)='@'
6160	# Tell ltmain to make .lib files, not .a files.
6161	libext=lib
6162	# Tell ltmain to make .dll files, not .so files.
6163	shrext_cmds=".dll"
6164	# FIXME: Setting linknames here is a bad hack.
6165	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6166	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6167	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6168	  else
6169	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6170	  fi~
6171	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6172	  linknames='
6173	# The linker will not automatically build a static lib if we build a DLL.
6174	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6175	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6176	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6177	_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'
6178	# Don't use ranlib
6179	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6180	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6181	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6182	  case $lt_outputfile in
6183	    *.exe|*.EXE) ;;
6184	    *)
6185	      lt_outputfile="$lt_outputfile.exe"
6186	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6187	      ;;
6188	  esac~
6189	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6190	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6191	    $RM "$lt_outputfile.manifest";
6192	  fi'
6193	;;
6194      *)
6195	# Assume MSVC wrapper
6196	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6197	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6198	# Tell ltmain to make .lib files, not .a files.
6199	libext=lib
6200	# Tell ltmain to make .dll files, not .so files.
6201	shrext_cmds=".dll"
6202	# FIXME: Setting linknames here is a bad hack.
6203	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6204	# The linker will automatically build a .lib file if we build a DLL.
6205	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6206	# FIXME: Should let the user specify the lib program.
6207	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6208	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6209	;;
6210      esac
6211      ;;
6212
6213    darwin* | rhapsody*)
6214      _LT_DARWIN_LINKER_FEATURES($1)
6215      ;;
6216
6217    dgux*)
6218      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6219      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6220      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6221      ;;
6222
6223    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6224    # support.  Future versions do this automatically, but an explicit c++rt0.o
6225    # does not break anything, and helps significantly (at the cost of a little
6226    # extra space).
6227    freebsd2.2*)
6228      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6229      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6230      _LT_TAGVAR(hardcode_direct, $1)=yes
6231      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6232      ;;
6233
6234    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6235    freebsd2.*)
6236      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6237      _LT_TAGVAR(hardcode_direct, $1)=yes
6238      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6239      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6240      ;;
6241
6242    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6243    freebsd* | dragonfly*)
6244      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6245      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6246      _LT_TAGVAR(hardcode_direct, $1)=yes
6247      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6248      ;;
6249
6250    hpux9*)
6251      if test "$GCC" = yes; then
6252	_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'
6253      else
6254	_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'
6255      fi
6256      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6257      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6258      _LT_TAGVAR(hardcode_direct, $1)=yes
6259
6260      # hardcode_minus_L: Not really in the search PATH,
6261      # but as the default location of the library.
6262      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6263      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6264      ;;
6265
6266    hpux10*)
6267      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6268	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6269      else
6270	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6271      fi
6272      if test "$with_gnu_ld" = no; then
6273	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6274	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6275	_LT_TAGVAR(hardcode_direct, $1)=yes
6276	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6277	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6278	# hardcode_minus_L: Not really in the search PATH,
6279	# but as the default location of the library.
6280	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6281      fi
6282      ;;
6283
6284    hpux11*)
6285      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6286	case $host_cpu in
6287	hppa*64*)
6288	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6289	  ;;
6290	ia64*)
6291	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6292	  ;;
6293	*)
6294	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6295	  ;;
6296	esac
6297      else
6298	case $host_cpu in
6299	hppa*64*)
6300	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6301	  ;;
6302	ia64*)
6303	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6304	  ;;
6305	*)
6306	m4_if($1, [], [
6307	  # Older versions of the 11.00 compiler do not understand -b yet
6308	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6309	  _LT_LINKER_OPTION([if $CC understands -b],
6310	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6311	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6312	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6313	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6314	  ;;
6315	esac
6316      fi
6317      if test "$with_gnu_ld" = no; then
6318	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6319	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6320
6321	case $host_cpu in
6322	hppa*64*|ia64*)
6323	  _LT_TAGVAR(hardcode_direct, $1)=no
6324	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6325	  ;;
6326	*)
6327	  _LT_TAGVAR(hardcode_direct, $1)=yes
6328	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6329	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6330
6331	  # hardcode_minus_L: Not really in the search PATH,
6332	  # but as the default location of the library.
6333	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6334	  ;;
6335	esac
6336      fi
6337      ;;
6338
6339    irix5* | irix6* | nonstopux*)
6340      if test "$GCC" = yes; then
6341	_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'
6342	# Try to use the -exported_symbol ld option, if it does not
6343	# work, assume that -exports_file does not work either and
6344	# implicitly export all symbols.
6345	# This should be the same for all languages, so no per-tag cache variable.
6346	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6347	  [lt_cv_irix_exported_symbol],
6348	  [save_LDFLAGS="$LDFLAGS"
6349	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6350	   AC_LINK_IFELSE(
6351	     [AC_LANG_SOURCE(
6352	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6353			      [C++], [[int foo (void) { return 0; }]],
6354			      [Fortran 77], [[
6355      subroutine foo
6356      end]],
6357			      [Fortran], [[
6358      subroutine foo
6359      end]])])],
6360	      [lt_cv_irix_exported_symbol=yes],
6361	      [lt_cv_irix_exported_symbol=no])
6362           LDFLAGS="$save_LDFLAGS"])
6363	if test "$lt_cv_irix_exported_symbol" = yes; then
6364          _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'
6365	fi
6366      else
6367	_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'
6368	_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'
6369      fi
6370      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6371      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6372      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6373      _LT_TAGVAR(inherit_rpath, $1)=yes
6374      _LT_TAGVAR(link_all_deplibs, $1)=yes
6375      ;;
6376
6377    netbsd*)
6378      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6379	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6380      else
6381	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6382      fi
6383      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6384      _LT_TAGVAR(hardcode_direct, $1)=yes
6385      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6386      ;;
6387
6388    newsos6)
6389      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6390      _LT_TAGVAR(hardcode_direct, $1)=yes
6391      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6392      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6393      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6394      ;;
6395
6396    *nto* | *qnx*)
6397      ;;
6398
6399    openbsd*)
6400      if test -f /usr/libexec/ld.so; then
6401	_LT_TAGVAR(hardcode_direct, $1)=yes
6402	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6403	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6404	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6405	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6406	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6407	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6408	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6409	else
6410	  case $host_os in
6411	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6412	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6413	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6414	     ;;
6415	   *)
6416	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6417	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6418	     ;;
6419	  esac
6420	fi
6421      else
6422	_LT_TAGVAR(ld_shlibs, $1)=no
6423      fi
6424      ;;
6425
6426    os2*)
6427      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6428      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6429      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6430      _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'
6431      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6432      ;;
6433
6434    osf3*)
6435      if test "$GCC" = yes; then
6436	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6437	_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'
6438      else
6439	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6440	_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'
6441      fi
6442      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6443      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6444      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6445      ;;
6446
6447    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6448      if test "$GCC" = yes; then
6449	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6450	_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'
6451	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6452      else
6453	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6454	_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'
6455	_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~
6456	$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'
6457
6458	# Both c and cxx compiler support -rpath directly
6459	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6460      fi
6461      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6462      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6463      ;;
6464
6465    solaris*)
6466      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6467      if test "$GCC" = yes; then
6468	wlarc='${wl}'
6469	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6470	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6471	  $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'
6472      else
6473	case `$CC -V 2>&1` in
6474	*"Compilers 5.0"*)
6475	  wlarc=''
6476	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6477	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6478	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6479	  ;;
6480	*)
6481	  wlarc='${wl}'
6482	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6483	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6484	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6485	  ;;
6486	esac
6487      fi
6488      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6489      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6490      case $host_os in
6491      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6492      *)
6493	# The compiler driver will combine and reorder linker options,
6494	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6495	# but is careful enough not to reorder.
6496	# Supported since Solaris 2.6 (maybe 2.5.1?)
6497	if test "$GCC" = yes; then
6498	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6499	else
6500	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6501	fi
6502	;;
6503      esac
6504      _LT_TAGVAR(link_all_deplibs, $1)=yes
6505      ;;
6506
6507    sunos4*)
6508      if test "x$host_vendor" = xsequent; then
6509	# Use $CC to link under sequent, because it throws in some extra .o
6510	# files that make .init and .fini sections work.
6511	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6512      else
6513	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6514      fi
6515      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6516      _LT_TAGVAR(hardcode_direct, $1)=yes
6517      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6518      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6519      ;;
6520
6521    sysv4)
6522      case $host_vendor in
6523	sni)
6524	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6525	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6526	;;
6527	siemens)
6528	  ## LD is ld it makes a PLAMLIB
6529	  ## CC just makes a GrossModule.
6530	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6531	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6532	  _LT_TAGVAR(hardcode_direct, $1)=no
6533        ;;
6534	motorola)
6535	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6536	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6537	;;
6538      esac
6539      runpath_var='LD_RUN_PATH'
6540      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6541      ;;
6542
6543    sysv4.3*)
6544      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6545      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6546      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6547      ;;
6548
6549    sysv4*MP*)
6550      if test -d /usr/nec; then
6551	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6552	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6553	runpath_var=LD_RUN_PATH
6554	hardcode_runpath_var=yes
6555	_LT_TAGVAR(ld_shlibs, $1)=yes
6556      fi
6557      ;;
6558
6559    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6560      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6561      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6562      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6563      runpath_var='LD_RUN_PATH'
6564
6565      if test "$GCC" = yes; then
6566	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6567	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6568      else
6569	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6570	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6571      fi
6572      ;;
6573
6574    sysv5* | sco3.2v5* | sco5v6*)
6575      # Note: We can NOT use -z defs as we might desire, because we do not
6576      # link with -lc, and that would cause any symbols used from libc to
6577      # always be unresolved, which means just about no library would
6578      # ever link correctly.  If we're not using GNU ld we use -z text
6579      # though, which does catch some bad symbols but isn't as heavy-handed
6580      # as -z defs.
6581      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6582      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6583      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6584      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6585      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6586      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6587      _LT_TAGVAR(link_all_deplibs, $1)=yes
6588      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6589      runpath_var='LD_RUN_PATH'
6590
6591      if test "$GCC" = yes; then
6592	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6593	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6594      else
6595	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6596	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6597      fi
6598      ;;
6599
6600    uts4*)
6601      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6602      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6603      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6604      ;;
6605
6606    *)
6607      _LT_TAGVAR(ld_shlibs, $1)=no
6608      ;;
6609    esac
6610
6611    if test x$host_vendor = xsni; then
6612      case $host in
6613      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6614	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6615	;;
6616      esac
6617    fi
6618  fi
6619])
6620AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6621test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6622
6623_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6624
6625_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6626_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6627_LT_DECL([], [extract_expsyms_cmds], [2],
6628    [The commands to extract the exported symbol list from a shared archive])
6629
6630#
6631# Do we need to explicitly link libc?
6632#
6633case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6634x|xyes)
6635  # Assume -lc should be added
6636  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6637
6638  if test "$enable_shared" = yes && test "$GCC" = yes; then
6639    case $_LT_TAGVAR(archive_cmds, $1) in
6640    *'~'*)
6641      # FIXME: we may have to deal with multi-command sequences.
6642      ;;
6643    '$CC '*)
6644      # Test whether the compiler implicitly links with -lc since on some
6645      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6646      # to ld, don't add -lc before -lgcc.
6647      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6648	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6649	[$RM conftest*
6650	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6651
6652	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6653	  soname=conftest
6654	  lib=conftest
6655	  libobjs=conftest.$ac_objext
6656	  deplibs=
6657	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6658	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6659	  compiler_flags=-v
6660	  linker_flags=-v
6661	  verstring=
6662	  output_objdir=.
6663	  libname=conftest
6664	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6665	  _LT_TAGVAR(allow_undefined_flag, $1)=
6666	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6667	  then
6668	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6669	  else
6670	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6671	  fi
6672	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6673	else
6674	  cat conftest.err 1>&5
6675	fi
6676	$RM conftest*
6677	])
6678      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6679      ;;
6680    esac
6681  fi
6682  ;;
6683esac
6684
6685_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6686    [Whether or not to add -lc for building shared libraries])
6687_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6688    [enable_shared_with_static_runtimes], [0],
6689    [Whether or not to disallow shared libs when runtime libs are static])
6690_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6691    [Compiler flag to allow reflexive dlopens])
6692_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6693    [Compiler flag to generate shared objects directly from archives])
6694_LT_TAGDECL([], [compiler_needs_object], [1],
6695    [Whether the compiler copes with passing no objects directly])
6696_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6697    [Create an old-style archive from a shared archive])
6698_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6699    [Create a temporary old-style archive to link instead of a shared archive])
6700_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6701_LT_TAGDECL([], [archive_expsym_cmds], [2])
6702_LT_TAGDECL([], [module_cmds], [2],
6703    [Commands used to build a loadable module if different from building
6704    a shared archive.])
6705_LT_TAGDECL([], [module_expsym_cmds], [2])
6706_LT_TAGDECL([], [with_gnu_ld], [1],
6707    [Whether we are building with GNU ld or not])
6708_LT_TAGDECL([], [allow_undefined_flag], [1],
6709    [Flag that allows shared libraries with undefined symbols to be built])
6710_LT_TAGDECL([], [no_undefined_flag], [1],
6711    [Flag that enforces no undefined symbols])
6712_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6713    [Flag to hardcode $libdir into a binary during linking.
6714    This must work even if $libdir does not exist])
6715_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6716    [Whether we need a single "-rpath" flag with a separated argument])
6717_LT_TAGDECL([], [hardcode_direct], [0],
6718    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6719    DIR into the resulting binary])
6720_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6721    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6722    DIR into the resulting binary and the resulting library dependency is
6723    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6724    library is relocated])
6725_LT_TAGDECL([], [hardcode_minus_L], [0],
6726    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6727    into the resulting binary])
6728_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6729    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6730    into the resulting binary])
6731_LT_TAGDECL([], [hardcode_automatic], [0],
6732    [Set to "yes" if building a shared library automatically hardcodes DIR
6733    into the library and all subsequent libraries and executables linked
6734    against it])
6735_LT_TAGDECL([], [inherit_rpath], [0],
6736    [Set to yes if linker adds runtime paths of dependent libraries
6737    to runtime path list])
6738_LT_TAGDECL([], [link_all_deplibs], [0],
6739    [Whether libtool must link a program against all its dependency libraries])
6740_LT_TAGDECL([], [always_export_symbols], [0],
6741    [Set to "yes" if exported symbols are required])
6742_LT_TAGDECL([], [export_symbols_cmds], [2],
6743    [The commands to list exported symbols])
6744_LT_TAGDECL([], [exclude_expsyms], [1],
6745    [Symbols that should not be listed in the preloaded symbols])
6746_LT_TAGDECL([], [include_expsyms], [1],
6747    [Symbols that must always be exported])
6748_LT_TAGDECL([], [prelink_cmds], [2],
6749    [Commands necessary for linking programs (against libraries) with templates])
6750_LT_TAGDECL([], [postlink_cmds], [2],
6751    [Commands necessary for finishing linking programs])
6752_LT_TAGDECL([], [file_list_spec], [1],
6753    [Specify filename containing input files])
6754dnl FIXME: Not yet implemented
6755dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6756dnl    [Compiler flag to generate thread safe objects])
6757])# _LT_LINKER_SHLIBS
6758
6759
6760# _LT_LANG_C_CONFIG([TAG])
6761# ------------------------
6762# Ensure that the configuration variables for a C compiler are suitably
6763# defined.  These variables are subsequently used by _LT_CONFIG to write
6764# the compiler configuration to `libtool'.
6765m4_defun([_LT_LANG_C_CONFIG],
6766[m4_require([_LT_DECL_EGREP])dnl
6767lt_save_CC="$CC"
6768AC_LANG_PUSH(C)
6769
6770# Source file extension for C test sources.
6771ac_ext=c
6772
6773# Object file extension for compiled C test sources.
6774objext=o
6775_LT_TAGVAR(objext, $1)=$objext
6776
6777# Code to be used in simple compile tests
6778lt_simple_compile_test_code="int some_variable = 0;"
6779
6780# Code to be used in simple link tests
6781lt_simple_link_test_code='int main(){return(0);}'
6782
6783_LT_TAG_COMPILER
6784# Save the default compiler, since it gets overwritten when the other
6785# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6786compiler_DEFAULT=$CC
6787
6788# save warnings/boilerplate of simple test code
6789_LT_COMPILER_BOILERPLATE
6790_LT_LINKER_BOILERPLATE
6791
6792if test -n "$compiler"; then
6793  _LT_COMPILER_NO_RTTI($1)
6794  _LT_COMPILER_PIC($1)
6795  _LT_COMPILER_C_O($1)
6796  _LT_COMPILER_FILE_LOCKS($1)
6797  _LT_LINKER_SHLIBS($1)
6798  _LT_SYS_DYNAMIC_LINKER($1)
6799  _LT_LINKER_HARDCODE_LIBPATH($1)
6800  LT_SYS_DLOPEN_SELF
6801  _LT_CMD_STRIPLIB
6802
6803  # Report which library types will actually be built
6804  AC_MSG_CHECKING([if libtool supports shared libraries])
6805  AC_MSG_RESULT([$can_build_shared])
6806
6807  AC_MSG_CHECKING([whether to build shared libraries])
6808  test "$can_build_shared" = "no" && enable_shared=no
6809
6810  # On AIX, shared libraries and static libraries use the same namespace, and
6811  # are all built from PIC.
6812  case $host_os in
6813  aix3*)
6814    test "$enable_shared" = yes && enable_static=no
6815    if test -n "$RANLIB"; then
6816      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6817      postinstall_cmds='$RANLIB $lib'
6818    fi
6819    ;;
6820
6821  aix[[4-9]]*)
6822    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6823      test "$enable_shared" = yes && enable_static=no
6824    fi
6825    ;;
6826  esac
6827  AC_MSG_RESULT([$enable_shared])
6828
6829  AC_MSG_CHECKING([whether to build static libraries])
6830  # Make sure either enable_shared or enable_static is yes.
6831  test "$enable_shared" = yes || enable_static=yes
6832  AC_MSG_RESULT([$enable_static])
6833
6834  _LT_CONFIG($1)
6835fi
6836AC_LANG_POP
6837CC="$lt_save_CC"
6838])# _LT_LANG_C_CONFIG
6839
6840
6841# _LT_LANG_CXX_CONFIG([TAG])
6842# --------------------------
6843# Ensure that the configuration variables for a C++ compiler are suitably
6844# defined.  These variables are subsequently used by _LT_CONFIG to write
6845# the compiler configuration to `libtool'.
6846m4_defun([_LT_LANG_CXX_CONFIG],
6847[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6848m4_require([_LT_DECL_EGREP])dnl
6849m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6850if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6851    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6852    (test "X$CXX" != "Xg++"))) ; then
6853  AC_PROG_CXXCPP
6854else
6855  _lt_caught_CXX_error=yes
6856fi
6857
6858AC_LANG_PUSH(C++)
6859_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6860_LT_TAGVAR(allow_undefined_flag, $1)=
6861_LT_TAGVAR(always_export_symbols, $1)=no
6862_LT_TAGVAR(archive_expsym_cmds, $1)=
6863_LT_TAGVAR(compiler_needs_object, $1)=no
6864_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6865_LT_TAGVAR(hardcode_direct, $1)=no
6866_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6867_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6868_LT_TAGVAR(hardcode_libdir_separator, $1)=
6869_LT_TAGVAR(hardcode_minus_L, $1)=no
6870_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6871_LT_TAGVAR(hardcode_automatic, $1)=no
6872_LT_TAGVAR(inherit_rpath, $1)=no
6873_LT_TAGVAR(module_cmds, $1)=
6874_LT_TAGVAR(module_expsym_cmds, $1)=
6875_LT_TAGVAR(link_all_deplibs, $1)=unknown
6876_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6877_LT_TAGVAR(reload_flag, $1)=$reload_flag
6878_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6879_LT_TAGVAR(no_undefined_flag, $1)=
6880_LT_TAGVAR(whole_archive_flag_spec, $1)=
6881_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6882
6883# Source file extension for C++ test sources.
6884ac_ext=cpp
6885
6886# Object file extension for compiled C++ test sources.
6887objext=o
6888_LT_TAGVAR(objext, $1)=$objext
6889
6890# No sense in running all these tests if we already determined that
6891# the CXX compiler isn't working.  Some variables (like enable_shared)
6892# are currently assumed to apply to all compilers on this platform,
6893# and will be corrupted by setting them based on a non-working compiler.
6894if test "$_lt_caught_CXX_error" != yes; then
6895  # Code to be used in simple compile tests
6896  lt_simple_compile_test_code="int some_variable = 0;"
6897
6898  # Code to be used in simple link tests
6899  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6900
6901  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6902  _LT_TAG_COMPILER
6903
6904  # save warnings/boilerplate of simple test code
6905  _LT_COMPILER_BOILERPLATE
6906  _LT_LINKER_BOILERPLATE
6907
6908  # Allow CC to be a program name with arguments.
6909  lt_save_CC=$CC
6910  lt_save_CFLAGS=$CFLAGS
6911  lt_save_LD=$LD
6912  lt_save_GCC=$GCC
6913  GCC=$GXX
6914  lt_save_with_gnu_ld=$with_gnu_ld
6915  lt_save_path_LD=$lt_cv_path_LD
6916  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6917    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6918  else
6919    $as_unset lt_cv_prog_gnu_ld
6920  fi
6921  if test -n "${lt_cv_path_LDCXX+set}"; then
6922    lt_cv_path_LD=$lt_cv_path_LDCXX
6923  else
6924    $as_unset lt_cv_path_LD
6925  fi
6926  test -z "${LDCXX+set}" || LD=$LDCXX
6927  CC=${CXX-"c++"}
6928  CFLAGS=$CXXFLAGS
6929  compiler=$CC
6930  _LT_TAGVAR(compiler, $1)=$CC
6931  _LT_CC_BASENAME([$compiler])
6932
6933  if test -n "$compiler"; then
6934    # We don't want -fno-exception when compiling C++ code, so set the
6935    # no_builtin_flag separately
6936    if test "$GXX" = yes; then
6937      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6938    else
6939      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6940    fi
6941
6942    if test "$GXX" = yes; then
6943      # Set up default GNU C++ configuration
6944
6945      LT_PATH_LD
6946
6947      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6948      # archiving commands below assume that GNU ld is being used.
6949      if test "$with_gnu_ld" = yes; then
6950        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6951        _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'
6952
6953        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6954        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6955
6956        # If archive_cmds runs LD, not CC, wlarc should be empty
6957        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6958        #     investigate it a little bit more. (MM)
6959        wlarc='${wl}'
6960
6961        # ancient GNU ld didn't support --whole-archive et. al.
6962        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6963	  $GREP 'no-whole-archive' > /dev/null; then
6964          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6965        else
6966          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6967        fi
6968      else
6969        with_gnu_ld=no
6970        wlarc=
6971
6972        # A generic and very simple default shared library creation
6973        # command for GNU C++ for the case where it uses the native
6974        # linker, instead of GNU ld.  If possible, this setting should
6975        # overridden to take advantage of the native linker features on
6976        # the platform it is being used on.
6977        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6978      fi
6979
6980      # Commands to make compiler produce verbose output that lists
6981      # what "hidden" libraries, object files and flags are used when
6982      # linking a shared library.
6983      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6984
6985    else
6986      GXX=no
6987      with_gnu_ld=no
6988      wlarc=
6989    fi
6990
6991    # PORTME: fill in a description of your system's C++ link characteristics
6992    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6993    _LT_TAGVAR(ld_shlibs, $1)=yes
6994    case $host_os in
6995      aix3*)
6996        # FIXME: insert proper C++ library support
6997        _LT_TAGVAR(ld_shlibs, $1)=no
6998        ;;
6999      aix[[4-9]]*)
7000        if test "$host_cpu" = ia64; then
7001          # On IA64, the linker does run time linking by default, so we don't
7002          # have to do anything special.
7003          aix_use_runtimelinking=no
7004          exp_sym_flag='-Bexport'
7005          no_entry_flag=""
7006        else
7007          aix_use_runtimelinking=no
7008
7009          # Test if we are trying to use run time linking or normal
7010          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7011          # need to do runtime linking.
7012          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7013	    for ld_flag in $LDFLAGS; do
7014	      case $ld_flag in
7015	      *-brtl*)
7016	        aix_use_runtimelinking=yes
7017	        break
7018	        ;;
7019	      esac
7020	    done
7021	    ;;
7022          esac
7023
7024          exp_sym_flag='-bexport'
7025          no_entry_flag='-bnoentry'
7026        fi
7027
7028        # When large executables or shared objects are built, AIX ld can
7029        # have problems creating the table of contents.  If linking a library
7030        # or program results in "error TOC overflow" add -mminimal-toc to
7031        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7032        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7033
7034        _LT_TAGVAR(archive_cmds, $1)=''
7035        _LT_TAGVAR(hardcode_direct, $1)=yes
7036        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7037        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7038        _LT_TAGVAR(link_all_deplibs, $1)=yes
7039        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7040
7041        if test "$GXX" = yes; then
7042          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7043          # We only want to do this on AIX 4.2 and lower, the check
7044          # below for broken collect2 doesn't work under 4.3+
7045	  collect2name=`${CC} -print-prog-name=collect2`
7046	  if test -f "$collect2name" &&
7047	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7048	  then
7049	    # We have reworked collect2
7050	    :
7051	  else
7052	    # We have old collect2
7053	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7054	    # It fails to find uninstalled libraries when the uninstalled
7055	    # path is not listed in the libpath.  Setting hardcode_minus_L
7056	    # to unsupported forces relinking
7057	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7058	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7059	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7060	  fi
7061          esac
7062          shared_flag='-shared'
7063	  if test "$aix_use_runtimelinking" = yes; then
7064	    shared_flag="$shared_flag "'${wl}-G'
7065	  fi
7066        else
7067          # not using gcc
7068          if test "$host_cpu" = ia64; then
7069	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7070	  # chokes on -Wl,-G. The following line is correct:
7071	  shared_flag='-G'
7072          else
7073	    if test "$aix_use_runtimelinking" = yes; then
7074	      shared_flag='${wl}-G'
7075	    else
7076	      shared_flag='${wl}-bM:SRE'
7077	    fi
7078          fi
7079        fi
7080
7081        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7082        # It seems that -bexpall does not export symbols beginning with
7083        # underscore (_), so it is better to generate a list of symbols to
7084	# export.
7085        _LT_TAGVAR(always_export_symbols, $1)=yes
7086        if test "$aix_use_runtimelinking" = yes; then
7087          # Warning - without using the other runtime loading flags (-brtl),
7088          # -berok will link without error, but may produce a broken library.
7089          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7090          # Determine the default libpath from the value encoded in an empty
7091          # executable.
7092          _LT_SYS_MODULE_PATH_AIX([$1])
7093          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7094
7095          _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"
7096        else
7097          if test "$host_cpu" = ia64; then
7098	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7099	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7100	    _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"
7101          else
7102	    # Determine the default libpath from the value encoded in an
7103	    # empty executable.
7104	    _LT_SYS_MODULE_PATH_AIX([$1])
7105	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7106	    # Warning - without using the other run time loading flags,
7107	    # -berok will link without error, but may produce a broken library.
7108	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7109	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7110	    if test "$with_gnu_ld" = yes; then
7111	      # We only use this code for GNU lds that support --whole-archive.
7112	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7113	    else
7114	      # Exported symbols can be pulled into shared objects from archives
7115	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7116	    fi
7117	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7118	    # This is similar to how AIX traditionally builds its shared
7119	    # libraries.
7120	    _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'
7121          fi
7122        fi
7123        ;;
7124
7125      beos*)
7126	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7127	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7128	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7129	  # support --undefined.  This deserves some investigation.  FIXME
7130	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7131	else
7132	  _LT_TAGVAR(ld_shlibs, $1)=no
7133	fi
7134	;;
7135
7136      chorus*)
7137        case $cc_basename in
7138          *)
7139	  # FIXME: insert proper C++ library support
7140	  _LT_TAGVAR(ld_shlibs, $1)=no
7141	  ;;
7142        esac
7143        ;;
7144
7145      cygwin* | mingw* | pw32* | cegcc*)
7146	case $GXX,$cc_basename in
7147	,cl* | no,cl*)
7148	  # Native MSVC
7149	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7150	  # no search path for DLLs.
7151	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7152	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7153	  _LT_TAGVAR(always_export_symbols, $1)=yes
7154	  _LT_TAGVAR(file_list_spec, $1)='@'
7155	  # Tell ltmain to make .lib files, not .a files.
7156	  libext=lib
7157	  # Tell ltmain to make .dll files, not .so files.
7158	  shrext_cmds=".dll"
7159	  # FIXME: Setting linknames here is a bad hack.
7160	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7161	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7162	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7163	    else
7164	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7165	    fi~
7166	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7167	    linknames='
7168	  # The linker will not automatically build a static lib if we build a DLL.
7169	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7170	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7171	  # Don't use ranlib
7172	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7173	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7174	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7175	    case $lt_outputfile in
7176	      *.exe|*.EXE) ;;
7177	      *)
7178		lt_outputfile="$lt_outputfile.exe"
7179		lt_tool_outputfile="$lt_tool_outputfile.exe"
7180		;;
7181	    esac~
7182	    func_to_tool_file "$lt_outputfile"~
7183	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7184	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7185	      $RM "$lt_outputfile.manifest";
7186	    fi'
7187	  ;;
7188	*)
7189	  # g++
7190	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7191	  # as there is no search path for DLLs.
7192	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7193	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7194	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7195	  _LT_TAGVAR(always_export_symbols, $1)=no
7196	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7197
7198	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7199	    _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'
7200	    # If the export-symbols file already is a .def file (1st line
7201	    # is EXPORTS), use it as is; otherwise, prepend...
7202	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7203	      cp $export_symbols $output_objdir/$soname.def;
7204	    else
7205	      echo EXPORTS > $output_objdir/$soname.def;
7206	      cat $export_symbols >> $output_objdir/$soname.def;
7207	    fi~
7208	    $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'
7209	  else
7210	    _LT_TAGVAR(ld_shlibs, $1)=no
7211	  fi
7212	  ;;
7213	esac
7214	;;
7215      darwin* | rhapsody*)
7216        _LT_DARWIN_LINKER_FEATURES($1)
7217	;;
7218
7219      dgux*)
7220        case $cc_basename in
7221          ec++*)
7222	    # FIXME: insert proper C++ library support
7223	    _LT_TAGVAR(ld_shlibs, $1)=no
7224	    ;;
7225          ghcx*)
7226	    # Green Hills C++ Compiler
7227	    # FIXME: insert proper C++ library support
7228	    _LT_TAGVAR(ld_shlibs, $1)=no
7229	    ;;
7230          *)
7231	    # FIXME: insert proper C++ library support
7232	    _LT_TAGVAR(ld_shlibs, $1)=no
7233	    ;;
7234        esac
7235        ;;
7236
7237      freebsd2.*)
7238        # C++ shared libraries reported to be fairly broken before
7239	# switch to ELF
7240        _LT_TAGVAR(ld_shlibs, $1)=no
7241        ;;
7242
7243      freebsd-elf*)
7244        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7245        ;;
7246
7247      freebsd* | dragonfly*)
7248        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7249        # conventions
7250        _LT_TAGVAR(ld_shlibs, $1)=yes
7251        ;;
7252
7253      gnu*)
7254        ;;
7255
7256      haiku*)
7257        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7258        _LT_TAGVAR(link_all_deplibs, $1)=yes
7259        ;;
7260
7261      hpux9*)
7262        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7263        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7264        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7265        _LT_TAGVAR(hardcode_direct, $1)=yes
7266        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7267				             # but as the default
7268				             # location of the library.
7269
7270        case $cc_basename in
7271          CC*)
7272            # FIXME: insert proper C++ library support
7273            _LT_TAGVAR(ld_shlibs, $1)=no
7274            ;;
7275          aCC*)
7276            _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'
7277            # Commands to make compiler produce verbose output that lists
7278            # what "hidden" libraries, object files and flags are used when
7279            # linking a shared library.
7280            #
7281            # There doesn't appear to be a way to prevent this compiler from
7282            # explicitly linking system object files so we need to strip them
7283            # from the output so that they don't get included in the library
7284            # dependencies.
7285            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"'
7286            ;;
7287          *)
7288            if test "$GXX" = yes; then
7289              _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'
7290            else
7291              # FIXME: insert proper C++ library support
7292              _LT_TAGVAR(ld_shlibs, $1)=no
7293            fi
7294            ;;
7295        esac
7296        ;;
7297
7298      hpux10*|hpux11*)
7299        if test $with_gnu_ld = no; then
7300	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7301	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7302
7303          case $host_cpu in
7304            hppa*64*|ia64*)
7305              ;;
7306            *)
7307	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7308              ;;
7309          esac
7310        fi
7311        case $host_cpu in
7312          hppa*64*|ia64*)
7313            _LT_TAGVAR(hardcode_direct, $1)=no
7314            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7315            ;;
7316          *)
7317            _LT_TAGVAR(hardcode_direct, $1)=yes
7318            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7319            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7320					         # but as the default
7321					         # location of the library.
7322            ;;
7323        esac
7324
7325        case $cc_basename in
7326          CC*)
7327	    # FIXME: insert proper C++ library support
7328	    _LT_TAGVAR(ld_shlibs, $1)=no
7329	    ;;
7330          aCC*)
7331	    case $host_cpu in
7332	      hppa*64*)
7333	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7334	        ;;
7335	      ia64*)
7336	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7337	        ;;
7338	      *)
7339	        _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'
7340	        ;;
7341	    esac
7342	    # Commands to make compiler produce verbose output that lists
7343	    # what "hidden" libraries, object files and flags are used when
7344	    # linking a shared library.
7345	    #
7346	    # There doesn't appear to be a way to prevent this compiler from
7347	    # explicitly linking system object files so we need to strip them
7348	    # from the output so that they don't get included in the library
7349	    # dependencies.
7350	    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"'
7351	    ;;
7352          *)
7353	    if test "$GXX" = yes; then
7354	      if test $with_gnu_ld = no; then
7355	        case $host_cpu in
7356	          hppa*64*)
7357	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7358	            ;;
7359	          ia64*)
7360	            _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'
7361	            ;;
7362	          *)
7363	            _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'
7364	            ;;
7365	        esac
7366	      fi
7367	    else
7368	      # FIXME: insert proper C++ library support
7369	      _LT_TAGVAR(ld_shlibs, $1)=no
7370	    fi
7371	    ;;
7372        esac
7373        ;;
7374
7375      interix[[3-9]]*)
7376	_LT_TAGVAR(hardcode_direct, $1)=no
7377	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7378	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7379	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7380	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7381	# Instead, shared libraries are loaded at an image base (0x10000000 by
7382	# default) and relocated if they conflict, which is a slow very memory
7383	# consuming and fragmenting process.  To avoid this, we pick a random,
7384	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7385	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7386	_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'
7387	_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'
7388	;;
7389      irix5* | irix6*)
7390        case $cc_basename in
7391          CC*)
7392	    # SGI C++
7393	    _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'
7394
7395	    # Archives containing C++ object files must be created using
7396	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7397	    # necessary to make sure instantiated templates are included
7398	    # in the archive.
7399	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7400	    ;;
7401          *)
7402	    if test "$GXX" = yes; then
7403	      if test "$with_gnu_ld" = no; then
7404	        _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'
7405	      else
7406	        _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'
7407	      fi
7408	    fi
7409	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7410	    ;;
7411        esac
7412        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7413        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7414        _LT_TAGVAR(inherit_rpath, $1)=yes
7415        ;;
7416
7417      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7418        case $cc_basename in
7419          KCC*)
7420	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7421
7422	    # KCC will only create a shared library if the output file
7423	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7424	    # to its proper name (with version) after linking.
7425	    _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'
7426	    _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'
7427	    # Commands to make compiler produce verbose output that lists
7428	    # what "hidden" libraries, object files and flags are used when
7429	    # linking a shared library.
7430	    #
7431	    # There doesn't appear to be a way to prevent this compiler from
7432	    # explicitly linking system object files so we need to strip them
7433	    # from the output so that they don't get included in the library
7434	    # dependencies.
7435	    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"'
7436
7437	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7438	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7439
7440	    # Archives containing C++ object files must be created using
7441	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7442	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7443	    ;;
7444	  icpc* | ecpc* )
7445	    # Intel C++
7446	    with_gnu_ld=yes
7447	    # version 8.0 and above of icpc choke on multiply defined symbols
7448	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7449	    # earlier do not add the objects themselves.
7450	    case `$CC -V 2>&1` in
7451	      *"Version 7."*)
7452	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7453		_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'
7454		;;
7455	      *)  # Version 8.0 or newer
7456	        tmp_idyn=
7457	        case $host_cpu in
7458		  ia64*) tmp_idyn=' -i_dynamic';;
7459		esac
7460	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7461		_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'
7462		;;
7463	    esac
7464	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7465	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7466	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7467	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7468	    ;;
7469          pgCC* | pgcpp*)
7470            # Portland Group C++ compiler
7471	    case `$CC -V` in
7472	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7473	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7474		rm -rf $tpldir~
7475		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7476		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7477	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7478		rm -rf $tpldir~
7479		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7480		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7481		$RANLIB $oldlib'
7482	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7483		rm -rf $tpldir~
7484		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7485		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7486	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7487		rm -rf $tpldir~
7488		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7489		$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'
7490	      ;;
7491	    *) # Version 6 and above use weak symbols
7492	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7493	      _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'
7494	      ;;
7495	    esac
7496
7497	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7498	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7499	    _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'
7500            ;;
7501	  cxx*)
7502	    # Compaq C++
7503	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7504	    _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'
7505
7506	    runpath_var=LD_RUN_PATH
7507	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7508	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7509
7510	    # Commands to make compiler produce verbose output that lists
7511	    # what "hidden" libraries, object files and flags are used when
7512	    # linking a shared library.
7513	    #
7514	    # There doesn't appear to be a way to prevent this compiler from
7515	    # explicitly linking system object files so we need to strip them
7516	    # from the output so that they don't get included in the library
7517	    # dependencies.
7518	    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'
7519	    ;;
7520	  xl* | mpixl* | bgxl*)
7521	    # IBM XL 8.0 on PPC, with GNU ld
7522	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7523	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7524	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7525	    if test "x$supports_anon_versioning" = xyes; then
7526	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7527		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7528		echo "local: *; };" >> $output_objdir/$libname.ver~
7529		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7530	    fi
7531	    ;;
7532	  *)
7533	    case `$CC -V 2>&1 | sed 5q` in
7534	    *Sun\ C*)
7535	      # Sun C++ 5.9
7536	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7537	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7538	      _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'
7539	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7540	      _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'
7541	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7542
7543	      # Not sure whether something based on
7544	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7545	      # would be better.
7546	      output_verbose_link_cmd='func_echo_all'
7547
7548	      # Archives containing C++ object files must be created using
7549	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7550	      # necessary to make sure instantiated templates are included
7551	      # in the archive.
7552	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7553	      ;;
7554	    esac
7555	    ;;
7556	esac
7557	;;
7558
7559      lynxos*)
7560        # FIXME: insert proper C++ library support
7561	_LT_TAGVAR(ld_shlibs, $1)=no
7562	;;
7563
7564      m88k*)
7565        # FIXME: insert proper C++ library support
7566        _LT_TAGVAR(ld_shlibs, $1)=no
7567	;;
7568
7569      mvs*)
7570        case $cc_basename in
7571          cxx*)
7572	    # FIXME: insert proper C++ library support
7573	    _LT_TAGVAR(ld_shlibs, $1)=no
7574	    ;;
7575	  *)
7576	    # FIXME: insert proper C++ library support
7577	    _LT_TAGVAR(ld_shlibs, $1)=no
7578	    ;;
7579	esac
7580	;;
7581
7582      netbsd*)
7583        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7584	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7585	  wlarc=
7586	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7587	  _LT_TAGVAR(hardcode_direct, $1)=yes
7588	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7589	fi
7590	# Workaround some broken pre-1.5 toolchains
7591	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7592	;;
7593
7594      *nto* | *qnx*)
7595        _LT_TAGVAR(ld_shlibs, $1)=yes
7596	;;
7597
7598      openbsd2*)
7599        # C++ shared libraries are fairly broken
7600	_LT_TAGVAR(ld_shlibs, $1)=no
7601	;;
7602
7603      openbsd*)
7604	if test -f /usr/libexec/ld.so; then
7605	  _LT_TAGVAR(hardcode_direct, $1)=yes
7606	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7607	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7608	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7609	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7610	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7611	    _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'
7612	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7613	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7614	  fi
7615	  output_verbose_link_cmd=func_echo_all
7616	else
7617	  _LT_TAGVAR(ld_shlibs, $1)=no
7618	fi
7619	;;
7620
7621      osf3* | osf4* | osf5*)
7622        case $cc_basename in
7623          KCC*)
7624	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7625
7626	    # KCC will only create a shared library if the output file
7627	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7628	    # to its proper name (with version) after linking.
7629	    _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'
7630
7631	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7632	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7633
7634	    # Archives containing C++ object files must be created using
7635	    # the KAI C++ compiler.
7636	    case $host in
7637	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7638	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7639	    esac
7640	    ;;
7641          RCC*)
7642	    # Rational C++ 2.4.1
7643	    # FIXME: insert proper C++ library support
7644	    _LT_TAGVAR(ld_shlibs, $1)=no
7645	    ;;
7646          cxx*)
7647	    case $host in
7648	      osf3*)
7649	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7650	        _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'
7651	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7652		;;
7653	      *)
7654	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7655	        _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'
7656	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7657	          echo "-hidden">> $lib.exp~
7658	          $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~
7659	          $RM $lib.exp'
7660	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7661		;;
7662	    esac
7663
7664	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7665
7666	    # Commands to make compiler produce verbose output that lists
7667	    # what "hidden" libraries, object files and flags are used when
7668	    # linking a shared library.
7669	    #
7670	    # There doesn't appear to be a way to prevent this compiler from
7671	    # explicitly linking system object files so we need to strip them
7672	    # from the output so that they don't get included in the library
7673	    # dependencies.
7674	    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"'
7675	    ;;
7676	  *)
7677	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7678	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7679	      case $host in
7680	        osf3*)
7681	          _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'
7682		  ;;
7683	        *)
7684	          _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'
7685		  ;;
7686	      esac
7687
7688	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7689	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7690
7691	      # Commands to make compiler produce verbose output that lists
7692	      # what "hidden" libraries, object files and flags are used when
7693	      # linking a shared library.
7694	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7695
7696	    else
7697	      # FIXME: insert proper C++ library support
7698	      _LT_TAGVAR(ld_shlibs, $1)=no
7699	    fi
7700	    ;;
7701        esac
7702        ;;
7703
7704      psos*)
7705        # FIXME: insert proper C++ library support
7706        _LT_TAGVAR(ld_shlibs, $1)=no
7707        ;;
7708
7709      sunos4*)
7710        case $cc_basename in
7711          CC*)
7712	    # Sun C++ 4.x
7713	    # FIXME: insert proper C++ library support
7714	    _LT_TAGVAR(ld_shlibs, $1)=no
7715	    ;;
7716          lcc*)
7717	    # Lucid
7718	    # FIXME: insert proper C++ library support
7719	    _LT_TAGVAR(ld_shlibs, $1)=no
7720	    ;;
7721          *)
7722	    # FIXME: insert proper C++ library support
7723	    _LT_TAGVAR(ld_shlibs, $1)=no
7724	    ;;
7725        esac
7726        ;;
7727
7728      solaris*)
7729        case $cc_basename in
7730          CC* | sunCC*)
7731	    # Sun C++ 4.2, 5.x and Centerline C++
7732            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7733	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7734	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7735	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7736	      $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'
7737
7738	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7739	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7740	    case $host_os in
7741	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7742	      *)
7743		# The compiler driver will combine and reorder linker options,
7744		# but understands `-z linker_flag'.
7745	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7746		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7747	        ;;
7748	    esac
7749	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7750
7751	    output_verbose_link_cmd='func_echo_all'
7752
7753	    # Archives containing C++ object files must be created using
7754	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7755	    # necessary to make sure instantiated templates are included
7756	    # in the archive.
7757	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7758	    ;;
7759          gcx*)
7760	    # Green Hills C++ Compiler
7761	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7762
7763	    # The C++ compiler must be used to create the archive.
7764	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7765	    ;;
7766          *)
7767	    # GNU C++ compiler with Solaris linker
7768	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7769	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7770	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7771	        _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'
7772	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7773		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
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	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7779	      else
7780	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7781	        # platform.
7782	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7783	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7784		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7785
7786	        # Commands to make compiler produce verbose output that lists
7787	        # what "hidden" libraries, object files and flags are used when
7788	        # linking a shared library.
7789	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7790	      fi
7791
7792	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7793	      case $host_os in
7794		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7795		*)
7796		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7797		  ;;
7798	      esac
7799	    fi
7800	    ;;
7801        esac
7802        ;;
7803
7804    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7805      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7806      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7807      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7808      runpath_var='LD_RUN_PATH'
7809
7810      case $cc_basename in
7811        CC*)
7812	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7813	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7814	  ;;
7815	*)
7816	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7817	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7818	  ;;
7819      esac
7820      ;;
7821
7822      sysv5* | sco3.2v5* | sco5v6*)
7823	# Note: We can NOT use -z defs as we might desire, because we do not
7824	# link with -lc, and that would cause any symbols used from libc to
7825	# always be unresolved, which means just about no library would
7826	# ever link correctly.  If we're not using GNU ld we use -z text
7827	# though, which does catch some bad symbols but isn't as heavy-handed
7828	# as -z defs.
7829	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7830	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7831	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7832	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7833	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7834	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7835	_LT_TAGVAR(link_all_deplibs, $1)=yes
7836	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7837	runpath_var='LD_RUN_PATH'
7838
7839	case $cc_basename in
7840          CC*)
7841	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7842	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7843	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7844	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7845	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7846	      '"$_LT_TAGVAR(reload_cmds, $1)"
7847	    ;;
7848	  *)
7849	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7850	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7851	    ;;
7852	esac
7853      ;;
7854
7855      tandem*)
7856        case $cc_basename in
7857          NCC*)
7858	    # NonStop-UX NCC 3.20
7859	    # FIXME: insert proper C++ library support
7860	    _LT_TAGVAR(ld_shlibs, $1)=no
7861	    ;;
7862          *)
7863	    # FIXME: insert proper C++ library support
7864	    _LT_TAGVAR(ld_shlibs, $1)=no
7865	    ;;
7866        esac
7867        ;;
7868
7869      vxworks*)
7870        # FIXME: insert proper C++ library support
7871        _LT_TAGVAR(ld_shlibs, $1)=no
7872        ;;
7873
7874      *)
7875        # FIXME: insert proper C++ library support
7876        _LT_TAGVAR(ld_shlibs, $1)=no
7877        ;;
7878    esac
7879
7880    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7881    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7882
7883    _LT_TAGVAR(GCC, $1)="$GXX"
7884    _LT_TAGVAR(LD, $1)="$LD"
7885
7886    ## CAVEAT EMPTOR:
7887    ## There is no encapsulation within the following macros, do not change
7888    ## the running order or otherwise move them around unless you know exactly
7889    ## what you are doing...
7890    _LT_SYS_HIDDEN_LIBDEPS($1)
7891    _LT_COMPILER_PIC($1)
7892    _LT_COMPILER_C_O($1)
7893    _LT_COMPILER_FILE_LOCKS($1)
7894    _LT_LINKER_SHLIBS($1)
7895    _LT_SYS_DYNAMIC_LINKER($1)
7896    _LT_LINKER_HARDCODE_LIBPATH($1)
7897
7898    _LT_CONFIG($1)
7899  fi # test -n "$compiler"
7900
7901  CC=$lt_save_CC
7902  CFLAGS=$lt_save_CFLAGS
7903  LDCXX=$LD
7904  LD=$lt_save_LD
7905  GCC=$lt_save_GCC
7906  with_gnu_ld=$lt_save_with_gnu_ld
7907  lt_cv_path_LDCXX=$lt_cv_path_LD
7908  lt_cv_path_LD=$lt_save_path_LD
7909  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7910  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7911fi # test "$_lt_caught_CXX_error" != yes
7912
7913AC_LANG_POP
7914])# _LT_LANG_CXX_CONFIG
7915
7916
7917# _LT_FUNC_STRIPNAME_CNF
7918# ----------------------
7919# func_stripname_cnf prefix suffix name
7920# strip PREFIX and SUFFIX off of NAME.
7921# PREFIX and SUFFIX must not contain globbing or regex special
7922# characters, hashes, percent signs, but SUFFIX may contain a leading
7923# dot (in which case that matches only a dot).
7924#
7925# This function is identical to the (non-XSI) version of func_stripname,
7926# except this one can be used by m4 code that may be executed by configure,
7927# rather than the libtool script.
7928m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7929AC_REQUIRE([_LT_DECL_SED])
7930AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7931func_stripname_cnf ()
7932{
7933  case ${2} in
7934  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7935  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7936  esac
7937} # func_stripname_cnf
7938])# _LT_FUNC_STRIPNAME_CNF
7939
7940# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7941# ---------------------------------
7942# Figure out "hidden" library dependencies from verbose
7943# compiler output when linking a shared library.
7944# Parse the compiler output and extract the necessary
7945# objects, libraries and library flags.
7946m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7947[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7948AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7949# Dependencies to place before and after the object being linked:
7950_LT_TAGVAR(predep_objects, $1)=
7951_LT_TAGVAR(postdep_objects, $1)=
7952_LT_TAGVAR(predeps, $1)=
7953_LT_TAGVAR(postdeps, $1)=
7954_LT_TAGVAR(compiler_lib_search_path, $1)=
7955
7956dnl we can't use the lt_simple_compile_test_code here,
7957dnl because it contains code intended for an executable,
7958dnl not a library.  It's possible we should let each
7959dnl tag define a new lt_????_link_test_code variable,
7960dnl but it's only used here...
7961m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7962int a;
7963void foo (void) { a = 0; }
7964_LT_EOF
7965], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7966class Foo
7967{
7968public:
7969  Foo (void) { a = 0; }
7970private:
7971  int a;
7972};
7973_LT_EOF
7974], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7975      subroutine foo
7976      implicit none
7977      integer*4 a
7978      a=0
7979      return
7980      end
7981_LT_EOF
7982], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7983      subroutine foo
7984      implicit none
7985      integer a
7986      a=0
7987      return
7988      end
7989_LT_EOF
7990], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7991public class foo {
7992  private int a;
7993  public void bar (void) {
7994    a = 0;
7995  }
7996};
7997_LT_EOF
7998], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7999package foo
8000func foo() {
8001}
8002_LT_EOF
8003])
8004
8005_lt_libdeps_save_CFLAGS=$CFLAGS
8006case "$CC $CFLAGS " in #(
8007*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8008*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8009*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8010esac
8011
8012dnl Parse the compiler output and extract the necessary
8013dnl objects, libraries and library flags.
8014if AC_TRY_EVAL(ac_compile); then
8015  # Parse the compiler output and extract the necessary
8016  # objects, libraries and library flags.
8017
8018  # Sentinel used to keep track of whether or not we are before
8019  # the conftest object file.
8020  pre_test_object_deps_done=no
8021
8022  for p in `eval "$output_verbose_link_cmd"`; do
8023    case ${prev}${p} in
8024
8025    -L* | -R* | -l*)
8026       # Some compilers place space between "-{L,R}" and the path.
8027       # Remove the space.
8028       if test $p = "-L" ||
8029          test $p = "-R"; then
8030	 prev=$p
8031	 continue
8032       fi
8033
8034       # Expand the sysroot to ease extracting the directories later.
8035       if test -z "$prev"; then
8036         case $p in
8037         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8038         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8039         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8040         esac
8041       fi
8042       case $p in
8043       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8044       esac
8045       if test "$pre_test_object_deps_done" = no; then
8046	 case ${prev} in
8047	 -L | -R)
8048	   # Internal compiler library paths should come after those
8049	   # provided the user.  The postdeps already come after the
8050	   # user supplied libs so there is no need to process them.
8051	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8052	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8053	   else
8054	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8055	   fi
8056	   ;;
8057	 # The "-l" case would never come before the object being
8058	 # linked, so don't bother handling this case.
8059	 esac
8060       else
8061	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8062	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8063	 else
8064	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8065	 fi
8066       fi
8067       prev=
8068       ;;
8069
8070    *.lto.$objext) ;; # Ignore GCC LTO objects
8071    *.$objext)
8072       # This assumes that the test object file only shows up
8073       # once in the compiler output.
8074       if test "$p" = "conftest.$objext"; then
8075	 pre_test_object_deps_done=yes
8076	 continue
8077       fi
8078
8079       if test "$pre_test_object_deps_done" = no; then
8080	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8081	   _LT_TAGVAR(predep_objects, $1)="$p"
8082	 else
8083	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8084	 fi
8085       else
8086	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8087	   _LT_TAGVAR(postdep_objects, $1)="$p"
8088	 else
8089	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8090	 fi
8091       fi
8092       ;;
8093
8094    *) ;; # Ignore the rest.
8095
8096    esac
8097  done
8098
8099  # Clean up.
8100  rm -f a.out a.exe
8101else
8102  echo "libtool.m4: error: problem compiling $1 test program"
8103fi
8104
8105$RM -f confest.$objext
8106CFLAGS=$_lt_libdeps_save_CFLAGS
8107
8108# PORTME: override above test on systems where it is broken
8109m4_if([$1], [CXX],
8110[case $host_os in
8111interix[[3-9]]*)
8112  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8113  # hack all around it, let's just trust "g++" to DTRT.
8114  _LT_TAGVAR(predep_objects,$1)=
8115  _LT_TAGVAR(postdep_objects,$1)=
8116  _LT_TAGVAR(postdeps,$1)=
8117  ;;
8118
8119linux*)
8120  case `$CC -V 2>&1 | sed 5q` in
8121  *Sun\ C*)
8122    # Sun C++ 5.9
8123
8124    # The more standards-conforming stlport4 library is
8125    # incompatible with the Cstd library. Avoid specifying
8126    # it if it's in CXXFLAGS. Ignore libCrun as
8127    # -library=stlport4 depends on it.
8128    case " $CXX $CXXFLAGS " in
8129    *" -library=stlport4 "*)
8130      solaris_use_stlport4=yes
8131      ;;
8132    esac
8133
8134    if test "$solaris_use_stlport4" != yes; then
8135      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8136    fi
8137    ;;
8138  esac
8139  ;;
8140
8141solaris*)
8142  case $cc_basename in
8143  CC* | sunCC*)
8144    # The more standards-conforming stlport4 library is
8145    # incompatible with the Cstd library. Avoid specifying
8146    # it if it's in CXXFLAGS. Ignore libCrun as
8147    # -library=stlport4 depends on it.
8148    case " $CXX $CXXFLAGS " in
8149    *" -library=stlport4 "*)
8150      solaris_use_stlport4=yes
8151      ;;
8152    esac
8153
8154    # Adding this requires a known-good setup of shared libraries for
8155    # Sun compiler versions before 5.6, else PIC objects from an old
8156    # archive will be linked into the output, leading to subtle bugs.
8157    if test "$solaris_use_stlport4" != yes; then
8158      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8159    fi
8160    ;;
8161  esac
8162  ;;
8163esac
8164])
8165
8166case " $_LT_TAGVAR(postdeps, $1) " in
8167*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8168esac
8169 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8170if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8171 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8172fi
8173_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8174    [The directories searched by this compiler when creating a shared library])
8175_LT_TAGDECL([], [predep_objects], [1],
8176    [Dependencies to place before and after the objects being linked to
8177    create a shared library])
8178_LT_TAGDECL([], [postdep_objects], [1])
8179_LT_TAGDECL([], [predeps], [1])
8180_LT_TAGDECL([], [postdeps], [1])
8181_LT_TAGDECL([], [compiler_lib_search_path], [1],
8182    [The library search path used internally by the compiler when linking
8183    a shared library])
8184])# _LT_SYS_HIDDEN_LIBDEPS
8185
8186
8187# _LT_LANG_F77_CONFIG([TAG])
8188# --------------------------
8189# Ensure that the configuration variables for a Fortran 77 compiler are
8190# suitably defined.  These variables are subsequently used by _LT_CONFIG
8191# to write the compiler configuration to `libtool'.
8192m4_defun([_LT_LANG_F77_CONFIG],
8193[AC_LANG_PUSH(Fortran 77)
8194if test -z "$F77" || test "X$F77" = "Xno"; then
8195  _lt_disable_F77=yes
8196fi
8197
8198_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8199_LT_TAGVAR(allow_undefined_flag, $1)=
8200_LT_TAGVAR(always_export_symbols, $1)=no
8201_LT_TAGVAR(archive_expsym_cmds, $1)=
8202_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8203_LT_TAGVAR(hardcode_direct, $1)=no
8204_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8205_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8206_LT_TAGVAR(hardcode_libdir_separator, $1)=
8207_LT_TAGVAR(hardcode_minus_L, $1)=no
8208_LT_TAGVAR(hardcode_automatic, $1)=no
8209_LT_TAGVAR(inherit_rpath, $1)=no
8210_LT_TAGVAR(module_cmds, $1)=
8211_LT_TAGVAR(module_expsym_cmds, $1)=
8212_LT_TAGVAR(link_all_deplibs, $1)=unknown
8213_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8214_LT_TAGVAR(reload_flag, $1)=$reload_flag
8215_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8216_LT_TAGVAR(no_undefined_flag, $1)=
8217_LT_TAGVAR(whole_archive_flag_spec, $1)=
8218_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8219
8220# Source file extension for f77 test sources.
8221ac_ext=f
8222
8223# Object file extension for compiled f77 test sources.
8224objext=o
8225_LT_TAGVAR(objext, $1)=$objext
8226
8227# No sense in running all these tests if we already determined that
8228# the F77 compiler isn't working.  Some variables (like enable_shared)
8229# are currently assumed to apply to all compilers on this platform,
8230# and will be corrupted by setting them based on a non-working compiler.
8231if test "$_lt_disable_F77" != yes; then
8232  # Code to be used in simple compile tests
8233  lt_simple_compile_test_code="\
8234      subroutine t
8235      return
8236      end
8237"
8238
8239  # Code to be used in simple link tests
8240  lt_simple_link_test_code="\
8241      program t
8242      end
8243"
8244
8245  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8246  _LT_TAG_COMPILER
8247
8248  # save warnings/boilerplate of simple test code
8249  _LT_COMPILER_BOILERPLATE
8250  _LT_LINKER_BOILERPLATE
8251
8252  # Allow CC to be a program name with arguments.
8253  lt_save_CC="$CC"
8254  lt_save_GCC=$GCC
8255  lt_save_CFLAGS=$CFLAGS
8256  CC=${F77-"f77"}
8257  CFLAGS=$FFLAGS
8258  compiler=$CC
8259  _LT_TAGVAR(compiler, $1)=$CC
8260  _LT_CC_BASENAME([$compiler])
8261  GCC=$G77
8262  if test -n "$compiler"; then
8263    AC_MSG_CHECKING([if libtool supports shared libraries])
8264    AC_MSG_RESULT([$can_build_shared])
8265
8266    AC_MSG_CHECKING([whether to build shared libraries])
8267    test "$can_build_shared" = "no" && enable_shared=no
8268
8269    # On AIX, shared libraries and static libraries use the same namespace, and
8270    # are all built from PIC.
8271    case $host_os in
8272      aix3*)
8273        test "$enable_shared" = yes && enable_static=no
8274        if test -n "$RANLIB"; then
8275          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8276          postinstall_cmds='$RANLIB $lib'
8277        fi
8278        ;;
8279      aix[[4-9]]*)
8280	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8281	  test "$enable_shared" = yes && enable_static=no
8282	fi
8283        ;;
8284    esac
8285    AC_MSG_RESULT([$enable_shared])
8286
8287    AC_MSG_CHECKING([whether to build static libraries])
8288    # Make sure either enable_shared or enable_static is yes.
8289    test "$enable_shared" = yes || enable_static=yes
8290    AC_MSG_RESULT([$enable_static])
8291
8292    _LT_TAGVAR(GCC, $1)="$G77"
8293    _LT_TAGVAR(LD, $1)="$LD"
8294
8295    ## CAVEAT EMPTOR:
8296    ## There is no encapsulation within the following macros, do not change
8297    ## the running order or otherwise move them around unless you know exactly
8298    ## what you are doing...
8299    _LT_COMPILER_PIC($1)
8300    _LT_COMPILER_C_O($1)
8301    _LT_COMPILER_FILE_LOCKS($1)
8302    _LT_LINKER_SHLIBS($1)
8303    _LT_SYS_DYNAMIC_LINKER($1)
8304    _LT_LINKER_HARDCODE_LIBPATH($1)
8305
8306    _LT_CONFIG($1)
8307  fi # test -n "$compiler"
8308
8309  GCC=$lt_save_GCC
8310  CC="$lt_save_CC"
8311  CFLAGS="$lt_save_CFLAGS"
8312fi # test "$_lt_disable_F77" != yes
8313
8314AC_LANG_POP
8315])# _LT_LANG_F77_CONFIG
8316
8317
8318# _LT_LANG_FC_CONFIG([TAG])
8319# -------------------------
8320# Ensure that the configuration variables for a Fortran compiler are
8321# suitably defined.  These variables are subsequently used by _LT_CONFIG
8322# to write the compiler configuration to `libtool'.
8323m4_defun([_LT_LANG_FC_CONFIG],
8324[AC_LANG_PUSH(Fortran)
8325
8326if test -z "$FC" || test "X$FC" = "Xno"; then
8327  _lt_disable_FC=yes
8328fi
8329
8330_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8331_LT_TAGVAR(allow_undefined_flag, $1)=
8332_LT_TAGVAR(always_export_symbols, $1)=no
8333_LT_TAGVAR(archive_expsym_cmds, $1)=
8334_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8335_LT_TAGVAR(hardcode_direct, $1)=no
8336_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8337_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8338_LT_TAGVAR(hardcode_libdir_separator, $1)=
8339_LT_TAGVAR(hardcode_minus_L, $1)=no
8340_LT_TAGVAR(hardcode_automatic, $1)=no
8341_LT_TAGVAR(inherit_rpath, $1)=no
8342_LT_TAGVAR(module_cmds, $1)=
8343_LT_TAGVAR(module_expsym_cmds, $1)=
8344_LT_TAGVAR(link_all_deplibs, $1)=unknown
8345_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8346_LT_TAGVAR(reload_flag, $1)=$reload_flag
8347_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8348_LT_TAGVAR(no_undefined_flag, $1)=
8349_LT_TAGVAR(whole_archive_flag_spec, $1)=
8350_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8351
8352# Source file extension for fc test sources.
8353ac_ext=${ac_fc_srcext-f}
8354
8355# Object file extension for compiled fc test sources.
8356objext=o
8357_LT_TAGVAR(objext, $1)=$objext
8358
8359# No sense in running all these tests if we already determined that
8360# the FC compiler isn't working.  Some variables (like enable_shared)
8361# are currently assumed to apply to all compilers on this platform,
8362# and will be corrupted by setting them based on a non-working compiler.
8363if test "$_lt_disable_FC" != yes; then
8364  # Code to be used in simple compile tests
8365  lt_simple_compile_test_code="\
8366      subroutine t
8367      return
8368      end
8369"
8370
8371  # Code to be used in simple link tests
8372  lt_simple_link_test_code="\
8373      program t
8374      end
8375"
8376
8377  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8378  _LT_TAG_COMPILER
8379
8380  # save warnings/boilerplate of simple test code
8381  _LT_COMPILER_BOILERPLATE
8382  _LT_LINKER_BOILERPLATE
8383
8384  # Allow CC to be a program name with arguments.
8385  lt_save_CC="$CC"
8386  lt_save_GCC=$GCC
8387  lt_save_CFLAGS=$CFLAGS
8388  CC=${FC-"f95"}
8389  CFLAGS=$FCFLAGS
8390  compiler=$CC
8391  GCC=$ac_cv_fc_compiler_gnu
8392
8393  _LT_TAGVAR(compiler, $1)=$CC
8394  _LT_CC_BASENAME([$compiler])
8395
8396  if test -n "$compiler"; then
8397    AC_MSG_CHECKING([if libtool supports shared libraries])
8398    AC_MSG_RESULT([$can_build_shared])
8399
8400    AC_MSG_CHECKING([whether to build shared libraries])
8401    test "$can_build_shared" = "no" && enable_shared=no
8402
8403    # On AIX, shared libraries and static libraries use the same namespace, and
8404    # are all built from PIC.
8405    case $host_os in
8406      aix3*)
8407        test "$enable_shared" = yes && enable_static=no
8408        if test -n "$RANLIB"; then
8409          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8410          postinstall_cmds='$RANLIB $lib'
8411        fi
8412        ;;
8413      aix[[4-9]]*)
8414	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8415	  test "$enable_shared" = yes && enable_static=no
8416	fi
8417        ;;
8418    esac
8419    AC_MSG_RESULT([$enable_shared])
8420
8421    AC_MSG_CHECKING([whether to build static libraries])
8422    # Make sure either enable_shared or enable_static is yes.
8423    test "$enable_shared" = yes || enable_static=yes
8424    AC_MSG_RESULT([$enable_static])
8425
8426    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8427    _LT_TAGVAR(LD, $1)="$LD"
8428
8429    ## CAVEAT EMPTOR:
8430    ## There is no encapsulation within the following macros, do not change
8431    ## the running order or otherwise move them around unless you know exactly
8432    ## what you are doing...
8433    _LT_SYS_HIDDEN_LIBDEPS($1)
8434    _LT_COMPILER_PIC($1)
8435    _LT_COMPILER_C_O($1)
8436    _LT_COMPILER_FILE_LOCKS($1)
8437    _LT_LINKER_SHLIBS($1)
8438    _LT_SYS_DYNAMIC_LINKER($1)
8439    _LT_LINKER_HARDCODE_LIBPATH($1)
8440
8441    _LT_CONFIG($1)
8442  fi # test -n "$compiler"
8443
8444  GCC=$lt_save_GCC
8445  CC=$lt_save_CC
8446  CFLAGS=$lt_save_CFLAGS
8447fi # test "$_lt_disable_FC" != yes
8448
8449AC_LANG_POP
8450])# _LT_LANG_FC_CONFIG
8451
8452
8453# _LT_LANG_GCJ_CONFIG([TAG])
8454# --------------------------
8455# Ensure that the configuration variables for the GNU Java Compiler compiler
8456# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8457# to write the compiler configuration to `libtool'.
8458m4_defun([_LT_LANG_GCJ_CONFIG],
8459[AC_REQUIRE([LT_PROG_GCJ])dnl
8460AC_LANG_SAVE
8461
8462# Source file extension for Java test sources.
8463ac_ext=java
8464
8465# Object file extension for compiled Java test sources.
8466objext=o
8467_LT_TAGVAR(objext, $1)=$objext
8468
8469# Code to be used in simple compile tests
8470lt_simple_compile_test_code="class foo {}"
8471
8472# Code to be used in simple link tests
8473lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8474
8475# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8476_LT_TAG_COMPILER
8477
8478# save warnings/boilerplate of simple test code
8479_LT_COMPILER_BOILERPLATE
8480_LT_LINKER_BOILERPLATE
8481
8482# Allow CC to be a program name with arguments.
8483lt_save_CC=$CC
8484lt_save_CFLAGS=$CFLAGS
8485lt_save_GCC=$GCC
8486GCC=yes
8487CC=${GCJ-"gcj"}
8488CFLAGS=$GCJFLAGS
8489compiler=$CC
8490_LT_TAGVAR(compiler, $1)=$CC
8491_LT_TAGVAR(LD, $1)="$LD"
8492_LT_CC_BASENAME([$compiler])
8493
8494# GCJ did not exist at the time GCC didn't implicitly link libc in.
8495_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8496
8497_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8498_LT_TAGVAR(reload_flag, $1)=$reload_flag
8499_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8500
8501if test -n "$compiler"; then
8502  _LT_COMPILER_NO_RTTI($1)
8503  _LT_COMPILER_PIC($1)
8504  _LT_COMPILER_C_O($1)
8505  _LT_COMPILER_FILE_LOCKS($1)
8506  _LT_LINKER_SHLIBS($1)
8507  _LT_LINKER_HARDCODE_LIBPATH($1)
8508
8509  _LT_CONFIG($1)
8510fi
8511
8512AC_LANG_RESTORE
8513
8514GCC=$lt_save_GCC
8515CC=$lt_save_CC
8516CFLAGS=$lt_save_CFLAGS
8517])# _LT_LANG_GCJ_CONFIG
8518
8519
8520# _LT_LANG_GO_CONFIG([TAG])
8521# --------------------------
8522# Ensure that the configuration variables for the GNU Go compiler
8523# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8524# to write the compiler configuration to `libtool'.
8525m4_defun([_LT_LANG_GO_CONFIG],
8526[AC_REQUIRE([LT_PROG_GO])dnl
8527AC_LANG_SAVE
8528
8529# Source file extension for Go test sources.
8530ac_ext=go
8531
8532# Object file extension for compiled Go test sources.
8533objext=o
8534_LT_TAGVAR(objext, $1)=$objext
8535
8536# Code to be used in simple compile tests
8537lt_simple_compile_test_code="package main; func main() { }"
8538
8539# Code to be used in simple link tests
8540lt_simple_link_test_code='package main; func main() { }'
8541
8542# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8543_LT_TAG_COMPILER
8544
8545# save warnings/boilerplate of simple test code
8546_LT_COMPILER_BOILERPLATE
8547_LT_LINKER_BOILERPLATE
8548
8549# Allow CC to be a program name with arguments.
8550lt_save_CC=$CC
8551lt_save_CFLAGS=$CFLAGS
8552lt_save_GCC=$GCC
8553GCC=yes
8554CC=${GOC-"gccgo"}
8555CFLAGS=$GOFLAGS
8556compiler=$CC
8557_LT_TAGVAR(compiler, $1)=$CC
8558_LT_TAGVAR(LD, $1)="$LD"
8559_LT_CC_BASENAME([$compiler])
8560
8561# Go did not exist at the time GCC didn't implicitly link libc in.
8562_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8563
8564_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8565_LT_TAGVAR(reload_flag, $1)=$reload_flag
8566_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8567
8568if test -n "$compiler"; then
8569  _LT_COMPILER_NO_RTTI($1)
8570  _LT_COMPILER_PIC($1)
8571  _LT_COMPILER_C_O($1)
8572  _LT_COMPILER_FILE_LOCKS($1)
8573  _LT_LINKER_SHLIBS($1)
8574  _LT_LINKER_HARDCODE_LIBPATH($1)
8575
8576  _LT_CONFIG($1)
8577fi
8578
8579AC_LANG_RESTORE
8580
8581GCC=$lt_save_GCC
8582CC=$lt_save_CC
8583CFLAGS=$lt_save_CFLAGS
8584])# _LT_LANG_GO_CONFIG
8585
8586
8587# _LT_LANG_RC_CONFIG([TAG])
8588# -------------------------
8589# Ensure that the configuration variables for the Windows resource compiler
8590# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8591# to write the compiler configuration to `libtool'.
8592m4_defun([_LT_LANG_RC_CONFIG],
8593[AC_REQUIRE([LT_PROG_RC])dnl
8594AC_LANG_SAVE
8595
8596# Source file extension for RC test sources.
8597ac_ext=rc
8598
8599# Object file extension for compiled RC test sources.
8600objext=o
8601_LT_TAGVAR(objext, $1)=$objext
8602
8603# Code to be used in simple compile tests
8604lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8605
8606# Code to be used in simple link tests
8607lt_simple_link_test_code="$lt_simple_compile_test_code"
8608
8609# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8610_LT_TAG_COMPILER
8611
8612# save warnings/boilerplate of simple test code
8613_LT_COMPILER_BOILERPLATE
8614_LT_LINKER_BOILERPLATE
8615
8616# Allow CC to be a program name with arguments.
8617lt_save_CC="$CC"
8618lt_save_CFLAGS=$CFLAGS
8619lt_save_GCC=$GCC
8620GCC=
8621CC=${RC-"windres"}
8622CFLAGS=
8623compiler=$CC
8624_LT_TAGVAR(compiler, $1)=$CC
8625_LT_CC_BASENAME([$compiler])
8626_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8627
8628if test -n "$compiler"; then
8629  :
8630  _LT_CONFIG($1)
8631fi
8632
8633GCC=$lt_save_GCC
8634AC_LANG_RESTORE
8635CC=$lt_save_CC
8636CFLAGS=$lt_save_CFLAGS
8637])# _LT_LANG_RC_CONFIG
8638
8639
8640# LT_PROG_GCJ
8641# -----------
8642AC_DEFUN([LT_PROG_GCJ],
8643[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8644  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8645    [AC_CHECK_TOOL(GCJ, gcj,)
8646      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8647      AC_SUBST(GCJFLAGS)])])[]dnl
8648])
8649
8650# Old name:
8651AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8652dnl aclocal-1.4 backwards compatibility:
8653dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8654
8655
8656# LT_PROG_GO
8657# ----------
8658AC_DEFUN([LT_PROG_GO],
8659[AC_CHECK_TOOL(GOC, gccgo,)
8660])
8661
8662
8663# LT_PROG_RC
8664# ----------
8665AC_DEFUN([LT_PROG_RC],
8666[AC_CHECK_TOOL(RC, windres,)
8667])
8668
8669# Old name:
8670AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8671dnl aclocal-1.4 backwards compatibility:
8672dnl AC_DEFUN([LT_AC_PROG_RC], [])
8673
8674
8675# _LT_DECL_EGREP
8676# --------------
8677# If we don't have a new enough Autoconf to choose the best grep
8678# available, choose the one first in the user's PATH.
8679m4_defun([_LT_DECL_EGREP],
8680[AC_REQUIRE([AC_PROG_EGREP])dnl
8681AC_REQUIRE([AC_PROG_FGREP])dnl
8682test -z "$GREP" && GREP=grep
8683_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8684_LT_DECL([], [EGREP], [1], [An ERE matcher])
8685_LT_DECL([], [FGREP], [1], [A literal string matcher])
8686dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8687AC_SUBST([GREP])
8688])
8689
8690
8691# _LT_DECL_OBJDUMP
8692# --------------
8693# If we don't have a new enough Autoconf to choose the best objdump
8694# available, choose the one first in the user's PATH.
8695m4_defun([_LT_DECL_OBJDUMP],
8696[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8697test -z "$OBJDUMP" && OBJDUMP=objdump
8698_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8699AC_SUBST([OBJDUMP])
8700])
8701
8702# _LT_DECL_DLLTOOL
8703# ----------------
8704# Ensure DLLTOOL variable is set.
8705m4_defun([_LT_DECL_DLLTOOL],
8706[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8707test -z "$DLLTOOL" && DLLTOOL=dlltool
8708_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8709AC_SUBST([DLLTOOL])
8710])
8711
8712# _LT_DECL_SED
8713# ------------
8714# Check for a fully-functional sed program, that truncates
8715# as few characters as possible.  Prefer GNU sed if found.
8716m4_defun([_LT_DECL_SED],
8717[AC_PROG_SED
8718test -z "$SED" && SED=sed
8719Xsed="$SED -e 1s/^X//"
8720_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8721_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8722    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8723])# _LT_DECL_SED
8724
8725m4_ifndef([AC_PROG_SED], [
8726# NOTE: This macro has been submitted for inclusion into   #
8727#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8728#  a released version of Autoconf we should remove this    #
8729#  macro and use it instead.                               #
8730
8731m4_defun([AC_PROG_SED],
8732[AC_MSG_CHECKING([for a sed that does not truncate output])
8733AC_CACHE_VAL(lt_cv_path_SED,
8734[# Loop through the user's path and test for sed and gsed.
8735# Then use that list of sed's as ones to test for truncation.
8736as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8737for as_dir in $PATH
8738do
8739  IFS=$as_save_IFS
8740  test -z "$as_dir" && as_dir=.
8741  for lt_ac_prog in sed gsed; do
8742    for ac_exec_ext in '' $ac_executable_extensions; do
8743      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8744        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8745      fi
8746    done
8747  done
8748done
8749IFS=$as_save_IFS
8750lt_ac_max=0
8751lt_ac_count=0
8752# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8753# along with /bin/sed that truncates output.
8754for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8755  test ! -f $lt_ac_sed && continue
8756  cat /dev/null > conftest.in
8757  lt_ac_count=0
8758  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8759  # Check for GNU sed and select it if it is found.
8760  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8761    lt_cv_path_SED=$lt_ac_sed
8762    break
8763  fi
8764  while true; do
8765    cat conftest.in conftest.in >conftest.tmp
8766    mv conftest.tmp conftest.in
8767    cp conftest.in conftest.nl
8768    echo >>conftest.nl
8769    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8770    cmp -s conftest.out conftest.nl || break
8771    # 10000 chars as input seems more than enough
8772    test $lt_ac_count -gt 10 && break
8773    lt_ac_count=`expr $lt_ac_count + 1`
8774    if test $lt_ac_count -gt $lt_ac_max; then
8775      lt_ac_max=$lt_ac_count
8776      lt_cv_path_SED=$lt_ac_sed
8777    fi
8778  done
8779done
8780])
8781SED=$lt_cv_path_SED
8782AC_SUBST([SED])
8783AC_MSG_RESULT([$SED])
8784])#AC_PROG_SED
8785])#m4_ifndef
8786
8787# Old name:
8788AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8789dnl aclocal-1.4 backwards compatibility:
8790dnl AC_DEFUN([LT_AC_PROG_SED], [])
8791
8792
8793# _LT_CHECK_SHELL_FEATURES
8794# ------------------------
8795# Find out whether the shell is Bourne or XSI compatible,
8796# or has some other useful features.
8797m4_defun([_LT_CHECK_SHELL_FEATURES],
8798[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8799# Try some XSI features
8800xsi_shell=no
8801( _lt_dummy="a/b/c"
8802  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8803      = c,a/b,b/c, \
8804    && eval 'test $(( 1 + 1 )) -eq 2 \
8805    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8806  && xsi_shell=yes
8807AC_MSG_RESULT([$xsi_shell])
8808_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8809
8810AC_MSG_CHECKING([whether the shell understands "+="])
8811lt_shell_append=no
8812( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8813    >/dev/null 2>&1 \
8814  && lt_shell_append=yes
8815AC_MSG_RESULT([$lt_shell_append])
8816_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8817
8818if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8819  lt_unset=unset
8820else
8821  lt_unset=false
8822fi
8823_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8824
8825# test EBCDIC or ASCII
8826case `echo X|tr X '\101'` in
8827 A) # ASCII based system
8828    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8829  lt_SP2NL='tr \040 \012'
8830  lt_NL2SP='tr \015\012 \040\040'
8831  ;;
8832 *) # EBCDIC based system
8833  lt_SP2NL='tr \100 \n'
8834  lt_NL2SP='tr \r\n \100\100'
8835  ;;
8836esac
8837_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8838_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8839])# _LT_CHECK_SHELL_FEATURES
8840
8841
8842# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8843# ------------------------------------------------------
8844# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8845# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8846m4_defun([_LT_PROG_FUNCTION_REPLACE],
8847[dnl {
8848sed -e '/^$1 ()$/,/^} # $1 /c\
8849$1 ()\
8850{\
8851m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8852} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8853  && mv -f "$cfgfile.tmp" "$cfgfile" \
8854    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8855test 0 -eq $? || _lt_function_replace_fail=:
8856])
8857
8858
8859# _LT_PROG_REPLACE_SHELLFNS
8860# -------------------------
8861# Replace existing portable implementations of several shell functions with
8862# equivalent extended shell implementations where those features are available..
8863m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8864[if test x"$xsi_shell" = xyes; then
8865  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8866    case ${1} in
8867      */*) func_dirname_result="${1%/*}${2}" ;;
8868      *  ) func_dirname_result="${3}" ;;
8869    esac])
8870
8871  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8872    func_basename_result="${1##*/}"])
8873
8874  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8875    case ${1} in
8876      */*) func_dirname_result="${1%/*}${2}" ;;
8877      *  ) func_dirname_result="${3}" ;;
8878    esac
8879    func_basename_result="${1##*/}"])
8880
8881  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8882    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8883    # positional parameters, so assign one to ordinary parameter first.
8884    func_stripname_result=${3}
8885    func_stripname_result=${func_stripname_result#"${1}"}
8886    func_stripname_result=${func_stripname_result%"${2}"}])
8887
8888  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8889    func_split_long_opt_name=${1%%=*}
8890    func_split_long_opt_arg=${1#*=}])
8891
8892  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8893    func_split_short_opt_arg=${1#??}
8894    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8895
8896  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8897    case ${1} in
8898      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8899      *)    func_lo2o_result=${1} ;;
8900    esac])
8901
8902  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8903
8904  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8905
8906  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8907fi
8908
8909if test x"$lt_shell_append" = xyes; then
8910  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8911
8912  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8913    func_quote_for_eval "${2}"
8914dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8915    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8916
8917  # Save a `func_append' function call where possible by direct use of '+='
8918  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8919    && mv -f "$cfgfile.tmp" "$cfgfile" \
8920      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8921  test 0 -eq $? || _lt_function_replace_fail=:
8922else
8923  # Save a `func_append' function call even when '+=' is not available
8924  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8925    && mv -f "$cfgfile.tmp" "$cfgfile" \
8926      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8927  test 0 -eq $? || _lt_function_replace_fail=:
8928fi
8929
8930if test x"$_lt_function_replace_fail" = x":"; then
8931  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8932fi
8933])
8934
8935# _LT_PATH_CONVERSION_FUNCTIONS
8936# -----------------------------
8937# Determine which file name conversion functions should be used by
8938# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8939# for certain cross-compile configurations and native mingw.
8940m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8941[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8942AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8943AC_MSG_CHECKING([how to convert $build file names to $host format])
8944AC_CACHE_VAL(lt_cv_to_host_file_cmd,
8945[case $host in
8946  *-*-mingw* )
8947    case $build in
8948      *-*-mingw* ) # actually msys
8949        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8950        ;;
8951      *-*-cygwin* )
8952        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8953        ;;
8954      * ) # otherwise, assume *nix
8955        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8956        ;;
8957    esac
8958    ;;
8959  *-*-cygwin* )
8960    case $build in
8961      *-*-mingw* ) # actually msys
8962        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8963        ;;
8964      *-*-cygwin* )
8965        lt_cv_to_host_file_cmd=func_convert_file_noop
8966        ;;
8967      * ) # otherwise, assume *nix
8968        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8969        ;;
8970    esac
8971    ;;
8972  * ) # unhandled hosts (and "normal" native builds)
8973    lt_cv_to_host_file_cmd=func_convert_file_noop
8974    ;;
8975esac
8976])
8977to_host_file_cmd=$lt_cv_to_host_file_cmd
8978AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8979_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8980         [0], [convert $build file names to $host format])dnl
8981
8982AC_MSG_CHECKING([how to convert $build file names to toolchain format])
8983AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8984[#assume ordinary cross tools, or native build.
8985lt_cv_to_tool_file_cmd=func_convert_file_noop
8986case $host in
8987  *-*-mingw* )
8988    case $build in
8989      *-*-mingw* ) # actually msys
8990        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8991        ;;
8992    esac
8993    ;;
8994esac
8995])
8996to_tool_file_cmd=$lt_cv_to_tool_file_cmd
8997AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8998_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8999         [0], [convert $build files to toolchain format])dnl
9000])# _LT_PATH_CONVERSION_FUNCTIONS
9001
9002# Helper functions for option handling.                    -*- Autoconf -*-
9003#
9004#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9005#   Inc.
9006#   Written by Gary V. Vaughan, 2004
9007#
9008# This file is free software; the Free Software Foundation gives
9009# unlimited permission to copy and/or distribute it, with or without
9010# modifications, as long as this notice is preserved.
9011
9012# serial 7 ltoptions.m4
9013
9014# This is to help aclocal find these macros, as it can't see m4_define.
9015AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9016
9017
9018# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9019# ------------------------------------------
9020m4_define([_LT_MANGLE_OPTION],
9021[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9022
9023
9024# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9025# ---------------------------------------
9026# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9027# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9028# saved as a flag.
9029m4_define([_LT_SET_OPTION],
9030[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9031m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9032        _LT_MANGLE_DEFUN([$1], [$2]),
9033    [m4_warning([Unknown $1 option `$2'])])[]dnl
9034])
9035
9036
9037# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9038# ------------------------------------------------------------
9039# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9040m4_define([_LT_IF_OPTION],
9041[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9042
9043
9044# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9045# -------------------------------------------------------
9046# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9047# are set.
9048m4_define([_LT_UNLESS_OPTIONS],
9049[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9050	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9051		      [m4_define([$0_found])])])[]dnl
9052m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9053])[]dnl
9054])
9055
9056
9057# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9058# ----------------------------------------
9059# OPTION-LIST is a space-separated list of Libtool options associated
9060# with MACRO-NAME.  If any OPTION has a matching handler declared with
9061# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9062# the unknown option and exit.
9063m4_defun([_LT_SET_OPTIONS],
9064[# Set options
9065m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9066    [_LT_SET_OPTION([$1], _LT_Option)])
9067
9068m4_if([$1],[LT_INIT],[
9069  dnl
9070  dnl Simply set some default values (i.e off) if boolean options were not
9071  dnl specified:
9072  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9073  ])
9074  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9075  ])
9076  dnl
9077  dnl If no reference was made to various pairs of opposing options, then
9078  dnl we run the default mode handler for the pair.  For example, if neither
9079  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9080  dnl archives by default:
9081  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9082  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9083  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9084  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9085  		   [_LT_ENABLE_FAST_INSTALL])
9086  ])
9087])# _LT_SET_OPTIONS
9088
9089
9090
9091# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9092# -----------------------------------------
9093m4_define([_LT_MANGLE_DEFUN],
9094[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9095
9096
9097# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9098# -----------------------------------------------
9099m4_define([LT_OPTION_DEFINE],
9100[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9101])# LT_OPTION_DEFINE
9102
9103
9104# dlopen
9105# ------
9106LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9107])
9108
9109AU_DEFUN([AC_LIBTOOL_DLOPEN],
9110[_LT_SET_OPTION([LT_INIT], [dlopen])
9111AC_DIAGNOSE([obsolete],
9112[$0: Remove this warning and the call to _LT_SET_OPTION when you
9113put the `dlopen' option into LT_INIT's first parameter.])
9114])
9115
9116dnl aclocal-1.4 backwards compatibility:
9117dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9118
9119
9120# win32-dll
9121# ---------
9122# Declare package support for building win32 dll's.
9123LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9124[enable_win32_dll=yes
9125
9126case $host in
9127*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9128  AC_CHECK_TOOL(AS, as, false)
9129  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9130  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9131  ;;
9132esac
9133
9134test -z "$AS" && AS=as
9135_LT_DECL([], [AS],      [1], [Assembler program])dnl
9136
9137test -z "$DLLTOOL" && DLLTOOL=dlltool
9138_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9139
9140test -z "$OBJDUMP" && OBJDUMP=objdump
9141_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9142])# win32-dll
9143
9144AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9145[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9146_LT_SET_OPTION([LT_INIT], [win32-dll])
9147AC_DIAGNOSE([obsolete],
9148[$0: Remove this warning and the call to _LT_SET_OPTION when you
9149put the `win32-dll' option into LT_INIT's first parameter.])
9150])
9151
9152dnl aclocal-1.4 backwards compatibility:
9153dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9154
9155
9156# _LT_ENABLE_SHARED([DEFAULT])
9157# ----------------------------
9158# implement the --enable-shared flag, and supports the `shared' and
9159# `disable-shared' LT_INIT options.
9160# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9161m4_define([_LT_ENABLE_SHARED],
9162[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9163AC_ARG_ENABLE([shared],
9164    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9165	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9166    [p=${PACKAGE-default}
9167    case $enableval in
9168    yes) enable_shared=yes ;;
9169    no) enable_shared=no ;;
9170    *)
9171      enable_shared=no
9172      # Look at the argument we got.  We use all the common list separators.
9173      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9174      for pkg in $enableval; do
9175	IFS="$lt_save_ifs"
9176	if test "X$pkg" = "X$p"; then
9177	  enable_shared=yes
9178	fi
9179      done
9180      IFS="$lt_save_ifs"
9181      ;;
9182    esac],
9183    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9184
9185    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9186	[Whether or not to build shared libraries])
9187])# _LT_ENABLE_SHARED
9188
9189LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9190LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9191
9192# Old names:
9193AC_DEFUN([AC_ENABLE_SHARED],
9194[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9195])
9196
9197AC_DEFUN([AC_DISABLE_SHARED],
9198[_LT_SET_OPTION([LT_INIT], [disable-shared])
9199])
9200
9201AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9202AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9203
9204dnl aclocal-1.4 backwards compatibility:
9205dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9206dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9207
9208
9209
9210# _LT_ENABLE_STATIC([DEFAULT])
9211# ----------------------------
9212# implement the --enable-static flag, and support the `static' and
9213# `disable-static' LT_INIT options.
9214# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9215m4_define([_LT_ENABLE_STATIC],
9216[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9217AC_ARG_ENABLE([static],
9218    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9219	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9220    [p=${PACKAGE-default}
9221    case $enableval in
9222    yes) enable_static=yes ;;
9223    no) enable_static=no ;;
9224    *)
9225     enable_static=no
9226      # Look at the argument we got.  We use all the common list separators.
9227      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9228      for pkg in $enableval; do
9229	IFS="$lt_save_ifs"
9230	if test "X$pkg" = "X$p"; then
9231	  enable_static=yes
9232	fi
9233      done
9234      IFS="$lt_save_ifs"
9235      ;;
9236    esac],
9237    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9238
9239    _LT_DECL([build_old_libs], [enable_static], [0],
9240	[Whether or not to build static libraries])
9241])# _LT_ENABLE_STATIC
9242
9243LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9244LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9245
9246# Old names:
9247AC_DEFUN([AC_ENABLE_STATIC],
9248[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9249])
9250
9251AC_DEFUN([AC_DISABLE_STATIC],
9252[_LT_SET_OPTION([LT_INIT], [disable-static])
9253])
9254
9255AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9256AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9257
9258dnl aclocal-1.4 backwards compatibility:
9259dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9260dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9261
9262
9263
9264# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9265# ----------------------------------
9266# implement the --enable-fast-install flag, and support the `fast-install'
9267# and `disable-fast-install' LT_INIT options.
9268# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9269m4_define([_LT_ENABLE_FAST_INSTALL],
9270[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9271AC_ARG_ENABLE([fast-install],
9272    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9273    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9274    [p=${PACKAGE-default}
9275    case $enableval in
9276    yes) enable_fast_install=yes ;;
9277    no) enable_fast_install=no ;;
9278    *)
9279      enable_fast_install=no
9280      # Look at the argument we got.  We use all the common list separators.
9281      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9282      for pkg in $enableval; do
9283	IFS="$lt_save_ifs"
9284	if test "X$pkg" = "X$p"; then
9285	  enable_fast_install=yes
9286	fi
9287      done
9288      IFS="$lt_save_ifs"
9289      ;;
9290    esac],
9291    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9292
9293_LT_DECL([fast_install], [enable_fast_install], [0],
9294	 [Whether or not to optimize for fast installation])dnl
9295])# _LT_ENABLE_FAST_INSTALL
9296
9297LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9298LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9299
9300# Old names:
9301AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9302[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9303AC_DIAGNOSE([obsolete],
9304[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9305the `fast-install' option into LT_INIT's first parameter.])
9306])
9307
9308AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9309[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9310AC_DIAGNOSE([obsolete],
9311[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9312the `disable-fast-install' option into LT_INIT's first parameter.])
9313])
9314
9315dnl aclocal-1.4 backwards compatibility:
9316dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9317dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9318
9319
9320# _LT_WITH_PIC([MODE])
9321# --------------------
9322# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9323# LT_INIT options.
9324# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9325m4_define([_LT_WITH_PIC],
9326[AC_ARG_WITH([pic],
9327    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9328	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9329    [lt_p=${PACKAGE-default}
9330    case $withval in
9331    yes|no) pic_mode=$withval ;;
9332    *)
9333      pic_mode=default
9334      # Look at the argument we got.  We use all the common list separators.
9335      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9336      for lt_pkg in $withval; do
9337	IFS="$lt_save_ifs"
9338	if test "X$lt_pkg" = "X$lt_p"; then
9339	  pic_mode=yes
9340	fi
9341      done
9342      IFS="$lt_save_ifs"
9343      ;;
9344    esac],
9345    [pic_mode=default])
9346
9347test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9348
9349_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9350])# _LT_WITH_PIC
9351
9352LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9353LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9354
9355# Old name:
9356AU_DEFUN([AC_LIBTOOL_PICMODE],
9357[_LT_SET_OPTION([LT_INIT], [pic-only])
9358AC_DIAGNOSE([obsolete],
9359[$0: Remove this warning and the call to _LT_SET_OPTION when you
9360put the `pic-only' option into LT_INIT's first parameter.])
9361])
9362
9363dnl aclocal-1.4 backwards compatibility:
9364dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9365
9366
9367m4_define([_LTDL_MODE], [])
9368LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9369		 [m4_define([_LTDL_MODE], [nonrecursive])])
9370LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9371		 [m4_define([_LTDL_MODE], [recursive])])
9372LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9373		 [m4_define([_LTDL_MODE], [subproject])])
9374
9375m4_define([_LTDL_TYPE], [])
9376LT_OPTION_DEFINE([LTDL_INIT], [installable],
9377		 [m4_define([_LTDL_TYPE], [installable])])
9378LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9379		 [m4_define([_LTDL_TYPE], [convenience])])
9380
9381# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9382#
9383# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9384# Written by Gary V. Vaughan, 2004
9385#
9386# This file is free software; the Free Software Foundation gives
9387# unlimited permission to copy and/or distribute it, with or without
9388# modifications, as long as this notice is preserved.
9389
9390# serial 6 ltsugar.m4
9391
9392# This is to help aclocal find these macros, as it can't see m4_define.
9393AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9394
9395
9396# lt_join(SEP, ARG1, [ARG2...])
9397# -----------------------------
9398# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9399# associated separator.
9400# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9401# versions in m4sugar had bugs.
9402m4_define([lt_join],
9403[m4_if([$#], [1], [],
9404       [$#], [2], [[$2]],
9405       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9406m4_define([_lt_join],
9407[m4_if([$#$2], [2], [],
9408       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9409
9410
9411# lt_car(LIST)
9412# lt_cdr(LIST)
9413# ------------
9414# Manipulate m4 lists.
9415# These macros are necessary as long as will still need to support
9416# Autoconf-2.59 which quotes differently.
9417m4_define([lt_car], [[$1]])
9418m4_define([lt_cdr],
9419[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9420       [$#], 1, [],
9421       [m4_dquote(m4_shift($@))])])
9422m4_define([lt_unquote], $1)
9423
9424
9425# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9426# ------------------------------------------
9427# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9428# Note that neither SEPARATOR nor STRING are expanded; they are appended
9429# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9430# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9431# than defined and empty).
9432#
9433# This macro is needed until we can rely on Autoconf 2.62, since earlier
9434# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9435m4_define([lt_append],
9436[m4_define([$1],
9437	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9438
9439
9440
9441# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9442# ----------------------------------------------------------
9443# Produce a SEP delimited list of all paired combinations of elements of
9444# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9445# has the form PREFIXmINFIXSUFFIXn.
9446# Needed until we can rely on m4_combine added in Autoconf 2.62.
9447m4_define([lt_combine],
9448[m4_if(m4_eval([$# > 3]), [1],
9449       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9450[[m4_foreach([_Lt_prefix], [$2],
9451	     [m4_foreach([_Lt_suffix],
9452		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9453	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9454
9455
9456# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9457# -----------------------------------------------------------------------
9458# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9459# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9460m4_define([lt_if_append_uniq],
9461[m4_ifdef([$1],
9462	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9463		 [lt_append([$1], [$2], [$3])$4],
9464		 [$5])],
9465	  [lt_append([$1], [$2], [$3])$4])])
9466
9467
9468# lt_dict_add(DICT, KEY, VALUE)
9469# -----------------------------
9470m4_define([lt_dict_add],
9471[m4_define([$1($2)], [$3])])
9472
9473
9474# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9475# --------------------------------------------
9476m4_define([lt_dict_add_subkey],
9477[m4_define([$1($2:$3)], [$4])])
9478
9479
9480# lt_dict_fetch(DICT, KEY, [SUBKEY])
9481# ----------------------------------
9482m4_define([lt_dict_fetch],
9483[m4_ifval([$3],
9484	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9485    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9486
9487
9488# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9489# -----------------------------------------------------------------
9490m4_define([lt_if_dict_fetch],
9491[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9492	[$5],
9493    [$6])])
9494
9495
9496# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9497# --------------------------------------------------------------
9498m4_define([lt_dict_filter],
9499[m4_if([$5], [], [],
9500  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9501           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9502		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9503])
9504
9505# ltversion.m4 -- version numbers			-*- Autoconf -*-
9506#
9507#   Copyright (C) 2004 Free Software Foundation, Inc.
9508#   Written by Scott James Remnant, 2004
9509#
9510# This file is free software; the Free Software Foundation gives
9511# unlimited permission to copy and/or distribute it, with or without
9512# modifications, as long as this notice is preserved.
9513
9514# @configure_input@
9515
9516# serial 3337 ltversion.m4
9517# This file is part of GNU Libtool
9518
9519m4_define([LT_PACKAGE_VERSION], [2.4.2])
9520m4_define([LT_PACKAGE_REVISION], [1.3337])
9521
9522AC_DEFUN([LTVERSION_VERSION],
9523[macro_version='2.4.2'
9524macro_revision='1.3337'
9525_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9526_LT_DECL(, macro_revision, 0)
9527])
9528
9529# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9530#
9531#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9532#   Written by Scott James Remnant, 2004.
9533#
9534# This file is free software; the Free Software Foundation gives
9535# unlimited permission to copy and/or distribute it, with or without
9536# modifications, as long as this notice is preserved.
9537
9538# serial 5 lt~obsolete.m4
9539
9540# These exist entirely to fool aclocal when bootstrapping libtool.
9541#
9542# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9543# which have later been changed to m4_define as they aren't part of the
9544# exported API, or moved to Autoconf or Automake where they belong.
9545#
9546# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9547# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9548# using a macro with the same name in our local m4/libtool.m4 it'll
9549# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9550# and doesn't know about Autoconf macros at all.)
9551#
9552# So we provide this file, which has a silly filename so it's always
9553# included after everything else.  This provides aclocal with the
9554# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9555# because those macros already exist, or will be overwritten later.
9556# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9557#
9558# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9559# Yes, that means every name once taken will need to remain here until
9560# we give up compatibility with versions before 1.7, at which point
9561# we need to keep only those names which we still refer to.
9562
9563# This is to help aclocal find these macros, as it can't see m4_define.
9564AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9565
9566m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9567m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9568m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9569m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9570m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9571m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9572m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9573m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9574m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9575m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9576m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9577m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9578m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9579m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9580m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9581m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9582m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9583m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9584m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9585m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9586m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9587m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9588m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9589m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9590m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9591m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9592m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9593m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9594m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9595m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9596m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9597m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9598m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9599m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9600m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9601m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9602m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9603m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9604m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9605m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9606m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9607m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9608m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9609m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9610m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9611m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9612m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9613m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9614m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9615m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9616m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9617m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9618m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9619m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9620m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9621m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9622m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9623m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9624m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9625m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9626m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9627
9628# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9629# 
9630# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9631#
9632# This program is free software; you can redistribute it and/or modify
9633# it under the terms of the GNU General Public License as published by
9634# the Free Software Foundation; either version 2 of the License, or
9635# (at your option) any later version.
9636#
9637# This program is distributed in the hope that it will be useful, but
9638# WITHOUT ANY WARRANTY; without even the implied warranty of
9639# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9640# General Public License for more details.
9641#
9642# You should have received a copy of the GNU General Public License
9643# along with this program; if not, write to the Free Software
9644# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9645#
9646# As a special exception to the GNU General Public License, if you
9647# distribute this file as part of a program that contains a
9648# configuration script generated by Autoconf, you may include it under
9649# the same distribution terms that you use for the rest of that program.
9650
9651# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9652# ----------------------------------
9653AC_DEFUN([PKG_PROG_PKG_CONFIG],
9654[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9655m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9656AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9657if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9658	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9659fi
9660if test -n "$PKG_CONFIG"; then
9661	_pkg_min_version=m4_default([$1], [0.9.0])
9662	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9663	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9664		AC_MSG_RESULT([yes])
9665	else
9666		AC_MSG_RESULT([no])
9667		PKG_CONFIG=""
9668	fi
9669		
9670fi[]dnl
9671])# PKG_PROG_PKG_CONFIG
9672
9673# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9674#
9675# Check to see whether a particular set of modules exists.  Similar
9676# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9677#
9678#
9679# Similar to PKG_CHECK_MODULES, make sure that the first instance of
9680# this or PKG_CHECK_MODULES is called, or make sure to call
9681# PKG_CHECK_EXISTS manually
9682# --------------------------------------------------------------
9683AC_DEFUN([PKG_CHECK_EXISTS],
9684[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9685if test -n "$PKG_CONFIG" && \
9686    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9687  m4_ifval([$2], [$2], [:])
9688m4_ifvaln([$3], [else
9689  $3])dnl
9690fi])
9691
9692
9693# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9694# ---------------------------------------------
9695m4_define([_PKG_CONFIG],
9696[if test -n "$$1"; then
9697    pkg_cv_[]$1="$$1"
9698 elif test -n "$PKG_CONFIG"; then
9699    PKG_CHECK_EXISTS([$3],
9700                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9701		     [pkg_failed=yes])
9702 else
9703    pkg_failed=untried
9704fi[]dnl
9705])# _PKG_CONFIG
9706
9707# _PKG_SHORT_ERRORS_SUPPORTED
9708# -----------------------------
9709AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9710[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9711if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9712        _pkg_short_errors_supported=yes
9713else
9714        _pkg_short_errors_supported=no
9715fi[]dnl
9716])# _PKG_SHORT_ERRORS_SUPPORTED
9717
9718
9719# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9720# [ACTION-IF-NOT-FOUND])
9721#
9722#
9723# Note that if there is a possibility the first call to
9724# PKG_CHECK_MODULES might not happen, you should be sure to include an
9725# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9726#
9727#
9728# --------------------------------------------------------------
9729AC_DEFUN([PKG_CHECK_MODULES],
9730[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9731AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9732AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9733
9734pkg_failed=no
9735AC_MSG_CHECKING([for $1])
9736
9737_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9738_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9739
9740m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9741and $1[]_LIBS to avoid the need to call pkg-config.
9742See the pkg-config man page for more details.])
9743
9744if test $pkg_failed = yes; then
9745        _PKG_SHORT_ERRORS_SUPPORTED
9746        if test $_pkg_short_errors_supported = yes; then
9747	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9748        else 
9749	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9750        fi
9751	# Put the nasty error message in config.log where it belongs
9752	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9753
9754	ifelse([$4], , [AC_MSG_ERROR(dnl
9755[Package requirements ($2) were not met:
9756
9757$$1_PKG_ERRORS
9758
9759Consider adjusting the PKG_CONFIG_PATH environment variable if you
9760installed software in a non-standard prefix.
9761
9762_PKG_TEXT
9763])],
9764		[AC_MSG_RESULT([no])
9765                $4])
9766elif test $pkg_failed = untried; then
9767	ifelse([$4], , [AC_MSG_FAILURE(dnl
9768[The pkg-config script could not be found or is too old.  Make sure it
9769is in your PATH or set the PKG_CONFIG environment variable to the full
9770path to pkg-config.
9771
9772_PKG_TEXT
9773
9774To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9775		[$4])
9776else
9777	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9778	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9779        AC_MSG_RESULT([yes])
9780	ifelse([$3], , :, [$3])
9781fi[]dnl
9782])# PKG_CHECK_MODULES
9783
9784dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9785dnl
9786dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9787dnl 
9788dnl Permission is hereby granted, free of charge, to any person obtaining a
9789dnl copy of this software and associated documentation files (the "Software"),
9790dnl to deal in the Software without restriction, including without limitation
9791dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9792dnl and/or sell copies of the Software, and to permit persons to whom the
9793dnl Software is furnished to do so, subject to the following conditions:
9794dnl
9795dnl The above copyright notice and this permission notice (including the next
9796dnl paragraph) shall be included in all copies or substantial portions of the
9797dnl Software.
9798dnl
9799dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9800dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9801dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9802dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9803dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9804dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9805dnl DEALINGS IN THE SOFTWARE.
9806
9807# XORG_MACROS_VERSION(required-version)
9808# -------------------------------------
9809# Minimum version: 1.1.0
9810#
9811# If you're using a macro added in Version 1.1 or newer, include this in
9812# your configure.ac with the minimum required version, such as:
9813# XORG_MACROS_VERSION(1.1)
9814#
9815# To ensure that this macro is defined, also add:
9816# m4_ifndef([XORG_MACROS_VERSION],
9817#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9818#
9819#
9820# See the "minimum version" comment for each macro you use to see what 
9821# version you require.
9822m4_defun([XORG_MACROS_VERSION],[
9823m4_define([vers_have], [1.17])
9824m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9825m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9826m4_if(m4_cmp(maj_have, maj_needed), 0,,
9827    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9828m4_if(m4_version_compare(vers_have, [$1]), -1,
9829    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9830m4_undefine([vers_have])
9831m4_undefine([maj_have])
9832m4_undefine([maj_needed])
9833]) # XORG_MACROS_VERSION
9834
9835# XORG_PROG_RAWCPP()
9836# ------------------
9837# Minimum version: 1.0.0
9838#
9839# Find cpp program and necessary flags for use in pre-processing text files
9840# such as man pages and config files
9841AC_DEFUN([XORG_PROG_RAWCPP],[
9842AC_REQUIRE([AC_PROG_CPP])
9843AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9844   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9845
9846# Check for flag to avoid builtin definitions - assumes unix is predefined,
9847# which is not the best choice for supporting other OS'es, but covers most
9848# of the ones we need for now.
9849AC_MSG_CHECKING([if $RAWCPP requires -undef])
9850AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9851if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9852	AC_MSG_RESULT([no])
9853else
9854	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9855		RAWCPPFLAGS=-undef
9856		AC_MSG_RESULT([yes])
9857	# under Cygwin unix is still defined even with -undef
9858	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9859		RAWCPPFLAGS="-undef -ansi"
9860		AC_MSG_RESULT([yes, with -ansi])
9861	else
9862		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9863	fi
9864fi
9865rm -f conftest.$ac_ext
9866
9867AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9868AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9869if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9870	AC_MSG_RESULT([no])
9871else
9872	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9873		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9874		AC_MSG_RESULT([yes])
9875	else
9876		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9877	fi
9878fi
9879rm -f conftest.$ac_ext
9880AC_SUBST(RAWCPPFLAGS)
9881]) # XORG_PROG_RAWCPP
9882
9883# XORG_MANPAGE_SECTIONS()
9884# -----------------------
9885# Minimum version: 1.0.0
9886#
9887# Determine which sections man pages go in for the different man page types
9888# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9889# Not sure if there's any better way than just hardcoding by OS name.
9890# Override default settings by setting environment variables
9891# Added MAN_SUBSTS in version 1.8
9892# Added AC_PROG_SED in version 1.8
9893
9894AC_DEFUN([XORG_MANPAGE_SECTIONS],[
9895AC_REQUIRE([AC_CANONICAL_HOST])
9896AC_REQUIRE([AC_PROG_SED])
9897
9898if test x$APP_MAN_SUFFIX = x    ; then
9899    APP_MAN_SUFFIX=1
9900fi
9901if test x$APP_MAN_DIR = x    ; then
9902    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9903fi
9904
9905if test x$LIB_MAN_SUFFIX = x    ; then
9906    LIB_MAN_SUFFIX=3
9907fi
9908if test x$LIB_MAN_DIR = x    ; then
9909    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9910fi
9911
9912if test x$FILE_MAN_SUFFIX = x    ; then
9913    case $host_os in
9914	solaris*)	FILE_MAN_SUFFIX=4  ;;
9915	*)		FILE_MAN_SUFFIX=5  ;;
9916    esac
9917fi
9918if test x$FILE_MAN_DIR = x    ; then
9919    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9920fi
9921
9922if test x$MISC_MAN_SUFFIX = x    ; then
9923    case $host_os in
9924	solaris*)	MISC_MAN_SUFFIX=5  ;;
9925	*)		MISC_MAN_SUFFIX=7  ;;
9926    esac
9927fi
9928if test x$MISC_MAN_DIR = x    ; then
9929    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9930fi
9931
9932if test x$DRIVER_MAN_SUFFIX = x    ; then
9933    case $host_os in
9934	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9935	*)		DRIVER_MAN_SUFFIX=4  ;;
9936    esac
9937fi
9938if test x$DRIVER_MAN_DIR = x    ; then
9939    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9940fi
9941
9942if test x$ADMIN_MAN_SUFFIX = x    ; then
9943    case $host_os in
9944	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9945	*)		ADMIN_MAN_SUFFIX=8  ;;
9946    esac
9947fi
9948if test x$ADMIN_MAN_DIR = x    ; then
9949    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9950fi
9951
9952
9953AC_SUBST([APP_MAN_SUFFIX])
9954AC_SUBST([LIB_MAN_SUFFIX])
9955AC_SUBST([FILE_MAN_SUFFIX])
9956AC_SUBST([MISC_MAN_SUFFIX])
9957AC_SUBST([DRIVER_MAN_SUFFIX])
9958AC_SUBST([ADMIN_MAN_SUFFIX])
9959AC_SUBST([APP_MAN_DIR])
9960AC_SUBST([LIB_MAN_DIR])
9961AC_SUBST([FILE_MAN_DIR])
9962AC_SUBST([MISC_MAN_DIR])
9963AC_SUBST([DRIVER_MAN_DIR])
9964AC_SUBST([ADMIN_MAN_DIR])
9965
9966XORG_MAN_PAGE="X Version 11"
9967AC_SUBST([XORG_MAN_PAGE])
9968MAN_SUBSTS="\
9969	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9970	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9971	-e 's|__xservername__|Xorg|g' \
9972	-e 's|__xconfigfile__|xorg.conf|g' \
9973	-e 's|__projectroot__|\$(prefix)|g' \
9974	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9975	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9976	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9977	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9978	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9979	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9980	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9981AC_SUBST([MAN_SUBSTS])
9982
9983]) # XORG_MANPAGE_SECTIONS
9984
9985# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9986# ------------------------
9987# Minimum version: 1.7.0
9988#
9989# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9990# provided by xorg-sgml-doctools, if installed.
9991AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9992AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9993XORG_SGML_PATH=
9994PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9995    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9996    [m4_ifval([$1],[:],
9997        [if test x"$cross_compiling" != x"yes" ; then
9998            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9999                          [XORG_SGML_PATH=$prefix/share/sgml])
10000         fi])
10001    ])
10002
10003# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10004# the path and the name of the doc stylesheet
10005if test "x$XORG_SGML_PATH" != "x" ; then
10006   AC_MSG_RESULT([$XORG_SGML_PATH])
10007   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10008   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10009else
10010   AC_MSG_RESULT([no])
10011fi
10012
10013AC_SUBST(XORG_SGML_PATH)
10014AC_SUBST(STYLESHEET_SRCDIR)
10015AC_SUBST(XSL_STYLESHEET)
10016AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10017]) # XORG_CHECK_SGML_DOCTOOLS
10018
10019# XORG_CHECK_LINUXDOC
10020# -------------------
10021# Minimum version: 1.0.0
10022#
10023# Defines the variable MAKE_TEXT if the necessary tools and
10024# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10025# Whether or not the necessary tools and files are found can be checked
10026# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10027AC_DEFUN([XORG_CHECK_LINUXDOC],[
10028AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10029AC_REQUIRE([XORG_WITH_PS2PDF])
10030
10031AC_PATH_PROG(LINUXDOC, linuxdoc)
10032
10033AC_MSG_CHECKING([whether to build documentation])
10034
10035if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10036   BUILDDOC=yes
10037else
10038   BUILDDOC=no
10039fi
10040
10041AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10042
10043AC_MSG_RESULT([$BUILDDOC])
10044
10045AC_MSG_CHECKING([whether to build pdf documentation])
10046
10047if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10048   BUILDPDFDOC=yes
10049else
10050   BUILDPDFDOC=no
10051fi
10052
10053AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10054
10055AC_MSG_RESULT([$BUILDPDFDOC])
10056
10057MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10058MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10059MAKE_PDF="$PS2PDF"
10060MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10061
10062AC_SUBST(MAKE_TEXT)
10063AC_SUBST(MAKE_PS)
10064AC_SUBST(MAKE_PDF)
10065AC_SUBST(MAKE_HTML)
10066]) # XORG_CHECK_LINUXDOC
10067
10068# XORG_CHECK_DOCBOOK
10069# -------------------
10070# Minimum version: 1.0.0
10071#
10072# Checks for the ability to build output formats from SGML DocBook source.
10073# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10074# indicates whether the necessary tools and files are found and, if set,
10075# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10076AC_DEFUN([XORG_CHECK_DOCBOOK],[
10077AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10078
10079BUILDTXTDOC=no
10080BUILDPDFDOC=no
10081BUILDPSDOC=no
10082BUILDHTMLDOC=no
10083
10084AC_PATH_PROG(DOCBOOKPS, docbook2ps)
10085AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10086AC_PATH_PROG(DOCBOOKHTML, docbook2html)
10087AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10088
10089AC_MSG_CHECKING([whether to build text documentation])
10090if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10091   test x$BUILD_TXTDOC != xno; then
10092	BUILDTXTDOC=yes
10093fi
10094AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10095AC_MSG_RESULT([$BUILDTXTDOC])
10096
10097AC_MSG_CHECKING([whether to build PDF documentation])
10098if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10099   test x$BUILD_PDFDOC != xno; then
10100	BUILDPDFDOC=yes
10101fi
10102AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10103AC_MSG_RESULT([$BUILDPDFDOC])
10104
10105AC_MSG_CHECKING([whether to build PostScript documentation])
10106if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10107   test x$BUILD_PSDOC != xno; then
10108	BUILDPSDOC=yes
10109fi
10110AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10111AC_MSG_RESULT([$BUILDPSDOC])
10112
10113AC_MSG_CHECKING([whether to build HTML documentation])
10114if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10115   test x$BUILD_HTMLDOC != xno; then
10116	BUILDHTMLDOC=yes
10117fi
10118AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10119AC_MSG_RESULT([$BUILDHTMLDOC])
10120
10121MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10122MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10123MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10124MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10125
10126AC_SUBST(MAKE_TEXT)
10127AC_SUBST(MAKE_PS)
10128AC_SUBST(MAKE_PDF)
10129AC_SUBST(MAKE_HTML)
10130]) # XORG_CHECK_DOCBOOK
10131
10132# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10133# ----------------
10134# Minimum version: 1.5.0
10135# Minimum version for optional DEFAULT argument: 1.11.0
10136#
10137# Documentation tools are not always available on all platforms and sometimes
10138# not at the appropriate level. This macro enables a module to test for the
10139# presence of the tool and obtain it's path in separate variables. Coupled with
10140# the --with-xmlto option, it allows maximum flexibilty in making decisions
10141# as whether or not to use the xmlto package. When DEFAULT is not specified,
10142# --with-xmlto assumes 'auto'.
10143#
10144# Interface to module:
10145# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10146# XMLTO:	returns the path of the xmlto program found
10147#		returns the path set by the user in the environment
10148# --with-xmlto:	'yes' user instructs the module to use xmlto
10149#		'no' user instructs the module not to use xmlto
10150#
10151# Added in version 1.10.0
10152# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10153#                  xmlto for text output requires either lynx, links, or w3m browsers
10154#
10155# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10156#
10157AC_DEFUN([XORG_WITH_XMLTO],[
10158AC_ARG_VAR([XMLTO], [Path to xmlto command])
10159m4_define([_defopt], m4_default([$2], [auto]))
10160AC_ARG_WITH(xmlto,
10161	AS_HELP_STRING([--with-xmlto],
10162	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10163	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10164m4_undefine([_defopt])
10165
10166if test "x$use_xmlto" = x"auto"; then
10167   AC_PATH_PROG([XMLTO], [xmlto])
10168   if test "x$XMLTO" = "x"; then
10169        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10170	have_xmlto=no
10171   else
10172        have_xmlto=yes
10173   fi
10174elif test "x$use_xmlto" = x"yes" ; then
10175   AC_PATH_PROG([XMLTO], [xmlto])
10176   if test "x$XMLTO" = "x"; then
10177        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10178   fi
10179   have_xmlto=yes
10180elif test "x$use_xmlto" = x"no" ; then
10181   if test "x$XMLTO" != "x"; then
10182      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10183   fi
10184   have_xmlto=no
10185else
10186   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10187fi
10188
10189# Test for a minimum version of xmlto, if provided.
10190m4_ifval([$1],
10191[if test "$have_xmlto" = yes; then
10192    # scrape the xmlto version
10193    AC_MSG_CHECKING([the xmlto version])
10194    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10195    AC_MSG_RESULT([$xmlto_version])
10196    AS_VERSION_COMPARE([$xmlto_version], [$1],
10197        [if test "x$use_xmlto" = xauto; then
10198            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10199            have_xmlto=no
10200        else
10201            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10202        fi])
10203fi])
10204
10205# Test for the ability of xmlto to generate a text target
10206have_xmlto_text=no
10207cat > conftest.xml << "EOF"
10208EOF
10209AS_IF([test "$have_xmlto" = yes],
10210      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10211             [have_xmlto_text=yes],
10212             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10213rm -f conftest.xml
10214AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10215AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10216]) # XORG_WITH_XMLTO
10217
10218# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10219# --------------------------------------------
10220# Minimum version: 1.12.0
10221# Minimum version for optional DEFAULT argument: 1.12.0
10222#
10223# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10224# XML-based language used for the transformation of XML documents.
10225# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10226# It is used under the cover by xmlto to generate html files from DocBook/XML.
10227# The XSLT processor is often used as a standalone tool for transformations.
10228# It should not be assumed that this tool is used only to work with documnetation.
10229# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10230#
10231# Interface to module:
10232# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10233# XSLTPROC:	 returns the path of the xsltproc program found
10234#		 returns the path set by the user in the environment
10235# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10236#		  'no' user instructs the module not to use xsltproc
10237# have_xsltproc: returns yes if xsltproc found in PATH or no
10238#
10239# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10240#
10241AC_DEFUN([XORG_WITH_XSLTPROC],[
10242AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10243# Preserves the interface, should it be implemented later
10244m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10245m4_define([_defopt], m4_default([$2], [auto]))
10246AC_ARG_WITH(xsltproc,
10247	AS_HELP_STRING([--with-xsltproc],
10248	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10249	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10250m4_undefine([_defopt])
10251
10252if test "x$use_xsltproc" = x"auto"; then
10253   AC_PATH_PROG([XSLTPROC], [xsltproc])
10254   if test "x$XSLTPROC" = "x"; then
10255        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10256	have_xsltproc=no
10257   else
10258        have_xsltproc=yes
10259   fi
10260elif test "x$use_xsltproc" = x"yes" ; then
10261   AC_PATH_PROG([XSLTPROC], [xsltproc])
10262   if test "x$XSLTPROC" = "x"; then
10263        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10264   fi
10265   have_xsltproc=yes
10266elif test "x$use_xsltproc" = x"no" ; then
10267   if test "x$XSLTPROC" != "x"; then
10268      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10269   fi
10270   have_xsltproc=no
10271else
10272   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10273fi
10274
10275AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10276]) # XORG_WITH_XSLTPROC
10277
10278# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10279# ----------------------------------------
10280# Minimum version: 1.15.0
10281#
10282# PERL (Practical Extraction and Report Language) is a language optimized for
10283# scanning arbitrary text files, extracting information from those text files,
10284# and printing reports based on that information.
10285#
10286# When DEFAULT is not specified, --with-perl assumes 'auto'.
10287#
10288# Interface to module:
10289# HAVE_PERL: used in makefiles to conditionally scan text files
10290# PERL:	     returns the path of the perl program found
10291#	     returns the path set by the user in the environment
10292# --with-perl: 'yes' user instructs the module to use perl
10293#	       'no' user instructs the module not to use perl
10294# have_perl: returns yes if perl found in PATH or no
10295#
10296# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10297#
10298AC_DEFUN([XORG_WITH_PERL],[
10299AC_ARG_VAR([PERL], [Path to perl command])
10300# Preserves the interface, should it be implemented later
10301m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10302m4_define([_defopt], m4_default([$2], [auto]))
10303AC_ARG_WITH(perl,
10304	AS_HELP_STRING([--with-perl],
10305	   [Use perl for extracting information from files (default: ]_defopt[)]),
10306	   [use_perl=$withval], [use_perl=]_defopt)
10307m4_undefine([_defopt])
10308
10309if test "x$use_perl" = x"auto"; then
10310   AC_PATH_PROG([PERL], [perl])
10311   if test "x$PERL" = "x"; then
10312        AC_MSG_WARN([perl not found - cannot extract information and report])
10313	have_perl=no
10314   else
10315        have_perl=yes
10316   fi
10317elif test "x$use_perl" = x"yes" ; then
10318   AC_PATH_PROG([PERL], [perl])
10319   if test "x$PERL" = "x"; then
10320        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10321   fi
10322   have_perl=yes
10323elif test "x$use_perl" = x"no" ; then
10324   if test "x$PERL" != "x"; then
10325      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10326   fi
10327   have_perl=no
10328else
10329   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10330fi
10331
10332AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10333]) # XORG_WITH_PERL
10334
10335# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10336# ----------------
10337# Minimum version: 1.5.0
10338# Minimum version for optional DEFAULT argument: 1.11.0
10339#
10340# Documentation tools are not always available on all platforms and sometimes
10341# not at the appropriate level. This macro enables a module to test for the
10342# presence of the tool and obtain it's path in separate variables. Coupled with
10343# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10344# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10345# --with-asciidoc assumes 'auto'.
10346#
10347# Interface to module:
10348# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10349# ASCIIDOC:	 returns the path of the asciidoc program found
10350#		 returns the path set by the user in the environment
10351# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10352#		  'no' user instructs the module not to use asciidoc
10353#
10354# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10355#
10356AC_DEFUN([XORG_WITH_ASCIIDOC],[
10357AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10358m4_define([_defopt], m4_default([$2], [auto]))
10359AC_ARG_WITH(asciidoc,
10360	AS_HELP_STRING([--with-asciidoc],
10361	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10362	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10363m4_undefine([_defopt])
10364
10365if test "x$use_asciidoc" = x"auto"; then
10366   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10367   if test "x$ASCIIDOC" = "x"; then
10368        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10369	have_asciidoc=no
10370   else
10371        have_asciidoc=yes
10372   fi
10373elif test "x$use_asciidoc" = x"yes" ; then
10374   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10375   if test "x$ASCIIDOC" = "x"; then
10376        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10377   fi
10378   have_asciidoc=yes
10379elif test "x$use_asciidoc" = x"no" ; then
10380   if test "x$ASCIIDOC" != "x"; then
10381      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10382   fi
10383   have_asciidoc=no
10384else
10385   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10386fi
10387m4_ifval([$1],
10388[if test "$have_asciidoc" = yes; then
10389    # scrape the asciidoc version
10390    AC_MSG_CHECKING([the asciidoc version])
10391    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10392    AC_MSG_RESULT([$asciidoc_version])
10393    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10394        [if test "x$use_asciidoc" = xauto; then
10395            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10396            have_asciidoc=no
10397        else
10398            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10399        fi])
10400fi])
10401AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10402]) # XORG_WITH_ASCIIDOC
10403
10404# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10405# --------------------------------
10406# Minimum version: 1.5.0
10407# Minimum version for optional DEFAULT argument: 1.11.0
10408#
10409# Documentation tools are not always available on all platforms and sometimes
10410# not at the appropriate level. This macro enables a module to test for the
10411# presence of the tool and obtain it's path in separate variables. Coupled with
10412# the --with-doxygen option, it allows maximum flexibilty in making decisions
10413# as whether or not to use the doxygen package. When DEFAULT is not specified,
10414# --with-doxygen assumes 'auto'.
10415#
10416# Interface to module:
10417# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10418# DOXYGEN:	 returns the path of the doxygen program found
10419#		 returns the path set by the user in the environment
10420# --with-doxygen: 'yes' user instructs the module to use doxygen
10421#		  'no' user instructs the module not to use doxygen
10422#
10423# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10424#
10425AC_DEFUN([XORG_WITH_DOXYGEN],[
10426AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10427m4_define([_defopt], m4_default([$2], [auto]))
10428AC_ARG_WITH(doxygen,
10429	AS_HELP_STRING([--with-doxygen],
10430	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10431	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10432m4_undefine([_defopt])
10433
10434if test "x$use_doxygen" = x"auto"; then
10435   AC_PATH_PROG([DOXYGEN], [doxygen])
10436   if test "x$DOXYGEN" = "x"; then
10437        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10438	have_doxygen=no
10439   else
10440        have_doxygen=yes
10441   fi
10442elif test "x$use_doxygen" = x"yes" ; then
10443   AC_PATH_PROG([DOXYGEN], [doxygen])
10444   if test "x$DOXYGEN" = "x"; then
10445        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10446   fi
10447   have_doxygen=yes
10448elif test "x$use_doxygen" = x"no" ; then
10449   if test "x$DOXYGEN" != "x"; then
10450      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10451   fi
10452   have_doxygen=no
10453else
10454   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10455fi
10456m4_ifval([$1],
10457[if test "$have_doxygen" = yes; then
10458    # scrape the doxygen version
10459    AC_MSG_CHECKING([the doxygen version])
10460    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10461    AC_MSG_RESULT([$doxygen_version])
10462    AS_VERSION_COMPARE([$doxygen_version], [$1],
10463        [if test "x$use_doxygen" = xauto; then
10464            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10465            have_doxygen=no
10466        else
10467            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10468        fi])
10469fi])
10470AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10471]) # XORG_WITH_DOXYGEN
10472
10473# XORG_WITH_GROFF([DEFAULT])
10474# ----------------
10475# Minimum version: 1.6.0
10476# Minimum version for optional DEFAULT argument: 1.11.0
10477#
10478# Documentation tools are not always available on all platforms and sometimes
10479# not at the appropriate level. This macro enables a module to test for the
10480# presence of the tool and obtain it's path in separate variables. Coupled with
10481# the --with-groff option, it allows maximum flexibilty in making decisions
10482# as whether or not to use the groff package. When DEFAULT is not specified,
10483# --with-groff assumes 'auto'.
10484#
10485# Interface to module:
10486# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10487# HAVE_GROFF_MM: the memorandum macros (-mm) package
10488# HAVE_GROFF_MS: the -ms macros package
10489# GROFF:	 returns the path of the groff program found
10490#		 returns the path set by the user in the environment
10491# --with-groff:	 'yes' user instructs the module to use groff
10492#		 'no' user instructs the module not to use groff
10493#
10494# Added in version 1.9.0:
10495# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10496#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10497#		   psselect from the psutils package.
10498#		   the ghostcript package. Refer to the grohtml man pages
10499#
10500# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10501#
10502# OS and distros often splits groff in a basic and full package, the former
10503# having the groff program and the later having devices, fonts and macros
10504# Checking for the groff executable is not enough.
10505#
10506# If macros are missing, we cannot assume that groff is useless, so we don't
10507# unset HAVE_GROFF or GROFF env variables.
10508# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10509#
10510AC_DEFUN([XORG_WITH_GROFF],[
10511AC_ARG_VAR([GROFF], [Path to groff command])
10512m4_define([_defopt], m4_default([$1], [auto]))
10513AC_ARG_WITH(groff,
10514	AS_HELP_STRING([--with-groff],
10515	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10516	   [use_groff=$withval], [use_groff=]_defopt)
10517m4_undefine([_defopt])
10518
10519if test "x$use_groff" = x"auto"; then
10520   AC_PATH_PROG([GROFF], [groff])
10521   if test "x$GROFF" = "x"; then
10522        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10523	have_groff=no
10524   else
10525        have_groff=yes
10526   fi
10527elif test "x$use_groff" = x"yes" ; then
10528   AC_PATH_PROG([GROFF], [groff])
10529   if test "x$GROFF" = "x"; then
10530        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10531   fi
10532   have_groff=yes
10533elif test "x$use_groff" = x"no" ; then
10534   if test "x$GROFF" != "x"; then
10535      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10536   fi
10537   have_groff=no
10538else
10539   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10540fi
10541
10542# We have groff, test for the presence of the macro packages
10543if test "x$have_groff" = x"yes"; then
10544    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10545    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10546        groff_ms_works=yes
10547    else
10548        groff_ms_works=no
10549    fi
10550    AC_MSG_RESULT([$groff_ms_works])
10551    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10552    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10553        groff_mm_works=yes
10554    else
10555        groff_mm_works=no
10556    fi
10557    AC_MSG_RESULT([$groff_mm_works])
10558fi
10559
10560# We have groff, test for HTML dependencies, one command per package
10561if test "x$have_groff" = x"yes"; then
10562   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10563   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10564   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10565   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10566      have_groff_html=yes
10567   else
10568      have_groff_html=no
10569      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10570   fi
10571fi
10572
10573# Set Automake conditionals for Makefiles
10574AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10575AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10576AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10577AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10578]) # XORG_WITH_GROFF
10579
10580# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10581# ---------------------------------------
10582# Minimum version: 1.6.0
10583# Minimum version for optional DEFAULT argument: 1.11.0
10584# Minimum version for optional MIN-VERSION argument: 1.15.0
10585#
10586# Documentation tools are not always available on all platforms and sometimes
10587# not at the appropriate level. This macro enables a module to test for the
10588# presence of the tool and obtain it's path in separate variables. Coupled with
10589# the --with-fop option, it allows maximum flexibilty in making decisions
10590# as whether or not to use the fop package. When DEFAULT is not specified,
10591# --with-fop assumes 'auto'.
10592#
10593# Interface to module:
10594# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10595# FOP:	 	returns the path of the fop program found
10596#		returns the path set by the user in the environment
10597# --with-fop: 	'yes' user instructs the module to use fop
10598#		'no' user instructs the module not to use fop
10599#
10600# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10601#
10602AC_DEFUN([XORG_WITH_FOP],[
10603AC_ARG_VAR([FOP], [Path to fop command])
10604m4_define([_defopt], m4_default([$2], [auto]))
10605AC_ARG_WITH(fop,
10606	AS_HELP_STRING([--with-fop],
10607	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10608	   [use_fop=$withval], [use_fop=]_defopt)
10609m4_undefine([_defopt])
10610
10611if test "x$use_fop" = x"auto"; then
10612   AC_PATH_PROG([FOP], [fop])
10613   if test "x$FOP" = "x"; then
10614        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10615	have_fop=no
10616   else
10617        have_fop=yes
10618   fi
10619elif test "x$use_fop" = x"yes" ; then
10620   AC_PATH_PROG([FOP], [fop])
10621   if test "x$FOP" = "x"; then
10622        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10623   fi
10624   have_fop=yes
10625elif test "x$use_fop" = x"no" ; then
10626   if test "x$FOP" != "x"; then
10627      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10628   fi
10629   have_fop=no
10630else
10631   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10632fi
10633
10634# Test for a minimum version of fop, if provided.
10635m4_ifval([$1],
10636[if test "$have_fop" = yes; then
10637    # scrape the fop version
10638    AC_MSG_CHECKING([for fop minimum version])
10639    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10640    AC_MSG_RESULT([$fop_version])
10641    AS_VERSION_COMPARE([$fop_version], [$1],
10642        [if test "x$use_fop" = xauto; then
10643            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10644            have_fop=no
10645        else
10646            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10647        fi])
10648fi])
10649AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10650]) # XORG_WITH_FOP
10651
10652# XORG_WITH_PS2PDF([DEFAULT])
10653# ----------------
10654# Minimum version: 1.6.0
10655# Minimum version for optional DEFAULT argument: 1.11.0
10656#
10657# Documentation tools are not always available on all platforms and sometimes
10658# not at the appropriate level. This macro enables a module to test for the
10659# presence of the tool and obtain it's path in separate variables. Coupled with
10660# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10661# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10662# --with-ps2pdf assumes 'auto'.
10663#
10664# Interface to module:
10665# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10666# PS2PDF:	returns the path of the ps2pdf program found
10667#		returns the path set by the user in the environment
10668# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10669#		 'no' user instructs the module not to use ps2pdf
10670#
10671# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10672#
10673AC_DEFUN([XORG_WITH_PS2PDF],[
10674AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10675m4_define([_defopt], m4_default([$1], [auto]))
10676AC_ARG_WITH(ps2pdf,
10677	AS_HELP_STRING([--with-ps2pdf],
10678	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10679	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10680m4_undefine([_defopt])
10681
10682if test "x$use_ps2pdf" = x"auto"; then
10683   AC_PATH_PROG([PS2PDF], [ps2pdf])
10684   if test "x$PS2PDF" = "x"; then
10685        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10686	have_ps2pdf=no
10687   else
10688        have_ps2pdf=yes
10689   fi
10690elif test "x$use_ps2pdf" = x"yes" ; then
10691   AC_PATH_PROG([PS2PDF], [ps2pdf])
10692   if test "x$PS2PDF" = "x"; then
10693        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10694   fi
10695   have_ps2pdf=yes
10696elif test "x$use_ps2pdf" = x"no" ; then
10697   if test "x$PS2PDF" != "x"; then
10698      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10699   fi
10700   have_ps2pdf=no
10701else
10702   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10703fi
10704AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10705]) # XORG_WITH_PS2PDF
10706
10707# XORG_ENABLE_DOCS (enable_docs=yes)
10708# ----------------
10709# Minimum version: 1.6.0
10710#
10711# Documentation tools are not always available on all platforms and sometimes
10712# not at the appropriate level. This macro enables a builder to skip all
10713# documentation targets except traditional man pages.
10714# Combined with the specific tool checking macros XORG_WITH_*, it provides
10715# maximum flexibilty in controlling documentation building.
10716# Refer to:
10717# XORG_WITH_XMLTO         --with-xmlto
10718# XORG_WITH_ASCIIDOC      --with-asciidoc
10719# XORG_WITH_DOXYGEN       --with-doxygen
10720# XORG_WITH_FOP           --with-fop
10721# XORG_WITH_GROFF         --with-groff
10722# XORG_WITH_PS2PDF        --with-ps2pdf
10723#
10724# Interface to module:
10725# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10726# --enable-docs: 'yes' user instructs the module to generate docs
10727#		 'no' user instructs the module not to generate docs
10728# parm1:	specify the default value, yes or no.
10729#
10730AC_DEFUN([XORG_ENABLE_DOCS],[
10731m4_define([docs_default], m4_default([$1], [yes]))
10732AC_ARG_ENABLE(docs,
10733	AS_HELP_STRING([--enable-docs],
10734	   [Enable building the documentation (default: ]docs_default[)]),
10735	   [build_docs=$enableval], [build_docs=]docs_default)
10736m4_undefine([docs_default])
10737AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10738AC_MSG_CHECKING([whether to build documentation])
10739AC_MSG_RESULT([$build_docs])
10740]) # XORG_ENABLE_DOCS
10741
10742# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10743# ----------------
10744# Minimum version: 1.6.0
10745#
10746# This macro enables a builder to skip all developer documentation.
10747# Combined with the specific tool checking macros XORG_WITH_*, it provides
10748# maximum flexibilty in controlling documentation building.
10749# Refer to:
10750# XORG_WITH_XMLTO         --with-xmlto
10751# XORG_WITH_ASCIIDOC      --with-asciidoc
10752# XORG_WITH_DOXYGEN       --with-doxygen
10753# XORG_WITH_FOP           --with-fop
10754# XORG_WITH_GROFF         --with-groff
10755# XORG_WITH_PS2PDF        --with-ps2pdf
10756#
10757# Interface to module:
10758# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10759# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10760#			'no' user instructs the module not to generate developer docs
10761# parm1:		specify the default value, yes or no.
10762#
10763AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10764m4_define([devel_default], m4_default([$1], [yes]))
10765AC_ARG_ENABLE(devel-docs,
10766	AS_HELP_STRING([--enable-devel-docs],
10767	   [Enable building the developer documentation (default: ]devel_default[)]),
10768	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10769m4_undefine([devel_default])
10770AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10771AC_MSG_CHECKING([whether to build developer documentation])
10772AC_MSG_RESULT([$build_devel_docs])
10773]) # XORG_ENABLE_DEVEL_DOCS
10774
10775# XORG_ENABLE_SPECS (enable_specs=yes)
10776# ----------------
10777# Minimum version: 1.6.0
10778#
10779# This macro enables a builder to skip all functional specification targets.
10780# Combined with the specific tool checking macros XORG_WITH_*, it provides
10781# maximum flexibilty in controlling documentation building.
10782# Refer to:
10783# XORG_WITH_XMLTO         --with-xmlto
10784# XORG_WITH_ASCIIDOC      --with-asciidoc
10785# XORG_WITH_DOXYGEN       --with-doxygen
10786# XORG_WITH_FOP           --with-fop
10787# XORG_WITH_GROFF         --with-groff
10788# XORG_WITH_PS2PDF        --with-ps2pdf
10789#
10790# Interface to module:
10791# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10792# --enable-specs:	'yes' user instructs the module to generate specs
10793#			'no' user instructs the module not to generate specs
10794# parm1:		specify the default value, yes or no.
10795#
10796AC_DEFUN([XORG_ENABLE_SPECS],[
10797m4_define([spec_default], m4_default([$1], [yes]))
10798AC_ARG_ENABLE(specs,
10799	AS_HELP_STRING([--enable-specs],
10800	   [Enable building the specs (default: ]spec_default[)]),
10801	   [build_specs=$enableval], [build_specs=]spec_default)
10802m4_undefine([spec_default])
10803AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10804AC_MSG_CHECKING([whether to build functional specifications])
10805AC_MSG_RESULT([$build_specs])
10806]) # XORG_ENABLE_SPECS
10807
10808# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10809# ----------------------------------------------
10810# Minimum version: 1.13.0
10811#
10812# This macro enables a builder to enable/disable unit testing
10813# It makes no assumption about the test cases implementation
10814# Test cases may or may not use Automake "Support for test suites"
10815# They may or may not use the software utility library GLib
10816#
10817# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10818# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10819# The variable enable_unit_tests is used by other macros in this file.
10820#
10821# Interface to module:
10822# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10823# enable_unit_tests:    used in configure.ac for additional configuration
10824# --enable-unit-tests:	'yes' user instructs the module to build tests
10825#			'no' user instructs the module not to build tests
10826# parm1:		specify the default value, yes or no.
10827#
10828AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10829AC_BEFORE([$0], [XORG_WITH_GLIB])
10830AC_BEFORE([$0], [XORG_LD_WRAP])
10831AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10832m4_define([_defopt], m4_default([$1], [auto]))
10833AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10834	[Enable building unit test cases (default: ]_defopt[)]),
10835	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10836m4_undefine([_defopt])
10837AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10838AC_MSG_CHECKING([whether to build unit test cases])
10839AC_MSG_RESULT([$enable_unit_tests])
10840]) # XORG_ENABLE_UNIT_TESTS
10841
10842# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10843# ------------------------------------------------------
10844# Minimum version: 1.17.0
10845#
10846# This macro enables a builder to enable/disable integration testing
10847# It makes no assumption about the test cases' implementation
10848# Test cases may or may not use Automake "Support for test suites"
10849#
10850# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10851# usually requires less dependencies and may be built and run under less
10852# stringent environments than integration tests.
10853#
10854# Interface to module:
10855# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10856# enable_integration_tests:   used in configure.ac for additional configuration
10857# --enable-integration-tests: 'yes' user instructs the module to build tests
10858#                             'no' user instructs the module not to build tests
10859# parm1:                      specify the default value, yes or no.
10860#
10861AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10862AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10863m4_define([_defopt], m4_default([$1], [auto]))
10864AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10865	[Enable building integration test cases (default: ]_defopt[)]),
10866	[enable_integration_tests=$enableval],
10867	[enable_integration_tests=]_defopt)
10868m4_undefine([_defopt])
10869AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10870	[test "x$enable_integration_tests" != xno])
10871AC_MSG_CHECKING([whether to build unit test cases])
10872AC_MSG_RESULT([$enable_integration_tests])
10873]) # XORG_ENABLE_INTEGRATION_TESTS
10874
10875# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10876# ----------------------------------------
10877# Minimum version: 1.13.0
10878#
10879# GLib is a library which provides advanced data structures and functions.
10880# This macro enables a module to test for the presence of Glib.
10881#
10882# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10883# Otherwise the value of $enable_unit_tests is blank.
10884#
10885# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10886# test support usually requires less dependencies and may be built and run under
10887# less stringent environments than integration tests.
10888#
10889# Interface to module:
10890# HAVE_GLIB: used in makefiles to conditionally build targets
10891# with_glib: used in configure.ac to know if GLib has been found
10892# --with-glib:	'yes' user instructs the module to use glib
10893#		'no' user instructs the module not to use glib
10894#
10895AC_DEFUN([XORG_WITH_GLIB],[
10896AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10897m4_define([_defopt], m4_default([$2], [auto]))
10898AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10899	[Use GLib library for unit testing (default: ]_defopt[)]),
10900	[with_glib=$withval], [with_glib=]_defopt)
10901m4_undefine([_defopt])
10902
10903have_glib=no
10904# Do not probe GLib if user explicitly disabled unit testing
10905if test "x$enable_unit_tests" != x"no"; then
10906  # Do not probe GLib if user explicitly disabled it
10907  if test "x$with_glib" != x"no"; then
10908    m4_ifval(
10909      [$1],
10910      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10911      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10912    )
10913  fi
10914fi
10915
10916# Not having GLib when unit testing has been explicitly requested is an error
10917if test "x$enable_unit_tests" = x"yes"; then
10918  if test "x$have_glib" = x"no"; then
10919    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10920  fi
10921fi
10922
10923# Having unit testing disabled when GLib has been explicitly requested is an error
10924if test "x$enable_unit_tests" = x"no"; then
10925  if test "x$with_glib" = x"yes"; then
10926    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10927  fi
10928fi
10929
10930# Not having GLib when it has been explicitly requested is an error
10931if test "x$with_glib" = x"yes"; then
10932  if test "x$have_glib" = x"no"; then
10933    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10934  fi
10935fi
10936
10937AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10938]) # XORG_WITH_GLIB
10939
10940# XORG_LD_WRAP([required|optional])
10941# ---------------------------------
10942# Minimum version: 1.13.0
10943#
10944# Check if linker supports -wrap, passed via compiler flags
10945#
10946# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10947# Otherwise the value of $enable_unit_tests is blank.
10948#
10949# Argument added in 1.16.0 - default is "required", to match existing behavior
10950# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10951# available, an argument of "optional" allows use when some unit tests require
10952# ld -wrap and others do not.
10953#
10954AC_DEFUN([XORG_LD_WRAP],[
10955XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10956    [AC_LANG_PROGRAM([#include <stdlib.h>
10957                      void __wrap_exit(int status) { return; }],
10958                     [exit(0);])])
10959# Not having ld wrap when unit testing has been explicitly requested is an error
10960if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10961  if test "x$have_ld_wrap" = x"no"; then
10962    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10963  fi
10964fi
10965AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10966#
10967]) # XORG_LD_WRAP
10968
10969# XORG_CHECK_LINKER_FLAGS
10970# -----------------------
10971# SYNOPSIS
10972#
10973#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10974#
10975# DESCRIPTION
10976#
10977#   Check whether the given linker FLAGS work with the current language's
10978#   linker, or whether they give an error.
10979#
10980#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10981#   success/failure.
10982#
10983#   PROGRAM-SOURCE is the program source to link with, if needed
10984#
10985#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10986#
10987# LICENSE
10988#
10989#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10990#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10991#   Copyright (c) 2009 Matteo Frigo
10992#
10993#   This program is free software: you can redistribute it and/or modify it
10994#   under the terms of the GNU General Public License as published by the
10995#   Free Software Foundation, either version 3 of the License, or (at your
10996#   option) any later version.
10997#
10998#   This program is distributed in the hope that it will be useful, but
10999#   WITHOUT ANY WARRANTY; without even the implied warranty of
11000#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11001#   Public License for more details.
11002#
11003#   You should have received a copy of the GNU General Public License along
11004#   with this program. If not, see <http://www.gnu.org/licenses/>.
11005#
11006#   As a special exception, the respective Autoconf Macro's copyright owner
11007#   gives unlimited permission to copy, distribute and modify the configure
11008#   scripts that are the output of Autoconf when processing the Macro. You
11009#   need not follow the terms of the GNU General Public License when using
11010#   or distributing such scripts, even though portions of the text of the
11011#   Macro appear in them. The GNU General Public License (GPL) does govern
11012#   all other use of the material that constitutes the Autoconf Macro.
11013#
11014#   This special exception to the GPL applies to versions of the Autoconf
11015#   Macro released by the Autoconf Archive. When you make and distribute a
11016#   modified version of the Autoconf Macro, you may extend this special
11017#   exception to the GPL to apply to your modified version as well.#
11018AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11019[AC_MSG_CHECKING([whether the linker accepts $1])
11020dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11021AS_LITERAL_IF([$1],
11022  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11023      ax_save_FLAGS=$LDFLAGS
11024      LDFLAGS="$1"
11025      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11026        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11027        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11028      LDFLAGS=$ax_save_FLAGS])],
11029  [ax_save_FLAGS=$LDFLAGS
11030   LDFLAGS="$1"
11031   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11032     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11033     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11034   LDFLAGS=$ax_save_FLAGS])
11035eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11036AC_MSG_RESULT($xorg_check_linker_flags)
11037if test "x$xorg_check_linker_flags" = xyes; then
11038	m4_default([$2], :)
11039else
11040	m4_default([$3], :)
11041fi
11042]) # XORG_CHECK_LINKER_FLAGS
11043
11044# XORG_MEMORY_CHECK_FLAGS
11045# -----------------------
11046# Minimum version: 1.16.0
11047#
11048# This macro attempts to find appropriate memory checking functionality
11049# for various platforms which unit testing code may use to catch various
11050# forms of memory allocation and access errors in testing.
11051#
11052# Interface to module:
11053# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11054#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11055#
11056# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11057#
11058AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11059
11060AC_REQUIRE([AC_CANONICAL_HOST])
11061AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11062           [Environment variables to enable memory checking in tests])
11063
11064# Check for different types of support on different platforms
11065case $host_os in
11066    solaris*)
11067        AC_CHECK_LIB([umem], [umem_alloc],
11068            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11069        ;;
11070    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11071        # both directly and inverted, so should not be 0 or 255.
11072        malloc_debug_env='MALLOC_PERTURB_=15'
11073        ;;
11074    darwin*)
11075        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11076        ;;
11077    *bsd*)
11078        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11079        ;;
11080esac
11081
11082# User supplied flags override default flags
11083if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11084    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11085fi
11086
11087AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11088]) # XORG_WITH_LINT
11089
11090# XORG_CHECK_MALLOC_ZERO
11091# ----------------------
11092# Minimum version: 1.0.0
11093#
11094# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11095# malloc(0) returns NULL.  Packages should add one of these cflags to
11096# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11097AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11098AC_ARG_ENABLE(malloc0returnsnull,
11099	AS_HELP_STRING([--enable-malloc0returnsnull],
11100		       [malloc(0) returns NULL (default: auto)]),
11101	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11102	[MALLOC_ZERO_RETURNS_NULL=auto])
11103
11104AC_MSG_CHECKING([whether malloc(0) returns NULL])
11105if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11106	AC_RUN_IFELSE([AC_LANG_PROGRAM([
11107#include <stdlib.h>
11108],[
11109    char *m0, *r0, *c0, *p;
11110    m0 = malloc(0);
11111    p = malloc(10);
11112    r0 = realloc(p,0);
11113    c0 = calloc(0,10);
11114    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11115])],
11116		[MALLOC_ZERO_RETURNS_NULL=yes],
11117		[MALLOC_ZERO_RETURNS_NULL=no],
11118		[MALLOC_ZERO_RETURNS_NULL=yes])
11119fi
11120AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11121
11122if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11123	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11124	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11125	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11126else
11127	MALLOC_ZERO_CFLAGS=""
11128	XMALLOC_ZERO_CFLAGS=""
11129	XTMALLOC_ZERO_CFLAGS=""
11130fi
11131
11132AC_SUBST([MALLOC_ZERO_CFLAGS])
11133AC_SUBST([XMALLOC_ZERO_CFLAGS])
11134AC_SUBST([XTMALLOC_ZERO_CFLAGS])
11135]) # XORG_CHECK_MALLOC_ZERO
11136
11137# XORG_WITH_LINT()
11138# ----------------
11139# Minimum version: 1.1.0
11140#
11141# This macro enables the use of a tool that flags some suspicious and
11142# non-portable constructs (likely to be bugs) in C language source code.
11143# It will attempt to locate the tool and use appropriate options.
11144# There are various lint type tools on different platforms.
11145#
11146# Interface to module:
11147# LINT:		returns the path to the tool found on the platform
11148#		or the value set to LINT on the configure cmd line
11149#		also an Automake conditional
11150# LINT_FLAGS:	an Automake variable with appropriate flags
11151#
11152# --with-lint:	'yes' user instructs the module to use lint
11153#		'no' user instructs the module not to use lint (default)
11154#
11155# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11156# If the user sets the value of LINT_FLAGS, they are used verbatim.
11157#
11158AC_DEFUN([XORG_WITH_LINT],[
11159
11160AC_ARG_VAR([LINT], [Path to a lint-style command])
11161AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11162AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11163		[Use a lint-style source code checker (default: disabled)])],
11164		[use_lint=$withval], [use_lint=no])
11165
11166# Obtain platform specific info like program name and options
11167# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11168case $host_os in
11169  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11170	lint_name=splint
11171	lint_options="-badflag"
11172	;;
11173  *freebsd* | *netbsd*)
11174	lint_name=lint
11175	lint_options="-u -b"
11176	;;
11177  *solaris*)
11178	lint_name=lint
11179	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11180	;;
11181esac
11182
11183# Test for the presence of the program (either guessed by the code or spelled out by the user)
11184if test "x$use_lint" = x"yes" ; then
11185   AC_PATH_PROG([LINT], [$lint_name])
11186   if test "x$LINT" = "x"; then
11187        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11188   fi
11189elif test "x$use_lint" = x"no" ; then
11190   if test "x$LINT" != "x"; then
11191      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11192   fi
11193else
11194   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11195fi
11196
11197# User supplied flags override default flags
11198if test "x$LINT_FLAGS" != "x"; then
11199   lint_options=$LINT_FLAGS
11200fi
11201
11202AC_SUBST([LINT_FLAGS],[$lint_options])
11203AM_CONDITIONAL(LINT, [test "x$LINT" != x])
11204
11205]) # XORG_WITH_LINT
11206
11207# XORG_LINT_LIBRARY(LIBNAME)
11208# --------------------------
11209# Minimum version: 1.1.0
11210#
11211# Sets up flags for building lint libraries for checking programs that call
11212# functions in the library.
11213#
11214# Interface to module:
11215# LINTLIB		- Automake variable with the name of lint library file to make
11216# MAKE_LINT_LIB		- Automake conditional
11217#
11218# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11219#			  - 'no' user instructs the module not to create a lint library (default)
11220
11221AC_DEFUN([XORG_LINT_LIBRARY],[
11222AC_REQUIRE([XORG_WITH_LINT])
11223AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11224	[Create lint library (default: disabled)])],
11225	[make_lint_lib=$enableval], [make_lint_lib=no])
11226
11227if test "x$make_lint_lib" = x"yes" ; then
11228   LINTLIB=llib-l$1.ln
11229   if test "x$LINT" = "x"; then
11230        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11231   fi
11232elif test "x$make_lint_lib" != x"no" ; then
11233   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11234fi
11235
11236AC_SUBST(LINTLIB)
11237AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11238
11239]) # XORG_LINT_LIBRARY
11240
11241# XORG_COMPILER_BRAND
11242# -------------------
11243# Minimum version: 1.14.0
11244#
11245# Checks for various brands of compilers and sets flags as appropriate:
11246#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11247#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11248#   clang compiler - sets CLANGCC to "yes"
11249#   Intel compiler - sets INTELCC to "yes"
11250#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11251#
11252AC_DEFUN([XORG_COMPILER_BRAND], [
11253AC_LANG_CASE(
11254	[C], [
11255		AC_REQUIRE([AC_PROG_CC_C99])
11256	],
11257	[C++], [
11258		AC_REQUIRE([AC_PROG_CXX])
11259	]
11260)
11261AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11262AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11263AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11264]) # XORG_COMPILER_BRAND
11265
11266# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11267# ---------------
11268# Minimum version: 1.16.0
11269#
11270# Test if the compiler works when passed the given flag as a command line argument.
11271# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11272# next flag in the list until there are no more options.
11273#
11274# Note that this does not guarantee that the compiler supports the flag as some
11275# compilers will simply ignore arguments that they do not understand, but we do
11276# attempt to weed out false positives by using -Werror=unknown-warning-option and
11277# -Werror=unused-command-line-argument
11278#
11279AC_DEFUN([XORG_TESTSET_CFLAG], [
11280m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11281m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11282
11283AC_LANG_COMPILER_REQUIRE
11284
11285AC_LANG_CASE(
11286	[C], [
11287		AC_REQUIRE([AC_PROG_CC_C99])
11288		define([PREFIX], [C])
11289		define([CACHE_PREFIX], [cc])
11290		define([COMPILER], [$CC])
11291	],
11292	[C++], [
11293		define([PREFIX], [CXX])
11294		define([CACHE_PREFIX], [cxx])
11295		define([COMPILER], [$CXX])
11296	]
11297)
11298
11299[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11300
11301if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11302	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11303	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11304			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11305			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11306					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11307					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11308	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11309	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11310fi
11311
11312if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11313	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11314		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11315	fi
11316	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11317	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11318			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11319			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11320					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11321					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11322	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11323	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11324fi
11325
11326found="no"
11327m4_foreach([flag], m4_cdr($@), [
11328	if test $found = "no" ; then
11329		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11330			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11331		fi
11332
11333		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11334			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11335		fi
11336
11337		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11338
11339dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11340		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11341		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11342		AC_CACHE_VAL($cacheid,
11343			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11344					     [eval $cacheid=yes],
11345					     [eval $cacheid=no])])
11346
11347		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11348
11349		eval supported=\$$cacheid
11350		AC_MSG_RESULT([$supported])
11351		if test "$supported" = "yes" ; then
11352			$1="$$1 ]flag["
11353			found="yes"
11354		fi
11355	fi
11356])
11357]) # XORG_TESTSET_CFLAG
11358
11359# XORG_COMPILER_FLAGS
11360# ---------------
11361# Minimum version: 1.16.0
11362#
11363# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11364# arguments supported by the selected compiler which do NOT alter the generated
11365# code.  These arguments will cause the compiler to print various warnings
11366# during compilation AND turn a conservative set of warnings into errors.
11367#
11368# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11369# future versions of util-macros as options are added to new compilers.
11370#
11371AC_DEFUN([XORG_COMPILER_FLAGS], [
11372AC_REQUIRE([XORG_COMPILER_BRAND])
11373
11374AC_ARG_ENABLE(selective-werror,
11375              AS_HELP_STRING([--disable-selective-werror],
11376                             [Turn off selective compiler errors. (default: enabled)]),
11377              [SELECTIVE_WERROR=$enableval],
11378              [SELECTIVE_WERROR=yes])
11379
11380AC_LANG_CASE(
11381        [C], [
11382                define([PREFIX], [C])
11383        ],
11384        [C++], [
11385                define([PREFIX], [CXX])
11386        ]
11387)
11388# -v is too short to test reliably with XORG_TESTSET_CFLAG
11389if test "x$SUNCC" = "xyes"; then
11390    [BASE_]PREFIX[FLAGS]="-v"
11391else
11392    [BASE_]PREFIX[FLAGS]=""
11393fi
11394
11395# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11396XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11397XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11398XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11399XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11400
11401AC_LANG_CASE(
11402	[C], [
11403		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11404		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11405		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11406		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11407		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11408		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11409	]
11410)
11411
11412# This chunk adds additional warnings that could catch undesired effects.
11413XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11414XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11415XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11416XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11417XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11418XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11419XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11420
11421# These are currently disabled because they are noisy.  They will be enabled
11422# in the future once the codebase is sufficiently modernized to silence
11423# them.  For now, I don't want them to drown out the other warnings.
11424# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11425# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11426# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11427
11428# Turn some warnings into errors, so we don't accidently get successful builds
11429# when there are problems that should be fixed.
11430
11431if test "x$SELECTIVE_WERROR" = "xyes" ; then
11432XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11433XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11434XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11435XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11436XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11437XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11438XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11439XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11440XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11441XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11442XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11443XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11444XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11445else
11446AC_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])
11447XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11448XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11449XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11450XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11451XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11452XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11453XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11454XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11455XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11456XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11457XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11458XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11459XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11460fi
11461
11462AC_SUBST([BASE_]PREFIX[FLAGS])
11463]) # XORG_COMPILER_FLAGS
11464
11465# XORG_CWARNFLAGS
11466# ---------------
11467# Minimum version: 1.2.0
11468# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11469#
11470# Defines CWARNFLAGS to enable C compiler warnings.
11471#
11472# This function is deprecated because it defines -fno-strict-aliasing
11473# which alters the code generated by the compiler.  If -fno-strict-aliasing
11474# is needed, then it should be added explicitly in the module when
11475# it is updated to use BASE_CFLAGS.
11476#
11477AC_DEFUN([XORG_CWARNFLAGS], [
11478AC_REQUIRE([XORG_COMPILER_FLAGS])
11479AC_REQUIRE([XORG_COMPILER_BRAND])
11480AC_LANG_CASE(
11481	[C], [
11482		CWARNFLAGS="$BASE_CFLAGS"
11483		if  test "x$GCC" = xyes ; then
11484		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11485		fi
11486		AC_SUBST(CWARNFLAGS)
11487	]
11488)
11489]) # XORG_CWARNFLAGS
11490
11491# XORG_STRICT_OPTION
11492# -----------------------
11493# Minimum version: 1.3.0
11494#
11495# Add configure option to enable strict compilation flags, such as treating
11496# warnings as fatal errors.
11497# If --enable-strict-compilation is passed to configure, adds strict flags to
11498# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11499#
11500# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11501# when strict compilation is unconditionally desired.
11502AC_DEFUN([XORG_STRICT_OPTION], [
11503AC_REQUIRE([XORG_CWARNFLAGS])
11504AC_REQUIRE([XORG_COMPILER_FLAGS])
11505
11506AC_ARG_ENABLE(strict-compilation,
11507			  AS_HELP_STRING([--enable-strict-compilation],
11508			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11509			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11510
11511AC_LANG_CASE(
11512        [C], [
11513                define([PREFIX], [C])
11514        ],
11515        [C++], [
11516                define([PREFIX], [CXX])
11517        ]
11518)
11519
11520[STRICT_]PREFIX[FLAGS]=""
11521XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11522XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11523
11524# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11525# activate it with -Werror, so we add it here explicitly.
11526XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11527
11528if test "x$STRICT_COMPILE" = "xyes"; then
11529    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11530    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11531fi
11532AC_SUBST([STRICT_]PREFIX[FLAGS])
11533AC_SUBST([BASE_]PREFIX[FLAGS])
11534AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11535]) # XORG_STRICT_OPTION
11536
11537# XORG_DEFAULT_OPTIONS
11538# --------------------
11539# Minimum version: 1.3.0
11540#
11541# Defines default options for X.Org modules.
11542#
11543AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11544AC_REQUIRE([AC_PROG_INSTALL])
11545XORG_COMPILER_FLAGS
11546XORG_CWARNFLAGS
11547XORG_STRICT_OPTION
11548XORG_RELEASE_VERSION
11549XORG_CHANGELOG
11550XORG_INSTALL
11551XORG_MANPAGE_SECTIONS
11552m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11553    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11554]) # XORG_DEFAULT_OPTIONS
11555
11556# XORG_INSTALL()
11557# ----------------
11558# Minimum version: 1.4.0
11559#
11560# Defines the variable INSTALL_CMD as the command to copy
11561# INSTALL from $prefix/share/util-macros.
11562#
11563AC_DEFUN([XORG_INSTALL], [
11564AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11565macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11566INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11567mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11568|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11569echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11570AC_SUBST([INSTALL_CMD])
11571]) # XORG_INSTALL
11572dnl Copyright 2005 Red Hat, Inc
11573dnl
11574dnl Permission to use, copy, modify, distribute, and sell this software and its
11575dnl documentation for any purpose is hereby granted without fee, provided that
11576dnl the above copyright notice appear in all copies and that both that
11577dnl copyright notice and this permission notice appear in supporting
11578dnl documentation.
11579dnl
11580dnl The above copyright notice and this permission notice shall be included
11581dnl in all copies or substantial portions of the Software.
11582dnl
11583dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11584dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11585dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11586dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11587dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11588dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11589dnl OTHER DEALINGS IN THE SOFTWARE.
11590dnl
11591dnl Except as contained in this notice, the name of the copyright holders shall
11592dnl not be used in advertising or otherwise to promote the sale, use or
11593dnl other dealings in this Software without prior written authorization
11594dnl from the copyright holders.
11595dnl
11596
11597# XORG_RELEASE_VERSION
11598# --------------------
11599# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11600 
11601AC_DEFUN([XORG_RELEASE_VERSION],[
11602	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11603		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11604		[Major version of this package])
11605	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11606	if test "x$PVM" = "x"; then
11607		PVM="0"
11608	fi
11609	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11610		[$PVM],
11611		[Minor version of this package])
11612	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11613	if test "x$PVP" = "x"; then
11614		PVP="0"
11615	fi
11616	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11617		[$PVP],
11618		[Patch version of this package])
11619])
11620
11621# XORG_CHANGELOG()
11622# ----------------
11623# Minimum version: 1.2.0
11624#
11625# Defines the variable CHANGELOG_CMD as the command to generate
11626# ChangeLog from git.
11627#
11628#
11629AC_DEFUN([XORG_CHANGELOG], [
11630CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11631mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11632|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11633echo 'git directory not found: installing possibly empty changelog.' >&2)"
11634AC_SUBST([CHANGELOG_CMD])
11635]) # XORG_CHANGELOG
11636
11637