aclocal.m4 revision af9a7ee5
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
1040# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1041#
1042#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1043#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1044#                 Foundation, Inc.
1045#   Written by Gordon Matzigkeit, 1996
1046#
1047# This file is free software; the Free Software Foundation gives
1048# unlimited permission to copy and/or distribute it, with or without
1049# modifications, as long as this notice is preserved.
1050
1051m4_define([_LT_COPYING], [dnl
1052#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1053#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1054#                 Foundation, Inc.
1055#   Written by Gordon Matzigkeit, 1996
1056#
1057#   This file is part of GNU Libtool.
1058#
1059# GNU Libtool is free software; you can redistribute it and/or
1060# modify it under the terms of the GNU General Public License as
1061# published by the Free Software Foundation; either version 2 of
1062# the License, or (at your option) any later version.
1063#
1064# As a special exception to the GNU General Public License,
1065# if you distribute this file as part of a program or library that
1066# is built using GNU Libtool, you may include this file under the
1067# same distribution terms that you use for the rest of that program.
1068#
1069# GNU Libtool is distributed in the hope that it will be useful,
1070# but WITHOUT ANY WARRANTY; without even the implied warranty of
1071# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1072# GNU General Public License for more details.
1073#
1074# You should have received a copy of the GNU General Public License
1075# along with GNU Libtool; see the file COPYING.  If not, a copy
1076# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1077# obtained by writing to the Free Software Foundation, Inc.,
1078# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1079])
1080
1081# serial 57 LT_INIT
1082
1083
1084# LT_PREREQ(VERSION)
1085# ------------------
1086# Complain and exit if this libtool version is less that VERSION.
1087m4_defun([LT_PREREQ],
1088[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1089       [m4_default([$3],
1090		   [m4_fatal([Libtool version $1 or higher is required],
1091		             63)])],
1092       [$2])])
1093
1094
1095# _LT_CHECK_BUILDDIR
1096# ------------------
1097# Complain if the absolute build directory name contains unusual characters
1098m4_defun([_LT_CHECK_BUILDDIR],
1099[case `pwd` in
1100  *\ * | *\	*)
1101    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1102esac
1103])
1104
1105
1106# LT_INIT([OPTIONS])
1107# ------------------
1108AC_DEFUN([LT_INIT],
1109[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1110AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1111AC_BEFORE([$0], [LT_LANG])dnl
1112AC_BEFORE([$0], [LT_OUTPUT])dnl
1113AC_BEFORE([$0], [LTDL_INIT])dnl
1114m4_require([_LT_CHECK_BUILDDIR])dnl
1115
1116dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1117m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1118m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1119dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1120dnl unless we require an AC_DEFUNed macro:
1121AC_REQUIRE([LTOPTIONS_VERSION])dnl
1122AC_REQUIRE([LTSUGAR_VERSION])dnl
1123AC_REQUIRE([LTVERSION_VERSION])dnl
1124AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1125m4_require([_LT_PROG_LTMAIN])dnl
1126
1127_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1128
1129dnl Parse OPTIONS
1130_LT_SET_OPTIONS([$0], [$1])
1131
1132# This can be used to rebuild libtool when needed
1133LIBTOOL_DEPS="$ltmain"
1134
1135# Always use our own libtool.
1136LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1137AC_SUBST(LIBTOOL)dnl
1138
1139_LT_SETUP
1140
1141# Only expand once:
1142m4_define([LT_INIT])
1143])# LT_INIT
1144
1145# Old names:
1146AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1147AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1148dnl aclocal-1.4 backwards compatibility:
1149dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1150dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1151
1152
1153# _LT_CC_BASENAME(CC)
1154# -------------------
1155# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1156m4_defun([_LT_CC_BASENAME],
1157[for cc_temp in $1""; do
1158  case $cc_temp in
1159    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1160    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1161    \-*) ;;
1162    *) break;;
1163  esac
1164done
1165cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1166])
1167
1168
1169# _LT_FILEUTILS_DEFAULTS
1170# ----------------------
1171# It is okay to use these file commands and assume they have been set
1172# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1173m4_defun([_LT_FILEUTILS_DEFAULTS],
1174[: ${CP="cp -f"}
1175: ${MV="mv -f"}
1176: ${RM="rm -f"}
1177])# _LT_FILEUTILS_DEFAULTS
1178
1179
1180# _LT_SETUP
1181# ---------
1182m4_defun([_LT_SETUP],
1183[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1184AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1185AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1186AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1187
1188_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1189dnl
1190_LT_DECL([], [host_alias], [0], [The host system])dnl
1191_LT_DECL([], [host], [0])dnl
1192_LT_DECL([], [host_os], [0])dnl
1193dnl
1194_LT_DECL([], [build_alias], [0], [The build system])dnl
1195_LT_DECL([], [build], [0])dnl
1196_LT_DECL([], [build_os], [0])dnl
1197dnl
1198AC_REQUIRE([AC_PROG_CC])dnl
1199AC_REQUIRE([LT_PATH_LD])dnl
1200AC_REQUIRE([LT_PATH_NM])dnl
1201dnl
1202AC_REQUIRE([AC_PROG_LN_S])dnl
1203test -z "$LN_S" && LN_S="ln -s"
1204_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1205dnl
1206AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1207_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1208_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1209dnl
1210m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1211m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1212m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1213m4_require([_LT_CMD_RELOAD])dnl
1214m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1215m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1216m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1217m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1218m4_require([_LT_WITH_SYSROOT])dnl
1219
1220_LT_CONFIG_LIBTOOL_INIT([
1221# See if we are running on zsh, and set the options which allow our
1222# commands through without removal of \ escapes INIT.
1223if test -n "\${ZSH_VERSION+set}" ; then
1224   setopt NO_GLOB_SUBST
1225fi
1226])
1227if test -n "${ZSH_VERSION+set}" ; then
1228   setopt NO_GLOB_SUBST
1229fi
1230
1231_LT_CHECK_OBJDIR
1232
1233m4_require([_LT_TAG_COMPILER])dnl
1234
1235case $host_os in
1236aix3*)
1237  # AIX sometimes has problems with the GCC collect2 program.  For some
1238  # reason, if we set the COLLECT_NAMES environment variable, the problems
1239  # vanish in a puff of smoke.
1240  if test "X${COLLECT_NAMES+set}" != Xset; then
1241    COLLECT_NAMES=
1242    export COLLECT_NAMES
1243  fi
1244  ;;
1245esac
1246
1247# Global variables:
1248ofile=libtool
1249can_build_shared=yes
1250
1251# All known linkers require a `.a' archive for static linking (except MSVC,
1252# which needs '.lib').
1253libext=a
1254
1255with_gnu_ld="$lt_cv_prog_gnu_ld"
1256
1257old_CC="$CC"
1258old_CFLAGS="$CFLAGS"
1259
1260# Set sane defaults for various variables
1261test -z "$CC" && CC=cc
1262test -z "$LTCC" && LTCC=$CC
1263test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1264test -z "$LD" && LD=ld
1265test -z "$ac_objext" && ac_objext=o
1266
1267_LT_CC_BASENAME([$compiler])
1268
1269# Only perform the check for file, if the check method requires it
1270test -z "$MAGIC_CMD" && MAGIC_CMD=file
1271case $deplibs_check_method in
1272file_magic*)
1273  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1274    _LT_PATH_MAGIC
1275  fi
1276  ;;
1277esac
1278
1279# Use C for the default configuration in the libtool script
1280LT_SUPPORTED_TAG([CC])
1281_LT_LANG_C_CONFIG
1282_LT_LANG_DEFAULT_CONFIG
1283_LT_CONFIG_COMMANDS
1284])# _LT_SETUP
1285
1286
1287# _LT_PREPARE_SED_QUOTE_VARS
1288# --------------------------
1289# Define a few sed substitution that help us do robust quoting.
1290m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1291[# Backslashify metacharacters that are still active within
1292# double-quoted strings.
1293sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1294
1295# Same as above, but do not quote variable references.
1296double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1297
1298# Sed substitution to delay expansion of an escaped shell variable in a
1299# double_quote_subst'ed string.
1300delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1301
1302# Sed substitution to delay expansion of an escaped single quote.
1303delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1304
1305# Sed substitution to avoid accidental globbing in evaled expressions
1306no_glob_subst='s/\*/\\\*/g'
1307])
1308
1309# _LT_PROG_LTMAIN
1310# ---------------
1311# Note that this code is called both from `configure', and `config.status'
1312# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1313# `config.status' has no value for ac_aux_dir unless we are using Automake,
1314# so we pass a copy along to make sure it has a sensible value anyway.
1315m4_defun([_LT_PROG_LTMAIN],
1316[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1317_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1318ltmain="$ac_aux_dir/ltmain.sh"
1319])# _LT_PROG_LTMAIN
1320
1321
1322
1323# So that we can recreate a full libtool script including additional
1324# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1325# in macros and then make a single call at the end using the `libtool'
1326# label.
1327
1328
1329# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1330# ----------------------------------------
1331# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1332m4_define([_LT_CONFIG_LIBTOOL_INIT],
1333[m4_ifval([$1],
1334          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1335                     [$1
1336])])])
1337
1338# Initialize.
1339m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1340
1341
1342# _LT_CONFIG_LIBTOOL([COMMANDS])
1343# ------------------------------
1344# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1345m4_define([_LT_CONFIG_LIBTOOL],
1346[m4_ifval([$1],
1347          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1348                     [$1
1349])])])
1350
1351# Initialize.
1352m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1353
1354
1355# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1356# -----------------------------------------------------
1357m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1358[_LT_CONFIG_LIBTOOL([$1])
1359_LT_CONFIG_LIBTOOL_INIT([$2])
1360])
1361
1362
1363# _LT_FORMAT_COMMENT([COMMENT])
1364# -----------------------------
1365# Add leading comment marks to the start of each line, and a trailing
1366# full-stop to the whole comment if one is not present already.
1367m4_define([_LT_FORMAT_COMMENT],
1368[m4_ifval([$1], [
1369m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1370              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1371)])
1372
1373
1374
1375
1376
1377# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1378# -------------------------------------------------------------------
1379# CONFIGNAME is the name given to the value in the libtool script.
1380# VARNAME is the (base) name used in the configure script.
1381# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1382# VARNAME.  Any other value will be used directly.
1383m4_define([_LT_DECL],
1384[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1385    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1386	[m4_ifval([$1], [$1], [$2])])
1387    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1388    m4_ifval([$4],
1389	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1390    lt_dict_add_subkey([lt_decl_dict], [$2],
1391	[tagged?], [m4_ifval([$5], [yes], [no])])])
1392])
1393
1394
1395# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1396# --------------------------------------------------------
1397m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1398
1399
1400# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1401# ------------------------------------------------
1402m4_define([lt_decl_tag_varnames],
1403[_lt_decl_filter([tagged?], [yes], $@)])
1404
1405
1406# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1407# ---------------------------------------------------------
1408m4_define([_lt_decl_filter],
1409[m4_case([$#],
1410  [0], [m4_fatal([$0: too few arguments: $#])],
1411  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1412  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1413  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1414  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1415])
1416
1417
1418# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1419# --------------------------------------------------
1420m4_define([lt_decl_quote_varnames],
1421[_lt_decl_filter([value], [1], $@)])
1422
1423
1424# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1425# ---------------------------------------------------
1426m4_define([lt_decl_dquote_varnames],
1427[_lt_decl_filter([value], [2], $@)])
1428
1429
1430# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1431# ---------------------------------------------------
1432m4_define([lt_decl_varnames_tagged],
1433[m4_assert([$# <= 2])dnl
1434_$0(m4_quote(m4_default([$1], [[, ]])),
1435    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1436    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1437m4_define([_lt_decl_varnames_tagged],
1438[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1439
1440
1441# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1442# ------------------------------------------------
1443m4_define([lt_decl_all_varnames],
1444[_$0(m4_quote(m4_default([$1], [[, ]])),
1445     m4_if([$2], [],
1446	   m4_quote(lt_decl_varnames),
1447	m4_quote(m4_shift($@))))[]dnl
1448])
1449m4_define([_lt_decl_all_varnames],
1450[lt_join($@, lt_decl_varnames_tagged([$1],
1451			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1452])
1453
1454
1455# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1456# ------------------------------------
1457# Quote a variable value, and forward it to `config.status' so that its
1458# declaration there will have the same value as in `configure'.  VARNAME
1459# must have a single quote delimited value for this to work.
1460m4_define([_LT_CONFIG_STATUS_DECLARE],
1461[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1462
1463
1464# _LT_CONFIG_STATUS_DECLARATIONS
1465# ------------------------------
1466# We delimit libtool config variables with single quotes, so when
1467# we write them to config.status, we have to be sure to quote all
1468# embedded single quotes properly.  In configure, this macro expands
1469# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1470#
1471#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1472m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1473[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1474    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1475
1476
1477# _LT_LIBTOOL_TAGS
1478# ----------------
1479# Output comment and list of tags supported by the script
1480m4_defun([_LT_LIBTOOL_TAGS],
1481[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1482available_tags="_LT_TAGS"dnl
1483])
1484
1485
1486# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1487# -----------------------------------
1488# Extract the dictionary values for VARNAME (optionally with TAG) and
1489# expand to a commented shell variable setting:
1490#
1491#    # Some comment about what VAR is for.
1492#    visible_name=$lt_internal_name
1493m4_define([_LT_LIBTOOL_DECLARE],
1494[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1495					   [description])))[]dnl
1496m4_pushdef([_libtool_name],
1497    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1498m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1499    [0], [_libtool_name=[$]$1],
1500    [1], [_libtool_name=$lt_[]$1],
1501    [2], [_libtool_name=$lt_[]$1],
1502    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1503m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1504])
1505
1506
1507# _LT_LIBTOOL_CONFIG_VARS
1508# -----------------------
1509# Produce commented declarations of non-tagged libtool config variables
1510# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1511# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1512# section) are produced by _LT_LIBTOOL_TAG_VARS.
1513m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1514[m4_foreach([_lt_var],
1515    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1516    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1517
1518
1519# _LT_LIBTOOL_TAG_VARS(TAG)
1520# -------------------------
1521m4_define([_LT_LIBTOOL_TAG_VARS],
1522[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1523    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1524
1525
1526# _LT_TAGVAR(VARNAME, [TAGNAME])
1527# ------------------------------
1528m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1529
1530
1531# _LT_CONFIG_COMMANDS
1532# -------------------
1533# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1534# variables for single and double quote escaping we saved from calls
1535# to _LT_DECL, we can put quote escaped variables declarations
1536# into `config.status', and then the shell code to quote escape them in
1537# for loops in `config.status'.  Finally, any additional code accumulated
1538# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1539m4_defun([_LT_CONFIG_COMMANDS],
1540[AC_PROVIDE_IFELSE([LT_OUTPUT],
1541	dnl If the libtool generation code has been placed in $CONFIG_LT,
1542	dnl instead of duplicating it all over again into config.status,
1543	dnl then we will have config.status run $CONFIG_LT later, so it
1544	dnl needs to know what name is stored there:
1545        [AC_CONFIG_COMMANDS([libtool],
1546            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1547    dnl If the libtool generation code is destined for config.status,
1548    dnl expand the accumulated commands and init code now:
1549    [AC_CONFIG_COMMANDS([libtool],
1550        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1551])#_LT_CONFIG_COMMANDS
1552
1553
1554# Initialize.
1555m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1556[
1557
1558# The HP-UX ksh and POSIX shell print the target directory to stdout
1559# if CDPATH is set.
1560(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1561
1562sed_quote_subst='$sed_quote_subst'
1563double_quote_subst='$double_quote_subst'
1564delay_variable_subst='$delay_variable_subst'
1565_LT_CONFIG_STATUS_DECLARATIONS
1566LTCC='$LTCC'
1567LTCFLAGS='$LTCFLAGS'
1568compiler='$compiler_DEFAULT'
1569
1570# A function that is used when there is no print builtin or printf.
1571func_fallback_echo ()
1572{
1573  eval 'cat <<_LTECHO_EOF
1574\$[]1
1575_LTECHO_EOF'
1576}
1577
1578# Quote evaled strings.
1579for var in lt_decl_all_varnames([[ \
1580]], lt_decl_quote_varnames); do
1581    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1582    *[[\\\\\\\`\\"\\\$]]*)
1583      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1584      ;;
1585    *)
1586      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1587      ;;
1588    esac
1589done
1590
1591# Double-quote double-evaled strings.
1592for var in lt_decl_all_varnames([[ \
1593]], lt_decl_dquote_varnames); do
1594    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1595    *[[\\\\\\\`\\"\\\$]]*)
1596      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1597      ;;
1598    *)
1599      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1600      ;;
1601    esac
1602done
1603
1604_LT_OUTPUT_LIBTOOL_INIT
1605])
1606
1607# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1608# ------------------------------------
1609# Generate a child script FILE with all initialization necessary to
1610# reuse the environment learned by the parent script, and make the
1611# file executable.  If COMMENT is supplied, it is inserted after the
1612# `#!' sequence but before initialization text begins.  After this
1613# macro, additional text can be appended to FILE to form the body of
1614# the child script.  The macro ends with non-zero status if the
1615# file could not be fully written (such as if the disk is full).
1616m4_ifdef([AS_INIT_GENERATED],
1617[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1618[m4_defun([_LT_GENERATED_FILE_INIT],
1619[m4_require([AS_PREPARE])]dnl
1620[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1621[lt_write_fail=0
1622cat >$1 <<_ASEOF || lt_write_fail=1
1623#! $SHELL
1624# Generated by $as_me.
1625$2
1626SHELL=\${CONFIG_SHELL-$SHELL}
1627export SHELL
1628_ASEOF
1629cat >>$1 <<\_ASEOF || lt_write_fail=1
1630AS_SHELL_SANITIZE
1631_AS_PREPARE
1632exec AS_MESSAGE_FD>&1
1633_ASEOF
1634test $lt_write_fail = 0 && chmod +x $1[]dnl
1635m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1636
1637# LT_OUTPUT
1638# ---------
1639# This macro allows early generation of the libtool script (before
1640# AC_OUTPUT is called), incase it is used in configure for compilation
1641# tests.
1642AC_DEFUN([LT_OUTPUT],
1643[: ${CONFIG_LT=./config.lt}
1644AC_MSG_NOTICE([creating $CONFIG_LT])
1645_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1646[# Run this file to recreate a libtool stub with the current configuration.])
1647
1648cat >>"$CONFIG_LT" <<\_LTEOF
1649lt_cl_silent=false
1650exec AS_MESSAGE_LOG_FD>>config.log
1651{
1652  echo
1653  AS_BOX([Running $as_me.])
1654} >&AS_MESSAGE_LOG_FD
1655
1656lt_cl_help="\
1657\`$as_me' creates a local libtool stub from the current configuration,
1658for use in further configure time tests before the real libtool is
1659generated.
1660
1661Usage: $[0] [[OPTIONS]]
1662
1663  -h, --help      print this help, then exit
1664  -V, --version   print version number, then exit
1665  -q, --quiet     do not print progress messages
1666  -d, --debug     don't remove temporary files
1667
1668Report bugs to <bug-libtool@gnu.org>."
1669
1670lt_cl_version="\
1671m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1672m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1673configured by $[0], generated by m4_PACKAGE_STRING.
1674
1675Copyright (C) 2011 Free Software Foundation, Inc.
1676This config.lt script is free software; the Free Software Foundation
1677gives unlimited permision to copy, distribute and modify it."
1678
1679while test $[#] != 0
1680do
1681  case $[1] in
1682    --version | --v* | -V )
1683      echo "$lt_cl_version"; exit 0 ;;
1684    --help | --h* | -h )
1685      echo "$lt_cl_help"; exit 0 ;;
1686    --debug | --d* | -d )
1687      debug=: ;;
1688    --quiet | --q* | --silent | --s* | -q )
1689      lt_cl_silent=: ;;
1690
1691    -*) AC_MSG_ERROR([unrecognized option: $[1]
1692Try \`$[0] --help' for more information.]) ;;
1693
1694    *) AC_MSG_ERROR([unrecognized argument: $[1]
1695Try \`$[0] --help' for more information.]) ;;
1696  esac
1697  shift
1698done
1699
1700if $lt_cl_silent; then
1701  exec AS_MESSAGE_FD>/dev/null
1702fi
1703_LTEOF
1704
1705cat >>"$CONFIG_LT" <<_LTEOF
1706_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1707_LTEOF
1708
1709cat >>"$CONFIG_LT" <<\_LTEOF
1710AC_MSG_NOTICE([creating $ofile])
1711_LT_OUTPUT_LIBTOOL_COMMANDS
1712AS_EXIT(0)
1713_LTEOF
1714chmod +x "$CONFIG_LT"
1715
1716# configure is writing to config.log, but config.lt does its own redirection,
1717# appending to config.log, which fails on DOS, as config.log is still kept
1718# open by configure.  Here we exec the FD to /dev/null, effectively closing
1719# config.log, so it can be properly (re)opened and appended to by config.lt.
1720lt_cl_success=:
1721test "$silent" = yes &&
1722  lt_config_lt_args="$lt_config_lt_args --quiet"
1723exec AS_MESSAGE_LOG_FD>/dev/null
1724$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1725exec AS_MESSAGE_LOG_FD>>config.log
1726$lt_cl_success || AS_EXIT(1)
1727])# LT_OUTPUT
1728
1729
1730# _LT_CONFIG(TAG)
1731# ---------------
1732# If TAG is the built-in tag, create an initial libtool script with a
1733# default configuration from the untagged config vars.  Otherwise add code
1734# to config.status for appending the configuration named by TAG from the
1735# matching tagged config vars.
1736m4_defun([_LT_CONFIG],
1737[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1738_LT_CONFIG_SAVE_COMMANDS([
1739  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1740  m4_if(_LT_TAG, [C], [
1741    # See if we are running on zsh, and set the options which allow our
1742    # commands through without removal of \ escapes.
1743    if test -n "${ZSH_VERSION+set}" ; then
1744      setopt NO_GLOB_SUBST
1745    fi
1746
1747    cfgfile="${ofile}T"
1748    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1749    $RM "$cfgfile"
1750
1751    cat <<_LT_EOF >> "$cfgfile"
1752#! $SHELL
1753
1754# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1755# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1756# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1757# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1758#
1759_LT_COPYING
1760_LT_LIBTOOL_TAGS
1761
1762# ### BEGIN LIBTOOL CONFIG
1763_LT_LIBTOOL_CONFIG_VARS
1764_LT_LIBTOOL_TAG_VARS
1765# ### END LIBTOOL CONFIG
1766
1767_LT_EOF
1768
1769  case $host_os in
1770  aix3*)
1771    cat <<\_LT_EOF >> "$cfgfile"
1772# AIX sometimes has problems with the GCC collect2 program.  For some
1773# reason, if we set the COLLECT_NAMES environment variable, the problems
1774# vanish in a puff of smoke.
1775if test "X${COLLECT_NAMES+set}" != Xset; then
1776  COLLECT_NAMES=
1777  export COLLECT_NAMES
1778fi
1779_LT_EOF
1780    ;;
1781  esac
1782
1783  _LT_PROG_LTMAIN
1784
1785  # We use sed instead of cat because bash on DJGPP gets confused if
1786  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1787  # text mode, it properly converts lines to CR/LF.  This bash problem
1788  # is reportedly fixed, but why not run on old versions too?
1789  sed '$q' "$ltmain" >> "$cfgfile" \
1790     || (rm -f "$cfgfile"; exit 1)
1791
1792  _LT_PROG_REPLACE_SHELLFNS
1793
1794   mv -f "$cfgfile" "$ofile" ||
1795    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1796  chmod +x "$ofile"
1797],
1798[cat <<_LT_EOF >> "$ofile"
1799
1800dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1801dnl in a comment (ie after a #).
1802# ### BEGIN LIBTOOL TAG CONFIG: $1
1803_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1804# ### END LIBTOOL TAG CONFIG: $1
1805_LT_EOF
1806])dnl /m4_if
1807],
1808[m4_if([$1], [], [
1809    PACKAGE='$PACKAGE'
1810    VERSION='$VERSION'
1811    TIMESTAMP='$TIMESTAMP'
1812    RM='$RM'
1813    ofile='$ofile'], [])
1814])dnl /_LT_CONFIG_SAVE_COMMANDS
1815])# _LT_CONFIG
1816
1817
1818# LT_SUPPORTED_TAG(TAG)
1819# ---------------------
1820# Trace this macro to discover what tags are supported by the libtool
1821# --tag option, using:
1822#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1823AC_DEFUN([LT_SUPPORTED_TAG], [])
1824
1825
1826# C support is built-in for now
1827m4_define([_LT_LANG_C_enabled], [])
1828m4_define([_LT_TAGS], [])
1829
1830
1831# LT_LANG(LANG)
1832# -------------
1833# Enable libtool support for the given language if not already enabled.
1834AC_DEFUN([LT_LANG],
1835[AC_BEFORE([$0], [LT_OUTPUT])dnl
1836m4_case([$1],
1837  [C],			[_LT_LANG(C)],
1838  [C++],		[_LT_LANG(CXX)],
1839  [Go],			[_LT_LANG(GO)],
1840  [Java],		[_LT_LANG(GCJ)],
1841  [Fortran 77],		[_LT_LANG(F77)],
1842  [Fortran],		[_LT_LANG(FC)],
1843  [Windows Resource],	[_LT_LANG(RC)],
1844  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1845    [_LT_LANG($1)],
1846    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1847])# LT_LANG
1848
1849
1850# _LT_LANG(LANGNAME)
1851# ------------------
1852m4_defun([_LT_LANG],
1853[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1854  [LT_SUPPORTED_TAG([$1])dnl
1855  m4_append([_LT_TAGS], [$1 ])dnl
1856  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1857  _LT_LANG_$1_CONFIG($1)])dnl
1858])# _LT_LANG
1859
1860
1861m4_ifndef([AC_PROG_GO], [
1862# NOTE: This macro has been submitted for inclusion into   #
1863#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1864#  a released version of Autoconf we should remove this    #
1865#  macro and use it instead.                               #
1866m4_defun([AC_PROG_GO],
1867[AC_LANG_PUSH(Go)dnl
1868AC_ARG_VAR([GOC],     [Go compiler command])dnl
1869AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1870_AC_ARG_VAR_LDFLAGS()dnl
1871AC_CHECK_TOOL(GOC, gccgo)
1872if test -z "$GOC"; then
1873  if test -n "$ac_tool_prefix"; then
1874    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1875  fi
1876fi
1877if test -z "$GOC"; then
1878  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1879fi
1880])#m4_defun
1881])#m4_ifndef
1882
1883
1884# _LT_LANG_DEFAULT_CONFIG
1885# -----------------------
1886m4_defun([_LT_LANG_DEFAULT_CONFIG],
1887[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1888  [LT_LANG(CXX)],
1889  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1890
1891AC_PROVIDE_IFELSE([AC_PROG_F77],
1892  [LT_LANG(F77)],
1893  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
1894
1895AC_PROVIDE_IFELSE([AC_PROG_FC],
1896  [LT_LANG(FC)],
1897  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
1898
1899dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
1900dnl pulling things in needlessly.
1901AC_PROVIDE_IFELSE([AC_PROG_GCJ],
1902  [LT_LANG(GCJ)],
1903  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1904    [LT_LANG(GCJ)],
1905    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
1906      [LT_LANG(GCJ)],
1907      [m4_ifdef([AC_PROG_GCJ],
1908	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
1909       m4_ifdef([A][M_PROG_GCJ],
1910	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
1911       m4_ifdef([LT_PROG_GCJ],
1912	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
1913
1914AC_PROVIDE_IFELSE([AC_PROG_GO],
1915  [LT_LANG(GO)],
1916  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
1917
1918AC_PROVIDE_IFELSE([LT_PROG_RC],
1919  [LT_LANG(RC)],
1920  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
1921])# _LT_LANG_DEFAULT_CONFIG
1922
1923# Obsolete macros:
1924AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
1925AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
1926AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
1927AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
1928AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
1929dnl aclocal-1.4 backwards compatibility:
1930dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
1931dnl AC_DEFUN([AC_LIBTOOL_F77], [])
1932dnl AC_DEFUN([AC_LIBTOOL_FC], [])
1933dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
1934dnl AC_DEFUN([AC_LIBTOOL_RC], [])
1935
1936
1937# _LT_TAG_COMPILER
1938# ----------------
1939m4_defun([_LT_TAG_COMPILER],
1940[AC_REQUIRE([AC_PROG_CC])dnl
1941
1942_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
1943_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
1944_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
1945_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
1946
1947# If no C compiler was specified, use CC.
1948LTCC=${LTCC-"$CC"}
1949
1950# If no C compiler flags were specified, use CFLAGS.
1951LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1952
1953# Allow CC to be a program name with arguments.
1954compiler=$CC
1955])# _LT_TAG_COMPILER
1956
1957
1958# _LT_COMPILER_BOILERPLATE
1959# ------------------------
1960# Check for compiler boilerplate output or warnings with
1961# the simple compiler test code.
1962m4_defun([_LT_COMPILER_BOILERPLATE],
1963[m4_require([_LT_DECL_SED])dnl
1964ac_outfile=conftest.$ac_objext
1965echo "$lt_simple_compile_test_code" >conftest.$ac_ext
1966eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1967_lt_compiler_boilerplate=`cat conftest.err`
1968$RM conftest*
1969])# _LT_COMPILER_BOILERPLATE
1970
1971
1972# _LT_LINKER_BOILERPLATE
1973# ----------------------
1974# Check for linker boilerplate output or warnings with
1975# the simple link test code.
1976m4_defun([_LT_LINKER_BOILERPLATE],
1977[m4_require([_LT_DECL_SED])dnl
1978ac_outfile=conftest.$ac_objext
1979echo "$lt_simple_link_test_code" >conftest.$ac_ext
1980eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1981_lt_linker_boilerplate=`cat conftest.err`
1982$RM -r conftest*
1983])# _LT_LINKER_BOILERPLATE
1984
1985# _LT_REQUIRED_DARWIN_CHECKS
1986# -------------------------
1987m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
1988  case $host_os in
1989    rhapsody* | darwin*)
1990    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
1991    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
1992    AC_CHECK_TOOL([LIPO], [lipo], [:])
1993    AC_CHECK_TOOL([OTOOL], [otool], [:])
1994    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1995    _LT_DECL([], [DSYMUTIL], [1],
1996      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1997    _LT_DECL([], [NMEDIT], [1],
1998      [Tool to change global to local symbols on Mac OS X])
1999    _LT_DECL([], [LIPO], [1],
2000      [Tool to manipulate fat objects and archives on Mac OS X])
2001    _LT_DECL([], [OTOOL], [1],
2002      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2003    _LT_DECL([], [OTOOL64], [1],
2004      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2005
2006    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2007      [lt_cv_apple_cc_single_mod=no
2008      if test -z "${LT_MULTI_MODULE}"; then
2009	# By default we will add the -single_module flag. You can override
2010	# by either setting the environment variable LT_MULTI_MODULE
2011	# non-empty at configure time, or by adding -multi_module to the
2012	# link flags.
2013	rm -rf libconftest.dylib*
2014	echo "int foo(void){return 1;}" > conftest.c
2015	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2016-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2017	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2018	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2019        _lt_result=$?
2020	# If there is a non-empty error log, and "single_module"
2021	# appears in it, assume the flag caused a linker warning
2022        if test -s conftest.err && $GREP single_module conftest.err; then
2023	  cat conftest.err >&AS_MESSAGE_LOG_FD
2024	# Otherwise, if the output was created with a 0 exit code from
2025	# the compiler, it worked.
2026	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2027	  lt_cv_apple_cc_single_mod=yes
2028	else
2029	  cat conftest.err >&AS_MESSAGE_LOG_FD
2030	fi
2031	rm -rf libconftest.dylib*
2032	rm -f conftest.*
2033      fi])
2034
2035    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2036      [lt_cv_ld_exported_symbols_list],
2037      [lt_cv_ld_exported_symbols_list=no
2038      save_LDFLAGS=$LDFLAGS
2039      echo "_main" > conftest.sym
2040      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2041      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2042	[lt_cv_ld_exported_symbols_list=yes],
2043	[lt_cv_ld_exported_symbols_list=no])
2044	LDFLAGS="$save_LDFLAGS"
2045    ])
2046
2047    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2048      [lt_cv_ld_force_load=no
2049      cat > conftest.c << _LT_EOF
2050int forced_loaded() { return 2;}
2051_LT_EOF
2052      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2053      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2054      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2055      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2056      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2057      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2058      cat > conftest.c << _LT_EOF
2059int main() { return 0;}
2060_LT_EOF
2061      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2062      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2063      _lt_result=$?
2064      if test -s conftest.err && $GREP force_load conftest.err; then
2065	cat conftest.err >&AS_MESSAGE_LOG_FD
2066      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2067	lt_cv_ld_force_load=yes
2068      else
2069	cat conftest.err >&AS_MESSAGE_LOG_FD
2070      fi
2071        rm -f conftest.err libconftest.a conftest conftest.c
2072        rm -rf conftest.dSYM
2073    ])
2074    case $host_os in
2075    rhapsody* | darwin1.[[012]])
2076      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2077    darwin1.*)
2078      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2079    darwin*) # darwin 5.x on
2080      # if running on 10.5 or later, the deployment target defaults
2081      # to the OS version, if on x86, and 10.4, the deployment
2082      # target defaults to 10.4. Don't you love it?
2083      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2084	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2085	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2086	10.[[012]]*)
2087	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2088	10.*)
2089	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2090      esac
2091    ;;
2092  esac
2093    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2094      _lt_dar_single_mod='$single_module'
2095    fi
2096    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2097      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2098    else
2099      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2100    fi
2101    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2102      _lt_dsymutil='~$DSYMUTIL $lib || :'
2103    else
2104      _lt_dsymutil=
2105    fi
2106    ;;
2107  esac
2108])
2109
2110
2111# _LT_DARWIN_LINKER_FEATURES([TAG])
2112# ---------------------------------
2113# Checks for linker and compiler features on darwin
2114m4_defun([_LT_DARWIN_LINKER_FEATURES],
2115[
2116  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2117  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2118  _LT_TAGVAR(hardcode_direct, $1)=no
2119  _LT_TAGVAR(hardcode_automatic, $1)=yes
2120  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2121  if test "$lt_cv_ld_force_load" = "yes"; then
2122    _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\"`'
2123    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2124                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2125  else
2126    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2127  fi
2128  _LT_TAGVAR(link_all_deplibs, $1)=yes
2129  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2130  case $cc_basename in
2131     ifort*) _lt_dar_can_shared=yes ;;
2132     *) _lt_dar_can_shared=$GCC ;;
2133  esac
2134  if test "$_lt_dar_can_shared" = "yes"; then
2135    output_verbose_link_cmd=func_echo_all
2136    _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}"
2137    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2138    _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}"
2139    _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}"
2140    m4_if([$1], [CXX],
2141[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2142      _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}"
2143      _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}"
2144    fi
2145],[])
2146  else
2147  _LT_TAGVAR(ld_shlibs, $1)=no
2148  fi
2149])
2150
2151# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2152# ----------------------------------
2153# Links a minimal program and checks the executable
2154# for the system default hardcoded library path. In most cases,
2155# this is /usr/lib:/lib, but when the MPI compilers are used
2156# the location of the communication and MPI libs are included too.
2157# If we don't find anything, use the default library path according
2158# to the aix ld manual.
2159# Store the results from the different compilers for each TAGNAME.
2160# Allow to override them for all tags through lt_cv_aix_libpath.
2161m4_defun([_LT_SYS_MODULE_PATH_AIX],
2162[m4_require([_LT_DECL_SED])dnl
2163if test "${lt_cv_aix_libpath+set}" = set; then
2164  aix_libpath=$lt_cv_aix_libpath
2165else
2166  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2167  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2168  lt_aix_libpath_sed='[
2169      /Import File Strings/,/^$/ {
2170	  /^0/ {
2171	      s/^0  *\([^ ]*\) *$/\1/
2172	      p
2173	  }
2174      }]'
2175  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2176  # Check for a 64-bit object if we didn't find anything.
2177  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2178    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2179  fi],[])
2180  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2181    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2182  fi
2183  ])
2184  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2185fi
2186])# _LT_SYS_MODULE_PATH_AIX
2187
2188
2189# _LT_SHELL_INIT(ARG)
2190# -------------------
2191m4_define([_LT_SHELL_INIT],
2192[m4_divert_text([M4SH-INIT], [$1
2193])])# _LT_SHELL_INIT
2194
2195
2196
2197# _LT_PROG_ECHO_BACKSLASH
2198# -----------------------
2199# Find how we can fake an echo command that does not interpret backslash.
2200# In particular, with Autoconf 2.60 or later we add some code to the start
2201# of the generated configure script which will find a shell with a builtin
2202# printf (which we can use as an echo command).
2203m4_defun([_LT_PROG_ECHO_BACKSLASH],
2204[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2205ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2206ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2207
2208AC_MSG_CHECKING([how to print strings])
2209# Test print first, because it will be a builtin if present.
2210if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2211   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2212  ECHO='print -r --'
2213elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2214  ECHO='printf %s\n'
2215else
2216  # Use this function as a fallback that always works.
2217  func_fallback_echo ()
2218  {
2219    eval 'cat <<_LTECHO_EOF
2220$[]1
2221_LTECHO_EOF'
2222  }
2223  ECHO='func_fallback_echo'
2224fi
2225
2226# func_echo_all arg...
2227# Invoke $ECHO with all args, space-separated.
2228func_echo_all ()
2229{
2230    $ECHO "$*" 
2231}
2232
2233case "$ECHO" in
2234  printf*) AC_MSG_RESULT([printf]) ;;
2235  print*) AC_MSG_RESULT([print -r]) ;;
2236  *) AC_MSG_RESULT([cat]) ;;
2237esac
2238
2239m4_ifdef([_AS_DETECT_SUGGESTED],
2240[_AS_DETECT_SUGGESTED([
2241  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2242    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2243    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2244    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2245    PATH=/empty FPATH=/empty; export PATH FPATH
2246    test "X`printf %s $ECHO`" = "X$ECHO" \
2247      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2248
2249_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2250_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2251])# _LT_PROG_ECHO_BACKSLASH
2252
2253
2254# _LT_WITH_SYSROOT
2255# ----------------
2256AC_DEFUN([_LT_WITH_SYSROOT],
2257[AC_MSG_CHECKING([for sysroot])
2258AC_ARG_WITH([sysroot],
2259[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2260                        (or the compiler's sysroot if not specified).],
2261[], [with_sysroot=no])
2262
2263dnl lt_sysroot will always be passed unquoted.  We quote it here
2264dnl in case the user passed a directory name.
2265lt_sysroot=
2266case ${with_sysroot} in #(
2267 yes)
2268   if test "$GCC" = yes; then
2269     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2270   fi
2271   ;; #(
2272 /*)
2273   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2274   ;; #(
2275 no|'')
2276   ;; #(
2277 *)
2278   AC_MSG_RESULT([${with_sysroot}])
2279   AC_MSG_ERROR([The sysroot must be an absolute path.])
2280   ;;
2281esac
2282
2283 AC_MSG_RESULT([${lt_sysroot:-no}])
2284_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2285[dependent libraries, and in which our libraries should be installed.])])
2286
2287# _LT_ENABLE_LOCK
2288# ---------------
2289m4_defun([_LT_ENABLE_LOCK],
2290[AC_ARG_ENABLE([libtool-lock],
2291  [AS_HELP_STRING([--disable-libtool-lock],
2292    [avoid locking (might break parallel builds)])])
2293test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2294
2295# Some flags need to be propagated to the compiler or linker for good
2296# libtool support.
2297case $host in
2298ia64-*-hpux*)
2299  # Find out which ABI we are using.
2300  echo 'int i;' > conftest.$ac_ext
2301  if AC_TRY_EVAL(ac_compile); then
2302    case `/usr/bin/file conftest.$ac_objext` in
2303      *ELF-32*)
2304	HPUX_IA64_MODE="32"
2305	;;
2306      *ELF-64*)
2307	HPUX_IA64_MODE="64"
2308	;;
2309    esac
2310  fi
2311  rm -rf conftest*
2312  ;;
2313*-*-irix6*)
2314  # Find out which ABI we are using.
2315  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2316  if AC_TRY_EVAL(ac_compile); then
2317    if test "$lt_cv_prog_gnu_ld" = yes; then
2318      case `/usr/bin/file conftest.$ac_objext` in
2319	*32-bit*)
2320	  LD="${LD-ld} -melf32bsmip"
2321	  ;;
2322	*N32*)
2323	  LD="${LD-ld} -melf32bmipn32"
2324	  ;;
2325	*64-bit*)
2326	  LD="${LD-ld} -melf64bmip"
2327	;;
2328      esac
2329    else
2330      case `/usr/bin/file conftest.$ac_objext` in
2331	*32-bit*)
2332	  LD="${LD-ld} -32"
2333	  ;;
2334	*N32*)
2335	  LD="${LD-ld} -n32"
2336	  ;;
2337	*64-bit*)
2338	  LD="${LD-ld} -64"
2339	  ;;
2340      esac
2341    fi
2342  fi
2343  rm -rf conftest*
2344  ;;
2345
2346x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2347s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2348  # Find out which ABI we are using.
2349  echo 'int i;' > conftest.$ac_ext
2350  if AC_TRY_EVAL(ac_compile); then
2351    case `/usr/bin/file conftest.o` in
2352      *32-bit*)
2353	case $host in
2354	  x86_64-*kfreebsd*-gnu)
2355	    LD="${LD-ld} -m elf_i386_fbsd"
2356	    ;;
2357	  x86_64-*linux*)
2358	    LD="${LD-ld} -m elf_i386"
2359	    ;;
2360	  ppc64-*linux*|powerpc64-*linux*)
2361	    LD="${LD-ld} -m elf32ppclinux"
2362	    ;;
2363	  s390x-*linux*)
2364	    LD="${LD-ld} -m elf_s390"
2365	    ;;
2366	  sparc64-*linux*)
2367	    LD="${LD-ld} -m elf32_sparc"
2368	    ;;
2369	esac
2370	;;
2371      *64-bit*)
2372	case $host in
2373	  x86_64-*kfreebsd*-gnu)
2374	    LD="${LD-ld} -m elf_x86_64_fbsd"
2375	    ;;
2376	  x86_64-*linux*)
2377	    LD="${LD-ld} -m elf_x86_64"
2378	    ;;
2379	  ppc*-*linux*|powerpc*-*linux*)
2380	    LD="${LD-ld} -m elf64ppc"
2381	    ;;
2382	  s390*-*linux*|s390*-*tpf*)
2383	    LD="${LD-ld} -m elf64_s390"
2384	    ;;
2385	  sparc*-*linux*)
2386	    LD="${LD-ld} -m elf64_sparc"
2387	    ;;
2388	esac
2389	;;
2390    esac
2391  fi
2392  rm -rf conftest*
2393  ;;
2394
2395*-*-sco3.2v5*)
2396  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2397  SAVE_CFLAGS="$CFLAGS"
2398  CFLAGS="$CFLAGS -belf"
2399  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2400    [AC_LANG_PUSH(C)
2401     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2402     AC_LANG_POP])
2403  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2404    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2405    CFLAGS="$SAVE_CFLAGS"
2406  fi
2407  ;;
2408*-*solaris*)
2409  # Find out which ABI we are using.
2410  echo 'int i;' > conftest.$ac_ext
2411  if AC_TRY_EVAL(ac_compile); then
2412    case `/usr/bin/file conftest.o` in
2413    *64-bit*)
2414      case $lt_cv_prog_gnu_ld in
2415      yes*)
2416        case $host in
2417        i?86-*-solaris*)
2418          LD="${LD-ld} -m elf_x86_64"
2419          ;;
2420        sparc*-*-solaris*)
2421          LD="${LD-ld} -m elf64_sparc"
2422          ;;
2423        esac
2424        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2425        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2426          LD="${LD-ld}_sol2"
2427        fi
2428        ;;
2429      *)
2430	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2431	  LD="${LD-ld} -64"
2432	fi
2433	;;
2434      esac
2435      ;;
2436    esac
2437  fi
2438  rm -rf conftest*
2439  ;;
2440esac
2441
2442need_locks="$enable_libtool_lock"
2443])# _LT_ENABLE_LOCK
2444
2445
2446# _LT_PROG_AR
2447# -----------
2448m4_defun([_LT_PROG_AR],
2449[AC_CHECK_TOOLS(AR, [ar], false)
2450: ${AR=ar}
2451: ${AR_FLAGS=cru}
2452_LT_DECL([], [AR], [1], [The archiver])
2453_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2454
2455AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2456  [lt_cv_ar_at_file=no
2457   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2458     [echo conftest.$ac_objext > conftest.lst
2459      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2460      AC_TRY_EVAL([lt_ar_try])
2461      if test "$ac_status" -eq 0; then
2462	# Ensure the archiver fails upon bogus file names.
2463	rm -f conftest.$ac_objext libconftest.a
2464	AC_TRY_EVAL([lt_ar_try])
2465	if test "$ac_status" -ne 0; then
2466          lt_cv_ar_at_file=@
2467        fi
2468      fi
2469      rm -f conftest.* libconftest.a
2470     ])
2471  ])
2472
2473if test "x$lt_cv_ar_at_file" = xno; then
2474  archiver_list_spec=
2475else
2476  archiver_list_spec=$lt_cv_ar_at_file
2477fi
2478_LT_DECL([], [archiver_list_spec], [1],
2479  [How to feed a file listing to the archiver])
2480])# _LT_PROG_AR
2481
2482
2483# _LT_CMD_OLD_ARCHIVE
2484# -------------------
2485m4_defun([_LT_CMD_OLD_ARCHIVE],
2486[_LT_PROG_AR
2487
2488AC_CHECK_TOOL(STRIP, strip, :)
2489test -z "$STRIP" && STRIP=:
2490_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2491
2492AC_CHECK_TOOL(RANLIB, ranlib, :)
2493test -z "$RANLIB" && RANLIB=:
2494_LT_DECL([], [RANLIB], [1],
2495    [Commands used to install an old-style archive])
2496
2497# Determine commands to create old-style static archives.
2498old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2499old_postinstall_cmds='chmod 644 $oldlib'
2500old_postuninstall_cmds=
2501
2502if test -n "$RANLIB"; then
2503  case $host_os in
2504  openbsd*)
2505    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2506    ;;
2507  *)
2508    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2509    ;;
2510  esac
2511  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2512fi
2513
2514case $host_os in
2515  darwin*)
2516    lock_old_archive_extraction=yes ;;
2517  *)
2518    lock_old_archive_extraction=no ;;
2519esac
2520_LT_DECL([], [old_postinstall_cmds], [2])
2521_LT_DECL([], [old_postuninstall_cmds], [2])
2522_LT_TAGDECL([], [old_archive_cmds], [2],
2523    [Commands used to build an old-style archive])
2524_LT_DECL([], [lock_old_archive_extraction], [0],
2525    [Whether to use a lock for old archive extraction])
2526])# _LT_CMD_OLD_ARCHIVE
2527
2528
2529# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2530#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2531# ----------------------------------------------------------------
2532# Check whether the given compiler option works
2533AC_DEFUN([_LT_COMPILER_OPTION],
2534[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2535m4_require([_LT_DECL_SED])dnl
2536AC_CACHE_CHECK([$1], [$2],
2537  [$2=no
2538   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2539   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2540   lt_compiler_flag="$3"
2541   # Insert the option either (1) after the last *FLAGS variable, or
2542   # (2) before a word containing "conftest.", or (3) at the end.
2543   # Note that $ac_compile itself does not contain backslashes and begins
2544   # with a dollar sign (not a hyphen), so the echo should work correctly.
2545   # The option is referenced via a variable to avoid confusing sed.
2546   lt_compile=`echo "$ac_compile" | $SED \
2547   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2548   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2549   -e 's:$: $lt_compiler_flag:'`
2550   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2551   (eval "$lt_compile" 2>conftest.err)
2552   ac_status=$?
2553   cat conftest.err >&AS_MESSAGE_LOG_FD
2554   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2555   if (exit $ac_status) && test -s "$ac_outfile"; then
2556     # The compiler can only warn and ignore the option if not recognized
2557     # So say no if there are warnings other than the usual output.
2558     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2559     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2560     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2561       $2=yes
2562     fi
2563   fi
2564   $RM conftest*
2565])
2566
2567if test x"[$]$2" = xyes; then
2568    m4_if([$5], , :, [$5])
2569else
2570    m4_if([$6], , :, [$6])
2571fi
2572])# _LT_COMPILER_OPTION
2573
2574# Old name:
2575AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2576dnl aclocal-1.4 backwards compatibility:
2577dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2578
2579
2580# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2581#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2582# ----------------------------------------------------
2583# Check whether the given linker option works
2584AC_DEFUN([_LT_LINKER_OPTION],
2585[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2586m4_require([_LT_DECL_SED])dnl
2587AC_CACHE_CHECK([$1], [$2],
2588  [$2=no
2589   save_LDFLAGS="$LDFLAGS"
2590   LDFLAGS="$LDFLAGS $3"
2591   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2592   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2593     # The linker can only warn and ignore the option if not recognized
2594     # So say no if there are warnings
2595     if test -s conftest.err; then
2596       # Append any errors to the config.log.
2597       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2598       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2599       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2600       if diff conftest.exp conftest.er2 >/dev/null; then
2601         $2=yes
2602       fi
2603     else
2604       $2=yes
2605     fi
2606   fi
2607   $RM -r conftest*
2608   LDFLAGS="$save_LDFLAGS"
2609])
2610
2611if test x"[$]$2" = xyes; then
2612    m4_if([$4], , :, [$4])
2613else
2614    m4_if([$5], , :, [$5])
2615fi
2616])# _LT_LINKER_OPTION
2617
2618# Old name:
2619AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2620dnl aclocal-1.4 backwards compatibility:
2621dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2622
2623
2624# LT_CMD_MAX_LEN
2625#---------------
2626AC_DEFUN([LT_CMD_MAX_LEN],
2627[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2628# find the maximum length of command line arguments
2629AC_MSG_CHECKING([the maximum length of command line arguments])
2630AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2631  i=0
2632  teststring="ABCD"
2633
2634  case $build_os in
2635  msdosdjgpp*)
2636    # On DJGPP, this test can blow up pretty badly due to problems in libc
2637    # (any single argument exceeding 2000 bytes causes a buffer overrun
2638    # during glob expansion).  Even if it were fixed, the result of this
2639    # check would be larger than it should be.
2640    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2641    ;;
2642
2643  gnu*)
2644    # Under GNU Hurd, this test is not required because there is
2645    # no limit to the length of command line arguments.
2646    # Libtool will interpret -1 as no limit whatsoever
2647    lt_cv_sys_max_cmd_len=-1;
2648    ;;
2649
2650  cygwin* | mingw* | cegcc*)
2651    # On Win9x/ME, this test blows up -- it succeeds, but takes
2652    # about 5 minutes as the teststring grows exponentially.
2653    # Worse, since 9x/ME are not pre-emptively multitasking,
2654    # you end up with a "frozen" computer, even though with patience
2655    # the test eventually succeeds (with a max line length of 256k).
2656    # Instead, let's just punt: use the minimum linelength reported by
2657    # all of the supported platforms: 8192 (on NT/2K/XP).
2658    lt_cv_sys_max_cmd_len=8192;
2659    ;;
2660
2661  mint*)
2662    # On MiNT this can take a long time and run out of memory.
2663    lt_cv_sys_max_cmd_len=8192;
2664    ;;
2665
2666  amigaos*)
2667    # On AmigaOS with pdksh, this test takes hours, literally.
2668    # So we just punt and use a minimum line length of 8192.
2669    lt_cv_sys_max_cmd_len=8192;
2670    ;;
2671
2672  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2673    # This has been around since 386BSD, at least.  Likely further.
2674    if test -x /sbin/sysctl; then
2675      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2676    elif test -x /usr/sbin/sysctl; then
2677      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2678    else
2679      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2680    fi
2681    # And add a safety zone
2682    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2683    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2684    ;;
2685
2686  interix*)
2687    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2688    lt_cv_sys_max_cmd_len=196608
2689    ;;
2690
2691  os2*)
2692    # The test takes a long time on OS/2.
2693    lt_cv_sys_max_cmd_len=8192
2694    ;;
2695
2696  osf*)
2697    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2698    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2699    # nice to cause kernel panics so lets avoid the loop below.
2700    # First set a reasonable default.
2701    lt_cv_sys_max_cmd_len=16384
2702    #
2703    if test -x /sbin/sysconfig; then
2704      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2705        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2706      esac
2707    fi
2708    ;;
2709  sco3.2v5*)
2710    lt_cv_sys_max_cmd_len=102400
2711    ;;
2712  sysv5* | sco5v6* | sysv4.2uw2*)
2713    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2714    if test -n "$kargmax"; then
2715      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2716    else
2717      lt_cv_sys_max_cmd_len=32768
2718    fi
2719    ;;
2720  *)
2721    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2722    if test -n "$lt_cv_sys_max_cmd_len"; then
2723      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2724      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2725    else
2726      # Make teststring a little bigger before we do anything with it.
2727      # a 1K string should be a reasonable start.
2728      for i in 1 2 3 4 5 6 7 8 ; do
2729        teststring=$teststring$teststring
2730      done
2731      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2732      # If test is not a shell built-in, we'll probably end up computing a
2733      # maximum length that is only half of the actual maximum length, but
2734      # we can't tell.
2735      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2736	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2737	      test $i != 17 # 1/2 MB should be enough
2738      do
2739        i=`expr $i + 1`
2740        teststring=$teststring$teststring
2741      done
2742      # Only check the string length outside the loop.
2743      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2744      teststring=
2745      # Add a significant safety factor because C++ compilers can tack on
2746      # massive amounts of additional arguments before passing them to the
2747      # linker.  It appears as though 1/2 is a usable value.
2748      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2749    fi
2750    ;;
2751  esac
2752])
2753if test -n $lt_cv_sys_max_cmd_len ; then
2754  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2755else
2756  AC_MSG_RESULT(none)
2757fi
2758max_cmd_len=$lt_cv_sys_max_cmd_len
2759_LT_DECL([], [max_cmd_len], [0],
2760    [What is the maximum length of a command?])
2761])# LT_CMD_MAX_LEN
2762
2763# Old name:
2764AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2765dnl aclocal-1.4 backwards compatibility:
2766dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2767
2768
2769# _LT_HEADER_DLFCN
2770# ----------------
2771m4_defun([_LT_HEADER_DLFCN],
2772[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2773])# _LT_HEADER_DLFCN
2774
2775
2776# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2777#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2778# ----------------------------------------------------------------
2779m4_defun([_LT_TRY_DLOPEN_SELF],
2780[m4_require([_LT_HEADER_DLFCN])dnl
2781if test "$cross_compiling" = yes; then :
2782  [$4]
2783else
2784  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2785  lt_status=$lt_dlunknown
2786  cat > conftest.$ac_ext <<_LT_EOF
2787[#line $LINENO "configure"
2788#include "confdefs.h"
2789
2790#if HAVE_DLFCN_H
2791#include <dlfcn.h>
2792#endif
2793
2794#include <stdio.h>
2795
2796#ifdef RTLD_GLOBAL
2797#  define LT_DLGLOBAL		RTLD_GLOBAL
2798#else
2799#  ifdef DL_GLOBAL
2800#    define LT_DLGLOBAL		DL_GLOBAL
2801#  else
2802#    define LT_DLGLOBAL		0
2803#  endif
2804#endif
2805
2806/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2807   find out it does not work in some platform. */
2808#ifndef LT_DLLAZY_OR_NOW
2809#  ifdef RTLD_LAZY
2810#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2811#  else
2812#    ifdef DL_LAZY
2813#      define LT_DLLAZY_OR_NOW		DL_LAZY
2814#    else
2815#      ifdef RTLD_NOW
2816#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2817#      else
2818#        ifdef DL_NOW
2819#          define LT_DLLAZY_OR_NOW	DL_NOW
2820#        else
2821#          define LT_DLLAZY_OR_NOW	0
2822#        endif
2823#      endif
2824#    endif
2825#  endif
2826#endif
2827
2828/* When -fvisbility=hidden is used, assume the code has been annotated
2829   correspondingly for the symbols needed.  */
2830#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2831int fnord () __attribute__((visibility("default")));
2832#endif
2833
2834int fnord () { return 42; }
2835int main ()
2836{
2837  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2838  int status = $lt_dlunknown;
2839
2840  if (self)
2841    {
2842      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2843      else
2844        {
2845	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2846          else puts (dlerror ());
2847	}
2848      /* dlclose (self); */
2849    }
2850  else
2851    puts (dlerror ());
2852
2853  return status;
2854}]
2855_LT_EOF
2856  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2857    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2858    lt_status=$?
2859    case x$lt_status in
2860      x$lt_dlno_uscore) $1 ;;
2861      x$lt_dlneed_uscore) $2 ;;
2862      x$lt_dlunknown|x*) $3 ;;
2863    esac
2864  else :
2865    # compilation failed
2866    $3
2867  fi
2868fi
2869rm -fr conftest*
2870])# _LT_TRY_DLOPEN_SELF
2871
2872
2873# LT_SYS_DLOPEN_SELF
2874# ------------------
2875AC_DEFUN([LT_SYS_DLOPEN_SELF],
2876[m4_require([_LT_HEADER_DLFCN])dnl
2877if test "x$enable_dlopen" != xyes; then
2878  enable_dlopen=unknown
2879  enable_dlopen_self=unknown
2880  enable_dlopen_self_static=unknown
2881else
2882  lt_cv_dlopen=no
2883  lt_cv_dlopen_libs=
2884
2885  case $host_os in
2886  beos*)
2887    lt_cv_dlopen="load_add_on"
2888    lt_cv_dlopen_libs=
2889    lt_cv_dlopen_self=yes
2890    ;;
2891
2892  mingw* | pw32* | cegcc*)
2893    lt_cv_dlopen="LoadLibrary"
2894    lt_cv_dlopen_libs=
2895    ;;
2896
2897  cygwin*)
2898    lt_cv_dlopen="dlopen"
2899    lt_cv_dlopen_libs=
2900    ;;
2901
2902  darwin*)
2903  # if libdl is installed we need to link against it
2904    AC_CHECK_LIB([dl], [dlopen],
2905		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2906    lt_cv_dlopen="dyld"
2907    lt_cv_dlopen_libs=
2908    lt_cv_dlopen_self=yes
2909    ])
2910    ;;
2911
2912  *)
2913    AC_CHECK_FUNC([shl_load],
2914	  [lt_cv_dlopen="shl_load"],
2915      [AC_CHECK_LIB([dld], [shl_load],
2916	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2917	[AC_CHECK_FUNC([dlopen],
2918	      [lt_cv_dlopen="dlopen"],
2919	  [AC_CHECK_LIB([dl], [dlopen],
2920		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2921	    [AC_CHECK_LIB([svld], [dlopen],
2922		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2923	      [AC_CHECK_LIB([dld], [dld_link],
2924		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
2925	      ])
2926	    ])
2927	  ])
2928	])
2929      ])
2930    ;;
2931  esac
2932
2933  if test "x$lt_cv_dlopen" != xno; then
2934    enable_dlopen=yes
2935  else
2936    enable_dlopen=no
2937  fi
2938
2939  case $lt_cv_dlopen in
2940  dlopen)
2941    save_CPPFLAGS="$CPPFLAGS"
2942    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2943
2944    save_LDFLAGS="$LDFLAGS"
2945    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2946
2947    save_LIBS="$LIBS"
2948    LIBS="$lt_cv_dlopen_libs $LIBS"
2949
2950    AC_CACHE_CHECK([whether a program can dlopen itself],
2951	  lt_cv_dlopen_self, [dnl
2952	  _LT_TRY_DLOPEN_SELF(
2953	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2954	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2955    ])
2956
2957    if test "x$lt_cv_dlopen_self" = xyes; then
2958      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2959      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2960	  lt_cv_dlopen_self_static, [dnl
2961	  _LT_TRY_DLOPEN_SELF(
2962	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2963	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2964      ])
2965    fi
2966
2967    CPPFLAGS="$save_CPPFLAGS"
2968    LDFLAGS="$save_LDFLAGS"
2969    LIBS="$save_LIBS"
2970    ;;
2971  esac
2972
2973  case $lt_cv_dlopen_self in
2974  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2975  *) enable_dlopen_self=unknown ;;
2976  esac
2977
2978  case $lt_cv_dlopen_self_static in
2979  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2980  *) enable_dlopen_self_static=unknown ;;
2981  esac
2982fi
2983_LT_DECL([dlopen_support], [enable_dlopen], [0],
2984	 [Whether dlopen is supported])
2985_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2986	 [Whether dlopen of programs is supported])
2987_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2988	 [Whether dlopen of statically linked programs is supported])
2989])# LT_SYS_DLOPEN_SELF
2990
2991# Old name:
2992AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2993dnl aclocal-1.4 backwards compatibility:
2994dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2995
2996
2997# _LT_COMPILER_C_O([TAGNAME])
2998# ---------------------------
2999# Check to see if options -c and -o are simultaneously supported by compiler.
3000# This macro does not hard code the compiler like AC_PROG_CC_C_O.
3001m4_defun([_LT_COMPILER_C_O],
3002[m4_require([_LT_DECL_SED])dnl
3003m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3004m4_require([_LT_TAG_COMPILER])dnl
3005AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3006  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3007  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3008   $RM -r conftest 2>/dev/null
3009   mkdir conftest
3010   cd conftest
3011   mkdir out
3012   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3013
3014   lt_compiler_flag="-o out/conftest2.$ac_objext"
3015   # Insert the option either (1) after the last *FLAGS variable, or
3016   # (2) before a word containing "conftest.", or (3) at the end.
3017   # Note that $ac_compile itself does not contain backslashes and begins
3018   # with a dollar sign (not a hyphen), so the echo should work correctly.
3019   lt_compile=`echo "$ac_compile" | $SED \
3020   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3021   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3022   -e 's:$: $lt_compiler_flag:'`
3023   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3024   (eval "$lt_compile" 2>out/conftest.err)
3025   ac_status=$?
3026   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3027   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3028   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3029   then
3030     # The compiler can only warn and ignore the option if not recognized
3031     # So say no if there are warnings
3032     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3033     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3034     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3035       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3036     fi
3037   fi
3038   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3039   $RM conftest*
3040   # SGI C++ compiler will create directory out/ii_files/ for
3041   # template instantiation
3042   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3043   $RM out/* && rmdir out
3044   cd ..
3045   $RM -r conftest
3046   $RM conftest*
3047])
3048_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3049	[Does compiler simultaneously support -c and -o options?])
3050])# _LT_COMPILER_C_O
3051
3052
3053# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3054# ----------------------------------
3055# Check to see if we can do hard links to lock some files if needed
3056m4_defun([_LT_COMPILER_FILE_LOCKS],
3057[m4_require([_LT_ENABLE_LOCK])dnl
3058m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3059_LT_COMPILER_C_O([$1])
3060
3061hard_links="nottested"
3062if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3063  # do not overwrite the value of need_locks provided by the user
3064  AC_MSG_CHECKING([if we can lock with hard links])
3065  hard_links=yes
3066  $RM conftest*
3067  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3068  touch conftest.a
3069  ln conftest.a conftest.b 2>&5 || hard_links=no
3070  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3071  AC_MSG_RESULT([$hard_links])
3072  if test "$hard_links" = no; then
3073    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3074    need_locks=warn
3075  fi
3076else
3077  need_locks=no
3078fi
3079_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3080])# _LT_COMPILER_FILE_LOCKS
3081
3082
3083# _LT_CHECK_OBJDIR
3084# ----------------
3085m4_defun([_LT_CHECK_OBJDIR],
3086[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3087[rm -f .libs 2>/dev/null
3088mkdir .libs 2>/dev/null
3089if test -d .libs; then
3090  lt_cv_objdir=.libs
3091else
3092  # MS-DOS does not allow filenames that begin with a dot.
3093  lt_cv_objdir=_libs
3094fi
3095rmdir .libs 2>/dev/null])
3096objdir=$lt_cv_objdir
3097_LT_DECL([], [objdir], [0],
3098         [The name of the directory that contains temporary libtool files])dnl
3099m4_pattern_allow([LT_OBJDIR])dnl
3100AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3101  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3102])# _LT_CHECK_OBJDIR
3103
3104
3105# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3106# --------------------------------------
3107# Check hardcoding attributes.
3108m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3109[AC_MSG_CHECKING([how to hardcode library paths into programs])
3110_LT_TAGVAR(hardcode_action, $1)=
3111if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3112   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3113   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3114
3115  # We can hardcode non-existent directories.
3116  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3117     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3118     # have to relink, otherwise we might link with an installed library
3119     # when we should be linking with a yet-to-be-installed one
3120     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3121     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3122    # Linking always hardcodes the temporary library directory.
3123    _LT_TAGVAR(hardcode_action, $1)=relink
3124  else
3125    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3126    _LT_TAGVAR(hardcode_action, $1)=immediate
3127  fi
3128else
3129  # We cannot hardcode anything, or else we can only hardcode existing
3130  # directories.
3131  _LT_TAGVAR(hardcode_action, $1)=unsupported
3132fi
3133AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3134
3135if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3136   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3137  # Fast installation is not supported
3138  enable_fast_install=no
3139elif test "$shlibpath_overrides_runpath" = yes ||
3140     test "$enable_shared" = no; then
3141  # Fast installation is not necessary
3142  enable_fast_install=needless
3143fi
3144_LT_TAGDECL([], [hardcode_action], [0],
3145    [How to hardcode a shared library path into an executable])
3146])# _LT_LINKER_HARDCODE_LIBPATH
3147
3148
3149# _LT_CMD_STRIPLIB
3150# ----------------
3151m4_defun([_LT_CMD_STRIPLIB],
3152[m4_require([_LT_DECL_EGREP])
3153striplib=
3154old_striplib=
3155AC_MSG_CHECKING([whether stripping libraries is possible])
3156if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3157  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3158  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3159  AC_MSG_RESULT([yes])
3160else
3161# FIXME - insert some real tests, host_os isn't really good enough
3162  case $host_os in
3163  darwin*)
3164    if test -n "$STRIP" ; then
3165      striplib="$STRIP -x"
3166      old_striplib="$STRIP -S"
3167      AC_MSG_RESULT([yes])
3168    else
3169      AC_MSG_RESULT([no])
3170    fi
3171    ;;
3172  *)
3173    AC_MSG_RESULT([no])
3174    ;;
3175  esac
3176fi
3177_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3178_LT_DECL([], [striplib], [1])
3179])# _LT_CMD_STRIPLIB
3180
3181
3182# _LT_SYS_DYNAMIC_LINKER([TAG])
3183# -----------------------------
3184# PORTME Fill in your ld.so characteristics
3185m4_defun([_LT_SYS_DYNAMIC_LINKER],
3186[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3187m4_require([_LT_DECL_EGREP])dnl
3188m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3189m4_require([_LT_DECL_OBJDUMP])dnl
3190m4_require([_LT_DECL_SED])dnl
3191m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3192AC_MSG_CHECKING([dynamic linker characteristics])
3193m4_if([$1],
3194	[], [
3195if test "$GCC" = yes; then
3196  case $host_os in
3197    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3198    *) lt_awk_arg="/^libraries:/" ;;
3199  esac
3200  case $host_os in
3201    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3202    *) lt_sed_strip_eq="s,=/,/,g" ;;
3203  esac
3204  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3205  case $lt_search_path_spec in
3206  *\;*)
3207    # if the path contains ";" then we assume it to be the separator
3208    # otherwise default to the standard path separator (i.e. ":") - it is
3209    # assumed that no part of a normal pathname contains ";" but that should
3210    # okay in the real world where ";" in dirpaths is itself problematic.
3211    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3212    ;;
3213  *)
3214    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3215    ;;
3216  esac
3217  # Ok, now we have the path, separated by spaces, we can step through it
3218  # and add multilib dir if necessary.
3219  lt_tmp_lt_search_path_spec=
3220  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3221  for lt_sys_path in $lt_search_path_spec; do
3222    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3223      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3224    else
3225      test -d "$lt_sys_path" && \
3226	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3227    fi
3228  done
3229  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3230BEGIN {RS=" "; FS="/|\n";} {
3231  lt_foo="";
3232  lt_count=0;
3233  for (lt_i = NF; lt_i > 0; lt_i--) {
3234    if ($lt_i != "" && $lt_i != ".") {
3235      if ($lt_i == "..") {
3236        lt_count++;
3237      } else {
3238        if (lt_count == 0) {
3239          lt_foo="/" $lt_i lt_foo;
3240        } else {
3241          lt_count--;
3242        }
3243      }
3244    }
3245  }
3246  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3247  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3248}'`
3249  # AWK program above erroneously prepends '/' to C:/dos/paths
3250  # for these hosts.
3251  case $host_os in
3252    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3253      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3254  esac
3255  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3256else
3257  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3258fi])
3259library_names_spec=
3260libname_spec='lib$name'
3261soname_spec=
3262shrext_cmds=".so"
3263postinstall_cmds=
3264postuninstall_cmds=
3265finish_cmds=
3266finish_eval=
3267shlibpath_var=
3268shlibpath_overrides_runpath=unknown
3269version_type=none
3270dynamic_linker="$host_os ld.so"
3271sys_lib_dlsearch_path_spec="/lib /usr/lib"
3272need_lib_prefix=unknown
3273hardcode_into_libs=no
3274
3275# when you set need_version to no, make sure it does not cause -set_version
3276# flags to be left without arguments
3277need_version=unknown
3278
3279case $host_os in
3280aix3*)
3281  version_type=linux # correct to gnu/linux during the next big refactor
3282  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3283  shlibpath_var=LIBPATH
3284
3285  # AIX 3 has no versioning support, so we append a major version to the name.
3286  soname_spec='${libname}${release}${shared_ext}$major'
3287  ;;
3288
3289aix[[4-9]]*)
3290  version_type=linux # correct to gnu/linux during the next big refactor
3291  need_lib_prefix=no
3292  need_version=no
3293  hardcode_into_libs=yes
3294  if test "$host_cpu" = ia64; then
3295    # AIX 5 supports IA64
3296    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3297    shlibpath_var=LD_LIBRARY_PATH
3298  else
3299    # With GCC up to 2.95.x, collect2 would create an import file
3300    # for dependence libraries.  The import file would start with
3301    # the line `#! .'.  This would cause the generated library to
3302    # depend on `.', always an invalid library.  This was fixed in
3303    # development snapshots of GCC prior to 3.0.
3304    case $host_os in
3305      aix4 | aix4.[[01]] | aix4.[[01]].*)
3306      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3307	   echo ' yes '
3308	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3309	:
3310      else
3311	can_build_shared=no
3312      fi
3313      ;;
3314    esac
3315    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3316    # soname into executable. Probably we can add versioning support to
3317    # collect2, so additional links can be useful in future.
3318    if test "$aix_use_runtimelinking" = yes; then
3319      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3320      # instead of lib<name>.a to let people know that these are not
3321      # typical AIX shared libraries.
3322      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3323    else
3324      # We preserve .a as extension for shared libraries through AIX4.2
3325      # and later when we are not doing run time linking.
3326      library_names_spec='${libname}${release}.a $libname.a'
3327      soname_spec='${libname}${release}${shared_ext}$major'
3328    fi
3329    shlibpath_var=LIBPATH
3330  fi
3331  ;;
3332
3333amigaos*)
3334  case $host_cpu in
3335  powerpc)
3336    # Since July 2007 AmigaOS4 officially supports .so libraries.
3337    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3338    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3339    ;;
3340  m68k)
3341    library_names_spec='$libname.ixlibrary $libname.a'
3342    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3343    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'
3344    ;;
3345  esac
3346  ;;
3347
3348beos*)
3349  library_names_spec='${libname}${shared_ext}'
3350  dynamic_linker="$host_os ld.so"
3351  shlibpath_var=LIBRARY_PATH
3352  ;;
3353
3354bsdi[[45]]*)
3355  version_type=linux # correct to gnu/linux during the next big refactor
3356  need_version=no
3357  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3358  soname_spec='${libname}${release}${shared_ext}$major'
3359  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3360  shlibpath_var=LD_LIBRARY_PATH
3361  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3362  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3363  # the default ld.so.conf also contains /usr/contrib/lib and
3364  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3365  # libtool to hard-code these into programs
3366  ;;
3367
3368cygwin* | mingw* | pw32* | cegcc*)
3369  version_type=windows
3370  shrext_cmds=".dll"
3371  need_version=no
3372  need_lib_prefix=no
3373
3374  case $GCC,$cc_basename in
3375  yes,*)
3376    # gcc
3377    library_names_spec='$libname.dll.a'
3378    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3379    postinstall_cmds='base_file=`basename \${file}`~
3380      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3381      dldir=$destdir/`dirname \$dlpath`~
3382      test -d \$dldir || mkdir -p \$dldir~
3383      $install_prog $dir/$dlname \$dldir/$dlname~
3384      chmod a+x \$dldir/$dlname~
3385      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3386        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3387      fi'
3388    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3389      dlpath=$dir/\$dldll~
3390       $RM \$dlpath'
3391    shlibpath_overrides_runpath=yes
3392
3393    case $host_os in
3394    cygwin*)
3395      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3396      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3397m4_if([$1], [],[
3398      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3399      ;;
3400    mingw* | cegcc*)
3401      # MinGW DLLs use traditional 'lib' prefix
3402      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3403      ;;
3404    pw32*)
3405      # pw32 DLLs use 'pw' prefix rather than 'lib'
3406      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3407      ;;
3408    esac
3409    dynamic_linker='Win32 ld.exe'
3410    ;;
3411
3412  *,cl*)
3413    # Native MSVC
3414    libname_spec='$name'
3415    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3416    library_names_spec='${libname}.dll.lib'
3417
3418    case $build_os in
3419    mingw*)
3420      sys_lib_search_path_spec=
3421      lt_save_ifs=$IFS
3422      IFS=';'
3423      for lt_path in $LIB
3424      do
3425        IFS=$lt_save_ifs
3426        # Let DOS variable expansion print the short 8.3 style file name.
3427        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3428        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3429      done
3430      IFS=$lt_save_ifs
3431      # Convert to MSYS style.
3432      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3433      ;;
3434    cygwin*)
3435      # Convert to unix form, then to dos form, then back to unix form
3436      # but this time dos style (no spaces!) so that the unix form looks
3437      # like /cygdrive/c/PROGRA~1:/cygdr...
3438      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3439      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3440      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3441      ;;
3442    *)
3443      sys_lib_search_path_spec="$LIB"
3444      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3445        # It is most probably a Windows format PATH.
3446        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3447      else
3448        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3449      fi
3450      # FIXME: find the short name or the path components, as spaces are
3451      # common. (e.g. "Program Files" -> "PROGRA~1")
3452      ;;
3453    esac
3454
3455    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3456    postinstall_cmds='base_file=`basename \${file}`~
3457      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3458      dldir=$destdir/`dirname \$dlpath`~
3459      test -d \$dldir || mkdir -p \$dldir~
3460      $install_prog $dir/$dlname \$dldir/$dlname'
3461    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3462      dlpath=$dir/\$dldll~
3463       $RM \$dlpath'
3464    shlibpath_overrides_runpath=yes
3465    dynamic_linker='Win32 link.exe'
3466    ;;
3467
3468  *)
3469    # Assume MSVC wrapper
3470    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3471    dynamic_linker='Win32 ld.exe'
3472    ;;
3473  esac
3474  # FIXME: first we should search . and the directory the executable is in
3475  shlibpath_var=PATH
3476  ;;
3477
3478darwin* | rhapsody*)
3479  dynamic_linker="$host_os dyld"
3480  version_type=darwin
3481  need_lib_prefix=no
3482  need_version=no
3483  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3484  soname_spec='${libname}${release}${major}$shared_ext'
3485  shlibpath_overrides_runpath=yes
3486  shlibpath_var=DYLD_LIBRARY_PATH
3487  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3488m4_if([$1], [],[
3489  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3490  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3491  ;;
3492
3493dgux*)
3494  version_type=linux # correct to gnu/linux during the next big refactor
3495  need_lib_prefix=no
3496  need_version=no
3497  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3498  soname_spec='${libname}${release}${shared_ext}$major'
3499  shlibpath_var=LD_LIBRARY_PATH
3500  ;;
3501
3502freebsd* | dragonfly*)
3503  # DragonFly does not have aout.  When/if they implement a new
3504  # versioning mechanism, adjust this.
3505  if test -x /usr/bin/objformat; then
3506    objformat=`/usr/bin/objformat`
3507  else
3508    case $host_os in
3509    freebsd[[23]].*) objformat=aout ;;
3510    *) objformat=elf ;;
3511    esac
3512  fi
3513  version_type=freebsd-$objformat
3514  case $version_type in
3515    freebsd-elf*)
3516      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3517      need_version=no
3518      need_lib_prefix=no
3519      ;;
3520    freebsd-*)
3521      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3522      need_version=yes
3523      ;;
3524  esac
3525  shlibpath_var=LD_LIBRARY_PATH
3526  case $host_os in
3527  freebsd2.*)
3528    shlibpath_overrides_runpath=yes
3529    ;;
3530  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3531    shlibpath_overrides_runpath=yes
3532    hardcode_into_libs=yes
3533    ;;
3534  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3535  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3536    shlibpath_overrides_runpath=no
3537    hardcode_into_libs=yes
3538    ;;
3539  *) # from 4.6 on, and DragonFly
3540    shlibpath_overrides_runpath=yes
3541    hardcode_into_libs=yes
3542    ;;
3543  esac
3544  ;;
3545
3546gnu*)
3547  version_type=linux # correct to gnu/linux during the next big refactor
3548  need_lib_prefix=no
3549  need_version=no
3550  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3551  soname_spec='${libname}${release}${shared_ext}$major'
3552  shlibpath_var=LD_LIBRARY_PATH
3553  shlibpath_overrides_runpath=no
3554  hardcode_into_libs=yes
3555  ;;
3556
3557haiku*)
3558  version_type=linux # correct to gnu/linux during the next big refactor
3559  need_lib_prefix=no
3560  need_version=no
3561  dynamic_linker="$host_os runtime_loader"
3562  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3563  soname_spec='${libname}${release}${shared_ext}$major'
3564  shlibpath_var=LIBRARY_PATH
3565  shlibpath_overrides_runpath=yes
3566  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3567  hardcode_into_libs=yes
3568  ;;
3569
3570hpux9* | hpux10* | hpux11*)
3571  # Give a soname corresponding to the major version so that dld.sl refuses to
3572  # link against other versions.
3573  version_type=sunos
3574  need_lib_prefix=no
3575  need_version=no
3576  case $host_cpu in
3577  ia64*)
3578    shrext_cmds='.so'
3579    hardcode_into_libs=yes
3580    dynamic_linker="$host_os dld.so"
3581    shlibpath_var=LD_LIBRARY_PATH
3582    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3583    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3584    soname_spec='${libname}${release}${shared_ext}$major'
3585    if test "X$HPUX_IA64_MODE" = X32; then
3586      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3587    else
3588      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3589    fi
3590    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3591    ;;
3592  hppa*64*)
3593    shrext_cmds='.sl'
3594    hardcode_into_libs=yes
3595    dynamic_linker="$host_os dld.sl"
3596    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3597    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3598    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3599    soname_spec='${libname}${release}${shared_ext}$major'
3600    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3601    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3602    ;;
3603  *)
3604    shrext_cmds='.sl'
3605    dynamic_linker="$host_os dld.sl"
3606    shlibpath_var=SHLIB_PATH
3607    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3608    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3609    soname_spec='${libname}${release}${shared_ext}$major'
3610    ;;
3611  esac
3612  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3613  postinstall_cmds='chmod 555 $lib'
3614  # or fails outright, so override atomically:
3615  install_override_mode=555
3616  ;;
3617
3618interix[[3-9]]*)
3619  version_type=linux # correct to gnu/linux during the next big refactor
3620  need_lib_prefix=no
3621  need_version=no
3622  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3623  soname_spec='${libname}${release}${shared_ext}$major'
3624  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3625  shlibpath_var=LD_LIBRARY_PATH
3626  shlibpath_overrides_runpath=no
3627  hardcode_into_libs=yes
3628  ;;
3629
3630irix5* | irix6* | nonstopux*)
3631  case $host_os in
3632    nonstopux*) version_type=nonstopux ;;
3633    *)
3634	if test "$lt_cv_prog_gnu_ld" = yes; then
3635		version_type=linux # correct to gnu/linux during the next big refactor
3636	else
3637		version_type=irix
3638	fi ;;
3639  esac
3640  need_lib_prefix=no
3641  need_version=no
3642  soname_spec='${libname}${release}${shared_ext}$major'
3643  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3644  case $host_os in
3645  irix5* | nonstopux*)
3646    libsuff= shlibsuff=
3647    ;;
3648  *)
3649    case $LD in # libtool.m4 will add one of these switches to LD
3650    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3651      libsuff= shlibsuff= libmagic=32-bit;;
3652    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3653      libsuff=32 shlibsuff=N32 libmagic=N32;;
3654    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3655      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3656    *) libsuff= shlibsuff= libmagic=never-match;;
3657    esac
3658    ;;
3659  esac
3660  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3661  shlibpath_overrides_runpath=no
3662  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3663  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3664  hardcode_into_libs=yes
3665  ;;
3666
3667# No shared lib support for Linux oldld, aout, or coff.
3668linux*oldld* | linux*aout* | linux*coff*)
3669  dynamic_linker=no
3670  ;;
3671
3672# This must be glibc/ELF.
3673linux* | k*bsd*-gnu | kopensolaris*-gnu)
3674  version_type=linux # correct to gnu/linux during the next big refactor
3675  need_lib_prefix=no
3676  need_version=no
3677  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3678  soname_spec='${libname}${release}${shared_ext}$major'
3679  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3680  shlibpath_var=LD_LIBRARY_PATH
3681  shlibpath_overrides_runpath=no
3682
3683  # Some binutils ld are patched to set DT_RUNPATH
3684  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3685    [lt_cv_shlibpath_overrides_runpath=no
3686    save_LDFLAGS=$LDFLAGS
3687    save_libdir=$libdir
3688    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3689	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3690    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3691      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3692	 [lt_cv_shlibpath_overrides_runpath=yes])])
3693    LDFLAGS=$save_LDFLAGS
3694    libdir=$save_libdir
3695    ])
3696  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3697
3698  # This implies no fast_install, which is unacceptable.
3699  # Some rework will be needed to allow for fast_install
3700  # before this can be enabled.
3701  hardcode_into_libs=yes
3702
3703  # Append ld.so.conf contents to the search path
3704  if test -f /etc/ld.so.conf; then
3705    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' ' '`
3706    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3707  fi
3708
3709  # We used to test for /lib/ld.so.1 and disable shared libraries on
3710  # powerpc, because MkLinux only supported shared libraries with the
3711  # GNU dynamic linker.  Since this was broken with cross compilers,
3712  # most powerpc-linux boxes support dynamic linking these days and
3713  # people can always --disable-shared, the test was removed, and we
3714  # assume the GNU/Linux dynamic linker is in use.
3715  dynamic_linker='GNU/Linux ld.so'
3716  ;;
3717
3718netbsd*)
3719  version_type=sunos
3720  need_lib_prefix=no
3721  need_version=no
3722  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3723    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3724    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3725    dynamic_linker='NetBSD (a.out) ld.so'
3726  else
3727    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3728    soname_spec='${libname}${release}${shared_ext}$major'
3729    dynamic_linker='NetBSD ld.elf_so'
3730  fi
3731  shlibpath_var=LD_LIBRARY_PATH
3732  shlibpath_overrides_runpath=yes
3733  hardcode_into_libs=yes
3734  ;;
3735
3736newsos6)
3737  version_type=linux # correct to gnu/linux during the next big refactor
3738  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3739  shlibpath_var=LD_LIBRARY_PATH
3740  shlibpath_overrides_runpath=yes
3741  ;;
3742
3743*nto* | *qnx*)
3744  version_type=qnx
3745  need_lib_prefix=no
3746  need_version=no
3747  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3748  soname_spec='${libname}${release}${shared_ext}$major'
3749  shlibpath_var=LD_LIBRARY_PATH
3750  shlibpath_overrides_runpath=no
3751  hardcode_into_libs=yes
3752  dynamic_linker='ldqnx.so'
3753  ;;
3754
3755openbsd*)
3756  version_type=sunos
3757  sys_lib_dlsearch_path_spec="/usr/lib"
3758  need_lib_prefix=no
3759  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3760  case $host_os in
3761    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3762    *)				need_version=no  ;;
3763  esac
3764  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3765  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3766  shlibpath_var=LD_LIBRARY_PATH
3767  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3768    case $host_os in
3769      openbsd2.[[89]] | openbsd2.[[89]].*)
3770	shlibpath_overrides_runpath=no
3771	;;
3772      *)
3773	shlibpath_overrides_runpath=yes
3774	;;
3775      esac
3776  else
3777    shlibpath_overrides_runpath=yes
3778  fi
3779  ;;
3780
3781os2*)
3782  libname_spec='$name'
3783  shrext_cmds=".dll"
3784  need_lib_prefix=no
3785  library_names_spec='$libname${shared_ext} $libname.a'
3786  dynamic_linker='OS/2 ld.exe'
3787  shlibpath_var=LIBPATH
3788  ;;
3789
3790osf3* | osf4* | osf5*)
3791  version_type=osf
3792  need_lib_prefix=no
3793  need_version=no
3794  soname_spec='${libname}${release}${shared_ext}$major'
3795  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3796  shlibpath_var=LD_LIBRARY_PATH
3797  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3798  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3799  ;;
3800
3801rdos*)
3802  dynamic_linker=no
3803  ;;
3804
3805solaris*)
3806  version_type=linux # correct to gnu/linux during the next big refactor
3807  need_lib_prefix=no
3808  need_version=no
3809  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3810  soname_spec='${libname}${release}${shared_ext}$major'
3811  shlibpath_var=LD_LIBRARY_PATH
3812  shlibpath_overrides_runpath=yes
3813  hardcode_into_libs=yes
3814  # ldd complains unless libraries are executable
3815  postinstall_cmds='chmod +x $lib'
3816  ;;
3817
3818sunos4*)
3819  version_type=sunos
3820  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3821  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3822  shlibpath_var=LD_LIBRARY_PATH
3823  shlibpath_overrides_runpath=yes
3824  if test "$with_gnu_ld" = yes; then
3825    need_lib_prefix=no
3826  fi
3827  need_version=yes
3828  ;;
3829
3830sysv4 | sysv4.3*)
3831  version_type=linux # correct to gnu/linux during the next big refactor
3832  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3833  soname_spec='${libname}${release}${shared_ext}$major'
3834  shlibpath_var=LD_LIBRARY_PATH
3835  case $host_vendor in
3836    sni)
3837      shlibpath_overrides_runpath=no
3838      need_lib_prefix=no
3839      runpath_var=LD_RUN_PATH
3840      ;;
3841    siemens)
3842      need_lib_prefix=no
3843      ;;
3844    motorola)
3845      need_lib_prefix=no
3846      need_version=no
3847      shlibpath_overrides_runpath=no
3848      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3849      ;;
3850  esac
3851  ;;
3852
3853sysv4*MP*)
3854  if test -d /usr/nec ;then
3855    version_type=linux # correct to gnu/linux during the next big refactor
3856    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3857    soname_spec='$libname${shared_ext}.$major'
3858    shlibpath_var=LD_LIBRARY_PATH
3859  fi
3860  ;;
3861
3862sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3863  version_type=freebsd-elf
3864  need_lib_prefix=no
3865  need_version=no
3866  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3867  soname_spec='${libname}${release}${shared_ext}$major'
3868  shlibpath_var=LD_LIBRARY_PATH
3869  shlibpath_overrides_runpath=yes
3870  hardcode_into_libs=yes
3871  if test "$with_gnu_ld" = yes; then
3872    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3873  else
3874    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3875    case $host_os in
3876      sco3.2v5*)
3877        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3878	;;
3879    esac
3880  fi
3881  sys_lib_dlsearch_path_spec='/usr/lib'
3882  ;;
3883
3884tpf*)
3885  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3886  version_type=linux # correct to gnu/linux during the next big refactor
3887  need_lib_prefix=no
3888  need_version=no
3889  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3890  shlibpath_var=LD_LIBRARY_PATH
3891  shlibpath_overrides_runpath=no
3892  hardcode_into_libs=yes
3893  ;;
3894
3895uts4*)
3896  version_type=linux # correct to gnu/linux during the next big refactor
3897  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3898  soname_spec='${libname}${release}${shared_ext}$major'
3899  shlibpath_var=LD_LIBRARY_PATH
3900  ;;
3901
3902*)
3903  dynamic_linker=no
3904  ;;
3905esac
3906AC_MSG_RESULT([$dynamic_linker])
3907test "$dynamic_linker" = no && can_build_shared=no
3908
3909variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3910if test "$GCC" = yes; then
3911  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3912fi
3913
3914if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3915  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3916fi
3917if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3918  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3919fi
3920
3921_LT_DECL([], [variables_saved_for_relink], [1],
3922    [Variables whose values should be saved in libtool wrapper scripts and
3923    restored at link time])
3924_LT_DECL([], [need_lib_prefix], [0],
3925    [Do we need the "lib" prefix for modules?])
3926_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3927_LT_DECL([], [version_type], [0], [Library versioning type])
3928_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3929_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3930_LT_DECL([], [shlibpath_overrides_runpath], [0],
3931    [Is shlibpath searched before the hard-coded library search path?])
3932_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3933_LT_DECL([], [library_names_spec], [1],
3934    [[List of archive names.  First name is the real one, the rest are links.
3935    The last name is the one that the linker finds with -lNAME]])
3936_LT_DECL([], [soname_spec], [1],
3937    [[The coded name of the library, if different from the real name]])
3938_LT_DECL([], [install_override_mode], [1],
3939    [Permission mode override for installation of shared libraries])
3940_LT_DECL([], [postinstall_cmds], [2],
3941    [Command to use after installation of a shared archive])
3942_LT_DECL([], [postuninstall_cmds], [2],
3943    [Command to use after uninstallation of a shared archive])
3944_LT_DECL([], [finish_cmds], [2],
3945    [Commands used to finish a libtool library installation in a directory])
3946_LT_DECL([], [finish_eval], [1],
3947    [[As "finish_cmds", except a single script fragment to be evaled but
3948    not shown]])
3949_LT_DECL([], [hardcode_into_libs], [0],
3950    [Whether we should hardcode library paths into libraries])
3951_LT_DECL([], [sys_lib_search_path_spec], [2],
3952    [Compile-time system search path for libraries])
3953_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3954    [Run-time system search path for libraries])
3955])# _LT_SYS_DYNAMIC_LINKER
3956
3957
3958# _LT_PATH_TOOL_PREFIX(TOOL)
3959# --------------------------
3960# find a file program which can recognize shared library
3961AC_DEFUN([_LT_PATH_TOOL_PREFIX],
3962[m4_require([_LT_DECL_EGREP])dnl
3963AC_MSG_CHECKING([for $1])
3964AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3965[case $MAGIC_CMD in
3966[[\\/*] |  ?:[\\/]*])
3967  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3968  ;;
3969*)
3970  lt_save_MAGIC_CMD="$MAGIC_CMD"
3971  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3972dnl $ac_dummy forces splitting on constant user-supplied paths.
3973dnl POSIX.2 word splitting is done only on the output of word expansions,
3974dnl not every word.  This closes a longstanding sh security hole.
3975  ac_dummy="m4_if([$2], , $PATH, [$2])"
3976  for ac_dir in $ac_dummy; do
3977    IFS="$lt_save_ifs"
3978    test -z "$ac_dir" && ac_dir=.
3979    if test -f $ac_dir/$1; then
3980      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3981      if test -n "$file_magic_test_file"; then
3982	case $deplibs_check_method in
3983	"file_magic "*)
3984	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3985	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3986	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3987	    $EGREP "$file_magic_regex" > /dev/null; then
3988	    :
3989	  else
3990	    cat <<_LT_EOF 1>&2
3991
3992*** Warning: the command libtool uses to detect shared libraries,
3993*** $file_magic_cmd, produces output that libtool cannot recognize.
3994*** The result is that libtool may fail to recognize shared libraries
3995*** as such.  This will affect the creation of libtool libraries that
3996*** depend on shared libraries, but programs linked with such libtool
3997*** libraries will work regardless of this problem.  Nevertheless, you
3998*** may want to report the problem to your system manager and/or to
3999*** bug-libtool@gnu.org
4000
4001_LT_EOF
4002	  fi ;;
4003	esac
4004      fi
4005      break
4006    fi
4007  done
4008  IFS="$lt_save_ifs"
4009  MAGIC_CMD="$lt_save_MAGIC_CMD"
4010  ;;
4011esac])
4012MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4013if test -n "$MAGIC_CMD"; then
4014  AC_MSG_RESULT($MAGIC_CMD)
4015else
4016  AC_MSG_RESULT(no)
4017fi
4018_LT_DECL([], [MAGIC_CMD], [0],
4019	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4020])# _LT_PATH_TOOL_PREFIX
4021
4022# Old name:
4023AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4024dnl aclocal-1.4 backwards compatibility:
4025dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4026
4027
4028# _LT_PATH_MAGIC
4029# --------------
4030# find a file program which can recognize a shared library
4031m4_defun([_LT_PATH_MAGIC],
4032[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4033if test -z "$lt_cv_path_MAGIC_CMD"; then
4034  if test -n "$ac_tool_prefix"; then
4035    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4036  else
4037    MAGIC_CMD=:
4038  fi
4039fi
4040])# _LT_PATH_MAGIC
4041
4042
4043# LT_PATH_LD
4044# ----------
4045# find the pathname to the GNU or non-GNU linker
4046AC_DEFUN([LT_PATH_LD],
4047[AC_REQUIRE([AC_PROG_CC])dnl
4048AC_REQUIRE([AC_CANONICAL_HOST])dnl
4049AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4050m4_require([_LT_DECL_SED])dnl
4051m4_require([_LT_DECL_EGREP])dnl
4052m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4053
4054AC_ARG_WITH([gnu-ld],
4055    [AS_HELP_STRING([--with-gnu-ld],
4056	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4057    [test "$withval" = no || with_gnu_ld=yes],
4058    [with_gnu_ld=no])dnl
4059
4060ac_prog=ld
4061if test "$GCC" = yes; then
4062  # Check if gcc -print-prog-name=ld gives a path.
4063  AC_MSG_CHECKING([for ld used by $CC])
4064  case $host in
4065  *-*-mingw*)
4066    # gcc leaves a trailing carriage return which upsets mingw
4067    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4068  *)
4069    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4070  esac
4071  case $ac_prog in
4072    # Accept absolute paths.
4073    [[\\/]]* | ?:[[\\/]]*)
4074      re_direlt='/[[^/]][[^/]]*/\.\./'
4075      # Canonicalize the pathname of ld
4076      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4077      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4078	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4079      done
4080      test -z "$LD" && LD="$ac_prog"
4081      ;;
4082  "")
4083    # If it fails, then pretend we aren't using GCC.
4084    ac_prog=ld
4085    ;;
4086  *)
4087    # If it is relative, then search for the first ld in PATH.
4088    with_gnu_ld=unknown
4089    ;;
4090  esac
4091elif test "$with_gnu_ld" = yes; then
4092  AC_MSG_CHECKING([for GNU ld])
4093else
4094  AC_MSG_CHECKING([for non-GNU ld])
4095fi
4096AC_CACHE_VAL(lt_cv_path_LD,
4097[if test -z "$LD"; then
4098  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4099  for ac_dir in $PATH; do
4100    IFS="$lt_save_ifs"
4101    test -z "$ac_dir" && ac_dir=.
4102    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4103      lt_cv_path_LD="$ac_dir/$ac_prog"
4104      # Check to see if the program is GNU ld.  I'd rather use --version,
4105      # but apparently some variants of GNU ld only accept -v.
4106      # Break only if it was the GNU/non-GNU ld that we prefer.
4107      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4108      *GNU* | *'with BFD'*)
4109	test "$with_gnu_ld" != no && break
4110	;;
4111      *)
4112	test "$with_gnu_ld" != yes && break
4113	;;
4114      esac
4115    fi
4116  done
4117  IFS="$lt_save_ifs"
4118else
4119  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4120fi])
4121LD="$lt_cv_path_LD"
4122if test -n "$LD"; then
4123  AC_MSG_RESULT($LD)
4124else
4125  AC_MSG_RESULT(no)
4126fi
4127test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4128_LT_PATH_LD_GNU
4129AC_SUBST([LD])
4130
4131_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4132])# LT_PATH_LD
4133
4134# Old names:
4135AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4136AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4137dnl aclocal-1.4 backwards compatibility:
4138dnl AC_DEFUN([AM_PROG_LD], [])
4139dnl AC_DEFUN([AC_PROG_LD], [])
4140
4141
4142# _LT_PATH_LD_GNU
4143#- --------------
4144m4_defun([_LT_PATH_LD_GNU],
4145[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4146[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4147case `$LD -v 2>&1 </dev/null` in
4148*GNU* | *'with BFD'*)
4149  lt_cv_prog_gnu_ld=yes
4150  ;;
4151*)
4152  lt_cv_prog_gnu_ld=no
4153  ;;
4154esac])
4155with_gnu_ld=$lt_cv_prog_gnu_ld
4156])# _LT_PATH_LD_GNU
4157
4158
4159# _LT_CMD_RELOAD
4160# --------------
4161# find reload flag for linker
4162#   -- PORTME Some linkers may need a different reload flag.
4163m4_defun([_LT_CMD_RELOAD],
4164[AC_CACHE_CHECK([for $LD option to reload object files],
4165  lt_cv_ld_reload_flag,
4166  [lt_cv_ld_reload_flag='-r'])
4167reload_flag=$lt_cv_ld_reload_flag
4168case $reload_flag in
4169"" | " "*) ;;
4170*) reload_flag=" $reload_flag" ;;
4171esac
4172reload_cmds='$LD$reload_flag -o $output$reload_objs'
4173case $host_os in
4174  cygwin* | mingw* | pw32* | cegcc*)
4175    if test "$GCC" != yes; then
4176      reload_cmds=false
4177    fi
4178    ;;
4179  darwin*)
4180    if test "$GCC" = yes; then
4181      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4182    else
4183      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4184    fi
4185    ;;
4186esac
4187_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4188_LT_TAGDECL([], [reload_cmds], [2])dnl
4189])# _LT_CMD_RELOAD
4190
4191
4192# _LT_CHECK_MAGIC_METHOD
4193# ----------------------
4194# how to check for library dependencies
4195#  -- PORTME fill in with the dynamic library characteristics
4196m4_defun([_LT_CHECK_MAGIC_METHOD],
4197[m4_require([_LT_DECL_EGREP])
4198m4_require([_LT_DECL_OBJDUMP])
4199AC_CACHE_CHECK([how to recognize dependent libraries],
4200lt_cv_deplibs_check_method,
4201[lt_cv_file_magic_cmd='$MAGIC_CMD'
4202lt_cv_file_magic_test_file=
4203lt_cv_deplibs_check_method='unknown'
4204# Need to set the preceding variable on all platforms that support
4205# interlibrary dependencies.
4206# 'none' -- dependencies not supported.
4207# `unknown' -- same as none, but documents that we really don't know.
4208# 'pass_all' -- all dependencies passed with no checks.
4209# 'test_compile' -- check by making test program.
4210# 'file_magic [[regex]]' -- check by looking for files in library path
4211# which responds to the $file_magic_cmd with a given extended regex.
4212# If you have `file' or equivalent on your system and you're not sure
4213# whether `pass_all' will *always* work, you probably want this one.
4214
4215case $host_os in
4216aix[[4-9]]*)
4217  lt_cv_deplibs_check_method=pass_all
4218  ;;
4219
4220beos*)
4221  lt_cv_deplibs_check_method=pass_all
4222  ;;
4223
4224bsdi[[45]]*)
4225  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4226  lt_cv_file_magic_cmd='/usr/bin/file -L'
4227  lt_cv_file_magic_test_file=/shlib/libc.so
4228  ;;
4229
4230cygwin*)
4231  # func_win32_libid is a shell function defined in ltmain.sh
4232  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4233  lt_cv_file_magic_cmd='func_win32_libid'
4234  ;;
4235
4236mingw* | pw32*)
4237  # Base MSYS/MinGW do not provide the 'file' command needed by
4238  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4239  # unless we find 'file', for example because we are cross-compiling.
4240  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4241  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4242    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4243    lt_cv_file_magic_cmd='func_win32_libid'
4244  else
4245    # Keep this pattern in sync with the one in func_win32_libid.
4246    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4247    lt_cv_file_magic_cmd='$OBJDUMP -f'
4248  fi
4249  ;;
4250
4251cegcc*)
4252  # use the weaker test based on 'objdump'. See mingw*.
4253  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4254  lt_cv_file_magic_cmd='$OBJDUMP -f'
4255  ;;
4256
4257darwin* | rhapsody*)
4258  lt_cv_deplibs_check_method=pass_all
4259  ;;
4260
4261freebsd* | dragonfly*)
4262  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4263    case $host_cpu in
4264    i*86 )
4265      # Not sure whether the presence of OpenBSD here was a mistake.
4266      # Let's accept both of them until this is cleared up.
4267      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4268      lt_cv_file_magic_cmd=/usr/bin/file
4269      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4270      ;;
4271    esac
4272  else
4273    lt_cv_deplibs_check_method=pass_all
4274  fi
4275  ;;
4276
4277gnu*)
4278  lt_cv_deplibs_check_method=pass_all
4279  ;;
4280
4281haiku*)
4282  lt_cv_deplibs_check_method=pass_all
4283  ;;
4284
4285hpux10.20* | hpux11*)
4286  lt_cv_file_magic_cmd=/usr/bin/file
4287  case $host_cpu in
4288  ia64*)
4289    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4290    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4291    ;;
4292  hppa*64*)
4293    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
4294    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4295    ;;
4296  *)
4297    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4298    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4299    ;;
4300  esac
4301  ;;
4302
4303interix[[3-9]]*)
4304  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4305  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4306  ;;
4307
4308irix5* | irix6* | nonstopux*)
4309  case $LD in
4310  *-32|*"-32 ") libmagic=32-bit;;
4311  *-n32|*"-n32 ") libmagic=N32;;
4312  *-64|*"-64 ") libmagic=64-bit;;
4313  *) libmagic=never-match;;
4314  esac
4315  lt_cv_deplibs_check_method=pass_all
4316  ;;
4317
4318# This must be glibc/ELF.
4319linux* | k*bsd*-gnu | kopensolaris*-gnu)
4320  lt_cv_deplibs_check_method=pass_all
4321  ;;
4322
4323netbsd*)
4324  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4325    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4326  else
4327    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4328  fi
4329  ;;
4330
4331newos6*)
4332  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4333  lt_cv_file_magic_cmd=/usr/bin/file
4334  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4335  ;;
4336
4337*nto* | *qnx*)
4338  lt_cv_deplibs_check_method=pass_all
4339  ;;
4340
4341openbsd*)
4342  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4343    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4344  else
4345    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4346  fi
4347  ;;
4348
4349osf3* | osf4* | osf5*)
4350  lt_cv_deplibs_check_method=pass_all
4351  ;;
4352
4353rdos*)
4354  lt_cv_deplibs_check_method=pass_all
4355  ;;
4356
4357solaris*)
4358  lt_cv_deplibs_check_method=pass_all
4359  ;;
4360
4361sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4362  lt_cv_deplibs_check_method=pass_all
4363  ;;
4364
4365sysv4 | sysv4.3*)
4366  case $host_vendor in
4367  motorola)
4368    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
4369    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4370    ;;
4371  ncr)
4372    lt_cv_deplibs_check_method=pass_all
4373    ;;
4374  sequent)
4375    lt_cv_file_magic_cmd='/bin/file'
4376    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4377    ;;
4378  sni)
4379    lt_cv_file_magic_cmd='/bin/file'
4380    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4381    lt_cv_file_magic_test_file=/lib/libc.so
4382    ;;
4383  siemens)
4384    lt_cv_deplibs_check_method=pass_all
4385    ;;
4386  pc)
4387    lt_cv_deplibs_check_method=pass_all
4388    ;;
4389  esac
4390  ;;
4391
4392tpf*)
4393  lt_cv_deplibs_check_method=pass_all
4394  ;;
4395esac
4396])
4397
4398file_magic_glob=
4399want_nocaseglob=no
4400if test "$build" = "$host"; then
4401  case $host_os in
4402  mingw* | pw32*)
4403    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4404      want_nocaseglob=yes
4405    else
4406      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4407    fi
4408    ;;
4409  esac
4410fi
4411
4412file_magic_cmd=$lt_cv_file_magic_cmd
4413deplibs_check_method=$lt_cv_deplibs_check_method
4414test -z "$deplibs_check_method" && deplibs_check_method=unknown
4415
4416_LT_DECL([], [deplibs_check_method], [1],
4417    [Method to check whether dependent libraries are shared objects])
4418_LT_DECL([], [file_magic_cmd], [1],
4419    [Command to use when deplibs_check_method = "file_magic"])
4420_LT_DECL([], [file_magic_glob], [1],
4421    [How to find potential files when deplibs_check_method = "file_magic"])
4422_LT_DECL([], [want_nocaseglob], [1],
4423    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4424])# _LT_CHECK_MAGIC_METHOD
4425
4426
4427# LT_PATH_NM
4428# ----------
4429# find the pathname to a BSD- or MS-compatible name lister
4430AC_DEFUN([LT_PATH_NM],
4431[AC_REQUIRE([AC_PROG_CC])dnl
4432AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4433[if test -n "$NM"; then
4434  # Let the user override the test.
4435  lt_cv_path_NM="$NM"
4436else
4437  lt_nm_to_check="${ac_tool_prefix}nm"
4438  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4439    lt_nm_to_check="$lt_nm_to_check nm"
4440  fi
4441  for lt_tmp_nm in $lt_nm_to_check; do
4442    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4443    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4444      IFS="$lt_save_ifs"
4445      test -z "$ac_dir" && ac_dir=.
4446      tmp_nm="$ac_dir/$lt_tmp_nm"
4447      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4448	# Check to see if the nm accepts a BSD-compat flag.
4449	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4450	#   nm: unknown option "B" ignored
4451	# Tru64's nm complains that /dev/null is an invalid object file
4452	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4453	*/dev/null* | *'Invalid file or object type'*)
4454	  lt_cv_path_NM="$tmp_nm -B"
4455	  break
4456	  ;;
4457	*)
4458	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4459	  */dev/null*)
4460	    lt_cv_path_NM="$tmp_nm -p"
4461	    break
4462	    ;;
4463	  *)
4464	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4465	    continue # so that we can try to find one that supports BSD flags
4466	    ;;
4467	  esac
4468	  ;;
4469	esac
4470      fi
4471    done
4472    IFS="$lt_save_ifs"
4473  done
4474  : ${lt_cv_path_NM=no}
4475fi])
4476if test "$lt_cv_path_NM" != "no"; then
4477  NM="$lt_cv_path_NM"
4478else
4479  # Didn't find any BSD compatible name lister, look for dumpbin.
4480  if test -n "$DUMPBIN"; then :
4481    # Let the user override the test.
4482  else
4483    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4484    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4485    *COFF*)
4486      DUMPBIN="$DUMPBIN -symbols"
4487      ;;
4488    *)
4489      DUMPBIN=:
4490      ;;
4491    esac
4492  fi
4493  AC_SUBST([DUMPBIN])
4494  if test "$DUMPBIN" != ":"; then
4495    NM="$DUMPBIN"
4496  fi
4497fi
4498test -z "$NM" && NM=nm
4499AC_SUBST([NM])
4500_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4501
4502AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4503  [lt_cv_nm_interface="BSD nm"
4504  echo "int some_variable = 0;" > conftest.$ac_ext
4505  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4506  (eval "$ac_compile" 2>conftest.err)
4507  cat conftest.err >&AS_MESSAGE_LOG_FD
4508  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4509  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4510  cat conftest.err >&AS_MESSAGE_LOG_FD
4511  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4512  cat conftest.out >&AS_MESSAGE_LOG_FD
4513  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4514    lt_cv_nm_interface="MS dumpbin"
4515  fi
4516  rm -f conftest*])
4517])# LT_PATH_NM
4518
4519# Old names:
4520AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4521AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4522dnl aclocal-1.4 backwards compatibility:
4523dnl AC_DEFUN([AM_PROG_NM], [])
4524dnl AC_DEFUN([AC_PROG_NM], [])
4525
4526# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4527# --------------------------------
4528# how to determine the name of the shared library
4529# associated with a specific link library.
4530#  -- PORTME fill in with the dynamic library characteristics
4531m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4532[m4_require([_LT_DECL_EGREP])
4533m4_require([_LT_DECL_OBJDUMP])
4534m4_require([_LT_DECL_DLLTOOL])
4535AC_CACHE_CHECK([how to associate runtime and link libraries],
4536lt_cv_sharedlib_from_linklib_cmd,
4537[lt_cv_sharedlib_from_linklib_cmd='unknown'
4538
4539case $host_os in
4540cygwin* | mingw* | pw32* | cegcc*)
4541  # two different shell functions defined in ltmain.sh
4542  # decide which to use based on capabilities of $DLLTOOL
4543  case `$DLLTOOL --help 2>&1` in
4544  *--identify-strict*)
4545    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4546    ;;
4547  *)
4548    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4549    ;;
4550  esac
4551  ;;
4552*)
4553  # fallback: assume linklib IS sharedlib
4554  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4555  ;;
4556esac
4557])
4558sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4559test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4560
4561_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4562    [Command to associate shared and link libraries])
4563])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4564
4565
4566# _LT_PATH_MANIFEST_TOOL
4567# ----------------------
4568# locate the manifest tool
4569m4_defun([_LT_PATH_MANIFEST_TOOL],
4570[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4571test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4572AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4573  [lt_cv_path_mainfest_tool=no
4574  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4575  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4576  cat conftest.err >&AS_MESSAGE_LOG_FD
4577  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4578    lt_cv_path_mainfest_tool=yes
4579  fi
4580  rm -f conftest*])
4581if test "x$lt_cv_path_mainfest_tool" != xyes; then
4582  MANIFEST_TOOL=:
4583fi
4584_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4585])# _LT_PATH_MANIFEST_TOOL
4586
4587
4588# LT_LIB_M
4589# --------
4590# check for math library
4591AC_DEFUN([LT_LIB_M],
4592[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4593LIBM=
4594case $host in
4595*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4596  # These system don't have libm, or don't need it
4597  ;;
4598*-ncr-sysv4.3*)
4599  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4600  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4601  ;;
4602*)
4603  AC_CHECK_LIB(m, cos, LIBM="-lm")
4604  ;;
4605esac
4606AC_SUBST([LIBM])
4607])# LT_LIB_M
4608
4609# Old name:
4610AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4611dnl aclocal-1.4 backwards compatibility:
4612dnl AC_DEFUN([AC_CHECK_LIBM], [])
4613
4614
4615# _LT_COMPILER_NO_RTTI([TAGNAME])
4616# -------------------------------
4617m4_defun([_LT_COMPILER_NO_RTTI],
4618[m4_require([_LT_TAG_COMPILER])dnl
4619
4620_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4621
4622if test "$GCC" = yes; then
4623  case $cc_basename in
4624  nvcc*)
4625    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4626  *)
4627    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4628  esac
4629
4630  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4631    lt_cv_prog_compiler_rtti_exceptions,
4632    [-fno-rtti -fno-exceptions], [],
4633    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4634fi
4635_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4636	[Compiler flag to turn off builtin functions])
4637])# _LT_COMPILER_NO_RTTI
4638
4639
4640# _LT_CMD_GLOBAL_SYMBOLS
4641# ----------------------
4642m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4643[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4644AC_REQUIRE([AC_PROG_CC])dnl
4645AC_REQUIRE([AC_PROG_AWK])dnl
4646AC_REQUIRE([LT_PATH_NM])dnl
4647AC_REQUIRE([LT_PATH_LD])dnl
4648m4_require([_LT_DECL_SED])dnl
4649m4_require([_LT_DECL_EGREP])dnl
4650m4_require([_LT_TAG_COMPILER])dnl
4651
4652# Check for command to grab the raw symbol name followed by C symbol from nm.
4653AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4654AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4655[
4656# These are sane defaults that work on at least a few old systems.
4657# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4658
4659# Character class describing NM global symbol codes.
4660symcode='[[BCDEGRST]]'
4661
4662# Regexp to match symbols that can be accessed directly from C.
4663sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4664
4665# Define system-specific variables.
4666case $host_os in
4667aix*)
4668  symcode='[[BCDT]]'
4669  ;;
4670cygwin* | mingw* | pw32* | cegcc*)
4671  symcode='[[ABCDGISTW]]'
4672  ;;
4673hpux*)
4674  if test "$host_cpu" = ia64; then
4675    symcode='[[ABCDEGRST]]'
4676  fi
4677  ;;
4678irix* | nonstopux*)
4679  symcode='[[BCDEGRST]]'
4680  ;;
4681osf*)
4682  symcode='[[BCDEGQRST]]'
4683  ;;
4684solaris*)
4685  symcode='[[BDRT]]'
4686  ;;
4687sco3.2v5*)
4688  symcode='[[DT]]'
4689  ;;
4690sysv4.2uw2*)
4691  symcode='[[DT]]'
4692  ;;
4693sysv5* | sco5v6* | unixware* | OpenUNIX*)
4694  symcode='[[ABDT]]'
4695  ;;
4696sysv4)
4697  symcode='[[DFNSTU]]'
4698  ;;
4699esac
4700
4701# If we're using GNU nm, then use its standard symbol codes.
4702case `$NM -V 2>&1` in
4703*GNU* | *'with BFD'*)
4704  symcode='[[ABCDGIRSTW]]' ;;
4705esac
4706
4707# Transform an extracted symbol line into a proper C declaration.
4708# Some systems (esp. on ia64) link data and code symbols differently,
4709# so use this general approach.
4710lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4711
4712# Transform an extracted symbol line into symbol name and symbol address
4713lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4714lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
4715
4716# Handle CRLF in mingw tool chain
4717opt_cr=
4718case $build_os in
4719mingw*)
4720  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4721  ;;
4722esac
4723
4724# Try without a prefix underscore, then with it.
4725for ac_symprfx in "" "_"; do
4726
4727  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4728  symxfrm="\\1 $ac_symprfx\\2 \\2"
4729
4730  # Write the raw and C identifiers.
4731  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4732    # Fake it for dumpbin and say T for any non-static function
4733    # and D for any global variable.
4734    # Also find C++ and __fastcall symbols from MSVC++,
4735    # which start with @ or ?.
4736    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4737"     {last_section=section; section=\$ 3};"\
4738"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4739"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4740"     \$ 0!~/External *\|/{next};"\
4741"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4742"     {if(hide[section]) next};"\
4743"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4744"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4745"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4746"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4747"     ' prfx=^$ac_symprfx]"
4748  else
4749    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4750  fi
4751  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4752
4753  # Check to see that the pipe works correctly.
4754  pipe_works=no
4755
4756  rm -f conftest*
4757  cat > conftest.$ac_ext <<_LT_EOF
4758#ifdef __cplusplus
4759extern "C" {
4760#endif
4761char nm_test_var;
4762void nm_test_func(void);
4763void nm_test_func(void){}
4764#ifdef __cplusplus
4765}
4766#endif
4767int main(){nm_test_var='a';nm_test_func();return(0);}
4768_LT_EOF
4769
4770  if AC_TRY_EVAL(ac_compile); then
4771    # Now try to grab the symbols.
4772    nlist=conftest.nm
4773    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4774      # Try sorting and uniquifying the output.
4775      if sort "$nlist" | uniq > "$nlist"T; then
4776	mv -f "$nlist"T "$nlist"
4777      else
4778	rm -f "$nlist"T
4779      fi
4780
4781      # Make sure that we snagged all the symbols we need.
4782      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4783	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4784	  cat <<_LT_EOF > conftest.$ac_ext
4785/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4786#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4787/* DATA imports from DLLs on WIN32 con't be const, because runtime
4788   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4789# define LT@&t@_DLSYM_CONST
4790#elif defined(__osf__)
4791/* This system does not cope well with relocations in const data.  */
4792# define LT@&t@_DLSYM_CONST
4793#else
4794# define LT@&t@_DLSYM_CONST const
4795#endif
4796
4797#ifdef __cplusplus
4798extern "C" {
4799#endif
4800
4801_LT_EOF
4802	  # Now generate the symbol file.
4803	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4804
4805	  cat <<_LT_EOF >> conftest.$ac_ext
4806
4807/* The mapping between symbol names and symbols.  */
4808LT@&t@_DLSYM_CONST struct {
4809  const char *name;
4810  void       *address;
4811}
4812lt__PROGRAM__LTX_preloaded_symbols[[]] =
4813{
4814  { "@PROGRAM@", (void *) 0 },
4815_LT_EOF
4816	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4817	  cat <<\_LT_EOF >> conftest.$ac_ext
4818  {0, (void *) 0}
4819};
4820
4821/* This works around a problem in FreeBSD linker */
4822#ifdef FREEBSD_WORKAROUND
4823static const void *lt_preloaded_setup() {
4824  return lt__PROGRAM__LTX_preloaded_symbols;
4825}
4826#endif
4827
4828#ifdef __cplusplus
4829}
4830#endif
4831_LT_EOF
4832	  # Now try linking the two files.
4833	  mv conftest.$ac_objext conftstm.$ac_objext
4834	  lt_globsym_save_LIBS=$LIBS
4835	  lt_globsym_save_CFLAGS=$CFLAGS
4836	  LIBS="conftstm.$ac_objext"
4837	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4838	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4839	    pipe_works=yes
4840	  fi
4841	  LIBS=$lt_globsym_save_LIBS
4842	  CFLAGS=$lt_globsym_save_CFLAGS
4843	else
4844	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4845	fi
4846      else
4847	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4848      fi
4849    else
4850      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4851    fi
4852  else
4853    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4854    cat conftest.$ac_ext >&5
4855  fi
4856  rm -rf conftest* conftst*
4857
4858  # Do not use the global_symbol_pipe unless it works.
4859  if test "$pipe_works" = yes; then
4860    break
4861  else
4862    lt_cv_sys_global_symbol_pipe=
4863  fi
4864done
4865])
4866if test -z "$lt_cv_sys_global_symbol_pipe"; then
4867  lt_cv_sys_global_symbol_to_cdecl=
4868fi
4869if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4870  AC_MSG_RESULT(failed)
4871else
4872  AC_MSG_RESULT(ok)
4873fi
4874
4875# Response file support.
4876if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4877  nm_file_list_spec='@'
4878elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4879  nm_file_list_spec='@'
4880fi
4881
4882_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4883    [Take the output of nm and produce a listing of raw symbols and C names])
4884_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4885    [Transform the output of nm in a proper C declaration])
4886_LT_DECL([global_symbol_to_c_name_address],
4887    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4888    [Transform the output of nm in a C name address pair])
4889_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4890    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4891    [Transform the output of nm in a C name address pair when lib prefix is needed])
4892_LT_DECL([], [nm_file_list_spec], [1],
4893    [Specify filename containing input files for $NM])
4894]) # _LT_CMD_GLOBAL_SYMBOLS
4895
4896
4897# _LT_COMPILER_PIC([TAGNAME])
4898# ---------------------------
4899m4_defun([_LT_COMPILER_PIC],
4900[m4_require([_LT_TAG_COMPILER])dnl
4901_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4902_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4903_LT_TAGVAR(lt_prog_compiler_static, $1)=
4904
4905m4_if([$1], [CXX], [
4906  # C++ specific cases for pic, static, wl, etc.
4907  if test "$GXX" = yes; then
4908    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4909    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4910
4911    case $host_os in
4912    aix*)
4913      # All AIX code is PIC.
4914      if test "$host_cpu" = ia64; then
4915	# AIX 5 now supports IA64 processor
4916	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4917      fi
4918      ;;
4919
4920    amigaos*)
4921      case $host_cpu in
4922      powerpc)
4923            # see comment about AmigaOS4 .so support
4924            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4925        ;;
4926      m68k)
4927            # FIXME: we need at least 68020 code to build shared libraries, but
4928            # adding the `-m68020' flag to GCC prevents building anything better,
4929            # like `-m68040'.
4930            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4931        ;;
4932      esac
4933      ;;
4934
4935    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4936      # PIC is the default for these OSes.
4937      ;;
4938    mingw* | cygwin* | os2* | pw32* | cegcc*)
4939      # This hack is so that the source file can tell whether it is being
4940      # built for inclusion in a dll (and should export symbols for example).
4941      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4942      # (--disable-auto-import) libraries
4943      m4_if([$1], [GCJ], [],
4944	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4945      ;;
4946    darwin* | rhapsody*)
4947      # PIC is the default on this platform
4948      # Common symbols not allowed in MH_DYLIB files
4949      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4950      ;;
4951    *djgpp*)
4952      # DJGPP does not support shared libraries at all
4953      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4954      ;;
4955    haiku*)
4956      # PIC is the default for Haiku.
4957      # The "-static" flag exists, but is broken.
4958      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4959      ;;
4960    interix[[3-9]]*)
4961      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4962      # Instead, we relocate shared libraries at runtime.
4963      ;;
4964    sysv4*MP*)
4965      if test -d /usr/nec; then
4966	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4967      fi
4968      ;;
4969    hpux*)
4970      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4971      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4972      # sets the default TLS model and affects inlining.
4973      case $host_cpu in
4974      hppa*64*)
4975	;;
4976      *)
4977	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4978	;;
4979      esac
4980      ;;
4981    *qnx* | *nto*)
4982      # QNX uses GNU C++, but need to define -shared option too, otherwise
4983      # it will coredump.
4984      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4985      ;;
4986    *)
4987      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4988      ;;
4989    esac
4990  else
4991    case $host_os in
4992      aix[[4-9]]*)
4993	# All AIX code is PIC.
4994	if test "$host_cpu" = ia64; then
4995	  # AIX 5 now supports IA64 processor
4996	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4997	else
4998	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4999	fi
5000	;;
5001      chorus*)
5002	case $cc_basename in
5003	cxch68*)
5004	  # Green Hills C++ Compiler
5005	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
5006	  ;;
5007	esac
5008	;;
5009      mingw* | cygwin* | os2* | pw32* | cegcc*)
5010	# This hack is so that the source file can tell whether it is being
5011	# built for inclusion in a dll (and should export symbols for example).
5012	m4_if([$1], [GCJ], [],
5013	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5014	;;
5015      dgux*)
5016	case $cc_basename in
5017	  ec++*)
5018	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5019	    ;;
5020	  ghcx*)
5021	    # Green Hills C++ Compiler
5022	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5023	    ;;
5024	  *)
5025	    ;;
5026	esac
5027	;;
5028      freebsd* | dragonfly*)
5029	# FreeBSD uses GNU C++
5030	;;
5031      hpux9* | hpux10* | hpux11*)
5032	case $cc_basename in
5033	  CC*)
5034	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5035	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5036	    if test "$host_cpu" != ia64; then
5037	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5038	    fi
5039	    ;;
5040	  aCC*)
5041	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5042	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5043	    case $host_cpu in
5044	    hppa*64*|ia64*)
5045	      # +Z the default
5046	      ;;
5047	    *)
5048	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5049	      ;;
5050	    esac
5051	    ;;
5052	  *)
5053	    ;;
5054	esac
5055	;;
5056      interix*)
5057	# This is c89, which is MS Visual C++ (no shared libs)
5058	# Anyone wants to do a port?
5059	;;
5060      irix5* | irix6* | nonstopux*)
5061	case $cc_basename in
5062	  CC*)
5063	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5064	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5065	    # CC pic flag -KPIC is the default.
5066	    ;;
5067	  *)
5068	    ;;
5069	esac
5070	;;
5071      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5072	case $cc_basename in
5073	  KCC*)
5074	    # KAI C++ Compiler
5075	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5076	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5077	    ;;
5078	  ecpc* )
5079	    # old Intel C++ for x86_64 which still supported -KPIC.
5080	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5081	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5082	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5083	    ;;
5084	  icpc* )
5085	    # Intel C++, used to be incompatible with GCC.
5086	    # ICC 10 doesn't accept -KPIC any more.
5087	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5088	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5089	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5090	    ;;
5091	  pgCC* | pgcpp*)
5092	    # Portland Group C++ compiler
5093	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5094	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5095	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5096	    ;;
5097	  cxx*)
5098	    # Compaq C++
5099	    # Make sure the PIC flag is empty.  It appears that all Alpha
5100	    # Linux and Compaq Tru64 Unix objects are PIC.
5101	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5102	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5103	    ;;
5104	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5105	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5106	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5107	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5108	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5109	    ;;
5110	  *)
5111	    case `$CC -V 2>&1 | sed 5q` in
5112	    *Sun\ C*)
5113	      # Sun C++ 5.9
5114	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5115	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5116	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5117	      ;;
5118	    esac
5119	    ;;
5120	esac
5121	;;
5122      lynxos*)
5123	;;
5124      m88k*)
5125	;;
5126      mvs*)
5127	case $cc_basename in
5128	  cxx*)
5129	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5130	    ;;
5131	  *)
5132	    ;;
5133	esac
5134	;;
5135      netbsd*)
5136	;;
5137      *qnx* | *nto*)
5138        # QNX uses GNU C++, but need to define -shared option too, otherwise
5139        # it will coredump.
5140        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5141        ;;
5142      osf3* | osf4* | osf5*)
5143	case $cc_basename in
5144	  KCC*)
5145	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5146	    ;;
5147	  RCC*)
5148	    # Rational C++ 2.4.1
5149	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5150	    ;;
5151	  cxx*)
5152	    # Digital/Compaq C++
5153	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5154	    # Make sure the PIC flag is empty.  It appears that all Alpha
5155	    # Linux and Compaq Tru64 Unix objects are PIC.
5156	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5157	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5158	    ;;
5159	  *)
5160	    ;;
5161	esac
5162	;;
5163      psos*)
5164	;;
5165      solaris*)
5166	case $cc_basename in
5167	  CC* | sunCC*)
5168	    # Sun C++ 4.2, 5.x and Centerline C++
5169	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5170	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5171	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5172	    ;;
5173	  gcx*)
5174	    # Green Hills C++ Compiler
5175	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5176	    ;;
5177	  *)
5178	    ;;
5179	esac
5180	;;
5181      sunos4*)
5182	case $cc_basename in
5183	  CC*)
5184	    # Sun C++ 4.x
5185	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5186	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5187	    ;;
5188	  lcc*)
5189	    # Lucid
5190	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5191	    ;;
5192	  *)
5193	    ;;
5194	esac
5195	;;
5196      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5197	case $cc_basename in
5198	  CC*)
5199	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5200	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5201	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5202	    ;;
5203	esac
5204	;;
5205      tandem*)
5206	case $cc_basename in
5207	  NCC*)
5208	    # NonStop-UX NCC 3.20
5209	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5210	    ;;
5211	  *)
5212	    ;;
5213	esac
5214	;;
5215      vxworks*)
5216	;;
5217      *)
5218	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5219	;;
5220    esac
5221  fi
5222],
5223[
5224  if test "$GCC" = yes; then
5225    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5226    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5227
5228    case $host_os in
5229      aix*)
5230      # All AIX code is PIC.
5231      if test "$host_cpu" = ia64; then
5232	# AIX 5 now supports IA64 processor
5233	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5234      fi
5235      ;;
5236
5237    amigaos*)
5238      case $host_cpu in
5239      powerpc)
5240            # see comment about AmigaOS4 .so support
5241            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5242        ;;
5243      m68k)
5244            # FIXME: we need at least 68020 code to build shared libraries, but
5245            # adding the `-m68020' flag to GCC prevents building anything better,
5246            # like `-m68040'.
5247            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5248        ;;
5249      esac
5250      ;;
5251
5252    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5253      # PIC is the default for these OSes.
5254      ;;
5255
5256    mingw* | cygwin* | pw32* | os2* | cegcc*)
5257      # This hack is so that the source file can tell whether it is being
5258      # built for inclusion in a dll (and should export symbols for example).
5259      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5260      # (--disable-auto-import) libraries
5261      m4_if([$1], [GCJ], [],
5262	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5263      ;;
5264
5265    darwin* | rhapsody*)
5266      # PIC is the default on this platform
5267      # Common symbols not allowed in MH_DYLIB files
5268      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5269      ;;
5270
5271    haiku*)
5272      # PIC is the default for Haiku.
5273      # The "-static" flag exists, but is broken.
5274      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5275      ;;
5276
5277    hpux*)
5278      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5279      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5280      # sets the default TLS model and affects inlining.
5281      case $host_cpu in
5282      hppa*64*)
5283	# +Z the default
5284	;;
5285      *)
5286	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5287	;;
5288      esac
5289      ;;
5290
5291    interix[[3-9]]*)
5292      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5293      # Instead, we relocate shared libraries at runtime.
5294      ;;
5295
5296    msdosdjgpp*)
5297      # Just because we use GCC doesn't mean we suddenly get shared libraries
5298      # on systems that don't support them.
5299      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5300      enable_shared=no
5301      ;;
5302
5303    *nto* | *qnx*)
5304      # QNX uses GNU C++, but need to define -shared option too, otherwise
5305      # it will coredump.
5306      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5307      ;;
5308
5309    sysv4*MP*)
5310      if test -d /usr/nec; then
5311	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5312      fi
5313      ;;
5314
5315    *)
5316      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5317      ;;
5318    esac
5319
5320    case $cc_basename in
5321    nvcc*) # Cuda Compiler Driver 2.2
5322      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5323      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5324        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5325      fi
5326      ;;
5327    esac
5328  else
5329    # PORTME Check for flag to pass linker flags through the system compiler.
5330    case $host_os in
5331    aix*)
5332      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5333      if test "$host_cpu" = ia64; then
5334	# AIX 5 now supports IA64 processor
5335	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5336      else
5337	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5338      fi
5339      ;;
5340
5341    mingw* | cygwin* | pw32* | os2* | cegcc*)
5342      # This hack is so that the source file can tell whether it is being
5343      # built for inclusion in a dll (and should export symbols for example).
5344      m4_if([$1], [GCJ], [],
5345	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5346      ;;
5347
5348    hpux9* | hpux10* | hpux11*)
5349      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5350      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5351      # not for PA HP-UX.
5352      case $host_cpu in
5353      hppa*64*|ia64*)
5354	# +Z the default
5355	;;
5356      *)
5357	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5358	;;
5359      esac
5360      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5361      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5362      ;;
5363
5364    irix5* | irix6* | nonstopux*)
5365      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5366      # PIC (with -KPIC) is the default.
5367      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5368      ;;
5369
5370    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5371      case $cc_basename in
5372      # old Intel for x86_64 which still supported -KPIC.
5373      ecc*)
5374	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5375	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5376	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5377        ;;
5378      # icc used to be incompatible with GCC.
5379      # ICC 10 doesn't accept -KPIC any more.
5380      icc* | ifort*)
5381	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5382	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5383	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5384        ;;
5385      # Lahey Fortran 8.1.
5386      lf95*)
5387	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5388	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5389	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5390	;;
5391      nagfor*)
5392	# NAG Fortran compiler
5393	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5394	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5395	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5396	;;
5397      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5398        # Portland Group compilers (*not* the Pentium gcc compiler,
5399	# which looks to be a dead project)
5400	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5401	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5402	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5403        ;;
5404      ccc*)
5405        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5406        # All Alpha code is PIC.
5407        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5408        ;;
5409      xl* | bgxl* | bgf* | mpixl*)
5410	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5411	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5412	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5413	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5414	;;
5415      *)
5416	case `$CC -V 2>&1 | sed 5q` in
5417	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5418	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5419	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5420	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5421	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5422	  ;;
5423	*Sun\ F* | *Sun*Fortran*)
5424	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5425	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5426	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5427	  ;;
5428	*Sun\ C*)
5429	  # Sun C 5.9
5430	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5431	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5432	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5433	  ;;
5434        *Intel*\ [[CF]]*Compiler*)
5435	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5436	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5437	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5438	  ;;
5439	*Portland\ Group*)
5440	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5441	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5442	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5443	  ;;
5444	esac
5445	;;
5446      esac
5447      ;;
5448
5449    newsos6)
5450      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5451      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5452      ;;
5453
5454    *nto* | *qnx*)
5455      # QNX uses GNU C++, but need to define -shared option too, otherwise
5456      # it will coredump.
5457      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5458      ;;
5459
5460    osf3* | osf4* | osf5*)
5461      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5462      # All OSF/1 code is PIC.
5463      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5464      ;;
5465
5466    rdos*)
5467      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5468      ;;
5469
5470    solaris*)
5471      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5472      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5473      case $cc_basename in
5474      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5475	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5476      *)
5477	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5478      esac
5479      ;;
5480
5481    sunos4*)
5482      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5483      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5484      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5485      ;;
5486
5487    sysv4 | sysv4.2uw2* | sysv4.3*)
5488      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5489      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5490      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5491      ;;
5492
5493    sysv4*MP*)
5494      if test -d /usr/nec ;then
5495	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5496	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5497      fi
5498      ;;
5499
5500    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5501      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5502      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5503      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5504      ;;
5505
5506    unicos*)
5507      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5508      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5509      ;;
5510
5511    uts4*)
5512      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5513      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5514      ;;
5515
5516    *)
5517      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5518      ;;
5519    esac
5520  fi
5521])
5522case $host_os in
5523  # For platforms which do not support PIC, -DPIC is meaningless:
5524  *djgpp*)
5525    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5526    ;;
5527  *)
5528    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5529    ;;
5530esac
5531
5532AC_CACHE_CHECK([for $compiler option to produce PIC],
5533  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5534  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5535_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5536
5537#
5538# Check to make sure the PIC flag actually works.
5539#
5540if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5541  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5542    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5543    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5544    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5545     "" | " "*) ;;
5546     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5547     esac],
5548    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5549     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5550fi
5551_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5552	[Additional compiler flags for building library objects])
5553
5554_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5555	[How to pass a linker flag through the compiler])
5556#
5557# Check to make sure the static flag actually works.
5558#
5559wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5560_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5561  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5562  $lt_tmp_static_flag,
5563  [],
5564  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5565_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5566	[Compiler flag to prevent dynamic linking])
5567])# _LT_COMPILER_PIC
5568
5569
5570# _LT_LINKER_SHLIBS([TAGNAME])
5571# ----------------------------
5572# See if the linker supports building shared libraries.
5573m4_defun([_LT_LINKER_SHLIBS],
5574[AC_REQUIRE([LT_PATH_LD])dnl
5575AC_REQUIRE([LT_PATH_NM])dnl
5576m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5577m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5578m4_require([_LT_DECL_EGREP])dnl
5579m4_require([_LT_DECL_SED])dnl
5580m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5581m4_require([_LT_TAG_COMPILER])dnl
5582AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5583m4_if([$1], [CXX], [
5584  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5585  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5586  case $host_os in
5587  aix[[4-9]]*)
5588    # If we're using GNU nm, then we don't want the "-C" option.
5589    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5590    # Also, AIX nm treats weak defined symbols like other global defined
5591    # symbols, whereas GNU nm marks them as "W".
5592    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5593      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5594    else
5595      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5596    fi
5597    ;;
5598  pw32*)
5599    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5600    ;;
5601  cygwin* | mingw* | cegcc*)
5602    case $cc_basename in
5603    cl*)
5604      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5605      ;;
5606    *)
5607      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5608      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5609      ;;
5610    esac
5611    ;;
5612  *)
5613    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5614    ;;
5615  esac
5616], [
5617  runpath_var=
5618  _LT_TAGVAR(allow_undefined_flag, $1)=
5619  _LT_TAGVAR(always_export_symbols, $1)=no
5620  _LT_TAGVAR(archive_cmds, $1)=
5621  _LT_TAGVAR(archive_expsym_cmds, $1)=
5622  _LT_TAGVAR(compiler_needs_object, $1)=no
5623  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5624  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5625  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5626  _LT_TAGVAR(hardcode_automatic, $1)=no
5627  _LT_TAGVAR(hardcode_direct, $1)=no
5628  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5629  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5630  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5631  _LT_TAGVAR(hardcode_minus_L, $1)=no
5632  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5633  _LT_TAGVAR(inherit_rpath, $1)=no
5634  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5635  _LT_TAGVAR(module_cmds, $1)=
5636  _LT_TAGVAR(module_expsym_cmds, $1)=
5637  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5638  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5639  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5640  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5641  # include_expsyms should be a list of space-separated symbols to be *always*
5642  # included in the symbol list
5643  _LT_TAGVAR(include_expsyms, $1)=
5644  # exclude_expsyms can be an extended regexp of symbols to exclude
5645  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5646  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5647  # as well as any symbol that contains `d'.
5648  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5649  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5650  # platforms (ab)use it in PIC code, but their linkers get confused if
5651  # the symbol is explicitly referenced.  Since portable code cannot
5652  # rely on this symbol name, it's probably fine to never include it in
5653  # preloaded symbol tables.
5654  # Exclude shared library initialization/finalization symbols.
5655dnl Note also adjust exclude_expsyms for C++ above.
5656  extract_expsyms_cmds=
5657
5658  case $host_os in
5659  cygwin* | mingw* | pw32* | cegcc*)
5660    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5661    # When not using gcc, we currently assume that we are using
5662    # Microsoft Visual C++.
5663    if test "$GCC" != yes; then
5664      with_gnu_ld=no
5665    fi
5666    ;;
5667  interix*)
5668    # we just hope/assume this is gcc and not c89 (= MSVC++)
5669    with_gnu_ld=yes
5670    ;;
5671  openbsd*)
5672    with_gnu_ld=no
5673    ;;
5674  esac
5675
5676  _LT_TAGVAR(ld_shlibs, $1)=yes
5677
5678  # On some targets, GNU ld is compatible enough with the native linker
5679  # that we're better off using the native interface for both.
5680  lt_use_gnu_ld_interface=no
5681  if test "$with_gnu_ld" = yes; then
5682    case $host_os in
5683      aix*)
5684	# The AIX port of GNU ld has always aspired to compatibility
5685	# with the native linker.  However, as the warning in the GNU ld
5686	# block says, versions before 2.19.5* couldn't really create working
5687	# shared libraries, regardless of the interface used.
5688	case `$LD -v 2>&1` in
5689	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5690	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5691	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5692	  *)
5693	    lt_use_gnu_ld_interface=yes
5694	    ;;
5695	esac
5696	;;
5697      *)
5698	lt_use_gnu_ld_interface=yes
5699	;;
5700    esac
5701  fi
5702
5703  if test "$lt_use_gnu_ld_interface" = yes; then
5704    # If archive_cmds runs LD, not CC, wlarc should be empty
5705    wlarc='${wl}'
5706
5707    # Set some defaults for GNU ld with shared library support. These
5708    # are reset later if shared libraries are not supported. Putting them
5709    # here allows them to be overridden if necessary.
5710    runpath_var=LD_RUN_PATH
5711    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5712    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5713    # ancient GNU ld didn't support --whole-archive et. al.
5714    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5715      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5716    else
5717      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5718    fi
5719    supports_anon_versioning=no
5720    case `$LD -v 2>&1` in
5721      *GNU\ gold*) supports_anon_versioning=yes ;;
5722      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5723      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5724      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5725      *\ 2.11.*) ;; # other 2.11 versions
5726      *) supports_anon_versioning=yes ;;
5727    esac
5728
5729    # See if GNU ld supports shared libraries.
5730    case $host_os in
5731    aix[[3-9]]*)
5732      # On AIX/PPC, the GNU linker is very broken
5733      if test "$host_cpu" != ia64; then
5734	_LT_TAGVAR(ld_shlibs, $1)=no
5735	cat <<_LT_EOF 1>&2
5736
5737*** Warning: the GNU linker, at least up to release 2.19, is reported
5738*** to be unable to reliably create shared libraries on AIX.
5739*** Therefore, libtool is disabling shared libraries support.  If you
5740*** really care for shared libraries, you may want to install binutils
5741*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5742*** You will then need to restart the configuration process.
5743
5744_LT_EOF
5745      fi
5746      ;;
5747
5748    amigaos*)
5749      case $host_cpu in
5750      powerpc)
5751            # see comment about AmigaOS4 .so support
5752            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5753            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5754        ;;
5755      m68k)
5756            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5757            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5758            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5759        ;;
5760      esac
5761      ;;
5762
5763    beos*)
5764      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5765	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5766	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5767	# support --undefined.  This deserves some investigation.  FIXME
5768	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5769      else
5770	_LT_TAGVAR(ld_shlibs, $1)=no
5771      fi
5772      ;;
5773
5774    cygwin* | mingw* | pw32* | cegcc*)
5775      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5776      # as there is no search path for DLLs.
5777      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5778      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5779      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5780      _LT_TAGVAR(always_export_symbols, $1)=no
5781      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5782      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5783      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5784
5785      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5786        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5787	# If the export-symbols file already is a .def file (1st line
5788	# is EXPORTS), use it as is; otherwise, prepend...
5789	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5790	  cp $export_symbols $output_objdir/$soname.def;
5791	else
5792	  echo EXPORTS > $output_objdir/$soname.def;
5793	  cat $export_symbols >> $output_objdir/$soname.def;
5794	fi~
5795	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5796      else
5797	_LT_TAGVAR(ld_shlibs, $1)=no
5798      fi
5799      ;;
5800
5801    haiku*)
5802      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5803      _LT_TAGVAR(link_all_deplibs, $1)=yes
5804      ;;
5805
5806    interix[[3-9]]*)
5807      _LT_TAGVAR(hardcode_direct, $1)=no
5808      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5809      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5810      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5811      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5812      # Instead, shared libraries are loaded at an image base (0x10000000 by
5813      # default) and relocated if they conflict, which is a slow very memory
5814      # consuming and fragmenting process.  To avoid this, we pick a random,
5815      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5816      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5817      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5818      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5819      ;;
5820
5821    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5822      tmp_diet=no
5823      if test "$host_os" = linux-dietlibc; then
5824	case $cc_basename in
5825	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5826	esac
5827      fi
5828      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5829	 && test "$tmp_diet" = no
5830      then
5831	tmp_addflag=' $pic_flag'
5832	tmp_sharedflag='-shared'
5833	case $cc_basename,$host_cpu in
5834        pgcc*)				# Portland Group C compiler
5835	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5836	  tmp_addflag=' $pic_flag'
5837	  ;;
5838	pgf77* | pgf90* | pgf95* | pgfortran*)
5839					# Portland Group f77 and f90 compilers
5840	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5841	  tmp_addflag=' $pic_flag -Mnomain' ;;
5842	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5843	  tmp_addflag=' -i_dynamic' ;;
5844	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5845	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5846	ifc* | ifort*)			# Intel Fortran compiler
5847	  tmp_addflag=' -nofor_main' ;;
5848	lf95*)				# Lahey Fortran 8.1
5849	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5850	  tmp_sharedflag='--shared' ;;
5851	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5852	  tmp_sharedflag='-qmkshrobj'
5853	  tmp_addflag= ;;
5854	nvcc*)	# Cuda Compiler Driver 2.2
5855	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5856	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5857	  ;;
5858	esac
5859	case `$CC -V 2>&1 | sed 5q` in
5860	*Sun\ C*)			# Sun C 5.9
5861	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5862	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5863	  tmp_sharedflag='-G' ;;
5864	*Sun\ F*)			# Sun Fortran 8.3
5865	  tmp_sharedflag='-G' ;;
5866	esac
5867	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5868
5869        if test "x$supports_anon_versioning" = xyes; then
5870          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5871	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5872	    echo "local: *; };" >> $output_objdir/$libname.ver~
5873	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5874        fi
5875
5876	case $cc_basename in
5877	xlf* | bgf* | bgxlf* | mpixlf*)
5878	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5879	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5880	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5881	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5882	  if test "x$supports_anon_versioning" = xyes; then
5883	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5884	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5885	      echo "local: *; };" >> $output_objdir/$libname.ver~
5886	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5887	  fi
5888	  ;;
5889	esac
5890      else
5891        _LT_TAGVAR(ld_shlibs, $1)=no
5892      fi
5893      ;;
5894
5895    netbsd*)
5896      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5897	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5898	wlarc=
5899      else
5900	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5901	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5902      fi
5903      ;;
5904
5905    solaris*)
5906      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5907	_LT_TAGVAR(ld_shlibs, $1)=no
5908	cat <<_LT_EOF 1>&2
5909
5910*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5911*** create shared libraries on Solaris systems.  Therefore, libtool
5912*** is disabling shared libraries support.  We urge you to upgrade GNU
5913*** binutils to release 2.9.1 or newer.  Another option is to modify
5914*** your PATH or compiler configuration so that the native linker is
5915*** used, and then restart.
5916
5917_LT_EOF
5918      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5919	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5920	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5921      else
5922	_LT_TAGVAR(ld_shlibs, $1)=no
5923      fi
5924      ;;
5925
5926    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5927      case `$LD -v 2>&1` in
5928        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5929	_LT_TAGVAR(ld_shlibs, $1)=no
5930	cat <<_LT_EOF 1>&2
5931
5932*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5933*** reliably create shared libraries on SCO systems.  Therefore, libtool
5934*** is disabling shared libraries support.  We urge you to upgrade GNU
5935*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5936*** your PATH or compiler configuration so that the native linker is
5937*** used, and then restart.
5938
5939_LT_EOF
5940	;;
5941	*)
5942	  # For security reasons, it is highly recommended that you always
5943	  # use absolute paths for naming shared libraries, and exclude the
5944	  # DT_RUNPATH tag from executables and libraries.  But doing so
5945	  # requires that you compile everything twice, which is a pain.
5946	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5947	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5948	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5949	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5950	  else
5951	    _LT_TAGVAR(ld_shlibs, $1)=no
5952	  fi
5953	;;
5954      esac
5955      ;;
5956
5957    sunos4*)
5958      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5959      wlarc=
5960      _LT_TAGVAR(hardcode_direct, $1)=yes
5961      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5962      ;;
5963
5964    *)
5965      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5966	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5967	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5968      else
5969	_LT_TAGVAR(ld_shlibs, $1)=no
5970      fi
5971      ;;
5972    esac
5973
5974    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
5975      runpath_var=
5976      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5977      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5978      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5979    fi
5980  else
5981    # PORTME fill in a description of your system's linker (not GNU ld)
5982    case $host_os in
5983    aix3*)
5984      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5985      _LT_TAGVAR(always_export_symbols, $1)=yes
5986      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
5987      # Note: this linker hardcodes the directories in LIBPATH if there
5988      # are no directories specified by -L.
5989      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5990      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5991	# Neither direct hardcoding nor static linking is supported with a
5992	# broken collect2.
5993	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5994      fi
5995      ;;
5996
5997    aix[[4-9]]*)
5998      if test "$host_cpu" = ia64; then
5999	# On IA64, the linker does run time linking by default, so we don't
6000	# have to do anything special.
6001	aix_use_runtimelinking=no
6002	exp_sym_flag='-Bexport'
6003	no_entry_flag=""
6004      else
6005	# If we're using GNU nm, then we don't want the "-C" option.
6006	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6007	# Also, AIX nm treats weak defined symbols like other global
6008	# defined symbols, whereas GNU nm marks them as "W".
6009	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6010	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6011	else
6012	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6013	fi
6014	aix_use_runtimelinking=no
6015
6016	# Test if we are trying to use run time linking or normal
6017	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6018	# need to do runtime linking.
6019	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6020	  for ld_flag in $LDFLAGS; do
6021	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6022	    aix_use_runtimelinking=yes
6023	    break
6024	  fi
6025	  done
6026	  ;;
6027	esac
6028
6029	exp_sym_flag='-bexport'
6030	no_entry_flag='-bnoentry'
6031      fi
6032
6033      # When large executables or shared objects are built, AIX ld can
6034      # have problems creating the table of contents.  If linking a library
6035      # or program results in "error TOC overflow" add -mminimal-toc to
6036      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6037      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6038
6039      _LT_TAGVAR(archive_cmds, $1)=''
6040      _LT_TAGVAR(hardcode_direct, $1)=yes
6041      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6042      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6043      _LT_TAGVAR(link_all_deplibs, $1)=yes
6044      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6045
6046      if test "$GCC" = yes; then
6047	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6048	# We only want to do this on AIX 4.2 and lower, the check
6049	# below for broken collect2 doesn't work under 4.3+
6050	  collect2name=`${CC} -print-prog-name=collect2`
6051	  if test -f "$collect2name" &&
6052	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6053	  then
6054	  # We have reworked collect2
6055	  :
6056	  else
6057	  # We have old collect2
6058	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6059	  # It fails to find uninstalled libraries when the uninstalled
6060	  # path is not listed in the libpath.  Setting hardcode_minus_L
6061	  # to unsupported forces relinking
6062	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6063	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6064	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6065	  fi
6066	  ;;
6067	esac
6068	shared_flag='-shared'
6069	if test "$aix_use_runtimelinking" = yes; then
6070	  shared_flag="$shared_flag "'${wl}-G'
6071	fi
6072      else
6073	# not using gcc
6074	if test "$host_cpu" = ia64; then
6075	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6076	# chokes on -Wl,-G. The following line is correct:
6077	  shared_flag='-G'
6078	else
6079	  if test "$aix_use_runtimelinking" = yes; then
6080	    shared_flag='${wl}-G'
6081	  else
6082	    shared_flag='${wl}-bM:SRE'
6083	  fi
6084	fi
6085      fi
6086
6087      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6088      # It seems that -bexpall does not export symbols beginning with
6089      # underscore (_), so it is better to generate a list of symbols to export.
6090      _LT_TAGVAR(always_export_symbols, $1)=yes
6091      if test "$aix_use_runtimelinking" = yes; then
6092	# Warning - without using the other runtime loading flags (-brtl),
6093	# -berok will link without error, but may produce a broken library.
6094	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6095        # Determine the default libpath from the value encoded in an
6096        # empty executable.
6097        _LT_SYS_MODULE_PATH_AIX([$1])
6098        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6099        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6100      else
6101	if test "$host_cpu" = ia64; then
6102	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6103	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6104	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
6105	else
6106	 # Determine the default libpath from the value encoded in an
6107	 # empty executable.
6108	 _LT_SYS_MODULE_PATH_AIX([$1])
6109	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6110	  # Warning - without using the other run time loading flags,
6111	  # -berok will link without error, but may produce a broken library.
6112	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6113	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6114	  if test "$with_gnu_ld" = yes; then
6115	    # We only use this code for GNU lds that support --whole-archive.
6116	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6117	  else
6118	    # Exported symbols can be pulled into shared objects from archives
6119	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6120	  fi
6121	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6122	  # This is similar to how AIX traditionally builds its shared libraries.
6123	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6124	fi
6125      fi
6126      ;;
6127
6128    amigaos*)
6129      case $host_cpu in
6130      powerpc)
6131            # see comment about AmigaOS4 .so support
6132            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6133            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6134        ;;
6135      m68k)
6136            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
6137            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6138            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6139        ;;
6140      esac
6141      ;;
6142
6143    bsdi[[45]]*)
6144      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6145      ;;
6146
6147    cygwin* | mingw* | pw32* | cegcc*)
6148      # When not using gcc, we currently assume that we are using
6149      # Microsoft Visual C++.
6150      # hardcode_libdir_flag_spec is actually meaningless, as there is
6151      # no search path for DLLs.
6152      case $cc_basename in
6153      cl*)
6154	# Native MSVC
6155	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6156	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6157	_LT_TAGVAR(always_export_symbols, $1)=yes
6158	_LT_TAGVAR(file_list_spec, $1)='@'
6159	# Tell ltmain to make .lib files, not .a files.
6160	libext=lib
6161	# Tell ltmain to make .dll files, not .so files.
6162	shrext_cmds=".dll"
6163	# FIXME: Setting linknames here is a bad hack.
6164	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6165	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6166	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6167	  else
6168	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6169	  fi~
6170	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6171	  linknames='
6172	# The linker will not automatically build a static lib if we build a DLL.
6173	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6174	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6175	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6176	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
6177	# Don't use ranlib
6178	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6179	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6180	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6181	  case $lt_outputfile in
6182	    *.exe|*.EXE) ;;
6183	    *)
6184	      lt_outputfile="$lt_outputfile.exe"
6185	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6186	      ;;
6187	  esac~
6188	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6189	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6190	    $RM "$lt_outputfile.manifest";
6191	  fi'
6192	;;
6193      *)
6194	# Assume MSVC wrapper
6195	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6196	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6197	# Tell ltmain to make .lib files, not .a files.
6198	libext=lib
6199	# Tell ltmain to make .dll files, not .so files.
6200	shrext_cmds=".dll"
6201	# FIXME: Setting linknames here is a bad hack.
6202	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6203	# The linker will automatically build a .lib file if we build a DLL.
6204	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6205	# FIXME: Should let the user specify the lib program.
6206	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6207	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6208	;;
6209      esac
6210      ;;
6211
6212    darwin* | rhapsody*)
6213      _LT_DARWIN_LINKER_FEATURES($1)
6214      ;;
6215
6216    dgux*)
6217      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6218      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6219      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6220      ;;
6221
6222    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6223    # support.  Future versions do this automatically, but an explicit c++rt0.o
6224    # does not break anything, and helps significantly (at the cost of a little
6225    # extra space).
6226    freebsd2.2*)
6227      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6228      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6229      _LT_TAGVAR(hardcode_direct, $1)=yes
6230      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6231      ;;
6232
6233    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6234    freebsd2.*)
6235      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6236      _LT_TAGVAR(hardcode_direct, $1)=yes
6237      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6238      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6239      ;;
6240
6241    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6242    freebsd* | dragonfly*)
6243      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6244      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6245      _LT_TAGVAR(hardcode_direct, $1)=yes
6246      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6247      ;;
6248
6249    hpux9*)
6250      if test "$GCC" = yes; then
6251	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6252      else
6253	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6254      fi
6255      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6256      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6257      _LT_TAGVAR(hardcode_direct, $1)=yes
6258
6259      # hardcode_minus_L: Not really in the search PATH,
6260      # but as the default location of the library.
6261      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6262      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6263      ;;
6264
6265    hpux10*)
6266      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6267	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6268      else
6269	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6270      fi
6271      if test "$with_gnu_ld" = no; then
6272	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6273	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6274	_LT_TAGVAR(hardcode_direct, $1)=yes
6275	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6276	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6277	# hardcode_minus_L: Not really in the search PATH,
6278	# but as the default location of the library.
6279	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6280      fi
6281      ;;
6282
6283    hpux11*)
6284      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6285	case $host_cpu in
6286	hppa*64*)
6287	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6288	  ;;
6289	ia64*)
6290	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6291	  ;;
6292	*)
6293	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6294	  ;;
6295	esac
6296      else
6297	case $host_cpu in
6298	hppa*64*)
6299	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6300	  ;;
6301	ia64*)
6302	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6303	  ;;
6304	*)
6305	m4_if($1, [], [
6306	  # Older versions of the 11.00 compiler do not understand -b yet
6307	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6308	  _LT_LINKER_OPTION([if $CC understands -b],
6309	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6310	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6311	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6312	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6313	  ;;
6314	esac
6315      fi
6316      if test "$with_gnu_ld" = no; then
6317	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6318	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6319
6320	case $host_cpu in
6321	hppa*64*|ia64*)
6322	  _LT_TAGVAR(hardcode_direct, $1)=no
6323	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6324	  ;;
6325	*)
6326	  _LT_TAGVAR(hardcode_direct, $1)=yes
6327	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6328	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6329
6330	  # hardcode_minus_L: Not really in the search PATH,
6331	  # but as the default location of the library.
6332	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6333	  ;;
6334	esac
6335      fi
6336      ;;
6337
6338    irix5* | irix6* | nonstopux*)
6339      if test "$GCC" = yes; then
6340	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6341	# Try to use the -exported_symbol ld option, if it does not
6342	# work, assume that -exports_file does not work either and
6343	# implicitly export all symbols.
6344	# This should be the same for all languages, so no per-tag cache variable.
6345	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6346	  [lt_cv_irix_exported_symbol],
6347	  [save_LDFLAGS="$LDFLAGS"
6348	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6349	   AC_LINK_IFELSE(
6350	     [AC_LANG_SOURCE(
6351	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6352			      [C++], [[int foo (void) { return 0; }]],
6353			      [Fortran 77], [[
6354      subroutine foo
6355      end]],
6356			      [Fortran], [[
6357      subroutine foo
6358      end]])])],
6359	      [lt_cv_irix_exported_symbol=yes],
6360	      [lt_cv_irix_exported_symbol=no])
6361           LDFLAGS="$save_LDFLAGS"])
6362	if test "$lt_cv_irix_exported_symbol" = yes; then
6363          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
6364	fi
6365      else
6366	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6367	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
6368      fi
6369      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6370      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6371      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6372      _LT_TAGVAR(inherit_rpath, $1)=yes
6373      _LT_TAGVAR(link_all_deplibs, $1)=yes
6374      ;;
6375
6376    netbsd*)
6377      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6378	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6379      else
6380	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6381      fi
6382      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6383      _LT_TAGVAR(hardcode_direct, $1)=yes
6384      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6385      ;;
6386
6387    newsos6)
6388      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6389      _LT_TAGVAR(hardcode_direct, $1)=yes
6390      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6391      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6392      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6393      ;;
6394
6395    *nto* | *qnx*)
6396      ;;
6397
6398    openbsd*)
6399      if test -f /usr/libexec/ld.so; then
6400	_LT_TAGVAR(hardcode_direct, $1)=yes
6401	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6402	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6403	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6404	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6405	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6406	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6407	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6408	else
6409	  case $host_os in
6410	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6411	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6412	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6413	     ;;
6414	   *)
6415	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6416	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6417	     ;;
6418	  esac
6419	fi
6420      else
6421	_LT_TAGVAR(ld_shlibs, $1)=no
6422      fi
6423      ;;
6424
6425    os2*)
6426      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6427      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6428      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6429      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
6430      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6431      ;;
6432
6433    osf3*)
6434      if test "$GCC" = yes; then
6435	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6436	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6437      else
6438	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6439	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6440      fi
6441      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6442      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6443      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6444      ;;
6445
6446    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6447      if test "$GCC" = yes; then
6448	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6449	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6450	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6451      else
6452	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6453	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6454	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
6455	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
6456
6457	# Both c and cxx compiler support -rpath directly
6458	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6459      fi
6460      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6461      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6462      ;;
6463
6464    solaris*)
6465      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6466      if test "$GCC" = yes; then
6467	wlarc='${wl}'
6468	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6469	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6470	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6471      else
6472	case `$CC -V 2>&1` in
6473	*"Compilers 5.0"*)
6474	  wlarc=''
6475	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6476	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6477	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6478	  ;;
6479	*)
6480	  wlarc='${wl}'
6481	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6482	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6483	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6484	  ;;
6485	esac
6486      fi
6487      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6488      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6489      case $host_os in
6490      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6491      *)
6492	# The compiler driver will combine and reorder linker options,
6493	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6494	# but is careful enough not to reorder.
6495	# Supported since Solaris 2.6 (maybe 2.5.1?)
6496	if test "$GCC" = yes; then
6497	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6498	else
6499	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6500	fi
6501	;;
6502      esac
6503      _LT_TAGVAR(link_all_deplibs, $1)=yes
6504      ;;
6505
6506    sunos4*)
6507      if test "x$host_vendor" = xsequent; then
6508	# Use $CC to link under sequent, because it throws in some extra .o
6509	# files that make .init and .fini sections work.
6510	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6511      else
6512	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6513      fi
6514      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6515      _LT_TAGVAR(hardcode_direct, $1)=yes
6516      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6517      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6518      ;;
6519
6520    sysv4)
6521      case $host_vendor in
6522	sni)
6523	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6524	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6525	;;
6526	siemens)
6527	  ## LD is ld it makes a PLAMLIB
6528	  ## CC just makes a GrossModule.
6529	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6530	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6531	  _LT_TAGVAR(hardcode_direct, $1)=no
6532        ;;
6533	motorola)
6534	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6535	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6536	;;
6537      esac
6538      runpath_var='LD_RUN_PATH'
6539      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6540      ;;
6541
6542    sysv4.3*)
6543      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6544      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6545      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6546      ;;
6547
6548    sysv4*MP*)
6549      if test -d /usr/nec; then
6550	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6551	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6552	runpath_var=LD_RUN_PATH
6553	hardcode_runpath_var=yes
6554	_LT_TAGVAR(ld_shlibs, $1)=yes
6555      fi
6556      ;;
6557
6558    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6559      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6560      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6561      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6562      runpath_var='LD_RUN_PATH'
6563
6564      if test "$GCC" = yes; then
6565	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6566	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6567      else
6568	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6569	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6570      fi
6571      ;;
6572
6573    sysv5* | sco3.2v5* | sco5v6*)
6574      # Note: We can NOT use -z defs as we might desire, because we do not
6575      # link with -lc, and that would cause any symbols used from libc to
6576      # always be unresolved, which means just about no library would
6577      # ever link correctly.  If we're not using GNU ld we use -z text
6578      # though, which does catch some bad symbols but isn't as heavy-handed
6579      # as -z defs.
6580      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6581      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6582      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6583      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6584      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6585      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6586      _LT_TAGVAR(link_all_deplibs, $1)=yes
6587      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6588      runpath_var='LD_RUN_PATH'
6589
6590      if test "$GCC" = yes; then
6591	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6592	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6593      else
6594	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6595	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6596      fi
6597      ;;
6598
6599    uts4*)
6600      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6601      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6602      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6603      ;;
6604
6605    *)
6606      _LT_TAGVAR(ld_shlibs, $1)=no
6607      ;;
6608    esac
6609
6610    if test x$host_vendor = xsni; then
6611      case $host in
6612      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6613	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6614	;;
6615      esac
6616    fi
6617  fi
6618])
6619AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6620test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6621
6622_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6623
6624_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6625_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6626_LT_DECL([], [extract_expsyms_cmds], [2],
6627    [The commands to extract the exported symbol list from a shared archive])
6628
6629#
6630# Do we need to explicitly link libc?
6631#
6632case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6633x|xyes)
6634  # Assume -lc should be added
6635  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6636
6637  if test "$enable_shared" = yes && test "$GCC" = yes; then
6638    case $_LT_TAGVAR(archive_cmds, $1) in
6639    *'~'*)
6640      # FIXME: we may have to deal with multi-command sequences.
6641      ;;
6642    '$CC '*)
6643      # Test whether the compiler implicitly links with -lc since on some
6644      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6645      # to ld, don't add -lc before -lgcc.
6646      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6647	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6648	[$RM conftest*
6649	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6650
6651	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6652	  soname=conftest
6653	  lib=conftest
6654	  libobjs=conftest.$ac_objext
6655	  deplibs=
6656	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6657	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6658	  compiler_flags=-v
6659	  linker_flags=-v
6660	  verstring=
6661	  output_objdir=.
6662	  libname=conftest
6663	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6664	  _LT_TAGVAR(allow_undefined_flag, $1)=
6665	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6666	  then
6667	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6668	  else
6669	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6670	  fi
6671	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6672	else
6673	  cat conftest.err 1>&5
6674	fi
6675	$RM conftest*
6676	])
6677      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6678      ;;
6679    esac
6680  fi
6681  ;;
6682esac
6683
6684_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6685    [Whether or not to add -lc for building shared libraries])
6686_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6687    [enable_shared_with_static_runtimes], [0],
6688    [Whether or not to disallow shared libs when runtime libs are static])
6689_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6690    [Compiler flag to allow reflexive dlopens])
6691_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6692    [Compiler flag to generate shared objects directly from archives])
6693_LT_TAGDECL([], [compiler_needs_object], [1],
6694    [Whether the compiler copes with passing no objects directly])
6695_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6696    [Create an old-style archive from a shared archive])
6697_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6698    [Create a temporary old-style archive to link instead of a shared archive])
6699_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6700_LT_TAGDECL([], [archive_expsym_cmds], [2])
6701_LT_TAGDECL([], [module_cmds], [2],
6702    [Commands used to build a loadable module if different from building
6703    a shared archive.])
6704_LT_TAGDECL([], [module_expsym_cmds], [2])
6705_LT_TAGDECL([], [with_gnu_ld], [1],
6706    [Whether we are building with GNU ld or not])
6707_LT_TAGDECL([], [allow_undefined_flag], [1],
6708    [Flag that allows shared libraries with undefined symbols to be built])
6709_LT_TAGDECL([], [no_undefined_flag], [1],
6710    [Flag that enforces no undefined symbols])
6711_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6712    [Flag to hardcode $libdir into a binary during linking.
6713    This must work even if $libdir does not exist])
6714_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6715    [Whether we need a single "-rpath" flag with a separated argument])
6716_LT_TAGDECL([], [hardcode_direct], [0],
6717    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6718    DIR into the resulting binary])
6719_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6720    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6721    DIR into the resulting binary and the resulting library dependency is
6722    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6723    library is relocated])
6724_LT_TAGDECL([], [hardcode_minus_L], [0],
6725    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6726    into the resulting binary])
6727_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6728    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6729    into the resulting binary])
6730_LT_TAGDECL([], [hardcode_automatic], [0],
6731    [Set to "yes" if building a shared library automatically hardcodes DIR
6732    into the library and all subsequent libraries and executables linked
6733    against it])
6734_LT_TAGDECL([], [inherit_rpath], [0],
6735    [Set to yes if linker adds runtime paths of dependent libraries
6736    to runtime path list])
6737_LT_TAGDECL([], [link_all_deplibs], [0],
6738    [Whether libtool must link a program against all its dependency libraries])
6739_LT_TAGDECL([], [always_export_symbols], [0],
6740    [Set to "yes" if exported symbols are required])
6741_LT_TAGDECL([], [export_symbols_cmds], [2],
6742    [The commands to list exported symbols])
6743_LT_TAGDECL([], [exclude_expsyms], [1],
6744    [Symbols that should not be listed in the preloaded symbols])
6745_LT_TAGDECL([], [include_expsyms], [1],
6746    [Symbols that must always be exported])
6747_LT_TAGDECL([], [prelink_cmds], [2],
6748    [Commands necessary for linking programs (against libraries) with templates])
6749_LT_TAGDECL([], [postlink_cmds], [2],
6750    [Commands necessary for finishing linking programs])
6751_LT_TAGDECL([], [file_list_spec], [1],
6752    [Specify filename containing input files])
6753dnl FIXME: Not yet implemented
6754dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6755dnl    [Compiler flag to generate thread safe objects])
6756])# _LT_LINKER_SHLIBS
6757
6758
6759# _LT_LANG_C_CONFIG([TAG])
6760# ------------------------
6761# Ensure that the configuration variables for a C compiler are suitably
6762# defined.  These variables are subsequently used by _LT_CONFIG to write
6763# the compiler configuration to `libtool'.
6764m4_defun([_LT_LANG_C_CONFIG],
6765[m4_require([_LT_DECL_EGREP])dnl
6766lt_save_CC="$CC"
6767AC_LANG_PUSH(C)
6768
6769# Source file extension for C test sources.
6770ac_ext=c
6771
6772# Object file extension for compiled C test sources.
6773objext=o
6774_LT_TAGVAR(objext, $1)=$objext
6775
6776# Code to be used in simple compile tests
6777lt_simple_compile_test_code="int some_variable = 0;"
6778
6779# Code to be used in simple link tests
6780lt_simple_link_test_code='int main(){return(0);}'
6781
6782_LT_TAG_COMPILER
6783# Save the default compiler, since it gets overwritten when the other
6784# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6785compiler_DEFAULT=$CC
6786
6787# save warnings/boilerplate of simple test code
6788_LT_COMPILER_BOILERPLATE
6789_LT_LINKER_BOILERPLATE
6790
6791if test -n "$compiler"; then
6792  _LT_COMPILER_NO_RTTI($1)
6793  _LT_COMPILER_PIC($1)
6794  _LT_COMPILER_C_O($1)
6795  _LT_COMPILER_FILE_LOCKS($1)
6796  _LT_LINKER_SHLIBS($1)
6797  _LT_SYS_DYNAMIC_LINKER($1)
6798  _LT_LINKER_HARDCODE_LIBPATH($1)
6799  LT_SYS_DLOPEN_SELF
6800  _LT_CMD_STRIPLIB
6801
6802  # Report which library types will actually be built
6803  AC_MSG_CHECKING([if libtool supports shared libraries])
6804  AC_MSG_RESULT([$can_build_shared])
6805
6806  AC_MSG_CHECKING([whether to build shared libraries])
6807  test "$can_build_shared" = "no" && enable_shared=no
6808
6809  # On AIX, shared libraries and static libraries use the same namespace, and
6810  # are all built from PIC.
6811  case $host_os in
6812  aix3*)
6813    test "$enable_shared" = yes && enable_static=no
6814    if test -n "$RANLIB"; then
6815      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6816      postinstall_cmds='$RANLIB $lib'
6817    fi
6818    ;;
6819
6820  aix[[4-9]]*)
6821    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6822      test "$enable_shared" = yes && enable_static=no
6823    fi
6824    ;;
6825  esac
6826  AC_MSG_RESULT([$enable_shared])
6827
6828  AC_MSG_CHECKING([whether to build static libraries])
6829  # Make sure either enable_shared or enable_static is yes.
6830  test "$enable_shared" = yes || enable_static=yes
6831  AC_MSG_RESULT([$enable_static])
6832
6833  _LT_CONFIG($1)
6834fi
6835AC_LANG_POP
6836CC="$lt_save_CC"
6837])# _LT_LANG_C_CONFIG
6838
6839
6840# _LT_LANG_CXX_CONFIG([TAG])
6841# --------------------------
6842# Ensure that the configuration variables for a C++ compiler are suitably
6843# defined.  These variables are subsequently used by _LT_CONFIG to write
6844# the compiler configuration to `libtool'.
6845m4_defun([_LT_LANG_CXX_CONFIG],
6846[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6847m4_require([_LT_DECL_EGREP])dnl
6848m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6849if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6850    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6851    (test "X$CXX" != "Xg++"))) ; then
6852  AC_PROG_CXXCPP
6853else
6854  _lt_caught_CXX_error=yes
6855fi
6856
6857AC_LANG_PUSH(C++)
6858_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6859_LT_TAGVAR(allow_undefined_flag, $1)=
6860_LT_TAGVAR(always_export_symbols, $1)=no
6861_LT_TAGVAR(archive_expsym_cmds, $1)=
6862_LT_TAGVAR(compiler_needs_object, $1)=no
6863_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6864_LT_TAGVAR(hardcode_direct, $1)=no
6865_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6866_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6867_LT_TAGVAR(hardcode_libdir_separator, $1)=
6868_LT_TAGVAR(hardcode_minus_L, $1)=no
6869_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6870_LT_TAGVAR(hardcode_automatic, $1)=no
6871_LT_TAGVAR(inherit_rpath, $1)=no
6872_LT_TAGVAR(module_cmds, $1)=
6873_LT_TAGVAR(module_expsym_cmds, $1)=
6874_LT_TAGVAR(link_all_deplibs, $1)=unknown
6875_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6876_LT_TAGVAR(reload_flag, $1)=$reload_flag
6877_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6878_LT_TAGVAR(no_undefined_flag, $1)=
6879_LT_TAGVAR(whole_archive_flag_spec, $1)=
6880_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6881
6882# Source file extension for C++ test sources.
6883ac_ext=cpp
6884
6885# Object file extension for compiled C++ test sources.
6886objext=o
6887_LT_TAGVAR(objext, $1)=$objext
6888
6889# No sense in running all these tests if we already determined that
6890# the CXX compiler isn't working.  Some variables (like enable_shared)
6891# are currently assumed to apply to all compilers on this platform,
6892# and will be corrupted by setting them based on a non-working compiler.
6893if test "$_lt_caught_CXX_error" != yes; then
6894  # Code to be used in simple compile tests
6895  lt_simple_compile_test_code="int some_variable = 0;"
6896
6897  # Code to be used in simple link tests
6898  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6899
6900  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6901  _LT_TAG_COMPILER
6902
6903  # save warnings/boilerplate of simple test code
6904  _LT_COMPILER_BOILERPLATE
6905  _LT_LINKER_BOILERPLATE
6906
6907  # Allow CC to be a program name with arguments.
6908  lt_save_CC=$CC
6909  lt_save_CFLAGS=$CFLAGS
6910  lt_save_LD=$LD
6911  lt_save_GCC=$GCC
6912  GCC=$GXX
6913  lt_save_with_gnu_ld=$with_gnu_ld
6914  lt_save_path_LD=$lt_cv_path_LD
6915  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6916    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6917  else
6918    $as_unset lt_cv_prog_gnu_ld
6919  fi
6920  if test -n "${lt_cv_path_LDCXX+set}"; then
6921    lt_cv_path_LD=$lt_cv_path_LDCXX
6922  else
6923    $as_unset lt_cv_path_LD
6924  fi
6925  test -z "${LDCXX+set}" || LD=$LDCXX
6926  CC=${CXX-"c++"}
6927  CFLAGS=$CXXFLAGS
6928  compiler=$CC
6929  _LT_TAGVAR(compiler, $1)=$CC
6930  _LT_CC_BASENAME([$compiler])
6931
6932  if test -n "$compiler"; then
6933    # We don't want -fno-exception when compiling C++ code, so set the
6934    # no_builtin_flag separately
6935    if test "$GXX" = yes; then
6936      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6937    else
6938      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6939    fi
6940
6941    if test "$GXX" = yes; then
6942      # Set up default GNU C++ configuration
6943
6944      LT_PATH_LD
6945
6946      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6947      # archiving commands below assume that GNU ld is being used.
6948      if test "$with_gnu_ld" = yes; then
6949        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6950        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6951
6952        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6953        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6954
6955        # If archive_cmds runs LD, not CC, wlarc should be empty
6956        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6957        #     investigate it a little bit more. (MM)
6958        wlarc='${wl}'
6959
6960        # ancient GNU ld didn't support --whole-archive et. al.
6961        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6962	  $GREP 'no-whole-archive' > /dev/null; then
6963          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6964        else
6965          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6966        fi
6967      else
6968        with_gnu_ld=no
6969        wlarc=
6970
6971        # A generic and very simple default shared library creation
6972        # command for GNU C++ for the case where it uses the native
6973        # linker, instead of GNU ld.  If possible, this setting should
6974        # overridden to take advantage of the native linker features on
6975        # the platform it is being used on.
6976        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6977      fi
6978
6979      # Commands to make compiler produce verbose output that lists
6980      # what "hidden" libraries, object files and flags are used when
6981      # linking a shared library.
6982      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6983
6984    else
6985      GXX=no
6986      with_gnu_ld=no
6987      wlarc=
6988    fi
6989
6990    # PORTME: fill in a description of your system's C++ link characteristics
6991    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6992    _LT_TAGVAR(ld_shlibs, $1)=yes
6993    case $host_os in
6994      aix3*)
6995        # FIXME: insert proper C++ library support
6996        _LT_TAGVAR(ld_shlibs, $1)=no
6997        ;;
6998      aix[[4-9]]*)
6999        if test "$host_cpu" = ia64; then
7000          # On IA64, the linker does run time linking by default, so we don't
7001          # have to do anything special.
7002          aix_use_runtimelinking=no
7003          exp_sym_flag='-Bexport'
7004          no_entry_flag=""
7005        else
7006          aix_use_runtimelinking=no
7007
7008          # Test if we are trying to use run time linking or normal
7009          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7010          # need to do runtime linking.
7011          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7012	    for ld_flag in $LDFLAGS; do
7013	      case $ld_flag in
7014	      *-brtl*)
7015	        aix_use_runtimelinking=yes
7016	        break
7017	        ;;
7018	      esac
7019	    done
7020	    ;;
7021          esac
7022
7023          exp_sym_flag='-bexport'
7024          no_entry_flag='-bnoentry'
7025        fi
7026
7027        # When large executables or shared objects are built, AIX ld can
7028        # have problems creating the table of contents.  If linking a library
7029        # or program results in "error TOC overflow" add -mminimal-toc to
7030        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7031        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7032
7033        _LT_TAGVAR(archive_cmds, $1)=''
7034        _LT_TAGVAR(hardcode_direct, $1)=yes
7035        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7036        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7037        _LT_TAGVAR(link_all_deplibs, $1)=yes
7038        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7039
7040        if test "$GXX" = yes; then
7041          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7042          # We only want to do this on AIX 4.2 and lower, the check
7043          # below for broken collect2 doesn't work under 4.3+
7044	  collect2name=`${CC} -print-prog-name=collect2`
7045	  if test -f "$collect2name" &&
7046	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7047	  then
7048	    # We have reworked collect2
7049	    :
7050	  else
7051	    # We have old collect2
7052	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7053	    # It fails to find uninstalled libraries when the uninstalled
7054	    # path is not listed in the libpath.  Setting hardcode_minus_L
7055	    # to unsupported forces relinking
7056	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7057	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7058	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7059	  fi
7060          esac
7061          shared_flag='-shared'
7062	  if test "$aix_use_runtimelinking" = yes; then
7063	    shared_flag="$shared_flag "'${wl}-G'
7064	  fi
7065        else
7066          # not using gcc
7067          if test "$host_cpu" = ia64; then
7068	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7069	  # chokes on -Wl,-G. The following line is correct:
7070	  shared_flag='-G'
7071          else
7072	    if test "$aix_use_runtimelinking" = yes; then
7073	      shared_flag='${wl}-G'
7074	    else
7075	      shared_flag='${wl}-bM:SRE'
7076	    fi
7077          fi
7078        fi
7079
7080        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7081        # It seems that -bexpall does not export symbols beginning with
7082        # underscore (_), so it is better to generate a list of symbols to
7083	# export.
7084        _LT_TAGVAR(always_export_symbols, $1)=yes
7085        if test "$aix_use_runtimelinking" = yes; then
7086          # Warning - without using the other runtime loading flags (-brtl),
7087          # -berok will link without error, but may produce a broken library.
7088          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7089          # Determine the default libpath from the value encoded in an empty
7090          # executable.
7091          _LT_SYS_MODULE_PATH_AIX([$1])
7092          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7093
7094          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
7095        else
7096          if test "$host_cpu" = ia64; then
7097	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7098	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7099	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
7100          else
7101	    # Determine the default libpath from the value encoded in an
7102	    # empty executable.
7103	    _LT_SYS_MODULE_PATH_AIX([$1])
7104	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7105	    # Warning - without using the other run time loading flags,
7106	    # -berok will link without error, but may produce a broken library.
7107	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7108	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7109	    if test "$with_gnu_ld" = yes; then
7110	      # We only use this code for GNU lds that support --whole-archive.
7111	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7112	    else
7113	      # Exported symbols can be pulled into shared objects from archives
7114	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7115	    fi
7116	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7117	    # This is similar to how AIX traditionally builds its shared
7118	    # libraries.
7119	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
7120          fi
7121        fi
7122        ;;
7123
7124      beos*)
7125	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7126	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7127	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7128	  # support --undefined.  This deserves some investigation.  FIXME
7129	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7130	else
7131	  _LT_TAGVAR(ld_shlibs, $1)=no
7132	fi
7133	;;
7134
7135      chorus*)
7136        case $cc_basename in
7137          *)
7138	  # FIXME: insert proper C++ library support
7139	  _LT_TAGVAR(ld_shlibs, $1)=no
7140	  ;;
7141        esac
7142        ;;
7143
7144      cygwin* | mingw* | pw32* | cegcc*)
7145	case $GXX,$cc_basename in
7146	,cl* | no,cl*)
7147	  # Native MSVC
7148	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7149	  # no search path for DLLs.
7150	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7151	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7152	  _LT_TAGVAR(always_export_symbols, $1)=yes
7153	  _LT_TAGVAR(file_list_spec, $1)='@'
7154	  # Tell ltmain to make .lib files, not .a files.
7155	  libext=lib
7156	  # Tell ltmain to make .dll files, not .so files.
7157	  shrext_cmds=".dll"
7158	  # FIXME: Setting linknames here is a bad hack.
7159	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7160	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7161	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7162	    else
7163	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7164	    fi~
7165	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7166	    linknames='
7167	  # The linker will not automatically build a static lib if we build a DLL.
7168	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7169	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7170	  # Don't use ranlib
7171	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7172	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7173	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7174	    case $lt_outputfile in
7175	      *.exe|*.EXE) ;;
7176	      *)
7177		lt_outputfile="$lt_outputfile.exe"
7178		lt_tool_outputfile="$lt_tool_outputfile.exe"
7179		;;
7180	    esac~
7181	    func_to_tool_file "$lt_outputfile"~
7182	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7183	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7184	      $RM "$lt_outputfile.manifest";
7185	    fi'
7186	  ;;
7187	*)
7188	  # g++
7189	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7190	  # as there is no search path for DLLs.
7191	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7192	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7193	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7194	  _LT_TAGVAR(always_export_symbols, $1)=no
7195	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7196
7197	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7198	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
7199	    # If the export-symbols file already is a .def file (1st line
7200	    # is EXPORTS), use it as is; otherwise, prepend...
7201	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7202	      cp $export_symbols $output_objdir/$soname.def;
7203	    else
7204	      echo EXPORTS > $output_objdir/$soname.def;
7205	      cat $export_symbols >> $output_objdir/$soname.def;
7206	    fi~
7207	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
7208	  else
7209	    _LT_TAGVAR(ld_shlibs, $1)=no
7210	  fi
7211	  ;;
7212	esac
7213	;;
7214      darwin* | rhapsody*)
7215        _LT_DARWIN_LINKER_FEATURES($1)
7216	;;
7217
7218      dgux*)
7219        case $cc_basename in
7220          ec++*)
7221	    # FIXME: insert proper C++ library support
7222	    _LT_TAGVAR(ld_shlibs, $1)=no
7223	    ;;
7224          ghcx*)
7225	    # Green Hills C++ Compiler
7226	    # FIXME: insert proper C++ library support
7227	    _LT_TAGVAR(ld_shlibs, $1)=no
7228	    ;;
7229          *)
7230	    # FIXME: insert proper C++ library support
7231	    _LT_TAGVAR(ld_shlibs, $1)=no
7232	    ;;
7233        esac
7234        ;;
7235
7236      freebsd2.*)
7237        # C++ shared libraries reported to be fairly broken before
7238	# switch to ELF
7239        _LT_TAGVAR(ld_shlibs, $1)=no
7240        ;;
7241
7242      freebsd-elf*)
7243        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7244        ;;
7245
7246      freebsd* | dragonfly*)
7247        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7248        # conventions
7249        _LT_TAGVAR(ld_shlibs, $1)=yes
7250        ;;
7251
7252      gnu*)
7253        ;;
7254
7255      haiku*)
7256        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7257        _LT_TAGVAR(link_all_deplibs, $1)=yes
7258        ;;
7259
7260      hpux9*)
7261        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7262        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7263        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7264        _LT_TAGVAR(hardcode_direct, $1)=yes
7265        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7266				             # but as the default
7267				             # location of the library.
7268
7269        case $cc_basename in
7270          CC*)
7271            # FIXME: insert proper C++ library support
7272            _LT_TAGVAR(ld_shlibs, $1)=no
7273            ;;
7274          aCC*)
7275            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
7276            # Commands to make compiler produce verbose output that lists
7277            # what "hidden" libraries, object files and flags are used when
7278            # linking a shared library.
7279            #
7280            # There doesn't appear to be a way to prevent this compiler from
7281            # explicitly linking system object files so we need to strip them
7282            # from the output so that they don't get included in the library
7283            # dependencies.
7284            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7285            ;;
7286          *)
7287            if test "$GXX" = yes; then
7288              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
7289            else
7290              # FIXME: insert proper C++ library support
7291              _LT_TAGVAR(ld_shlibs, $1)=no
7292            fi
7293            ;;
7294        esac
7295        ;;
7296
7297      hpux10*|hpux11*)
7298        if test $with_gnu_ld = no; then
7299	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7300	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7301
7302          case $host_cpu in
7303            hppa*64*|ia64*)
7304              ;;
7305            *)
7306	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7307              ;;
7308          esac
7309        fi
7310        case $host_cpu in
7311          hppa*64*|ia64*)
7312            _LT_TAGVAR(hardcode_direct, $1)=no
7313            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7314            ;;
7315          *)
7316            _LT_TAGVAR(hardcode_direct, $1)=yes
7317            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7318            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7319					         # but as the default
7320					         # location of the library.
7321            ;;
7322        esac
7323
7324        case $cc_basename in
7325          CC*)
7326	    # FIXME: insert proper C++ library support
7327	    _LT_TAGVAR(ld_shlibs, $1)=no
7328	    ;;
7329          aCC*)
7330	    case $host_cpu in
7331	      hppa*64*)
7332	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7333	        ;;
7334	      ia64*)
7335	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7336	        ;;
7337	      *)
7338	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7339	        ;;
7340	    esac
7341	    # Commands to make compiler produce verbose output that lists
7342	    # what "hidden" libraries, object files and flags are used when
7343	    # linking a shared library.
7344	    #
7345	    # There doesn't appear to be a way to prevent this compiler from
7346	    # explicitly linking system object files so we need to strip them
7347	    # from the output so that they don't get included in the library
7348	    # dependencies.
7349	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7350	    ;;
7351          *)
7352	    if test "$GXX" = yes; then
7353	      if test $with_gnu_ld = no; then
7354	        case $host_cpu in
7355	          hppa*64*)
7356	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7357	            ;;
7358	          ia64*)
7359	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7360	            ;;
7361	          *)
7362	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7363	            ;;
7364	        esac
7365	      fi
7366	    else
7367	      # FIXME: insert proper C++ library support
7368	      _LT_TAGVAR(ld_shlibs, $1)=no
7369	    fi
7370	    ;;
7371        esac
7372        ;;
7373
7374      interix[[3-9]]*)
7375	_LT_TAGVAR(hardcode_direct, $1)=no
7376	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7377	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7378	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7379	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7380	# Instead, shared libraries are loaded at an image base (0x10000000 by
7381	# default) and relocated if they conflict, which is a slow very memory
7382	# consuming and fragmenting process.  To avoid this, we pick a random,
7383	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7384	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7385	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
7386	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
7387	;;
7388      irix5* | irix6*)
7389        case $cc_basename in
7390          CC*)
7391	    # SGI C++
7392	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7393
7394	    # Archives containing C++ object files must be created using
7395	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7396	    # necessary to make sure instantiated templates are included
7397	    # in the archive.
7398	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7399	    ;;
7400          *)
7401	    if test "$GXX" = yes; then
7402	      if test "$with_gnu_ld" = no; then
7403	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7404	      else
7405	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
7406	      fi
7407	    fi
7408	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7409	    ;;
7410        esac
7411        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7412        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7413        _LT_TAGVAR(inherit_rpath, $1)=yes
7414        ;;
7415
7416      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7417        case $cc_basename in
7418          KCC*)
7419	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7420
7421	    # KCC will only create a shared library if the output file
7422	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7423	    # to its proper name (with version) after linking.
7424	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7425	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
7426	    # Commands to make compiler produce verbose output that lists
7427	    # what "hidden" libraries, object files and flags are used when
7428	    # linking a shared library.
7429	    #
7430	    # There doesn't appear to be a way to prevent this compiler from
7431	    # explicitly linking system object files so we need to strip them
7432	    # from the output so that they don't get included in the library
7433	    # dependencies.
7434	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7435
7436	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7437	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7438
7439	    # Archives containing C++ object files must be created using
7440	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7441	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7442	    ;;
7443	  icpc* | ecpc* )
7444	    # Intel C++
7445	    with_gnu_ld=yes
7446	    # version 8.0 and above of icpc choke on multiply defined symbols
7447	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7448	    # earlier do not add the objects themselves.
7449	    case `$CC -V 2>&1` in
7450	      *"Version 7."*)
7451	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7452		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7453		;;
7454	      *)  # Version 8.0 or newer
7455	        tmp_idyn=
7456	        case $host_cpu in
7457		  ia64*) tmp_idyn=' -i_dynamic';;
7458		esac
7459	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7460		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7461		;;
7462	    esac
7463	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7464	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7465	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7466	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7467	    ;;
7468          pgCC* | pgcpp*)
7469            # Portland Group C++ compiler
7470	    case `$CC -V` in
7471	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7472	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7473		rm -rf $tpldir~
7474		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7475		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7476	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7477		rm -rf $tpldir~
7478		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7479		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7480		$RANLIB $oldlib'
7481	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7482		rm -rf $tpldir~
7483		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7484		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7485	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7486		rm -rf $tpldir~
7487		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7488		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
7489	      ;;
7490	    *) # Version 6 and above use weak symbols
7491	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7492	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
7493	      ;;
7494	    esac
7495
7496	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7497	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7498	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
7499            ;;
7500	  cxx*)
7501	    # Compaq C++
7502	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7503	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
7504
7505	    runpath_var=LD_RUN_PATH
7506	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7507	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7508
7509	    # Commands to make compiler produce verbose output that lists
7510	    # what "hidden" libraries, object files and flags are used when
7511	    # linking a shared library.
7512	    #
7513	    # There doesn't appear to be a way to prevent this compiler from
7514	    # explicitly linking system object files so we need to strip them
7515	    # from the output so that they don't get included in the library
7516	    # dependencies.
7517	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
7518	    ;;
7519	  xl* | mpixl* | bgxl*)
7520	    # IBM XL 8.0 on PPC, with GNU ld
7521	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7522	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7523	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7524	    if test "x$supports_anon_versioning" = xyes; then
7525	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7526		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7527		echo "local: *; };" >> $output_objdir/$libname.ver~
7528		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7529	    fi
7530	    ;;
7531	  *)
7532	    case `$CC -V 2>&1 | sed 5q` in
7533	    *Sun\ C*)
7534	      # Sun C++ 5.9
7535	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7536	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7537	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
7538	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7539	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
7540	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7541
7542	      # Not sure whether something based on
7543	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7544	      # would be better.
7545	      output_verbose_link_cmd='func_echo_all'
7546
7547	      # Archives containing C++ object files must be created using
7548	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7549	      # necessary to make sure instantiated templates are included
7550	      # in the archive.
7551	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7552	      ;;
7553	    esac
7554	    ;;
7555	esac
7556	;;
7557
7558      lynxos*)
7559        # FIXME: insert proper C++ library support
7560	_LT_TAGVAR(ld_shlibs, $1)=no
7561	;;
7562
7563      m88k*)
7564        # FIXME: insert proper C++ library support
7565        _LT_TAGVAR(ld_shlibs, $1)=no
7566	;;
7567
7568      mvs*)
7569        case $cc_basename in
7570          cxx*)
7571	    # FIXME: insert proper C++ library support
7572	    _LT_TAGVAR(ld_shlibs, $1)=no
7573	    ;;
7574	  *)
7575	    # FIXME: insert proper C++ library support
7576	    _LT_TAGVAR(ld_shlibs, $1)=no
7577	    ;;
7578	esac
7579	;;
7580
7581      netbsd*)
7582        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7583	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7584	  wlarc=
7585	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7586	  _LT_TAGVAR(hardcode_direct, $1)=yes
7587	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7588	fi
7589	# Workaround some broken pre-1.5 toolchains
7590	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7591	;;
7592
7593      *nto* | *qnx*)
7594        _LT_TAGVAR(ld_shlibs, $1)=yes
7595	;;
7596
7597      openbsd2*)
7598        # C++ shared libraries are fairly broken
7599	_LT_TAGVAR(ld_shlibs, $1)=no
7600	;;
7601
7602      openbsd*)
7603	if test -f /usr/libexec/ld.so; then
7604	  _LT_TAGVAR(hardcode_direct, $1)=yes
7605	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7606	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7607	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7608	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7609	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7610	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
7611	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7612	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7613	  fi
7614	  output_verbose_link_cmd=func_echo_all
7615	else
7616	  _LT_TAGVAR(ld_shlibs, $1)=no
7617	fi
7618	;;
7619
7620      osf3* | osf4* | osf5*)
7621        case $cc_basename in
7622          KCC*)
7623	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7624
7625	    # KCC will only create a shared library if the output file
7626	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7627	    # to its proper name (with version) after linking.
7628	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7629
7630	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7631	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7632
7633	    # Archives containing C++ object files must be created using
7634	    # the KAI C++ compiler.
7635	    case $host in
7636	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7637	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7638	    esac
7639	    ;;
7640          RCC*)
7641	    # Rational C++ 2.4.1
7642	    # FIXME: insert proper C++ library support
7643	    _LT_TAGVAR(ld_shlibs, $1)=no
7644	    ;;
7645          cxx*)
7646	    case $host in
7647	      osf3*)
7648	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7649	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7650	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7651		;;
7652	      *)
7653	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7654	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7655	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7656	          echo "-hidden">> $lib.exp~
7657	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
7658	          $RM $lib.exp'
7659	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7660		;;
7661	    esac
7662
7663	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7664
7665	    # Commands to make compiler produce verbose output that lists
7666	    # what "hidden" libraries, object files and flags are used when
7667	    # linking a shared library.
7668	    #
7669	    # There doesn't appear to be a way to prevent this compiler from
7670	    # explicitly linking system object files so we need to strip them
7671	    # from the output so that they don't get included in the library
7672	    # dependencies.
7673	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7674	    ;;
7675	  *)
7676	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7677	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7678	      case $host in
7679	        osf3*)
7680	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7681		  ;;
7682	        *)
7683	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7684		  ;;
7685	      esac
7686
7687	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7688	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7689
7690	      # Commands to make compiler produce verbose output that lists
7691	      # what "hidden" libraries, object files and flags are used when
7692	      # linking a shared library.
7693	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7694
7695	    else
7696	      # FIXME: insert proper C++ library support
7697	      _LT_TAGVAR(ld_shlibs, $1)=no
7698	    fi
7699	    ;;
7700        esac
7701        ;;
7702
7703      psos*)
7704        # FIXME: insert proper C++ library support
7705        _LT_TAGVAR(ld_shlibs, $1)=no
7706        ;;
7707
7708      sunos4*)
7709        case $cc_basename in
7710          CC*)
7711	    # Sun C++ 4.x
7712	    # FIXME: insert proper C++ library support
7713	    _LT_TAGVAR(ld_shlibs, $1)=no
7714	    ;;
7715          lcc*)
7716	    # Lucid
7717	    # FIXME: insert proper C++ library support
7718	    _LT_TAGVAR(ld_shlibs, $1)=no
7719	    ;;
7720          *)
7721	    # FIXME: insert proper C++ library support
7722	    _LT_TAGVAR(ld_shlibs, $1)=no
7723	    ;;
7724        esac
7725        ;;
7726
7727      solaris*)
7728        case $cc_basename in
7729          CC* | sunCC*)
7730	    # Sun C++ 4.2, 5.x and Centerline C++
7731            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7732	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7733	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7734	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7735	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7736
7737	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7738	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7739	    case $host_os in
7740	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7741	      *)
7742		# The compiler driver will combine and reorder linker options,
7743		# but understands `-z linker_flag'.
7744	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7745		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7746	        ;;
7747	    esac
7748	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7749
7750	    output_verbose_link_cmd='func_echo_all'
7751
7752	    # Archives containing C++ object files must be created using
7753	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7754	    # necessary to make sure instantiated templates are included
7755	    # in the archive.
7756	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7757	    ;;
7758          gcx*)
7759	    # Green Hills C++ Compiler
7760	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7761
7762	    # The C++ compiler must be used to create the archive.
7763	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7764	    ;;
7765          *)
7766	    # GNU C++ compiler with Solaris linker
7767	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7768	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7769	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7770	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7771	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7772		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7773
7774	        # Commands to make compiler produce verbose output that lists
7775	        # what "hidden" libraries, object files and flags are used when
7776	        # linking a shared library.
7777	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7778	      else
7779	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7780	        # platform.
7781	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7782	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7783		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7784
7785	        # Commands to make compiler produce verbose output that lists
7786	        # what "hidden" libraries, object files and flags are used when
7787	        # linking a shared library.
7788	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7789	      fi
7790
7791	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7792	      case $host_os in
7793		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7794		*)
7795		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7796		  ;;
7797	      esac
7798	    fi
7799	    ;;
7800        esac
7801        ;;
7802
7803    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7804      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7805      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7806      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7807      runpath_var='LD_RUN_PATH'
7808
7809      case $cc_basename in
7810        CC*)
7811	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7812	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7813	  ;;
7814	*)
7815	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7816	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7817	  ;;
7818      esac
7819      ;;
7820
7821      sysv5* | sco3.2v5* | sco5v6*)
7822	# Note: We can NOT use -z defs as we might desire, because we do not
7823	# link with -lc, and that would cause any symbols used from libc to
7824	# always be unresolved, which means just about no library would
7825	# ever link correctly.  If we're not using GNU ld we use -z text
7826	# though, which does catch some bad symbols but isn't as heavy-handed
7827	# as -z defs.
7828	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7829	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7830	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7831	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7832	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7833	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7834	_LT_TAGVAR(link_all_deplibs, $1)=yes
7835	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7836	runpath_var='LD_RUN_PATH'
7837
7838	case $cc_basename in
7839          CC*)
7840	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7841	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7842	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7843	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7844	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7845	      '"$_LT_TAGVAR(reload_cmds, $1)"
7846	    ;;
7847	  *)
7848	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7849	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7850	    ;;
7851	esac
7852      ;;
7853
7854      tandem*)
7855        case $cc_basename in
7856          NCC*)
7857	    # NonStop-UX NCC 3.20
7858	    # FIXME: insert proper C++ library support
7859	    _LT_TAGVAR(ld_shlibs, $1)=no
7860	    ;;
7861          *)
7862	    # FIXME: insert proper C++ library support
7863	    _LT_TAGVAR(ld_shlibs, $1)=no
7864	    ;;
7865        esac
7866        ;;
7867
7868      vxworks*)
7869        # FIXME: insert proper C++ library support
7870        _LT_TAGVAR(ld_shlibs, $1)=no
7871        ;;
7872
7873      *)
7874        # FIXME: insert proper C++ library support
7875        _LT_TAGVAR(ld_shlibs, $1)=no
7876        ;;
7877    esac
7878
7879    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7880    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7881
7882    _LT_TAGVAR(GCC, $1)="$GXX"
7883    _LT_TAGVAR(LD, $1)="$LD"
7884
7885    ## CAVEAT EMPTOR:
7886    ## There is no encapsulation within the following macros, do not change
7887    ## the running order or otherwise move them around unless you know exactly
7888    ## what you are doing...
7889    _LT_SYS_HIDDEN_LIBDEPS($1)
7890    _LT_COMPILER_PIC($1)
7891    _LT_COMPILER_C_O($1)
7892    _LT_COMPILER_FILE_LOCKS($1)
7893    _LT_LINKER_SHLIBS($1)
7894    _LT_SYS_DYNAMIC_LINKER($1)
7895    _LT_LINKER_HARDCODE_LIBPATH($1)
7896
7897    _LT_CONFIG($1)
7898  fi # test -n "$compiler"
7899
7900  CC=$lt_save_CC
7901  CFLAGS=$lt_save_CFLAGS
7902  LDCXX=$LD
7903  LD=$lt_save_LD
7904  GCC=$lt_save_GCC
7905  with_gnu_ld=$lt_save_with_gnu_ld
7906  lt_cv_path_LDCXX=$lt_cv_path_LD
7907  lt_cv_path_LD=$lt_save_path_LD
7908  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7909  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7910fi # test "$_lt_caught_CXX_error" != yes
7911
7912AC_LANG_POP
7913])# _LT_LANG_CXX_CONFIG
7914
7915
7916# _LT_FUNC_STRIPNAME_CNF
7917# ----------------------
7918# func_stripname_cnf prefix suffix name
7919# strip PREFIX and SUFFIX off of NAME.
7920# PREFIX and SUFFIX must not contain globbing or regex special
7921# characters, hashes, percent signs, but SUFFIX may contain a leading
7922# dot (in which case that matches only a dot).
7923#
7924# This function is identical to the (non-XSI) version of func_stripname,
7925# except this one can be used by m4 code that may be executed by configure,
7926# rather than the libtool script.
7927m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7928AC_REQUIRE([_LT_DECL_SED])
7929AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7930func_stripname_cnf ()
7931{
7932  case ${2} in
7933  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7934  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7935  esac
7936} # func_stripname_cnf
7937])# _LT_FUNC_STRIPNAME_CNF
7938
7939# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7940# ---------------------------------
7941# Figure out "hidden" library dependencies from verbose
7942# compiler output when linking a shared library.
7943# Parse the compiler output and extract the necessary
7944# objects, libraries and library flags.
7945m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7946[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7947AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7948# Dependencies to place before and after the object being linked:
7949_LT_TAGVAR(predep_objects, $1)=
7950_LT_TAGVAR(postdep_objects, $1)=
7951_LT_TAGVAR(predeps, $1)=
7952_LT_TAGVAR(postdeps, $1)=
7953_LT_TAGVAR(compiler_lib_search_path, $1)=
7954
7955dnl we can't use the lt_simple_compile_test_code here,
7956dnl because it contains code intended for an executable,
7957dnl not a library.  It's possible we should let each
7958dnl tag define a new lt_????_link_test_code variable,
7959dnl but it's only used here...
7960m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7961int a;
7962void foo (void) { a = 0; }
7963_LT_EOF
7964], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7965class Foo
7966{
7967public:
7968  Foo (void) { a = 0; }
7969private:
7970  int a;
7971};
7972_LT_EOF
7973], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7974      subroutine foo
7975      implicit none
7976      integer*4 a
7977      a=0
7978      return
7979      end
7980_LT_EOF
7981], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7982      subroutine foo
7983      implicit none
7984      integer a
7985      a=0
7986      return
7987      end
7988_LT_EOF
7989], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7990public class foo {
7991  private int a;
7992  public void bar (void) {
7993    a = 0;
7994  }
7995};
7996_LT_EOF
7997], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7998package foo
7999func foo() {
8000}
8001_LT_EOF
8002])
8003
8004_lt_libdeps_save_CFLAGS=$CFLAGS
8005case "$CC $CFLAGS " in #(
8006*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8007*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8008*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8009esac
8010
8011dnl Parse the compiler output and extract the necessary
8012dnl objects, libraries and library flags.
8013if AC_TRY_EVAL(ac_compile); then
8014  # Parse the compiler output and extract the necessary
8015  # objects, libraries and library flags.
8016
8017  # Sentinel used to keep track of whether or not we are before
8018  # the conftest object file.
8019  pre_test_object_deps_done=no
8020
8021  for p in `eval "$output_verbose_link_cmd"`; do
8022    case ${prev}${p} in
8023
8024    -L* | -R* | -l*)
8025       # Some compilers place space between "-{L,R}" and the path.
8026       # Remove the space.
8027       if test $p = "-L" ||
8028          test $p = "-R"; then
8029	 prev=$p
8030	 continue
8031       fi
8032
8033       # Expand the sysroot to ease extracting the directories later.
8034       if test -z "$prev"; then
8035         case $p in
8036         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8037         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8038         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8039         esac
8040       fi
8041       case $p in
8042       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8043       esac
8044       if test "$pre_test_object_deps_done" = no; then
8045	 case ${prev} in
8046	 -L | -R)
8047	   # Internal compiler library paths should come after those
8048	   # provided the user.  The postdeps already come after the
8049	   # user supplied libs so there is no need to process them.
8050	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8051	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8052	   else
8053	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8054	   fi
8055	   ;;
8056	 # The "-l" case would never come before the object being
8057	 # linked, so don't bother handling this case.
8058	 esac
8059       else
8060	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8061	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8062	 else
8063	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8064	 fi
8065       fi
8066       prev=
8067       ;;
8068
8069    *.lto.$objext) ;; # Ignore GCC LTO objects
8070    *.$objext)
8071       # This assumes that the test object file only shows up
8072       # once in the compiler output.
8073       if test "$p" = "conftest.$objext"; then
8074	 pre_test_object_deps_done=yes
8075	 continue
8076       fi
8077
8078       if test "$pre_test_object_deps_done" = no; then
8079	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8080	   _LT_TAGVAR(predep_objects, $1)="$p"
8081	 else
8082	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8083	 fi
8084       else
8085	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8086	   _LT_TAGVAR(postdep_objects, $1)="$p"
8087	 else
8088	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8089	 fi
8090       fi
8091       ;;
8092
8093    *) ;; # Ignore the rest.
8094
8095    esac
8096  done
8097
8098  # Clean up.
8099  rm -f a.out a.exe
8100else
8101  echo "libtool.m4: error: problem compiling $1 test program"
8102fi
8103
8104$RM -f confest.$objext
8105CFLAGS=$_lt_libdeps_save_CFLAGS
8106
8107# PORTME: override above test on systems where it is broken
8108m4_if([$1], [CXX],
8109[case $host_os in
8110interix[[3-9]]*)
8111  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8112  # hack all around it, let's just trust "g++" to DTRT.
8113  _LT_TAGVAR(predep_objects,$1)=
8114  _LT_TAGVAR(postdep_objects,$1)=
8115  _LT_TAGVAR(postdeps,$1)=
8116  ;;
8117
8118linux*)
8119  case `$CC -V 2>&1 | sed 5q` in
8120  *Sun\ C*)
8121    # Sun C++ 5.9
8122
8123    # The more standards-conforming stlport4 library is
8124    # incompatible with the Cstd library. Avoid specifying
8125    # it if it's in CXXFLAGS. Ignore libCrun as
8126    # -library=stlport4 depends on it.
8127    case " $CXX $CXXFLAGS " in
8128    *" -library=stlport4 "*)
8129      solaris_use_stlport4=yes
8130      ;;
8131    esac
8132
8133    if test "$solaris_use_stlport4" != yes; then
8134      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8135    fi
8136    ;;
8137  esac
8138  ;;
8139
8140solaris*)
8141  case $cc_basename in
8142  CC* | sunCC*)
8143    # The more standards-conforming stlport4 library is
8144    # incompatible with the Cstd library. Avoid specifying
8145    # it if it's in CXXFLAGS. Ignore libCrun as
8146    # -library=stlport4 depends on it.
8147    case " $CXX $CXXFLAGS " in
8148    *" -library=stlport4 "*)
8149      solaris_use_stlport4=yes
8150      ;;
8151    esac
8152
8153    # Adding this requires a known-good setup of shared libraries for
8154    # Sun compiler versions before 5.6, else PIC objects from an old
8155    # archive will be linked into the output, leading to subtle bugs.
8156    if test "$solaris_use_stlport4" != yes; then
8157      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8158    fi
8159    ;;
8160  esac
8161  ;;
8162esac
8163])
8164
8165case " $_LT_TAGVAR(postdeps, $1) " in
8166*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8167esac
8168 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8169if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8170 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8171fi
8172_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8173    [The directories searched by this compiler when creating a shared library])
8174_LT_TAGDECL([], [predep_objects], [1],
8175    [Dependencies to place before and after the objects being linked to
8176    create a shared library])
8177_LT_TAGDECL([], [postdep_objects], [1])
8178_LT_TAGDECL([], [predeps], [1])
8179_LT_TAGDECL([], [postdeps], [1])
8180_LT_TAGDECL([], [compiler_lib_search_path], [1],
8181    [The library search path used internally by the compiler when linking
8182    a shared library])
8183])# _LT_SYS_HIDDEN_LIBDEPS
8184
8185
8186# _LT_LANG_F77_CONFIG([TAG])
8187# --------------------------
8188# Ensure that the configuration variables for a Fortran 77 compiler are
8189# suitably defined.  These variables are subsequently used by _LT_CONFIG
8190# to write the compiler configuration to `libtool'.
8191m4_defun([_LT_LANG_F77_CONFIG],
8192[AC_LANG_PUSH(Fortran 77)
8193if test -z "$F77" || test "X$F77" = "Xno"; then
8194  _lt_disable_F77=yes
8195fi
8196
8197_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8198_LT_TAGVAR(allow_undefined_flag, $1)=
8199_LT_TAGVAR(always_export_symbols, $1)=no
8200_LT_TAGVAR(archive_expsym_cmds, $1)=
8201_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8202_LT_TAGVAR(hardcode_direct, $1)=no
8203_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8204_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8205_LT_TAGVAR(hardcode_libdir_separator, $1)=
8206_LT_TAGVAR(hardcode_minus_L, $1)=no
8207_LT_TAGVAR(hardcode_automatic, $1)=no
8208_LT_TAGVAR(inherit_rpath, $1)=no
8209_LT_TAGVAR(module_cmds, $1)=
8210_LT_TAGVAR(module_expsym_cmds, $1)=
8211_LT_TAGVAR(link_all_deplibs, $1)=unknown
8212_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8213_LT_TAGVAR(reload_flag, $1)=$reload_flag
8214_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8215_LT_TAGVAR(no_undefined_flag, $1)=
8216_LT_TAGVAR(whole_archive_flag_spec, $1)=
8217_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8218
8219# Source file extension for f77 test sources.
8220ac_ext=f
8221
8222# Object file extension for compiled f77 test sources.
8223objext=o
8224_LT_TAGVAR(objext, $1)=$objext
8225
8226# No sense in running all these tests if we already determined that
8227# the F77 compiler isn't working.  Some variables (like enable_shared)
8228# are currently assumed to apply to all compilers on this platform,
8229# and will be corrupted by setting them based on a non-working compiler.
8230if test "$_lt_disable_F77" != yes; then
8231  # Code to be used in simple compile tests
8232  lt_simple_compile_test_code="\
8233      subroutine t
8234      return
8235      end
8236"
8237
8238  # Code to be used in simple link tests
8239  lt_simple_link_test_code="\
8240      program t
8241      end
8242"
8243
8244  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8245  _LT_TAG_COMPILER
8246
8247  # save warnings/boilerplate of simple test code
8248  _LT_COMPILER_BOILERPLATE
8249  _LT_LINKER_BOILERPLATE
8250
8251  # Allow CC to be a program name with arguments.
8252  lt_save_CC="$CC"
8253  lt_save_GCC=$GCC
8254  lt_save_CFLAGS=$CFLAGS
8255  CC=${F77-"f77"}
8256  CFLAGS=$FFLAGS
8257  compiler=$CC
8258  _LT_TAGVAR(compiler, $1)=$CC
8259  _LT_CC_BASENAME([$compiler])
8260  GCC=$G77
8261  if test -n "$compiler"; then
8262    AC_MSG_CHECKING([if libtool supports shared libraries])
8263    AC_MSG_RESULT([$can_build_shared])
8264
8265    AC_MSG_CHECKING([whether to build shared libraries])
8266    test "$can_build_shared" = "no" && enable_shared=no
8267
8268    # On AIX, shared libraries and static libraries use the same namespace, and
8269    # are all built from PIC.
8270    case $host_os in
8271      aix3*)
8272        test "$enable_shared" = yes && enable_static=no
8273        if test -n "$RANLIB"; then
8274          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8275          postinstall_cmds='$RANLIB $lib'
8276        fi
8277        ;;
8278      aix[[4-9]]*)
8279	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8280	  test "$enable_shared" = yes && enable_static=no
8281	fi
8282        ;;
8283    esac
8284    AC_MSG_RESULT([$enable_shared])
8285
8286    AC_MSG_CHECKING([whether to build static libraries])
8287    # Make sure either enable_shared or enable_static is yes.
8288    test "$enable_shared" = yes || enable_static=yes
8289    AC_MSG_RESULT([$enable_static])
8290
8291    _LT_TAGVAR(GCC, $1)="$G77"
8292    _LT_TAGVAR(LD, $1)="$LD"
8293
8294    ## CAVEAT EMPTOR:
8295    ## There is no encapsulation within the following macros, do not change
8296    ## the running order or otherwise move them around unless you know exactly
8297    ## what you are doing...
8298    _LT_COMPILER_PIC($1)
8299    _LT_COMPILER_C_O($1)
8300    _LT_COMPILER_FILE_LOCKS($1)
8301    _LT_LINKER_SHLIBS($1)
8302    _LT_SYS_DYNAMIC_LINKER($1)
8303    _LT_LINKER_HARDCODE_LIBPATH($1)
8304
8305    _LT_CONFIG($1)
8306  fi # test -n "$compiler"
8307
8308  GCC=$lt_save_GCC
8309  CC="$lt_save_CC"
8310  CFLAGS="$lt_save_CFLAGS"
8311fi # test "$_lt_disable_F77" != yes
8312
8313AC_LANG_POP
8314])# _LT_LANG_F77_CONFIG
8315
8316
8317# _LT_LANG_FC_CONFIG([TAG])
8318# -------------------------
8319# Ensure that the configuration variables for a Fortran compiler are
8320# suitably defined.  These variables are subsequently used by _LT_CONFIG
8321# to write the compiler configuration to `libtool'.
8322m4_defun([_LT_LANG_FC_CONFIG],
8323[AC_LANG_PUSH(Fortran)
8324
8325if test -z "$FC" || test "X$FC" = "Xno"; then
8326  _lt_disable_FC=yes
8327fi
8328
8329_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8330_LT_TAGVAR(allow_undefined_flag, $1)=
8331_LT_TAGVAR(always_export_symbols, $1)=no
8332_LT_TAGVAR(archive_expsym_cmds, $1)=
8333_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8334_LT_TAGVAR(hardcode_direct, $1)=no
8335_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8336_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8337_LT_TAGVAR(hardcode_libdir_separator, $1)=
8338_LT_TAGVAR(hardcode_minus_L, $1)=no
8339_LT_TAGVAR(hardcode_automatic, $1)=no
8340_LT_TAGVAR(inherit_rpath, $1)=no
8341_LT_TAGVAR(module_cmds, $1)=
8342_LT_TAGVAR(module_expsym_cmds, $1)=
8343_LT_TAGVAR(link_all_deplibs, $1)=unknown
8344_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8345_LT_TAGVAR(reload_flag, $1)=$reload_flag
8346_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8347_LT_TAGVAR(no_undefined_flag, $1)=
8348_LT_TAGVAR(whole_archive_flag_spec, $1)=
8349_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8350
8351# Source file extension for fc test sources.
8352ac_ext=${ac_fc_srcext-f}
8353
8354# Object file extension for compiled fc test sources.
8355objext=o
8356_LT_TAGVAR(objext, $1)=$objext
8357
8358# No sense in running all these tests if we already determined that
8359# the FC compiler isn't working.  Some variables (like enable_shared)
8360# are currently assumed to apply to all compilers on this platform,
8361# and will be corrupted by setting them based on a non-working compiler.
8362if test "$_lt_disable_FC" != yes; then
8363  # Code to be used in simple compile tests
8364  lt_simple_compile_test_code="\
8365      subroutine t
8366      return
8367      end
8368"
8369
8370  # Code to be used in simple link tests
8371  lt_simple_link_test_code="\
8372      program t
8373      end
8374"
8375
8376  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8377  _LT_TAG_COMPILER
8378
8379  # save warnings/boilerplate of simple test code
8380  _LT_COMPILER_BOILERPLATE
8381  _LT_LINKER_BOILERPLATE
8382
8383  # Allow CC to be a program name with arguments.
8384  lt_save_CC="$CC"
8385  lt_save_GCC=$GCC
8386  lt_save_CFLAGS=$CFLAGS
8387  CC=${FC-"f95"}
8388  CFLAGS=$FCFLAGS
8389  compiler=$CC
8390  GCC=$ac_cv_fc_compiler_gnu
8391
8392  _LT_TAGVAR(compiler, $1)=$CC
8393  _LT_CC_BASENAME([$compiler])
8394
8395  if test -n "$compiler"; then
8396    AC_MSG_CHECKING([if libtool supports shared libraries])
8397    AC_MSG_RESULT([$can_build_shared])
8398
8399    AC_MSG_CHECKING([whether to build shared libraries])
8400    test "$can_build_shared" = "no" && enable_shared=no
8401
8402    # On AIX, shared libraries and static libraries use the same namespace, and
8403    # are all built from PIC.
8404    case $host_os in
8405      aix3*)
8406        test "$enable_shared" = yes && enable_static=no
8407        if test -n "$RANLIB"; then
8408          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8409          postinstall_cmds='$RANLIB $lib'
8410        fi
8411        ;;
8412      aix[[4-9]]*)
8413	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8414	  test "$enable_shared" = yes && enable_static=no
8415	fi
8416        ;;
8417    esac
8418    AC_MSG_RESULT([$enable_shared])
8419
8420    AC_MSG_CHECKING([whether to build static libraries])
8421    # Make sure either enable_shared or enable_static is yes.
8422    test "$enable_shared" = yes || enable_static=yes
8423    AC_MSG_RESULT([$enable_static])
8424
8425    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8426    _LT_TAGVAR(LD, $1)="$LD"
8427
8428    ## CAVEAT EMPTOR:
8429    ## There is no encapsulation within the following macros, do not change
8430    ## the running order or otherwise move them around unless you know exactly
8431    ## what you are doing...
8432    _LT_SYS_HIDDEN_LIBDEPS($1)
8433    _LT_COMPILER_PIC($1)
8434    _LT_COMPILER_C_O($1)
8435    _LT_COMPILER_FILE_LOCKS($1)
8436    _LT_LINKER_SHLIBS($1)
8437    _LT_SYS_DYNAMIC_LINKER($1)
8438    _LT_LINKER_HARDCODE_LIBPATH($1)
8439
8440    _LT_CONFIG($1)
8441  fi # test -n "$compiler"
8442
8443  GCC=$lt_save_GCC
8444  CC=$lt_save_CC
8445  CFLAGS=$lt_save_CFLAGS
8446fi # test "$_lt_disable_FC" != yes
8447
8448AC_LANG_POP
8449])# _LT_LANG_FC_CONFIG
8450
8451
8452# _LT_LANG_GCJ_CONFIG([TAG])
8453# --------------------------
8454# Ensure that the configuration variables for the GNU Java Compiler compiler
8455# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8456# to write the compiler configuration to `libtool'.
8457m4_defun([_LT_LANG_GCJ_CONFIG],
8458[AC_REQUIRE([LT_PROG_GCJ])dnl
8459AC_LANG_SAVE
8460
8461# Source file extension for Java test sources.
8462ac_ext=java
8463
8464# Object file extension for compiled Java test sources.
8465objext=o
8466_LT_TAGVAR(objext, $1)=$objext
8467
8468# Code to be used in simple compile tests
8469lt_simple_compile_test_code="class foo {}"
8470
8471# Code to be used in simple link tests
8472lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8473
8474# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8475_LT_TAG_COMPILER
8476
8477# save warnings/boilerplate of simple test code
8478_LT_COMPILER_BOILERPLATE
8479_LT_LINKER_BOILERPLATE
8480
8481# Allow CC to be a program name with arguments.
8482lt_save_CC=$CC
8483lt_save_CFLAGS=$CFLAGS
8484lt_save_GCC=$GCC
8485GCC=yes
8486CC=${GCJ-"gcj"}
8487CFLAGS=$GCJFLAGS
8488compiler=$CC
8489_LT_TAGVAR(compiler, $1)=$CC
8490_LT_TAGVAR(LD, $1)="$LD"
8491_LT_CC_BASENAME([$compiler])
8492
8493# GCJ did not exist at the time GCC didn't implicitly link libc in.
8494_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8495
8496_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8497_LT_TAGVAR(reload_flag, $1)=$reload_flag
8498_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8499
8500if test -n "$compiler"; then
8501  _LT_COMPILER_NO_RTTI($1)
8502  _LT_COMPILER_PIC($1)
8503  _LT_COMPILER_C_O($1)
8504  _LT_COMPILER_FILE_LOCKS($1)
8505  _LT_LINKER_SHLIBS($1)
8506  _LT_LINKER_HARDCODE_LIBPATH($1)
8507
8508  _LT_CONFIG($1)
8509fi
8510
8511AC_LANG_RESTORE
8512
8513GCC=$lt_save_GCC
8514CC=$lt_save_CC
8515CFLAGS=$lt_save_CFLAGS
8516])# _LT_LANG_GCJ_CONFIG
8517
8518
8519# _LT_LANG_GO_CONFIG([TAG])
8520# --------------------------
8521# Ensure that the configuration variables for the GNU Go compiler
8522# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8523# to write the compiler configuration to `libtool'.
8524m4_defun([_LT_LANG_GO_CONFIG],
8525[AC_REQUIRE([LT_PROG_GO])dnl
8526AC_LANG_SAVE
8527
8528# Source file extension for Go test sources.
8529ac_ext=go
8530
8531# Object file extension for compiled Go test sources.
8532objext=o
8533_LT_TAGVAR(objext, $1)=$objext
8534
8535# Code to be used in simple compile tests
8536lt_simple_compile_test_code="package main; func main() { }"
8537
8538# Code to be used in simple link tests
8539lt_simple_link_test_code='package main; func main() { }'
8540
8541# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8542_LT_TAG_COMPILER
8543
8544# save warnings/boilerplate of simple test code
8545_LT_COMPILER_BOILERPLATE
8546_LT_LINKER_BOILERPLATE
8547
8548# Allow CC to be a program name with arguments.
8549lt_save_CC=$CC
8550lt_save_CFLAGS=$CFLAGS
8551lt_save_GCC=$GCC
8552GCC=yes
8553CC=${GOC-"gccgo"}
8554CFLAGS=$GOFLAGS
8555compiler=$CC
8556_LT_TAGVAR(compiler, $1)=$CC
8557_LT_TAGVAR(LD, $1)="$LD"
8558_LT_CC_BASENAME([$compiler])
8559
8560# Go did not exist at the time GCC didn't implicitly link libc in.
8561_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8562
8563_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8564_LT_TAGVAR(reload_flag, $1)=$reload_flag
8565_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8566
8567if test -n "$compiler"; then
8568  _LT_COMPILER_NO_RTTI($1)
8569  _LT_COMPILER_PIC($1)
8570  _LT_COMPILER_C_O($1)
8571  _LT_COMPILER_FILE_LOCKS($1)
8572  _LT_LINKER_SHLIBS($1)
8573  _LT_LINKER_HARDCODE_LIBPATH($1)
8574
8575  _LT_CONFIG($1)
8576fi
8577
8578AC_LANG_RESTORE
8579
8580GCC=$lt_save_GCC
8581CC=$lt_save_CC
8582CFLAGS=$lt_save_CFLAGS
8583])# _LT_LANG_GO_CONFIG
8584
8585
8586# _LT_LANG_RC_CONFIG([TAG])
8587# -------------------------
8588# Ensure that the configuration variables for the Windows resource compiler
8589# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8590# to write the compiler configuration to `libtool'.
8591m4_defun([_LT_LANG_RC_CONFIG],
8592[AC_REQUIRE([LT_PROG_RC])dnl
8593AC_LANG_SAVE
8594
8595# Source file extension for RC test sources.
8596ac_ext=rc
8597
8598# Object file extension for compiled RC test sources.
8599objext=o
8600_LT_TAGVAR(objext, $1)=$objext
8601
8602# Code to be used in simple compile tests
8603lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8604
8605# Code to be used in simple link tests
8606lt_simple_link_test_code="$lt_simple_compile_test_code"
8607
8608# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8609_LT_TAG_COMPILER
8610
8611# save warnings/boilerplate of simple test code
8612_LT_COMPILER_BOILERPLATE
8613_LT_LINKER_BOILERPLATE
8614
8615# Allow CC to be a program name with arguments.
8616lt_save_CC="$CC"
8617lt_save_CFLAGS=$CFLAGS
8618lt_save_GCC=$GCC
8619GCC=
8620CC=${RC-"windres"}
8621CFLAGS=
8622compiler=$CC
8623_LT_TAGVAR(compiler, $1)=$CC
8624_LT_CC_BASENAME([$compiler])
8625_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8626
8627if test -n "$compiler"; then
8628  :
8629  _LT_CONFIG($1)
8630fi
8631
8632GCC=$lt_save_GCC
8633AC_LANG_RESTORE
8634CC=$lt_save_CC
8635CFLAGS=$lt_save_CFLAGS
8636])# _LT_LANG_RC_CONFIG
8637
8638
8639# LT_PROG_GCJ
8640# -----------
8641AC_DEFUN([LT_PROG_GCJ],
8642[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8643  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8644    [AC_CHECK_TOOL(GCJ, gcj,)
8645      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8646      AC_SUBST(GCJFLAGS)])])[]dnl
8647])
8648
8649# Old name:
8650AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8651dnl aclocal-1.4 backwards compatibility:
8652dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8653
8654
8655# LT_PROG_GO
8656# ----------
8657AC_DEFUN([LT_PROG_GO],
8658[AC_CHECK_TOOL(GOC, gccgo,)
8659])
8660
8661
8662# LT_PROG_RC
8663# ----------
8664AC_DEFUN([LT_PROG_RC],
8665[AC_CHECK_TOOL(RC, windres,)
8666])
8667
8668# Old name:
8669AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8670dnl aclocal-1.4 backwards compatibility:
8671dnl AC_DEFUN([LT_AC_PROG_RC], [])
8672
8673
8674# _LT_DECL_EGREP
8675# --------------
8676# If we don't have a new enough Autoconf to choose the best grep
8677# available, choose the one first in the user's PATH.
8678m4_defun([_LT_DECL_EGREP],
8679[AC_REQUIRE([AC_PROG_EGREP])dnl
8680AC_REQUIRE([AC_PROG_FGREP])dnl
8681test -z "$GREP" && GREP=grep
8682_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8683_LT_DECL([], [EGREP], [1], [An ERE matcher])
8684_LT_DECL([], [FGREP], [1], [A literal string matcher])
8685dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8686AC_SUBST([GREP])
8687])
8688
8689
8690# _LT_DECL_OBJDUMP
8691# --------------
8692# If we don't have a new enough Autoconf to choose the best objdump
8693# available, choose the one first in the user's PATH.
8694m4_defun([_LT_DECL_OBJDUMP],
8695[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8696test -z "$OBJDUMP" && OBJDUMP=objdump
8697_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8698AC_SUBST([OBJDUMP])
8699])
8700
8701# _LT_DECL_DLLTOOL
8702# ----------------
8703# Ensure DLLTOOL variable is set.
8704m4_defun([_LT_DECL_DLLTOOL],
8705[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8706test -z "$DLLTOOL" && DLLTOOL=dlltool
8707_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8708AC_SUBST([DLLTOOL])
8709])
8710
8711# _LT_DECL_SED
8712# ------------
8713# Check for a fully-functional sed program, that truncates
8714# as few characters as possible.  Prefer GNU sed if found.
8715m4_defun([_LT_DECL_SED],
8716[AC_PROG_SED
8717test -z "$SED" && SED=sed
8718Xsed="$SED -e 1s/^X//"
8719_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8720_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8721    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8722])# _LT_DECL_SED
8723
8724m4_ifndef([AC_PROG_SED], [
8725# NOTE: This macro has been submitted for inclusion into   #
8726#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8727#  a released version of Autoconf we should remove this    #
8728#  macro and use it instead.                               #
8729
8730m4_defun([AC_PROG_SED],
8731[AC_MSG_CHECKING([for a sed that does not truncate output])
8732AC_CACHE_VAL(lt_cv_path_SED,
8733[# Loop through the user's path and test for sed and gsed.
8734# Then use that list of sed's as ones to test for truncation.
8735as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8736for as_dir in $PATH
8737do
8738  IFS=$as_save_IFS
8739  test -z "$as_dir" && as_dir=.
8740  for lt_ac_prog in sed gsed; do
8741    for ac_exec_ext in '' $ac_executable_extensions; do
8742      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8743        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8744      fi
8745    done
8746  done
8747done
8748IFS=$as_save_IFS
8749lt_ac_max=0
8750lt_ac_count=0
8751# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8752# along with /bin/sed that truncates output.
8753for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8754  test ! -f $lt_ac_sed && continue
8755  cat /dev/null > conftest.in
8756  lt_ac_count=0
8757  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8758  # Check for GNU sed and select it if it is found.
8759  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8760    lt_cv_path_SED=$lt_ac_sed
8761    break
8762  fi
8763  while true; do
8764    cat conftest.in conftest.in >conftest.tmp
8765    mv conftest.tmp conftest.in
8766    cp conftest.in conftest.nl
8767    echo >>conftest.nl
8768    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8769    cmp -s conftest.out conftest.nl || break
8770    # 10000 chars as input seems more than enough
8771    test $lt_ac_count -gt 10 && break
8772    lt_ac_count=`expr $lt_ac_count + 1`
8773    if test $lt_ac_count -gt $lt_ac_max; then
8774      lt_ac_max=$lt_ac_count
8775      lt_cv_path_SED=$lt_ac_sed
8776    fi
8777  done
8778done
8779])
8780SED=$lt_cv_path_SED
8781AC_SUBST([SED])
8782AC_MSG_RESULT([$SED])
8783])#AC_PROG_SED
8784])#m4_ifndef
8785
8786# Old name:
8787AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8788dnl aclocal-1.4 backwards compatibility:
8789dnl AC_DEFUN([LT_AC_PROG_SED], [])
8790
8791
8792# _LT_CHECK_SHELL_FEATURES
8793# ------------------------
8794# Find out whether the shell is Bourne or XSI compatible,
8795# or has some other useful features.
8796m4_defun([_LT_CHECK_SHELL_FEATURES],
8797[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8798# Try some XSI features
8799xsi_shell=no
8800( _lt_dummy="a/b/c"
8801  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8802      = c,a/b,b/c, \
8803    && eval 'test $(( 1 + 1 )) -eq 2 \
8804    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8805  && xsi_shell=yes
8806AC_MSG_RESULT([$xsi_shell])
8807_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8808
8809AC_MSG_CHECKING([whether the shell understands "+="])
8810lt_shell_append=no
8811( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8812    >/dev/null 2>&1 \
8813  && lt_shell_append=yes
8814AC_MSG_RESULT([$lt_shell_append])
8815_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8816
8817if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8818  lt_unset=unset
8819else
8820  lt_unset=false
8821fi
8822_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8823
8824# test EBCDIC or ASCII
8825case `echo X|tr X '\101'` in
8826 A) # ASCII based system
8827    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8828  lt_SP2NL='tr \040 \012'
8829  lt_NL2SP='tr \015\012 \040\040'
8830  ;;
8831 *) # EBCDIC based system
8832  lt_SP2NL='tr \100 \n'
8833  lt_NL2SP='tr \r\n \100\100'
8834  ;;
8835esac
8836_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8837_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8838])# _LT_CHECK_SHELL_FEATURES
8839
8840
8841# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8842# ------------------------------------------------------
8843# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8844# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8845m4_defun([_LT_PROG_FUNCTION_REPLACE],
8846[dnl {
8847sed -e '/^$1 ()$/,/^} # $1 /c\
8848$1 ()\
8849{\
8850m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8851} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8852  && mv -f "$cfgfile.tmp" "$cfgfile" \
8853    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8854test 0 -eq $? || _lt_function_replace_fail=:
8855])
8856
8857
8858# _LT_PROG_REPLACE_SHELLFNS
8859# -------------------------
8860# Replace existing portable implementations of several shell functions with
8861# equivalent extended shell implementations where those features are available..
8862m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8863[if test x"$xsi_shell" = xyes; then
8864  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8865    case ${1} in
8866      */*) func_dirname_result="${1%/*}${2}" ;;
8867      *  ) func_dirname_result="${3}" ;;
8868    esac])
8869
8870  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8871    func_basename_result="${1##*/}"])
8872
8873  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8874    case ${1} in
8875      */*) func_dirname_result="${1%/*}${2}" ;;
8876      *  ) func_dirname_result="${3}" ;;
8877    esac
8878    func_basename_result="${1##*/}"])
8879
8880  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8881    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8882    # positional parameters, so assign one to ordinary parameter first.
8883    func_stripname_result=${3}
8884    func_stripname_result=${func_stripname_result#"${1}"}
8885    func_stripname_result=${func_stripname_result%"${2}"}])
8886
8887  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8888    func_split_long_opt_name=${1%%=*}
8889    func_split_long_opt_arg=${1#*=}])
8890
8891  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8892    func_split_short_opt_arg=${1#??}
8893    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8894
8895  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8896    case ${1} in
8897      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8898      *)    func_lo2o_result=${1} ;;
8899    esac])
8900
8901  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8902
8903  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8904
8905  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8906fi
8907
8908if test x"$lt_shell_append" = xyes; then
8909  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8910
8911  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8912    func_quote_for_eval "${2}"
8913dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8914    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8915
8916  # Save a `func_append' function call where possible by direct use of '+='
8917  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8918    && mv -f "$cfgfile.tmp" "$cfgfile" \
8919      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8920  test 0 -eq $? || _lt_function_replace_fail=:
8921else
8922  # Save a `func_append' function call even when '+=' is not available
8923  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8924    && mv -f "$cfgfile.tmp" "$cfgfile" \
8925      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8926  test 0 -eq $? || _lt_function_replace_fail=:
8927fi
8928
8929if test x"$_lt_function_replace_fail" = x":"; then
8930  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8931fi
8932])
8933
8934# _LT_PATH_CONVERSION_FUNCTIONS
8935# -----------------------------
8936# Determine which file name conversion functions should be used by
8937# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8938# for certain cross-compile configurations and native mingw.
8939m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8940[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8941AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8942AC_MSG_CHECKING([how to convert $build file names to $host format])
8943AC_CACHE_VAL(lt_cv_to_host_file_cmd,
8944[case $host in
8945  *-*-mingw* )
8946    case $build in
8947      *-*-mingw* ) # actually msys
8948        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8949        ;;
8950      *-*-cygwin* )
8951        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8952        ;;
8953      * ) # otherwise, assume *nix
8954        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8955        ;;
8956    esac
8957    ;;
8958  *-*-cygwin* )
8959    case $build in
8960      *-*-mingw* ) # actually msys
8961        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8962        ;;
8963      *-*-cygwin* )
8964        lt_cv_to_host_file_cmd=func_convert_file_noop
8965        ;;
8966      * ) # otherwise, assume *nix
8967        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8968        ;;
8969    esac
8970    ;;
8971  * ) # unhandled hosts (and "normal" native builds)
8972    lt_cv_to_host_file_cmd=func_convert_file_noop
8973    ;;
8974esac
8975])
8976to_host_file_cmd=$lt_cv_to_host_file_cmd
8977AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8978_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8979         [0], [convert $build file names to $host format])dnl
8980
8981AC_MSG_CHECKING([how to convert $build file names to toolchain format])
8982AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8983[#assume ordinary cross tools, or native build.
8984lt_cv_to_tool_file_cmd=func_convert_file_noop
8985case $host in
8986  *-*-mingw* )
8987    case $build in
8988      *-*-mingw* ) # actually msys
8989        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8990        ;;
8991    esac
8992    ;;
8993esac
8994])
8995to_tool_file_cmd=$lt_cv_to_tool_file_cmd
8996AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8997_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8998         [0], [convert $build files to toolchain format])dnl
8999])# _LT_PATH_CONVERSION_FUNCTIONS
9000
9001# Helper functions for option handling.                    -*- Autoconf -*-
9002#
9003#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9004#   Inc.
9005#   Written by Gary V. Vaughan, 2004
9006#
9007# This file is free software; the Free Software Foundation gives
9008# unlimited permission to copy and/or distribute it, with or without
9009# modifications, as long as this notice is preserved.
9010
9011# serial 7 ltoptions.m4
9012
9013# This is to help aclocal find these macros, as it can't see m4_define.
9014AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9015
9016
9017# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9018# ------------------------------------------
9019m4_define([_LT_MANGLE_OPTION],
9020[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9021
9022
9023# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9024# ---------------------------------------
9025# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9026# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9027# saved as a flag.
9028m4_define([_LT_SET_OPTION],
9029[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9030m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9031        _LT_MANGLE_DEFUN([$1], [$2]),
9032    [m4_warning([Unknown $1 option `$2'])])[]dnl
9033])
9034
9035
9036# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9037# ------------------------------------------------------------
9038# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9039m4_define([_LT_IF_OPTION],
9040[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9041
9042
9043# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9044# -------------------------------------------------------
9045# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9046# are set.
9047m4_define([_LT_UNLESS_OPTIONS],
9048[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9049	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9050		      [m4_define([$0_found])])])[]dnl
9051m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9052])[]dnl
9053])
9054
9055
9056# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9057# ----------------------------------------
9058# OPTION-LIST is a space-separated list of Libtool options associated
9059# with MACRO-NAME.  If any OPTION has a matching handler declared with
9060# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9061# the unknown option and exit.
9062m4_defun([_LT_SET_OPTIONS],
9063[# Set options
9064m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9065    [_LT_SET_OPTION([$1], _LT_Option)])
9066
9067m4_if([$1],[LT_INIT],[
9068  dnl
9069  dnl Simply set some default values (i.e off) if boolean options were not
9070  dnl specified:
9071  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9072  ])
9073  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9074  ])
9075  dnl
9076  dnl If no reference was made to various pairs of opposing options, then
9077  dnl we run the default mode handler for the pair.  For example, if neither
9078  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9079  dnl archives by default:
9080  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9081  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9082  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9083  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9084  		   [_LT_ENABLE_FAST_INSTALL])
9085  ])
9086])# _LT_SET_OPTIONS
9087
9088
9089
9090# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9091# -----------------------------------------
9092m4_define([_LT_MANGLE_DEFUN],
9093[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9094
9095
9096# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9097# -----------------------------------------------
9098m4_define([LT_OPTION_DEFINE],
9099[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9100])# LT_OPTION_DEFINE
9101
9102
9103# dlopen
9104# ------
9105LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9106])
9107
9108AU_DEFUN([AC_LIBTOOL_DLOPEN],
9109[_LT_SET_OPTION([LT_INIT], [dlopen])
9110AC_DIAGNOSE([obsolete],
9111[$0: Remove this warning and the call to _LT_SET_OPTION when you
9112put the `dlopen' option into LT_INIT's first parameter.])
9113])
9114
9115dnl aclocal-1.4 backwards compatibility:
9116dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9117
9118
9119# win32-dll
9120# ---------
9121# Declare package support for building win32 dll's.
9122LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9123[enable_win32_dll=yes
9124
9125case $host in
9126*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9127  AC_CHECK_TOOL(AS, as, false)
9128  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9129  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9130  ;;
9131esac
9132
9133test -z "$AS" && AS=as
9134_LT_DECL([], [AS],      [1], [Assembler program])dnl
9135
9136test -z "$DLLTOOL" && DLLTOOL=dlltool
9137_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9138
9139test -z "$OBJDUMP" && OBJDUMP=objdump
9140_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9141])# win32-dll
9142
9143AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9144[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9145_LT_SET_OPTION([LT_INIT], [win32-dll])
9146AC_DIAGNOSE([obsolete],
9147[$0: Remove this warning and the call to _LT_SET_OPTION when you
9148put the `win32-dll' option into LT_INIT's first parameter.])
9149])
9150
9151dnl aclocal-1.4 backwards compatibility:
9152dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9153
9154
9155# _LT_ENABLE_SHARED([DEFAULT])
9156# ----------------------------
9157# implement the --enable-shared flag, and supports the `shared' and
9158# `disable-shared' LT_INIT options.
9159# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9160m4_define([_LT_ENABLE_SHARED],
9161[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9162AC_ARG_ENABLE([shared],
9163    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9164	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9165    [p=${PACKAGE-default}
9166    case $enableval in
9167    yes) enable_shared=yes ;;
9168    no) enable_shared=no ;;
9169    *)
9170      enable_shared=no
9171      # Look at the argument we got.  We use all the common list separators.
9172      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9173      for pkg in $enableval; do
9174	IFS="$lt_save_ifs"
9175	if test "X$pkg" = "X$p"; then
9176	  enable_shared=yes
9177	fi
9178      done
9179      IFS="$lt_save_ifs"
9180      ;;
9181    esac],
9182    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9183
9184    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9185	[Whether or not to build shared libraries])
9186])# _LT_ENABLE_SHARED
9187
9188LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9189LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9190
9191# Old names:
9192AC_DEFUN([AC_ENABLE_SHARED],
9193[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9194])
9195
9196AC_DEFUN([AC_DISABLE_SHARED],
9197[_LT_SET_OPTION([LT_INIT], [disable-shared])
9198])
9199
9200AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9201AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9202
9203dnl aclocal-1.4 backwards compatibility:
9204dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9205dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9206
9207
9208
9209# _LT_ENABLE_STATIC([DEFAULT])
9210# ----------------------------
9211# implement the --enable-static flag, and support the `static' and
9212# `disable-static' LT_INIT options.
9213# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9214m4_define([_LT_ENABLE_STATIC],
9215[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9216AC_ARG_ENABLE([static],
9217    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9218	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9219    [p=${PACKAGE-default}
9220    case $enableval in
9221    yes) enable_static=yes ;;
9222    no) enable_static=no ;;
9223    *)
9224     enable_static=no
9225      # Look at the argument we got.  We use all the common list separators.
9226      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9227      for pkg in $enableval; do
9228	IFS="$lt_save_ifs"
9229	if test "X$pkg" = "X$p"; then
9230	  enable_static=yes
9231	fi
9232      done
9233      IFS="$lt_save_ifs"
9234      ;;
9235    esac],
9236    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9237
9238    _LT_DECL([build_old_libs], [enable_static], [0],
9239	[Whether or not to build static libraries])
9240])# _LT_ENABLE_STATIC
9241
9242LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9243LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9244
9245# Old names:
9246AC_DEFUN([AC_ENABLE_STATIC],
9247[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9248])
9249
9250AC_DEFUN([AC_DISABLE_STATIC],
9251[_LT_SET_OPTION([LT_INIT], [disable-static])
9252])
9253
9254AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9255AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9256
9257dnl aclocal-1.4 backwards compatibility:
9258dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9259dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9260
9261
9262
9263# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9264# ----------------------------------
9265# implement the --enable-fast-install flag, and support the `fast-install'
9266# and `disable-fast-install' LT_INIT options.
9267# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9268m4_define([_LT_ENABLE_FAST_INSTALL],
9269[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9270AC_ARG_ENABLE([fast-install],
9271    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9272    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9273    [p=${PACKAGE-default}
9274    case $enableval in
9275    yes) enable_fast_install=yes ;;
9276    no) enable_fast_install=no ;;
9277    *)
9278      enable_fast_install=no
9279      # Look at the argument we got.  We use all the common list separators.
9280      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9281      for pkg in $enableval; do
9282	IFS="$lt_save_ifs"
9283	if test "X$pkg" = "X$p"; then
9284	  enable_fast_install=yes
9285	fi
9286      done
9287      IFS="$lt_save_ifs"
9288      ;;
9289    esac],
9290    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9291
9292_LT_DECL([fast_install], [enable_fast_install], [0],
9293	 [Whether or not to optimize for fast installation])dnl
9294])# _LT_ENABLE_FAST_INSTALL
9295
9296LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9297LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9298
9299# Old names:
9300AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9301[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9302AC_DIAGNOSE([obsolete],
9303[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9304the `fast-install' option into LT_INIT's first parameter.])
9305])
9306
9307AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9308[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9309AC_DIAGNOSE([obsolete],
9310[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9311the `disable-fast-install' option into LT_INIT's first parameter.])
9312])
9313
9314dnl aclocal-1.4 backwards compatibility:
9315dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9316dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9317
9318
9319# _LT_WITH_PIC([MODE])
9320# --------------------
9321# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9322# LT_INIT options.
9323# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9324m4_define([_LT_WITH_PIC],
9325[AC_ARG_WITH([pic],
9326    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9327	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9328    [lt_p=${PACKAGE-default}
9329    case $withval in
9330    yes|no) pic_mode=$withval ;;
9331    *)
9332      pic_mode=default
9333      # Look at the argument we got.  We use all the common list separators.
9334      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9335      for lt_pkg in $withval; do
9336	IFS="$lt_save_ifs"
9337	if test "X$lt_pkg" = "X$lt_p"; then
9338	  pic_mode=yes
9339	fi
9340      done
9341      IFS="$lt_save_ifs"
9342      ;;
9343    esac],
9344    [pic_mode=default])
9345
9346test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9347
9348_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9349])# _LT_WITH_PIC
9350
9351LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9352LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9353
9354# Old name:
9355AU_DEFUN([AC_LIBTOOL_PICMODE],
9356[_LT_SET_OPTION([LT_INIT], [pic-only])
9357AC_DIAGNOSE([obsolete],
9358[$0: Remove this warning and the call to _LT_SET_OPTION when you
9359put the `pic-only' option into LT_INIT's first parameter.])
9360])
9361
9362dnl aclocal-1.4 backwards compatibility:
9363dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9364
9365
9366m4_define([_LTDL_MODE], [])
9367LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9368		 [m4_define([_LTDL_MODE], [nonrecursive])])
9369LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9370		 [m4_define([_LTDL_MODE], [recursive])])
9371LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9372		 [m4_define([_LTDL_MODE], [subproject])])
9373
9374m4_define([_LTDL_TYPE], [])
9375LT_OPTION_DEFINE([LTDL_INIT], [installable],
9376		 [m4_define([_LTDL_TYPE], [installable])])
9377LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9378		 [m4_define([_LTDL_TYPE], [convenience])])
9379
9380# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9381#
9382# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9383# Written by Gary V. Vaughan, 2004
9384#
9385# This file is free software; the Free Software Foundation gives
9386# unlimited permission to copy and/or distribute it, with or without
9387# modifications, as long as this notice is preserved.
9388
9389# serial 6 ltsugar.m4
9390
9391# This is to help aclocal find these macros, as it can't see m4_define.
9392AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9393
9394
9395# lt_join(SEP, ARG1, [ARG2...])
9396# -----------------------------
9397# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9398# associated separator.
9399# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9400# versions in m4sugar had bugs.
9401m4_define([lt_join],
9402[m4_if([$#], [1], [],
9403       [$#], [2], [[$2]],
9404       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9405m4_define([_lt_join],
9406[m4_if([$#$2], [2], [],
9407       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9408
9409
9410# lt_car(LIST)
9411# lt_cdr(LIST)
9412# ------------
9413# Manipulate m4 lists.
9414# These macros are necessary as long as will still need to support
9415# Autoconf-2.59 which quotes differently.
9416m4_define([lt_car], [[$1]])
9417m4_define([lt_cdr],
9418[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9419       [$#], 1, [],
9420       [m4_dquote(m4_shift($@))])])
9421m4_define([lt_unquote], $1)
9422
9423
9424# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9425# ------------------------------------------
9426# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9427# Note that neither SEPARATOR nor STRING are expanded; they are appended
9428# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9429# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9430# than defined and empty).
9431#
9432# This macro is needed until we can rely on Autoconf 2.62, since earlier
9433# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9434m4_define([lt_append],
9435[m4_define([$1],
9436	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9437
9438
9439
9440# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9441# ----------------------------------------------------------
9442# Produce a SEP delimited list of all paired combinations of elements of
9443# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9444# has the form PREFIXmINFIXSUFFIXn.
9445# Needed until we can rely on m4_combine added in Autoconf 2.62.
9446m4_define([lt_combine],
9447[m4_if(m4_eval([$# > 3]), [1],
9448       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9449[[m4_foreach([_Lt_prefix], [$2],
9450	     [m4_foreach([_Lt_suffix],
9451		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9452	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9453
9454
9455# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9456# -----------------------------------------------------------------------
9457# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9458# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9459m4_define([lt_if_append_uniq],
9460[m4_ifdef([$1],
9461	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9462		 [lt_append([$1], [$2], [$3])$4],
9463		 [$5])],
9464	  [lt_append([$1], [$2], [$3])$4])])
9465
9466
9467# lt_dict_add(DICT, KEY, VALUE)
9468# -----------------------------
9469m4_define([lt_dict_add],
9470[m4_define([$1($2)], [$3])])
9471
9472
9473# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9474# --------------------------------------------
9475m4_define([lt_dict_add_subkey],
9476[m4_define([$1($2:$3)], [$4])])
9477
9478
9479# lt_dict_fetch(DICT, KEY, [SUBKEY])
9480# ----------------------------------
9481m4_define([lt_dict_fetch],
9482[m4_ifval([$3],
9483	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9484    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9485
9486
9487# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9488# -----------------------------------------------------------------
9489m4_define([lt_if_dict_fetch],
9490[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9491	[$5],
9492    [$6])])
9493
9494
9495# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9496# --------------------------------------------------------------
9497m4_define([lt_dict_filter],
9498[m4_if([$5], [], [],
9499  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9500           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9501		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9502])
9503
9504# ltversion.m4 -- version numbers			-*- Autoconf -*-
9505#
9506#   Copyright (C) 2004 Free Software Foundation, Inc.
9507#   Written by Scott James Remnant, 2004
9508#
9509# This file is free software; the Free Software Foundation gives
9510# unlimited permission to copy and/or distribute it, with or without
9511# modifications, as long as this notice is preserved.
9512
9513# @configure_input@
9514
9515# serial 3337 ltversion.m4
9516# This file is part of GNU Libtool
9517
9518m4_define([LT_PACKAGE_VERSION], [2.4.2])
9519m4_define([LT_PACKAGE_REVISION], [1.3337])
9520
9521AC_DEFUN([LTVERSION_VERSION],
9522[macro_version='2.4.2'
9523macro_revision='1.3337'
9524_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9525_LT_DECL(, macro_revision, 0)
9526])
9527
9528# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9529#
9530#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9531#   Written by Scott James Remnant, 2004.
9532#
9533# This file is free software; the Free Software Foundation gives
9534# unlimited permission to copy and/or distribute it, with or without
9535# modifications, as long as this notice is preserved.
9536
9537# serial 5 lt~obsolete.m4
9538
9539# These exist entirely to fool aclocal when bootstrapping libtool.
9540#
9541# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9542# which have later been changed to m4_define as they aren't part of the
9543# exported API, or moved to Autoconf or Automake where they belong.
9544#
9545# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9546# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9547# using a macro with the same name in our local m4/libtool.m4 it'll
9548# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9549# and doesn't know about Autoconf macros at all.)
9550#
9551# So we provide this file, which has a silly filename so it's always
9552# included after everything else.  This provides aclocal with the
9553# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9554# because those macros already exist, or will be overwritten later.
9555# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9556#
9557# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9558# Yes, that means every name once taken will need to remain here until
9559# we give up compatibility with versions before 1.7, at which point
9560# we need to keep only those names which we still refer to.
9561
9562# This is to help aclocal find these macros, as it can't see m4_define.
9563AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9564
9565m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9566m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9567m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9568m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9569m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9570m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9571m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9572m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9573m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9574m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9575m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9576m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9577m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9578m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9579m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9580m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9581m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9582m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9583m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9584m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9585m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9586m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9587m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9588m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9589m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9590m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9591m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9592m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9593m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9594m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9595m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9596m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9597m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9598m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9599m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9600m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9601m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9602m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9603m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9604m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9605m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9606m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9607m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9608m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9609m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9610m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9611m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9612m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9613m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9614m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9615m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9616m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9617m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9618m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9619m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9620m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9621m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9622m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9623m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9624m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9625m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9626
9627# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9628# 
9629# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9630#
9631# This program is free software; you can redistribute it and/or modify
9632# it under the terms of the GNU General Public License as published by
9633# the Free Software Foundation; either version 2 of the License, or
9634# (at your option) any later version.
9635#
9636# This program is distributed in the hope that it will be useful, but
9637# WITHOUT ANY WARRANTY; without even the implied warranty of
9638# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9639# General Public License for more details.
9640#
9641# You should have received a copy of the GNU General Public License
9642# along with this program; if not, write to the Free Software
9643# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9644#
9645# As a special exception to the GNU General Public License, if you
9646# distribute this file as part of a program that contains a
9647# configuration script generated by Autoconf, you may include it under
9648# the same distribution terms that you use for the rest of that program.
9649
9650# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9651# ----------------------------------
9652AC_DEFUN([PKG_PROG_PKG_CONFIG],
9653[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9654m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9655AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9656if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9657	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9658fi
9659if test -n "$PKG_CONFIG"; then
9660	_pkg_min_version=m4_default([$1], [0.9.0])
9661	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9662	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9663		AC_MSG_RESULT([yes])
9664	else
9665		AC_MSG_RESULT([no])
9666		PKG_CONFIG=""
9667	fi
9668		
9669fi[]dnl
9670])# PKG_PROG_PKG_CONFIG
9671
9672# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9673#
9674# Check to see whether a particular set of modules exists.  Similar
9675# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9676#
9677#
9678# Similar to PKG_CHECK_MODULES, make sure that the first instance of
9679# this or PKG_CHECK_MODULES is called, or make sure to call
9680# PKG_CHECK_EXISTS manually
9681# --------------------------------------------------------------
9682AC_DEFUN([PKG_CHECK_EXISTS],
9683[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9684if test -n "$PKG_CONFIG" && \
9685    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9686  m4_ifval([$2], [$2], [:])
9687m4_ifvaln([$3], [else
9688  $3])dnl
9689fi])
9690
9691
9692# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9693# ---------------------------------------------
9694m4_define([_PKG_CONFIG],
9695[if test -n "$$1"; then
9696    pkg_cv_[]$1="$$1"
9697 elif test -n "$PKG_CONFIG"; then
9698    PKG_CHECK_EXISTS([$3],
9699                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9700		     [pkg_failed=yes])
9701 else
9702    pkg_failed=untried
9703fi[]dnl
9704])# _PKG_CONFIG
9705
9706# _PKG_SHORT_ERRORS_SUPPORTED
9707# -----------------------------
9708AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9709[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9710if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9711        _pkg_short_errors_supported=yes
9712else
9713        _pkg_short_errors_supported=no
9714fi[]dnl
9715])# _PKG_SHORT_ERRORS_SUPPORTED
9716
9717
9718# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9719# [ACTION-IF-NOT-FOUND])
9720#
9721#
9722# Note that if there is a possibility the first call to
9723# PKG_CHECK_MODULES might not happen, you should be sure to include an
9724# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9725#
9726#
9727# --------------------------------------------------------------
9728AC_DEFUN([PKG_CHECK_MODULES],
9729[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9730AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9731AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9732
9733pkg_failed=no
9734AC_MSG_CHECKING([for $1])
9735
9736_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9737_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9738
9739m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9740and $1[]_LIBS to avoid the need to call pkg-config.
9741See the pkg-config man page for more details.])
9742
9743if test $pkg_failed = yes; then
9744        _PKG_SHORT_ERRORS_SUPPORTED
9745        if test $_pkg_short_errors_supported = yes; then
9746	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9747        else 
9748	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9749        fi
9750	# Put the nasty error message in config.log where it belongs
9751	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9752
9753	ifelse([$4], , [AC_MSG_ERROR(dnl
9754[Package requirements ($2) were not met:
9755
9756$$1_PKG_ERRORS
9757
9758Consider adjusting the PKG_CONFIG_PATH environment variable if you
9759installed software in a non-standard prefix.
9760
9761_PKG_TEXT
9762])],
9763		[AC_MSG_RESULT([no])
9764                $4])
9765elif test $pkg_failed = untried; then
9766	ifelse([$4], , [AC_MSG_FAILURE(dnl
9767[The pkg-config script could not be found or is too old.  Make sure it
9768is in your PATH or set the PKG_CONFIG environment variable to the full
9769path to pkg-config.
9770
9771_PKG_TEXT
9772
9773To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9774		[$4])
9775else
9776	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9777	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9778        AC_MSG_RESULT([yes])
9779	ifelse([$3], , :, [$3])
9780fi[]dnl
9781])# PKG_CHECK_MODULES
9782
9783dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9784dnl
9785dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9786dnl 
9787dnl Permission is hereby granted, free of charge, to any person obtaining a
9788dnl copy of this software and associated documentation files (the "Software"),
9789dnl to deal in the Software without restriction, including without limitation
9790dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9791dnl and/or sell copies of the Software, and to permit persons to whom the
9792dnl Software is furnished to do so, subject to the following conditions:
9793dnl
9794dnl The above copyright notice and this permission notice (including the next
9795dnl paragraph) shall be included in all copies or substantial portions of the
9796dnl Software.
9797dnl
9798dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9799dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9800dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9801dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9802dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9803dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9804dnl DEALINGS IN THE SOFTWARE.
9805
9806# XORG_MACROS_VERSION(required-version)
9807# -------------------------------------
9808# Minimum version: 1.1.0
9809#
9810# If you're using a macro added in Version 1.1 or newer, include this in
9811# your configure.ac with the minimum required version, such as:
9812# XORG_MACROS_VERSION(1.1)
9813#
9814# To ensure that this macro is defined, also add:
9815# m4_ifndef([XORG_MACROS_VERSION],
9816#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9817#
9818#
9819# See the "minimum version" comment for each macro you use to see what 
9820# version you require.
9821m4_defun([XORG_MACROS_VERSION],[
9822m4_define([vers_have], [1.17])
9823m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9824m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9825m4_if(m4_cmp(maj_have, maj_needed), 0,,
9826    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9827m4_if(m4_version_compare(vers_have, [$1]), -1,
9828    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9829m4_undefine([vers_have])
9830m4_undefine([maj_have])
9831m4_undefine([maj_needed])
9832]) # XORG_MACROS_VERSION
9833
9834# XORG_PROG_RAWCPP()
9835# ------------------
9836# Minimum version: 1.0.0
9837#
9838# Find cpp program and necessary flags for use in pre-processing text files
9839# such as man pages and config files
9840AC_DEFUN([XORG_PROG_RAWCPP],[
9841AC_REQUIRE([AC_PROG_CPP])
9842AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9843   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9844
9845# Check for flag to avoid builtin definitions - assumes unix is predefined,
9846# which is not the best choice for supporting other OS'es, but covers most
9847# of the ones we need for now.
9848AC_MSG_CHECKING([if $RAWCPP requires -undef])
9849AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9850if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9851	AC_MSG_RESULT([no])
9852else
9853	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9854		RAWCPPFLAGS=-undef
9855		AC_MSG_RESULT([yes])
9856	# under Cygwin unix is still defined even with -undef
9857	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9858		RAWCPPFLAGS="-undef -ansi"
9859		AC_MSG_RESULT([yes, with -ansi])
9860	else
9861		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9862	fi
9863fi
9864rm -f conftest.$ac_ext
9865
9866AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9867AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9868if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9869	AC_MSG_RESULT([no])
9870else
9871	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9872		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9873		AC_MSG_RESULT([yes])
9874	else
9875		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9876	fi
9877fi
9878rm -f conftest.$ac_ext
9879AC_SUBST(RAWCPPFLAGS)
9880]) # XORG_PROG_RAWCPP
9881
9882# XORG_MANPAGE_SECTIONS()
9883# -----------------------
9884# Minimum version: 1.0.0
9885#
9886# Determine which sections man pages go in for the different man page types
9887# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9888# Not sure if there's any better way than just hardcoding by OS name.
9889# Override default settings by setting environment variables
9890# Added MAN_SUBSTS in version 1.8
9891# Added AC_PROG_SED in version 1.8
9892
9893AC_DEFUN([XORG_MANPAGE_SECTIONS],[
9894AC_REQUIRE([AC_CANONICAL_HOST])
9895AC_REQUIRE([AC_PROG_SED])
9896
9897if test x$APP_MAN_SUFFIX = x    ; then
9898    APP_MAN_SUFFIX=1
9899fi
9900if test x$APP_MAN_DIR = x    ; then
9901    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9902fi
9903
9904if test x$LIB_MAN_SUFFIX = x    ; then
9905    LIB_MAN_SUFFIX=3
9906fi
9907if test x$LIB_MAN_DIR = x    ; then
9908    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9909fi
9910
9911if test x$FILE_MAN_SUFFIX = x    ; then
9912    case $host_os in
9913	solaris*)	FILE_MAN_SUFFIX=4  ;;
9914	*)		FILE_MAN_SUFFIX=5  ;;
9915    esac
9916fi
9917if test x$FILE_MAN_DIR = x    ; then
9918    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9919fi
9920
9921if test x$MISC_MAN_SUFFIX = x    ; then
9922    case $host_os in
9923	solaris*)	MISC_MAN_SUFFIX=5  ;;
9924	*)		MISC_MAN_SUFFIX=7  ;;
9925    esac
9926fi
9927if test x$MISC_MAN_DIR = x    ; then
9928    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9929fi
9930
9931if test x$DRIVER_MAN_SUFFIX = x    ; then
9932    case $host_os in
9933	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9934	*)		DRIVER_MAN_SUFFIX=4  ;;
9935    esac
9936fi
9937if test x$DRIVER_MAN_DIR = x    ; then
9938    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9939fi
9940
9941if test x$ADMIN_MAN_SUFFIX = x    ; then
9942    case $host_os in
9943	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9944	*)		ADMIN_MAN_SUFFIX=8  ;;
9945    esac
9946fi
9947if test x$ADMIN_MAN_DIR = x    ; then
9948    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9949fi
9950
9951
9952AC_SUBST([APP_MAN_SUFFIX])
9953AC_SUBST([LIB_MAN_SUFFIX])
9954AC_SUBST([FILE_MAN_SUFFIX])
9955AC_SUBST([MISC_MAN_SUFFIX])
9956AC_SUBST([DRIVER_MAN_SUFFIX])
9957AC_SUBST([ADMIN_MAN_SUFFIX])
9958AC_SUBST([APP_MAN_DIR])
9959AC_SUBST([LIB_MAN_DIR])
9960AC_SUBST([FILE_MAN_DIR])
9961AC_SUBST([MISC_MAN_DIR])
9962AC_SUBST([DRIVER_MAN_DIR])
9963AC_SUBST([ADMIN_MAN_DIR])
9964
9965XORG_MAN_PAGE="X Version 11"
9966AC_SUBST([XORG_MAN_PAGE])
9967MAN_SUBSTS="\
9968	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9969	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9970	-e 's|__xservername__|Xorg|g' \
9971	-e 's|__xconfigfile__|xorg.conf|g' \
9972	-e 's|__projectroot__|\$(prefix)|g' \
9973	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9974	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9975	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9976	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9977	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9978	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9979	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9980AC_SUBST([MAN_SUBSTS])
9981
9982]) # XORG_MANPAGE_SECTIONS
9983
9984# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9985# ------------------------
9986# Minimum version: 1.7.0
9987#
9988# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9989# provided by xorg-sgml-doctools, if installed.
9990AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9991AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9992XORG_SGML_PATH=
9993PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9994    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9995    [m4_ifval([$1],[:],
9996        [if test x"$cross_compiling" != x"yes" ; then
9997            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9998                          [XORG_SGML_PATH=$prefix/share/sgml])
9999         fi])
10000    ])
10001
10002# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10003# the path and the name of the doc stylesheet
10004if test "x$XORG_SGML_PATH" != "x" ; then
10005   AC_MSG_RESULT([$XORG_SGML_PATH])
10006   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10007   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10008else
10009   AC_MSG_RESULT([no])
10010fi
10011
10012AC_SUBST(XORG_SGML_PATH)
10013AC_SUBST(STYLESHEET_SRCDIR)
10014AC_SUBST(XSL_STYLESHEET)
10015AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10016]) # XORG_CHECK_SGML_DOCTOOLS
10017
10018# XORG_CHECK_LINUXDOC
10019# -------------------
10020# Minimum version: 1.0.0
10021#
10022# Defines the variable MAKE_TEXT if the necessary tools and
10023# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10024# Whether or not the necessary tools and files are found can be checked
10025# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10026AC_DEFUN([XORG_CHECK_LINUXDOC],[
10027AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10028AC_REQUIRE([XORG_WITH_PS2PDF])
10029
10030AC_PATH_PROG(LINUXDOC, linuxdoc)
10031
10032AC_MSG_CHECKING([whether to build documentation])
10033
10034if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10035   BUILDDOC=yes
10036else
10037   BUILDDOC=no
10038fi
10039
10040AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10041
10042AC_MSG_RESULT([$BUILDDOC])
10043
10044AC_MSG_CHECKING([whether to build pdf documentation])
10045
10046if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10047   BUILDPDFDOC=yes
10048else
10049   BUILDPDFDOC=no
10050fi
10051
10052AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10053
10054AC_MSG_RESULT([$BUILDPDFDOC])
10055
10056MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10057MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10058MAKE_PDF="$PS2PDF"
10059MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10060
10061AC_SUBST(MAKE_TEXT)
10062AC_SUBST(MAKE_PS)
10063AC_SUBST(MAKE_PDF)
10064AC_SUBST(MAKE_HTML)
10065]) # XORG_CHECK_LINUXDOC
10066
10067# XORG_CHECK_DOCBOOK
10068# -------------------
10069# Minimum version: 1.0.0
10070#
10071# Checks for the ability to build output formats from SGML DocBook source.
10072# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10073# indicates whether the necessary tools and files are found and, if set,
10074# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10075AC_DEFUN([XORG_CHECK_DOCBOOK],[
10076AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10077
10078BUILDTXTDOC=no
10079BUILDPDFDOC=no
10080BUILDPSDOC=no
10081BUILDHTMLDOC=no
10082
10083AC_PATH_PROG(DOCBOOKPS, docbook2ps)
10084AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10085AC_PATH_PROG(DOCBOOKHTML, docbook2html)
10086AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10087
10088AC_MSG_CHECKING([whether to build text documentation])
10089if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10090   test x$BUILD_TXTDOC != xno; then
10091	BUILDTXTDOC=yes
10092fi
10093AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10094AC_MSG_RESULT([$BUILDTXTDOC])
10095
10096AC_MSG_CHECKING([whether to build PDF documentation])
10097if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10098   test x$BUILD_PDFDOC != xno; then
10099	BUILDPDFDOC=yes
10100fi
10101AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10102AC_MSG_RESULT([$BUILDPDFDOC])
10103
10104AC_MSG_CHECKING([whether to build PostScript documentation])
10105if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10106   test x$BUILD_PSDOC != xno; then
10107	BUILDPSDOC=yes
10108fi
10109AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10110AC_MSG_RESULT([$BUILDPSDOC])
10111
10112AC_MSG_CHECKING([whether to build HTML documentation])
10113if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10114   test x$BUILD_HTMLDOC != xno; then
10115	BUILDHTMLDOC=yes
10116fi
10117AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10118AC_MSG_RESULT([$BUILDHTMLDOC])
10119
10120MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10121MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10122MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10123MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10124
10125AC_SUBST(MAKE_TEXT)
10126AC_SUBST(MAKE_PS)
10127AC_SUBST(MAKE_PDF)
10128AC_SUBST(MAKE_HTML)
10129]) # XORG_CHECK_DOCBOOK
10130
10131# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10132# ----------------
10133# Minimum version: 1.5.0
10134# Minimum version for optional DEFAULT argument: 1.11.0
10135#
10136# Documentation tools are not always available on all platforms and sometimes
10137# not at the appropriate level. This macro enables a module to test for the
10138# presence of the tool and obtain it's path in separate variables. Coupled with
10139# the --with-xmlto option, it allows maximum flexibilty in making decisions
10140# as whether or not to use the xmlto package. When DEFAULT is not specified,
10141# --with-xmlto assumes 'auto'.
10142#
10143# Interface to module:
10144# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10145# XMLTO:	returns the path of the xmlto program found
10146#		returns the path set by the user in the environment
10147# --with-xmlto:	'yes' user instructs the module to use xmlto
10148#		'no' user instructs the module not to use xmlto
10149#
10150# Added in version 1.10.0
10151# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10152#                  xmlto for text output requires either lynx, links, or w3m browsers
10153#
10154# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10155#
10156AC_DEFUN([XORG_WITH_XMLTO],[
10157AC_ARG_VAR([XMLTO], [Path to xmlto command])
10158m4_define([_defopt], m4_default([$2], [auto]))
10159AC_ARG_WITH(xmlto,
10160	AS_HELP_STRING([--with-xmlto],
10161	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10162	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10163m4_undefine([_defopt])
10164
10165if test "x$use_xmlto" = x"auto"; then
10166   AC_PATH_PROG([XMLTO], [xmlto])
10167   if test "x$XMLTO" = "x"; then
10168        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10169	have_xmlto=no
10170   else
10171        have_xmlto=yes
10172   fi
10173elif test "x$use_xmlto" = x"yes" ; then
10174   AC_PATH_PROG([XMLTO], [xmlto])
10175   if test "x$XMLTO" = "x"; then
10176        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10177   fi
10178   have_xmlto=yes
10179elif test "x$use_xmlto" = x"no" ; then
10180   if test "x$XMLTO" != "x"; then
10181      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10182   fi
10183   have_xmlto=no
10184else
10185   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10186fi
10187
10188# Test for a minimum version of xmlto, if provided.
10189m4_ifval([$1],
10190[if test "$have_xmlto" = yes; then
10191    # scrape the xmlto version
10192    AC_MSG_CHECKING([the xmlto version])
10193    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10194    AC_MSG_RESULT([$xmlto_version])
10195    AS_VERSION_COMPARE([$xmlto_version], [$1],
10196        [if test "x$use_xmlto" = xauto; then
10197            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10198            have_xmlto=no
10199        else
10200            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10201        fi])
10202fi])
10203
10204# Test for the ability of xmlto to generate a text target
10205have_xmlto_text=no
10206cat > conftest.xml << "EOF"
10207EOF
10208AS_IF([test "$have_xmlto" = yes],
10209      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10210             [have_xmlto_text=yes],
10211             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10212rm -f conftest.xml
10213AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10214AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10215]) # XORG_WITH_XMLTO
10216
10217# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10218# --------------------------------------------
10219# Minimum version: 1.12.0
10220# Minimum version for optional DEFAULT argument: 1.12.0
10221#
10222# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10223# XML-based language used for the transformation of XML documents.
10224# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10225# It is used under the cover by xmlto to generate html files from DocBook/XML.
10226# The XSLT processor is often used as a standalone tool for transformations.
10227# It should not be assumed that this tool is used only to work with documnetation.
10228# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10229#
10230# Interface to module:
10231# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10232# XSLTPROC:	 returns the path of the xsltproc program found
10233#		 returns the path set by the user in the environment
10234# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10235#		  'no' user instructs the module not to use xsltproc
10236# have_xsltproc: returns yes if xsltproc found in PATH or no
10237#
10238# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10239#
10240AC_DEFUN([XORG_WITH_XSLTPROC],[
10241AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10242# Preserves the interface, should it be implemented later
10243m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10244m4_define([_defopt], m4_default([$2], [auto]))
10245AC_ARG_WITH(xsltproc,
10246	AS_HELP_STRING([--with-xsltproc],
10247	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10248	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10249m4_undefine([_defopt])
10250
10251if test "x$use_xsltproc" = x"auto"; then
10252   AC_PATH_PROG([XSLTPROC], [xsltproc])
10253   if test "x$XSLTPROC" = "x"; then
10254        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10255	have_xsltproc=no
10256   else
10257        have_xsltproc=yes
10258   fi
10259elif test "x$use_xsltproc" = x"yes" ; then
10260   AC_PATH_PROG([XSLTPROC], [xsltproc])
10261   if test "x$XSLTPROC" = "x"; then
10262        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10263   fi
10264   have_xsltproc=yes
10265elif test "x$use_xsltproc" = x"no" ; then
10266   if test "x$XSLTPROC" != "x"; then
10267      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10268   fi
10269   have_xsltproc=no
10270else
10271   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10272fi
10273
10274AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10275]) # XORG_WITH_XSLTPROC
10276
10277# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10278# ----------------------------------------
10279# Minimum version: 1.15.0
10280#
10281# PERL (Practical Extraction and Report Language) is a language optimized for
10282# scanning arbitrary text files, extracting information from those text files,
10283# and printing reports based on that information.
10284#
10285# When DEFAULT is not specified, --with-perl assumes 'auto'.
10286#
10287# Interface to module:
10288# HAVE_PERL: used in makefiles to conditionally scan text files
10289# PERL:	     returns the path of the perl program found
10290#	     returns the path set by the user in the environment
10291# --with-perl: 'yes' user instructs the module to use perl
10292#	       'no' user instructs the module not to use perl
10293# have_perl: returns yes if perl found in PATH or no
10294#
10295# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10296#
10297AC_DEFUN([XORG_WITH_PERL],[
10298AC_ARG_VAR([PERL], [Path to perl command])
10299# Preserves the interface, should it be implemented later
10300m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10301m4_define([_defopt], m4_default([$2], [auto]))
10302AC_ARG_WITH(perl,
10303	AS_HELP_STRING([--with-perl],
10304	   [Use perl for extracting information from files (default: ]_defopt[)]),
10305	   [use_perl=$withval], [use_perl=]_defopt)
10306m4_undefine([_defopt])
10307
10308if test "x$use_perl" = x"auto"; then
10309   AC_PATH_PROG([PERL], [perl])
10310   if test "x$PERL" = "x"; then
10311        AC_MSG_WARN([perl not found - cannot extract information and report])
10312	have_perl=no
10313   else
10314        have_perl=yes
10315   fi
10316elif test "x$use_perl" = x"yes" ; then
10317   AC_PATH_PROG([PERL], [perl])
10318   if test "x$PERL" = "x"; then
10319        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10320   fi
10321   have_perl=yes
10322elif test "x$use_perl" = x"no" ; then
10323   if test "x$PERL" != "x"; then
10324      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10325   fi
10326   have_perl=no
10327else
10328   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10329fi
10330
10331AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10332]) # XORG_WITH_PERL
10333
10334# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10335# ----------------
10336# Minimum version: 1.5.0
10337# Minimum version for optional DEFAULT argument: 1.11.0
10338#
10339# Documentation tools are not always available on all platforms and sometimes
10340# not at the appropriate level. This macro enables a module to test for the
10341# presence of the tool and obtain it's path in separate variables. Coupled with
10342# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10343# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10344# --with-asciidoc assumes 'auto'.
10345#
10346# Interface to module:
10347# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10348# ASCIIDOC:	 returns the path of the asciidoc program found
10349#		 returns the path set by the user in the environment
10350# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10351#		  'no' user instructs the module not to use asciidoc
10352#
10353# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10354#
10355AC_DEFUN([XORG_WITH_ASCIIDOC],[
10356AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10357m4_define([_defopt], m4_default([$2], [auto]))
10358AC_ARG_WITH(asciidoc,
10359	AS_HELP_STRING([--with-asciidoc],
10360	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10361	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10362m4_undefine([_defopt])
10363
10364if test "x$use_asciidoc" = x"auto"; then
10365   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10366   if test "x$ASCIIDOC" = "x"; then
10367        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10368	have_asciidoc=no
10369   else
10370        have_asciidoc=yes
10371   fi
10372elif test "x$use_asciidoc" = x"yes" ; then
10373   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10374   if test "x$ASCIIDOC" = "x"; then
10375        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10376   fi
10377   have_asciidoc=yes
10378elif test "x$use_asciidoc" = x"no" ; then
10379   if test "x$ASCIIDOC" != "x"; then
10380      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10381   fi
10382   have_asciidoc=no
10383else
10384   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10385fi
10386m4_ifval([$1],
10387[if test "$have_asciidoc" = yes; then
10388    # scrape the asciidoc version
10389    AC_MSG_CHECKING([the asciidoc version])
10390    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10391    AC_MSG_RESULT([$asciidoc_version])
10392    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10393        [if test "x$use_asciidoc" = xauto; then
10394            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10395            have_asciidoc=no
10396        else
10397            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10398        fi])
10399fi])
10400AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10401]) # XORG_WITH_ASCIIDOC
10402
10403# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10404# --------------------------------
10405# Minimum version: 1.5.0
10406# Minimum version for optional DEFAULT argument: 1.11.0
10407#
10408# Documentation tools are not always available on all platforms and sometimes
10409# not at the appropriate level. This macro enables a module to test for the
10410# presence of the tool and obtain it's path in separate variables. Coupled with
10411# the --with-doxygen option, it allows maximum flexibilty in making decisions
10412# as whether or not to use the doxygen package. When DEFAULT is not specified,
10413# --with-doxygen assumes 'auto'.
10414#
10415# Interface to module:
10416# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10417# DOXYGEN:	 returns the path of the doxygen program found
10418#		 returns the path set by the user in the environment
10419# --with-doxygen: 'yes' user instructs the module to use doxygen
10420#		  'no' user instructs the module not to use doxygen
10421#
10422# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10423#
10424AC_DEFUN([XORG_WITH_DOXYGEN],[
10425AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10426m4_define([_defopt], m4_default([$2], [auto]))
10427AC_ARG_WITH(doxygen,
10428	AS_HELP_STRING([--with-doxygen],
10429	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10430	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10431m4_undefine([_defopt])
10432
10433if test "x$use_doxygen" = x"auto"; then
10434   AC_PATH_PROG([DOXYGEN], [doxygen])
10435   if test "x$DOXYGEN" = "x"; then
10436        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10437	have_doxygen=no
10438   else
10439        have_doxygen=yes
10440   fi
10441elif test "x$use_doxygen" = x"yes" ; then
10442   AC_PATH_PROG([DOXYGEN], [doxygen])
10443   if test "x$DOXYGEN" = "x"; then
10444        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10445   fi
10446   have_doxygen=yes
10447elif test "x$use_doxygen" = x"no" ; then
10448   if test "x$DOXYGEN" != "x"; then
10449      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10450   fi
10451   have_doxygen=no
10452else
10453   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10454fi
10455m4_ifval([$1],
10456[if test "$have_doxygen" = yes; then
10457    # scrape the doxygen version
10458    AC_MSG_CHECKING([the doxygen version])
10459    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10460    AC_MSG_RESULT([$doxygen_version])
10461    AS_VERSION_COMPARE([$doxygen_version], [$1],
10462        [if test "x$use_doxygen" = xauto; then
10463            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10464            have_doxygen=no
10465        else
10466            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10467        fi])
10468fi])
10469AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10470]) # XORG_WITH_DOXYGEN
10471
10472# XORG_WITH_GROFF([DEFAULT])
10473# ----------------
10474# Minimum version: 1.6.0
10475# Minimum version for optional DEFAULT argument: 1.11.0
10476#
10477# Documentation tools are not always available on all platforms and sometimes
10478# not at the appropriate level. This macro enables a module to test for the
10479# presence of the tool and obtain it's path in separate variables. Coupled with
10480# the --with-groff option, it allows maximum flexibilty in making decisions
10481# as whether or not to use the groff package. When DEFAULT is not specified,
10482# --with-groff assumes 'auto'.
10483#
10484# Interface to module:
10485# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10486# HAVE_GROFF_MM: the memorandum macros (-mm) package
10487# HAVE_GROFF_MS: the -ms macros package
10488# GROFF:	 returns the path of the groff program found
10489#		 returns the path set by the user in the environment
10490# --with-groff:	 'yes' user instructs the module to use groff
10491#		 'no' user instructs the module not to use groff
10492#
10493# Added in version 1.9.0:
10494# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10495#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10496#		   psselect from the psutils package.
10497#		   the ghostcript package. Refer to the grohtml man pages
10498#
10499# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10500#
10501# OS and distros often splits groff in a basic and full package, the former
10502# having the groff program and the later having devices, fonts and macros
10503# Checking for the groff executable is not enough.
10504#
10505# If macros are missing, we cannot assume that groff is useless, so we don't
10506# unset HAVE_GROFF or GROFF env variables.
10507# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10508#
10509AC_DEFUN([XORG_WITH_GROFF],[
10510AC_ARG_VAR([GROFF], [Path to groff command])
10511m4_define([_defopt], m4_default([$1], [auto]))
10512AC_ARG_WITH(groff,
10513	AS_HELP_STRING([--with-groff],
10514	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10515	   [use_groff=$withval], [use_groff=]_defopt)
10516m4_undefine([_defopt])
10517
10518if test "x$use_groff" = x"auto"; then
10519   AC_PATH_PROG([GROFF], [groff])
10520   if test "x$GROFF" = "x"; then
10521        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10522	have_groff=no
10523   else
10524        have_groff=yes
10525   fi
10526elif test "x$use_groff" = x"yes" ; then
10527   AC_PATH_PROG([GROFF], [groff])
10528   if test "x$GROFF" = "x"; then
10529        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10530   fi
10531   have_groff=yes
10532elif test "x$use_groff" = x"no" ; then
10533   if test "x$GROFF" != "x"; then
10534      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10535   fi
10536   have_groff=no
10537else
10538   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10539fi
10540
10541# We have groff, test for the presence of the macro packages
10542if test "x$have_groff" = x"yes"; then
10543    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10544    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10545        groff_ms_works=yes
10546    else
10547        groff_ms_works=no
10548    fi
10549    AC_MSG_RESULT([$groff_ms_works])
10550    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10551    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10552        groff_mm_works=yes
10553    else
10554        groff_mm_works=no
10555    fi
10556    AC_MSG_RESULT([$groff_mm_works])
10557fi
10558
10559# We have groff, test for HTML dependencies, one command per package
10560if test "x$have_groff" = x"yes"; then
10561   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10562   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10563   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10564   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10565      have_groff_html=yes
10566   else
10567      have_groff_html=no
10568      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10569   fi
10570fi
10571
10572# Set Automake conditionals for Makefiles
10573AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10574AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10575AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10576AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10577]) # XORG_WITH_GROFF
10578
10579# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10580# ---------------------------------------
10581# Minimum version: 1.6.0
10582# Minimum version for optional DEFAULT argument: 1.11.0
10583# Minimum version for optional MIN-VERSION argument: 1.15.0
10584#
10585# Documentation tools are not always available on all platforms and sometimes
10586# not at the appropriate level. This macro enables a module to test for the
10587# presence of the tool and obtain it's path in separate variables. Coupled with
10588# the --with-fop option, it allows maximum flexibilty in making decisions
10589# as whether or not to use the fop package. When DEFAULT is not specified,
10590# --with-fop assumes 'auto'.
10591#
10592# Interface to module:
10593# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10594# FOP:	 	returns the path of the fop program found
10595#		returns the path set by the user in the environment
10596# --with-fop: 	'yes' user instructs the module to use fop
10597#		'no' user instructs the module not to use fop
10598#
10599# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10600#
10601AC_DEFUN([XORG_WITH_FOP],[
10602AC_ARG_VAR([FOP], [Path to fop command])
10603m4_define([_defopt], m4_default([$2], [auto]))
10604AC_ARG_WITH(fop,
10605	AS_HELP_STRING([--with-fop],
10606	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10607	   [use_fop=$withval], [use_fop=]_defopt)
10608m4_undefine([_defopt])
10609
10610if test "x$use_fop" = x"auto"; then
10611   AC_PATH_PROG([FOP], [fop])
10612   if test "x$FOP" = "x"; then
10613        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10614	have_fop=no
10615   else
10616        have_fop=yes
10617   fi
10618elif test "x$use_fop" = x"yes" ; then
10619   AC_PATH_PROG([FOP], [fop])
10620   if test "x$FOP" = "x"; then
10621        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10622   fi
10623   have_fop=yes
10624elif test "x$use_fop" = x"no" ; then
10625   if test "x$FOP" != "x"; then
10626      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10627   fi
10628   have_fop=no
10629else
10630   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10631fi
10632
10633# Test for a minimum version of fop, if provided.
10634m4_ifval([$1],
10635[if test "$have_fop" = yes; then
10636    # scrape the fop version
10637    AC_MSG_CHECKING([for fop minimum version])
10638    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10639    AC_MSG_RESULT([$fop_version])
10640    AS_VERSION_COMPARE([$fop_version], [$1],
10641        [if test "x$use_fop" = xauto; then
10642            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10643            have_fop=no
10644        else
10645            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10646        fi])
10647fi])
10648AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10649]) # XORG_WITH_FOP
10650
10651# XORG_WITH_PS2PDF([DEFAULT])
10652# ----------------
10653# Minimum version: 1.6.0
10654# Minimum version for optional DEFAULT argument: 1.11.0
10655#
10656# Documentation tools are not always available on all platforms and sometimes
10657# not at the appropriate level. This macro enables a module to test for the
10658# presence of the tool and obtain it's path in separate variables. Coupled with
10659# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10660# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10661# --with-ps2pdf assumes 'auto'.
10662#
10663# Interface to module:
10664# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10665# PS2PDF:	returns the path of the ps2pdf program found
10666#		returns the path set by the user in the environment
10667# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10668#		 'no' user instructs the module not to use ps2pdf
10669#
10670# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10671#
10672AC_DEFUN([XORG_WITH_PS2PDF],[
10673AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10674m4_define([_defopt], m4_default([$1], [auto]))
10675AC_ARG_WITH(ps2pdf,
10676	AS_HELP_STRING([--with-ps2pdf],
10677	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10678	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10679m4_undefine([_defopt])
10680
10681if test "x$use_ps2pdf" = x"auto"; then
10682   AC_PATH_PROG([PS2PDF], [ps2pdf])
10683   if test "x$PS2PDF" = "x"; then
10684        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10685	have_ps2pdf=no
10686   else
10687        have_ps2pdf=yes
10688   fi
10689elif test "x$use_ps2pdf" = x"yes" ; then
10690   AC_PATH_PROG([PS2PDF], [ps2pdf])
10691   if test "x$PS2PDF" = "x"; then
10692        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10693   fi
10694   have_ps2pdf=yes
10695elif test "x$use_ps2pdf" = x"no" ; then
10696   if test "x$PS2PDF" != "x"; then
10697      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10698   fi
10699   have_ps2pdf=no
10700else
10701   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10702fi
10703AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10704]) # XORG_WITH_PS2PDF
10705
10706# XORG_ENABLE_DOCS (enable_docs=yes)
10707# ----------------
10708# Minimum version: 1.6.0
10709#
10710# Documentation tools are not always available on all platforms and sometimes
10711# not at the appropriate level. This macro enables a builder to skip all
10712# documentation targets except traditional man pages.
10713# Combined with the specific tool checking macros XORG_WITH_*, it provides
10714# maximum flexibilty in controlling documentation building.
10715# Refer to:
10716# XORG_WITH_XMLTO         --with-xmlto
10717# XORG_WITH_ASCIIDOC      --with-asciidoc
10718# XORG_WITH_DOXYGEN       --with-doxygen
10719# XORG_WITH_FOP           --with-fop
10720# XORG_WITH_GROFF         --with-groff
10721# XORG_WITH_PS2PDF        --with-ps2pdf
10722#
10723# Interface to module:
10724# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10725# --enable-docs: 'yes' user instructs the module to generate docs
10726#		 'no' user instructs the module not to generate docs
10727# parm1:	specify the default value, yes or no.
10728#
10729AC_DEFUN([XORG_ENABLE_DOCS],[
10730m4_define([docs_default], m4_default([$1], [yes]))
10731AC_ARG_ENABLE(docs,
10732	AS_HELP_STRING([--enable-docs],
10733	   [Enable building the documentation (default: ]docs_default[)]),
10734	   [build_docs=$enableval], [build_docs=]docs_default)
10735m4_undefine([docs_default])
10736AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10737AC_MSG_CHECKING([whether to build documentation])
10738AC_MSG_RESULT([$build_docs])
10739]) # XORG_ENABLE_DOCS
10740
10741# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10742# ----------------
10743# Minimum version: 1.6.0
10744#
10745# This macro enables a builder to skip all developer documentation.
10746# Combined with the specific tool checking macros XORG_WITH_*, it provides
10747# maximum flexibilty in controlling documentation building.
10748# Refer to:
10749# XORG_WITH_XMLTO         --with-xmlto
10750# XORG_WITH_ASCIIDOC      --with-asciidoc
10751# XORG_WITH_DOXYGEN       --with-doxygen
10752# XORG_WITH_FOP           --with-fop
10753# XORG_WITH_GROFF         --with-groff
10754# XORG_WITH_PS2PDF        --with-ps2pdf
10755#
10756# Interface to module:
10757# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10758# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10759#			'no' user instructs the module not to generate developer docs
10760# parm1:		specify the default value, yes or no.
10761#
10762AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10763m4_define([devel_default], m4_default([$1], [yes]))
10764AC_ARG_ENABLE(devel-docs,
10765	AS_HELP_STRING([--enable-devel-docs],
10766	   [Enable building the developer documentation (default: ]devel_default[)]),
10767	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10768m4_undefine([devel_default])
10769AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10770AC_MSG_CHECKING([whether to build developer documentation])
10771AC_MSG_RESULT([$build_devel_docs])
10772]) # XORG_ENABLE_DEVEL_DOCS
10773
10774# XORG_ENABLE_SPECS (enable_specs=yes)
10775# ----------------
10776# Minimum version: 1.6.0
10777#
10778# This macro enables a builder to skip all functional specification targets.
10779# Combined with the specific tool checking macros XORG_WITH_*, it provides
10780# maximum flexibilty in controlling documentation building.
10781# Refer to:
10782# XORG_WITH_XMLTO         --with-xmlto
10783# XORG_WITH_ASCIIDOC      --with-asciidoc
10784# XORG_WITH_DOXYGEN       --with-doxygen
10785# XORG_WITH_FOP           --with-fop
10786# XORG_WITH_GROFF         --with-groff
10787# XORG_WITH_PS2PDF        --with-ps2pdf
10788#
10789# Interface to module:
10790# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10791# --enable-specs:	'yes' user instructs the module to generate specs
10792#			'no' user instructs the module not to generate specs
10793# parm1:		specify the default value, yes or no.
10794#
10795AC_DEFUN([XORG_ENABLE_SPECS],[
10796m4_define([spec_default], m4_default([$1], [yes]))
10797AC_ARG_ENABLE(specs,
10798	AS_HELP_STRING([--enable-specs],
10799	   [Enable building the specs (default: ]spec_default[)]),
10800	   [build_specs=$enableval], [build_specs=]spec_default)
10801m4_undefine([spec_default])
10802AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10803AC_MSG_CHECKING([whether to build functional specifications])
10804AC_MSG_RESULT([$build_specs])
10805]) # XORG_ENABLE_SPECS
10806
10807# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10808# ----------------------------------------------
10809# Minimum version: 1.13.0
10810#
10811# This macro enables a builder to enable/disable unit testing
10812# It makes no assumption about the test cases implementation
10813# Test cases may or may not use Automake "Support for test suites"
10814# They may or may not use the software utility library GLib
10815#
10816# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10817# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10818# The variable enable_unit_tests is used by other macros in this file.
10819#
10820# Interface to module:
10821# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10822# enable_unit_tests:    used in configure.ac for additional configuration
10823# --enable-unit-tests:	'yes' user instructs the module to build tests
10824#			'no' user instructs the module not to build tests
10825# parm1:		specify the default value, yes or no.
10826#
10827AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10828AC_BEFORE([$0], [XORG_WITH_GLIB])
10829AC_BEFORE([$0], [XORG_LD_WRAP])
10830AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10831m4_define([_defopt], m4_default([$1], [auto]))
10832AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10833	[Enable building unit test cases (default: ]_defopt[)]),
10834	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10835m4_undefine([_defopt])
10836AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10837AC_MSG_CHECKING([whether to build unit test cases])
10838AC_MSG_RESULT([$enable_unit_tests])
10839]) # XORG_ENABLE_UNIT_TESTS
10840
10841# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10842# ------------------------------------------------------
10843# Minimum version: 1.17.0
10844#
10845# This macro enables a builder to enable/disable integration testing
10846# It makes no assumption about the test cases' implementation
10847# Test cases may or may not use Automake "Support for test suites"
10848#
10849# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10850# usually requires less dependencies and may be built and run under less
10851# stringent environments than integration tests.
10852#
10853# Interface to module:
10854# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10855# enable_integration_tests:   used in configure.ac for additional configuration
10856# --enable-integration-tests: 'yes' user instructs the module to build tests
10857#                             'no' user instructs the module not to build tests
10858# parm1:                      specify the default value, yes or no.
10859#
10860AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10861AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10862m4_define([_defopt], m4_default([$1], [auto]))
10863AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10864	[Enable building integration test cases (default: ]_defopt[)]),
10865	[enable_integration_tests=$enableval],
10866	[enable_integration_tests=]_defopt)
10867m4_undefine([_defopt])
10868AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10869	[test "x$enable_integration_tests" != xno])
10870AC_MSG_CHECKING([whether to build unit test cases])
10871AC_MSG_RESULT([$enable_integration_tests])
10872]) # XORG_ENABLE_INTEGRATION_TESTS
10873
10874# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10875# ----------------------------------------
10876# Minimum version: 1.13.0
10877#
10878# GLib is a library which provides advanced data structures and functions.
10879# This macro enables a module to test for the presence of Glib.
10880#
10881# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10882# Otherwise the value of $enable_unit_tests is blank.
10883#
10884# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10885# test support usually requires less dependencies and may be built and run under
10886# less stringent environments than integration tests.
10887#
10888# Interface to module:
10889# HAVE_GLIB: used in makefiles to conditionally build targets
10890# with_glib: used in configure.ac to know if GLib has been found
10891# --with-glib:	'yes' user instructs the module to use glib
10892#		'no' user instructs the module not to use glib
10893#
10894AC_DEFUN([XORG_WITH_GLIB],[
10895AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10896m4_define([_defopt], m4_default([$2], [auto]))
10897AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10898	[Use GLib library for unit testing (default: ]_defopt[)]),
10899	[with_glib=$withval], [with_glib=]_defopt)
10900m4_undefine([_defopt])
10901
10902have_glib=no
10903# Do not probe GLib if user explicitly disabled unit testing
10904if test "x$enable_unit_tests" != x"no"; then
10905  # Do not probe GLib if user explicitly disabled it
10906  if test "x$with_glib" != x"no"; then
10907    m4_ifval(
10908      [$1],
10909      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10910      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10911    )
10912  fi
10913fi
10914
10915# Not having GLib when unit testing has been explicitly requested is an error
10916if test "x$enable_unit_tests" = x"yes"; then
10917  if test "x$have_glib" = x"no"; then
10918    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10919  fi
10920fi
10921
10922# Having unit testing disabled when GLib has been explicitly requested is an error
10923if test "x$enable_unit_tests" = x"no"; then
10924  if test "x$with_glib" = x"yes"; then
10925    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10926  fi
10927fi
10928
10929# Not having GLib when it has been explicitly requested is an error
10930if test "x$with_glib" = x"yes"; then
10931  if test "x$have_glib" = x"no"; then
10932    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10933  fi
10934fi
10935
10936AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10937]) # XORG_WITH_GLIB
10938
10939# XORG_LD_WRAP([required|optional])
10940# ---------------------------------
10941# Minimum version: 1.13.0
10942#
10943# Check if linker supports -wrap, passed via compiler flags
10944#
10945# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10946# Otherwise the value of $enable_unit_tests is blank.
10947#
10948# Argument added in 1.16.0 - default is "required", to match existing behavior
10949# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10950# available, an argument of "optional" allows use when some unit tests require
10951# ld -wrap and others do not.
10952#
10953AC_DEFUN([XORG_LD_WRAP],[
10954XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10955    [AC_LANG_PROGRAM([#include <stdlib.h>
10956                      void __wrap_exit(int status) { return; }],
10957                     [exit(0);])])
10958# Not having ld wrap when unit testing has been explicitly requested is an error
10959if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10960  if test "x$have_ld_wrap" = x"no"; then
10961    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10962  fi
10963fi
10964AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10965#
10966]) # XORG_LD_WRAP
10967
10968# XORG_CHECK_LINKER_FLAGS
10969# -----------------------
10970# SYNOPSIS
10971#
10972#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10973#
10974# DESCRIPTION
10975#
10976#   Check whether the given linker FLAGS work with the current language's
10977#   linker, or whether they give an error.
10978#
10979#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10980#   success/failure.
10981#
10982#   PROGRAM-SOURCE is the program source to link with, if needed
10983#
10984#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10985#
10986# LICENSE
10987#
10988#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10989#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10990#   Copyright (c) 2009 Matteo Frigo
10991#
10992#   This program is free software: you can redistribute it and/or modify it
10993#   under the terms of the GNU General Public License as published by the
10994#   Free Software Foundation, either version 3 of the License, or (at your
10995#   option) any later version.
10996#
10997#   This program is distributed in the hope that it will be useful, but
10998#   WITHOUT ANY WARRANTY; without even the implied warranty of
10999#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11000#   Public License for more details.
11001#
11002#   You should have received a copy of the GNU General Public License along
11003#   with this program. If not, see <http://www.gnu.org/licenses/>.
11004#
11005#   As a special exception, the respective Autoconf Macro's copyright owner
11006#   gives unlimited permission to copy, distribute and modify the configure
11007#   scripts that are the output of Autoconf when processing the Macro. You
11008#   need not follow the terms of the GNU General Public License when using
11009#   or distributing such scripts, even though portions of the text of the
11010#   Macro appear in them. The GNU General Public License (GPL) does govern
11011#   all other use of the material that constitutes the Autoconf Macro.
11012#
11013#   This special exception to the GPL applies to versions of the Autoconf
11014#   Macro released by the Autoconf Archive. When you make and distribute a
11015#   modified version of the Autoconf Macro, you may extend this special
11016#   exception to the GPL to apply to your modified version as well.#
11017AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11018[AC_MSG_CHECKING([whether the linker accepts $1])
11019dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11020AS_LITERAL_IF([$1],
11021  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11022      ax_save_FLAGS=$LDFLAGS
11023      LDFLAGS="$1"
11024      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11025        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11026        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11027      LDFLAGS=$ax_save_FLAGS])],
11028  [ax_save_FLAGS=$LDFLAGS
11029   LDFLAGS="$1"
11030   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11031     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11032     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11033   LDFLAGS=$ax_save_FLAGS])
11034eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11035AC_MSG_RESULT($xorg_check_linker_flags)
11036if test "x$xorg_check_linker_flags" = xyes; then
11037	m4_default([$2], :)
11038else
11039	m4_default([$3], :)
11040fi
11041]) # XORG_CHECK_LINKER_FLAGS
11042
11043# XORG_MEMORY_CHECK_FLAGS
11044# -----------------------
11045# Minimum version: 1.16.0
11046#
11047# This macro attempts to find appropriate memory checking functionality
11048# for various platforms which unit testing code may use to catch various
11049# forms of memory allocation and access errors in testing.
11050#
11051# Interface to module:
11052# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11053#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11054#
11055# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11056#
11057AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11058
11059AC_REQUIRE([AC_CANONICAL_HOST])
11060AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11061           [Environment variables to enable memory checking in tests])
11062
11063# Check for different types of support on different platforms
11064case $host_os in
11065    solaris*)
11066        AC_CHECK_LIB([umem], [umem_alloc],
11067            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11068        ;;
11069    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11070        # both directly and inverted, so should not be 0 or 255.
11071        malloc_debug_env='MALLOC_PERTURB_=15'
11072        ;;
11073    darwin*)
11074        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11075        ;;
11076    *bsd*)
11077        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11078        ;;
11079esac
11080
11081# User supplied flags override default flags
11082if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11083    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11084fi
11085
11086AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11087]) # XORG_WITH_LINT
11088
11089# XORG_CHECK_MALLOC_ZERO
11090# ----------------------
11091# Minimum version: 1.0.0
11092#
11093# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11094# malloc(0) returns NULL.  Packages should add one of these cflags to
11095# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11096AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11097AC_ARG_ENABLE(malloc0returnsnull,
11098	AS_HELP_STRING([--enable-malloc0returnsnull],
11099		       [malloc(0) returns NULL (default: auto)]),
11100	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11101	[MALLOC_ZERO_RETURNS_NULL=auto])
11102
11103AC_MSG_CHECKING([whether malloc(0) returns NULL])
11104if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11105	AC_RUN_IFELSE([AC_LANG_PROGRAM([
11106#include <stdlib.h>
11107],[
11108    char *m0, *r0, *c0, *p;
11109    m0 = malloc(0);
11110    p = malloc(10);
11111    r0 = realloc(p,0);
11112    c0 = calloc(0,10);
11113    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11114])],
11115		[MALLOC_ZERO_RETURNS_NULL=yes],
11116		[MALLOC_ZERO_RETURNS_NULL=no],
11117		[MALLOC_ZERO_RETURNS_NULL=yes])
11118fi
11119AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11120
11121if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11122	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11123	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11124	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11125else
11126	MALLOC_ZERO_CFLAGS=""
11127	XMALLOC_ZERO_CFLAGS=""
11128	XTMALLOC_ZERO_CFLAGS=""
11129fi
11130
11131AC_SUBST([MALLOC_ZERO_CFLAGS])
11132AC_SUBST([XMALLOC_ZERO_CFLAGS])
11133AC_SUBST([XTMALLOC_ZERO_CFLAGS])
11134]) # XORG_CHECK_MALLOC_ZERO
11135
11136# XORG_WITH_LINT()
11137# ----------------
11138# Minimum version: 1.1.0
11139#
11140# This macro enables the use of a tool that flags some suspicious and
11141# non-portable constructs (likely to be bugs) in C language source code.
11142# It will attempt to locate the tool and use appropriate options.
11143# There are various lint type tools on different platforms.
11144#
11145# Interface to module:
11146# LINT:		returns the path to the tool found on the platform
11147#		or the value set to LINT on the configure cmd line
11148#		also an Automake conditional
11149# LINT_FLAGS:	an Automake variable with appropriate flags
11150#
11151# --with-lint:	'yes' user instructs the module to use lint
11152#		'no' user instructs the module not to use lint (default)
11153#
11154# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11155# If the user sets the value of LINT_FLAGS, they are used verbatim.
11156#
11157AC_DEFUN([XORG_WITH_LINT],[
11158
11159AC_ARG_VAR([LINT], [Path to a lint-style command])
11160AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11161AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11162		[Use a lint-style source code checker (default: disabled)])],
11163		[use_lint=$withval], [use_lint=no])
11164
11165# Obtain platform specific info like program name and options
11166# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11167case $host_os in
11168  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11169	lint_name=splint
11170	lint_options="-badflag"
11171	;;
11172  *freebsd* | *netbsd*)
11173	lint_name=lint
11174	lint_options="-u -b"
11175	;;
11176  *solaris*)
11177	lint_name=lint
11178	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11179	;;
11180esac
11181
11182# Test for the presence of the program (either guessed by the code or spelled out by the user)
11183if test "x$use_lint" = x"yes" ; then
11184   AC_PATH_PROG([LINT], [$lint_name])
11185   if test "x$LINT" = "x"; then
11186        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11187   fi
11188elif test "x$use_lint" = x"no" ; then
11189   if test "x$LINT" != "x"; then
11190      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11191   fi
11192else
11193   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11194fi
11195
11196# User supplied flags override default flags
11197if test "x$LINT_FLAGS" != "x"; then
11198   lint_options=$LINT_FLAGS
11199fi
11200
11201AC_SUBST([LINT_FLAGS],[$lint_options])
11202AM_CONDITIONAL(LINT, [test "x$LINT" != x])
11203
11204]) # XORG_WITH_LINT
11205
11206# XORG_LINT_LIBRARY(LIBNAME)
11207# --------------------------
11208# Minimum version: 1.1.0
11209#
11210# Sets up flags for building lint libraries for checking programs that call
11211# functions in the library.
11212#
11213# Interface to module:
11214# LINTLIB		- Automake variable with the name of lint library file to make
11215# MAKE_LINT_LIB		- Automake conditional
11216#
11217# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11218#			  - 'no' user instructs the module not to create a lint library (default)
11219
11220AC_DEFUN([XORG_LINT_LIBRARY],[
11221AC_REQUIRE([XORG_WITH_LINT])
11222AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11223	[Create lint library (default: disabled)])],
11224	[make_lint_lib=$enableval], [make_lint_lib=no])
11225
11226if test "x$make_lint_lib" = x"yes" ; then
11227   LINTLIB=llib-l$1.ln
11228   if test "x$LINT" = "x"; then
11229        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11230   fi
11231elif test "x$make_lint_lib" != x"no" ; then
11232   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11233fi
11234
11235AC_SUBST(LINTLIB)
11236AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11237
11238]) # XORG_LINT_LIBRARY
11239
11240# XORG_COMPILER_BRAND
11241# -------------------
11242# Minimum version: 1.14.0
11243#
11244# Checks for various brands of compilers and sets flags as appropriate:
11245#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11246#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11247#   clang compiler - sets CLANGCC to "yes"
11248#   Intel compiler - sets INTELCC to "yes"
11249#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11250#
11251AC_DEFUN([XORG_COMPILER_BRAND], [
11252AC_LANG_CASE(
11253	[C], [
11254		AC_REQUIRE([AC_PROG_CC_C99])
11255	],
11256	[C++], [
11257		AC_REQUIRE([AC_PROG_CXX])
11258	]
11259)
11260AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11261AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11262AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11263]) # XORG_COMPILER_BRAND
11264
11265# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11266# ---------------
11267# Minimum version: 1.16.0
11268#
11269# Test if the compiler works when passed the given flag as a command line argument.
11270# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11271# next flag in the list until there are no more options.
11272#
11273# Note that this does not guarantee that the compiler supports the flag as some
11274# compilers will simply ignore arguments that they do not understand, but we do
11275# attempt to weed out false positives by using -Werror=unknown-warning-option and
11276# -Werror=unused-command-line-argument
11277#
11278AC_DEFUN([XORG_TESTSET_CFLAG], [
11279m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11280m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11281
11282AC_LANG_COMPILER_REQUIRE
11283
11284AC_LANG_CASE(
11285	[C], [
11286		AC_REQUIRE([AC_PROG_CC_C99])
11287		define([PREFIX], [C])
11288		define([CACHE_PREFIX], [cc])
11289		define([COMPILER], [$CC])
11290	],
11291	[C++], [
11292		define([PREFIX], [CXX])
11293		define([CACHE_PREFIX], [cxx])
11294		define([COMPILER], [$CXX])
11295	]
11296)
11297
11298[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11299
11300if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11301	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11302	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11303			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11304			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11305					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11306					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11307	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11308	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11309fi
11310
11311if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11312	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11313		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11314	fi
11315	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11316	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11317			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11318			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11319					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11320					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11321	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11322	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11323fi
11324
11325found="no"
11326m4_foreach([flag], m4_cdr($@), [
11327	if test $found = "no" ; then
11328		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11329			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11330		fi
11331
11332		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11333			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11334		fi
11335
11336		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11337
11338dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11339		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11340		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11341		AC_CACHE_VAL($cacheid,
11342			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11343					     [eval $cacheid=yes],
11344					     [eval $cacheid=no])])
11345
11346		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11347
11348		eval supported=\$$cacheid
11349		AC_MSG_RESULT([$supported])
11350		if test "$supported" = "yes" ; then
11351			$1="$$1 ]flag["
11352			found="yes"
11353		fi
11354	fi
11355])
11356]) # XORG_TESTSET_CFLAG
11357
11358# XORG_COMPILER_FLAGS
11359# ---------------
11360# Minimum version: 1.16.0
11361#
11362# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11363# arguments supported by the selected compiler which do NOT alter the generated
11364# code.  These arguments will cause the compiler to print various warnings
11365# during compilation AND turn a conservative set of warnings into errors.
11366#
11367# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11368# future versions of util-macros as options are added to new compilers.
11369#
11370AC_DEFUN([XORG_COMPILER_FLAGS], [
11371AC_REQUIRE([XORG_COMPILER_BRAND])
11372
11373AC_ARG_ENABLE(selective-werror,
11374              AS_HELP_STRING([--disable-selective-werror],
11375                             [Turn off selective compiler errors. (default: enabled)]),
11376              [SELECTIVE_WERROR=$enableval],
11377              [SELECTIVE_WERROR=yes])
11378
11379AC_LANG_CASE(
11380        [C], [
11381                define([PREFIX], [C])
11382        ],
11383        [C++], [
11384                define([PREFIX], [CXX])
11385        ]
11386)
11387# -v is too short to test reliably with XORG_TESTSET_CFLAG
11388if test "x$SUNCC" = "xyes"; then
11389    [BASE_]PREFIX[FLAGS]="-v"
11390else
11391    [BASE_]PREFIX[FLAGS]=""
11392fi
11393
11394# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11395XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11396XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11397XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11398XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11399
11400AC_LANG_CASE(
11401	[C], [
11402		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11403		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11404		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11405		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11406		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11407		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11408	]
11409)
11410
11411# This chunk adds additional warnings that could catch undesired effects.
11412XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11413XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11414XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11415XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11416XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11417XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11418XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11419
11420# These are currently disabled because they are noisy.  They will be enabled
11421# in the future once the codebase is sufficiently modernized to silence
11422# them.  For now, I don't want them to drown out the other warnings.
11423# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11424# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11425# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11426
11427# Turn some warnings into errors, so we don't accidently get successful builds
11428# when there are problems that should be fixed.
11429
11430if test "x$SELECTIVE_WERROR" = "xyes" ; then
11431XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11432XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11433XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11434XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11435XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11436XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11437XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11438XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11439XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11440XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11441XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11442XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11443XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11444else
11445AC_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])
11446XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11447XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11448XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11449XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11450XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11451XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11452XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11453XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11454XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11455XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11456XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11457XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11458XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11459fi
11460
11461AC_SUBST([BASE_]PREFIX[FLAGS])
11462]) # XORG_COMPILER_FLAGS
11463
11464# XORG_CWARNFLAGS
11465# ---------------
11466# Minimum version: 1.2.0
11467# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11468#
11469# Defines CWARNFLAGS to enable C compiler warnings.
11470#
11471# This function is deprecated because it defines -fno-strict-aliasing
11472# which alters the code generated by the compiler.  If -fno-strict-aliasing
11473# is needed, then it should be added explicitly in the module when
11474# it is updated to use BASE_CFLAGS.
11475#
11476AC_DEFUN([XORG_CWARNFLAGS], [
11477AC_REQUIRE([XORG_COMPILER_FLAGS])
11478AC_REQUIRE([XORG_COMPILER_BRAND])
11479AC_LANG_CASE(
11480	[C], [
11481		CWARNFLAGS="$BASE_CFLAGS"
11482		if  test "x$GCC" = xyes ; then
11483		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11484		fi
11485		AC_SUBST(CWARNFLAGS)
11486	]
11487)
11488]) # XORG_CWARNFLAGS
11489
11490# XORG_STRICT_OPTION
11491# -----------------------
11492# Minimum version: 1.3.0
11493#
11494# Add configure option to enable strict compilation flags, such as treating
11495# warnings as fatal errors.
11496# If --enable-strict-compilation is passed to configure, adds strict flags to
11497# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11498#
11499# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11500# when strict compilation is unconditionally desired.
11501AC_DEFUN([XORG_STRICT_OPTION], [
11502AC_REQUIRE([XORG_CWARNFLAGS])
11503AC_REQUIRE([XORG_COMPILER_FLAGS])
11504
11505AC_ARG_ENABLE(strict-compilation,
11506			  AS_HELP_STRING([--enable-strict-compilation],
11507			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11508			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11509
11510AC_LANG_CASE(
11511        [C], [
11512                define([PREFIX], [C])
11513        ],
11514        [C++], [
11515                define([PREFIX], [CXX])
11516        ]
11517)
11518
11519[STRICT_]PREFIX[FLAGS]=""
11520XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11521XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11522
11523# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11524# activate it with -Werror, so we add it here explicitly.
11525XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11526
11527if test "x$STRICT_COMPILE" = "xyes"; then
11528    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11529    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11530fi
11531AC_SUBST([STRICT_]PREFIX[FLAGS])
11532AC_SUBST([BASE_]PREFIX[FLAGS])
11533AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11534]) # XORG_STRICT_OPTION
11535
11536# XORG_DEFAULT_OPTIONS
11537# --------------------
11538# Minimum version: 1.3.0
11539#
11540# Defines default options for X.Org modules.
11541#
11542AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11543AC_REQUIRE([AC_PROG_INSTALL])
11544XORG_COMPILER_FLAGS
11545XORG_CWARNFLAGS
11546XORG_STRICT_OPTION
11547XORG_RELEASE_VERSION
11548XORG_CHANGELOG
11549XORG_INSTALL
11550XORG_MANPAGE_SECTIONS
11551m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11552    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11553]) # XORG_DEFAULT_OPTIONS
11554
11555# XORG_INSTALL()
11556# ----------------
11557# Minimum version: 1.4.0
11558#
11559# Defines the variable INSTALL_CMD as the command to copy
11560# INSTALL from $prefix/share/util-macros.
11561#
11562AC_DEFUN([XORG_INSTALL], [
11563AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11564macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11565INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11566mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11567|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11568echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11569AC_SUBST([INSTALL_CMD])
11570]) # XORG_INSTALL
11571dnl Copyright 2005 Red Hat, Inc
11572dnl
11573dnl Permission to use, copy, modify, distribute, and sell this software and its
11574dnl documentation for any purpose is hereby granted without fee, provided that
11575dnl the above copyright notice appear in all copies and that both that
11576dnl copyright notice and this permission notice appear in supporting
11577dnl documentation.
11578dnl
11579dnl The above copyright notice and this permission notice shall be included
11580dnl in all copies or substantial portions of the Software.
11581dnl
11582dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11583dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11584dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11585dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11586dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11587dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11588dnl OTHER DEALINGS IN THE SOFTWARE.
11589dnl
11590dnl Except as contained in this notice, the name of the copyright holders shall
11591dnl not be used in advertising or otherwise to promote the sale, use or
11592dnl other dealings in this Software without prior written authorization
11593dnl from the copyright holders.
11594dnl
11595
11596# XORG_RELEASE_VERSION
11597# --------------------
11598# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11599 
11600AC_DEFUN([XORG_RELEASE_VERSION],[
11601	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11602		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11603		[Major version of this package])
11604	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11605	if test "x$PVM" = "x"; then
11606		PVM="0"
11607	fi
11608	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11609		[$PVM],
11610		[Minor version of this package])
11611	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11612	if test "x$PVP" = "x"; then
11613		PVP="0"
11614	fi
11615	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11616		[$PVP],
11617		[Patch version of this package])
11618])
11619
11620# XORG_CHANGELOG()
11621# ----------------
11622# Minimum version: 1.2.0
11623#
11624# Defines the variable CHANGELOG_CMD as the command to generate
11625# ChangeLog from git.
11626#
11627#
11628AC_DEFUN([XORG_CHANGELOG], [
11629CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11630mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11631|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11632echo 'git directory not found: installing possibly empty changelog.' >&2)"
11633AC_SUBST([CHANGELOG_CMD])
11634]) # XORG_CHANGELOG
11635
11636