aclocal.m4 revision fe4c343a
1# generated automatically by aclocal 1.15 -*- Autoconf -*-
2
3# Copyright (C) 1996-2014 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.69],,
18[m4_warning([this file was generated for autoconf 2.69.
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-2014 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.15'
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.15], [],
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.15])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-2014 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[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
107# Expand $ac_aux_dir to an absolute path.
108am_aux_dir=`cd "$ac_aux_dir" && pwd`
109])
110
111# AM_CONDITIONAL                                            -*- Autoconf -*-
112
113# Copyright (C) 1997-2014 Free Software Foundation, Inc.
114#
115# This file is free software; the Free Software Foundation
116# gives unlimited permission to copy and/or distribute it,
117# with or without modifications, as long as this notice is preserved.
118
119# AM_CONDITIONAL(NAME, SHELL-CONDITION)
120# -------------------------------------
121# Define a conditional.
122AC_DEFUN([AM_CONDITIONAL],
123[AC_PREREQ([2.52])dnl
124 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
125       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
126AC_SUBST([$1_TRUE])dnl
127AC_SUBST([$1_FALSE])dnl
128_AM_SUBST_NOTMAKE([$1_TRUE])dnl
129_AM_SUBST_NOTMAKE([$1_FALSE])dnl
130m4_define([_AM_COND_VALUE_$1], [$2])dnl
131if $2; then
132  $1_TRUE=
133  $1_FALSE='#'
134else
135  $1_TRUE='#'
136  $1_FALSE=
137fi
138AC_CONFIG_COMMANDS_PRE(
139[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
140  AC_MSG_ERROR([[conditional "$1" was never defined.
141Usually this means the macro was only invoked conditionally.]])
142fi])])
143
144# Copyright (C) 1999-2014 Free Software Foundation, Inc.
145#
146# This file is free software; the Free Software Foundation
147# gives unlimited permission to copy and/or distribute it,
148# with or without modifications, as long as this notice is preserved.
149
150
151# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
152# written in clear, in which case automake, when reading aclocal.m4,
153# will think it sees a *use*, and therefore will trigger all it's
154# C support machinery.  Also note that it means that autoscan, seeing
155# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
156
157
158# _AM_DEPENDENCIES(NAME)
159# ----------------------
160# See how the compiler implements dependency checking.
161# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
162# We try a few techniques and use that to set a single cache variable.
163#
164# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
165# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
166# dependency, and given that the user is not expected to run this macro,
167# just rely on AC_PROG_CC.
168AC_DEFUN([_AM_DEPENDENCIES],
169[AC_REQUIRE([AM_SET_DEPDIR])dnl
170AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
171AC_REQUIRE([AM_MAKE_INCLUDE])dnl
172AC_REQUIRE([AM_DEP_TRACK])dnl
173
174m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
175      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
176      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
177      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
178      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
179      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
180                    [depcc="$$1"   am_compiler_list=])
181
182AC_CACHE_CHECK([dependency style of $depcc],
183               [am_cv_$1_dependencies_compiler_type],
184[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
185  # We make a subdir and do the tests there.  Otherwise we can end up
186  # making bogus files that we don't know about and never remove.  For
187  # instance it was reported that on HP-UX the gcc test will end up
188  # making a dummy file named 'D' -- because '-MD' means "put the output
189  # in D".
190  rm -rf conftest.dir
191  mkdir conftest.dir
192  # Copy depcomp to subdir because otherwise we won't find it if we're
193  # using a relative directory.
194  cp "$am_depcomp" conftest.dir
195  cd conftest.dir
196  # We will build objects and dependencies in a subdirectory because
197  # it helps to detect inapplicable dependency modes.  For instance
198  # both Tru64's cc and ICC support -MD to output dependencies as a
199  # side effect of compilation, but ICC will put the dependencies in
200  # the current directory while Tru64 will put them in the object
201  # directory.
202  mkdir sub
203
204  am_cv_$1_dependencies_compiler_type=none
205  if test "$am_compiler_list" = ""; then
206     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
207  fi
208  am__universal=false
209  m4_case([$1], [CC],
210    [case " $depcc " in #(
211     *\ -arch\ *\ -arch\ *) am__universal=true ;;
212     esac],
213    [CXX],
214    [case " $depcc " in #(
215     *\ -arch\ *\ -arch\ *) am__universal=true ;;
216     esac])
217
218  for depmode in $am_compiler_list; do
219    # Setup a source with many dependencies, because some compilers
220    # like to wrap large dependency lists on column 80 (with \), and
221    # we should not choose a depcomp mode which is confused by this.
222    #
223    # We need to recreate these files for each test, as the compiler may
224    # overwrite some of them when testing with obscure command lines.
225    # This happens at least with the AIX C compiler.
226    : > sub/conftest.c
227    for i in 1 2 3 4 5 6; do
228      echo '#include "conftst'$i'.h"' >> sub/conftest.c
229      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
230      # Solaris 10 /bin/sh.
231      echo '/* dummy */' > sub/conftst$i.h
232    done
233    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
234
235    # We check with '-c' and '-o' for the sake of the "dashmstdout"
236    # mode.  It turns out that the SunPro C++ compiler does not properly
237    # handle '-M -o', and we need to detect this.  Also, some Intel
238    # versions had trouble with output in subdirs.
239    am__obj=sub/conftest.${OBJEXT-o}
240    am__minus_obj="-o $am__obj"
241    case $depmode in
242    gcc)
243      # This depmode causes a compiler race in universal mode.
244      test "$am__universal" = false || continue
245      ;;
246    nosideeffect)
247      # After this tag, mechanisms are not by side-effect, so they'll
248      # only be used when explicitly requested.
249      if test "x$enable_dependency_tracking" = xyes; then
250	continue
251      else
252	break
253      fi
254      ;;
255    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
256      # This compiler won't grok '-c -o', but also, the minuso test has
257      # not run yet.  These depmodes are late enough in the game, and
258      # so weak that their functioning should not be impacted.
259      am__obj=conftest.${OBJEXT-o}
260      am__minus_obj=
261      ;;
262    none) break ;;
263    esac
264    if depmode=$depmode \
265       source=sub/conftest.c object=$am__obj \
266       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
267       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
268         >/dev/null 2>conftest.err &&
269       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
270       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
271       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
272       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
273      # icc doesn't choke on unknown options, it will just issue warnings
274      # or remarks (even with -Werror).  So we grep stderr for any message
275      # that says an option was ignored or not supported.
276      # When given -MP, icc 7.0 and 7.1 complain thusly:
277      #   icc: Command line warning: ignoring option '-M'; no argument required
278      # The diagnosis changed in icc 8.0:
279      #   icc: Command line remark: option '-MP' not supported
280      if (grep 'ignoring option' conftest.err ||
281          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
282        am_cv_$1_dependencies_compiler_type=$depmode
283        break
284      fi
285    fi
286  done
287
288  cd ..
289  rm -rf conftest.dir
290else
291  am_cv_$1_dependencies_compiler_type=none
292fi
293])
294AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
295AM_CONDITIONAL([am__fastdep$1], [
296  test "x$enable_dependency_tracking" != xno \
297  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
298])
299
300
301# AM_SET_DEPDIR
302# -------------
303# Choose a directory name for dependency files.
304# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
305AC_DEFUN([AM_SET_DEPDIR],
306[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
307AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
308])
309
310
311# AM_DEP_TRACK
312# ------------
313AC_DEFUN([AM_DEP_TRACK],
314[AC_ARG_ENABLE([dependency-tracking], [dnl
315AS_HELP_STRING(
316  [--enable-dependency-tracking],
317  [do not reject slow dependency extractors])
318AS_HELP_STRING(
319  [--disable-dependency-tracking],
320  [speeds up one-time build])])
321if test "x$enable_dependency_tracking" != xno; then
322  am_depcomp="$ac_aux_dir/depcomp"
323  AMDEPBACKSLASH='\'
324  am__nodep='_no'
325fi
326AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
327AC_SUBST([AMDEPBACKSLASH])dnl
328_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
329AC_SUBST([am__nodep])dnl
330_AM_SUBST_NOTMAKE([am__nodep])dnl
331])
332
333# Generate code to set up dependency tracking.              -*- Autoconf -*-
334
335# Copyright (C) 1999-2014 Free Software Foundation, Inc.
336#
337# This file is free software; the Free Software Foundation
338# gives unlimited permission to copy and/or distribute it,
339# with or without modifications, as long as this notice is preserved.
340
341
342# _AM_OUTPUT_DEPENDENCY_COMMANDS
343# ------------------------------
344AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
345[{
346  # Older Autoconf quotes --file arguments for eval, but not when files
347  # are listed without --file.  Let's play safe and only enable the eval
348  # if we detect the quoting.
349  case $CONFIG_FILES in
350  *\'*) eval set x "$CONFIG_FILES" ;;
351  *)   set x $CONFIG_FILES ;;
352  esac
353  shift
354  for mf
355  do
356    # Strip MF so we end up with the name of the file.
357    mf=`echo "$mf" | sed -e 's/:.*$//'`
358    # Check whether this is an Automake generated Makefile or not.
359    # We used to match only the files named 'Makefile.in', but
360    # some people rename them; so instead we look at the file content.
361    # Grep'ing the first line is not enough: some people post-process
362    # each Makefile.in and add a new line on top of each file to say so.
363    # Grep'ing the whole file is not good either: AIX grep has a line
364    # limit of 2048, but all sed's we know have understand at least 4000.
365    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
366      dirpart=`AS_DIRNAME("$mf")`
367    else
368      continue
369    fi
370    # Extract the definition of DEPDIR, am__include, and am__quote
371    # from the Makefile without running 'make'.
372    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
373    test -z "$DEPDIR" && continue
374    am__include=`sed -n 's/^am__include = //p' < "$mf"`
375    test -z "$am__include" && continue
376    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
377    # Find all dependency output files, they are included files with
378    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379    # simplest approach to changing $(DEPDIR) to its actual value in the
380    # expansion.
381    for file in `sed -n "
382      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
384      # Make sure the directory exists.
385      test -f "$dirpart/$file" && continue
386      fdir=`AS_DIRNAME(["$file"])`
387      AS_MKDIR_P([$dirpart/$fdir])
388      # echo "creating $dirpart/$file"
389      echo '# dummy' > "$dirpart/$file"
390    done
391  done
392}
393])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394
395
396# AM_OUTPUT_DEPENDENCY_COMMANDS
397# -----------------------------
398# This macro should only be invoked once -- use via AC_REQUIRE.
399#
400# This code is only required when automatic dependency tracking
401# is enabled.  FIXME.  This creates each '.P' file that we will
402# need in order to bootstrap the dependency handling code.
403AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404[AC_CONFIG_COMMANDS([depfiles],
405     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407])
408
409# Do all the work for Automake.                             -*- Autoconf -*-
410
411# Copyright (C) 1996-2014 Free Software Foundation, Inc.
412#
413# This file is free software; the Free Software Foundation
414# gives unlimited permission to copy and/or distribute it,
415# with or without modifications, as long as this notice is preserved.
416
417# This macro actually does too much.  Some checks are only needed if
418# your package does certain things.  But this isn't really a big deal.
419
420dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
421m4_define([AC_PROG_CC],
422m4_defn([AC_PROG_CC])
423[_AM_PROG_CC_C_O
424])
425
426# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
427# AM_INIT_AUTOMAKE([OPTIONS])
428# -----------------------------------------------
429# The call with PACKAGE and VERSION arguments is the old style
430# call (pre autoconf-2.50), which is being phased out.  PACKAGE
431# and VERSION should now be passed to AC_INIT and removed from
432# the call to AM_INIT_AUTOMAKE.
433# We support both call styles for the transition.  After
434# the next Automake release, Autoconf can make the AC_INIT
435# arguments mandatory, and then we can depend on a new Autoconf
436# release and drop the old call support.
437AC_DEFUN([AM_INIT_AUTOMAKE],
438[AC_PREREQ([2.65])dnl
439dnl Autoconf wants to disallow AM_ names.  We explicitly allow
440dnl the ones we care about.
441m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
442AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
443AC_REQUIRE([AC_PROG_INSTALL])dnl
444if test "`cd $srcdir && pwd`" != "`pwd`"; then
445  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
446  # is not polluted with repeated "-I."
447  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
448  # test to see if srcdir already configured
449  if test -f $srcdir/config.status; then
450    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
451  fi
452fi
453
454# test whether we have cygpath
455if test -z "$CYGPATH_W"; then
456  if (cygpath --version) >/dev/null 2>/dev/null; then
457    CYGPATH_W='cygpath -w'
458  else
459    CYGPATH_W=echo
460  fi
461fi
462AC_SUBST([CYGPATH_W])
463
464# Define the identity of the package.
465dnl Distinguish between old-style and new-style calls.
466m4_ifval([$2],
467[AC_DIAGNOSE([obsolete],
468             [$0: two- and three-arguments forms are deprecated.])
469m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
470 AC_SUBST([PACKAGE], [$1])dnl
471 AC_SUBST([VERSION], [$2])],
472[_AM_SET_OPTIONS([$1])dnl
473dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
474m4_if(
475  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
476  [ok:ok],,
477  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
478 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
479 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
480
481_AM_IF_OPTION([no-define],,
482[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
483 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
484
485# Some tools Automake needs.
486AC_REQUIRE([AM_SANITY_CHECK])dnl
487AC_REQUIRE([AC_ARG_PROGRAM])dnl
488AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
489AM_MISSING_PROG([AUTOCONF], [autoconf])
490AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
491AM_MISSING_PROG([AUTOHEADER], [autoheader])
492AM_MISSING_PROG([MAKEINFO], [makeinfo])
493AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
494AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
495AC_REQUIRE([AC_PROG_MKDIR_P])dnl
496# For better backward compatibility.  To be removed once Automake 1.9.x
497# dies out for good.  For more background, see:
498# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
499# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
500AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
501# We need awk for the "check" target (and possibly the TAP driver).  The
502# system "awk" is bad on some platforms.
503AC_REQUIRE([AC_PROG_AWK])dnl
504AC_REQUIRE([AC_PROG_MAKE_SET])dnl
505AC_REQUIRE([AM_SET_LEADING_DOT])dnl
506_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508			     [_AM_PROG_TAR([v7])])])
509_AM_IF_OPTION([no-dependencies],,
510[AC_PROVIDE_IFELSE([AC_PROG_CC],
511		  [_AM_DEPENDENCIES([CC])],
512		  [m4_define([AC_PROG_CC],
513			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
514AC_PROVIDE_IFELSE([AC_PROG_CXX],
515		  [_AM_DEPENDENCIES([CXX])],
516		  [m4_define([AC_PROG_CXX],
517			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
518AC_PROVIDE_IFELSE([AC_PROG_OBJC],
519		  [_AM_DEPENDENCIES([OBJC])],
520		  [m4_define([AC_PROG_OBJC],
521			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
522AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
523		  [_AM_DEPENDENCIES([OBJCXX])],
524		  [m4_define([AC_PROG_OBJCXX],
525			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
526])
527AC_REQUIRE([AM_SILENT_RULES])dnl
528dnl The testsuite driver may need to know about EXEEXT, so add the
529dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
530dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
531AC_CONFIG_COMMANDS_PRE(dnl
532[m4_provide_if([_AM_COMPILER_EXEEXT],
533  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
534
535# POSIX will say in a future version that running "rm -f" with no argument
536# is OK; and we want to be able to make that assumption in our Makefile
537# recipes.  So use an aggressive probe to check that the usage we want is
538# actually supported "in the wild" to an acceptable degree.
539# See automake bug#10828.
540# To make any issue more visible, cause the running configure to be aborted
541# by default if the 'rm' program in use doesn't match our expectations; the
542# user can still override this though.
543if rm -f && rm -fr && rm -rf; then : OK; else
544  cat >&2 <<'END'
545Oops!
546
547Your 'rm' program seems unable to run without file operands specified
548on the command line, even when the '-f' option is present.  This is contrary
549to the behaviour of most rm programs out there, and not conforming with
550the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
551
552Please tell bug-automake@gnu.org about your system, including the value
553of your $PATH and any error possibly output before this message.  This
554can help us improve future automake versions.
555
556END
557  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
558    echo 'Configuration will proceed anyway, since you have set the' >&2
559    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
560    echo >&2
561  else
562    cat >&2 <<'END'
563Aborting the configuration process, to ensure you take notice of the issue.
564
565You can download and install GNU coreutils to get an 'rm' implementation
566that behaves properly: <http://www.gnu.org/software/coreutils/>.
567
568If you want to complete the configuration process using your problematic
569'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
570to "yes", and re-run configure.
571
572END
573    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
574  fi
575fi
576dnl The trailing newline in this macro's definition is deliberate, for
577dnl backward compatibility and to allow trailing 'dnl'-style comments
578dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
579])
580
581dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
582dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
583dnl mangled by Autoconf and run in a shell conditional statement.
584m4_define([_AC_COMPILER_EXEEXT],
585m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
586
587# When config.status generates a header, we must update the stamp-h file.
588# This file resides in the same directory as the config header
589# that is generated.  The stamp files are numbered to have different names.
590
591# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
592# loop where config.status creates the headers, so we can generate
593# our stamp files there.
594AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
595[# Compute $1's index in $config_headers.
596_am_arg=$1
597_am_stamp_count=1
598for _am_header in $config_headers :; do
599  case $_am_header in
600    $_am_arg | $_am_arg:* )
601      break ;;
602    * )
603      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
604  esac
605done
606echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
607
608# Copyright (C) 2001-2014 Free Software Foundation, Inc.
609#
610# This file is free software; the Free Software Foundation
611# gives unlimited permission to copy and/or distribute it,
612# with or without modifications, as long as this notice is preserved.
613
614# AM_PROG_INSTALL_SH
615# ------------------
616# Define $install_sh.
617AC_DEFUN([AM_PROG_INSTALL_SH],
618[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
619if test x"${install_sh+set}" != xset; then
620  case $am_aux_dir in
621  *\ * | *\	*)
622    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
623  *)
624    install_sh="\${SHELL} $am_aux_dir/install-sh"
625  esac
626fi
627AC_SUBST([install_sh])])
628
629# Copyright (C) 2003-2014 Free Software Foundation, Inc.
630#
631# This file is free software; the Free Software Foundation
632# gives unlimited permission to copy and/or distribute it,
633# with or without modifications, as long as this notice is preserved.
634
635# Check whether the underlying file-system supports filenames
636# with a leading dot.  For instance MS-DOS doesn't.
637AC_DEFUN([AM_SET_LEADING_DOT],
638[rm -rf .tst 2>/dev/null
639mkdir .tst 2>/dev/null
640if test -d .tst; then
641  am__leading_dot=.
642else
643  am__leading_dot=_
644fi
645rmdir .tst 2>/dev/null
646AC_SUBST([am__leading_dot])])
647
648# Check to see how 'make' treats includes.	            -*- Autoconf -*-
649
650# Copyright (C) 2001-2014 Free Software Foundation, Inc.
651#
652# This file is free software; the Free Software Foundation
653# gives unlimited permission to copy and/or distribute it,
654# with or without modifications, as long as this notice is preserved.
655
656# AM_MAKE_INCLUDE()
657# -----------------
658# Check to see how make treats includes.
659AC_DEFUN([AM_MAKE_INCLUDE],
660[am_make=${MAKE-make}
661cat > confinc << 'END'
662am__doit:
663	@echo this is the am__doit target
664.PHONY: am__doit
665END
666# If we don't find an include directive, just comment out the code.
667AC_MSG_CHECKING([for style of include used by $am_make])
668am__include="#"
669am__quote=
670_am_result=none
671# First try GNU make style include.
672echo "include confinc" > confmf
673# Ignore all kinds of additional output from 'make'.
674case `$am_make -s -f confmf 2> /dev/null` in #(
675*the\ am__doit\ target*)
676  am__include=include
677  am__quote=
678  _am_result=GNU
679  ;;
680esac
681# Now try BSD make style include.
682if test "$am__include" = "#"; then
683   echo '.include "confinc"' > confmf
684   case `$am_make -s -f confmf 2> /dev/null` in #(
685   *the\ am__doit\ target*)
686     am__include=.include
687     am__quote="\""
688     _am_result=BSD
689     ;;
690   esac
691fi
692AC_SUBST([am__include])
693AC_SUBST([am__quote])
694AC_MSG_RESULT([$_am_result])
695rm -f confinc confmf
696])
697
698# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
699
700# Copyright (C) 1997-2014 Free Software Foundation, Inc.
701#
702# This file is free software; the Free Software Foundation
703# gives unlimited permission to copy and/or distribute it,
704# with or without modifications, as long as this notice is preserved.
705
706# AM_MISSING_PROG(NAME, PROGRAM)
707# ------------------------------
708AC_DEFUN([AM_MISSING_PROG],
709[AC_REQUIRE([AM_MISSING_HAS_RUN])
710$1=${$1-"${am_missing_run}$2"}
711AC_SUBST($1)])
712
713# AM_MISSING_HAS_RUN
714# ------------------
715# Define MISSING if not defined so far and test if it is modern enough.
716# If it is, set am_missing_run to use it, otherwise, to nothing.
717AC_DEFUN([AM_MISSING_HAS_RUN],
718[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719AC_REQUIRE_AUX_FILE([missing])dnl
720if test x"${MISSING+set}" != xset; then
721  case $am_aux_dir in
722  *\ * | *\	*)
723    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724  *)
725    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726  esac
727fi
728# Use eval to expand $SHELL
729if eval "$MISSING --is-lightweight"; then
730  am_missing_run="$MISSING "
731else
732  am_missing_run=
733  AC_MSG_WARN(['missing' script is too old or missing])
734fi
735])
736
737# Helper functions for option handling.                     -*- Autoconf -*-
738
739# Copyright (C) 2001-2014 Free Software Foundation, Inc.
740#
741# This file is free software; the Free Software Foundation
742# gives unlimited permission to copy and/or distribute it,
743# with or without modifications, as long as this notice is preserved.
744
745# _AM_MANGLE_OPTION(NAME)
746# -----------------------
747AC_DEFUN([_AM_MANGLE_OPTION],
748[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
749
750# _AM_SET_OPTION(NAME)
751# --------------------
752# Set option NAME.  Presently that only means defining a flag for this option.
753AC_DEFUN([_AM_SET_OPTION],
754[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
755
756# _AM_SET_OPTIONS(OPTIONS)
757# ------------------------
758# OPTIONS is a space-separated list of Automake options.
759AC_DEFUN([_AM_SET_OPTIONS],
760[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
761
762# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
763# -------------------------------------------
764# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
765AC_DEFUN([_AM_IF_OPTION],
766[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
767
768# Copyright (C) 1999-2014 Free Software Foundation, Inc.
769#
770# This file is free software; the Free Software Foundation
771# gives unlimited permission to copy and/or distribute it,
772# with or without modifications, as long as this notice is preserved.
773
774# _AM_PROG_CC_C_O
775# ---------------
776# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
777# to automatically call this.
778AC_DEFUN([_AM_PROG_CC_C_O],
779[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
780AC_REQUIRE_AUX_FILE([compile])dnl
781AC_LANG_PUSH([C])dnl
782AC_CACHE_CHECK(
783  [whether $CC understands -c and -o together],
784  [am_cv_prog_cc_c_o],
785  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
786  # Make sure it works both with $CC and with simple cc.
787  # Following AC_PROG_CC_C_O, we do the test twice because some
788  # compilers refuse to overwrite an existing .o file with -o,
789  # though they will create one.
790  am_cv_prog_cc_c_o=yes
791  for am_i in 1 2; do
792    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
793         && test -f conftest2.$ac_objext; then
794      : OK
795    else
796      am_cv_prog_cc_c_o=no
797      break
798    fi
799  done
800  rm -f core conftest*
801  unset am_i])
802if test "$am_cv_prog_cc_c_o" != yes; then
803   # Losing compiler, so override with the script.
804   # FIXME: It is wrong to rewrite CC.
805   # But if we don't then we get into trouble of one sort or another.
806   # A longer-term fix would be to have automake use am__CC in this case,
807   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
808   CC="$am_aux_dir/compile $CC"
809fi
810AC_LANG_POP([C])])
811
812# For backward compatibility.
813AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
814
815# Copyright (C) 2001-2014 Free Software Foundation, Inc.
816#
817# This file is free software; the Free Software Foundation
818# gives unlimited permission to copy and/or distribute it,
819# with or without modifications, as long as this notice is preserved.
820
821# AM_RUN_LOG(COMMAND)
822# -------------------
823# Run COMMAND, save the exit status in ac_status, and log it.
824# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
825AC_DEFUN([AM_RUN_LOG],
826[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
827   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
828   ac_status=$?
829   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
830   (exit $ac_status); }])
831
832# Check to make sure that the build environment is sane.    -*- Autoconf -*-
833
834# Copyright (C) 1996-2014 Free Software Foundation, Inc.
835#
836# This file is free software; the Free Software Foundation
837# gives unlimited permission to copy and/or distribute it,
838# with or without modifications, as long as this notice is preserved.
839
840# AM_SANITY_CHECK
841# ---------------
842AC_DEFUN([AM_SANITY_CHECK],
843[AC_MSG_CHECKING([whether build environment is sane])
844# Reject unsafe characters in $srcdir or the absolute working directory
845# name.  Accept space and tab only in the latter.
846am_lf='
847'
848case `pwd` in
849  *[[\\\"\#\$\&\'\`$am_lf]]*)
850    AC_MSG_ERROR([unsafe absolute working directory name]);;
851esac
852case $srcdir in
853  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
854    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
855esac
856
857# Do 'set' in a subshell so we don't clobber the current shell's
858# arguments.  Must try -L first in case configure is actually a
859# symlink; some systems play weird games with the mod time of symlinks
860# (eg FreeBSD returns the mod time of the symlink's containing
861# directory).
862if (
863   am_has_slept=no
864   for am_try in 1 2; do
865     echo "timestamp, slept: $am_has_slept" > conftest.file
866     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
867     if test "$[*]" = "X"; then
868	# -L didn't work.
869	set X `ls -t "$srcdir/configure" conftest.file`
870     fi
871     if test "$[*]" != "X $srcdir/configure conftest.file" \
872	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
873
874	# If neither matched, then we have a broken ls.  This can happen
875	# if, for instance, CONFIG_SHELL is bash and it inherits a
876	# broken ls alias from the environment.  This has actually
877	# happened.  Such a system could not be considered "sane".
878	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
879  alias in your environment])
880     fi
881     if test "$[2]" = conftest.file || test $am_try -eq 2; then
882       break
883     fi
884     # Just in case.
885     sleep 1
886     am_has_slept=yes
887   done
888   test "$[2]" = conftest.file
889   )
890then
891   # Ok.
892   :
893else
894   AC_MSG_ERROR([newly created file is older than distributed files!
895Check your system clock])
896fi
897AC_MSG_RESULT([yes])
898# If we didn't sleep, we still need to ensure time stamps of config.status and
899# generated files are strictly newer.
900am_sleep_pid=
901if grep 'slept: no' conftest.file >/dev/null 2>&1; then
902  ( sleep 1 ) &
903  am_sleep_pid=$!
904fi
905AC_CONFIG_COMMANDS_PRE(
906  [AC_MSG_CHECKING([that generated files are newer than configure])
907   if test -n "$am_sleep_pid"; then
908     # Hide warnings about reused PIDs.
909     wait $am_sleep_pid 2>/dev/null
910   fi
911   AC_MSG_RESULT([done])])
912rm -f conftest.file
913])
914
915# Copyright (C) 2009-2014 Free Software Foundation, Inc.
916#
917# This file is free software; the Free Software Foundation
918# gives unlimited permission to copy and/or distribute it,
919# with or without modifications, as long as this notice is preserved.
920
921# AM_SILENT_RULES([DEFAULT])
922# --------------------------
923# Enable less verbose build rules; with the default set to DEFAULT
924# ("yes" being less verbose, "no" or empty being verbose).
925AC_DEFUN([AM_SILENT_RULES],
926[AC_ARG_ENABLE([silent-rules], [dnl
927AS_HELP_STRING(
928  [--enable-silent-rules],
929  [less verbose build output (undo: "make V=1")])
930AS_HELP_STRING(
931  [--disable-silent-rules],
932  [verbose build output (undo: "make V=0")])dnl
933])
934case $enable_silent_rules in @%:@ (((
935  yes) AM_DEFAULT_VERBOSITY=0;;
936   no) AM_DEFAULT_VERBOSITY=1;;
937    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
938esac
939dnl
940dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
941dnl do not support nested variable expansions.
942dnl See automake bug#9928 and bug#10237.
943am_make=${MAKE-make}
944AC_CACHE_CHECK([whether $am_make supports nested variables],
945   [am_cv_make_support_nested_variables],
946   [if AS_ECHO([['TRUE=$(BAR$(V))
947BAR0=false
948BAR1=true
949V=1
950am__doit:
951	@$(TRUE)
952.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
953  am_cv_make_support_nested_variables=yes
954else
955  am_cv_make_support_nested_variables=no
956fi])
957if test $am_cv_make_support_nested_variables = yes; then
958  dnl Using '$V' instead of '$(V)' breaks IRIX make.
959  AM_V='$(V)'
960  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
961else
962  AM_V=$AM_DEFAULT_VERBOSITY
963  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
964fi
965AC_SUBST([AM_V])dnl
966AM_SUBST_NOTMAKE([AM_V])dnl
967AC_SUBST([AM_DEFAULT_V])dnl
968AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
969AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
970AM_BACKSLASH='\'
971AC_SUBST([AM_BACKSLASH])dnl
972_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
973])
974
975# Copyright (C) 2001-2014 Free Software Foundation, Inc.
976#
977# This file is free software; the Free Software Foundation
978# gives unlimited permission to copy and/or distribute it,
979# with or without modifications, as long as this notice is preserved.
980
981# AM_PROG_INSTALL_STRIP
982# ---------------------
983# One issue with vendor 'install' (even GNU) is that you can't
984# specify the program used to strip binaries.  This is especially
985# annoying in cross-compiling environments, where the build's strip
986# is unlikely to handle the host's binaries.
987# Fortunately install-sh will honor a STRIPPROG variable, so we
988# always use install-sh in "make install-strip", and initialize
989# STRIPPROG with the value of the STRIP variable (set by the user).
990AC_DEFUN([AM_PROG_INSTALL_STRIP],
991[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
992# Installed binaries are usually stripped using 'strip' when the user
993# run "make install-strip".  However 'strip' might not be the right
994# tool to use in cross-compilation environments, therefore Automake
995# will honor the 'STRIP' environment variable to overrule this program.
996dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
997if test "$cross_compiling" != no; then
998  AC_CHECK_TOOL([STRIP], [strip], :)
999fi
1000INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1001AC_SUBST([INSTALL_STRIP_PROGRAM])])
1002
1003# Copyright (C) 2006-2014 Free Software Foundation, Inc.
1004#
1005# This file is free software; the Free Software Foundation
1006# gives unlimited permission to copy and/or distribute it,
1007# with or without modifications, as long as this notice is preserved.
1008
1009# _AM_SUBST_NOTMAKE(VARIABLE)
1010# ---------------------------
1011# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1012# This macro is traced by Automake.
1013AC_DEFUN([_AM_SUBST_NOTMAKE])
1014
1015# AM_SUBST_NOTMAKE(VARIABLE)
1016# --------------------------
1017# Public sister of _AM_SUBST_NOTMAKE.
1018AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1019
1020# Check how to create a tarball.                            -*- Autoconf -*-
1021
1022# Copyright (C) 2004-2014 Free Software Foundation, Inc.
1023#
1024# This file is free software; the Free Software Foundation
1025# gives unlimited permission to copy and/or distribute it,
1026# with or without modifications, as long as this notice is preserved.
1027
1028# _AM_PROG_TAR(FORMAT)
1029# --------------------
1030# Check how to create a tarball in format FORMAT.
1031# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1032#
1033# Substitute a variable $(am__tar) that is a command
1034# writing to stdout a FORMAT-tarball containing the directory
1035# $tardir.
1036#     tardir=directory && $(am__tar) > result.tar
1037#
1038# Substitute a variable $(am__untar) that extract such
1039# a tarball read from stdin.
1040#     $(am__untar) < result.tar
1041#
1042AC_DEFUN([_AM_PROG_TAR],
1043[# Always define AMTAR for backward compatibility.  Yes, it's still used
1044# in the wild :-(  We should find a proper way to deprecate it ...
1045AC_SUBST([AMTAR], ['$${TAR-tar}'])
1046
1047# We'll loop over all known methods to create a tar archive until one works.
1048_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1049
1050m4_if([$1], [v7],
1051  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1052
1053  [m4_case([$1],
1054    [ustar],
1055     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1056      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1057      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1058      # and bug#13588).
1059      am_max_uid=2097151 # 2^21 - 1
1060      am_max_gid=$am_max_uid
1061      # The $UID and $GID variables are not portable, so we need to resort
1062      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1063      # below are definitely unexpected, so allow the users to see them
1064      # (that is, avoid stderr redirection).
1065      am_uid=`id -u || echo unknown`
1066      am_gid=`id -g || echo unknown`
1067      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1068      if test $am_uid -le $am_max_uid; then
1069         AC_MSG_RESULT([yes])
1070      else
1071         AC_MSG_RESULT([no])
1072         _am_tools=none
1073      fi
1074      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1075      if test $am_gid -le $am_max_gid; then
1076         AC_MSG_RESULT([yes])
1077      else
1078        AC_MSG_RESULT([no])
1079        _am_tools=none
1080      fi],
1081
1082  [pax],
1083    [],
1084
1085  [m4_fatal([Unknown tar format])])
1086
1087  AC_MSG_CHECKING([how to create a $1 tar archive])
1088
1089  # Go ahead even if we have the value already cached.  We do so because we
1090  # need to set the values for the 'am__tar' and 'am__untar' variables.
1091  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1092
1093  for _am_tool in $_am_tools; do
1094    case $_am_tool in
1095    gnutar)
1096      for _am_tar in tar gnutar gtar; do
1097        AM_RUN_LOG([$_am_tar --version]) && break
1098      done
1099      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1100      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1101      am__untar="$_am_tar -xf -"
1102      ;;
1103    plaintar)
1104      # Must skip GNU tar: if it does not support --format= it doesn't create
1105      # ustar tarball either.
1106      (tar --version) >/dev/null 2>&1 && continue
1107      am__tar='tar chf - "$$tardir"'
1108      am__tar_='tar chf - "$tardir"'
1109      am__untar='tar xf -'
1110      ;;
1111    pax)
1112      am__tar='pax -L -x $1 -w "$$tardir"'
1113      am__tar_='pax -L -x $1 -w "$tardir"'
1114      am__untar='pax -r'
1115      ;;
1116    cpio)
1117      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1118      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1119      am__untar='cpio -i -H $1 -d'
1120      ;;
1121    none)
1122      am__tar=false
1123      am__tar_=false
1124      am__untar=false
1125      ;;
1126    esac
1127
1128    # If the value was cached, stop now.  We just wanted to have am__tar
1129    # and am__untar set.
1130    test -n "${am_cv_prog_tar_$1}" && break
1131
1132    # tar/untar a dummy directory, and stop if the command works.
1133    rm -rf conftest.dir
1134    mkdir conftest.dir
1135    echo GrepMe > conftest.dir/file
1136    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1137    rm -rf conftest.dir
1138    if test -s conftest.tar; then
1139      AM_RUN_LOG([$am__untar <conftest.tar])
1140      AM_RUN_LOG([cat conftest.dir/file])
1141      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1142    fi
1143  done
1144  rm -rf conftest.dir
1145
1146  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1147  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1148
1149AC_SUBST([am__tar])
1150AC_SUBST([am__untar])
1151]) # _AM_PROG_TAR
1152
1153dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
1154dnl serial 11 (pkg-config-0.29)
1155dnl
1156dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1157dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
1158dnl
1159dnl This program is free software; you can redistribute it and/or modify
1160dnl it under the terms of the GNU General Public License as published by
1161dnl the Free Software Foundation; either version 2 of the License, or
1162dnl (at your option) any later version.
1163dnl
1164dnl This program is distributed in the hope that it will be useful, but
1165dnl WITHOUT ANY WARRANTY; without even the implied warranty of
1166dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1167dnl General Public License for more details.
1168dnl
1169dnl You should have received a copy of the GNU General Public License
1170dnl along with this program; if not, write to the Free Software
1171dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1172dnl 02111-1307, USA.
1173dnl
1174dnl As a special exception to the GNU General Public License, if you
1175dnl distribute this file as part of a program that contains a
1176dnl configuration script generated by Autoconf, you may include it under
1177dnl the same distribution terms that you use for the rest of that
1178dnl program.
1179
1180dnl PKG_PREREQ(MIN-VERSION)
1181dnl -----------------------
1182dnl Since: 0.29
1183dnl
1184dnl Verify that the version of the pkg-config macros are at least
1185dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
1186dnl installed version of pkg-config, this checks the developer's version
1187dnl of pkg.m4 when generating configure.
1188dnl
1189dnl To ensure that this macro is defined, also add:
1190dnl m4_ifndef([PKG_PREREQ],
1191dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
1192dnl
1193dnl See the "Since" comment for each macro you use to see what version
1194dnl of the macros you require.
1195m4_defun([PKG_PREREQ],
1196[m4_define([PKG_MACROS_VERSION], [0.29])
1197m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
1198    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
1199])dnl PKG_PREREQ
1200
1201dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
1202dnl ----------------------------------
1203dnl Since: 0.16
1204dnl
1205dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
1206dnl first found in the path. Checks that the version of pkg-config found
1207dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
1208dnl used since that's the first version where most current features of
1209dnl pkg-config existed.
1210AC_DEFUN([PKG_PROG_PKG_CONFIG],
1211[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1212m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1213m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1214AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1215AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1216AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1217
1218if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1219	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1220fi
1221if test -n "$PKG_CONFIG"; then
1222	_pkg_min_version=m4_default([$1], [0.9.0])
1223	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1224	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1225		AC_MSG_RESULT([yes])
1226	else
1227		AC_MSG_RESULT([no])
1228		PKG_CONFIG=""
1229	fi
1230fi[]dnl
1231])dnl PKG_PROG_PKG_CONFIG
1232
1233dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1234dnl -------------------------------------------------------------------
1235dnl Since: 0.18
1236dnl
1237dnl Check to see whether a particular set of modules exists. Similar to
1238dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
1239dnl
1240dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1241dnl only at the first occurence in configure.ac, so if the first place
1242dnl it's called might be skipped (such as if it is within an "if", you
1243dnl have to call PKG_CHECK_EXISTS manually
1244AC_DEFUN([PKG_CHECK_EXISTS],
1245[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1246if test -n "$PKG_CONFIG" && \
1247    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1248  m4_default([$2], [:])
1249m4_ifvaln([$3], [else
1250  $3])dnl
1251fi])
1252
1253dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1254dnl ---------------------------------------------
1255dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
1256dnl pkg_failed based on the result.
1257m4_define([_PKG_CONFIG],
1258[if test -n "$$1"; then
1259    pkg_cv_[]$1="$$1"
1260 elif test -n "$PKG_CONFIG"; then
1261    PKG_CHECK_EXISTS([$3],
1262                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1263		      test "x$?" != "x0" && pkg_failed=yes ],
1264		     [pkg_failed=yes])
1265 else
1266    pkg_failed=untried
1267fi[]dnl
1268])dnl _PKG_CONFIG
1269
1270dnl _PKG_SHORT_ERRORS_SUPPORTED
1271dnl ---------------------------
1272dnl Internal check to see if pkg-config supports short errors.
1273AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1274[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1275if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1276        _pkg_short_errors_supported=yes
1277else
1278        _pkg_short_errors_supported=no
1279fi[]dnl
1280])dnl _PKG_SHORT_ERRORS_SUPPORTED
1281
1282
1283dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1284dnl   [ACTION-IF-NOT-FOUND])
1285dnl --------------------------------------------------------------
1286dnl Since: 0.4.0
1287dnl
1288dnl Note that if there is a possibility the first call to
1289dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
1290dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1291AC_DEFUN([PKG_CHECK_MODULES],
1292[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1293AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1294AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1295
1296pkg_failed=no
1297AC_MSG_CHECKING([for $1])
1298
1299_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1300_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1301
1302m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1303and $1[]_LIBS to avoid the need to call pkg-config.
1304See the pkg-config man page for more details.])
1305
1306if test $pkg_failed = yes; then
1307   	AC_MSG_RESULT([no])
1308        _PKG_SHORT_ERRORS_SUPPORTED
1309        if test $_pkg_short_errors_supported = yes; then
1310	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1311        else 
1312	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1313        fi
1314	# Put the nasty error message in config.log where it belongs
1315	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1316
1317	m4_default([$4], [AC_MSG_ERROR(
1318[Package requirements ($2) were not met:
1319
1320$$1_PKG_ERRORS
1321
1322Consider adjusting the PKG_CONFIG_PATH environment variable if you
1323installed software in a non-standard prefix.
1324
1325_PKG_TEXT])[]dnl
1326        ])
1327elif test $pkg_failed = untried; then
1328     	AC_MSG_RESULT([no])
1329	m4_default([$4], [AC_MSG_FAILURE(
1330[The pkg-config script could not be found or is too old.  Make sure it
1331is in your PATH or set the PKG_CONFIG environment variable to the full
1332path to pkg-config.
1333
1334_PKG_TEXT
1335
1336To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1337        ])
1338else
1339	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1340	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1341        AC_MSG_RESULT([yes])
1342	$3
1343fi[]dnl
1344])dnl PKG_CHECK_MODULES
1345
1346
1347dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1348dnl   [ACTION-IF-NOT-FOUND])
1349dnl ---------------------------------------------------------------------
1350dnl Since: 0.29
1351dnl
1352dnl Checks for existence of MODULES and gathers its build flags with
1353dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
1354dnl and VARIABLE-PREFIX_LIBS from --libs.
1355dnl
1356dnl Note that if there is a possibility the first call to
1357dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
1358dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
1359dnl configure.ac.
1360AC_DEFUN([PKG_CHECK_MODULES_STATIC],
1361[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1362_save_PKG_CONFIG=$PKG_CONFIG
1363PKG_CONFIG="$PKG_CONFIG --static"
1364PKG_CHECK_MODULES($@)
1365PKG_CONFIG=$_save_PKG_CONFIG[]dnl
1366])dnl PKG_CHECK_MODULES_STATIC
1367
1368
1369dnl PKG_INSTALLDIR([DIRECTORY])
1370dnl -------------------------
1371dnl Since: 0.27
1372dnl
1373dnl Substitutes the variable pkgconfigdir as the location where a module
1374dnl should install pkg-config .pc files. By default the directory is
1375dnl $libdir/pkgconfig, but the default can be changed by passing
1376dnl DIRECTORY. The user can override through the --with-pkgconfigdir
1377dnl parameter.
1378AC_DEFUN([PKG_INSTALLDIR],
1379[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1380m4_pushdef([pkg_description],
1381    [pkg-config installation directory @<:@]pkg_default[@:>@])
1382AC_ARG_WITH([pkgconfigdir],
1383    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1384    [with_pkgconfigdir=]pkg_default)
1385AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1386m4_popdef([pkg_default])
1387m4_popdef([pkg_description])
1388])dnl PKG_INSTALLDIR
1389
1390
1391dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
1392dnl --------------------------------
1393dnl Since: 0.27
1394dnl
1395dnl Substitutes the variable noarch_pkgconfigdir as the location where a
1396dnl module should install arch-independent pkg-config .pc files. By
1397dnl default the directory is $datadir/pkgconfig, but the default can be
1398dnl changed by passing DIRECTORY. The user can override through the
1399dnl --with-noarch-pkgconfigdir parameter.
1400AC_DEFUN([PKG_NOARCH_INSTALLDIR],
1401[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
1402m4_pushdef([pkg_description],
1403    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1404AC_ARG_WITH([noarch-pkgconfigdir],
1405    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1406    [with_noarch_pkgconfigdir=]pkg_default)
1407AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
1408m4_popdef([pkg_default])
1409m4_popdef([pkg_description])
1410])dnl PKG_NOARCH_INSTALLDIR
1411
1412
1413dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1414dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1415dnl -------------------------------------------
1416dnl Since: 0.28
1417dnl
1418dnl Retrieves the value of the pkg-config variable for the given module.
1419AC_DEFUN([PKG_CHECK_VAR],
1420[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1421AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
1422
1423_PKG_CONFIG([$1], [variable="][$3]["], [$2])
1424AS_VAR_COPY([$1], [pkg_cv_][$1])
1425
1426AS_VAR_IF([$1], [""], [$5], [$4])dnl
1427])dnl PKG_CHECK_VAR
1428
1429dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1430dnl
1431dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
1432dnl
1433dnl Permission is hereby granted, free of charge, to any person obtaining a
1434dnl copy of this software and associated documentation files (the "Software"),
1435dnl to deal in the Software without restriction, including without limitation
1436dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1437dnl and/or sell copies of the Software, and to permit persons to whom the
1438dnl Software is furnished to do so, subject to the following conditions:
1439dnl
1440dnl The above copyright notice and this permission notice (including the next
1441dnl paragraph) shall be included in all copies or substantial portions of the
1442dnl Software.
1443dnl
1444dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1445dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1446dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1447dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1448dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1449dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1450dnl DEALINGS IN THE SOFTWARE.
1451
1452# XORG_MACROS_VERSION(required-version)
1453# -------------------------------------
1454# Minimum version: 1.1.0
1455#
1456# If you're using a macro added in Version 1.1 or newer, include this in
1457# your configure.ac with the minimum required version, such as:
1458# XORG_MACROS_VERSION(1.1)
1459#
1460# To ensure that this macro is defined, also add:
1461# m4_ifndef([XORG_MACROS_VERSION],
1462#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1463#
1464#
1465# See the "minimum version" comment for each macro you use to see what
1466# version you require.
1467m4_defun([XORG_MACROS_VERSION],[
1468m4_define([vers_have], [1.19.2])
1469m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1470m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1471m4_if(m4_cmp(maj_have, maj_needed), 0,,
1472    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1473m4_if(m4_version_compare(vers_have, [$1]), -1,
1474    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1475m4_undefine([vers_have])
1476m4_undefine([maj_have])
1477m4_undefine([maj_needed])
1478]) # XORG_MACROS_VERSION
1479
1480# XORG_PROG_RAWCPP()
1481# ------------------
1482# Minimum version: 1.0.0
1483#
1484# Find cpp program and necessary flags for use in pre-processing text files
1485# such as man pages and config files
1486AC_DEFUN([XORG_PROG_RAWCPP],[
1487AC_REQUIRE([AC_PROG_CPP])
1488AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
1489   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1490
1491# Check for flag to avoid builtin definitions - assumes unix is predefined,
1492# which is not the best choice for supporting other OS'es, but covers most
1493# of the ones we need for now.
1494AC_MSG_CHECKING([if $RAWCPP requires -undef])
1495AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1496if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1497	AC_MSG_RESULT([no])
1498else
1499	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1500		RAWCPPFLAGS=-undef
1501		AC_MSG_RESULT([yes])
1502	# under Cygwin unix is still defined even with -undef
1503	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1504		RAWCPPFLAGS="-undef -ansi"
1505		AC_MSG_RESULT([yes, with -ansi])
1506	else
1507		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1508	fi
1509fi
1510rm -f conftest.$ac_ext
1511
1512AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1513AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
1514if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1515	AC_MSG_RESULT([no])
1516else
1517	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1518		TRADITIONALCPPFLAGS="-traditional"
1519		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1520		AC_MSG_RESULT([yes])
1521	else
1522		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1523	fi
1524fi
1525rm -f conftest.$ac_ext
1526AC_SUBST(RAWCPPFLAGS)
1527AC_SUBST(TRADITIONALCPPFLAGS)
1528]) # XORG_PROG_RAWCPP
1529
1530# XORG_MANPAGE_SECTIONS()
1531# -----------------------
1532# Minimum version: 1.0.0
1533#
1534# Determine which sections man pages go in for the different man page types
1535# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1536# Not sure if there's any better way than just hardcoding by OS name.
1537# Override default settings by setting environment variables
1538# Added MAN_SUBSTS in version 1.8
1539# Added AC_PROG_SED in version 1.8
1540
1541AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1542AC_REQUIRE([AC_CANONICAL_HOST])
1543AC_REQUIRE([AC_PROG_SED])
1544
1545case $host_os in
1546    solaris*)
1547        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
1548        # check for a man page file found in later versions that use
1549        # traditional section numbers instead
1550        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
1551                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
1552        ;;
1553    *) SYSV_MAN_SECTIONS=false ;;
1554esac
1555
1556if test x$APP_MAN_SUFFIX = x    ; then
1557    APP_MAN_SUFFIX=1
1558fi
1559if test x$APP_MAN_DIR = x    ; then
1560    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1561fi
1562
1563if test x$LIB_MAN_SUFFIX = x    ; then
1564    LIB_MAN_SUFFIX=3
1565fi
1566if test x$LIB_MAN_DIR = x    ; then
1567    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1568fi
1569
1570if test x$FILE_MAN_SUFFIX = x    ; then
1571    case $SYSV_MAN_SECTIONS in
1572	true)				FILE_MAN_SUFFIX=4  ;;
1573	*)				FILE_MAN_SUFFIX=5  ;;
1574    esac
1575fi
1576if test x$FILE_MAN_DIR = x    ; then
1577    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1578fi
1579
1580if test x$MISC_MAN_SUFFIX = x    ; then
1581    case $SYSV_MAN_SECTIONS in
1582	true)				MISC_MAN_SUFFIX=5  ;;
1583	*)				MISC_MAN_SUFFIX=7  ;;
1584    esac
1585fi
1586if test x$MISC_MAN_DIR = x    ; then
1587    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1588fi
1589
1590if test x$DRIVER_MAN_SUFFIX = x    ; then
1591    case $SYSV_MAN_SECTIONS in
1592	true)				DRIVER_MAN_SUFFIX=7  ;;
1593	*)				DRIVER_MAN_SUFFIX=4  ;;
1594    esac
1595fi
1596if test x$DRIVER_MAN_DIR = x    ; then
1597    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1598fi
1599
1600if test x$ADMIN_MAN_SUFFIX = x    ; then
1601    case $SYSV_MAN_SECTIONS in
1602	true)				ADMIN_MAN_SUFFIX=1m ;;
1603	*)				ADMIN_MAN_SUFFIX=8  ;;
1604    esac
1605fi
1606if test x$ADMIN_MAN_DIR = x    ; then
1607    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1608fi
1609
1610
1611AC_SUBST([APP_MAN_SUFFIX])
1612AC_SUBST([LIB_MAN_SUFFIX])
1613AC_SUBST([FILE_MAN_SUFFIX])
1614AC_SUBST([MISC_MAN_SUFFIX])
1615AC_SUBST([DRIVER_MAN_SUFFIX])
1616AC_SUBST([ADMIN_MAN_SUFFIX])
1617AC_SUBST([APP_MAN_DIR])
1618AC_SUBST([LIB_MAN_DIR])
1619AC_SUBST([FILE_MAN_DIR])
1620AC_SUBST([MISC_MAN_DIR])
1621AC_SUBST([DRIVER_MAN_DIR])
1622AC_SUBST([ADMIN_MAN_DIR])
1623
1624XORG_MAN_PAGE="X Version 11"
1625AC_SUBST([XORG_MAN_PAGE])
1626MAN_SUBSTS="\
1627	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1628	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1629	-e 's|__xservername__|Xorg|g' \
1630	-e 's|__xconfigfile__|xorg.conf|g' \
1631	-e 's|__projectroot__|\$(prefix)|g' \
1632	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1633	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1634	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1635	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1636	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1637	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1638	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1639AC_SUBST([MAN_SUBSTS])
1640
1641]) # XORG_MANPAGE_SECTIONS
1642
1643# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1644# ------------------------
1645# Minimum version: 1.7.0
1646#
1647# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1648# provided by xorg-sgml-doctools, if installed.
1649AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1650AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1651XORG_SGML_PATH=
1652PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1653    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1654    [m4_ifval([$1],[:],
1655        [if test x"$cross_compiling" != x"yes" ; then
1656            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1657                          [XORG_SGML_PATH=$prefix/share/sgml])
1658         fi])
1659    ])
1660
1661# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1662# the path and the name of the doc stylesheet
1663if test "x$XORG_SGML_PATH" != "x" ; then
1664   AC_MSG_RESULT([$XORG_SGML_PATH])
1665   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1666   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1667else
1668   AC_MSG_RESULT([no])
1669fi
1670
1671AC_SUBST(XORG_SGML_PATH)
1672AC_SUBST(STYLESHEET_SRCDIR)
1673AC_SUBST(XSL_STYLESHEET)
1674AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1675]) # XORG_CHECK_SGML_DOCTOOLS
1676
1677# XORG_CHECK_LINUXDOC
1678# -------------------
1679# Minimum version: 1.0.0
1680#
1681# Defines the variable MAKE_TEXT if the necessary tools and
1682# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1683# Whether or not the necessary tools and files are found can be checked
1684# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1685AC_DEFUN([XORG_CHECK_LINUXDOC],[
1686AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1687AC_REQUIRE([XORG_WITH_PS2PDF])
1688
1689AC_PATH_PROG(LINUXDOC, linuxdoc)
1690
1691AC_MSG_CHECKING([whether to build documentation])
1692
1693if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1694   BUILDDOC=yes
1695else
1696   BUILDDOC=no
1697fi
1698
1699AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1700
1701AC_MSG_RESULT([$BUILDDOC])
1702
1703AC_MSG_CHECKING([whether to build pdf documentation])
1704
1705if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1706   BUILDPDFDOC=yes
1707else
1708   BUILDPDFDOC=no
1709fi
1710
1711AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1712
1713AC_MSG_RESULT([$BUILDPDFDOC])
1714
1715MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1716MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1717MAKE_PDF="$PS2PDF"
1718MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1719
1720AC_SUBST(MAKE_TEXT)
1721AC_SUBST(MAKE_PS)
1722AC_SUBST(MAKE_PDF)
1723AC_SUBST(MAKE_HTML)
1724]) # XORG_CHECK_LINUXDOC
1725
1726# XORG_CHECK_DOCBOOK
1727# -------------------
1728# Minimum version: 1.0.0
1729#
1730# Checks for the ability to build output formats from SGML DocBook source.
1731# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1732# indicates whether the necessary tools and files are found and, if set,
1733# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1734AC_DEFUN([XORG_CHECK_DOCBOOK],[
1735AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1736
1737BUILDTXTDOC=no
1738BUILDPDFDOC=no
1739BUILDPSDOC=no
1740BUILDHTMLDOC=no
1741
1742AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1743AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1744AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1745AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1746
1747AC_MSG_CHECKING([whether to build text documentation])
1748if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1749   test x$BUILD_TXTDOC != xno; then
1750	BUILDTXTDOC=yes
1751fi
1752AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1753AC_MSG_RESULT([$BUILDTXTDOC])
1754
1755AC_MSG_CHECKING([whether to build PDF documentation])
1756if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1757   test x$BUILD_PDFDOC != xno; then
1758	BUILDPDFDOC=yes
1759fi
1760AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1761AC_MSG_RESULT([$BUILDPDFDOC])
1762
1763AC_MSG_CHECKING([whether to build PostScript documentation])
1764if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1765   test x$BUILD_PSDOC != xno; then
1766	BUILDPSDOC=yes
1767fi
1768AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1769AC_MSG_RESULT([$BUILDPSDOC])
1770
1771AC_MSG_CHECKING([whether to build HTML documentation])
1772if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1773   test x$BUILD_HTMLDOC != xno; then
1774	BUILDHTMLDOC=yes
1775fi
1776AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1777AC_MSG_RESULT([$BUILDHTMLDOC])
1778
1779MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1780MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1781MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1782MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1783
1784AC_SUBST(MAKE_TEXT)
1785AC_SUBST(MAKE_PS)
1786AC_SUBST(MAKE_PDF)
1787AC_SUBST(MAKE_HTML)
1788]) # XORG_CHECK_DOCBOOK
1789
1790# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1791# ----------------
1792# Minimum version: 1.5.0
1793# Minimum version for optional DEFAULT argument: 1.11.0
1794#
1795# Documentation tools are not always available on all platforms and sometimes
1796# not at the appropriate level. This macro enables a module to test for the
1797# presence of the tool and obtain it's path in separate variables. Coupled with
1798# the --with-xmlto option, it allows maximum flexibilty in making decisions
1799# as whether or not to use the xmlto package. When DEFAULT is not specified,
1800# --with-xmlto assumes 'auto'.
1801#
1802# Interface to module:
1803# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1804# XMLTO:	returns the path of the xmlto program found
1805#		returns the path set by the user in the environment
1806# --with-xmlto:	'yes' user instructs the module to use xmlto
1807#		'no' user instructs the module not to use xmlto
1808#
1809# Added in version 1.10.0
1810# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1811#                  xmlto for text output requires either lynx, links, or w3m browsers
1812#
1813# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1814#
1815AC_DEFUN([XORG_WITH_XMLTO],[
1816AC_ARG_VAR([XMLTO], [Path to xmlto command])
1817m4_define([_defopt], m4_default([$2], [auto]))
1818AC_ARG_WITH(xmlto,
1819	AS_HELP_STRING([--with-xmlto],
1820	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1821	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1822m4_undefine([_defopt])
1823
1824if test "x$use_xmlto" = x"auto"; then
1825   AC_PATH_PROG([XMLTO], [xmlto])
1826   if test "x$XMLTO" = "x"; then
1827        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1828	have_xmlto=no
1829   else
1830        have_xmlto=yes
1831   fi
1832elif test "x$use_xmlto" = x"yes" ; then
1833   AC_PATH_PROG([XMLTO], [xmlto])
1834   if test "x$XMLTO" = "x"; then
1835        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1836   fi
1837   have_xmlto=yes
1838elif test "x$use_xmlto" = x"no" ; then
1839   if test "x$XMLTO" != "x"; then
1840      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1841   fi
1842   have_xmlto=no
1843else
1844   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1845fi
1846
1847# Test for a minimum version of xmlto, if provided.
1848m4_ifval([$1],
1849[if test "$have_xmlto" = yes; then
1850    # scrape the xmlto version
1851    AC_MSG_CHECKING([the xmlto version])
1852    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1853    AC_MSG_RESULT([$xmlto_version])
1854    AS_VERSION_COMPARE([$xmlto_version], [$1],
1855        [if test "x$use_xmlto" = xauto; then
1856            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1857            have_xmlto=no
1858        else
1859            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1860        fi])
1861fi])
1862
1863# Test for the ability of xmlto to generate a text target
1864#
1865# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
1866# following test for empty XML docbook files.
1867# For compatibility reasons use the following empty XML docbook file and if
1868# it fails try it again with a non-empty XML file.
1869have_xmlto_text=no
1870cat > conftest.xml << "EOF"
1871EOF
1872AS_IF([test "$have_xmlto" = yes],
1873      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1874             [have_xmlto_text=yes],
1875             [# Try it again with a non-empty XML file.
1876              cat > conftest.xml << "EOF"
1877<x></x>
1878EOF
1879              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1880                    [have_xmlto_text=yes],
1881                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
1882rm -f conftest.xml
1883AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1884AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1885]) # XORG_WITH_XMLTO
1886
1887# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1888# --------------------------------------------
1889# Minimum version: 1.12.0
1890# Minimum version for optional DEFAULT argument: 1.12.0
1891#
1892# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1893# XML-based language used for the transformation of XML documents.
1894# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1895# It is used under the cover by xmlto to generate html files from DocBook/XML.
1896# The XSLT processor is often used as a standalone tool for transformations.
1897# It should not be assumed that this tool is used only to work with documnetation.
1898# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1899#
1900# Interface to module:
1901# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1902# XSLTPROC:	 returns the path of the xsltproc program found
1903#		 returns the path set by the user in the environment
1904# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1905#		  'no' user instructs the module not to use xsltproc
1906# have_xsltproc: returns yes if xsltproc found in PATH or no
1907#
1908# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1909#
1910AC_DEFUN([XORG_WITH_XSLTPROC],[
1911AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1912# Preserves the interface, should it be implemented later
1913m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1914m4_define([_defopt], m4_default([$2], [auto]))
1915AC_ARG_WITH(xsltproc,
1916	AS_HELP_STRING([--with-xsltproc],
1917	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1918	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1919m4_undefine([_defopt])
1920
1921if test "x$use_xsltproc" = x"auto"; then
1922   AC_PATH_PROG([XSLTPROC], [xsltproc])
1923   if test "x$XSLTPROC" = "x"; then
1924        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1925	have_xsltproc=no
1926   else
1927        have_xsltproc=yes
1928   fi
1929elif test "x$use_xsltproc" = x"yes" ; then
1930   AC_PATH_PROG([XSLTPROC], [xsltproc])
1931   if test "x$XSLTPROC" = "x"; then
1932        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1933   fi
1934   have_xsltproc=yes
1935elif test "x$use_xsltproc" = x"no" ; then
1936   if test "x$XSLTPROC" != "x"; then
1937      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1938   fi
1939   have_xsltproc=no
1940else
1941   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1942fi
1943
1944AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1945]) # XORG_WITH_XSLTPROC
1946
1947# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1948# ----------------------------------------
1949# Minimum version: 1.15.0
1950#
1951# PERL (Practical Extraction and Report Language) is a language optimized for
1952# scanning arbitrary text files, extracting information from those text files,
1953# and printing reports based on that information.
1954#
1955# When DEFAULT is not specified, --with-perl assumes 'auto'.
1956#
1957# Interface to module:
1958# HAVE_PERL: used in makefiles to conditionally scan text files
1959# PERL:	     returns the path of the perl program found
1960#	     returns the path set by the user in the environment
1961# --with-perl: 'yes' user instructs the module to use perl
1962#	       'no' user instructs the module not to use perl
1963# have_perl: returns yes if perl found in PATH or no
1964#
1965# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1966#
1967AC_DEFUN([XORG_WITH_PERL],[
1968AC_ARG_VAR([PERL], [Path to perl command])
1969# Preserves the interface, should it be implemented later
1970m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1971m4_define([_defopt], m4_default([$2], [auto]))
1972AC_ARG_WITH(perl,
1973	AS_HELP_STRING([--with-perl],
1974	   [Use perl for extracting information from files (default: ]_defopt[)]),
1975	   [use_perl=$withval], [use_perl=]_defopt)
1976m4_undefine([_defopt])
1977
1978if test "x$use_perl" = x"auto"; then
1979   AC_PATH_PROG([PERL], [perl])
1980   if test "x$PERL" = "x"; then
1981        AC_MSG_WARN([perl not found - cannot extract information and report])
1982	have_perl=no
1983   else
1984        have_perl=yes
1985   fi
1986elif test "x$use_perl" = x"yes" ; then
1987   AC_PATH_PROG([PERL], [perl])
1988   if test "x$PERL" = "x"; then
1989        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1990   fi
1991   have_perl=yes
1992elif test "x$use_perl" = x"no" ; then
1993   if test "x$PERL" != "x"; then
1994      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1995   fi
1996   have_perl=no
1997else
1998   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1999fi
2000
2001AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
2002]) # XORG_WITH_PERL
2003
2004# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
2005# ----------------
2006# Minimum version: 1.5.0
2007# Minimum version for optional DEFAULT argument: 1.11.0
2008#
2009# Documentation tools are not always available on all platforms and sometimes
2010# not at the appropriate level. This macro enables a module to test for the
2011# presence of the tool and obtain it's path in separate variables. Coupled with
2012# the --with-asciidoc option, it allows maximum flexibilty in making decisions
2013# as whether or not to use the asciidoc package. When DEFAULT is not specified,
2014# --with-asciidoc assumes 'auto'.
2015#
2016# Interface to module:
2017# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
2018# ASCIIDOC:	 returns the path of the asciidoc program found
2019#		 returns the path set by the user in the environment
2020# --with-asciidoc: 'yes' user instructs the module to use asciidoc
2021#		  'no' user instructs the module not to use asciidoc
2022#
2023# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
2024#
2025AC_DEFUN([XORG_WITH_ASCIIDOC],[
2026AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
2027m4_define([_defopt], m4_default([$2], [auto]))
2028AC_ARG_WITH(asciidoc,
2029	AS_HELP_STRING([--with-asciidoc],
2030	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
2031	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
2032m4_undefine([_defopt])
2033
2034if test "x$use_asciidoc" = x"auto"; then
2035   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2036   if test "x$ASCIIDOC" = "x"; then
2037        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
2038	have_asciidoc=no
2039   else
2040        have_asciidoc=yes
2041   fi
2042elif test "x$use_asciidoc" = x"yes" ; then
2043   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2044   if test "x$ASCIIDOC" = "x"; then
2045        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
2046   fi
2047   have_asciidoc=yes
2048elif test "x$use_asciidoc" = x"no" ; then
2049   if test "x$ASCIIDOC" != "x"; then
2050      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
2051   fi
2052   have_asciidoc=no
2053else
2054   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
2055fi
2056m4_ifval([$1],
2057[if test "$have_asciidoc" = yes; then
2058    # scrape the asciidoc version
2059    AC_MSG_CHECKING([the asciidoc version])
2060    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
2061    AC_MSG_RESULT([$asciidoc_version])
2062    AS_VERSION_COMPARE([$asciidoc_version], [$1],
2063        [if test "x$use_asciidoc" = xauto; then
2064            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
2065            have_asciidoc=no
2066        else
2067            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
2068        fi])
2069fi])
2070AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
2071]) # XORG_WITH_ASCIIDOC
2072
2073# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
2074# -------------------------------------------
2075# Minimum version: 1.5.0
2076# Minimum version for optional DEFAULT argument: 1.11.0
2077# Minimum version for optional DOT checking: 1.18.0
2078#
2079# Documentation tools are not always available on all platforms and sometimes
2080# not at the appropriate level. This macro enables a module to test for the
2081# presence of the tool and obtain it's path in separate variables. Coupled with
2082# the --with-doxygen option, it allows maximum flexibilty in making decisions
2083# as whether or not to use the doxygen package. When DEFAULT is not specified,
2084# --with-doxygen assumes 'auto'.
2085#
2086# Interface to module:
2087# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
2088# DOXYGEN:	 returns the path of the doxygen program found
2089#		 returns the path set by the user in the environment
2090# --with-doxygen: 'yes' user instructs the module to use doxygen
2091#		  'no' user instructs the module not to use doxygen
2092#
2093# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
2094#
2095AC_DEFUN([XORG_WITH_DOXYGEN],[
2096AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
2097AC_ARG_VAR([DOT], [Path to the dot graphics utility])
2098m4_define([_defopt], m4_default([$2], [auto]))
2099AC_ARG_WITH(doxygen,
2100	AS_HELP_STRING([--with-doxygen],
2101	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
2102	   [use_doxygen=$withval], [use_doxygen=]_defopt)
2103m4_undefine([_defopt])
2104
2105if test "x$use_doxygen" = x"auto"; then
2106   AC_PATH_PROG([DOXYGEN], [doxygen])
2107   if test "x$DOXYGEN" = "x"; then
2108        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
2109	have_doxygen=no
2110   else
2111        have_doxygen=yes
2112   fi
2113elif test "x$use_doxygen" = x"yes" ; then
2114   AC_PATH_PROG([DOXYGEN], [doxygen])
2115   if test "x$DOXYGEN" = "x"; then
2116        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
2117   fi
2118   have_doxygen=yes
2119elif test "x$use_doxygen" = x"no" ; then
2120   if test "x$DOXYGEN" != "x"; then
2121      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
2122   fi
2123   have_doxygen=no
2124else
2125   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
2126fi
2127m4_ifval([$1],
2128[if test "$have_doxygen" = yes; then
2129    # scrape the doxygen version
2130    AC_MSG_CHECKING([the doxygen version])
2131    doxygen_version=`$DOXYGEN --version 2>/dev/null`
2132    AC_MSG_RESULT([$doxygen_version])
2133    AS_VERSION_COMPARE([$doxygen_version], [$1],
2134        [if test "x$use_doxygen" = xauto; then
2135            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
2136            have_doxygen=no
2137        else
2138            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
2139        fi])
2140fi])
2141
2142dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
2143dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
2144dnl 	HAVE_DOT = @HAVE_DOT@
2145HAVE_DOT=no
2146if test "x$have_doxygen" = "xyes"; then
2147  AC_PATH_PROG([DOT], [dot])
2148    if test "x$DOT" != "x"; then
2149      HAVE_DOT=yes
2150    fi
2151fi
2152
2153AC_SUBST([HAVE_DOT])
2154AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
2155AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
2156]) # XORG_WITH_DOXYGEN
2157
2158# XORG_WITH_GROFF([DEFAULT])
2159# ----------------
2160# Minimum version: 1.6.0
2161# Minimum version for optional DEFAULT argument: 1.11.0
2162#
2163# Documentation tools are not always available on all platforms and sometimes
2164# not at the appropriate level. This macro enables a module to test for the
2165# presence of the tool and obtain it's path in separate variables. Coupled with
2166# the --with-groff option, it allows maximum flexibilty in making decisions
2167# as whether or not to use the groff package. When DEFAULT is not specified,
2168# --with-groff assumes 'auto'.
2169#
2170# Interface to module:
2171# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
2172# HAVE_GROFF_MM: the memorandum macros (-mm) package
2173# HAVE_GROFF_MS: the -ms macros package
2174# GROFF:	 returns the path of the groff program found
2175#		 returns the path set by the user in the environment
2176# --with-groff:	 'yes' user instructs the module to use groff
2177#		 'no' user instructs the module not to use groff
2178#
2179# Added in version 1.9.0:
2180# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
2181#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
2182#		   psselect from the psutils package.
2183#		   the ghostcript package. Refer to the grohtml man pages
2184#
2185# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
2186#
2187# OS and distros often splits groff in a basic and full package, the former
2188# having the groff program and the later having devices, fonts and macros
2189# Checking for the groff executable is not enough.
2190#
2191# If macros are missing, we cannot assume that groff is useless, so we don't
2192# unset HAVE_GROFF or GROFF env variables.
2193# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
2194#
2195AC_DEFUN([XORG_WITH_GROFF],[
2196AC_ARG_VAR([GROFF], [Path to groff command])
2197m4_define([_defopt], m4_default([$1], [auto]))
2198AC_ARG_WITH(groff,
2199	AS_HELP_STRING([--with-groff],
2200	   [Use groff to regenerate documentation (default: ]_defopt[)]),
2201	   [use_groff=$withval], [use_groff=]_defopt)
2202m4_undefine([_defopt])
2203
2204if test "x$use_groff" = x"auto"; then
2205   AC_PATH_PROG([GROFF], [groff])
2206   if test "x$GROFF" = "x"; then
2207        AC_MSG_WARN([groff not found - documentation targets will be skipped])
2208	have_groff=no
2209   else
2210        have_groff=yes
2211   fi
2212elif test "x$use_groff" = x"yes" ; then
2213   AC_PATH_PROG([GROFF], [groff])
2214   if test "x$GROFF" = "x"; then
2215        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2216   fi
2217   have_groff=yes
2218elif test "x$use_groff" = x"no" ; then
2219   if test "x$GROFF" != "x"; then
2220      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2221   fi
2222   have_groff=no
2223else
2224   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
2225fi
2226
2227# We have groff, test for the presence of the macro packages
2228if test "x$have_groff" = x"yes"; then
2229    AC_MSG_CHECKING([for ${GROFF} -ms macros])
2230    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2231        groff_ms_works=yes
2232    else
2233        groff_ms_works=no
2234    fi
2235    AC_MSG_RESULT([$groff_ms_works])
2236    AC_MSG_CHECKING([for ${GROFF} -mm macros])
2237    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2238        groff_mm_works=yes
2239    else
2240        groff_mm_works=no
2241    fi
2242    AC_MSG_RESULT([$groff_mm_works])
2243fi
2244
2245# We have groff, test for HTML dependencies, one command per package
2246if test "x$have_groff" = x"yes"; then
2247   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2248   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2249   AC_PATH_PROG(PSSELECT_PATH, [psselect])
2250   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2251      have_groff_html=yes
2252   else
2253      have_groff_html=no
2254      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2255   fi
2256fi
2257
2258# Set Automake conditionals for Makefiles
2259AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2260AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2261AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2262AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2263]) # XORG_WITH_GROFF
2264
2265# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
2266# ---------------------------------------
2267# Minimum version: 1.6.0
2268# Minimum version for optional DEFAULT argument: 1.11.0
2269# Minimum version for optional MIN-VERSION argument: 1.15.0
2270#
2271# Documentation tools are not always available on all platforms and sometimes
2272# not at the appropriate level. This macro enables a module to test for the
2273# presence of the tool and obtain it's path in separate variables. Coupled with
2274# the --with-fop option, it allows maximum flexibilty in making decisions
2275# as whether or not to use the fop package. When DEFAULT is not specified,
2276# --with-fop assumes 'auto'.
2277#
2278# Interface to module:
2279# HAVE_FOP: 	used in makefiles to conditionally generate documentation
2280# FOP:	 	returns the path of the fop program found
2281#		returns the path set by the user in the environment
2282# --with-fop: 	'yes' user instructs the module to use fop
2283#		'no' user instructs the module not to use fop
2284#
2285# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2286#
2287AC_DEFUN([XORG_WITH_FOP],[
2288AC_ARG_VAR([FOP], [Path to fop command])
2289m4_define([_defopt], m4_default([$2], [auto]))
2290AC_ARG_WITH(fop,
2291	AS_HELP_STRING([--with-fop],
2292	   [Use fop to regenerate documentation (default: ]_defopt[)]),
2293	   [use_fop=$withval], [use_fop=]_defopt)
2294m4_undefine([_defopt])
2295
2296if test "x$use_fop" = x"auto"; then
2297   AC_PATH_PROG([FOP], [fop])
2298   if test "x$FOP" = "x"; then
2299        AC_MSG_WARN([fop not found - documentation targets will be skipped])
2300	have_fop=no
2301   else
2302        have_fop=yes
2303   fi
2304elif test "x$use_fop" = x"yes" ; then
2305   AC_PATH_PROG([FOP], [fop])
2306   if test "x$FOP" = "x"; then
2307        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2308   fi
2309   have_fop=yes
2310elif test "x$use_fop" = x"no" ; then
2311   if test "x$FOP" != "x"; then
2312      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2313   fi
2314   have_fop=no
2315else
2316   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
2317fi
2318
2319# Test for a minimum version of fop, if provided.
2320m4_ifval([$1],
2321[if test "$have_fop" = yes; then
2322    # scrape the fop version
2323    AC_MSG_CHECKING([for fop minimum version])
2324    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2325    AC_MSG_RESULT([$fop_version])
2326    AS_VERSION_COMPARE([$fop_version], [$1],
2327        [if test "x$use_fop" = xauto; then
2328            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2329            have_fop=no
2330        else
2331            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2332        fi])
2333fi])
2334AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2335]) # XORG_WITH_FOP
2336
2337# XORG_WITH_M4([MIN-VERSION])
2338# ---------------------------
2339# Minimum version: 1.19.0
2340#
2341# This macro attempts to locate an m4 macro processor which supports
2342# -I option and is only useful for modules relying on M4 in order to
2343# expand macros in source code files.
2344#
2345# Interface to module:
2346# M4:	 	returns the path of the m4 program found
2347#		returns the path set by the user in the environment
2348#
2349AC_DEFUN([XORG_WITH_M4], [
2350AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
2351   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
2352       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
2353         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
2354   [AC_MSG_ERROR([could not find m4 that supports -I option])],
2355   [$PATH:/usr/gnu/bin])])
2356
2357AC_SUBST([M4], [$ac_cv_path_M4])
2358]) # XORG_WITH_M4
2359
2360# XORG_WITH_PS2PDF([DEFAULT])
2361# ----------------
2362# Minimum version: 1.6.0
2363# Minimum version for optional DEFAULT argument: 1.11.0
2364#
2365# Documentation tools are not always available on all platforms and sometimes
2366# not at the appropriate level. This macro enables a module to test for the
2367# presence of the tool and obtain it's path in separate variables. Coupled with
2368# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
2369# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2370# --with-ps2pdf assumes 'auto'.
2371#
2372# Interface to module:
2373# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
2374# PS2PDF:	returns the path of the ps2pdf program found
2375#		returns the path set by the user in the environment
2376# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2377#		 'no' user instructs the module not to use ps2pdf
2378#
2379# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2380#
2381AC_DEFUN([XORG_WITH_PS2PDF],[
2382AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2383m4_define([_defopt], m4_default([$1], [auto]))
2384AC_ARG_WITH(ps2pdf,
2385	AS_HELP_STRING([--with-ps2pdf],
2386	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2387	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2388m4_undefine([_defopt])
2389
2390if test "x$use_ps2pdf" = x"auto"; then
2391   AC_PATH_PROG([PS2PDF], [ps2pdf])
2392   if test "x$PS2PDF" = "x"; then
2393        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2394	have_ps2pdf=no
2395   else
2396        have_ps2pdf=yes
2397   fi
2398elif test "x$use_ps2pdf" = x"yes" ; then
2399   AC_PATH_PROG([PS2PDF], [ps2pdf])
2400   if test "x$PS2PDF" = "x"; then
2401        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2402   fi
2403   have_ps2pdf=yes
2404elif test "x$use_ps2pdf" = x"no" ; then
2405   if test "x$PS2PDF" != "x"; then
2406      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2407   fi
2408   have_ps2pdf=no
2409else
2410   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2411fi
2412AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2413]) # XORG_WITH_PS2PDF
2414
2415# XORG_ENABLE_DOCS (enable_docs=yes)
2416# ----------------
2417# Minimum version: 1.6.0
2418#
2419# Documentation tools are not always available on all platforms and sometimes
2420# not at the appropriate level. This macro enables a builder to skip all
2421# documentation targets except traditional man pages.
2422# Combined with the specific tool checking macros XORG_WITH_*, it provides
2423# maximum flexibilty in controlling documentation building.
2424# Refer to:
2425# XORG_WITH_XMLTO         --with-xmlto
2426# XORG_WITH_ASCIIDOC      --with-asciidoc
2427# XORG_WITH_DOXYGEN       --with-doxygen
2428# XORG_WITH_FOP           --with-fop
2429# XORG_WITH_GROFF         --with-groff
2430# XORG_WITH_PS2PDF        --with-ps2pdf
2431#
2432# Interface to module:
2433# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
2434# --enable-docs: 'yes' user instructs the module to generate docs
2435#		 'no' user instructs the module not to generate docs
2436# parm1:	specify the default value, yes or no.
2437#
2438AC_DEFUN([XORG_ENABLE_DOCS],[
2439m4_define([docs_default], m4_default([$1], [yes]))
2440AC_ARG_ENABLE(docs,
2441	AS_HELP_STRING([--enable-docs],
2442	   [Enable building the documentation (default: ]docs_default[)]),
2443	   [build_docs=$enableval], [build_docs=]docs_default)
2444m4_undefine([docs_default])
2445AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2446AC_MSG_CHECKING([whether to build documentation])
2447AC_MSG_RESULT([$build_docs])
2448]) # XORG_ENABLE_DOCS
2449
2450# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2451# ----------------
2452# Minimum version: 1.6.0
2453#
2454# This macro enables a builder to skip all developer documentation.
2455# Combined with the specific tool checking macros XORG_WITH_*, it provides
2456# maximum flexibilty in controlling documentation building.
2457# Refer to:
2458# XORG_WITH_XMLTO         --with-xmlto
2459# XORG_WITH_ASCIIDOC      --with-asciidoc
2460# XORG_WITH_DOXYGEN       --with-doxygen
2461# XORG_WITH_FOP           --with-fop
2462# XORG_WITH_GROFF         --with-groff
2463# XORG_WITH_PS2PDF        --with-ps2pdf
2464#
2465# Interface to module:
2466# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
2467# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
2468#			'no' user instructs the module not to generate developer docs
2469# parm1:		specify the default value, yes or no.
2470#
2471AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2472m4_define([devel_default], m4_default([$1], [yes]))
2473AC_ARG_ENABLE(devel-docs,
2474	AS_HELP_STRING([--enable-devel-docs],
2475	   [Enable building the developer documentation (default: ]devel_default[)]),
2476	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2477m4_undefine([devel_default])
2478AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2479AC_MSG_CHECKING([whether to build developer documentation])
2480AC_MSG_RESULT([$build_devel_docs])
2481]) # XORG_ENABLE_DEVEL_DOCS
2482
2483# XORG_ENABLE_SPECS (enable_specs=yes)
2484# ----------------
2485# Minimum version: 1.6.0
2486#
2487# This macro enables a builder to skip all functional specification targets.
2488# Combined with the specific tool checking macros XORG_WITH_*, it provides
2489# maximum flexibilty in controlling documentation building.
2490# Refer to:
2491# XORG_WITH_XMLTO         --with-xmlto
2492# XORG_WITH_ASCIIDOC      --with-asciidoc
2493# XORG_WITH_DOXYGEN       --with-doxygen
2494# XORG_WITH_FOP           --with-fop
2495# XORG_WITH_GROFF         --with-groff
2496# XORG_WITH_PS2PDF        --with-ps2pdf
2497#
2498# Interface to module:
2499# ENABLE_SPECS:		used in makefiles to conditionally generate specs
2500# --enable-specs:	'yes' user instructs the module to generate specs
2501#			'no' user instructs the module not to generate specs
2502# parm1:		specify the default value, yes or no.
2503#
2504AC_DEFUN([XORG_ENABLE_SPECS],[
2505m4_define([spec_default], m4_default([$1], [yes]))
2506AC_ARG_ENABLE(specs,
2507	AS_HELP_STRING([--enable-specs],
2508	   [Enable building the specs (default: ]spec_default[)]),
2509	   [build_specs=$enableval], [build_specs=]spec_default)
2510m4_undefine([spec_default])
2511AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2512AC_MSG_CHECKING([whether to build functional specifications])
2513AC_MSG_RESULT([$build_specs])
2514]) # XORG_ENABLE_SPECS
2515
2516# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2517# ----------------------------------------------
2518# Minimum version: 1.13.0
2519#
2520# This macro enables a builder to enable/disable unit testing
2521# It makes no assumption about the test cases implementation
2522# Test cases may or may not use Automake "Support for test suites"
2523# They may or may not use the software utility library GLib
2524#
2525# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2526# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2527# The variable enable_unit_tests is used by other macros in this file.
2528#
2529# Interface to module:
2530# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2531# enable_unit_tests:    used in configure.ac for additional configuration
2532# --enable-unit-tests:	'yes' user instructs the module to build tests
2533#			'no' user instructs the module not to build tests
2534# parm1:		specify the default value, yes or no.
2535#
2536AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2537AC_BEFORE([$0], [XORG_WITH_GLIB])
2538AC_BEFORE([$0], [XORG_LD_WRAP])
2539AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2540m4_define([_defopt], m4_default([$1], [auto]))
2541AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2542	[Enable building unit test cases (default: ]_defopt[)]),
2543	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2544m4_undefine([_defopt])
2545AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2546AC_MSG_CHECKING([whether to build unit test cases])
2547AC_MSG_RESULT([$enable_unit_tests])
2548]) # XORG_ENABLE_UNIT_TESTS
2549
2550# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2551# ------------------------------------------------------
2552# Minimum version: 1.17.0
2553#
2554# This macro enables a builder to enable/disable integration testing
2555# It makes no assumption about the test cases' implementation
2556# Test cases may or may not use Automake "Support for test suites"
2557#
2558# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2559# usually requires less dependencies and may be built and run under less
2560# stringent environments than integration tests.
2561#
2562# Interface to module:
2563# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
2564# enable_integration_tests:   used in configure.ac for additional configuration
2565# --enable-integration-tests: 'yes' user instructs the module to build tests
2566#                             'no' user instructs the module not to build tests
2567# parm1:                      specify the default value, yes or no.
2568#
2569AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2570AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2571m4_define([_defopt], m4_default([$1], [auto]))
2572AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2573	[Enable building integration test cases (default: ]_defopt[)]),
2574	[enable_integration_tests=$enableval],
2575	[enable_integration_tests=]_defopt)
2576m4_undefine([_defopt])
2577AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2578	[test "x$enable_integration_tests" != xno])
2579AC_MSG_CHECKING([whether to build unit test cases])
2580AC_MSG_RESULT([$enable_integration_tests])
2581]) # XORG_ENABLE_INTEGRATION_TESTS
2582
2583# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2584# ----------------------------------------
2585# Minimum version: 1.13.0
2586#
2587# GLib is a library which provides advanced data structures and functions.
2588# This macro enables a module to test for the presence of Glib.
2589#
2590# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2591# Otherwise the value of $enable_unit_tests is blank.
2592#
2593# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2594# test support usually requires less dependencies and may be built and run under
2595# less stringent environments than integration tests.
2596#
2597# Interface to module:
2598# HAVE_GLIB: used in makefiles to conditionally build targets
2599# with_glib: used in configure.ac to know if GLib has been found
2600# --with-glib:	'yes' user instructs the module to use glib
2601#		'no' user instructs the module not to use glib
2602#
2603AC_DEFUN([XORG_WITH_GLIB],[
2604AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2605m4_define([_defopt], m4_default([$2], [auto]))
2606AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2607	[Use GLib library for unit testing (default: ]_defopt[)]),
2608	[with_glib=$withval], [with_glib=]_defopt)
2609m4_undefine([_defopt])
2610
2611have_glib=no
2612# Do not probe GLib if user explicitly disabled unit testing
2613if test "x$enable_unit_tests" != x"no"; then
2614  # Do not probe GLib if user explicitly disabled it
2615  if test "x$with_glib" != x"no"; then
2616    m4_ifval(
2617      [$1],
2618      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2619      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2620    )
2621  fi
2622fi
2623
2624# Not having GLib when unit testing has been explicitly requested is an error
2625if test "x$enable_unit_tests" = x"yes"; then
2626  if test "x$have_glib" = x"no"; then
2627    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2628  fi
2629fi
2630
2631# Having unit testing disabled when GLib has been explicitly requested is an error
2632if test "x$enable_unit_tests" = x"no"; then
2633  if test "x$with_glib" = x"yes"; then
2634    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2635  fi
2636fi
2637
2638# Not having GLib when it has been explicitly requested is an error
2639if test "x$with_glib" = x"yes"; then
2640  if test "x$have_glib" = x"no"; then
2641    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2642  fi
2643fi
2644
2645AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2646]) # XORG_WITH_GLIB
2647
2648# XORG_LD_WRAP([required|optional])
2649# ---------------------------------
2650# Minimum version: 1.13.0
2651#
2652# Check if linker supports -wrap, passed via compiler flags
2653#
2654# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2655# Otherwise the value of $enable_unit_tests is blank.
2656#
2657# Argument added in 1.16.0 - default is "required", to match existing behavior
2658# of returning an error if enable_unit_tests is yes, and ld -wrap is not
2659# available, an argument of "optional" allows use when some unit tests require
2660# ld -wrap and others do not.
2661#
2662AC_DEFUN([XORG_LD_WRAP],[
2663XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2664    [AC_LANG_PROGRAM([#include <stdlib.h>
2665                      void __wrap_exit(int status) { return; }],
2666                     [exit(0);])])
2667# Not having ld wrap when unit testing has been explicitly requested is an error
2668if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2669  if test "x$have_ld_wrap" = x"no"; then
2670    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2671  fi
2672fi
2673AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2674#
2675]) # XORG_LD_WRAP
2676
2677# XORG_CHECK_LINKER_FLAGS
2678# -----------------------
2679# SYNOPSIS
2680#
2681#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2682#
2683# DESCRIPTION
2684#
2685#   Check whether the given linker FLAGS work with the current language's
2686#   linker, or whether they give an error.
2687#
2688#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2689#   success/failure.
2690#
2691#   PROGRAM-SOURCE is the program source to link with, if needed
2692#
2693#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2694#
2695# LICENSE
2696#
2697#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2698#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2699#   Copyright (c) 2009 Matteo Frigo
2700#
2701#   This program is free software: you can redistribute it and/or modify it
2702#   under the terms of the GNU General Public License as published by the
2703#   Free Software Foundation, either version 3 of the License, or (at your
2704#   option) any later version.
2705#
2706#   This program is distributed in the hope that it will be useful, but
2707#   WITHOUT ANY WARRANTY; without even the implied warranty of
2708#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2709#   Public License for more details.
2710#
2711#   You should have received a copy of the GNU General Public License along
2712#   with this program. If not, see <http://www.gnu.org/licenses/>.
2713#
2714#   As a special exception, the respective Autoconf Macro's copyright owner
2715#   gives unlimited permission to copy, distribute and modify the configure
2716#   scripts that are the output of Autoconf when processing the Macro. You
2717#   need not follow the terms of the GNU General Public License when using
2718#   or distributing such scripts, even though portions of the text of the
2719#   Macro appear in them. The GNU General Public License (GPL) does govern
2720#   all other use of the material that constitutes the Autoconf Macro.
2721#
2722#   This special exception to the GPL applies to versions of the Autoconf
2723#   Macro released by the Autoconf Archive. When you make and distribute a
2724#   modified version of the Autoconf Macro, you may extend this special
2725#   exception to the GPL to apply to your modified version as well.#
2726AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2727[AC_MSG_CHECKING([whether the linker accepts $1])
2728dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2729AS_LITERAL_IF([$1],
2730  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2731      ax_save_FLAGS=$LDFLAGS
2732      LDFLAGS="$1"
2733      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2734        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2735        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2736      LDFLAGS=$ax_save_FLAGS])],
2737  [ax_save_FLAGS=$LDFLAGS
2738   LDFLAGS="$1"
2739   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2740     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2741     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2742   LDFLAGS=$ax_save_FLAGS])
2743eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2744AC_MSG_RESULT($xorg_check_linker_flags)
2745if test "x$xorg_check_linker_flags" = xyes; then
2746	m4_default([$2], :)
2747else
2748	m4_default([$3], :)
2749fi
2750]) # XORG_CHECK_LINKER_FLAGS
2751
2752# XORG_MEMORY_CHECK_FLAGS
2753# -----------------------
2754# Minimum version: 1.16.0
2755#
2756# This macro attempts to find appropriate memory checking functionality
2757# for various platforms which unit testing code may use to catch various
2758# forms of memory allocation and access errors in testing.
2759#
2760# Interface to module:
2761# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2762#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
2763#
2764# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2765#
2766AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
2767
2768AC_REQUIRE([AC_CANONICAL_HOST])
2769AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2770           [Environment variables to enable memory checking in tests])
2771
2772# Check for different types of support on different platforms
2773case $host_os in
2774    solaris*)
2775        AC_CHECK_LIB([umem], [umem_alloc],
2776            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2777        ;;
2778    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2779        # both directly and inverted, so should not be 0 or 255.
2780        malloc_debug_env='MALLOC_PERTURB_=15'
2781        ;;
2782    darwin*)
2783        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2784        ;;
2785    *bsd*)
2786        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2787        ;;
2788esac
2789
2790# User supplied flags override default flags
2791if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2792    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2793fi
2794
2795AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2796]) # XORG_WITH_LINT
2797
2798# XORG_CHECK_MALLOC_ZERO
2799# ----------------------
2800# Minimum version: 1.0.0
2801#
2802# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2803# malloc(0) returns NULL.  Packages should add one of these cflags to
2804# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2805AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2806AC_ARG_ENABLE(malloc0returnsnull,
2807	AS_HELP_STRING([--enable-malloc0returnsnull],
2808		       [malloc(0) returns NULL (default: auto)]),
2809	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2810	[MALLOC_ZERO_RETURNS_NULL=auto])
2811
2812AC_MSG_CHECKING([whether malloc(0) returns NULL])
2813if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2814AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
2815	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
2816#include <stdlib.h>
2817],[
2818    char *m0, *r0, *c0, *p;
2819    m0 = malloc(0);
2820    p = malloc(10);
2821    r0 = realloc(p,0);
2822    c0 = calloc(0,10);
2823    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2824])],
2825		[xorg_cv_malloc0_returns_null=yes],
2826		[xorg_cv_malloc0_returns_null=no])])
2827MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2828fi
2829AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2830
2831if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2832	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2833	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2834	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2835else
2836	MALLOC_ZERO_CFLAGS=""
2837	XMALLOC_ZERO_CFLAGS=""
2838	XTMALLOC_ZERO_CFLAGS=""
2839fi
2840
2841AC_SUBST([MALLOC_ZERO_CFLAGS])
2842AC_SUBST([XMALLOC_ZERO_CFLAGS])
2843AC_SUBST([XTMALLOC_ZERO_CFLAGS])
2844]) # XORG_CHECK_MALLOC_ZERO
2845
2846# XORG_WITH_LINT()
2847# ----------------
2848# Minimum version: 1.1.0
2849#
2850# This macro enables the use of a tool that flags some suspicious and
2851# non-portable constructs (likely to be bugs) in C language source code.
2852# It will attempt to locate the tool and use appropriate options.
2853# There are various lint type tools on different platforms.
2854#
2855# Interface to module:
2856# LINT:		returns the path to the tool found on the platform
2857#		or the value set to LINT on the configure cmd line
2858#		also an Automake conditional
2859# LINT_FLAGS:	an Automake variable with appropriate flags
2860#
2861# --with-lint:	'yes' user instructs the module to use lint
2862#		'no' user instructs the module not to use lint (default)
2863#
2864# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2865# If the user sets the value of LINT_FLAGS, they are used verbatim.
2866#
2867AC_DEFUN([XORG_WITH_LINT],[
2868
2869AC_ARG_VAR([LINT], [Path to a lint-style command])
2870AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2871AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2872		[Use a lint-style source code checker (default: disabled)])],
2873		[use_lint=$withval], [use_lint=no])
2874
2875# Obtain platform specific info like program name and options
2876# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2877case $host_os in
2878  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2879	lint_name=splint
2880	lint_options="-badflag"
2881	;;
2882  *freebsd* | *netbsd*)
2883	lint_name=lint
2884	lint_options="-u -b"
2885	;;
2886  *solaris*)
2887	lint_name=lint
2888	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2889	;;
2890esac
2891
2892# Test for the presence of the program (either guessed by the code or spelled out by the user)
2893if test "x$use_lint" = x"yes" ; then
2894   AC_PATH_PROG([LINT], [$lint_name])
2895   if test "x$LINT" = "x"; then
2896        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2897   fi
2898elif test "x$use_lint" = x"no" ; then
2899   if test "x$LINT" != "x"; then
2900      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2901   fi
2902else
2903   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2904fi
2905
2906# User supplied flags override default flags
2907if test "x$LINT_FLAGS" != "x"; then
2908   lint_options=$LINT_FLAGS
2909fi
2910
2911AC_SUBST([LINT_FLAGS],[$lint_options])
2912AM_CONDITIONAL(LINT, [test "x$LINT" != x])
2913
2914]) # XORG_WITH_LINT
2915
2916# XORG_LINT_LIBRARY(LIBNAME)
2917# --------------------------
2918# Minimum version: 1.1.0
2919#
2920# Sets up flags for building lint libraries for checking programs that call
2921# functions in the library.
2922#
2923# Interface to module:
2924# LINTLIB		- Automake variable with the name of lint library file to make
2925# MAKE_LINT_LIB		- Automake conditional
2926#
2927# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2928#			  - 'no' user instructs the module not to create a lint library (default)
2929
2930AC_DEFUN([XORG_LINT_LIBRARY],[
2931AC_REQUIRE([XORG_WITH_LINT])
2932AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2933	[Create lint library (default: disabled)])],
2934	[make_lint_lib=$enableval], [make_lint_lib=no])
2935
2936if test "x$make_lint_lib" = x"yes" ; then
2937   LINTLIB=llib-l$1.ln
2938   if test "x$LINT" = "x"; then
2939        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2940   fi
2941elif test "x$make_lint_lib" != x"no" ; then
2942   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2943fi
2944
2945AC_SUBST(LINTLIB)
2946AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2947
2948]) # XORG_LINT_LIBRARY
2949
2950# XORG_COMPILER_BRAND
2951# -------------------
2952# Minimum version: 1.14.0
2953#
2954# Checks for various brands of compilers and sets flags as appropriate:
2955#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2956#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2957#   clang compiler - sets CLANGCC to "yes"
2958#   Intel compiler - sets INTELCC to "yes"
2959#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2960#
2961AC_DEFUN([XORG_COMPILER_BRAND], [
2962AC_LANG_CASE(
2963	[C], [
2964		AC_REQUIRE([AC_PROG_CC_C99])
2965	],
2966	[C++], [
2967		AC_REQUIRE([AC_PROG_CXX])
2968	]
2969)
2970AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2971AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2972AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2973]) # XORG_COMPILER_BRAND
2974
2975# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
2976# ---------------
2977# Minimum version: 1.16.0
2978#
2979# Test if the compiler works when passed the given flag as a command line argument.
2980# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
2981# next flag in the list until there are no more options.
2982#
2983# Note that this does not guarantee that the compiler supports the flag as some
2984# compilers will simply ignore arguments that they do not understand, but we do
2985# attempt to weed out false positives by using -Werror=unknown-warning-option and
2986# -Werror=unused-command-line-argument
2987#
2988AC_DEFUN([XORG_TESTSET_CFLAG], [
2989m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2990m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2991
2992AC_LANG_COMPILER_REQUIRE
2993
2994AC_LANG_CASE(
2995	[C], [
2996		AC_REQUIRE([AC_PROG_CC_C99])
2997		define([PREFIX], [C])
2998		define([CACHE_PREFIX], [cc])
2999		define([COMPILER], [$CC])
3000	],
3001	[C++], [
3002		define([PREFIX], [CXX])
3003		define([CACHE_PREFIX], [cxx])
3004		define([COMPILER], [$CXX])
3005	]
3006)
3007
3008[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
3009
3010if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
3011	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3012	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
3013			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
3014			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3015					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
3016					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
3017	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
3018	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3019fi
3020
3021if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
3022	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
3023		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3024	fi
3025	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3026	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
3027			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
3028			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3029					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
3030					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
3031	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
3032	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3033fi
3034
3035found="no"
3036m4_foreach([flag], m4_cdr($@), [
3037	if test $found = "no" ; then
3038		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
3039			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3040		fi
3041
3042		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
3043			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3044		fi
3045
3046		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
3047
3048dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
3049		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
3050		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
3051		AC_CACHE_VAL($cacheid,
3052			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
3053					     [eval $cacheid=yes],
3054					     [eval $cacheid=no])])
3055
3056		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3057
3058		eval supported=\$$cacheid
3059		AC_MSG_RESULT([$supported])
3060		if test "$supported" = "yes" ; then
3061			$1="$$1 ]flag["
3062			found="yes"
3063		fi
3064	fi
3065])
3066]) # XORG_TESTSET_CFLAG
3067
3068# XORG_COMPILER_FLAGS
3069# ---------------
3070# Minimum version: 1.16.0
3071#
3072# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
3073# arguments supported by the selected compiler which do NOT alter the generated
3074# code.  These arguments will cause the compiler to print various warnings
3075# during compilation AND turn a conservative set of warnings into errors.
3076#
3077# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
3078# future versions of util-macros as options are added to new compilers.
3079#
3080AC_DEFUN([XORG_COMPILER_FLAGS], [
3081AC_REQUIRE([XORG_COMPILER_BRAND])
3082
3083AC_ARG_ENABLE(selective-werror,
3084              AS_HELP_STRING([--disable-selective-werror],
3085                             [Turn off selective compiler errors. (default: enabled)]),
3086              [SELECTIVE_WERROR=$enableval],
3087              [SELECTIVE_WERROR=yes])
3088
3089AC_LANG_CASE(
3090        [C], [
3091                define([PREFIX], [C])
3092        ],
3093        [C++], [
3094                define([PREFIX], [CXX])
3095        ]
3096)
3097# -v is too short to test reliably with XORG_TESTSET_CFLAG
3098if test "x$SUNCC" = "xyes"; then
3099    [BASE_]PREFIX[FLAGS]="-v"
3100else
3101    [BASE_]PREFIX[FLAGS]=""
3102fi
3103
3104# This chunk of warnings were those that existed in the legacy CWARNFLAGS
3105XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
3106XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
3107XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
3108XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
3109
3110AC_LANG_CASE(
3111	[C], [
3112		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
3113		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
3114		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
3115		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
3116		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
3117		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
3118	]
3119)
3120
3121# This chunk adds additional warnings that could catch undesired effects.
3122XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
3123XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
3124XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
3125XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
3126XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
3127XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
3128XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
3129
3130# These are currently disabled because they are noisy.  They will be enabled
3131# in the future once the codebase is sufficiently modernized to silence
3132# them.  For now, I don't want them to drown out the other warnings.
3133# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
3134# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
3135# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
3136
3137# Turn some warnings into errors, so we don't accidently get successful builds
3138# when there are problems that should be fixed.
3139
3140if test "x$SELECTIVE_WERROR" = "xyes" ; then
3141XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
3142XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
3143XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
3144XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
3145XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
3146XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
3147XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
3148XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
3149XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
3150XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3151XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3152XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3153XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
3154else
3155AC_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])
3156XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3157XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3158XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3159XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3160XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3161XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3162XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3163XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3164XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3165XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3166XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3167XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3168XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
3169fi
3170
3171AC_SUBST([BASE_]PREFIX[FLAGS])
3172]) # XORG_COMPILER_FLAGS
3173
3174# XORG_CWARNFLAGS
3175# ---------------
3176# Minimum version: 1.2.0
3177# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3178#
3179# Defines CWARNFLAGS to enable C compiler warnings.
3180#
3181# This function is deprecated because it defines -fno-strict-aliasing
3182# which alters the code generated by the compiler.  If -fno-strict-aliasing
3183# is needed, then it should be added explicitly in the module when
3184# it is updated to use BASE_CFLAGS.
3185#
3186AC_DEFUN([XORG_CWARNFLAGS], [
3187AC_REQUIRE([XORG_COMPILER_FLAGS])
3188AC_REQUIRE([XORG_COMPILER_BRAND])
3189AC_LANG_CASE(
3190	[C], [
3191		CWARNFLAGS="$BASE_CFLAGS"
3192		if  test "x$GCC" = xyes ; then
3193		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3194		fi
3195		AC_SUBST(CWARNFLAGS)
3196	]
3197)
3198]) # XORG_CWARNFLAGS
3199
3200# XORG_STRICT_OPTION
3201# -----------------------
3202# Minimum version: 1.3.0
3203#
3204# Add configure option to enable strict compilation flags, such as treating
3205# warnings as fatal errors.
3206# If --enable-strict-compilation is passed to configure, adds strict flags to
3207# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
3208#
3209# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
3210# when strict compilation is unconditionally desired.
3211AC_DEFUN([XORG_STRICT_OPTION], [
3212AC_REQUIRE([XORG_CWARNFLAGS])
3213AC_REQUIRE([XORG_COMPILER_FLAGS])
3214
3215AC_ARG_ENABLE(strict-compilation,
3216			  AS_HELP_STRING([--enable-strict-compilation],
3217			  [Enable all warnings from compiler and make them errors (default: disabled)]),
3218			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
3219
3220AC_LANG_CASE(
3221        [C], [
3222                define([PREFIX], [C])
3223        ],
3224        [C++], [
3225                define([PREFIX], [CXX])
3226        ]
3227)
3228
3229[STRICT_]PREFIX[FLAGS]=""
3230XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3231XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3232
3233# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3234# activate it with -Werror, so we add it here explicitly.
3235XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
3236
3237if test "x$STRICT_COMPILE" = "xyes"; then
3238    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3239    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
3240fi
3241AC_SUBST([STRICT_]PREFIX[FLAGS])
3242AC_SUBST([BASE_]PREFIX[FLAGS])
3243AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
3244]) # XORG_STRICT_OPTION
3245
3246# XORG_DEFAULT_OPTIONS
3247# --------------------
3248# Minimum version: 1.3.0
3249#
3250# Defines default options for X.Org modules.
3251#
3252AC_DEFUN([XORG_DEFAULT_OPTIONS], [
3253AC_REQUIRE([AC_PROG_INSTALL])
3254XORG_COMPILER_FLAGS
3255XORG_CWARNFLAGS
3256XORG_STRICT_OPTION
3257XORG_RELEASE_VERSION
3258XORG_CHANGELOG
3259XORG_INSTALL
3260XORG_MANPAGE_SECTIONS
3261m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
3262    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
3263]) # XORG_DEFAULT_OPTIONS
3264
3265# XORG_INSTALL()
3266# ----------------
3267# Minimum version: 1.4.0
3268#
3269# Defines the variable INSTALL_CMD as the command to copy
3270# INSTALL from $prefix/share/util-macros.
3271#
3272AC_DEFUN([XORG_INSTALL], [
3273AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3274macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
3275INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
3276mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
3277|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
3278touch \$(top_srcdir)/INSTALL; \
3279echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
3280AC_SUBST([INSTALL_CMD])
3281]) # XORG_INSTALL
3282dnl Copyright 2005 Red Hat, Inc
3283dnl
3284dnl Permission to use, copy, modify, distribute, and sell this software and its
3285dnl documentation for any purpose is hereby granted without fee, provided that
3286dnl the above copyright notice appear in all copies and that both that
3287dnl copyright notice and this permission notice appear in supporting
3288dnl documentation.
3289dnl
3290dnl The above copyright notice and this permission notice shall be included
3291dnl in all copies or substantial portions of the Software.
3292dnl
3293dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3294dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3295dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3296dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3297dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3298dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3299dnl OTHER DEALINGS IN THE SOFTWARE.
3300dnl
3301dnl Except as contained in this notice, the name of the copyright holders shall
3302dnl not be used in advertising or otherwise to promote the sale, use or
3303dnl other dealings in this Software without prior written authorization
3304dnl from the copyright holders.
3305dnl
3306
3307# XORG_RELEASE_VERSION
3308# --------------------
3309# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
3310
3311AC_DEFUN([XORG_RELEASE_VERSION],[
3312	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3313		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
3314		[Major version of this package])
3315	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3316	if test "x$PVM" = "x"; then
3317		PVM="0"
3318	fi
3319	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3320		[$PVM],
3321		[Minor version of this package])
3322	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3323	if test "x$PVP" = "x"; then
3324		PVP="0"
3325	fi
3326	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3327		[$PVP],
3328		[Patch version of this package])
3329])
3330
3331# XORG_CHANGELOG()
3332# ----------------
3333# Minimum version: 1.2.0
3334#
3335# Defines the variable CHANGELOG_CMD as the command to generate
3336# ChangeLog from git.
3337#
3338#
3339AC_DEFUN([XORG_CHANGELOG], [
3340CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
3341mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3342|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
3343touch \$(top_srcdir)/ChangeLog; \
3344echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
3345AC_SUBST([CHANGELOG_CMD])
3346]) # XORG_CHANGELOG
3347
3348dnl
3349dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
3350dnl
3351dnl Permission is hereby granted, free of charge, to any person obtaining a
3352dnl copy of this software and associated documentation files (the "Software"),
3353dnl to deal in the Software without restriction, including without limitation
3354dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
3355dnl and/or sell copies of the Software, and to permit persons to whom the
3356dnl Software is furnished to do so, subject to the following conditions:
3357dnl
3358dnl The above copyright notice and this permission notice (including the next
3359dnl paragraph) shall be included in all copies or substantial portions of the
3360dnl Software.
3361dnl
3362dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3363dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3364dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
3365dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3366dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3367dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
3368dnl DEALINGS IN THE SOFTWARE.
3369dnl
3370
3371# XTRANS_TCP_FLAGS()
3372# ------------------
3373# Find needed libraries for TCP sockets, and check for IPv6 support
3374AC_DEFUN([XTRANS_TCP_FLAGS],[
3375 # SVR4 hides these in libraries other than libc
3376 AC_SEARCH_LIBS(socket, [socket])
3377 AC_SEARCH_LIBS(gethostbyname, [nsl])
3378 if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
3379   AC_CHECK_LIB([ws2_32],[main])
3380 fi
3381
3382 # Needs to come after above checks for libsocket & libnsl for SVR4 systems
3383 AC_ARG_ENABLE(ipv6,
3384	AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
3385	[IPV6CONN=$enableval],
3386	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
3387 AC_MSG_CHECKING([if IPv6 support should be built])
3388 if test "$IPV6CONN" = "yes"; then
3389	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
3390 fi
3391 AC_MSG_RESULT($IPV6CONN)
3392
3393 # 4.3BSD-Reno added a new member to struct sockaddr_in
3394 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
3395	AC_DEFINE([BSD44SOCKETS],1,
3396 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
3397#include <sys/types.h>
3398#include <sys/socket.h>
3399#include <netinet/in.h>
3400 ])
3401
3402 # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
3403 AC_CHECK_TYPES([socklen_t], [], [], [
3404AC_INCLUDES_DEFAULT
3405#include <sys/socket.h>])
3406
3407 # XPG4v2/UNIX95 added msg_control - check to see if we need to define
3408 # _XOPEN_SOURCE to get it (such as on Solaris)
3409 AC_CHECK_MEMBER([struct msghdr.msg_control], [], [],
3410                 [
3411AC_INCLUDES_DEFAULT
3412#include <sys/socket.h>
3413                 ])
3414 # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03
3415 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
3416     unset ac_cv_member_struct_msghdr_msg_control
3417     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600])
3418     AC_CHECK_MEMBER([struct msghdr.msg_control],
3419                     [AC_DEFINE([_XOPEN_SOURCE], [600],
3420                       [Defined if needed to expose struct msghdr.msg_control])
3421                     ], [], [
3422#define _XOPEN_SOURCE 600
3423AC_INCLUDES_DEFAULT
3424#include <sys/socket.h>
3425                     ])
3426 fi
3427 # If that didn't work, fall back to XPG5/UNIX98 with C89
3428 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
3429     unset ac_cv_member_struct_msghdr_msg_control
3430     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500])
3431     AC_CHECK_MEMBER([struct msghdr.msg_control],
3432                     [AC_DEFINE([_XOPEN_SOURCE], [500],
3433                       [Defined if needed to expose struct msghdr.msg_control])
3434                     ], [], [
3435#define _XOPEN_SOURCE 500
3436AC_INCLUDES_DEFAULT
3437#include <sys/socket.h>
3438                     ])
3439 fi
3440
3441
3442]) # XTRANS_TCP_FLAGS
3443
3444# XTRANS_CONNECTION_FLAGS()
3445# -------------------------
3446# Standard checks for which Xtrans transports to use by the Xorg packages
3447# that use Xtrans functions
3448AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
3449 AC_REQUIRE([AC_CANONICAL_HOST])
3450 [case $host_os in
3451	mingw*)	unixdef="no"   ;;
3452	*)	unixdef="yes"  ;;
3453 esac]
3454 AC_ARG_ENABLE(unix-transport,
3455	AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
3456	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
3457 AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
3458 if test "$UNIXCONN" = "yes"; then
3459	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
3460 fi
3461 AC_MSG_RESULT($UNIXCONN)
3462 AC_ARG_ENABLE(tcp-transport,
3463	AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
3464	[TCPCONN=$enableval], [TCPCONN=yes])
3465 AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
3466 AC_MSG_RESULT($TCPCONN)
3467 if test "$TCPCONN" = "yes"; then
3468	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
3469	XTRANS_TCP_FLAGS
3470 fi
3471 [case $host_os in
3472	solaris*|sco*|sysv4*)	localdef="yes" ;;
3473	*)			localdef="no"  ;;
3474 esac]
3475 AC_ARG_ENABLE(local-transport,
3476	AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
3477	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
3478 AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
3479 AC_MSG_RESULT($LOCALCONN)
3480 if test "$LOCALCONN" = "yes"; then
3481	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
3482 fi
3483
3484 # Other functions Xtrans may need
3485 AC_CHECK_FUNCS([strcasecmp strlcpy])
3486
3487]) # XTRANS_CONNECTION_FLAGS
3488
3489
3490# XTRANS_SECURE_RPC_FLAGS()
3491# -------------------------
3492# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
3493# so that any necessary networking libraries are already found
3494AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
3495[AC_REQUIRE([XTRANS_TCP_FLAGS])
3496 AC_ARG_ENABLE(secure-rpc,
3497	AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
3498        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
3499
3500 if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
3501	FOUND_SECURE_RPC="no"
3502	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
3503			[FOUND_SECURE_RPC="yes"])
3504	if test "x$FOUND_SECURE_RPC" = "xno" ; then
3505		if test "x$SECURE_RPC" = "xyes" ; then
3506	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
3507		fi
3508		SECURE_RPC="no"
3509	else
3510		dnl FreeBSD keeps getsecretkey in librpcsvc
3511		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
3512		SECURE_RPC="yes"
3513	fi
3514 fi
3515 AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
3516 if test "x$SECURE_RPC" = "xyes" ; then
3517	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
3518 fi
3519 AC_MSG_RESULT($SECURE_RPC)
3520]) # XTRANS_SECURE_RPC_FLAGS
3521
3522
3523# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
3524#
3525#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
3526#   Written by Gordon Matzigkeit, 1996
3527#
3528# This file is free software; the Free Software Foundation gives
3529# unlimited permission to copy and/or distribute it, with or without
3530# modifications, as long as this notice is preserved.
3531
3532m4_define([_LT_COPYING], [dnl
3533# Copyright (C) 2014 Free Software Foundation, Inc.
3534# This is free software; see the source for copying conditions.  There is NO
3535# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3536
3537# GNU Libtool is free software; you can redistribute it and/or modify
3538# it under the terms of the GNU General Public License as published by
3539# the Free Software Foundation; either version 2 of of the License, or
3540# (at your option) any later version.
3541#
3542# As a special exception to the GNU General Public License, if you
3543# distribute this file as part of a program or library that is built
3544# using GNU Libtool, you may include this file under the  same
3545# distribution terms that you use for the rest of that program.
3546#
3547# GNU Libtool is distributed in the hope that it will be useful, but
3548# WITHOUT ANY WARRANTY; without even the implied warranty of
3549# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3550# GNU General Public License for more details.
3551#
3552# You should have received a copy of the GNU General Public License
3553# along with this program.  If not, see <http://www.gnu.org/licenses/>.
3554])
3555
3556# serial 58 LT_INIT
3557
3558
3559# LT_PREREQ(VERSION)
3560# ------------------
3561# Complain and exit if this libtool version is less that VERSION.
3562m4_defun([LT_PREREQ],
3563[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
3564       [m4_default([$3],
3565		   [m4_fatal([Libtool version $1 or higher is required],
3566		             63)])],
3567       [$2])])
3568
3569
3570# _LT_CHECK_BUILDDIR
3571# ------------------
3572# Complain if the absolute build directory name contains unusual characters
3573m4_defun([_LT_CHECK_BUILDDIR],
3574[case `pwd` in
3575  *\ * | *\	*)
3576    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
3577esac
3578])
3579
3580
3581# LT_INIT([OPTIONS])
3582# ------------------
3583AC_DEFUN([LT_INIT],
3584[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
3585AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3586AC_BEFORE([$0], [LT_LANG])dnl
3587AC_BEFORE([$0], [LT_OUTPUT])dnl
3588AC_BEFORE([$0], [LTDL_INIT])dnl
3589m4_require([_LT_CHECK_BUILDDIR])dnl
3590
3591dnl Autoconf doesn't catch unexpanded LT_ macros by default:
3592m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
3593m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
3594dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
3595dnl unless we require an AC_DEFUNed macro:
3596AC_REQUIRE([LTOPTIONS_VERSION])dnl
3597AC_REQUIRE([LTSUGAR_VERSION])dnl
3598AC_REQUIRE([LTVERSION_VERSION])dnl
3599AC_REQUIRE([LTOBSOLETE_VERSION])dnl
3600m4_require([_LT_PROG_LTMAIN])dnl
3601
3602_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
3603
3604dnl Parse OPTIONS
3605_LT_SET_OPTIONS([$0], [$1])
3606
3607# This can be used to rebuild libtool when needed
3608LIBTOOL_DEPS=$ltmain
3609
3610# Always use our own libtool.
3611LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3612AC_SUBST(LIBTOOL)dnl
3613
3614_LT_SETUP
3615
3616# Only expand once:
3617m4_define([LT_INIT])
3618])# LT_INIT
3619
3620# Old names:
3621AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
3622AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
3623dnl aclocal-1.4 backwards compatibility:
3624dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
3625dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
3626
3627
3628# _LT_PREPARE_CC_BASENAME
3629# -----------------------
3630m4_defun([_LT_PREPARE_CC_BASENAME], [
3631# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
3632func_cc_basename ()
3633{
3634    for cc_temp in @S|@*""; do
3635      case $cc_temp in
3636        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
3637        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
3638        \-*) ;;
3639        *) break;;
3640      esac
3641    done
3642    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
3643}
3644])# _LT_PREPARE_CC_BASENAME
3645
3646
3647# _LT_CC_BASENAME(CC)
3648# -------------------
3649# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
3650# but that macro is also expanded into generated libtool script, which
3651# arranges for $SED and $ECHO to be set by different means.
3652m4_defun([_LT_CC_BASENAME],
3653[m4_require([_LT_PREPARE_CC_BASENAME])dnl
3654AC_REQUIRE([_LT_DECL_SED])dnl
3655AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
3656func_cc_basename $1
3657cc_basename=$func_cc_basename_result
3658])
3659
3660
3661# _LT_FILEUTILS_DEFAULTS
3662# ----------------------
3663# It is okay to use these file commands and assume they have been set
3664# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
3665m4_defun([_LT_FILEUTILS_DEFAULTS],
3666[: ${CP="cp -f"}
3667: ${MV="mv -f"}
3668: ${RM="rm -f"}
3669])# _LT_FILEUTILS_DEFAULTS
3670
3671
3672# _LT_SETUP
3673# ---------
3674m4_defun([_LT_SETUP],
3675[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3676AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3677AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
3678AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
3679
3680_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
3681dnl
3682_LT_DECL([], [host_alias], [0], [The host system])dnl
3683_LT_DECL([], [host], [0])dnl
3684_LT_DECL([], [host_os], [0])dnl
3685dnl
3686_LT_DECL([], [build_alias], [0], [The build system])dnl
3687_LT_DECL([], [build], [0])dnl
3688_LT_DECL([], [build_os], [0])dnl
3689dnl
3690AC_REQUIRE([AC_PROG_CC])dnl
3691AC_REQUIRE([LT_PATH_LD])dnl
3692AC_REQUIRE([LT_PATH_NM])dnl
3693dnl
3694AC_REQUIRE([AC_PROG_LN_S])dnl
3695test -z "$LN_S" && LN_S="ln -s"
3696_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
3697dnl
3698AC_REQUIRE([LT_CMD_MAX_LEN])dnl
3699_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
3700_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
3701dnl
3702m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3703m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3704m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
3705m4_require([_LT_CMD_RELOAD])dnl
3706m4_require([_LT_CHECK_MAGIC_METHOD])dnl
3707m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
3708m4_require([_LT_CMD_OLD_ARCHIVE])dnl
3709m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
3710m4_require([_LT_WITH_SYSROOT])dnl
3711m4_require([_LT_CMD_TRUNCATE])dnl
3712
3713_LT_CONFIG_LIBTOOL_INIT([
3714# See if we are running on zsh, and set the options that allow our
3715# commands through without removal of \ escapes INIT.
3716if test -n "\${ZSH_VERSION+set}"; then
3717   setopt NO_GLOB_SUBST
3718fi
3719])
3720if test -n "${ZSH_VERSION+set}"; then
3721   setopt NO_GLOB_SUBST
3722fi
3723
3724_LT_CHECK_OBJDIR
3725
3726m4_require([_LT_TAG_COMPILER])dnl
3727
3728case $host_os in
3729aix3*)
3730  # AIX sometimes has problems with the GCC collect2 program.  For some
3731  # reason, if we set the COLLECT_NAMES environment variable, the problems
3732  # vanish in a puff of smoke.
3733  if test set != "${COLLECT_NAMES+set}"; then
3734    COLLECT_NAMES=
3735    export COLLECT_NAMES
3736  fi
3737  ;;
3738esac
3739
3740# Global variables:
3741ofile=libtool
3742can_build_shared=yes
3743
3744# All known linkers require a '.a' archive for static linking (except MSVC,
3745# which needs '.lib').
3746libext=a
3747
3748with_gnu_ld=$lt_cv_prog_gnu_ld
3749
3750old_CC=$CC
3751old_CFLAGS=$CFLAGS
3752
3753# Set sane defaults for various variables
3754test -z "$CC" && CC=cc
3755test -z "$LTCC" && LTCC=$CC
3756test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
3757test -z "$LD" && LD=ld
3758test -z "$ac_objext" && ac_objext=o
3759
3760_LT_CC_BASENAME([$compiler])
3761
3762# Only perform the check for file, if the check method requires it
3763test -z "$MAGIC_CMD" && MAGIC_CMD=file
3764case $deplibs_check_method in
3765file_magic*)
3766  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
3767    _LT_PATH_MAGIC
3768  fi
3769  ;;
3770esac
3771
3772# Use C for the default configuration in the libtool script
3773LT_SUPPORTED_TAG([CC])
3774_LT_LANG_C_CONFIG
3775_LT_LANG_DEFAULT_CONFIG
3776_LT_CONFIG_COMMANDS
3777])# _LT_SETUP
3778
3779
3780# _LT_PREPARE_SED_QUOTE_VARS
3781# --------------------------
3782# Define a few sed substitution that help us do robust quoting.
3783m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
3784[# Backslashify metacharacters that are still active within
3785# double-quoted strings.
3786sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
3787
3788# Same as above, but do not quote variable references.
3789double_quote_subst='s/\([["`\\]]\)/\\\1/g'
3790
3791# Sed substitution to delay expansion of an escaped shell variable in a
3792# double_quote_subst'ed string.
3793delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
3794
3795# Sed substitution to delay expansion of an escaped single quote.
3796delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
3797
3798# Sed substitution to avoid accidental globbing in evaled expressions
3799no_glob_subst='s/\*/\\\*/g'
3800])
3801
3802# _LT_PROG_LTMAIN
3803# ---------------
3804# Note that this code is called both from 'configure', and 'config.status'
3805# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
3806# 'config.status' has no value for ac_aux_dir unless we are using Automake,
3807# so we pass a copy along to make sure it has a sensible value anyway.
3808m4_defun([_LT_PROG_LTMAIN],
3809[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3810_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3811ltmain=$ac_aux_dir/ltmain.sh
3812])# _LT_PROG_LTMAIN
3813
3814
3815
3816# So that we can recreate a full libtool script including additional
3817# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3818# in macros and then make a single call at the end using the 'libtool'
3819# label.
3820
3821
3822# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3823# ----------------------------------------
3824# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3825m4_define([_LT_CONFIG_LIBTOOL_INIT],
3826[m4_ifval([$1],
3827          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3828                     [$1
3829])])])
3830
3831# Initialize.
3832m4_define([_LT_OUTPUT_LIBTOOL_INIT])
3833
3834
3835# _LT_CONFIG_LIBTOOL([COMMANDS])
3836# ------------------------------
3837# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3838m4_define([_LT_CONFIG_LIBTOOL],
3839[m4_ifval([$1],
3840          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3841                     [$1
3842])])])
3843
3844# Initialize.
3845m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3846
3847
3848# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3849# -----------------------------------------------------
3850m4_defun([_LT_CONFIG_SAVE_COMMANDS],
3851[_LT_CONFIG_LIBTOOL([$1])
3852_LT_CONFIG_LIBTOOL_INIT([$2])
3853])
3854
3855
3856# _LT_FORMAT_COMMENT([COMMENT])
3857# -----------------------------
3858# Add leading comment marks to the start of each line, and a trailing
3859# full-stop to the whole comment if one is not present already.
3860m4_define([_LT_FORMAT_COMMENT],
3861[m4_ifval([$1], [
3862m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3863              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3864)])
3865
3866
3867
3868
3869
3870# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3871# -------------------------------------------------------------------
3872# CONFIGNAME is the name given to the value in the libtool script.
3873# VARNAME is the (base) name used in the configure script.
3874# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3875# VARNAME.  Any other value will be used directly.
3876m4_define([_LT_DECL],
3877[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3878    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3879	[m4_ifval([$1], [$1], [$2])])
3880    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3881    m4_ifval([$4],
3882	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3883    lt_dict_add_subkey([lt_decl_dict], [$2],
3884	[tagged?], [m4_ifval([$5], [yes], [no])])])
3885])
3886
3887
3888# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3889# --------------------------------------------------------
3890m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3891
3892
3893# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3894# ------------------------------------------------
3895m4_define([lt_decl_tag_varnames],
3896[_lt_decl_filter([tagged?], [yes], $@)])
3897
3898
3899# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3900# ---------------------------------------------------------
3901m4_define([_lt_decl_filter],
3902[m4_case([$#],
3903  [0], [m4_fatal([$0: too few arguments: $#])],
3904  [1], [m4_fatal([$0: too few arguments: $#: $1])],
3905  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3906  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3907  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3908])
3909
3910
3911# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
3912# --------------------------------------------------
3913m4_define([lt_decl_quote_varnames],
3914[_lt_decl_filter([value], [1], $@)])
3915
3916
3917# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
3918# ---------------------------------------------------
3919m4_define([lt_decl_dquote_varnames],
3920[_lt_decl_filter([value], [2], $@)])
3921
3922
3923# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
3924# ---------------------------------------------------
3925m4_define([lt_decl_varnames_tagged],
3926[m4_assert([$# <= 2])dnl
3927_$0(m4_quote(m4_default([$1], [[, ]])),
3928    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
3929    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
3930m4_define([_lt_decl_varnames_tagged],
3931[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
3932
3933
3934# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
3935# ------------------------------------------------
3936m4_define([lt_decl_all_varnames],
3937[_$0(m4_quote(m4_default([$1], [[, ]])),
3938     m4_if([$2], [],
3939	   m4_quote(lt_decl_varnames),
3940	m4_quote(m4_shift($@))))[]dnl
3941])
3942m4_define([_lt_decl_all_varnames],
3943[lt_join($@, lt_decl_varnames_tagged([$1],
3944			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
3945])
3946
3947
3948# _LT_CONFIG_STATUS_DECLARE([VARNAME])
3949# ------------------------------------
3950# Quote a variable value, and forward it to 'config.status' so that its
3951# declaration there will have the same value as in 'configure'.  VARNAME
3952# must have a single quote delimited value for this to work.
3953m4_define([_LT_CONFIG_STATUS_DECLARE],
3954[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
3955
3956
3957# _LT_CONFIG_STATUS_DECLARATIONS
3958# ------------------------------
3959# We delimit libtool config variables with single quotes, so when
3960# we write them to config.status, we have to be sure to quote all
3961# embedded single quotes properly.  In configure, this macro expands
3962# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
3963#
3964#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
3965m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
3966[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
3967    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
3968
3969
3970# _LT_LIBTOOL_TAGS
3971# ----------------
3972# Output comment and list of tags supported by the script
3973m4_defun([_LT_LIBTOOL_TAGS],
3974[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
3975available_tags='_LT_TAGS'dnl
3976])
3977
3978
3979# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
3980# -----------------------------------
3981# Extract the dictionary values for VARNAME (optionally with TAG) and
3982# expand to a commented shell variable setting:
3983#
3984#    # Some comment about what VAR is for.
3985#    visible_name=$lt_internal_name
3986m4_define([_LT_LIBTOOL_DECLARE],
3987[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
3988					   [description])))[]dnl
3989m4_pushdef([_libtool_name],
3990    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
3991m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
3992    [0], [_libtool_name=[$]$1],
3993    [1], [_libtool_name=$lt_[]$1],
3994    [2], [_libtool_name=$lt_[]$1],
3995    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
3996m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
3997])
3998
3999
4000# _LT_LIBTOOL_CONFIG_VARS
4001# -----------------------
4002# Produce commented declarations of non-tagged libtool config variables
4003# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
4004# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
4005# section) are produced by _LT_LIBTOOL_TAG_VARS.
4006m4_defun([_LT_LIBTOOL_CONFIG_VARS],
4007[m4_foreach([_lt_var],
4008    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
4009    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
4010
4011
4012# _LT_LIBTOOL_TAG_VARS(TAG)
4013# -------------------------
4014m4_define([_LT_LIBTOOL_TAG_VARS],
4015[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
4016    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
4017
4018
4019# _LT_TAGVAR(VARNAME, [TAGNAME])
4020# ------------------------------
4021m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
4022
4023
4024# _LT_CONFIG_COMMANDS
4025# -------------------
4026# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
4027# variables for single and double quote escaping we saved from calls
4028# to _LT_DECL, we can put quote escaped variables declarations
4029# into 'config.status', and then the shell code to quote escape them in
4030# for loops in 'config.status'.  Finally, any additional code accumulated
4031# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
4032m4_defun([_LT_CONFIG_COMMANDS],
4033[AC_PROVIDE_IFELSE([LT_OUTPUT],
4034	dnl If the libtool generation code has been placed in $CONFIG_LT,
4035	dnl instead of duplicating it all over again into config.status,
4036	dnl then we will have config.status run $CONFIG_LT later, so it
4037	dnl needs to know what name is stored there:
4038        [AC_CONFIG_COMMANDS([libtool],
4039            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
4040    dnl If the libtool generation code is destined for config.status,
4041    dnl expand the accumulated commands and init code now:
4042    [AC_CONFIG_COMMANDS([libtool],
4043        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
4044])#_LT_CONFIG_COMMANDS
4045
4046
4047# Initialize.
4048m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
4049[
4050
4051# The HP-UX ksh and POSIX shell print the target directory to stdout
4052# if CDPATH is set.
4053(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4054
4055sed_quote_subst='$sed_quote_subst'
4056double_quote_subst='$double_quote_subst'
4057delay_variable_subst='$delay_variable_subst'
4058_LT_CONFIG_STATUS_DECLARATIONS
4059LTCC='$LTCC'
4060LTCFLAGS='$LTCFLAGS'
4061compiler='$compiler_DEFAULT'
4062
4063# A function that is used when there is no print builtin or printf.
4064func_fallback_echo ()
4065{
4066  eval 'cat <<_LTECHO_EOF
4067\$[]1
4068_LTECHO_EOF'
4069}
4070
4071# Quote evaled strings.
4072for var in lt_decl_all_varnames([[ \
4073]], lt_decl_quote_varnames); do
4074    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
4075    *[[\\\\\\\`\\"\\\$]]*)
4076      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
4077      ;;
4078    *)
4079      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
4080      ;;
4081    esac
4082done
4083
4084# Double-quote double-evaled strings.
4085for var in lt_decl_all_varnames([[ \
4086]], lt_decl_dquote_varnames); do
4087    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
4088    *[[\\\\\\\`\\"\\\$]]*)
4089      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
4090      ;;
4091    *)
4092      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
4093      ;;
4094    esac
4095done
4096
4097_LT_OUTPUT_LIBTOOL_INIT
4098])
4099
4100# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
4101# ------------------------------------
4102# Generate a child script FILE with all initialization necessary to
4103# reuse the environment learned by the parent script, and make the
4104# file executable.  If COMMENT is supplied, it is inserted after the
4105# '#!' sequence but before initialization text begins.  After this
4106# macro, additional text can be appended to FILE to form the body of
4107# the child script.  The macro ends with non-zero status if the
4108# file could not be fully written (such as if the disk is full).
4109m4_ifdef([AS_INIT_GENERATED],
4110[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
4111[m4_defun([_LT_GENERATED_FILE_INIT],
4112[m4_require([AS_PREPARE])]dnl
4113[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
4114[lt_write_fail=0
4115cat >$1 <<_ASEOF || lt_write_fail=1
4116#! $SHELL
4117# Generated by $as_me.
4118$2
4119SHELL=\${CONFIG_SHELL-$SHELL}
4120export SHELL
4121_ASEOF
4122cat >>$1 <<\_ASEOF || lt_write_fail=1
4123AS_SHELL_SANITIZE
4124_AS_PREPARE
4125exec AS_MESSAGE_FD>&1
4126_ASEOF
4127test 0 = "$lt_write_fail" && chmod +x $1[]dnl
4128m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
4129
4130# LT_OUTPUT
4131# ---------
4132# This macro allows early generation of the libtool script (before
4133# AC_OUTPUT is called), incase it is used in configure for compilation
4134# tests.
4135AC_DEFUN([LT_OUTPUT],
4136[: ${CONFIG_LT=./config.lt}
4137AC_MSG_NOTICE([creating $CONFIG_LT])
4138_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
4139[# Run this file to recreate a libtool stub with the current configuration.])
4140
4141cat >>"$CONFIG_LT" <<\_LTEOF
4142lt_cl_silent=false
4143exec AS_MESSAGE_LOG_FD>>config.log
4144{
4145  echo
4146  AS_BOX([Running $as_me.])
4147} >&AS_MESSAGE_LOG_FD
4148
4149lt_cl_help="\
4150'$as_me' creates a local libtool stub from the current configuration,
4151for use in further configure time tests before the real libtool is
4152generated.
4153
4154Usage: $[0] [[OPTIONS]]
4155
4156  -h, --help      print this help, then exit
4157  -V, --version   print version number, then exit
4158  -q, --quiet     do not print progress messages
4159  -d, --debug     don't remove temporary files
4160
4161Report bugs to <bug-libtool@gnu.org>."
4162
4163lt_cl_version="\
4164m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
4165m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
4166configured by $[0], generated by m4_PACKAGE_STRING.
4167
4168Copyright (C) 2011 Free Software Foundation, Inc.
4169This config.lt script is free software; the Free Software Foundation
4170gives unlimited permision to copy, distribute and modify it."
4171
4172while test 0 != $[#]
4173do
4174  case $[1] in
4175    --version | --v* | -V )
4176      echo "$lt_cl_version"; exit 0 ;;
4177    --help | --h* | -h )
4178      echo "$lt_cl_help"; exit 0 ;;
4179    --debug | --d* | -d )
4180      debug=: ;;
4181    --quiet | --q* | --silent | --s* | -q )
4182      lt_cl_silent=: ;;
4183
4184    -*) AC_MSG_ERROR([unrecognized option: $[1]
4185Try '$[0] --help' for more information.]) ;;
4186
4187    *) AC_MSG_ERROR([unrecognized argument: $[1]
4188Try '$[0] --help' for more information.]) ;;
4189  esac
4190  shift
4191done
4192
4193if $lt_cl_silent; then
4194  exec AS_MESSAGE_FD>/dev/null
4195fi
4196_LTEOF
4197
4198cat >>"$CONFIG_LT" <<_LTEOF
4199_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
4200_LTEOF
4201
4202cat >>"$CONFIG_LT" <<\_LTEOF
4203AC_MSG_NOTICE([creating $ofile])
4204_LT_OUTPUT_LIBTOOL_COMMANDS
4205AS_EXIT(0)
4206_LTEOF
4207chmod +x "$CONFIG_LT"
4208
4209# configure is writing to config.log, but config.lt does its own redirection,
4210# appending to config.log, which fails on DOS, as config.log is still kept
4211# open by configure.  Here we exec the FD to /dev/null, effectively closing
4212# config.log, so it can be properly (re)opened and appended to by config.lt.
4213lt_cl_success=:
4214test yes = "$silent" &&
4215  lt_config_lt_args="$lt_config_lt_args --quiet"
4216exec AS_MESSAGE_LOG_FD>/dev/null
4217$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
4218exec AS_MESSAGE_LOG_FD>>config.log
4219$lt_cl_success || AS_EXIT(1)
4220])# LT_OUTPUT
4221
4222
4223# _LT_CONFIG(TAG)
4224# ---------------
4225# If TAG is the built-in tag, create an initial libtool script with a
4226# default configuration from the untagged config vars.  Otherwise add code
4227# to config.status for appending the configuration named by TAG from the
4228# matching tagged config vars.
4229m4_defun([_LT_CONFIG],
4230[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4231_LT_CONFIG_SAVE_COMMANDS([
4232  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
4233  m4_if(_LT_TAG, [C], [
4234    # See if we are running on zsh, and set the options that allow our
4235    # commands through without removal of \ escapes.
4236    if test -n "${ZSH_VERSION+set}"; then
4237      setopt NO_GLOB_SUBST
4238    fi
4239
4240    cfgfile=${ofile}T
4241    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
4242    $RM "$cfgfile"
4243
4244    cat <<_LT_EOF >> "$cfgfile"
4245#! $SHELL
4246# Generated automatically by $as_me ($PACKAGE) $VERSION
4247# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4248# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4249
4250# Provide generalized library-building support services.
4251# Written by Gordon Matzigkeit, 1996
4252
4253_LT_COPYING
4254_LT_LIBTOOL_TAGS
4255
4256# Configured defaults for sys_lib_dlsearch_path munging.
4257: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
4258
4259# ### BEGIN LIBTOOL CONFIG
4260_LT_LIBTOOL_CONFIG_VARS
4261_LT_LIBTOOL_TAG_VARS
4262# ### END LIBTOOL CONFIG
4263
4264_LT_EOF
4265
4266    cat <<'_LT_EOF' >> "$cfgfile"
4267
4268# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
4269
4270_LT_PREPARE_MUNGE_PATH_LIST
4271_LT_PREPARE_CC_BASENAME
4272
4273# ### END FUNCTIONS SHARED WITH CONFIGURE
4274
4275_LT_EOF
4276
4277  case $host_os in
4278  aix3*)
4279    cat <<\_LT_EOF >> "$cfgfile"
4280# AIX sometimes has problems with the GCC collect2 program.  For some
4281# reason, if we set the COLLECT_NAMES environment variable, the problems
4282# vanish in a puff of smoke.
4283if test set != "${COLLECT_NAMES+set}"; then
4284  COLLECT_NAMES=
4285  export COLLECT_NAMES
4286fi
4287_LT_EOF
4288    ;;
4289  esac
4290
4291  _LT_PROG_LTMAIN
4292
4293  # We use sed instead of cat because bash on DJGPP gets confused if
4294  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4295  # text mode, it properly converts lines to CR/LF.  This bash problem
4296  # is reportedly fixed, but why not run on old versions too?
4297  sed '$q' "$ltmain" >> "$cfgfile" \
4298     || (rm -f "$cfgfile"; exit 1)
4299
4300   mv -f "$cfgfile" "$ofile" ||
4301    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4302  chmod +x "$ofile"
4303],
4304[cat <<_LT_EOF >> "$ofile"
4305
4306dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
4307dnl in a comment (ie after a #).
4308# ### BEGIN LIBTOOL TAG CONFIG: $1
4309_LT_LIBTOOL_TAG_VARS(_LT_TAG)
4310# ### END LIBTOOL TAG CONFIG: $1
4311_LT_EOF
4312])dnl /m4_if
4313],
4314[m4_if([$1], [], [
4315    PACKAGE='$PACKAGE'
4316    VERSION='$VERSION'
4317    RM='$RM'
4318    ofile='$ofile'], [])
4319])dnl /_LT_CONFIG_SAVE_COMMANDS
4320])# _LT_CONFIG
4321
4322
4323# LT_SUPPORTED_TAG(TAG)
4324# ---------------------
4325# Trace this macro to discover what tags are supported by the libtool
4326# --tag option, using:
4327#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
4328AC_DEFUN([LT_SUPPORTED_TAG], [])
4329
4330
4331# C support is built-in for now
4332m4_define([_LT_LANG_C_enabled], [])
4333m4_define([_LT_TAGS], [])
4334
4335
4336# LT_LANG(LANG)
4337# -------------
4338# Enable libtool support for the given language if not already enabled.
4339AC_DEFUN([LT_LANG],
4340[AC_BEFORE([$0], [LT_OUTPUT])dnl
4341m4_case([$1],
4342  [C],			[_LT_LANG(C)],
4343  [C++],		[_LT_LANG(CXX)],
4344  [Go],			[_LT_LANG(GO)],
4345  [Java],		[_LT_LANG(GCJ)],
4346  [Fortran 77],		[_LT_LANG(F77)],
4347  [Fortran],		[_LT_LANG(FC)],
4348  [Windows Resource],	[_LT_LANG(RC)],
4349  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
4350    [_LT_LANG($1)],
4351    [m4_fatal([$0: unsupported language: "$1"])])])dnl
4352])# LT_LANG
4353
4354
4355# _LT_LANG(LANGNAME)
4356# ------------------
4357m4_defun([_LT_LANG],
4358[m4_ifdef([_LT_LANG_]$1[_enabled], [],
4359  [LT_SUPPORTED_TAG([$1])dnl
4360  m4_append([_LT_TAGS], [$1 ])dnl
4361  m4_define([_LT_LANG_]$1[_enabled], [])dnl
4362  _LT_LANG_$1_CONFIG($1)])dnl
4363])# _LT_LANG
4364
4365
4366m4_ifndef([AC_PROG_GO], [
4367# NOTE: This macro has been submitted for inclusion into   #
4368#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
4369#  a released version of Autoconf we should remove this    #
4370#  macro and use it instead.                               #
4371m4_defun([AC_PROG_GO],
4372[AC_LANG_PUSH(Go)dnl
4373AC_ARG_VAR([GOC],     [Go compiler command])dnl
4374AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
4375_AC_ARG_VAR_LDFLAGS()dnl
4376AC_CHECK_TOOL(GOC, gccgo)
4377if test -z "$GOC"; then
4378  if test -n "$ac_tool_prefix"; then
4379    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
4380  fi
4381fi
4382if test -z "$GOC"; then
4383  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
4384fi
4385])#m4_defun
4386])#m4_ifndef
4387
4388
4389# _LT_LANG_DEFAULT_CONFIG
4390# -----------------------
4391m4_defun([_LT_LANG_DEFAULT_CONFIG],
4392[AC_PROVIDE_IFELSE([AC_PROG_CXX],
4393  [LT_LANG(CXX)],
4394  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
4395
4396AC_PROVIDE_IFELSE([AC_PROG_F77],
4397  [LT_LANG(F77)],
4398  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
4399
4400AC_PROVIDE_IFELSE([AC_PROG_FC],
4401  [LT_LANG(FC)],
4402  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
4403
4404dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
4405dnl pulling things in needlessly.
4406AC_PROVIDE_IFELSE([AC_PROG_GCJ],
4407  [LT_LANG(GCJ)],
4408  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
4409    [LT_LANG(GCJ)],
4410    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
4411      [LT_LANG(GCJ)],
4412      [m4_ifdef([AC_PROG_GCJ],
4413	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
4414       m4_ifdef([A][M_PROG_GCJ],
4415	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
4416       m4_ifdef([LT_PROG_GCJ],
4417	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
4418
4419AC_PROVIDE_IFELSE([AC_PROG_GO],
4420  [LT_LANG(GO)],
4421  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
4422
4423AC_PROVIDE_IFELSE([LT_PROG_RC],
4424  [LT_LANG(RC)],
4425  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
4426])# _LT_LANG_DEFAULT_CONFIG
4427
4428# Obsolete macros:
4429AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
4430AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
4431AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
4432AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
4433AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
4434dnl aclocal-1.4 backwards compatibility:
4435dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
4436dnl AC_DEFUN([AC_LIBTOOL_F77], [])
4437dnl AC_DEFUN([AC_LIBTOOL_FC], [])
4438dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
4439dnl AC_DEFUN([AC_LIBTOOL_RC], [])
4440
4441
4442# _LT_TAG_COMPILER
4443# ----------------
4444m4_defun([_LT_TAG_COMPILER],
4445[AC_REQUIRE([AC_PROG_CC])dnl
4446
4447_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
4448_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
4449_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
4450_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
4451
4452# If no C compiler was specified, use CC.
4453LTCC=${LTCC-"$CC"}
4454
4455# If no C compiler flags were specified, use CFLAGS.
4456LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
4457
4458# Allow CC to be a program name with arguments.
4459compiler=$CC
4460])# _LT_TAG_COMPILER
4461
4462
4463# _LT_COMPILER_BOILERPLATE
4464# ------------------------
4465# Check for compiler boilerplate output or warnings with
4466# the simple compiler test code.
4467m4_defun([_LT_COMPILER_BOILERPLATE],
4468[m4_require([_LT_DECL_SED])dnl
4469ac_outfile=conftest.$ac_objext
4470echo "$lt_simple_compile_test_code" >conftest.$ac_ext
4471eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
4472_lt_compiler_boilerplate=`cat conftest.err`
4473$RM conftest*
4474])# _LT_COMPILER_BOILERPLATE
4475
4476
4477# _LT_LINKER_BOILERPLATE
4478# ----------------------
4479# Check for linker boilerplate output or warnings with
4480# the simple link test code.
4481m4_defun([_LT_LINKER_BOILERPLATE],
4482[m4_require([_LT_DECL_SED])dnl
4483ac_outfile=conftest.$ac_objext
4484echo "$lt_simple_link_test_code" >conftest.$ac_ext
4485eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
4486_lt_linker_boilerplate=`cat conftest.err`
4487$RM -r conftest*
4488])# _LT_LINKER_BOILERPLATE
4489
4490# _LT_REQUIRED_DARWIN_CHECKS
4491# -------------------------
4492m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
4493  case $host_os in
4494    rhapsody* | darwin*)
4495    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
4496    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
4497    AC_CHECK_TOOL([LIPO], [lipo], [:])
4498    AC_CHECK_TOOL([OTOOL], [otool], [:])
4499    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
4500    _LT_DECL([], [DSYMUTIL], [1],
4501      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
4502    _LT_DECL([], [NMEDIT], [1],
4503      [Tool to change global to local symbols on Mac OS X])
4504    _LT_DECL([], [LIPO], [1],
4505      [Tool to manipulate fat objects and archives on Mac OS X])
4506    _LT_DECL([], [OTOOL], [1],
4507      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
4508    _LT_DECL([], [OTOOL64], [1],
4509      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
4510
4511    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
4512      [lt_cv_apple_cc_single_mod=no
4513      if test -z "$LT_MULTI_MODULE"; then
4514	# By default we will add the -single_module flag. You can override
4515	# by either setting the environment variable LT_MULTI_MODULE
4516	# non-empty at configure time, or by adding -multi_module to the
4517	# link flags.
4518	rm -rf libconftest.dylib*
4519	echo "int foo(void){return 1;}" > conftest.c
4520	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
4521-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
4522	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
4523	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
4524        _lt_result=$?
4525	# If there is a non-empty error log, and "single_module"
4526	# appears in it, assume the flag caused a linker warning
4527        if test -s conftest.err && $GREP single_module conftest.err; then
4528	  cat conftest.err >&AS_MESSAGE_LOG_FD
4529	# Otherwise, if the output was created with a 0 exit code from
4530	# the compiler, it worked.
4531	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
4532	  lt_cv_apple_cc_single_mod=yes
4533	else
4534	  cat conftest.err >&AS_MESSAGE_LOG_FD
4535	fi
4536	rm -rf libconftest.dylib*
4537	rm -f conftest.*
4538      fi])
4539
4540    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
4541      [lt_cv_ld_exported_symbols_list],
4542      [lt_cv_ld_exported_symbols_list=no
4543      save_LDFLAGS=$LDFLAGS
4544      echo "_main" > conftest.sym
4545      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
4546      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
4547	[lt_cv_ld_exported_symbols_list=yes],
4548	[lt_cv_ld_exported_symbols_list=no])
4549	LDFLAGS=$save_LDFLAGS
4550    ])
4551
4552    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
4553      [lt_cv_ld_force_load=no
4554      cat > conftest.c << _LT_EOF
4555int forced_loaded() { return 2;}
4556_LT_EOF
4557      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
4558      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
4559      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
4560      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
4561      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
4562      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
4563      cat > conftest.c << _LT_EOF
4564int main() { return 0;}
4565_LT_EOF
4566      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
4567      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
4568      _lt_result=$?
4569      if test -s conftest.err && $GREP force_load conftest.err; then
4570	cat conftest.err >&AS_MESSAGE_LOG_FD
4571      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
4572	lt_cv_ld_force_load=yes
4573      else
4574	cat conftest.err >&AS_MESSAGE_LOG_FD
4575      fi
4576        rm -f conftest.err libconftest.a conftest conftest.c
4577        rm -rf conftest.dSYM
4578    ])
4579    case $host_os in
4580    rhapsody* | darwin1.[[012]])
4581      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
4582    darwin1.*)
4583      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
4584    darwin*) # darwin 5.x on
4585      # if running on 10.5 or later, the deployment target defaults
4586      # to the OS version, if on x86, and 10.4, the deployment
4587      # target defaults to 10.4. Don't you love it?
4588      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
4589	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
4590	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
4591	10.[[012]][[,.]]*)
4592	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
4593	10.*)
4594	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
4595      esac
4596    ;;
4597  esac
4598    if test yes = "$lt_cv_apple_cc_single_mod"; then
4599      _lt_dar_single_mod='$single_module'
4600    fi
4601    if test yes = "$lt_cv_ld_exported_symbols_list"; then
4602      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
4603    else
4604      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
4605    fi
4606    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
4607      _lt_dsymutil='~$DSYMUTIL $lib || :'
4608    else
4609      _lt_dsymutil=
4610    fi
4611    ;;
4612  esac
4613])
4614
4615
4616# _LT_DARWIN_LINKER_FEATURES([TAG])
4617# ---------------------------------
4618# Checks for linker and compiler features on darwin
4619m4_defun([_LT_DARWIN_LINKER_FEATURES],
4620[
4621  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
4622  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
4623  _LT_TAGVAR(hardcode_direct, $1)=no
4624  _LT_TAGVAR(hardcode_automatic, $1)=yes
4625  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4626  if test yes = "$lt_cv_ld_force_load"; then
4627    _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\"`'
4628    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
4629                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
4630  else
4631    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
4632  fi
4633  _LT_TAGVAR(link_all_deplibs, $1)=yes
4634  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
4635  case $cc_basename in
4636     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
4637     *) _lt_dar_can_shared=$GCC ;;
4638  esac
4639  if test yes = "$_lt_dar_can_shared"; then
4640    output_verbose_link_cmd=func_echo_all
4641    _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"
4642    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
4643    _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"
4644    _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"
4645    m4_if([$1], [CXX],
4646[   if test yes != "$lt_cv_apple_cc_single_mod"; then
4647      _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"
4648      _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"
4649    fi
4650],[])
4651  else
4652  _LT_TAGVAR(ld_shlibs, $1)=no
4653  fi
4654])
4655
4656# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
4657# ----------------------------------
4658# Links a minimal program and checks the executable
4659# for the system default hardcoded library path. In most cases,
4660# this is /usr/lib:/lib, but when the MPI compilers are used
4661# the location of the communication and MPI libs are included too.
4662# If we don't find anything, use the default library path according
4663# to the aix ld manual.
4664# Store the results from the different compilers for each TAGNAME.
4665# Allow to override them for all tags through lt_cv_aix_libpath.
4666m4_defun([_LT_SYS_MODULE_PATH_AIX],
4667[m4_require([_LT_DECL_SED])dnl
4668if test set = "${lt_cv_aix_libpath+set}"; then
4669  aix_libpath=$lt_cv_aix_libpath
4670else
4671  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
4672  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
4673  lt_aix_libpath_sed='[
4674      /Import File Strings/,/^$/ {
4675	  /^0/ {
4676	      s/^0  *\([^ ]*\) *$/\1/
4677	      p
4678	  }
4679      }]'
4680  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
4681  # Check for a 64-bit object if we didn't find anything.
4682  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
4683    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
4684  fi],[])
4685  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
4686    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
4687  fi
4688  ])
4689  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
4690fi
4691])# _LT_SYS_MODULE_PATH_AIX
4692
4693
4694# _LT_SHELL_INIT(ARG)
4695# -------------------
4696m4_define([_LT_SHELL_INIT],
4697[m4_divert_text([M4SH-INIT], [$1
4698])])# _LT_SHELL_INIT
4699
4700
4701
4702# _LT_PROG_ECHO_BACKSLASH
4703# -----------------------
4704# Find how we can fake an echo command that does not interpret backslash.
4705# In particular, with Autoconf 2.60 or later we add some code to the start
4706# of the generated configure script that will find a shell with a builtin
4707# printf (that we can use as an echo command).
4708m4_defun([_LT_PROG_ECHO_BACKSLASH],
4709[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4710ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4711ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4712
4713AC_MSG_CHECKING([how to print strings])
4714# Test print first, because it will be a builtin if present.
4715if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
4716   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
4717  ECHO='print -r --'
4718elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
4719  ECHO='printf %s\n'
4720else
4721  # Use this function as a fallback that always works.
4722  func_fallback_echo ()
4723  {
4724    eval 'cat <<_LTECHO_EOF
4725$[]1
4726_LTECHO_EOF'
4727  }
4728  ECHO='func_fallback_echo'
4729fi
4730
4731# func_echo_all arg...
4732# Invoke $ECHO with all args, space-separated.
4733func_echo_all ()
4734{
4735    $ECHO "$*"
4736}
4737
4738case $ECHO in
4739  printf*) AC_MSG_RESULT([printf]) ;;
4740  print*) AC_MSG_RESULT([print -r]) ;;
4741  *) AC_MSG_RESULT([cat]) ;;
4742esac
4743
4744m4_ifdef([_AS_DETECT_SUGGESTED],
4745[_AS_DETECT_SUGGESTED([
4746  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
4747    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4748    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4749    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4750    PATH=/empty FPATH=/empty; export PATH FPATH
4751    test "X`printf %s $ECHO`" = "X$ECHO" \
4752      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
4753
4754_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
4755_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
4756])# _LT_PROG_ECHO_BACKSLASH
4757
4758
4759# _LT_WITH_SYSROOT
4760# ----------------
4761AC_DEFUN([_LT_WITH_SYSROOT],
4762[AC_MSG_CHECKING([for sysroot])
4763AC_ARG_WITH([sysroot],
4764[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
4765  [Search for dependent libraries within DIR (or the compiler's sysroot
4766   if not specified).])],
4767[], [with_sysroot=no])
4768
4769dnl lt_sysroot will always be passed unquoted.  We quote it here
4770dnl in case the user passed a directory name.
4771lt_sysroot=
4772case $with_sysroot in #(
4773 yes)
4774   if test yes = "$GCC"; then
4775     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
4776   fi
4777   ;; #(
4778 /*)
4779   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
4780   ;; #(
4781 no|'')
4782   ;; #(
4783 *)
4784   AC_MSG_RESULT([$with_sysroot])
4785   AC_MSG_ERROR([The sysroot must be an absolute path.])
4786   ;;
4787esac
4788
4789 AC_MSG_RESULT([${lt_sysroot:-no}])
4790_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
4791[dependent libraries, and where our libraries should be installed.])])
4792
4793# _LT_ENABLE_LOCK
4794# ---------------
4795m4_defun([_LT_ENABLE_LOCK],
4796[AC_ARG_ENABLE([libtool-lock],
4797  [AS_HELP_STRING([--disable-libtool-lock],
4798    [avoid locking (might break parallel builds)])])
4799test no = "$enable_libtool_lock" || enable_libtool_lock=yes
4800
4801# Some flags need to be propagated to the compiler or linker for good
4802# libtool support.
4803case $host in
4804ia64-*-hpux*)
4805  # Find out what ABI is being produced by ac_compile, and set mode
4806  # options accordingly.
4807  echo 'int i;' > conftest.$ac_ext
4808  if AC_TRY_EVAL(ac_compile); then
4809    case `/usr/bin/file conftest.$ac_objext` in
4810      *ELF-32*)
4811	HPUX_IA64_MODE=32
4812	;;
4813      *ELF-64*)
4814	HPUX_IA64_MODE=64
4815	;;
4816    esac
4817  fi
4818  rm -rf conftest*
4819  ;;
4820*-*-irix6*)
4821  # Find out what ABI is being produced by ac_compile, and set linker
4822  # options accordingly.
4823  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4824  if AC_TRY_EVAL(ac_compile); then
4825    if test yes = "$lt_cv_prog_gnu_ld"; then
4826      case `/usr/bin/file conftest.$ac_objext` in
4827	*32-bit*)
4828	  LD="${LD-ld} -melf32bsmip"
4829	  ;;
4830	*N32*)
4831	  LD="${LD-ld} -melf32bmipn32"
4832	  ;;
4833	*64-bit*)
4834	  LD="${LD-ld} -melf64bmip"
4835	;;
4836      esac
4837    else
4838      case `/usr/bin/file conftest.$ac_objext` in
4839	*32-bit*)
4840	  LD="${LD-ld} -32"
4841	  ;;
4842	*N32*)
4843	  LD="${LD-ld} -n32"
4844	  ;;
4845	*64-bit*)
4846	  LD="${LD-ld} -64"
4847	  ;;
4848      esac
4849    fi
4850  fi
4851  rm -rf conftest*
4852  ;;
4853
4854mips64*-*linux*)
4855  # Find out what ABI is being produced by ac_compile, and set linker
4856  # options accordingly.
4857  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4858  if AC_TRY_EVAL(ac_compile); then
4859    emul=elf
4860    case `/usr/bin/file conftest.$ac_objext` in
4861      *32-bit*)
4862	emul="${emul}32"
4863	;;
4864      *64-bit*)
4865	emul="${emul}64"
4866	;;
4867    esac
4868    case `/usr/bin/file conftest.$ac_objext` in
4869      *MSB*)
4870	emul="${emul}btsmip"
4871	;;
4872      *LSB*)
4873	emul="${emul}ltsmip"
4874	;;
4875    esac
4876    case `/usr/bin/file conftest.$ac_objext` in
4877      *N32*)
4878	emul="${emul}n32"
4879	;;
4880    esac
4881    LD="${LD-ld} -m $emul"
4882  fi
4883  rm -rf conftest*
4884  ;;
4885
4886x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
4887s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
4888  # Find out what ABI is being produced by ac_compile, and set linker
4889  # options accordingly.  Note that the listed cases only cover the
4890  # situations where additional linker options are needed (such as when
4891  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
4892  # vice versa); the common cases where no linker options are needed do
4893  # not appear in the list.
4894  echo 'int i;' > conftest.$ac_ext
4895  if AC_TRY_EVAL(ac_compile); then
4896    case `/usr/bin/file conftest.o` in
4897      *32-bit*)
4898	case $host in
4899	  x86_64-*kfreebsd*-gnu)
4900	    LD="${LD-ld} -m elf_i386_fbsd"
4901	    ;;
4902	  x86_64-*linux*)
4903	    case `/usr/bin/file conftest.o` in
4904	      *x86-64*)
4905		LD="${LD-ld} -m elf32_x86_64"
4906		;;
4907	      *)
4908		LD="${LD-ld} -m elf_i386"
4909		;;
4910	    esac
4911	    ;;
4912	  powerpc64le-*linux*)
4913	    LD="${LD-ld} -m elf32lppclinux"
4914	    ;;
4915	  powerpc64-*linux*)
4916	    LD="${LD-ld} -m elf32ppclinux"
4917	    ;;
4918	  s390x-*linux*)
4919	    LD="${LD-ld} -m elf_s390"
4920	    ;;
4921	  sparc64-*linux*)
4922	    LD="${LD-ld} -m elf32_sparc"
4923	    ;;
4924	esac
4925	;;
4926      *64-bit*)
4927	case $host in
4928	  x86_64-*kfreebsd*-gnu)
4929	    LD="${LD-ld} -m elf_x86_64_fbsd"
4930	    ;;
4931	  x86_64-*linux*)
4932	    LD="${LD-ld} -m elf_x86_64"
4933	    ;;
4934	  powerpcle-*linux*)
4935	    LD="${LD-ld} -m elf64lppc"
4936	    ;;
4937	  powerpc-*linux*)
4938	    LD="${LD-ld} -m elf64ppc"
4939	    ;;
4940	  s390*-*linux*|s390*-*tpf*)
4941	    LD="${LD-ld} -m elf64_s390"
4942	    ;;
4943	  sparc*-*linux*)
4944	    LD="${LD-ld} -m elf64_sparc"
4945	    ;;
4946	esac
4947	;;
4948    esac
4949  fi
4950  rm -rf conftest*
4951  ;;
4952
4953*-*-sco3.2v5*)
4954  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4955  SAVE_CFLAGS=$CFLAGS
4956  CFLAGS="$CFLAGS -belf"
4957  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
4958    [AC_LANG_PUSH(C)
4959     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
4960     AC_LANG_POP])
4961  if test yes != "$lt_cv_cc_needs_belf"; then
4962    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4963    CFLAGS=$SAVE_CFLAGS
4964  fi
4965  ;;
4966*-*solaris*)
4967  # Find out what ABI is being produced by ac_compile, and set linker
4968  # options accordingly.
4969  echo 'int i;' > conftest.$ac_ext
4970  if AC_TRY_EVAL(ac_compile); then
4971    case `/usr/bin/file conftest.o` in
4972    *64-bit*)
4973      case $lt_cv_prog_gnu_ld in
4974      yes*)
4975        case $host in
4976        i?86-*-solaris*|x86_64-*-solaris*)
4977          LD="${LD-ld} -m elf_x86_64"
4978          ;;
4979        sparc*-*-solaris*)
4980          LD="${LD-ld} -m elf64_sparc"
4981          ;;
4982        esac
4983        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
4984        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
4985          LD=${LD-ld}_sol2
4986        fi
4987        ;;
4988      *)
4989	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
4990	  LD="${LD-ld} -64"
4991	fi
4992	;;
4993      esac
4994      ;;
4995    esac
4996  fi
4997  rm -rf conftest*
4998  ;;
4999esac
5000
5001need_locks=$enable_libtool_lock
5002])# _LT_ENABLE_LOCK
5003
5004
5005# _LT_PROG_AR
5006# -----------
5007m4_defun([_LT_PROG_AR],
5008[AC_CHECK_TOOLS(AR, [ar], false)
5009: ${AR=ar}
5010: ${AR_FLAGS=cru}
5011_LT_DECL([], [AR], [1], [The archiver])
5012_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
5013
5014AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
5015  [lt_cv_ar_at_file=no
5016   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
5017     [echo conftest.$ac_objext > conftest.lst
5018      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
5019      AC_TRY_EVAL([lt_ar_try])
5020      if test 0 -eq "$ac_status"; then
5021	# Ensure the archiver fails upon bogus file names.
5022	rm -f conftest.$ac_objext libconftest.a
5023	AC_TRY_EVAL([lt_ar_try])
5024	if test 0 -ne "$ac_status"; then
5025          lt_cv_ar_at_file=@
5026        fi
5027      fi
5028      rm -f conftest.* libconftest.a
5029     ])
5030  ])
5031
5032if test no = "$lt_cv_ar_at_file"; then
5033  archiver_list_spec=
5034else
5035  archiver_list_spec=$lt_cv_ar_at_file
5036fi
5037_LT_DECL([], [archiver_list_spec], [1],
5038  [How to feed a file listing to the archiver])
5039])# _LT_PROG_AR
5040
5041
5042# _LT_CMD_OLD_ARCHIVE
5043# -------------------
5044m4_defun([_LT_CMD_OLD_ARCHIVE],
5045[_LT_PROG_AR
5046
5047AC_CHECK_TOOL(STRIP, strip, :)
5048test -z "$STRIP" && STRIP=:
5049_LT_DECL([], [STRIP], [1], [A symbol stripping program])
5050
5051AC_CHECK_TOOL(RANLIB, ranlib, :)
5052test -z "$RANLIB" && RANLIB=:
5053_LT_DECL([], [RANLIB], [1],
5054    [Commands used to install an old-style archive])
5055
5056# Determine commands to create old-style static archives.
5057old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
5058old_postinstall_cmds='chmod 644 $oldlib'
5059old_postuninstall_cmds=
5060
5061if test -n "$RANLIB"; then
5062  case $host_os in
5063  bitrig* | openbsd*)
5064    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
5065    ;;
5066  *)
5067    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
5068    ;;
5069  esac
5070  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
5071fi
5072
5073case $host_os in
5074  darwin*)
5075    lock_old_archive_extraction=yes ;;
5076  *)
5077    lock_old_archive_extraction=no ;;
5078esac
5079_LT_DECL([], [old_postinstall_cmds], [2])
5080_LT_DECL([], [old_postuninstall_cmds], [2])
5081_LT_TAGDECL([], [old_archive_cmds], [2],
5082    [Commands used to build an old-style archive])
5083_LT_DECL([], [lock_old_archive_extraction], [0],
5084    [Whether to use a lock for old archive extraction])
5085])# _LT_CMD_OLD_ARCHIVE
5086
5087
5088# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
5089#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
5090# ----------------------------------------------------------------
5091# Check whether the given compiler option works
5092AC_DEFUN([_LT_COMPILER_OPTION],
5093[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5094m4_require([_LT_DECL_SED])dnl
5095AC_CACHE_CHECK([$1], [$2],
5096  [$2=no
5097   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
5098   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5099   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
5100   # Insert the option either (1) after the last *FLAGS variable, or
5101   # (2) before a word containing "conftest.", or (3) at the end.
5102   # Note that $ac_compile itself does not contain backslashes and begins
5103   # with a dollar sign (not a hyphen), so the echo should work correctly.
5104   # The option is referenced via a variable to avoid confusing sed.
5105   lt_compile=`echo "$ac_compile" | $SED \
5106   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
5107   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
5108   -e 's:$: $lt_compiler_flag:'`
5109   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
5110   (eval "$lt_compile" 2>conftest.err)
5111   ac_status=$?
5112   cat conftest.err >&AS_MESSAGE_LOG_FD
5113   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
5114   if (exit $ac_status) && test -s "$ac_outfile"; then
5115     # The compiler can only warn and ignore the option if not recognized
5116     # So say no if there are warnings other than the usual output.
5117     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
5118     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
5119     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
5120       $2=yes
5121     fi
5122   fi
5123   $RM conftest*
5124])
5125
5126if test yes = "[$]$2"; then
5127    m4_if([$5], , :, [$5])
5128else
5129    m4_if([$6], , :, [$6])
5130fi
5131])# _LT_COMPILER_OPTION
5132
5133# Old name:
5134AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
5135dnl aclocal-1.4 backwards compatibility:
5136dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
5137
5138
5139# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
5140#                  [ACTION-SUCCESS], [ACTION-FAILURE])
5141# ----------------------------------------------------
5142# Check whether the given linker option works
5143AC_DEFUN([_LT_LINKER_OPTION],
5144[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5145m4_require([_LT_DECL_SED])dnl
5146AC_CACHE_CHECK([$1], [$2],
5147  [$2=no
5148   save_LDFLAGS=$LDFLAGS
5149   LDFLAGS="$LDFLAGS $3"
5150   echo "$lt_simple_link_test_code" > conftest.$ac_ext
5151   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
5152     # The linker can only warn and ignore the option if not recognized
5153     # So say no if there are warnings
5154     if test -s conftest.err; then
5155       # Append any errors to the config.log.
5156       cat conftest.err 1>&AS_MESSAGE_LOG_FD
5157       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
5158       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
5159       if diff conftest.exp conftest.er2 >/dev/null; then
5160         $2=yes
5161       fi
5162     else
5163       $2=yes
5164     fi
5165   fi
5166   $RM -r conftest*
5167   LDFLAGS=$save_LDFLAGS
5168])
5169
5170if test yes = "[$]$2"; then
5171    m4_if([$4], , :, [$4])
5172else
5173    m4_if([$5], , :, [$5])
5174fi
5175])# _LT_LINKER_OPTION
5176
5177# Old name:
5178AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
5179dnl aclocal-1.4 backwards compatibility:
5180dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
5181
5182
5183# LT_CMD_MAX_LEN
5184#---------------
5185AC_DEFUN([LT_CMD_MAX_LEN],
5186[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5187# find the maximum length of command line arguments
5188AC_MSG_CHECKING([the maximum length of command line arguments])
5189AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
5190  i=0
5191  teststring=ABCD
5192
5193  case $build_os in
5194  msdosdjgpp*)
5195    # On DJGPP, this test can blow up pretty badly due to problems in libc
5196    # (any single argument exceeding 2000 bytes causes a buffer overrun
5197    # during glob expansion).  Even if it were fixed, the result of this
5198    # check would be larger than it should be.
5199    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
5200    ;;
5201
5202  gnu*)
5203    # Under GNU Hurd, this test is not required because there is
5204    # no limit to the length of command line arguments.
5205    # Libtool will interpret -1 as no limit whatsoever
5206    lt_cv_sys_max_cmd_len=-1;
5207    ;;
5208
5209  cygwin* | mingw* | cegcc*)
5210    # On Win9x/ME, this test blows up -- it succeeds, but takes
5211    # about 5 minutes as the teststring grows exponentially.
5212    # Worse, since 9x/ME are not pre-emptively multitasking,
5213    # you end up with a "frozen" computer, even though with patience
5214    # the test eventually succeeds (with a max line length of 256k).
5215    # Instead, let's just punt: use the minimum linelength reported by
5216    # all of the supported platforms: 8192 (on NT/2K/XP).
5217    lt_cv_sys_max_cmd_len=8192;
5218    ;;
5219
5220  mint*)
5221    # On MiNT this can take a long time and run out of memory.
5222    lt_cv_sys_max_cmd_len=8192;
5223    ;;
5224
5225  amigaos*)
5226    # On AmigaOS with pdksh, this test takes hours, literally.
5227    # So we just punt and use a minimum line length of 8192.
5228    lt_cv_sys_max_cmd_len=8192;
5229    ;;
5230
5231  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
5232    # This has been around since 386BSD, at least.  Likely further.
5233    if test -x /sbin/sysctl; then
5234      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
5235    elif test -x /usr/sbin/sysctl; then
5236      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
5237    else
5238      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
5239    fi
5240    # And add a safety zone
5241    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5242    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5243    ;;
5244
5245  interix*)
5246    # We know the value 262144 and hardcode it with a safety zone (like BSD)
5247    lt_cv_sys_max_cmd_len=196608
5248    ;;
5249
5250  os2*)
5251    # The test takes a long time on OS/2.
5252    lt_cv_sys_max_cmd_len=8192
5253    ;;
5254
5255  osf*)
5256    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
5257    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
5258    # nice to cause kernel panics so lets avoid the loop below.
5259    # First set a reasonable default.
5260    lt_cv_sys_max_cmd_len=16384
5261    #
5262    if test -x /sbin/sysconfig; then
5263      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
5264        *1*) lt_cv_sys_max_cmd_len=-1 ;;
5265      esac
5266    fi
5267    ;;
5268  sco3.2v5*)
5269    lt_cv_sys_max_cmd_len=102400
5270    ;;
5271  sysv5* | sco5v6* | sysv4.2uw2*)
5272    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
5273    if test -n "$kargmax"; then
5274      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
5275    else
5276      lt_cv_sys_max_cmd_len=32768
5277    fi
5278    ;;
5279  *)
5280    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
5281    if test -n "$lt_cv_sys_max_cmd_len" && \
5282       test undefined != "$lt_cv_sys_max_cmd_len"; then
5283      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5284      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5285    else
5286      # Make teststring a little bigger before we do anything with it.
5287      # a 1K string should be a reasonable start.
5288      for i in 1 2 3 4 5 6 7 8; do
5289        teststring=$teststring$teststring
5290      done
5291      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
5292      # If test is not a shell built-in, we'll probably end up computing a
5293      # maximum length that is only half of the actual maximum length, but
5294      # we can't tell.
5295      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
5296	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
5297	      test 17 != "$i" # 1/2 MB should be enough
5298      do
5299        i=`expr $i + 1`
5300        teststring=$teststring$teststring
5301      done
5302      # Only check the string length outside the loop.
5303      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
5304      teststring=
5305      # Add a significant safety factor because C++ compilers can tack on
5306      # massive amounts of additional arguments before passing them to the
5307      # linker.  It appears as though 1/2 is a usable value.
5308      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
5309    fi
5310    ;;
5311  esac
5312])
5313if test -n "$lt_cv_sys_max_cmd_len"; then
5314  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
5315else
5316  AC_MSG_RESULT(none)
5317fi
5318max_cmd_len=$lt_cv_sys_max_cmd_len
5319_LT_DECL([], [max_cmd_len], [0],
5320    [What is the maximum length of a command?])
5321])# LT_CMD_MAX_LEN
5322
5323# Old name:
5324AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
5325dnl aclocal-1.4 backwards compatibility:
5326dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
5327
5328
5329# _LT_HEADER_DLFCN
5330# ----------------
5331m4_defun([_LT_HEADER_DLFCN],
5332[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
5333])# _LT_HEADER_DLFCN
5334
5335
5336# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
5337#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
5338# ----------------------------------------------------------------
5339m4_defun([_LT_TRY_DLOPEN_SELF],
5340[m4_require([_LT_HEADER_DLFCN])dnl
5341if test yes = "$cross_compiling"; then :
5342  [$4]
5343else
5344  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
5345  lt_status=$lt_dlunknown
5346  cat > conftest.$ac_ext <<_LT_EOF
5347[#line $LINENO "configure"
5348#include "confdefs.h"
5349
5350#if HAVE_DLFCN_H
5351#include <dlfcn.h>
5352#endif
5353
5354#include <stdio.h>
5355
5356#ifdef RTLD_GLOBAL
5357#  define LT_DLGLOBAL		RTLD_GLOBAL
5358#else
5359#  ifdef DL_GLOBAL
5360#    define LT_DLGLOBAL		DL_GLOBAL
5361#  else
5362#    define LT_DLGLOBAL		0
5363#  endif
5364#endif
5365
5366/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
5367   find out it does not work in some platform. */
5368#ifndef LT_DLLAZY_OR_NOW
5369#  ifdef RTLD_LAZY
5370#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
5371#  else
5372#    ifdef DL_LAZY
5373#      define LT_DLLAZY_OR_NOW		DL_LAZY
5374#    else
5375#      ifdef RTLD_NOW
5376#        define LT_DLLAZY_OR_NOW	RTLD_NOW
5377#      else
5378#        ifdef DL_NOW
5379#          define LT_DLLAZY_OR_NOW	DL_NOW
5380#        else
5381#          define LT_DLLAZY_OR_NOW	0
5382#        endif
5383#      endif
5384#    endif
5385#  endif
5386#endif
5387
5388/* When -fvisibility=hidden is used, assume the code has been annotated
5389   correspondingly for the symbols needed.  */
5390#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
5391int fnord () __attribute__((visibility("default")));
5392#endif
5393
5394int fnord () { return 42; }
5395int main ()
5396{
5397  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
5398  int status = $lt_dlunknown;
5399
5400  if (self)
5401    {
5402      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
5403      else
5404        {
5405	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
5406          else puts (dlerror ());
5407	}
5408      /* dlclose (self); */
5409    }
5410  else
5411    puts (dlerror ());
5412
5413  return status;
5414}]
5415_LT_EOF
5416  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
5417    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
5418    lt_status=$?
5419    case x$lt_status in
5420      x$lt_dlno_uscore) $1 ;;
5421      x$lt_dlneed_uscore) $2 ;;
5422      x$lt_dlunknown|x*) $3 ;;
5423    esac
5424  else :
5425    # compilation failed
5426    $3
5427  fi
5428fi
5429rm -fr conftest*
5430])# _LT_TRY_DLOPEN_SELF
5431
5432
5433# LT_SYS_DLOPEN_SELF
5434# ------------------
5435AC_DEFUN([LT_SYS_DLOPEN_SELF],
5436[m4_require([_LT_HEADER_DLFCN])dnl
5437if test yes != "$enable_dlopen"; then
5438  enable_dlopen=unknown
5439  enable_dlopen_self=unknown
5440  enable_dlopen_self_static=unknown
5441else
5442  lt_cv_dlopen=no
5443  lt_cv_dlopen_libs=
5444
5445  case $host_os in
5446  beos*)
5447    lt_cv_dlopen=load_add_on
5448    lt_cv_dlopen_libs=
5449    lt_cv_dlopen_self=yes
5450    ;;
5451
5452  mingw* | pw32* | cegcc*)
5453    lt_cv_dlopen=LoadLibrary
5454    lt_cv_dlopen_libs=
5455    ;;
5456
5457  cygwin*)
5458    lt_cv_dlopen=dlopen
5459    lt_cv_dlopen_libs=
5460    ;;
5461
5462  darwin*)
5463    # if libdl is installed we need to link against it
5464    AC_CHECK_LIB([dl], [dlopen],
5465		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
5466    lt_cv_dlopen=dyld
5467    lt_cv_dlopen_libs=
5468    lt_cv_dlopen_self=yes
5469    ])
5470    ;;
5471
5472  tpf*)
5473    # Don't try to run any link tests for TPF.  We know it's impossible
5474    # because TPF is a cross-compiler, and we know how we open DSOs.
5475    lt_cv_dlopen=dlopen
5476    lt_cv_dlopen_libs=
5477    lt_cv_dlopen_self=no
5478    ;;
5479
5480  *)
5481    AC_CHECK_FUNC([shl_load],
5482	  [lt_cv_dlopen=shl_load],
5483      [AC_CHECK_LIB([dld], [shl_load],
5484	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
5485	[AC_CHECK_FUNC([dlopen],
5486	      [lt_cv_dlopen=dlopen],
5487	  [AC_CHECK_LIB([dl], [dlopen],
5488		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
5489	    [AC_CHECK_LIB([svld], [dlopen],
5490		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
5491	      [AC_CHECK_LIB([dld], [dld_link],
5492		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
5493	      ])
5494	    ])
5495	  ])
5496	])
5497      ])
5498    ;;
5499  esac
5500
5501  if test no = "$lt_cv_dlopen"; then
5502    enable_dlopen=no
5503  else
5504    enable_dlopen=yes
5505  fi
5506
5507  case $lt_cv_dlopen in
5508  dlopen)
5509    save_CPPFLAGS=$CPPFLAGS
5510    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
5511
5512    save_LDFLAGS=$LDFLAGS
5513    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
5514
5515    save_LIBS=$LIBS
5516    LIBS="$lt_cv_dlopen_libs $LIBS"
5517
5518    AC_CACHE_CHECK([whether a program can dlopen itself],
5519	  lt_cv_dlopen_self, [dnl
5520	  _LT_TRY_DLOPEN_SELF(
5521	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
5522	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
5523    ])
5524
5525    if test yes = "$lt_cv_dlopen_self"; then
5526      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
5527      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
5528	  lt_cv_dlopen_self_static, [dnl
5529	  _LT_TRY_DLOPEN_SELF(
5530	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
5531	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
5532      ])
5533    fi
5534
5535    CPPFLAGS=$save_CPPFLAGS
5536    LDFLAGS=$save_LDFLAGS
5537    LIBS=$save_LIBS
5538    ;;
5539  esac
5540
5541  case $lt_cv_dlopen_self in
5542  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
5543  *) enable_dlopen_self=unknown ;;
5544  esac
5545
5546  case $lt_cv_dlopen_self_static in
5547  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
5548  *) enable_dlopen_self_static=unknown ;;
5549  esac
5550fi
5551_LT_DECL([dlopen_support], [enable_dlopen], [0],
5552	 [Whether dlopen is supported])
5553_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
5554	 [Whether dlopen of programs is supported])
5555_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
5556	 [Whether dlopen of statically linked programs is supported])
5557])# LT_SYS_DLOPEN_SELF
5558
5559# Old name:
5560AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
5561dnl aclocal-1.4 backwards compatibility:
5562dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
5563
5564
5565# _LT_COMPILER_C_O([TAGNAME])
5566# ---------------------------
5567# Check to see if options -c and -o are simultaneously supported by compiler.
5568# This macro does not hard code the compiler like AC_PROG_CC_C_O.
5569m4_defun([_LT_COMPILER_C_O],
5570[m4_require([_LT_DECL_SED])dnl
5571m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5572m4_require([_LT_TAG_COMPILER])dnl
5573AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
5574  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
5575  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
5576   $RM -r conftest 2>/dev/null
5577   mkdir conftest
5578   cd conftest
5579   mkdir out
5580   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5581
5582   lt_compiler_flag="-o out/conftest2.$ac_objext"
5583   # Insert the option either (1) after the last *FLAGS variable, or
5584   # (2) before a word containing "conftest.", or (3) at the end.
5585   # Note that $ac_compile itself does not contain backslashes and begins
5586   # with a dollar sign (not a hyphen), so the echo should work correctly.
5587   lt_compile=`echo "$ac_compile" | $SED \
5588   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
5589   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
5590   -e 's:$: $lt_compiler_flag:'`
5591   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
5592   (eval "$lt_compile" 2>out/conftest.err)
5593   ac_status=$?
5594   cat out/conftest.err >&AS_MESSAGE_LOG_FD
5595   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
5596   if (exit $ac_status) && test -s out/conftest2.$ac_objext
5597   then
5598     # The compiler can only warn and ignore the option if not recognized
5599     # So say no if there are warnings
5600     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
5601     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
5602     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
5603       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
5604     fi
5605   fi
5606   chmod u+w . 2>&AS_MESSAGE_LOG_FD
5607   $RM conftest*
5608   # SGI C++ compiler will create directory out/ii_files/ for
5609   # template instantiation
5610   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
5611   $RM out/* && rmdir out
5612   cd ..
5613   $RM -r conftest
5614   $RM conftest*
5615])
5616_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
5617	[Does compiler simultaneously support -c and -o options?])
5618])# _LT_COMPILER_C_O
5619
5620
5621# _LT_COMPILER_FILE_LOCKS([TAGNAME])
5622# ----------------------------------
5623# Check to see if we can do hard links to lock some files if needed
5624m4_defun([_LT_COMPILER_FILE_LOCKS],
5625[m4_require([_LT_ENABLE_LOCK])dnl
5626m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5627_LT_COMPILER_C_O([$1])
5628
5629hard_links=nottested
5630if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
5631  # do not overwrite the value of need_locks provided by the user
5632  AC_MSG_CHECKING([if we can lock with hard links])
5633  hard_links=yes
5634  $RM conftest*
5635  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5636  touch conftest.a
5637  ln conftest.a conftest.b 2>&5 || hard_links=no
5638  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5639  AC_MSG_RESULT([$hard_links])
5640  if test no = "$hard_links"; then
5641    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
5642    need_locks=warn
5643  fi
5644else
5645  need_locks=no
5646fi
5647_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
5648])# _LT_COMPILER_FILE_LOCKS
5649
5650
5651# _LT_CHECK_OBJDIR
5652# ----------------
5653m4_defun([_LT_CHECK_OBJDIR],
5654[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
5655[rm -f .libs 2>/dev/null
5656mkdir .libs 2>/dev/null
5657if test -d .libs; then
5658  lt_cv_objdir=.libs
5659else
5660  # MS-DOS does not allow filenames that begin with a dot.
5661  lt_cv_objdir=_libs
5662fi
5663rmdir .libs 2>/dev/null])
5664objdir=$lt_cv_objdir
5665_LT_DECL([], [objdir], [0],
5666         [The name of the directory that contains temporary libtool files])dnl
5667m4_pattern_allow([LT_OBJDIR])dnl
5668AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
5669  [Define to the sub-directory where libtool stores uninstalled libraries.])
5670])# _LT_CHECK_OBJDIR
5671
5672
5673# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
5674# --------------------------------------
5675# Check hardcoding attributes.
5676m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
5677[AC_MSG_CHECKING([how to hardcode library paths into programs])
5678_LT_TAGVAR(hardcode_action, $1)=
5679if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
5680   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
5681   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
5682
5683  # We can hardcode non-existent directories.
5684  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
5685     # If the only mechanism to avoid hardcoding is shlibpath_var, we
5686     # have to relink, otherwise we might link with an installed library
5687     # when we should be linking with a yet-to-be-installed one
5688     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
5689     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
5690    # Linking always hardcodes the temporary library directory.
5691    _LT_TAGVAR(hardcode_action, $1)=relink
5692  else
5693    # We can link without hardcoding, and we can hardcode nonexisting dirs.
5694    _LT_TAGVAR(hardcode_action, $1)=immediate
5695  fi
5696else
5697  # We cannot hardcode anything, or else we can only hardcode existing
5698  # directories.
5699  _LT_TAGVAR(hardcode_action, $1)=unsupported
5700fi
5701AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
5702
5703if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
5704   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
5705  # Fast installation is not supported
5706  enable_fast_install=no
5707elif test yes = "$shlibpath_overrides_runpath" ||
5708     test no = "$enable_shared"; then
5709  # Fast installation is not necessary
5710  enable_fast_install=needless
5711fi
5712_LT_TAGDECL([], [hardcode_action], [0],
5713    [How to hardcode a shared library path into an executable])
5714])# _LT_LINKER_HARDCODE_LIBPATH
5715
5716
5717# _LT_CMD_STRIPLIB
5718# ----------------
5719m4_defun([_LT_CMD_STRIPLIB],
5720[m4_require([_LT_DECL_EGREP])
5721striplib=
5722old_striplib=
5723AC_MSG_CHECKING([whether stripping libraries is possible])
5724if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
5725  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
5726  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
5727  AC_MSG_RESULT([yes])
5728else
5729# FIXME - insert some real tests, host_os isn't really good enough
5730  case $host_os in
5731  darwin*)
5732    if test -n "$STRIP"; then
5733      striplib="$STRIP -x"
5734      old_striplib="$STRIP -S"
5735      AC_MSG_RESULT([yes])
5736    else
5737      AC_MSG_RESULT([no])
5738    fi
5739    ;;
5740  *)
5741    AC_MSG_RESULT([no])
5742    ;;
5743  esac
5744fi
5745_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
5746_LT_DECL([], [striplib], [1])
5747])# _LT_CMD_STRIPLIB
5748
5749
5750# _LT_PREPARE_MUNGE_PATH_LIST
5751# ---------------------------
5752# Make sure func_munge_path_list() is defined correctly.
5753m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
5754[[# func_munge_path_list VARIABLE PATH
5755# -----------------------------------
5756# VARIABLE is name of variable containing _space_ separated list of
5757# directories to be munged by the contents of PATH, which is string
5758# having a format:
5759# "DIR[:DIR]:"
5760#       string "DIR[ DIR]" will be prepended to VARIABLE
5761# ":DIR[:DIR]"
5762#       string "DIR[ DIR]" will be appended to VARIABLE
5763# "DIRP[:DIRP]::[DIRA:]DIRA"
5764#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
5765#       "DIRA[ DIRA]" will be appended to VARIABLE
5766# "DIR[:DIR]"
5767#       VARIABLE will be replaced by "DIR[ DIR]"
5768func_munge_path_list ()
5769{
5770    case x@S|@2 in
5771    x)
5772        ;;
5773    *:)
5774        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
5775        ;;
5776    x:*)
5777        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
5778        ;;
5779    *::*)
5780        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
5781        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
5782        ;;
5783    *)
5784        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
5785        ;;
5786    esac
5787}
5788]])# _LT_PREPARE_PATH_LIST
5789
5790
5791# _LT_SYS_DYNAMIC_LINKER([TAG])
5792# -----------------------------
5793# PORTME Fill in your ld.so characteristics
5794m4_defun([_LT_SYS_DYNAMIC_LINKER],
5795[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5796m4_require([_LT_DECL_EGREP])dnl
5797m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5798m4_require([_LT_DECL_OBJDUMP])dnl
5799m4_require([_LT_DECL_SED])dnl
5800m4_require([_LT_CHECK_SHELL_FEATURES])dnl
5801m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
5802AC_MSG_CHECKING([dynamic linker characteristics])
5803m4_if([$1],
5804	[], [
5805if test yes = "$GCC"; then
5806  case $host_os in
5807    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
5808    *) lt_awk_arg='/^libraries:/' ;;
5809  esac
5810  case $host_os in
5811    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
5812    *) lt_sed_strip_eq='s|=/|/|g' ;;
5813  esac
5814  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
5815  case $lt_search_path_spec in
5816  *\;*)
5817    # if the path contains ";" then we assume it to be the separator
5818    # otherwise default to the standard path separator (i.e. ":") - it is
5819    # assumed that no part of a normal pathname contains ";" but that should
5820    # okay in the real world where ";" in dirpaths is itself problematic.
5821    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
5822    ;;
5823  *)
5824    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
5825    ;;
5826  esac
5827  # Ok, now we have the path, separated by spaces, we can step through it
5828  # and add multilib dir if necessary...
5829  lt_tmp_lt_search_path_spec=
5830  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
5831  # ...but if some path component already ends with the multilib dir we assume
5832  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
5833  case "$lt_multi_os_dir; $lt_search_path_spec " in
5834  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
5835    lt_multi_os_dir=
5836    ;;
5837  esac
5838  for lt_sys_path in $lt_search_path_spec; do
5839    if test -d "$lt_sys_path$lt_multi_os_dir"; then
5840      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
5841    elif test -n "$lt_multi_os_dir"; then
5842      test -d "$lt_sys_path" && \
5843	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
5844    fi
5845  done
5846  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
5847BEGIN {RS = " "; FS = "/|\n";} {
5848  lt_foo = "";
5849  lt_count = 0;
5850  for (lt_i = NF; lt_i > 0; lt_i--) {
5851    if ($lt_i != "" && $lt_i != ".") {
5852      if ($lt_i == "..") {
5853        lt_count++;
5854      } else {
5855        if (lt_count == 0) {
5856          lt_foo = "/" $lt_i lt_foo;
5857        } else {
5858          lt_count--;
5859        }
5860      }
5861    }
5862  }
5863  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
5864  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
5865}'`
5866  # AWK program above erroneously prepends '/' to C:/dos/paths
5867  # for these hosts.
5868  case $host_os in
5869    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
5870      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
5871  esac
5872  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
5873else
5874  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
5875fi])
5876library_names_spec=
5877libname_spec='lib$name'
5878soname_spec=
5879shrext_cmds=.so
5880postinstall_cmds=
5881postuninstall_cmds=
5882finish_cmds=
5883finish_eval=
5884shlibpath_var=
5885shlibpath_overrides_runpath=unknown
5886version_type=none
5887dynamic_linker="$host_os ld.so"
5888sys_lib_dlsearch_path_spec="/lib /usr/lib"
5889need_lib_prefix=unknown
5890hardcode_into_libs=no
5891
5892# when you set need_version to no, make sure it does not cause -set_version
5893# flags to be left without arguments
5894need_version=unknown
5895
5896AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
5897[User-defined run-time library search path.])
5898
5899case $host_os in
5900aix3*)
5901  version_type=linux # correct to gnu/linux during the next big refactor
5902  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
5903  shlibpath_var=LIBPATH
5904
5905  # AIX 3 has no versioning support, so we append a major version to the name.
5906  soname_spec='$libname$release$shared_ext$major'
5907  ;;
5908
5909aix[[4-9]]*)
5910  version_type=linux # correct to gnu/linux during the next big refactor
5911  need_lib_prefix=no
5912  need_version=no
5913  hardcode_into_libs=yes
5914  if test ia64 = "$host_cpu"; then
5915    # AIX 5 supports IA64
5916    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
5917    shlibpath_var=LD_LIBRARY_PATH
5918  else
5919    # With GCC up to 2.95.x, collect2 would create an import file
5920    # for dependence libraries.  The import file would start with
5921    # the line '#! .'.  This would cause the generated library to
5922    # depend on '.', always an invalid library.  This was fixed in
5923    # development snapshots of GCC prior to 3.0.
5924    case $host_os in
5925      aix4 | aix4.[[01]] | aix4.[[01]].*)
5926      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
5927	   echo ' yes '
5928	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
5929	:
5930      else
5931	can_build_shared=no
5932      fi
5933      ;;
5934    esac
5935    # Using Import Files as archive members, it is possible to support
5936    # filename-based versioning of shared library archives on AIX. While
5937    # this would work for both with and without runtime linking, it will
5938    # prevent static linking of such archives. So we do filename-based
5939    # shared library versioning with .so extension only, which is used
5940    # when both runtime linking and shared linking is enabled.
5941    # Unfortunately, runtime linking may impact performance, so we do
5942    # not want this to be the default eventually. Also, we use the
5943    # versioned .so libs for executables only if there is the -brtl
5944    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
5945    # To allow for filename-based versioning support, we need to create
5946    # libNAME.so.V as an archive file, containing:
5947    # *) an Import File, referring to the versioned filename of the
5948    #    archive as well as the shared archive member, telling the
5949    #    bitwidth (32 or 64) of that shared object, and providing the
5950    #    list of exported symbols of that shared object, eventually
5951    #    decorated with the 'weak' keyword
5952    # *) the shared object with the F_LOADONLY flag set, to really avoid
5953    #    it being seen by the linker.
5954    # At run time we better use the real file rather than another symlink,
5955    # but for link time we create the symlink libNAME.so -> libNAME.so.V
5956
5957    case $with_aix_soname,$aix_use_runtimelinking in
5958    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
5959    # soname into executable. Probably we can add versioning support to
5960    # collect2, so additional links can be useful in future.
5961    aix,yes) # traditional libtool
5962      dynamic_linker='AIX unversionable lib.so'
5963      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
5964      # instead of lib<name>.a to let people know that these are not
5965      # typical AIX shared libraries.
5966      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5967      ;;
5968    aix,no) # traditional AIX only
5969      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
5970      # We preserve .a as extension for shared libraries through AIX4.2
5971      # and later when we are not doing run time linking.
5972      library_names_spec='$libname$release.a $libname.a'
5973      soname_spec='$libname$release$shared_ext$major'
5974      ;;
5975    svr4,*) # full svr4 only
5976      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
5977      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5978      # We do not specify a path in Import Files, so LIBPATH fires.
5979      shlibpath_overrides_runpath=yes
5980      ;;
5981    *,yes) # both, prefer svr4
5982      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
5983      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5984      # unpreferred sharedlib libNAME.a needs extra handling
5985      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
5986      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
5987      # We do not specify a path in Import Files, so LIBPATH fires.
5988      shlibpath_overrides_runpath=yes
5989      ;;
5990    *,no) # both, prefer aix
5991      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
5992      library_names_spec='$libname$release.a $libname.a'
5993      soname_spec='$libname$release$shared_ext$major'
5994      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
5995      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
5996      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
5997      ;;
5998    esac
5999    shlibpath_var=LIBPATH
6000  fi
6001  ;;
6002
6003amigaos*)
6004  case $host_cpu in
6005  powerpc)
6006    # Since July 2007 AmigaOS4 officially supports .so libraries.
6007    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
6008    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6009    ;;
6010  m68k)
6011    library_names_spec='$libname.ixlibrary $libname.a'
6012    # Create ${libname}_ixlibrary.a entries in /sys/libs.
6013    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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'
6014    ;;
6015  esac
6016  ;;
6017
6018beos*)
6019  library_names_spec='$libname$shared_ext'
6020  dynamic_linker="$host_os ld.so"
6021  shlibpath_var=LIBRARY_PATH
6022  ;;
6023
6024bsdi[[45]]*)
6025  version_type=linux # correct to gnu/linux during the next big refactor
6026  need_version=no
6027  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6028  soname_spec='$libname$release$shared_ext$major'
6029  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6030  shlibpath_var=LD_LIBRARY_PATH
6031  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6032  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6033  # the default ld.so.conf also contains /usr/contrib/lib and
6034  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6035  # libtool to hard-code these into programs
6036  ;;
6037
6038cygwin* | mingw* | pw32* | cegcc*)
6039  version_type=windows
6040  shrext_cmds=.dll
6041  need_version=no
6042  need_lib_prefix=no
6043
6044  case $GCC,$cc_basename in
6045  yes,*)
6046    # gcc
6047    library_names_spec='$libname.dll.a'
6048    # DLL is installed to $(libdir)/../bin by postinstall_cmds
6049    postinstall_cmds='base_file=`basename \$file`~
6050      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
6051      dldir=$destdir/`dirname \$dlpath`~
6052      test -d \$dldir || mkdir -p \$dldir~
6053      $install_prog $dir/$dlname \$dldir/$dlname~
6054      chmod a+x \$dldir/$dlname~
6055      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
6056        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
6057      fi'
6058    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
6059      dlpath=$dir/\$dldll~
6060       $RM \$dlpath'
6061    shlibpath_overrides_runpath=yes
6062
6063    case $host_os in
6064    cygwin*)
6065      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
6066      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
6067m4_if([$1], [],[
6068      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
6069      ;;
6070    mingw* | cegcc*)
6071      # MinGW DLLs use traditional 'lib' prefix
6072      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
6073      ;;
6074    pw32*)
6075      # pw32 DLLs use 'pw' prefix rather than 'lib'
6076      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
6077      ;;
6078    esac
6079    dynamic_linker='Win32 ld.exe'
6080    ;;
6081
6082  *,cl*)
6083    # Native MSVC
6084    libname_spec='$name'
6085    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
6086    library_names_spec='$libname.dll.lib'
6087
6088    case $build_os in
6089    mingw*)
6090      sys_lib_search_path_spec=
6091      lt_save_ifs=$IFS
6092      IFS=';'
6093      for lt_path in $LIB
6094      do
6095        IFS=$lt_save_ifs
6096        # Let DOS variable expansion print the short 8.3 style file name.
6097        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
6098        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
6099      done
6100      IFS=$lt_save_ifs
6101      # Convert to MSYS style.
6102      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
6103      ;;
6104    cygwin*)
6105      # Convert to unix form, then to dos form, then back to unix form
6106      # but this time dos style (no spaces!) so that the unix form looks
6107      # like /cygdrive/c/PROGRA~1:/cygdr...
6108      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
6109      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
6110      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
6111      ;;
6112    *)
6113      sys_lib_search_path_spec=$LIB
6114      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
6115        # It is most probably a Windows format PATH.
6116        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
6117      else
6118        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
6119      fi
6120      # FIXME: find the short name or the path components, as spaces are
6121      # common. (e.g. "Program Files" -> "PROGRA~1")
6122      ;;
6123    esac
6124
6125    # DLL is installed to $(libdir)/../bin by postinstall_cmds
6126    postinstall_cmds='base_file=`basename \$file`~
6127      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
6128      dldir=$destdir/`dirname \$dlpath`~
6129      test -d \$dldir || mkdir -p \$dldir~
6130      $install_prog $dir/$dlname \$dldir/$dlname'
6131    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
6132      dlpath=$dir/\$dldll~
6133       $RM \$dlpath'
6134    shlibpath_overrides_runpath=yes
6135    dynamic_linker='Win32 link.exe'
6136    ;;
6137
6138  *)
6139    # Assume MSVC wrapper
6140    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
6141    dynamic_linker='Win32 ld.exe'
6142    ;;
6143  esac
6144  # FIXME: first we should search . and the directory the executable is in
6145  shlibpath_var=PATH
6146  ;;
6147
6148darwin* | rhapsody*)
6149  dynamic_linker="$host_os dyld"
6150  version_type=darwin
6151  need_lib_prefix=no
6152  need_version=no
6153  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
6154  soname_spec='$libname$release$major$shared_ext'
6155  shlibpath_overrides_runpath=yes
6156  shlibpath_var=DYLD_LIBRARY_PATH
6157  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
6158m4_if([$1], [],[
6159  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
6160  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
6161  ;;
6162
6163dgux*)
6164  version_type=linux # correct to gnu/linux during the next big refactor
6165  need_lib_prefix=no
6166  need_version=no
6167  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6168  soname_spec='$libname$release$shared_ext$major'
6169  shlibpath_var=LD_LIBRARY_PATH
6170  ;;
6171
6172freebsd* | dragonfly*)
6173  # DragonFly does not have aout.  When/if they implement a new
6174  # versioning mechanism, adjust this.
6175  if test -x /usr/bin/objformat; then
6176    objformat=`/usr/bin/objformat`
6177  else
6178    case $host_os in
6179    freebsd[[23]].*) objformat=aout ;;
6180    *) objformat=elf ;;
6181    esac
6182  fi
6183  version_type=freebsd-$objformat
6184  case $version_type in
6185    freebsd-elf*)
6186      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6187      soname_spec='$libname$release$shared_ext$major'
6188      need_version=no
6189      need_lib_prefix=no
6190      ;;
6191    freebsd-*)
6192      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6193      need_version=yes
6194      ;;
6195  esac
6196  shlibpath_var=LD_LIBRARY_PATH
6197  case $host_os in
6198  freebsd2.*)
6199    shlibpath_overrides_runpath=yes
6200    ;;
6201  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
6202    shlibpath_overrides_runpath=yes
6203    hardcode_into_libs=yes
6204    ;;
6205  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
6206  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
6207    shlibpath_overrides_runpath=no
6208    hardcode_into_libs=yes
6209    ;;
6210  *) # from 4.6 on, and DragonFly
6211    shlibpath_overrides_runpath=yes
6212    hardcode_into_libs=yes
6213    ;;
6214  esac
6215  ;;
6216
6217haiku*)
6218  version_type=linux # correct to gnu/linux during the next big refactor
6219  need_lib_prefix=no
6220  need_version=no
6221  dynamic_linker="$host_os runtime_loader"
6222  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6223  soname_spec='$libname$release$shared_ext$major'
6224  shlibpath_var=LIBRARY_PATH
6225  shlibpath_overrides_runpath=no
6226  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
6227  hardcode_into_libs=yes
6228  ;;
6229
6230hpux9* | hpux10* | hpux11*)
6231  # Give a soname corresponding to the major version so that dld.sl refuses to
6232  # link against other versions.
6233  version_type=sunos
6234  need_lib_prefix=no
6235  need_version=no
6236  case $host_cpu in
6237  ia64*)
6238    shrext_cmds='.so'
6239    hardcode_into_libs=yes
6240    dynamic_linker="$host_os dld.so"
6241    shlibpath_var=LD_LIBRARY_PATH
6242    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6243    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6244    soname_spec='$libname$release$shared_ext$major'
6245    if test 32 = "$HPUX_IA64_MODE"; then
6246      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
6247      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
6248    else
6249      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
6250      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
6251    fi
6252    ;;
6253  hppa*64*)
6254    shrext_cmds='.sl'
6255    hardcode_into_libs=yes
6256    dynamic_linker="$host_os dld.sl"
6257    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
6258    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6259    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6260    soname_spec='$libname$release$shared_ext$major'
6261    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
6262    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6263    ;;
6264  *)
6265    shrext_cmds='.sl'
6266    dynamic_linker="$host_os dld.sl"
6267    shlibpath_var=SHLIB_PATH
6268    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6269    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6270    soname_spec='$libname$release$shared_ext$major'
6271    ;;
6272  esac
6273  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
6274  postinstall_cmds='chmod 555 $lib'
6275  # or fails outright, so override atomically:
6276  install_override_mode=555
6277  ;;
6278
6279interix[[3-9]]*)
6280  version_type=linux # correct to gnu/linux during the next big refactor
6281  need_lib_prefix=no
6282  need_version=no
6283  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6284  soname_spec='$libname$release$shared_ext$major'
6285  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
6286  shlibpath_var=LD_LIBRARY_PATH
6287  shlibpath_overrides_runpath=no
6288  hardcode_into_libs=yes
6289  ;;
6290
6291irix5* | irix6* | nonstopux*)
6292  case $host_os in
6293    nonstopux*) version_type=nonstopux ;;
6294    *)
6295	if test yes = "$lt_cv_prog_gnu_ld"; then
6296		version_type=linux # correct to gnu/linux during the next big refactor
6297	else
6298		version_type=irix
6299	fi ;;
6300  esac
6301  need_lib_prefix=no
6302  need_version=no
6303  soname_spec='$libname$release$shared_ext$major'
6304  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
6305  case $host_os in
6306  irix5* | nonstopux*)
6307    libsuff= shlibsuff=
6308    ;;
6309  *)
6310    case $LD in # libtool.m4 will add one of these switches to LD
6311    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
6312      libsuff= shlibsuff= libmagic=32-bit;;
6313    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
6314      libsuff=32 shlibsuff=N32 libmagic=N32;;
6315    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
6316      libsuff=64 shlibsuff=64 libmagic=64-bit;;
6317    *) libsuff= shlibsuff= libmagic=never-match;;
6318    esac
6319    ;;
6320  esac
6321  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6322  shlibpath_overrides_runpath=no
6323  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
6324  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
6325  hardcode_into_libs=yes
6326  ;;
6327
6328# No shared lib support for Linux oldld, aout, or coff.
6329linux*oldld* | linux*aout* | linux*coff*)
6330  dynamic_linker=no
6331  ;;
6332
6333linux*android*)
6334  version_type=none # Android doesn't support versioned libraries.
6335  need_lib_prefix=no
6336  need_version=no
6337  library_names_spec='$libname$release$shared_ext'
6338  soname_spec='$libname$release$shared_ext'
6339  finish_cmds=
6340  shlibpath_var=LD_LIBRARY_PATH
6341  shlibpath_overrides_runpath=yes
6342
6343  # This implies no fast_install, which is unacceptable.
6344  # Some rework will be needed to allow for fast_install
6345  # before this can be enabled.
6346  hardcode_into_libs=yes
6347
6348  dynamic_linker='Android linker'
6349  # Don't embed -rpath directories since the linker doesn't support them.
6350  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6351  ;;
6352
6353# This must be glibc/ELF.
6354linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6355  version_type=linux # correct to gnu/linux during the next big refactor
6356  need_lib_prefix=no
6357  need_version=no
6358  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6359  soname_spec='$libname$release$shared_ext$major'
6360  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6361  shlibpath_var=LD_LIBRARY_PATH
6362  shlibpath_overrides_runpath=no
6363
6364  # Some binutils ld are patched to set DT_RUNPATH
6365  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
6366    [lt_cv_shlibpath_overrides_runpath=no
6367    save_LDFLAGS=$LDFLAGS
6368    save_libdir=$libdir
6369    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
6370	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
6371    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
6372      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
6373	 [lt_cv_shlibpath_overrides_runpath=yes])])
6374    LDFLAGS=$save_LDFLAGS
6375    libdir=$save_libdir
6376    ])
6377  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
6378
6379  # This implies no fast_install, which is unacceptable.
6380  # Some rework will be needed to allow for fast_install
6381  # before this can be enabled.
6382  hardcode_into_libs=yes
6383
6384  # Ideally, we could use ldconfig to report *all* directores which are
6385  # searched for libraries, however this is still not possible.  Aside from not
6386  # being certain /sbin/ldconfig is available, command
6387  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
6388  # even though it is searched at run-time.  Try to do the best guess by
6389  # appending ld.so.conf contents (and includes) to the search path.
6390  if test -f /etc/ld.so.conf; then
6391    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' ' '`
6392    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
6393  fi
6394
6395  # We used to test for /lib/ld.so.1 and disable shared libraries on
6396  # powerpc, because MkLinux only supported shared libraries with the
6397  # GNU dynamic linker.  Since this was broken with cross compilers,
6398  # most powerpc-linux boxes support dynamic linking these days and
6399  # people can always --disable-shared, the test was removed, and we
6400  # assume the GNU/Linux dynamic linker is in use.
6401  dynamic_linker='GNU/Linux ld.so'
6402  ;;
6403
6404netbsd*)
6405  version_type=sunos
6406  need_lib_prefix=no
6407  need_version=no
6408  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6409    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6410    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6411    dynamic_linker='NetBSD (a.out) ld.so'
6412  else
6413    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6414    soname_spec='$libname$release$shared_ext$major'
6415    dynamic_linker='NetBSD ld.elf_so'
6416  fi
6417  shlibpath_var=LD_LIBRARY_PATH
6418  shlibpath_overrides_runpath=yes
6419  hardcode_into_libs=yes
6420  ;;
6421
6422newsos6)
6423  version_type=linux # correct to gnu/linux during the next big refactor
6424  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6425  shlibpath_var=LD_LIBRARY_PATH
6426  shlibpath_overrides_runpath=yes
6427  ;;
6428
6429*nto* | *qnx*)
6430  version_type=qnx
6431  need_lib_prefix=no
6432  need_version=no
6433  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6434  soname_spec='$libname$release$shared_ext$major'
6435  shlibpath_var=LD_LIBRARY_PATH
6436  shlibpath_overrides_runpath=no
6437  hardcode_into_libs=yes
6438  dynamic_linker='ldqnx.so'
6439  ;;
6440
6441openbsd* | bitrig*)
6442  version_type=sunos
6443  sys_lib_dlsearch_path_spec=/usr/lib
6444  need_lib_prefix=no
6445  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
6446    need_version=no
6447  else
6448    need_version=yes
6449  fi
6450  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6451  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6452  shlibpath_var=LD_LIBRARY_PATH
6453  shlibpath_overrides_runpath=yes
6454  ;;
6455
6456os2*)
6457  libname_spec='$name'
6458  version_type=windows
6459  shrext_cmds=.dll
6460  need_version=no
6461  need_lib_prefix=no
6462  # OS/2 can only load a DLL with a base name of 8 characters or less.
6463  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
6464    v=$($ECHO $release$versuffix | tr -d .-);
6465    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
6466    $ECHO $n$v`$shared_ext'
6467  library_names_spec='${libname}_dll.$libext'
6468  dynamic_linker='OS/2 ld.exe'
6469  shlibpath_var=BEGINLIBPATH
6470  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6471  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6472  postinstall_cmds='base_file=`basename \$file`~
6473    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
6474    dldir=$destdir/`dirname \$dlpath`~
6475    test -d \$dldir || mkdir -p \$dldir~
6476    $install_prog $dir/$dlname \$dldir/$dlname~
6477    chmod a+x \$dldir/$dlname~
6478    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
6479      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
6480    fi'
6481  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
6482    dlpath=$dir/\$dldll~
6483    $RM \$dlpath'
6484  ;;
6485
6486osf3* | osf4* | osf5*)
6487  version_type=osf
6488  need_lib_prefix=no
6489  need_version=no
6490  soname_spec='$libname$release$shared_ext$major'
6491  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6492  shlibpath_var=LD_LIBRARY_PATH
6493  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6494  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6495  ;;
6496
6497rdos*)
6498  dynamic_linker=no
6499  ;;
6500
6501solaris*)
6502  version_type=linux # correct to gnu/linux during the next big refactor
6503  need_lib_prefix=no
6504  need_version=no
6505  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6506  soname_spec='$libname$release$shared_ext$major'
6507  shlibpath_var=LD_LIBRARY_PATH
6508  shlibpath_overrides_runpath=yes
6509  hardcode_into_libs=yes
6510  # ldd complains unless libraries are executable
6511  postinstall_cmds='chmod +x $lib'
6512  ;;
6513
6514sunos4*)
6515  version_type=sunos
6516  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6517  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6518  shlibpath_var=LD_LIBRARY_PATH
6519  shlibpath_overrides_runpath=yes
6520  if test yes = "$with_gnu_ld"; then
6521    need_lib_prefix=no
6522  fi
6523  need_version=yes
6524  ;;
6525
6526sysv4 | sysv4.3*)
6527  version_type=linux # correct to gnu/linux during the next big refactor
6528  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6529  soname_spec='$libname$release$shared_ext$major'
6530  shlibpath_var=LD_LIBRARY_PATH
6531  case $host_vendor in
6532    sni)
6533      shlibpath_overrides_runpath=no
6534      need_lib_prefix=no
6535      runpath_var=LD_RUN_PATH
6536      ;;
6537    siemens)
6538      need_lib_prefix=no
6539      ;;
6540    motorola)
6541      need_lib_prefix=no
6542      need_version=no
6543      shlibpath_overrides_runpath=no
6544      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6545      ;;
6546  esac
6547  ;;
6548
6549sysv4*MP*)
6550  if test -d /usr/nec; then
6551    version_type=linux # correct to gnu/linux during the next big refactor
6552    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
6553    soname_spec='$libname$shared_ext.$major'
6554    shlibpath_var=LD_LIBRARY_PATH
6555  fi
6556  ;;
6557
6558sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
6559  version_type=sco
6560  need_lib_prefix=no
6561  need_version=no
6562  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
6563  soname_spec='$libname$release$shared_ext$major'
6564  shlibpath_var=LD_LIBRARY_PATH
6565  shlibpath_overrides_runpath=yes
6566  hardcode_into_libs=yes
6567  if test yes = "$with_gnu_ld"; then
6568    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
6569  else
6570    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
6571    case $host_os in
6572      sco3.2v5*)
6573        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
6574	;;
6575    esac
6576  fi
6577  sys_lib_dlsearch_path_spec='/usr/lib'
6578  ;;
6579
6580tpf*)
6581  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
6582  version_type=linux # correct to gnu/linux during the next big refactor
6583  need_lib_prefix=no
6584  need_version=no
6585  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6586  shlibpath_var=LD_LIBRARY_PATH
6587  shlibpath_overrides_runpath=no
6588  hardcode_into_libs=yes
6589  ;;
6590
6591uts4*)
6592  version_type=linux # correct to gnu/linux during the next big refactor
6593  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6594  soname_spec='$libname$release$shared_ext$major'
6595  shlibpath_var=LD_LIBRARY_PATH
6596  ;;
6597
6598*)
6599  dynamic_linker=no
6600  ;;
6601esac
6602AC_MSG_RESULT([$dynamic_linker])
6603test no = "$dynamic_linker" && can_build_shared=no
6604
6605variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6606if test yes = "$GCC"; then
6607  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6608fi
6609
6610if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
6611  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
6612fi
6613
6614if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
6615  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
6616fi
6617
6618# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
6619configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
6620
6621# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
6622func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
6623
6624# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
6625configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
6626
6627_LT_DECL([], [variables_saved_for_relink], [1],
6628    [Variables whose values should be saved in libtool wrapper scripts and
6629    restored at link time])
6630_LT_DECL([], [need_lib_prefix], [0],
6631    [Do we need the "lib" prefix for modules?])
6632_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
6633_LT_DECL([], [version_type], [0], [Library versioning type])
6634_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
6635_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
6636_LT_DECL([], [shlibpath_overrides_runpath], [0],
6637    [Is shlibpath searched before the hard-coded library search path?])
6638_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
6639_LT_DECL([], [library_names_spec], [1],
6640    [[List of archive names.  First name is the real one, the rest are links.
6641    The last name is the one that the linker finds with -lNAME]])
6642_LT_DECL([], [soname_spec], [1],
6643    [[The coded name of the library, if different from the real name]])
6644_LT_DECL([], [install_override_mode], [1],
6645    [Permission mode override for installation of shared libraries])
6646_LT_DECL([], [postinstall_cmds], [2],
6647    [Command to use after installation of a shared archive])
6648_LT_DECL([], [postuninstall_cmds], [2],
6649    [Command to use after uninstallation of a shared archive])
6650_LT_DECL([], [finish_cmds], [2],
6651    [Commands used to finish a libtool library installation in a directory])
6652_LT_DECL([], [finish_eval], [1],
6653    [[As "finish_cmds", except a single script fragment to be evaled but
6654    not shown]])
6655_LT_DECL([], [hardcode_into_libs], [0],
6656    [Whether we should hardcode library paths into libraries])
6657_LT_DECL([], [sys_lib_search_path_spec], [2],
6658    [Compile-time system search path for libraries])
6659_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
6660    [Detected run-time system search path for libraries])
6661_LT_DECL([], [configure_time_lt_sys_library_path], [2],
6662    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
6663])# _LT_SYS_DYNAMIC_LINKER
6664
6665
6666# _LT_PATH_TOOL_PREFIX(TOOL)
6667# --------------------------
6668# find a file program that can recognize shared library
6669AC_DEFUN([_LT_PATH_TOOL_PREFIX],
6670[m4_require([_LT_DECL_EGREP])dnl
6671AC_MSG_CHECKING([for $1])
6672AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
6673[case $MAGIC_CMD in
6674[[\\/*] |  ?:[\\/]*])
6675  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
6676  ;;
6677*)
6678  lt_save_MAGIC_CMD=$MAGIC_CMD
6679  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6680dnl $ac_dummy forces splitting on constant user-supplied paths.
6681dnl POSIX.2 word splitting is done only on the output of word expansions,
6682dnl not every word.  This closes a longstanding sh security hole.
6683  ac_dummy="m4_if([$2], , $PATH, [$2])"
6684  for ac_dir in $ac_dummy; do
6685    IFS=$lt_save_ifs
6686    test -z "$ac_dir" && ac_dir=.
6687    if test -f "$ac_dir/$1"; then
6688      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
6689      if test -n "$file_magic_test_file"; then
6690	case $deplibs_check_method in
6691	"file_magic "*)
6692	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
6693	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
6694	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
6695	    $EGREP "$file_magic_regex" > /dev/null; then
6696	    :
6697	  else
6698	    cat <<_LT_EOF 1>&2
6699
6700*** Warning: the command libtool uses to detect shared libraries,
6701*** $file_magic_cmd, produces output that libtool cannot recognize.
6702*** The result is that libtool may fail to recognize shared libraries
6703*** as such.  This will affect the creation of libtool libraries that
6704*** depend on shared libraries, but programs linked with such libtool
6705*** libraries will work regardless of this problem.  Nevertheless, you
6706*** may want to report the problem to your system manager and/or to
6707*** bug-libtool@gnu.org
6708
6709_LT_EOF
6710	  fi ;;
6711	esac
6712      fi
6713      break
6714    fi
6715  done
6716  IFS=$lt_save_ifs
6717  MAGIC_CMD=$lt_save_MAGIC_CMD
6718  ;;
6719esac])
6720MAGIC_CMD=$lt_cv_path_MAGIC_CMD
6721if test -n "$MAGIC_CMD"; then
6722  AC_MSG_RESULT($MAGIC_CMD)
6723else
6724  AC_MSG_RESULT(no)
6725fi
6726_LT_DECL([], [MAGIC_CMD], [0],
6727	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
6728])# _LT_PATH_TOOL_PREFIX
6729
6730# Old name:
6731AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
6732dnl aclocal-1.4 backwards compatibility:
6733dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
6734
6735
6736# _LT_PATH_MAGIC
6737# --------------
6738# find a file program that can recognize a shared library
6739m4_defun([_LT_PATH_MAGIC],
6740[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
6741if test -z "$lt_cv_path_MAGIC_CMD"; then
6742  if test -n "$ac_tool_prefix"; then
6743    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
6744  else
6745    MAGIC_CMD=:
6746  fi
6747fi
6748])# _LT_PATH_MAGIC
6749
6750
6751# LT_PATH_LD
6752# ----------
6753# find the pathname to the GNU or non-GNU linker
6754AC_DEFUN([LT_PATH_LD],
6755[AC_REQUIRE([AC_PROG_CC])dnl
6756AC_REQUIRE([AC_CANONICAL_HOST])dnl
6757AC_REQUIRE([AC_CANONICAL_BUILD])dnl
6758m4_require([_LT_DECL_SED])dnl
6759m4_require([_LT_DECL_EGREP])dnl
6760m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
6761
6762AC_ARG_WITH([gnu-ld],
6763    [AS_HELP_STRING([--with-gnu-ld],
6764	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
6765    [test no = "$withval" || with_gnu_ld=yes],
6766    [with_gnu_ld=no])dnl
6767
6768ac_prog=ld
6769if test yes = "$GCC"; then
6770  # Check if gcc -print-prog-name=ld gives a path.
6771  AC_MSG_CHECKING([for ld used by $CC])
6772  case $host in
6773  *-*-mingw*)
6774    # gcc leaves a trailing carriage return, which upsets mingw
6775    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6776  *)
6777    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6778  esac
6779  case $ac_prog in
6780    # Accept absolute paths.
6781    [[\\/]]* | ?:[[\\/]]*)
6782      re_direlt='/[[^/]][[^/]]*/\.\./'
6783      # Canonicalize the pathname of ld
6784      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
6785      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
6786	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
6787      done
6788      test -z "$LD" && LD=$ac_prog
6789      ;;
6790  "")
6791    # If it fails, then pretend we aren't using GCC.
6792    ac_prog=ld
6793    ;;
6794  *)
6795    # If it is relative, then search for the first ld in PATH.
6796    with_gnu_ld=unknown
6797    ;;
6798  esac
6799elif test yes = "$with_gnu_ld"; then
6800  AC_MSG_CHECKING([for GNU ld])
6801else
6802  AC_MSG_CHECKING([for non-GNU ld])
6803fi
6804AC_CACHE_VAL(lt_cv_path_LD,
6805[if test -z "$LD"; then
6806  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6807  for ac_dir in $PATH; do
6808    IFS=$lt_save_ifs
6809    test -z "$ac_dir" && ac_dir=.
6810    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6811      lt_cv_path_LD=$ac_dir/$ac_prog
6812      # Check to see if the program is GNU ld.  I'd rather use --version,
6813      # but apparently some variants of GNU ld only accept -v.
6814      # Break only if it was the GNU/non-GNU ld that we prefer.
6815      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
6816      *GNU* | *'with BFD'*)
6817	test no != "$with_gnu_ld" && break
6818	;;
6819      *)
6820	test yes != "$with_gnu_ld" && break
6821	;;
6822      esac
6823    fi
6824  done
6825  IFS=$lt_save_ifs
6826else
6827  lt_cv_path_LD=$LD # Let the user override the test with a path.
6828fi])
6829LD=$lt_cv_path_LD
6830if test -n "$LD"; then
6831  AC_MSG_RESULT($LD)
6832else
6833  AC_MSG_RESULT(no)
6834fi
6835test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
6836_LT_PATH_LD_GNU
6837AC_SUBST([LD])
6838
6839_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
6840])# LT_PATH_LD
6841
6842# Old names:
6843AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
6844AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
6845dnl aclocal-1.4 backwards compatibility:
6846dnl AC_DEFUN([AM_PROG_LD], [])
6847dnl AC_DEFUN([AC_PROG_LD], [])
6848
6849
6850# _LT_PATH_LD_GNU
6851#- --------------
6852m4_defun([_LT_PATH_LD_GNU],
6853[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
6854[# I'd rather use --version here, but apparently some GNU lds only accept -v.
6855case `$LD -v 2>&1 </dev/null` in
6856*GNU* | *'with BFD'*)
6857  lt_cv_prog_gnu_ld=yes
6858  ;;
6859*)
6860  lt_cv_prog_gnu_ld=no
6861  ;;
6862esac])
6863with_gnu_ld=$lt_cv_prog_gnu_ld
6864])# _LT_PATH_LD_GNU
6865
6866
6867# _LT_CMD_RELOAD
6868# --------------
6869# find reload flag for linker
6870#   -- PORTME Some linkers may need a different reload flag.
6871m4_defun([_LT_CMD_RELOAD],
6872[AC_CACHE_CHECK([for $LD option to reload object files],
6873  lt_cv_ld_reload_flag,
6874  [lt_cv_ld_reload_flag='-r'])
6875reload_flag=$lt_cv_ld_reload_flag
6876case $reload_flag in
6877"" | " "*) ;;
6878*) reload_flag=" $reload_flag" ;;
6879esac
6880reload_cmds='$LD$reload_flag -o $output$reload_objs'
6881case $host_os in
6882  cygwin* | mingw* | pw32* | cegcc*)
6883    if test yes != "$GCC"; then
6884      reload_cmds=false
6885    fi
6886    ;;
6887  darwin*)
6888    if test yes = "$GCC"; then
6889      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
6890    else
6891      reload_cmds='$LD$reload_flag -o $output$reload_objs'
6892    fi
6893    ;;
6894esac
6895_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
6896_LT_TAGDECL([], [reload_cmds], [2])dnl
6897])# _LT_CMD_RELOAD
6898
6899
6900# _LT_PATH_DD
6901# -----------
6902# find a working dd
6903m4_defun([_LT_PATH_DD],
6904[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
6905[printf 0123456789abcdef0123456789abcdef >conftest.i
6906cat conftest.i conftest.i >conftest2.i
6907: ${lt_DD:=$DD}
6908AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
6909[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6910  cmp -s conftest.i conftest.out \
6911  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6912fi])
6913rm -f conftest.i conftest2.i conftest.out])
6914])# _LT_PATH_DD
6915
6916
6917# _LT_CMD_TRUNCATE
6918# ----------------
6919# find command to truncate a binary pipe
6920m4_defun([_LT_CMD_TRUNCATE],
6921[m4_require([_LT_PATH_DD])
6922AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
6923[printf 0123456789abcdef0123456789abcdef >conftest.i
6924cat conftest.i conftest.i >conftest2.i
6925lt_cv_truncate_bin=
6926if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6927  cmp -s conftest.i conftest.out \
6928  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6929fi
6930rm -f conftest.i conftest2.i conftest.out
6931test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
6932_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
6933  [Command to truncate a binary pipe])
6934])# _LT_CMD_TRUNCATE
6935
6936
6937# _LT_CHECK_MAGIC_METHOD
6938# ----------------------
6939# how to check for library dependencies
6940#  -- PORTME fill in with the dynamic library characteristics
6941m4_defun([_LT_CHECK_MAGIC_METHOD],
6942[m4_require([_LT_DECL_EGREP])
6943m4_require([_LT_DECL_OBJDUMP])
6944AC_CACHE_CHECK([how to recognize dependent libraries],
6945lt_cv_deplibs_check_method,
6946[lt_cv_file_magic_cmd='$MAGIC_CMD'
6947lt_cv_file_magic_test_file=
6948lt_cv_deplibs_check_method='unknown'
6949# Need to set the preceding variable on all platforms that support
6950# interlibrary dependencies.
6951# 'none' -- dependencies not supported.
6952# 'unknown' -- same as none, but documents that we really don't know.
6953# 'pass_all' -- all dependencies passed with no checks.
6954# 'test_compile' -- check by making test program.
6955# 'file_magic [[regex]]' -- check by looking for files in library path
6956# that responds to the $file_magic_cmd with a given extended regex.
6957# If you have 'file' or equivalent on your system and you're not sure
6958# whether 'pass_all' will *always* work, you probably want this one.
6959
6960case $host_os in
6961aix[[4-9]]*)
6962  lt_cv_deplibs_check_method=pass_all
6963  ;;
6964
6965beos*)
6966  lt_cv_deplibs_check_method=pass_all
6967  ;;
6968
6969bsdi[[45]]*)
6970  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
6971  lt_cv_file_magic_cmd='/usr/bin/file -L'
6972  lt_cv_file_magic_test_file=/shlib/libc.so
6973  ;;
6974
6975cygwin*)
6976  # func_win32_libid is a shell function defined in ltmain.sh
6977  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6978  lt_cv_file_magic_cmd='func_win32_libid'
6979  ;;
6980
6981mingw* | pw32*)
6982  # Base MSYS/MinGW do not provide the 'file' command needed by
6983  # func_win32_libid shell function, so use a weaker test based on 'objdump',
6984  # unless we find 'file', for example because we are cross-compiling.
6985  if ( file / ) >/dev/null 2>&1; then
6986    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6987    lt_cv_file_magic_cmd='func_win32_libid'
6988  else
6989    # Keep this pattern in sync with the one in func_win32_libid.
6990    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
6991    lt_cv_file_magic_cmd='$OBJDUMP -f'
6992  fi
6993  ;;
6994
6995cegcc*)
6996  # use the weaker test based on 'objdump'. See mingw*.
6997  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
6998  lt_cv_file_magic_cmd='$OBJDUMP -f'
6999  ;;
7000
7001darwin* | rhapsody*)
7002  lt_cv_deplibs_check_method=pass_all
7003  ;;
7004
7005freebsd* | dragonfly*)
7006  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
7007    case $host_cpu in
7008    i*86 )
7009      # Not sure whether the presence of OpenBSD here was a mistake.
7010      # Let's accept both of them until this is cleared up.
7011      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
7012      lt_cv_file_magic_cmd=/usr/bin/file
7013      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7014      ;;
7015    esac
7016  else
7017    lt_cv_deplibs_check_method=pass_all
7018  fi
7019  ;;
7020
7021haiku*)
7022  lt_cv_deplibs_check_method=pass_all
7023  ;;
7024
7025hpux10.20* | hpux11*)
7026  lt_cv_file_magic_cmd=/usr/bin/file
7027  case $host_cpu in
7028  ia64*)
7029    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
7030    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
7031    ;;
7032  hppa*64*)
7033    [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]']
7034    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
7035    ;;
7036  *)
7037    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
7038    lt_cv_file_magic_test_file=/usr/lib/libc.sl
7039    ;;
7040  esac
7041  ;;
7042
7043interix[[3-9]]*)
7044  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
7045  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
7046  ;;
7047
7048irix5* | irix6* | nonstopux*)
7049  case $LD in
7050  *-32|*"-32 ") libmagic=32-bit;;
7051  *-n32|*"-n32 ") libmagic=N32;;
7052  *-64|*"-64 ") libmagic=64-bit;;
7053  *) libmagic=never-match;;
7054  esac
7055  lt_cv_deplibs_check_method=pass_all
7056  ;;
7057
7058# This must be glibc/ELF.
7059linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7060  lt_cv_deplibs_check_method=pass_all
7061  ;;
7062
7063netbsd*)
7064  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
7065    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
7066  else
7067    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
7068  fi
7069  ;;
7070
7071newos6*)
7072  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
7073  lt_cv_file_magic_cmd=/usr/bin/file
7074  lt_cv_file_magic_test_file=/usr/lib/libnls.so
7075  ;;
7076
7077*nto* | *qnx*)
7078  lt_cv_deplibs_check_method=pass_all
7079  ;;
7080
7081openbsd* | bitrig*)
7082  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
7083    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
7084  else
7085    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
7086  fi
7087  ;;
7088
7089osf3* | osf4* | osf5*)
7090  lt_cv_deplibs_check_method=pass_all
7091  ;;
7092
7093rdos*)
7094  lt_cv_deplibs_check_method=pass_all
7095  ;;
7096
7097solaris*)
7098  lt_cv_deplibs_check_method=pass_all
7099  ;;
7100
7101sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
7102  lt_cv_deplibs_check_method=pass_all
7103  ;;
7104
7105sysv4 | sysv4.3*)
7106  case $host_vendor in
7107  motorola)
7108    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]]'
7109    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
7110    ;;
7111  ncr)
7112    lt_cv_deplibs_check_method=pass_all
7113    ;;
7114  sequent)
7115    lt_cv_file_magic_cmd='/bin/file'
7116    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
7117    ;;
7118  sni)
7119    lt_cv_file_magic_cmd='/bin/file'
7120    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
7121    lt_cv_file_magic_test_file=/lib/libc.so
7122    ;;
7123  siemens)
7124    lt_cv_deplibs_check_method=pass_all
7125    ;;
7126  pc)
7127    lt_cv_deplibs_check_method=pass_all
7128    ;;
7129  esac
7130  ;;
7131
7132tpf*)
7133  lt_cv_deplibs_check_method=pass_all
7134  ;;
7135os2*)
7136  lt_cv_deplibs_check_method=pass_all
7137  ;;
7138esac
7139])
7140
7141file_magic_glob=
7142want_nocaseglob=no
7143if test "$build" = "$host"; then
7144  case $host_os in
7145  mingw* | pw32*)
7146    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
7147      want_nocaseglob=yes
7148    else
7149      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
7150    fi
7151    ;;
7152  esac
7153fi
7154
7155file_magic_cmd=$lt_cv_file_magic_cmd
7156deplibs_check_method=$lt_cv_deplibs_check_method
7157test -z "$deplibs_check_method" && deplibs_check_method=unknown
7158
7159_LT_DECL([], [deplibs_check_method], [1],
7160    [Method to check whether dependent libraries are shared objects])
7161_LT_DECL([], [file_magic_cmd], [1],
7162    [Command to use when deplibs_check_method = "file_magic"])
7163_LT_DECL([], [file_magic_glob], [1],
7164    [How to find potential files when deplibs_check_method = "file_magic"])
7165_LT_DECL([], [want_nocaseglob], [1],
7166    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
7167])# _LT_CHECK_MAGIC_METHOD
7168
7169
7170# LT_PATH_NM
7171# ----------
7172# find the pathname to a BSD- or MS-compatible name lister
7173AC_DEFUN([LT_PATH_NM],
7174[AC_REQUIRE([AC_PROG_CC])dnl
7175AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
7176[if test -n "$NM"; then
7177  # Let the user override the test.
7178  lt_cv_path_NM=$NM
7179else
7180  lt_nm_to_check=${ac_tool_prefix}nm
7181  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
7182    lt_nm_to_check="$lt_nm_to_check nm"
7183  fi
7184  for lt_tmp_nm in $lt_nm_to_check; do
7185    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7186    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
7187      IFS=$lt_save_ifs
7188      test -z "$ac_dir" && ac_dir=.
7189      tmp_nm=$ac_dir/$lt_tmp_nm
7190      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
7191	# Check to see if the nm accepts a BSD-compat flag.
7192	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
7193	#   nm: unknown option "B" ignored
7194	# Tru64's nm complains that /dev/null is an invalid object file
7195	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
7196	case $build_os in
7197	mingw*) lt_bad_file=conftest.nm/nofile ;;
7198	*) lt_bad_file=/dev/null ;;
7199	esac
7200	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
7201	*$lt_bad_file* | *'Invalid file or object type'*)
7202	  lt_cv_path_NM="$tmp_nm -B"
7203	  break 2
7204	  ;;
7205	*)
7206	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
7207	  */dev/null*)
7208	    lt_cv_path_NM="$tmp_nm -p"
7209	    break 2
7210	    ;;
7211	  *)
7212	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7213	    continue # so that we can try to find one that supports BSD flags
7214	    ;;
7215	  esac
7216	  ;;
7217	esac
7218      fi
7219    done
7220    IFS=$lt_save_ifs
7221  done
7222  : ${lt_cv_path_NM=no}
7223fi])
7224if test no != "$lt_cv_path_NM"; then
7225  NM=$lt_cv_path_NM
7226else
7227  # Didn't find any BSD compatible name lister, look for dumpbin.
7228  if test -n "$DUMPBIN"; then :
7229    # Let the user override the test.
7230  else
7231    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
7232    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
7233    *COFF*)
7234      DUMPBIN="$DUMPBIN -symbols -headers"
7235      ;;
7236    *)
7237      DUMPBIN=:
7238      ;;
7239    esac
7240  fi
7241  AC_SUBST([DUMPBIN])
7242  if test : != "$DUMPBIN"; then
7243    NM=$DUMPBIN
7244  fi
7245fi
7246test -z "$NM" && NM=nm
7247AC_SUBST([NM])
7248_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
7249
7250AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
7251  [lt_cv_nm_interface="BSD nm"
7252  echo "int some_variable = 0;" > conftest.$ac_ext
7253  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
7254  (eval "$ac_compile" 2>conftest.err)
7255  cat conftest.err >&AS_MESSAGE_LOG_FD
7256  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
7257  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
7258  cat conftest.err >&AS_MESSAGE_LOG_FD
7259  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
7260  cat conftest.out >&AS_MESSAGE_LOG_FD
7261  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
7262    lt_cv_nm_interface="MS dumpbin"
7263  fi
7264  rm -f conftest*])
7265])# LT_PATH_NM
7266
7267# Old names:
7268AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
7269AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
7270dnl aclocal-1.4 backwards compatibility:
7271dnl AC_DEFUN([AM_PROG_NM], [])
7272dnl AC_DEFUN([AC_PROG_NM], [])
7273
7274# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7275# --------------------------------
7276# how to determine the name of the shared library
7277# associated with a specific link library.
7278#  -- PORTME fill in with the dynamic library characteristics
7279m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
7280[m4_require([_LT_DECL_EGREP])
7281m4_require([_LT_DECL_OBJDUMP])
7282m4_require([_LT_DECL_DLLTOOL])
7283AC_CACHE_CHECK([how to associate runtime and link libraries],
7284lt_cv_sharedlib_from_linklib_cmd,
7285[lt_cv_sharedlib_from_linklib_cmd='unknown'
7286
7287case $host_os in
7288cygwin* | mingw* | pw32* | cegcc*)
7289  # two different shell functions defined in ltmain.sh;
7290  # decide which one to use based on capabilities of $DLLTOOL
7291  case `$DLLTOOL --help 2>&1` in
7292  *--identify-strict*)
7293    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
7294    ;;
7295  *)
7296    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
7297    ;;
7298  esac
7299  ;;
7300*)
7301  # fallback: assume linklib IS sharedlib
7302  lt_cv_sharedlib_from_linklib_cmd=$ECHO
7303  ;;
7304esac
7305])
7306sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
7307test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
7308
7309_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
7310    [Command to associate shared and link libraries])
7311])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7312
7313
7314# _LT_PATH_MANIFEST_TOOL
7315# ----------------------
7316# locate the manifest tool
7317m4_defun([_LT_PATH_MANIFEST_TOOL],
7318[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
7319test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
7320AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
7321  [lt_cv_path_mainfest_tool=no
7322  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
7323  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
7324  cat conftest.err >&AS_MESSAGE_LOG_FD
7325  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
7326    lt_cv_path_mainfest_tool=yes
7327  fi
7328  rm -f conftest*])
7329if test yes != "$lt_cv_path_mainfest_tool"; then
7330  MANIFEST_TOOL=:
7331fi
7332_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
7333])# _LT_PATH_MANIFEST_TOOL
7334
7335
7336# _LT_DLL_DEF_P([FILE])
7337# ---------------------
7338# True iff FILE is a Windows DLL '.def' file.
7339# Keep in sync with func_dll_def_p in the libtool script
7340AC_DEFUN([_LT_DLL_DEF_P],
7341[dnl
7342  test DEF = "`$SED -n dnl
7343    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
7344    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
7345    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
7346    -e q dnl                          Only consider the first "real" line
7347    $1`" dnl
7348])# _LT_DLL_DEF_P
7349
7350
7351# LT_LIB_M
7352# --------
7353# check for math library
7354AC_DEFUN([LT_LIB_M],
7355[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7356LIBM=
7357case $host in
7358*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
7359  # These system don't have libm, or don't need it
7360  ;;
7361*-ncr-sysv4.3*)
7362  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
7363  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
7364  ;;
7365*)
7366  AC_CHECK_LIB(m, cos, LIBM=-lm)
7367  ;;
7368esac
7369AC_SUBST([LIBM])
7370])# LT_LIB_M
7371
7372# Old name:
7373AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
7374dnl aclocal-1.4 backwards compatibility:
7375dnl AC_DEFUN([AC_CHECK_LIBM], [])
7376
7377
7378# _LT_COMPILER_NO_RTTI([TAGNAME])
7379# -------------------------------
7380m4_defun([_LT_COMPILER_NO_RTTI],
7381[m4_require([_LT_TAG_COMPILER])dnl
7382
7383_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7384
7385if test yes = "$GCC"; then
7386  case $cc_basename in
7387  nvcc*)
7388    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
7389  *)
7390    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
7391  esac
7392
7393  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
7394    lt_cv_prog_compiler_rtti_exceptions,
7395    [-fno-rtti -fno-exceptions], [],
7396    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
7397fi
7398_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
7399	[Compiler flag to turn off builtin functions])
7400])# _LT_COMPILER_NO_RTTI
7401
7402
7403# _LT_CMD_GLOBAL_SYMBOLS
7404# ----------------------
7405m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
7406[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7407AC_REQUIRE([AC_PROG_CC])dnl
7408AC_REQUIRE([AC_PROG_AWK])dnl
7409AC_REQUIRE([LT_PATH_NM])dnl
7410AC_REQUIRE([LT_PATH_LD])dnl
7411m4_require([_LT_DECL_SED])dnl
7412m4_require([_LT_DECL_EGREP])dnl
7413m4_require([_LT_TAG_COMPILER])dnl
7414
7415# Check for command to grab the raw symbol name followed by C symbol from nm.
7416AC_MSG_CHECKING([command to parse $NM output from $compiler object])
7417AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
7418[
7419# These are sane defaults that work on at least a few old systems.
7420# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
7421
7422# Character class describing NM global symbol codes.
7423symcode='[[BCDEGRST]]'
7424
7425# Regexp to match symbols that can be accessed directly from C.
7426sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
7427
7428# Define system-specific variables.
7429case $host_os in
7430aix*)
7431  symcode='[[BCDT]]'
7432  ;;
7433cygwin* | mingw* | pw32* | cegcc*)
7434  symcode='[[ABCDGISTW]]'
7435  ;;
7436hpux*)
7437  if test ia64 = "$host_cpu"; then
7438    symcode='[[ABCDEGRST]]'
7439  fi
7440  ;;
7441irix* | nonstopux*)
7442  symcode='[[BCDEGRST]]'
7443  ;;
7444osf*)
7445  symcode='[[BCDEGQRST]]'
7446  ;;
7447solaris*)
7448  symcode='[[BDRT]]'
7449  ;;
7450sco3.2v5*)
7451  symcode='[[DT]]'
7452  ;;
7453sysv4.2uw2*)
7454  symcode='[[DT]]'
7455  ;;
7456sysv5* | sco5v6* | unixware* | OpenUNIX*)
7457  symcode='[[ABDT]]'
7458  ;;
7459sysv4)
7460  symcode='[[DFNSTU]]'
7461  ;;
7462esac
7463
7464# If we're using GNU nm, then use its standard symbol codes.
7465case `$NM -V 2>&1` in
7466*GNU* | *'with BFD'*)
7467  symcode='[[ABCDGIRSTW]]' ;;
7468esac
7469
7470if test "$lt_cv_nm_interface" = "MS dumpbin"; then
7471  # Gets list of data symbols to import.
7472  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
7473  # Adjust the below global symbol transforms to fixup imported variables.
7474  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
7475  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
7476  lt_c_name_lib_hook="\
7477  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
7478  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
7479else
7480  # Disable hooks by default.
7481  lt_cv_sys_global_symbol_to_import=
7482  lt_cdecl_hook=
7483  lt_c_name_hook=
7484  lt_c_name_lib_hook=
7485fi
7486
7487# Transform an extracted symbol line into a proper C declaration.
7488# Some systems (esp. on ia64) link data and code symbols differently,
7489# so use this general approach.
7490lt_cv_sys_global_symbol_to_cdecl="sed -n"\
7491$lt_cdecl_hook\
7492" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
7493" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
7494
7495# Transform an extracted symbol line into symbol name and symbol address
7496lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
7497$lt_c_name_hook\
7498" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
7499" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
7500
7501# Transform an extracted symbol line into symbol name with lib prefix and
7502# symbol address.
7503lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
7504$lt_c_name_lib_hook\
7505" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
7506" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
7507" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
7508
7509# Handle CRLF in mingw tool chain
7510opt_cr=
7511case $build_os in
7512mingw*)
7513  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
7514  ;;
7515esac
7516
7517# Try without a prefix underscore, then with it.
7518for ac_symprfx in "" "_"; do
7519
7520  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
7521  symxfrm="\\1 $ac_symprfx\\2 \\2"
7522
7523  # Write the raw and C identifiers.
7524  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
7525    # Fake it for dumpbin and say T for any non-static function,
7526    # D for any global variable and I for any imported variable.
7527    # Also find C++ and __fastcall symbols from MSVC++,
7528    # which start with @ or ?.
7529    lt_cv_sys_global_symbol_pipe="$AWK ['"\
7530"     {last_section=section; section=\$ 3};"\
7531"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
7532"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
7533"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
7534"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
7535"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
7536"     \$ 0!~/External *\|/{next};"\
7537"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
7538"     {if(hide[section]) next};"\
7539"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
7540"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
7541"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
7542"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
7543"     ' prfx=^$ac_symprfx]"
7544  else
7545    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
7546  fi
7547  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
7548
7549  # Check to see that the pipe works correctly.
7550  pipe_works=no
7551
7552  rm -f conftest*
7553  cat > conftest.$ac_ext <<_LT_EOF
7554#ifdef __cplusplus
7555extern "C" {
7556#endif
7557char nm_test_var;
7558void nm_test_func(void);
7559void nm_test_func(void){}
7560#ifdef __cplusplus
7561}
7562#endif
7563int main(){nm_test_var='a';nm_test_func();return(0);}
7564_LT_EOF
7565
7566  if AC_TRY_EVAL(ac_compile); then
7567    # Now try to grab the symbols.
7568    nlist=conftest.nm
7569    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
7570      # Try sorting and uniquifying the output.
7571      if sort "$nlist" | uniq > "$nlist"T; then
7572	mv -f "$nlist"T "$nlist"
7573      else
7574	rm -f "$nlist"T
7575      fi
7576
7577      # Make sure that we snagged all the symbols we need.
7578      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
7579	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
7580	  cat <<_LT_EOF > conftest.$ac_ext
7581/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
7582#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
7583/* DATA imports from DLLs on WIN32 can't be const, because runtime
7584   relocations are performed -- see ld's documentation on pseudo-relocs.  */
7585# define LT@&t@_DLSYM_CONST
7586#elif defined __osf__
7587/* This system does not cope well with relocations in const data.  */
7588# define LT@&t@_DLSYM_CONST
7589#else
7590# define LT@&t@_DLSYM_CONST const
7591#endif
7592
7593#ifdef __cplusplus
7594extern "C" {
7595#endif
7596
7597_LT_EOF
7598	  # Now generate the symbol file.
7599	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
7600
7601	  cat <<_LT_EOF >> conftest.$ac_ext
7602
7603/* The mapping between symbol names and symbols.  */
7604LT@&t@_DLSYM_CONST struct {
7605  const char *name;
7606  void       *address;
7607}
7608lt__PROGRAM__LTX_preloaded_symbols[[]] =
7609{
7610  { "@PROGRAM@", (void *) 0 },
7611_LT_EOF
7612	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
7613	  cat <<\_LT_EOF >> conftest.$ac_ext
7614  {0, (void *) 0}
7615};
7616
7617/* This works around a problem in FreeBSD linker */
7618#ifdef FREEBSD_WORKAROUND
7619static const void *lt_preloaded_setup() {
7620  return lt__PROGRAM__LTX_preloaded_symbols;
7621}
7622#endif
7623
7624#ifdef __cplusplus
7625}
7626#endif
7627_LT_EOF
7628	  # Now try linking the two files.
7629	  mv conftest.$ac_objext conftstm.$ac_objext
7630	  lt_globsym_save_LIBS=$LIBS
7631	  lt_globsym_save_CFLAGS=$CFLAGS
7632	  LIBS=conftstm.$ac_objext
7633	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
7634	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
7635	    pipe_works=yes
7636	  fi
7637	  LIBS=$lt_globsym_save_LIBS
7638	  CFLAGS=$lt_globsym_save_CFLAGS
7639	else
7640	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
7641	fi
7642      else
7643	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
7644      fi
7645    else
7646      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
7647    fi
7648  else
7649    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
7650    cat conftest.$ac_ext >&5
7651  fi
7652  rm -rf conftest* conftst*
7653
7654  # Do not use the global_symbol_pipe unless it works.
7655  if test yes = "$pipe_works"; then
7656    break
7657  else
7658    lt_cv_sys_global_symbol_pipe=
7659  fi
7660done
7661])
7662if test -z "$lt_cv_sys_global_symbol_pipe"; then
7663  lt_cv_sys_global_symbol_to_cdecl=
7664fi
7665if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
7666  AC_MSG_RESULT(failed)
7667else
7668  AC_MSG_RESULT(ok)
7669fi
7670
7671# Response file support.
7672if test "$lt_cv_nm_interface" = "MS dumpbin"; then
7673  nm_file_list_spec='@'
7674elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
7675  nm_file_list_spec='@'
7676fi
7677
7678_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
7679    [Take the output of nm and produce a listing of raw symbols and C names])
7680_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
7681    [Transform the output of nm in a proper C declaration])
7682_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
7683    [Transform the output of nm into a list of symbols to manually relocate])
7684_LT_DECL([global_symbol_to_c_name_address],
7685    [lt_cv_sys_global_symbol_to_c_name_address], [1],
7686    [Transform the output of nm in a C name address pair])
7687_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
7688    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
7689    [Transform the output of nm in a C name address pair when lib prefix is needed])
7690_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
7691    [The name lister interface])
7692_LT_DECL([], [nm_file_list_spec], [1],
7693    [Specify filename containing input files for $NM])
7694]) # _LT_CMD_GLOBAL_SYMBOLS
7695
7696
7697# _LT_COMPILER_PIC([TAGNAME])
7698# ---------------------------
7699m4_defun([_LT_COMPILER_PIC],
7700[m4_require([_LT_TAG_COMPILER])dnl
7701_LT_TAGVAR(lt_prog_compiler_wl, $1)=
7702_LT_TAGVAR(lt_prog_compiler_pic, $1)=
7703_LT_TAGVAR(lt_prog_compiler_static, $1)=
7704
7705m4_if([$1], [CXX], [
7706  # C++ specific cases for pic, static, wl, etc.
7707  if test yes = "$GXX"; then
7708    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7709    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7710
7711    case $host_os in
7712    aix*)
7713      # All AIX code is PIC.
7714      if test ia64 = "$host_cpu"; then
7715	# AIX 5 now supports IA64 processor
7716	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7717      fi
7718      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7719      ;;
7720
7721    amigaos*)
7722      case $host_cpu in
7723      powerpc)
7724            # see comment about AmigaOS4 .so support
7725            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7726        ;;
7727      m68k)
7728            # FIXME: we need at least 68020 code to build shared libraries, but
7729            # adding the '-m68020' flag to GCC prevents building anything better,
7730            # like '-m68040'.
7731            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7732        ;;
7733      esac
7734      ;;
7735
7736    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7737      # PIC is the default for these OSes.
7738      ;;
7739    mingw* | cygwin* | os2* | pw32* | cegcc*)
7740      # This hack is so that the source file can tell whether it is being
7741      # built for inclusion in a dll (and should export symbols for example).
7742      # Although the cygwin gcc ignores -fPIC, still need this for old-style
7743      # (--disable-auto-import) libraries
7744      m4_if([$1], [GCJ], [],
7745	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7746      case $host_os in
7747      os2*)
7748	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7749	;;
7750      esac
7751      ;;
7752    darwin* | rhapsody*)
7753      # PIC is the default on this platform
7754      # Common symbols not allowed in MH_DYLIB files
7755      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7756      ;;
7757    *djgpp*)
7758      # DJGPP does not support shared libraries at all
7759      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7760      ;;
7761    haiku*)
7762      # PIC is the default for Haiku.
7763      # The "-static" flag exists, but is broken.
7764      _LT_TAGVAR(lt_prog_compiler_static, $1)=
7765      ;;
7766    interix[[3-9]]*)
7767      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7768      # Instead, we relocate shared libraries at runtime.
7769      ;;
7770    sysv4*MP*)
7771      if test -d /usr/nec; then
7772	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7773      fi
7774      ;;
7775    hpux*)
7776      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7777      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
7778      # sets the default TLS model and affects inlining.
7779      case $host_cpu in
7780      hppa*64*)
7781	;;
7782      *)
7783	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7784	;;
7785      esac
7786      ;;
7787    *qnx* | *nto*)
7788      # QNX uses GNU C++, but need to define -shared option too, otherwise
7789      # it will coredump.
7790      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7791      ;;
7792    *)
7793      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7794      ;;
7795    esac
7796  else
7797    case $host_os in
7798      aix[[4-9]]*)
7799	# All AIX code is PIC.
7800	if test ia64 = "$host_cpu"; then
7801	  # AIX 5 now supports IA64 processor
7802	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7803	else
7804	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7805	fi
7806	;;
7807      chorus*)
7808	case $cc_basename in
7809	cxch68*)
7810	  # Green Hills C++ Compiler
7811	  # _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"
7812	  ;;
7813	esac
7814	;;
7815      mingw* | cygwin* | os2* | pw32* | cegcc*)
7816	# This hack is so that the source file can tell whether it is being
7817	# built for inclusion in a dll (and should export symbols for example).
7818	m4_if([$1], [GCJ], [],
7819	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7820	;;
7821      dgux*)
7822	case $cc_basename in
7823	  ec++*)
7824	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7825	    ;;
7826	  ghcx*)
7827	    # Green Hills C++ Compiler
7828	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7829	    ;;
7830	  *)
7831	    ;;
7832	esac
7833	;;
7834      freebsd* | dragonfly*)
7835	# FreeBSD uses GNU C++
7836	;;
7837      hpux9* | hpux10* | hpux11*)
7838	case $cc_basename in
7839	  CC*)
7840	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7841	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7842	    if test ia64 != "$host_cpu"; then
7843	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7844	    fi
7845	    ;;
7846	  aCC*)
7847	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7848	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7849	    case $host_cpu in
7850	    hppa*64*|ia64*)
7851	      # +Z the default
7852	      ;;
7853	    *)
7854	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7855	      ;;
7856	    esac
7857	    ;;
7858	  *)
7859	    ;;
7860	esac
7861	;;
7862      interix*)
7863	# This is c89, which is MS Visual C++ (no shared libs)
7864	# Anyone wants to do a port?
7865	;;
7866      irix5* | irix6* | nonstopux*)
7867	case $cc_basename in
7868	  CC*)
7869	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7870	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7871	    # CC pic flag -KPIC is the default.
7872	    ;;
7873	  *)
7874	    ;;
7875	esac
7876	;;
7877      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7878	case $cc_basename in
7879	  KCC*)
7880	    # KAI C++ Compiler
7881	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7882	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7883	    ;;
7884	  ecpc* )
7885	    # old Intel C++ for x86_64, which still supported -KPIC.
7886	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7887	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7888	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7889	    ;;
7890	  icpc* )
7891	    # Intel C++, used to be incompatible with GCC.
7892	    # ICC 10 doesn't accept -KPIC any more.
7893	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7894	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7895	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7896	    ;;
7897	  pgCC* | pgcpp*)
7898	    # Portland Group C++ compiler
7899	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7900	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
7901	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7902	    ;;
7903	  cxx*)
7904	    # Compaq C++
7905	    # Make sure the PIC flag is empty.  It appears that all Alpha
7906	    # Linux and Compaq Tru64 Unix objects are PIC.
7907	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7908	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7909	    ;;
7910	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
7911	    # IBM XL 8.0, 9.0 on PPC and BlueGene
7912	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7913	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
7914	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
7915	    ;;
7916	  *)
7917	    case `$CC -V 2>&1 | sed 5q` in
7918	    *Sun\ C*)
7919	      # Sun C++ 5.9
7920	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7921	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7922	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7923	      ;;
7924	    esac
7925	    ;;
7926	esac
7927	;;
7928      lynxos*)
7929	;;
7930      m88k*)
7931	;;
7932      mvs*)
7933	case $cc_basename in
7934	  cxx*)
7935	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
7936	    ;;
7937	  *)
7938	    ;;
7939	esac
7940	;;
7941      netbsd*)
7942	;;
7943      *qnx* | *nto*)
7944        # QNX uses GNU C++, but need to define -shared option too, otherwise
7945        # it will coredump.
7946        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7947        ;;
7948      osf3* | osf4* | osf5*)
7949	case $cc_basename in
7950	  KCC*)
7951	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7952	    ;;
7953	  RCC*)
7954	    # Rational C++ 2.4.1
7955	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7956	    ;;
7957	  cxx*)
7958	    # Digital/Compaq C++
7959	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7960	    # Make sure the PIC flag is empty.  It appears that all Alpha
7961	    # Linux and Compaq Tru64 Unix objects are PIC.
7962	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7963	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7964	    ;;
7965	  *)
7966	    ;;
7967	esac
7968	;;
7969      psos*)
7970	;;
7971      solaris*)
7972	case $cc_basename in
7973	  CC* | sunCC*)
7974	    # Sun C++ 4.2, 5.x and Centerline C++
7975	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7976	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7977	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7978	    ;;
7979	  gcx*)
7980	    # Green Hills C++ Compiler
7981	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7982	    ;;
7983	  *)
7984	    ;;
7985	esac
7986	;;
7987      sunos4*)
7988	case $cc_basename in
7989	  CC*)
7990	    # Sun C++ 4.x
7991	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7992	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7993	    ;;
7994	  lcc*)
7995	    # Lucid
7996	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7997	    ;;
7998	  *)
7999	    ;;
8000	esac
8001	;;
8002      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8003	case $cc_basename in
8004	  CC*)
8005	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8006	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8007	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8008	    ;;
8009	esac
8010	;;
8011      tandem*)
8012	case $cc_basename in
8013	  NCC*)
8014	    # NonStop-UX NCC 3.20
8015	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8016	    ;;
8017	  *)
8018	    ;;
8019	esac
8020	;;
8021      vxworks*)
8022	;;
8023      *)
8024	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8025	;;
8026    esac
8027  fi
8028],
8029[
8030  if test yes = "$GCC"; then
8031    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8032    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8033
8034    case $host_os in
8035      aix*)
8036      # All AIX code is PIC.
8037      if test ia64 = "$host_cpu"; then
8038	# AIX 5 now supports IA64 processor
8039	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8040      fi
8041      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8042      ;;
8043
8044    amigaos*)
8045      case $host_cpu in
8046      powerpc)
8047            # see comment about AmigaOS4 .so support
8048            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8049        ;;
8050      m68k)
8051            # FIXME: we need at least 68020 code to build shared libraries, but
8052            # adding the '-m68020' flag to GCC prevents building anything better,
8053            # like '-m68040'.
8054            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
8055        ;;
8056      esac
8057      ;;
8058
8059    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
8060      # PIC is the default for these OSes.
8061      ;;
8062
8063    mingw* | cygwin* | pw32* | os2* | cegcc*)
8064      # This hack is so that the source file can tell whether it is being
8065      # built for inclusion in a dll (and should export symbols for example).
8066      # Although the cygwin gcc ignores -fPIC, still need this for old-style
8067      # (--disable-auto-import) libraries
8068      m4_if([$1], [GCJ], [],
8069	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8070      case $host_os in
8071      os2*)
8072	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
8073	;;
8074      esac
8075      ;;
8076
8077    darwin* | rhapsody*)
8078      # PIC is the default on this platform
8079      # Common symbols not allowed in MH_DYLIB files
8080      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8081      ;;
8082
8083    haiku*)
8084      # PIC is the default for Haiku.
8085      # The "-static" flag exists, but is broken.
8086      _LT_TAGVAR(lt_prog_compiler_static, $1)=
8087      ;;
8088
8089    hpux*)
8090      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
8091      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
8092      # sets the default TLS model and affects inlining.
8093      case $host_cpu in
8094      hppa*64*)
8095	# +Z the default
8096	;;
8097      *)
8098	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8099	;;
8100      esac
8101      ;;
8102
8103    interix[[3-9]]*)
8104      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8105      # Instead, we relocate shared libraries at runtime.
8106      ;;
8107
8108    msdosdjgpp*)
8109      # Just because we use GCC doesn't mean we suddenly get shared libraries
8110      # on systems that don't support them.
8111      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8112      enable_shared=no
8113      ;;
8114
8115    *nto* | *qnx*)
8116      # QNX uses GNU C++, but need to define -shared option too, otherwise
8117      # it will coredump.
8118      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8119      ;;
8120
8121    sysv4*MP*)
8122      if test -d /usr/nec; then
8123	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
8124      fi
8125      ;;
8126
8127    *)
8128      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8129      ;;
8130    esac
8131
8132    case $cc_basename in
8133    nvcc*) # Cuda Compiler Driver 2.2
8134      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
8135      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8136        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
8137      fi
8138      ;;
8139    esac
8140  else
8141    # PORTME Check for flag to pass linker flags through the system compiler.
8142    case $host_os in
8143    aix*)
8144      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8145      if test ia64 = "$host_cpu"; then
8146	# AIX 5 now supports IA64 processor
8147	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8148      else
8149	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
8150      fi
8151      ;;
8152
8153    darwin* | rhapsody*)
8154      # PIC is the default on this platform
8155      # Common symbols not allowed in MH_DYLIB files
8156      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8157      case $cc_basename in
8158      nagfor*)
8159        # NAG Fortran compiler
8160        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8161        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8162        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8163        ;;
8164      esac
8165      ;;
8166
8167    mingw* | cygwin* | pw32* | os2* | cegcc*)
8168      # This hack is so that the source file can tell whether it is being
8169      # built for inclusion in a dll (and should export symbols for example).
8170      m4_if([$1], [GCJ], [],
8171	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8172      case $host_os in
8173      os2*)
8174	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
8175	;;
8176      esac
8177      ;;
8178
8179    hpux9* | hpux10* | hpux11*)
8180      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8181      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8182      # not for PA HP-UX.
8183      case $host_cpu in
8184      hppa*64*|ia64*)
8185	# +Z the default
8186	;;
8187      *)
8188	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8189	;;
8190      esac
8191      # Is there a better lt_prog_compiler_static that works with the bundled CC?
8192      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
8193      ;;
8194
8195    irix5* | irix6* | nonstopux*)
8196      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8197      # PIC (with -KPIC) is the default.
8198      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8199      ;;
8200
8201    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
8202      case $cc_basename in
8203      # old Intel for x86_64, which still supported -KPIC.
8204      ecc*)
8205	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8206	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8207	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8208        ;;
8209      # icc used to be incompatible with GCC.
8210      # ICC 10 doesn't accept -KPIC any more.
8211      icc* | ifort*)
8212	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8213	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8214	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8215        ;;
8216      # Lahey Fortran 8.1.
8217      lf95*)
8218	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8219	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
8220	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
8221	;;
8222      nagfor*)
8223	# NAG Fortran compiler
8224	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8225	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8226	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8227	;;
8228      tcc*)
8229	# Fabrice Bellard et al's Tiny C Compiler
8230	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8231	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8232	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8233	;;
8234      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
8235        # Portland Group compilers (*not* the Pentium gcc compiler,
8236	# which looks to be a dead project)
8237	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8238	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8239	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8240        ;;
8241      ccc*)
8242        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8243        # All Alpha code is PIC.
8244        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8245        ;;
8246      xl* | bgxl* | bgf* | mpixl*)
8247	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
8248	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8249	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
8250	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
8251	;;
8252      *)
8253	case `$CC -V 2>&1 | sed 5q` in
8254	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
8255	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
8256	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8257	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8258	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
8259	  ;;
8260	*Sun\ F* | *Sun*Fortran*)
8261	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8262	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8263	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8264	  ;;
8265	*Sun\ C*)
8266	  # Sun C 5.9
8267	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8268	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8269	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8270	  ;;
8271        *Intel*\ [[CF]]*Compiler*)
8272	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8273	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8274	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8275	  ;;
8276	*Portland\ Group*)
8277	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8278	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8279	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8280	  ;;
8281	esac
8282	;;
8283      esac
8284      ;;
8285
8286    newsos6)
8287      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8288      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8289      ;;
8290
8291    *nto* | *qnx*)
8292      # QNX uses GNU C++, but need to define -shared option too, otherwise
8293      # it will coredump.
8294      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8295      ;;
8296
8297    osf3* | osf4* | osf5*)
8298      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8299      # All OSF/1 code is PIC.
8300      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8301      ;;
8302
8303    rdos*)
8304      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8305      ;;
8306
8307    solaris*)
8308      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8309      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8310      case $cc_basename in
8311      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
8312	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
8313      *)
8314	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
8315      esac
8316      ;;
8317
8318    sunos4*)
8319      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8320      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8321      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8322      ;;
8323
8324    sysv4 | sysv4.2uw2* | sysv4.3*)
8325      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8326      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8327      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8328      ;;
8329
8330    sysv4*MP*)
8331      if test -d /usr/nec; then
8332	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
8333	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8334      fi
8335      ;;
8336
8337    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8338      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8339      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8340      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8341      ;;
8342
8343    unicos*)
8344      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8345      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8346      ;;
8347
8348    uts4*)
8349      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8350      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8351      ;;
8352
8353    *)
8354      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8355      ;;
8356    esac
8357  fi
8358])
8359case $host_os in
8360  # For platforms that do not support PIC, -DPIC is meaningless:
8361  *djgpp*)
8362    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
8363    ;;
8364  *)
8365    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
8366    ;;
8367esac
8368
8369AC_CACHE_CHECK([for $compiler option to produce PIC],
8370  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
8371  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
8372_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
8373
8374#
8375# Check to make sure the PIC flag actually works.
8376#
8377if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8378  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
8379    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
8380    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
8381    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
8382     "" | " "*) ;;
8383     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
8384     esac],
8385    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
8386     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
8387fi
8388_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
8389	[Additional compiler flags for building library objects])
8390
8391_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
8392	[How to pass a linker flag through the compiler])
8393#
8394# Check to make sure the static flag actually works.
8395#
8396wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
8397_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
8398  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
8399  $lt_tmp_static_flag,
8400  [],
8401  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
8402_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
8403	[Compiler flag to prevent dynamic linking])
8404])# _LT_COMPILER_PIC
8405
8406
8407# _LT_LINKER_SHLIBS([TAGNAME])
8408# ----------------------------
8409# See if the linker supports building shared libraries.
8410m4_defun([_LT_LINKER_SHLIBS],
8411[AC_REQUIRE([LT_PATH_LD])dnl
8412AC_REQUIRE([LT_PATH_NM])dnl
8413m4_require([_LT_PATH_MANIFEST_TOOL])dnl
8414m4_require([_LT_FILEUTILS_DEFAULTS])dnl
8415m4_require([_LT_DECL_EGREP])dnl
8416m4_require([_LT_DECL_SED])dnl
8417m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
8418m4_require([_LT_TAG_COMPILER])dnl
8419AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
8420m4_if([$1], [CXX], [
8421  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8422  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8423  case $host_os in
8424  aix[[4-9]]*)
8425    # If we're using GNU nm, then we don't want the "-C" option.
8426    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
8427    # Without the "-l" option, or with the "-B" option, AIX nm treats
8428    # weak defined symbols like other global defined symbols, whereas
8429    # GNU nm marks them as "W".
8430    # While the 'weak' keyword is ignored in the Export File, we need
8431    # it in the Import File for the 'aix-soname' feature, so we have
8432    # to replace the "-B" option with "-P" for AIX nm.
8433    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8434      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
8435    else
8436      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
8437    fi
8438    ;;
8439  pw32*)
8440    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
8441    ;;
8442  cygwin* | mingw* | cegcc*)
8443    case $cc_basename in
8444    cl*)
8445      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
8446      ;;
8447    *)
8448      _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'
8449      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
8450      ;;
8451    esac
8452    ;;
8453  *)
8454    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8455    ;;
8456  esac
8457], [
8458  runpath_var=
8459  _LT_TAGVAR(allow_undefined_flag, $1)=
8460  _LT_TAGVAR(always_export_symbols, $1)=no
8461  _LT_TAGVAR(archive_cmds, $1)=
8462  _LT_TAGVAR(archive_expsym_cmds, $1)=
8463  _LT_TAGVAR(compiler_needs_object, $1)=no
8464  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8465  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8466  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8467  _LT_TAGVAR(hardcode_automatic, $1)=no
8468  _LT_TAGVAR(hardcode_direct, $1)=no
8469  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8470  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8471  _LT_TAGVAR(hardcode_libdir_separator, $1)=
8472  _LT_TAGVAR(hardcode_minus_L, $1)=no
8473  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8474  _LT_TAGVAR(inherit_rpath, $1)=no
8475  _LT_TAGVAR(link_all_deplibs, $1)=unknown
8476  _LT_TAGVAR(module_cmds, $1)=
8477  _LT_TAGVAR(module_expsym_cmds, $1)=
8478  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
8479  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
8480  _LT_TAGVAR(thread_safe_flag_spec, $1)=
8481  _LT_TAGVAR(whole_archive_flag_spec, $1)=
8482  # include_expsyms should be a list of space-separated symbols to be *always*
8483  # included in the symbol list
8484  _LT_TAGVAR(include_expsyms, $1)=
8485  # exclude_expsyms can be an extended regexp of symbols to exclude
8486  # it will be wrapped by ' (' and ')$', so one must not match beginning or
8487  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
8488  # as well as any symbol that contains 'd'.
8489  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8490  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8491  # platforms (ab)use it in PIC code, but their linkers get confused if
8492  # the symbol is explicitly referenced.  Since portable code cannot
8493  # rely on this symbol name, it's probably fine to never include it in
8494  # preloaded symbol tables.
8495  # Exclude shared library initialization/finalization symbols.
8496dnl Note also adjust exclude_expsyms for C++ above.
8497  extract_expsyms_cmds=
8498
8499  case $host_os in
8500  cygwin* | mingw* | pw32* | cegcc*)
8501    # FIXME: the MSVC++ port hasn't been tested in a loooong time
8502    # When not using gcc, we currently assume that we are using
8503    # Microsoft Visual C++.
8504    if test yes != "$GCC"; then
8505      with_gnu_ld=no
8506    fi
8507    ;;
8508  interix*)
8509    # we just hope/assume this is gcc and not c89 (= MSVC++)
8510    with_gnu_ld=yes
8511    ;;
8512  openbsd* | bitrig*)
8513    with_gnu_ld=no
8514    ;;
8515  esac
8516
8517  _LT_TAGVAR(ld_shlibs, $1)=yes
8518
8519  # On some targets, GNU ld is compatible enough with the native linker
8520  # that we're better off using the native interface for both.
8521  lt_use_gnu_ld_interface=no
8522  if test yes = "$with_gnu_ld"; then
8523    case $host_os in
8524      aix*)
8525	# The AIX port of GNU ld has always aspired to compatibility
8526	# with the native linker.  However, as the warning in the GNU ld
8527	# block says, versions before 2.19.5* couldn't really create working
8528	# shared libraries, regardless of the interface used.
8529	case `$LD -v 2>&1` in
8530	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
8531	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
8532	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
8533	  *)
8534	    lt_use_gnu_ld_interface=yes
8535	    ;;
8536	esac
8537	;;
8538      *)
8539	lt_use_gnu_ld_interface=yes
8540	;;
8541    esac
8542  fi
8543
8544  if test yes = "$lt_use_gnu_ld_interface"; then
8545    # If archive_cmds runs LD, not CC, wlarc should be empty
8546    wlarc='$wl'
8547
8548    # Set some defaults for GNU ld with shared library support. These
8549    # are reset later if shared libraries are not supported. Putting them
8550    # here allows them to be overridden if necessary.
8551    runpath_var=LD_RUN_PATH
8552    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8553    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
8554    # ancient GNU ld didn't support --whole-archive et. al.
8555    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8556      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
8557    else
8558      _LT_TAGVAR(whole_archive_flag_spec, $1)=
8559    fi
8560    supports_anon_versioning=no
8561    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
8562      *GNU\ gold*) supports_anon_versioning=yes ;;
8563      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
8564      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8565      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8566      *\ 2.11.*) ;; # other 2.11 versions
8567      *) supports_anon_versioning=yes ;;
8568    esac
8569
8570    # See if GNU ld supports shared libraries.
8571    case $host_os in
8572    aix[[3-9]]*)
8573      # On AIX/PPC, the GNU linker is very broken
8574      if test ia64 != "$host_cpu"; then
8575	_LT_TAGVAR(ld_shlibs, $1)=no
8576	cat <<_LT_EOF 1>&2
8577
8578*** Warning: the GNU linker, at least up to release 2.19, is reported
8579*** to be unable to reliably create shared libraries on AIX.
8580*** Therefore, libtool is disabling shared libraries support.  If you
8581*** really care for shared libraries, you may want to install binutils
8582*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
8583*** You will then need to restart the configuration process.
8584
8585_LT_EOF
8586      fi
8587      ;;
8588
8589    amigaos*)
8590      case $host_cpu in
8591      powerpc)
8592            # see comment about AmigaOS4 .so support
8593            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8594            _LT_TAGVAR(archive_expsym_cmds, $1)=''
8595        ;;
8596      m68k)
8597            _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)'
8598            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8599            _LT_TAGVAR(hardcode_minus_L, $1)=yes
8600        ;;
8601      esac
8602      ;;
8603
8604    beos*)
8605      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8606	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8607	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8608	# support --undefined.  This deserves some investigation.  FIXME
8609	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8610      else
8611	_LT_TAGVAR(ld_shlibs, $1)=no
8612      fi
8613      ;;
8614
8615    cygwin* | mingw* | pw32* | cegcc*)
8616      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
8617      # as there is no search path for DLLs.
8618      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8619      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
8620      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8621      _LT_TAGVAR(always_export_symbols, $1)=no
8622      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8623      _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'
8624      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
8625
8626      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8627        _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'
8628	# If the export-symbols file already is a .def file, use it as
8629	# is; otherwise, prepend EXPORTS...
8630	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
8631          cp $export_symbols $output_objdir/$soname.def;
8632        else
8633          echo EXPORTS > $output_objdir/$soname.def;
8634          cat $export_symbols >> $output_objdir/$soname.def;
8635        fi~
8636        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8637      else
8638	_LT_TAGVAR(ld_shlibs, $1)=no
8639      fi
8640      ;;
8641
8642    haiku*)
8643      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8644      _LT_TAGVAR(link_all_deplibs, $1)=yes
8645      ;;
8646
8647    os2*)
8648      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8649      _LT_TAGVAR(hardcode_minus_L, $1)=yes
8650      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8651      shrext_cmds=.dll
8652      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8653	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8654	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8655	$ECHO EXPORTS >> $output_objdir/$libname.def~
8656	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
8657	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8658	emximp -o $lib $output_objdir/$libname.def'
8659      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8660	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8661	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8662	$ECHO EXPORTS >> $output_objdir/$libname.def~
8663	prefix_cmds="$SED"~
8664	if test EXPORTS = "`$SED 1q $export_symbols`"; then
8665	  prefix_cmds="$prefix_cmds -e 1d";
8666	fi~
8667	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
8668	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
8669	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8670	emximp -o $lib $output_objdir/$libname.def'
8671      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
8672      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8673      ;;
8674
8675    interix[[3-9]]*)
8676      _LT_TAGVAR(hardcode_direct, $1)=no
8677      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8678      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
8679      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
8680      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8681      # Instead, shared libraries are loaded at an image base (0x10000000 by
8682      # default) and relocated if they conflict, which is a slow very memory
8683      # consuming and fragmenting process.  To avoid this, we pick a random,
8684      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8685      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
8686      _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'
8687      _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'
8688      ;;
8689
8690    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
8691      tmp_diet=no
8692      if test linux-dietlibc = "$host_os"; then
8693	case $cc_basename in
8694	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
8695	esac
8696      fi
8697      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8698	 && test no = "$tmp_diet"
8699      then
8700	tmp_addflag=' $pic_flag'
8701	tmp_sharedflag='-shared'
8702	case $cc_basename,$host_cpu in
8703        pgcc*)				# Portland Group C compiler
8704	  _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'
8705	  tmp_addflag=' $pic_flag'
8706	  ;;
8707	pgf77* | pgf90* | pgf95* | pgfortran*)
8708					# Portland Group f77 and f90 compilers
8709	  _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'
8710	  tmp_addflag=' $pic_flag -Mnomain' ;;
8711	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
8712	  tmp_addflag=' -i_dynamic' ;;
8713	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
8714	  tmp_addflag=' -i_dynamic -nofor_main' ;;
8715	ifc* | ifort*)			# Intel Fortran compiler
8716	  tmp_addflag=' -nofor_main' ;;
8717	lf95*)				# Lahey Fortran 8.1
8718	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
8719	  tmp_sharedflag='--shared' ;;
8720        nagfor*)                        # NAGFOR 5.3
8721          tmp_sharedflag='-Wl,-shared' ;;
8722	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8723	  tmp_sharedflag='-qmkshrobj'
8724	  tmp_addflag= ;;
8725	nvcc*)	# Cuda Compiler Driver 2.2
8726	  _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'
8727	  _LT_TAGVAR(compiler_needs_object, $1)=yes
8728	  ;;
8729	esac
8730	case `$CC -V 2>&1 | sed 5q` in
8731	*Sun\ C*)			# Sun C 5.9
8732	  _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'
8733	  _LT_TAGVAR(compiler_needs_object, $1)=yes
8734	  tmp_sharedflag='-G' ;;
8735	*Sun\ F*)			# Sun Fortran 8.3
8736	  tmp_sharedflag='-G' ;;
8737	esac
8738	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8739
8740        if test yes = "$supports_anon_versioning"; then
8741          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8742            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8743            echo "local: *; };" >> $output_objdir/$libname.ver~
8744            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
8745        fi
8746
8747	case $cc_basename in
8748	tcc*)
8749	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
8750	  ;;
8751	xlf* | bgf* | bgxlf* | mpixlf*)
8752	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8753	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
8754	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8755	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
8756	  if test yes = "$supports_anon_versioning"; then
8757	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8758              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8759              echo "local: *; };" >> $output_objdir/$libname.ver~
8760              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8761	  fi
8762	  ;;
8763	esac
8764      else
8765        _LT_TAGVAR(ld_shlibs, $1)=no
8766      fi
8767      ;;
8768
8769    netbsd*)
8770      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8771	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8772	wlarc=
8773      else
8774	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8775	_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'
8776      fi
8777      ;;
8778
8779    solaris*)
8780      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8781	_LT_TAGVAR(ld_shlibs, $1)=no
8782	cat <<_LT_EOF 1>&2
8783
8784*** Warning: The releases 2.8.* of the GNU linker cannot reliably
8785*** create shared libraries on Solaris systems.  Therefore, libtool
8786*** is disabling shared libraries support.  We urge you to upgrade GNU
8787*** binutils to release 2.9.1 or newer.  Another option is to modify
8788*** your PATH or compiler configuration so that the native linker is
8789*** used, and then restart.
8790
8791_LT_EOF
8792      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8793	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8794	_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'
8795      else
8796	_LT_TAGVAR(ld_shlibs, $1)=no
8797      fi
8798      ;;
8799
8800    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8801      case `$LD -v 2>&1` in
8802        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
8803	_LT_TAGVAR(ld_shlibs, $1)=no
8804	cat <<_LT_EOF 1>&2
8805
8806*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
8807*** reliably create shared libraries on SCO systems.  Therefore, libtool
8808*** is disabling shared libraries support.  We urge you to upgrade GNU
8809*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
8810*** your PATH or compiler configuration so that the native linker is
8811*** used, and then restart.
8812
8813_LT_EOF
8814	;;
8815	*)
8816	  # For security reasons, it is highly recommended that you always
8817	  # use absolute paths for naming shared libraries, and exclude the
8818	  # DT_RUNPATH tag from executables and libraries.  But doing so
8819	  # requires that you compile everything twice, which is a pain.
8820	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8821	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8822	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8823	    _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'
8824	  else
8825	    _LT_TAGVAR(ld_shlibs, $1)=no
8826	  fi
8827	;;
8828      esac
8829      ;;
8830
8831    sunos4*)
8832      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8833      wlarc=
8834      _LT_TAGVAR(hardcode_direct, $1)=yes
8835      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8836      ;;
8837
8838    *)
8839      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8840	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8841	_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'
8842      else
8843	_LT_TAGVAR(ld_shlibs, $1)=no
8844      fi
8845      ;;
8846    esac
8847
8848    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
8849      runpath_var=
8850      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8851      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8852      _LT_TAGVAR(whole_archive_flag_spec, $1)=
8853    fi
8854  else
8855    # PORTME fill in a description of your system's linker (not GNU ld)
8856    case $host_os in
8857    aix3*)
8858      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8859      _LT_TAGVAR(always_export_symbols, $1)=yes
8860      _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'
8861      # Note: this linker hardcodes the directories in LIBPATH if there
8862      # are no directories specified by -L.
8863      _LT_TAGVAR(hardcode_minus_L, $1)=yes
8864      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
8865	# Neither direct hardcoding nor static linking is supported with a
8866	# broken collect2.
8867	_LT_TAGVAR(hardcode_direct, $1)=unsupported
8868      fi
8869      ;;
8870
8871    aix[[4-9]]*)
8872      if test ia64 = "$host_cpu"; then
8873	# On IA64, the linker does run time linking by default, so we don't
8874	# have to do anything special.
8875	aix_use_runtimelinking=no
8876	exp_sym_flag='-Bexport'
8877	no_entry_flag=
8878      else
8879	# If we're using GNU nm, then we don't want the "-C" option.
8880	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
8881	# Without the "-l" option, or with the "-B" option, AIX nm treats
8882	# weak defined symbols like other global defined symbols, whereas
8883	# GNU nm marks them as "W".
8884	# While the 'weak' keyword is ignored in the Export File, we need
8885	# it in the Import File for the 'aix-soname' feature, so we have
8886	# to replace the "-B" option with "-P" for AIX nm.
8887	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8888	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
8889	else
8890	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
8891	fi
8892	aix_use_runtimelinking=no
8893
8894	# Test if we are trying to use run time linking or normal
8895	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
8896	# have runtime linking enabled, and use it for executables.
8897	# For shared libraries, we enable/disable runtime linking
8898	# depending on the kind of the shared library created -
8899	# when "with_aix_soname,aix_use_runtimelinking" is:
8900	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
8901	# "aix,yes"  lib.so          shared, rtl:yes, for executables
8902	#            lib.a           static archive
8903	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
8904	#            lib.a(lib.so.V) shared, rtl:no,  for executables
8905	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
8906	#            lib.a(lib.so.V) shared, rtl:no
8907	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
8908	#            lib.a           static archive
8909	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
8910	  for ld_flag in $LDFLAGS; do
8911	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
8912	    aix_use_runtimelinking=yes
8913	    break
8914	  fi
8915	  done
8916	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
8917	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
8918	    # so we don't have lib.a shared libs to link our executables.
8919	    # We have to force runtime linking in this case.
8920	    aix_use_runtimelinking=yes
8921	    LDFLAGS="$LDFLAGS -Wl,-brtl"
8922	  fi
8923	  ;;
8924	esac
8925
8926	exp_sym_flag='-bexport'
8927	no_entry_flag='-bnoentry'
8928      fi
8929
8930      # When large executables or shared objects are built, AIX ld can
8931      # have problems creating the table of contents.  If linking a library
8932      # or program results in "error TOC overflow" add -mminimal-toc to
8933      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8934      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8935
8936      _LT_TAGVAR(archive_cmds, $1)=''
8937      _LT_TAGVAR(hardcode_direct, $1)=yes
8938      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8939      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
8940      _LT_TAGVAR(link_all_deplibs, $1)=yes
8941      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
8942      case $with_aix_soname,$aix_use_runtimelinking in
8943      aix,*) ;; # traditional, no import file
8944      svr4,* | *,yes) # use import file
8945	# The Import File defines what to hardcode.
8946	_LT_TAGVAR(hardcode_direct, $1)=no
8947	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8948	;;
8949      esac
8950
8951      if test yes = "$GCC"; then
8952	case $host_os in aix4.[[012]]|aix4.[[012]].*)
8953	# We only want to do this on AIX 4.2 and lower, the check
8954	# below for broken collect2 doesn't work under 4.3+
8955	  collect2name=`$CC -print-prog-name=collect2`
8956	  if test -f "$collect2name" &&
8957	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8958	  then
8959	  # We have reworked collect2
8960	  :
8961	  else
8962	  # We have old collect2
8963	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
8964	  # It fails to find uninstalled libraries when the uninstalled
8965	  # path is not listed in the libpath.  Setting hardcode_minus_L
8966	  # to unsupported forces relinking
8967	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
8968	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8969	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
8970	  fi
8971	  ;;
8972	esac
8973	shared_flag='-shared'
8974	if test yes = "$aix_use_runtimelinking"; then
8975	  shared_flag="$shared_flag "'$wl-G'
8976	fi
8977	# Need to ensure runtime linking is disabled for the traditional
8978	# shared library, or the linker may eventually find shared libraries
8979	# /with/ Import File - we do not want to mix them.
8980	shared_flag_aix='-shared'
8981	shared_flag_svr4='-shared $wl-G'
8982      else
8983	# not using gcc
8984	if test ia64 = "$host_cpu"; then
8985	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8986	# chokes on -Wl,-G. The following line is correct:
8987	  shared_flag='-G'
8988	else
8989	  if test yes = "$aix_use_runtimelinking"; then
8990	    shared_flag='$wl-G'
8991	  else
8992	    shared_flag='$wl-bM:SRE'
8993	  fi
8994	  shared_flag_aix='$wl-bM:SRE'
8995	  shared_flag_svr4='$wl-G'
8996	fi
8997      fi
8998
8999      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
9000      # It seems that -bexpall does not export symbols beginning with
9001      # underscore (_), so it is better to generate a list of symbols to export.
9002      _LT_TAGVAR(always_export_symbols, $1)=yes
9003      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
9004	# Warning - without using the other runtime loading flags (-brtl),
9005	# -berok will link without error, but may produce a broken library.
9006	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
9007        # Determine the default libpath from the value encoded in an
9008        # empty executable.
9009        _LT_SYS_MODULE_PATH_AIX([$1])
9010        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9011        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
9012      else
9013	if test ia64 = "$host_cpu"; then
9014	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
9015	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
9016	  _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"
9017	else
9018	 # Determine the default libpath from the value encoded in an
9019	 # empty executable.
9020	 _LT_SYS_MODULE_PATH_AIX([$1])
9021	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9022	  # Warning - without using the other run time loading flags,
9023	  # -berok will link without error, but may produce a broken library.
9024	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
9025	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
9026	  if test yes = "$with_gnu_ld"; then
9027	    # We only use this code for GNU lds that support --whole-archive.
9028	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
9029	  else
9030	    # Exported symbols can be pulled into shared objects from archives
9031	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
9032	  fi
9033	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9034	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
9035	  # -brtl affects multiple linker settings, -berok does not and is overridden later
9036	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
9037	  if test svr4 != "$with_aix_soname"; then
9038	    # This is similar to how AIX traditionally builds its shared libraries.
9039	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
9040	  fi
9041	  if test aix != "$with_aix_soname"; then
9042	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
9043	  else
9044	    # used by -dlpreopen to get the symbols
9045	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
9046	  fi
9047	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
9048	fi
9049      fi
9050      ;;
9051
9052    amigaos*)
9053      case $host_cpu in
9054      powerpc)
9055            # see comment about AmigaOS4 .so support
9056            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9057            _LT_TAGVAR(archive_expsym_cmds, $1)=''
9058        ;;
9059      m68k)
9060            _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)'
9061            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9062            _LT_TAGVAR(hardcode_minus_L, $1)=yes
9063        ;;
9064      esac
9065      ;;
9066
9067    bsdi[[45]]*)
9068      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
9069      ;;
9070
9071    cygwin* | mingw* | pw32* | cegcc*)
9072      # When not using gcc, we currently assume that we are using
9073      # Microsoft Visual C++.
9074      # hardcode_libdir_flag_spec is actually meaningless, as there is
9075      # no search path for DLLs.
9076      case $cc_basename in
9077      cl*)
9078	# Native MSVC
9079	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9080	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9081	_LT_TAGVAR(always_export_symbols, $1)=yes
9082	_LT_TAGVAR(file_list_spec, $1)='@'
9083	# Tell ltmain to make .lib files, not .a files.
9084	libext=lib
9085	# Tell ltmain to make .dll files, not .so files.
9086	shrext_cmds=.dll
9087	# FIXME: Setting linknames here is a bad hack.
9088	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
9089	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
9090            cp "$export_symbols" "$output_objdir/$soname.def";
9091            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
9092          else
9093            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
9094          fi~
9095          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9096          linknames='
9097	# The linker will not automatically build a static lib if we build a DLL.
9098	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9099	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9100	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
9101	_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'
9102	# Don't use ranlib
9103	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
9104	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
9105          lt_tool_outputfile="@TOOL_OUTPUT@"~
9106          case $lt_outputfile in
9107            *.exe|*.EXE) ;;
9108            *)
9109              lt_outputfile=$lt_outputfile.exe
9110              lt_tool_outputfile=$lt_tool_outputfile.exe
9111              ;;
9112          esac~
9113          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
9114            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9115            $RM "$lt_outputfile.manifest";
9116          fi'
9117	;;
9118      *)
9119	# Assume MSVC wrapper
9120	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9121	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9122	# Tell ltmain to make .lib files, not .a files.
9123	libext=lib
9124	# Tell ltmain to make .dll files, not .so files.
9125	shrext_cmds=.dll
9126	# FIXME: Setting linknames here is a bad hack.
9127	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
9128	# The linker will automatically build a .lib file if we build a DLL.
9129	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9130	# FIXME: Should let the user specify the lib program.
9131	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
9132	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9133	;;
9134      esac
9135      ;;
9136
9137    darwin* | rhapsody*)
9138      _LT_DARWIN_LINKER_FEATURES($1)
9139      ;;
9140
9141    dgux*)
9142      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9143      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9144      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9145      ;;
9146
9147    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
9148    # support.  Future versions do this automatically, but an explicit c++rt0.o
9149    # does not break anything, and helps significantly (at the cost of a little
9150    # extra space).
9151    freebsd2.2*)
9152      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
9153      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9154      _LT_TAGVAR(hardcode_direct, $1)=yes
9155      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9156      ;;
9157
9158    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9159    freebsd2.*)
9160      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9161      _LT_TAGVAR(hardcode_direct, $1)=yes
9162      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9163      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9164      ;;
9165
9166    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9167    freebsd* | dragonfly*)
9168      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9169      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9170      _LT_TAGVAR(hardcode_direct, $1)=yes
9171      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9172      ;;
9173
9174    hpux9*)
9175      if test yes = "$GCC"; then
9176	_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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9177      else
9178	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9179      fi
9180      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9181      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9182      _LT_TAGVAR(hardcode_direct, $1)=yes
9183
9184      # hardcode_minus_L: Not really in the search PATH,
9185      # but as the default location of the library.
9186      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9187      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9188      ;;
9189
9190    hpux10*)
9191      if test yes,no = "$GCC,$with_gnu_ld"; then
9192	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9193      else
9194	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9195      fi
9196      if test no = "$with_gnu_ld"; then
9197	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9198	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9199	_LT_TAGVAR(hardcode_direct, $1)=yes
9200	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9201	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9202	# hardcode_minus_L: Not really in the search PATH,
9203	# but as the default location of the library.
9204	_LT_TAGVAR(hardcode_minus_L, $1)=yes
9205      fi
9206      ;;
9207
9208    hpux11*)
9209      if test yes,no = "$GCC,$with_gnu_ld"; then
9210	case $host_cpu in
9211	hppa*64*)
9212	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9213	  ;;
9214	ia64*)
9215	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9216	  ;;
9217	*)
9218	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9219	  ;;
9220	esac
9221      else
9222	case $host_cpu in
9223	hppa*64*)
9224	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9225	  ;;
9226	ia64*)
9227	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9228	  ;;
9229	*)
9230	m4_if($1, [], [
9231	  # Older versions of the 11.00 compiler do not understand -b yet
9232	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
9233	  _LT_LINKER_OPTION([if $CC understands -b],
9234	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
9235	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
9236	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
9237	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
9238	  ;;
9239	esac
9240      fi
9241      if test no = "$with_gnu_ld"; then
9242	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9243	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9244
9245	case $host_cpu in
9246	hppa*64*|ia64*)
9247	  _LT_TAGVAR(hardcode_direct, $1)=no
9248	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9249	  ;;
9250	*)
9251	  _LT_TAGVAR(hardcode_direct, $1)=yes
9252	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9253	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9254
9255	  # hardcode_minus_L: Not really in the search PATH,
9256	  # but as the default location of the library.
9257	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
9258	  ;;
9259	esac
9260      fi
9261      ;;
9262
9263    irix5* | irix6* | nonstopux*)
9264      if test yes = "$GCC"; then
9265	_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'
9266	# Try to use the -exported_symbol ld option, if it does not
9267	# work, assume that -exports_file does not work either and
9268	# implicitly export all symbols.
9269	# This should be the same for all languages, so no per-tag cache variable.
9270	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
9271	  [lt_cv_irix_exported_symbol],
9272	  [save_LDFLAGS=$LDFLAGS
9273	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
9274	   AC_LINK_IFELSE(
9275	     [AC_LANG_SOURCE(
9276	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
9277			      [C++], [[int foo (void) { return 0; }]],
9278			      [Fortran 77], [[
9279      subroutine foo
9280      end]],
9281			      [Fortran], [[
9282      subroutine foo
9283      end]])])],
9284	      [lt_cv_irix_exported_symbol=yes],
9285	      [lt_cv_irix_exported_symbol=no])
9286           LDFLAGS=$save_LDFLAGS])
9287	if test yes = "$lt_cv_irix_exported_symbol"; then
9288          _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'
9289	fi
9290      else
9291	_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'
9292	_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'
9293      fi
9294      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9295      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9296      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9297      _LT_TAGVAR(inherit_rpath, $1)=yes
9298      _LT_TAGVAR(link_all_deplibs, $1)=yes
9299      ;;
9300
9301    linux*)
9302      case $cc_basename in
9303      tcc*)
9304	# Fabrice Bellard et al's Tiny C Compiler
9305	_LT_TAGVAR(ld_shlibs, $1)=yes
9306	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9307	;;
9308      esac
9309      ;;
9310
9311    netbsd*)
9312      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9313	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
9314      else
9315	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
9316      fi
9317      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9318      _LT_TAGVAR(hardcode_direct, $1)=yes
9319      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9320      ;;
9321
9322    newsos6)
9323      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9324      _LT_TAGVAR(hardcode_direct, $1)=yes
9325      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9326      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9327      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9328      ;;
9329
9330    *nto* | *qnx*)
9331      ;;
9332
9333    openbsd* | bitrig*)
9334      if test -f /usr/libexec/ld.so; then
9335	_LT_TAGVAR(hardcode_direct, $1)=yes
9336	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9337	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9338	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
9339	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9340	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
9341	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9342	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9343	else
9344	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9345	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9346	fi
9347      else
9348	_LT_TAGVAR(ld_shlibs, $1)=no
9349      fi
9350      ;;
9351
9352    os2*)
9353      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9354      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9355      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9356      shrext_cmds=.dll
9357      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9358	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9359	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9360	$ECHO EXPORTS >> $output_objdir/$libname.def~
9361	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9362	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9363	emximp -o $lib $output_objdir/$libname.def'
9364      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9365	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9366	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9367	$ECHO EXPORTS >> $output_objdir/$libname.def~
9368	prefix_cmds="$SED"~
9369	if test EXPORTS = "`$SED 1q $export_symbols`"; then
9370	  prefix_cmds="$prefix_cmds -e 1d";
9371	fi~
9372	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9373	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9374	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9375	emximp -o $lib $output_objdir/$libname.def'
9376      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9377      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9378      ;;
9379
9380    osf3*)
9381      if test yes = "$GCC"; then
9382	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9383	_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'
9384      else
9385	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9386	_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'
9387      fi
9388      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9389      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9390      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9391      ;;
9392
9393    osf4* | osf5*)	# as osf3* with the addition of -msym flag
9394      if test yes = "$GCC"; then
9395	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9396	_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'
9397	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9398      else
9399	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9400	_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'
9401	_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~
9402          $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'
9403
9404	# Both c and cxx compiler support -rpath directly
9405	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9406      fi
9407      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9408      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9409      ;;
9410
9411    solaris*)
9412      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
9413      if test yes = "$GCC"; then
9414	wlarc='$wl'
9415	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9416	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9417          $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'
9418      else
9419	case `$CC -V 2>&1` in
9420	*"Compilers 5.0"*)
9421	  wlarc=''
9422	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
9423	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9424            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
9425	  ;;
9426	*)
9427	  wlarc='$wl'
9428	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
9429	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9430            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9431	  ;;
9432	esac
9433      fi
9434      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9435      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9436      case $host_os in
9437      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
9438      *)
9439	# The compiler driver will combine and reorder linker options,
9440	# but understands '-z linker_flag'.  GCC discards it without '$wl',
9441	# but is careful enough not to reorder.
9442	# Supported since Solaris 2.6 (maybe 2.5.1?)
9443	if test yes = "$GCC"; then
9444	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
9445	else
9446	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
9447	fi
9448	;;
9449      esac
9450      _LT_TAGVAR(link_all_deplibs, $1)=yes
9451      ;;
9452
9453    sunos4*)
9454      if test sequent = "$host_vendor"; then
9455	# Use $CC to link under sequent, because it throws in some extra .o
9456	# files that make .init and .fini sections work.
9457	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
9458      else
9459	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
9460      fi
9461      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9462      _LT_TAGVAR(hardcode_direct, $1)=yes
9463      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9464      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9465      ;;
9466
9467    sysv4)
9468      case $host_vendor in
9469	sni)
9470	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9471	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
9472	;;
9473	siemens)
9474	  ## LD is ld it makes a PLAMLIB
9475	  ## CC just makes a GrossModule.
9476	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
9477	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
9478	  _LT_TAGVAR(hardcode_direct, $1)=no
9479        ;;
9480	motorola)
9481	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9482	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
9483	;;
9484      esac
9485      runpath_var='LD_RUN_PATH'
9486      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9487      ;;
9488
9489    sysv4.3*)
9490      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9491      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9492      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
9493      ;;
9494
9495    sysv4*MP*)
9496      if test -d /usr/nec; then
9497	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9498	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9499	runpath_var=LD_RUN_PATH
9500	hardcode_runpath_var=yes
9501	_LT_TAGVAR(ld_shlibs, $1)=yes
9502      fi
9503      ;;
9504
9505    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
9506      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
9507      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9508      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9509      runpath_var='LD_RUN_PATH'
9510
9511      if test yes = "$GCC"; then
9512	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9513	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9514      else
9515	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9516	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9517      fi
9518      ;;
9519
9520    sysv5* | sco3.2v5* | sco5v6*)
9521      # Note: We CANNOT use -z defs as we might desire, because we do not
9522      # link with -lc, and that would cause any symbols used from libc to
9523      # always be unresolved, which means just about no library would
9524      # ever link correctly.  If we're not using GNU ld we use -z text
9525      # though, which does catch some bad symbols but isn't as heavy-handed
9526      # as -z defs.
9527      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
9528      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
9529      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9530      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9531      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
9532      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9533      _LT_TAGVAR(link_all_deplibs, $1)=yes
9534      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
9535      runpath_var='LD_RUN_PATH'
9536
9537      if test yes = "$GCC"; then
9538	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9539	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9540      else
9541	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9542	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9543      fi
9544      ;;
9545
9546    uts4*)
9547      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9548      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9549      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9550      ;;
9551
9552    *)
9553      _LT_TAGVAR(ld_shlibs, $1)=no
9554      ;;
9555    esac
9556
9557    if test sni = "$host_vendor"; then
9558      case $host in
9559      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9560	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
9561	;;
9562      esac
9563    fi
9564  fi
9565])
9566AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
9567test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
9568
9569_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
9570
9571_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
9572_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
9573_LT_DECL([], [extract_expsyms_cmds], [2],
9574    [The commands to extract the exported symbol list from a shared archive])
9575
9576#
9577# Do we need to explicitly link libc?
9578#
9579case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
9580x|xyes)
9581  # Assume -lc should be added
9582  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9583
9584  if test yes,yes = "$GCC,$enable_shared"; then
9585    case $_LT_TAGVAR(archive_cmds, $1) in
9586    *'~'*)
9587      # FIXME: we may have to deal with multi-command sequences.
9588      ;;
9589    '$CC '*)
9590      # Test whether the compiler implicitly links with -lc since on some
9591      # systems, -lgcc has to come before -lc. If gcc already passes -lc
9592      # to ld, don't add -lc before -lgcc.
9593      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
9594	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
9595	[$RM conftest*
9596	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9597
9598	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
9599	  soname=conftest
9600	  lib=conftest
9601	  libobjs=conftest.$ac_objext
9602	  deplibs=
9603	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
9604	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
9605	  compiler_flags=-v
9606	  linker_flags=-v
9607	  verstring=
9608	  output_objdir=.
9609	  libname=conftest
9610	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
9611	  _LT_TAGVAR(allow_undefined_flag, $1)=
9612	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
9613	  then
9614	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9615	  else
9616	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9617	  fi
9618	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
9619	else
9620	  cat conftest.err 1>&5
9621	fi
9622	$RM conftest*
9623	])
9624      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
9625      ;;
9626    esac
9627  fi
9628  ;;
9629esac
9630
9631_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
9632    [Whether or not to add -lc for building shared libraries])
9633_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
9634    [enable_shared_with_static_runtimes], [0],
9635    [Whether or not to disallow shared libs when runtime libs are static])
9636_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
9637    [Compiler flag to allow reflexive dlopens])
9638_LT_TAGDECL([], [whole_archive_flag_spec], [1],
9639    [Compiler flag to generate shared objects directly from archives])
9640_LT_TAGDECL([], [compiler_needs_object], [1],
9641    [Whether the compiler copes with passing no objects directly])
9642_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
9643    [Create an old-style archive from a shared archive])
9644_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
9645    [Create a temporary old-style archive to link instead of a shared archive])
9646_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
9647_LT_TAGDECL([], [archive_expsym_cmds], [2])
9648_LT_TAGDECL([], [module_cmds], [2],
9649    [Commands used to build a loadable module if different from building
9650    a shared archive.])
9651_LT_TAGDECL([], [module_expsym_cmds], [2])
9652_LT_TAGDECL([], [with_gnu_ld], [1],
9653    [Whether we are building with GNU ld or not])
9654_LT_TAGDECL([], [allow_undefined_flag], [1],
9655    [Flag that allows shared libraries with undefined symbols to be built])
9656_LT_TAGDECL([], [no_undefined_flag], [1],
9657    [Flag that enforces no undefined symbols])
9658_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
9659    [Flag to hardcode $libdir into a binary during linking.
9660    This must work even if $libdir does not exist])
9661_LT_TAGDECL([], [hardcode_libdir_separator], [1],
9662    [Whether we need a single "-rpath" flag with a separated argument])
9663_LT_TAGDECL([], [hardcode_direct], [0],
9664    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
9665    DIR into the resulting binary])
9666_LT_TAGDECL([], [hardcode_direct_absolute], [0],
9667    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
9668    DIR into the resulting binary and the resulting library dependency is
9669    "absolute", i.e impossible to change by setting $shlibpath_var if the
9670    library is relocated])
9671_LT_TAGDECL([], [hardcode_minus_L], [0],
9672    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
9673    into the resulting binary])
9674_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
9675    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
9676    into the resulting binary])
9677_LT_TAGDECL([], [hardcode_automatic], [0],
9678    [Set to "yes" if building a shared library automatically hardcodes DIR
9679    into the library and all subsequent libraries and executables linked
9680    against it])
9681_LT_TAGDECL([], [inherit_rpath], [0],
9682    [Set to yes if linker adds runtime paths of dependent libraries
9683    to runtime path list])
9684_LT_TAGDECL([], [link_all_deplibs], [0],
9685    [Whether libtool must link a program against all its dependency libraries])
9686_LT_TAGDECL([], [always_export_symbols], [0],
9687    [Set to "yes" if exported symbols are required])
9688_LT_TAGDECL([], [export_symbols_cmds], [2],
9689    [The commands to list exported symbols])
9690_LT_TAGDECL([], [exclude_expsyms], [1],
9691    [Symbols that should not be listed in the preloaded symbols])
9692_LT_TAGDECL([], [include_expsyms], [1],
9693    [Symbols that must always be exported])
9694_LT_TAGDECL([], [prelink_cmds], [2],
9695    [Commands necessary for linking programs (against libraries) with templates])
9696_LT_TAGDECL([], [postlink_cmds], [2],
9697    [Commands necessary for finishing linking programs])
9698_LT_TAGDECL([], [file_list_spec], [1],
9699    [Specify filename containing input files])
9700dnl FIXME: Not yet implemented
9701dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
9702dnl    [Compiler flag to generate thread safe objects])
9703])# _LT_LINKER_SHLIBS
9704
9705
9706# _LT_LANG_C_CONFIG([TAG])
9707# ------------------------
9708# Ensure that the configuration variables for a C compiler are suitably
9709# defined.  These variables are subsequently used by _LT_CONFIG to write
9710# the compiler configuration to 'libtool'.
9711m4_defun([_LT_LANG_C_CONFIG],
9712[m4_require([_LT_DECL_EGREP])dnl
9713lt_save_CC=$CC
9714AC_LANG_PUSH(C)
9715
9716# Source file extension for C test sources.
9717ac_ext=c
9718
9719# Object file extension for compiled C test sources.
9720objext=o
9721_LT_TAGVAR(objext, $1)=$objext
9722
9723# Code to be used in simple compile tests
9724lt_simple_compile_test_code="int some_variable = 0;"
9725
9726# Code to be used in simple link tests
9727lt_simple_link_test_code='int main(){return(0);}'
9728
9729_LT_TAG_COMPILER
9730# Save the default compiler, since it gets overwritten when the other
9731# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
9732compiler_DEFAULT=$CC
9733
9734# save warnings/boilerplate of simple test code
9735_LT_COMPILER_BOILERPLATE
9736_LT_LINKER_BOILERPLATE
9737
9738if test -n "$compiler"; then
9739  _LT_COMPILER_NO_RTTI($1)
9740  _LT_COMPILER_PIC($1)
9741  _LT_COMPILER_C_O($1)
9742  _LT_COMPILER_FILE_LOCKS($1)
9743  _LT_LINKER_SHLIBS($1)
9744  _LT_SYS_DYNAMIC_LINKER($1)
9745  _LT_LINKER_HARDCODE_LIBPATH($1)
9746  LT_SYS_DLOPEN_SELF
9747  _LT_CMD_STRIPLIB
9748
9749  # Report what library types will actually be built
9750  AC_MSG_CHECKING([if libtool supports shared libraries])
9751  AC_MSG_RESULT([$can_build_shared])
9752
9753  AC_MSG_CHECKING([whether to build shared libraries])
9754  test no = "$can_build_shared" && enable_shared=no
9755
9756  # On AIX, shared libraries and static libraries use the same namespace, and
9757  # are all built from PIC.
9758  case $host_os in
9759  aix3*)
9760    test yes = "$enable_shared" && enable_static=no
9761    if test -n "$RANLIB"; then
9762      archive_cmds="$archive_cmds~\$RANLIB \$lib"
9763      postinstall_cmds='$RANLIB $lib'
9764    fi
9765    ;;
9766
9767  aix[[4-9]]*)
9768    if test ia64 != "$host_cpu"; then
9769      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
9770      yes,aix,yes) ;;			# shared object as lib.so file only
9771      yes,svr4,*) ;;			# shared object as lib.so archive member only
9772      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
9773      esac
9774    fi
9775    ;;
9776  esac
9777  AC_MSG_RESULT([$enable_shared])
9778
9779  AC_MSG_CHECKING([whether to build static libraries])
9780  # Make sure either enable_shared or enable_static is yes.
9781  test yes = "$enable_shared" || enable_static=yes
9782  AC_MSG_RESULT([$enable_static])
9783
9784  _LT_CONFIG($1)
9785fi
9786AC_LANG_POP
9787CC=$lt_save_CC
9788])# _LT_LANG_C_CONFIG
9789
9790
9791# _LT_LANG_CXX_CONFIG([TAG])
9792# --------------------------
9793# Ensure that the configuration variables for a C++ compiler are suitably
9794# defined.  These variables are subsequently used by _LT_CONFIG to write
9795# the compiler configuration to 'libtool'.
9796m4_defun([_LT_LANG_CXX_CONFIG],
9797[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
9798m4_require([_LT_DECL_EGREP])dnl
9799m4_require([_LT_PATH_MANIFEST_TOOL])dnl
9800if test -n "$CXX" && ( test no != "$CXX" &&
9801    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
9802    (test g++ != "$CXX"))); then
9803  AC_PROG_CXXCPP
9804else
9805  _lt_caught_CXX_error=yes
9806fi
9807
9808AC_LANG_PUSH(C++)
9809_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9810_LT_TAGVAR(allow_undefined_flag, $1)=
9811_LT_TAGVAR(always_export_symbols, $1)=no
9812_LT_TAGVAR(archive_expsym_cmds, $1)=
9813_LT_TAGVAR(compiler_needs_object, $1)=no
9814_LT_TAGVAR(export_dynamic_flag_spec, $1)=
9815_LT_TAGVAR(hardcode_direct, $1)=no
9816_LT_TAGVAR(hardcode_direct_absolute, $1)=no
9817_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9818_LT_TAGVAR(hardcode_libdir_separator, $1)=
9819_LT_TAGVAR(hardcode_minus_L, $1)=no
9820_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9821_LT_TAGVAR(hardcode_automatic, $1)=no
9822_LT_TAGVAR(inherit_rpath, $1)=no
9823_LT_TAGVAR(module_cmds, $1)=
9824_LT_TAGVAR(module_expsym_cmds, $1)=
9825_LT_TAGVAR(link_all_deplibs, $1)=unknown
9826_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9827_LT_TAGVAR(reload_flag, $1)=$reload_flag
9828_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
9829_LT_TAGVAR(no_undefined_flag, $1)=
9830_LT_TAGVAR(whole_archive_flag_spec, $1)=
9831_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9832
9833# Source file extension for C++ test sources.
9834ac_ext=cpp
9835
9836# Object file extension for compiled C++ test sources.
9837objext=o
9838_LT_TAGVAR(objext, $1)=$objext
9839
9840# No sense in running all these tests if we already determined that
9841# the CXX compiler isn't working.  Some variables (like enable_shared)
9842# are currently assumed to apply to all compilers on this platform,
9843# and will be corrupted by setting them based on a non-working compiler.
9844if test yes != "$_lt_caught_CXX_error"; then
9845  # Code to be used in simple compile tests
9846  lt_simple_compile_test_code="int some_variable = 0;"
9847
9848  # Code to be used in simple link tests
9849  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
9850
9851  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9852  _LT_TAG_COMPILER
9853
9854  # save warnings/boilerplate of simple test code
9855  _LT_COMPILER_BOILERPLATE
9856  _LT_LINKER_BOILERPLATE
9857
9858  # Allow CC to be a program name with arguments.
9859  lt_save_CC=$CC
9860  lt_save_CFLAGS=$CFLAGS
9861  lt_save_LD=$LD
9862  lt_save_GCC=$GCC
9863  GCC=$GXX
9864  lt_save_with_gnu_ld=$with_gnu_ld
9865  lt_save_path_LD=$lt_cv_path_LD
9866  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
9867    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
9868  else
9869    $as_unset lt_cv_prog_gnu_ld
9870  fi
9871  if test -n "${lt_cv_path_LDCXX+set}"; then
9872    lt_cv_path_LD=$lt_cv_path_LDCXX
9873  else
9874    $as_unset lt_cv_path_LD
9875  fi
9876  test -z "${LDCXX+set}" || LD=$LDCXX
9877  CC=${CXX-"c++"}
9878  CFLAGS=$CXXFLAGS
9879  compiler=$CC
9880  _LT_TAGVAR(compiler, $1)=$CC
9881  _LT_CC_BASENAME([$compiler])
9882
9883  if test -n "$compiler"; then
9884    # We don't want -fno-exception when compiling C++ code, so set the
9885    # no_builtin_flag separately
9886    if test yes = "$GXX"; then
9887      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
9888    else
9889      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
9890    fi
9891
9892    if test yes = "$GXX"; then
9893      # Set up default GNU C++ configuration
9894
9895      LT_PATH_LD
9896
9897      # Check if GNU C++ uses GNU ld as the underlying linker, since the
9898      # archiving commands below assume that GNU ld is being used.
9899      if test yes = "$with_gnu_ld"; then
9900        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9901        _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'
9902
9903        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9904        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9905
9906        # If archive_cmds runs LD, not CC, wlarc should be empty
9907        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
9908        #     investigate it a little bit more. (MM)
9909        wlarc='$wl'
9910
9911        # ancient GNU ld didn't support --whole-archive et. al.
9912        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
9913	  $GREP 'no-whole-archive' > /dev/null; then
9914          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
9915        else
9916          _LT_TAGVAR(whole_archive_flag_spec, $1)=
9917        fi
9918      else
9919        with_gnu_ld=no
9920        wlarc=
9921
9922        # A generic and very simple default shared library creation
9923        # command for GNU C++ for the case where it uses the native
9924        # linker, instead of GNU ld.  If possible, this setting should
9925        # overridden to take advantage of the native linker features on
9926        # the platform it is being used on.
9927        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
9928      fi
9929
9930      # Commands to make compiler produce verbose output that lists
9931      # what "hidden" libraries, object files and flags are used when
9932      # linking a shared library.
9933      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
9934
9935    else
9936      GXX=no
9937      with_gnu_ld=no
9938      wlarc=
9939    fi
9940
9941    # PORTME: fill in a description of your system's C++ link characteristics
9942    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9943    _LT_TAGVAR(ld_shlibs, $1)=yes
9944    case $host_os in
9945      aix3*)
9946        # FIXME: insert proper C++ library support
9947        _LT_TAGVAR(ld_shlibs, $1)=no
9948        ;;
9949      aix[[4-9]]*)
9950        if test ia64 = "$host_cpu"; then
9951          # On IA64, the linker does run time linking by default, so we don't
9952          # have to do anything special.
9953          aix_use_runtimelinking=no
9954          exp_sym_flag='-Bexport'
9955          no_entry_flag=
9956        else
9957          aix_use_runtimelinking=no
9958
9959          # Test if we are trying to use run time linking or normal
9960          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
9961          # have runtime linking enabled, and use it for executables.
9962          # For shared libraries, we enable/disable runtime linking
9963          # depending on the kind of the shared library created -
9964          # when "with_aix_soname,aix_use_runtimelinking" is:
9965          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
9966          # "aix,yes"  lib.so          shared, rtl:yes, for executables
9967          #            lib.a           static archive
9968          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
9969          #            lib.a(lib.so.V) shared, rtl:no,  for executables
9970          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
9971          #            lib.a(lib.so.V) shared, rtl:no
9972          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
9973          #            lib.a           static archive
9974          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
9975	    for ld_flag in $LDFLAGS; do
9976	      case $ld_flag in
9977	      *-brtl*)
9978	        aix_use_runtimelinking=yes
9979	        break
9980	        ;;
9981	      esac
9982	    done
9983	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
9984	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
9985	      # so we don't have lib.a shared libs to link our executables.
9986	      # We have to force runtime linking in this case.
9987	      aix_use_runtimelinking=yes
9988	      LDFLAGS="$LDFLAGS -Wl,-brtl"
9989	    fi
9990	    ;;
9991          esac
9992
9993          exp_sym_flag='-bexport'
9994          no_entry_flag='-bnoentry'
9995        fi
9996
9997        # When large executables or shared objects are built, AIX ld can
9998        # have problems creating the table of contents.  If linking a library
9999        # or program results in "error TOC overflow" add -mminimal-toc to
10000        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
10001        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
10002
10003        _LT_TAGVAR(archive_cmds, $1)=''
10004        _LT_TAGVAR(hardcode_direct, $1)=yes
10005        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10006        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10007        _LT_TAGVAR(link_all_deplibs, $1)=yes
10008        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
10009        case $with_aix_soname,$aix_use_runtimelinking in
10010        aix,*) ;;	# no import file
10011        svr4,* | *,yes) # use import file
10012          # The Import File defines what to hardcode.
10013          _LT_TAGVAR(hardcode_direct, $1)=no
10014          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
10015          ;;
10016        esac
10017
10018        if test yes = "$GXX"; then
10019          case $host_os in aix4.[[012]]|aix4.[[012]].*)
10020          # We only want to do this on AIX 4.2 and lower, the check
10021          # below for broken collect2 doesn't work under 4.3+
10022	  collect2name=`$CC -print-prog-name=collect2`
10023	  if test -f "$collect2name" &&
10024	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
10025	  then
10026	    # We have reworked collect2
10027	    :
10028	  else
10029	    # We have old collect2
10030	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
10031	    # It fails to find uninstalled libraries when the uninstalled
10032	    # path is not listed in the libpath.  Setting hardcode_minus_L
10033	    # to unsupported forces relinking
10034	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
10035	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10036	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
10037	  fi
10038          esac
10039          shared_flag='-shared'
10040	  if test yes = "$aix_use_runtimelinking"; then
10041	    shared_flag=$shared_flag' $wl-G'
10042	  fi
10043	  # Need to ensure runtime linking is disabled for the traditional
10044	  # shared library, or the linker may eventually find shared libraries
10045	  # /with/ Import File - we do not want to mix them.
10046	  shared_flag_aix='-shared'
10047	  shared_flag_svr4='-shared $wl-G'
10048        else
10049          # not using gcc
10050          if test ia64 = "$host_cpu"; then
10051	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
10052	  # chokes on -Wl,-G. The following line is correct:
10053	  shared_flag='-G'
10054          else
10055	    if test yes = "$aix_use_runtimelinking"; then
10056	      shared_flag='$wl-G'
10057	    else
10058	      shared_flag='$wl-bM:SRE'
10059	    fi
10060	    shared_flag_aix='$wl-bM:SRE'
10061	    shared_flag_svr4='$wl-G'
10062          fi
10063        fi
10064
10065        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
10066        # It seems that -bexpall does not export symbols beginning with
10067        # underscore (_), so it is better to generate a list of symbols to
10068	# export.
10069        _LT_TAGVAR(always_export_symbols, $1)=yes
10070	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
10071          # Warning - without using the other runtime loading flags (-brtl),
10072          # -berok will link without error, but may produce a broken library.
10073          # The "-G" linker flag allows undefined symbols.
10074          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
10075          # Determine the default libpath from the value encoded in an empty
10076          # executable.
10077          _LT_SYS_MODULE_PATH_AIX([$1])
10078          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
10079
10080          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
10081        else
10082          if test ia64 = "$host_cpu"; then
10083	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
10084	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
10085	    _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"
10086          else
10087	    # Determine the default libpath from the value encoded in an
10088	    # empty executable.
10089	    _LT_SYS_MODULE_PATH_AIX([$1])
10090	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
10091	    # Warning - without using the other run time loading flags,
10092	    # -berok will link without error, but may produce a broken library.
10093	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
10094	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
10095	    if test yes = "$with_gnu_ld"; then
10096	      # We only use this code for GNU lds that support --whole-archive.
10097	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
10098	    else
10099	      # Exported symbols can be pulled into shared objects from archives
10100	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
10101	    fi
10102	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10103	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
10104	    # -brtl affects multiple linker settings, -berok does not and is overridden later
10105	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
10106	    if test svr4 != "$with_aix_soname"; then
10107	      # This is similar to how AIX traditionally builds its shared
10108	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
10109	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
10110	    fi
10111	    if test aix != "$with_aix_soname"; then
10112	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
10113	    else
10114	      # used by -dlpreopen to get the symbols
10115	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
10116	    fi
10117	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
10118          fi
10119        fi
10120        ;;
10121
10122      beos*)
10123	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10124	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10125	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
10126	  # support --undefined.  This deserves some investigation.  FIXME
10127	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10128	else
10129	  _LT_TAGVAR(ld_shlibs, $1)=no
10130	fi
10131	;;
10132
10133      chorus*)
10134        case $cc_basename in
10135          *)
10136	  # FIXME: insert proper C++ library support
10137	  _LT_TAGVAR(ld_shlibs, $1)=no
10138	  ;;
10139        esac
10140        ;;
10141
10142      cygwin* | mingw* | pw32* | cegcc*)
10143	case $GXX,$cc_basename in
10144	,cl* | no,cl*)
10145	  # Native MSVC
10146	  # hardcode_libdir_flag_spec is actually meaningless, as there is
10147	  # no search path for DLLs.
10148	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
10149	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10150	  _LT_TAGVAR(always_export_symbols, $1)=yes
10151	  _LT_TAGVAR(file_list_spec, $1)='@'
10152	  # Tell ltmain to make .lib files, not .a files.
10153	  libext=lib
10154	  # Tell ltmain to make .dll files, not .so files.
10155	  shrext_cmds=.dll
10156	  # FIXME: Setting linknames here is a bad hack.
10157	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
10158	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10159              cp "$export_symbols" "$output_objdir/$soname.def";
10160              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
10161            else
10162              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
10163            fi~
10164            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
10165            linknames='
10166	  # The linker will not automatically build a static lib if we build a DLL.
10167	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
10168	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10169	  # Don't use ranlib
10170	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
10171	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
10172            lt_tool_outputfile="@TOOL_OUTPUT@"~
10173            case $lt_outputfile in
10174              *.exe|*.EXE) ;;
10175              *)
10176                lt_outputfile=$lt_outputfile.exe
10177                lt_tool_outputfile=$lt_tool_outputfile.exe
10178                ;;
10179            esac~
10180            func_to_tool_file "$lt_outputfile"~
10181            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
10182              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
10183              $RM "$lt_outputfile.manifest";
10184            fi'
10185	  ;;
10186	*)
10187	  # g++
10188	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
10189	  # as there is no search path for DLLs.
10190	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10191	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
10192	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10193	  _LT_TAGVAR(always_export_symbols, $1)=no
10194	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10195
10196	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
10197	    _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'
10198	    # If the export-symbols file already is a .def file, use it as
10199	    # is; otherwise, prepend EXPORTS...
10200	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10201              cp $export_symbols $output_objdir/$soname.def;
10202            else
10203              echo EXPORTS > $output_objdir/$soname.def;
10204              cat $export_symbols >> $output_objdir/$soname.def;
10205            fi~
10206            $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'
10207	  else
10208	    _LT_TAGVAR(ld_shlibs, $1)=no
10209	  fi
10210	  ;;
10211	esac
10212	;;
10213      darwin* | rhapsody*)
10214        _LT_DARWIN_LINKER_FEATURES($1)
10215	;;
10216
10217      os2*)
10218	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10219	_LT_TAGVAR(hardcode_minus_L, $1)=yes
10220	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10221	shrext_cmds=.dll
10222	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10223	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10224	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10225	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10226	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
10227	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10228	  emximp -o $lib $output_objdir/$libname.def'
10229	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10230	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10231	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10232	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10233	  prefix_cmds="$SED"~
10234	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
10235	    prefix_cmds="$prefix_cmds -e 1d";
10236	  fi~
10237	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
10238	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
10239	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10240	  emximp -o $lib $output_objdir/$libname.def'
10241	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
10242	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10243	;;
10244
10245      dgux*)
10246        case $cc_basename in
10247          ec++*)
10248	    # FIXME: insert proper C++ library support
10249	    _LT_TAGVAR(ld_shlibs, $1)=no
10250	    ;;
10251          ghcx*)
10252	    # Green Hills C++ Compiler
10253	    # FIXME: insert proper C++ library support
10254	    _LT_TAGVAR(ld_shlibs, $1)=no
10255	    ;;
10256          *)
10257	    # FIXME: insert proper C++ library support
10258	    _LT_TAGVAR(ld_shlibs, $1)=no
10259	    ;;
10260        esac
10261        ;;
10262
10263      freebsd2.*)
10264        # C++ shared libraries reported to be fairly broken before
10265	# switch to ELF
10266        _LT_TAGVAR(ld_shlibs, $1)=no
10267        ;;
10268
10269      freebsd-elf*)
10270        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10271        ;;
10272
10273      freebsd* | dragonfly*)
10274        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
10275        # conventions
10276        _LT_TAGVAR(ld_shlibs, $1)=yes
10277        ;;
10278
10279      haiku*)
10280        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10281        _LT_TAGVAR(link_all_deplibs, $1)=yes
10282        ;;
10283
10284      hpux9*)
10285        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10286        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10287        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10288        _LT_TAGVAR(hardcode_direct, $1)=yes
10289        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10290				             # but as the default
10291				             # location of the library.
10292
10293        case $cc_basename in
10294          CC*)
10295            # FIXME: insert proper C++ library support
10296            _LT_TAGVAR(ld_shlibs, $1)=no
10297            ;;
10298          aCC*)
10299            _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
10300            # Commands to make compiler produce verbose output that lists
10301            # what "hidden" libraries, object files and flags are used when
10302            # linking a shared library.
10303            #
10304            # There doesn't appear to be a way to prevent this compiler from
10305            # explicitly linking system object files so we need to strip them
10306            # from the output so that they don't get included in the library
10307            # dependencies.
10308            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"'
10309            ;;
10310          *)
10311            if test yes = "$GXX"; then
10312              _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
10313            else
10314              # FIXME: insert proper C++ library support
10315              _LT_TAGVAR(ld_shlibs, $1)=no
10316            fi
10317            ;;
10318        esac
10319        ;;
10320
10321      hpux10*|hpux11*)
10322        if test no = "$with_gnu_ld"; then
10323	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10324	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10325
10326          case $host_cpu in
10327            hppa*64*|ia64*)
10328              ;;
10329            *)
10330	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10331              ;;
10332          esac
10333        fi
10334        case $host_cpu in
10335          hppa*64*|ia64*)
10336            _LT_TAGVAR(hardcode_direct, $1)=no
10337            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10338            ;;
10339          *)
10340            _LT_TAGVAR(hardcode_direct, $1)=yes
10341            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10342            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10343					         # but as the default
10344					         # location of the library.
10345            ;;
10346        esac
10347
10348        case $cc_basename in
10349          CC*)
10350	    # FIXME: insert proper C++ library support
10351	    _LT_TAGVAR(ld_shlibs, $1)=no
10352	    ;;
10353          aCC*)
10354	    case $host_cpu in
10355	      hppa*64*)
10356	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10357	        ;;
10358	      ia64*)
10359	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10360	        ;;
10361	      *)
10362	        _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'
10363	        ;;
10364	    esac
10365	    # Commands to make compiler produce verbose output that lists
10366	    # what "hidden" libraries, object files and flags are used when
10367	    # linking a shared library.
10368	    #
10369	    # There doesn't appear to be a way to prevent this compiler from
10370	    # explicitly linking system object files so we need to strip them
10371	    # from the output so that they don't get included in the library
10372	    # dependencies.
10373	    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"'
10374	    ;;
10375          *)
10376	    if test yes = "$GXX"; then
10377	      if test no = "$with_gnu_ld"; then
10378	        case $host_cpu in
10379	          hppa*64*)
10380	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10381	            ;;
10382	          ia64*)
10383	            _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'
10384	            ;;
10385	          *)
10386	            _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'
10387	            ;;
10388	        esac
10389	      fi
10390	    else
10391	      # FIXME: insert proper C++ library support
10392	      _LT_TAGVAR(ld_shlibs, $1)=no
10393	    fi
10394	    ;;
10395        esac
10396        ;;
10397
10398      interix[[3-9]]*)
10399	_LT_TAGVAR(hardcode_direct, $1)=no
10400	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10401	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10402	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10403	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
10404	# Instead, shared libraries are loaded at an image base (0x10000000 by
10405	# default) and relocated if they conflict, which is a slow very memory
10406	# consuming and fragmenting process.  To avoid this, we pick a random,
10407	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
10408	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
10409	_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'
10410	_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'
10411	;;
10412      irix5* | irix6*)
10413        case $cc_basename in
10414          CC*)
10415	    # SGI C++
10416	    _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'
10417
10418	    # Archives containing C++ object files must be created using
10419	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
10420	    # necessary to make sure instantiated templates are included
10421	    # in the archive.
10422	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
10423	    ;;
10424          *)
10425	    if test yes = "$GXX"; then
10426	      if test no = "$with_gnu_ld"; then
10427	        _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'
10428	      else
10429	        _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'
10430	      fi
10431	    fi
10432	    _LT_TAGVAR(link_all_deplibs, $1)=yes
10433	    ;;
10434        esac
10435        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10436        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10437        _LT_TAGVAR(inherit_rpath, $1)=yes
10438        ;;
10439
10440      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
10441        case $cc_basename in
10442          KCC*)
10443	    # Kuck and Associates, Inc. (KAI) C++ Compiler
10444
10445	    # KCC will only create a shared library if the output file
10446	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
10447	    # to its proper name (with version) after linking.
10448	    _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'
10449	    _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'
10450	    # Commands to make compiler produce verbose output that lists
10451	    # what "hidden" libraries, object files and flags are used when
10452	    # linking a shared library.
10453	    #
10454	    # There doesn't appear to be a way to prevent this compiler from
10455	    # explicitly linking system object files so we need to strip them
10456	    # from the output so that they don't get included in the library
10457	    # dependencies.
10458	    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"'
10459
10460	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10461	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10462
10463	    # Archives containing C++ object files must be created using
10464	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
10465	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
10466	    ;;
10467	  icpc* | ecpc* )
10468	    # Intel C++
10469	    with_gnu_ld=yes
10470	    # version 8.0 and above of icpc choke on multiply defined symbols
10471	    # if we add $predep_objects and $postdep_objects, however 7.1 and
10472	    # earlier do not add the objects themselves.
10473	    case `$CC -V 2>&1` in
10474	      *"Version 7."*)
10475	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10476		_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'
10477		;;
10478	      *)  # Version 8.0 or newer
10479	        tmp_idyn=
10480	        case $host_cpu in
10481		  ia64*) tmp_idyn=' -i_dynamic';;
10482		esac
10483	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10484		_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'
10485		;;
10486	    esac
10487	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10488	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10489	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10490	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
10491	    ;;
10492          pgCC* | pgcpp*)
10493            # Portland Group C++ compiler
10494	    case `$CC -V` in
10495	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
10496	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
10497               rm -rf $tpldir~
10498               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
10499               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
10500	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
10501                rm -rf $tpldir~
10502                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
10503                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
10504                $RANLIB $oldlib'
10505	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
10506                rm -rf $tpldir~
10507                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
10508                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10509	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
10510                rm -rf $tpldir~
10511                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
10512                $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'
10513	      ;;
10514	    *) # Version 6 and above use weak symbols
10515	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10516	      _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'
10517	      ;;
10518	    esac
10519
10520	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
10521	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10522	    _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'
10523            ;;
10524	  cxx*)
10525	    # Compaq C++
10526	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10527	    _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'
10528
10529	    runpath_var=LD_RUN_PATH
10530	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10531	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10532
10533	    # Commands to make compiler produce verbose output that lists
10534	    # what "hidden" libraries, object files and flags are used when
10535	    # linking a shared library.
10536	    #
10537	    # There doesn't appear to be a way to prevent this compiler from
10538	    # explicitly linking system object files so we need to strip them
10539	    # from the output so that they don't get included in the library
10540	    # dependencies.
10541	    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'
10542	    ;;
10543	  xl* | mpixl* | bgxl*)
10544	    # IBM XL 8.0 on PPC, with GNU ld
10545	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10546	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10547	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10548	    if test yes = "$supports_anon_versioning"; then
10549	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
10550                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
10551                echo "local: *; };" >> $output_objdir/$libname.ver~
10552                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
10553	    fi
10554	    ;;
10555	  *)
10556	    case `$CC -V 2>&1 | sed 5q` in
10557	    *Sun\ C*)
10558	      # Sun C++ 5.9
10559	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10560	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10561	      _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'
10562	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10563	      _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'
10564	      _LT_TAGVAR(compiler_needs_object, $1)=yes
10565
10566	      # Not sure whether something based on
10567	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
10568	      # would be better.
10569	      output_verbose_link_cmd='func_echo_all'
10570
10571	      # Archives containing C++ object files must be created using
10572	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
10573	      # necessary to make sure instantiated templates are included
10574	      # in the archive.
10575	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10576	      ;;
10577	    esac
10578	    ;;
10579	esac
10580	;;
10581
10582      lynxos*)
10583        # FIXME: insert proper C++ library support
10584	_LT_TAGVAR(ld_shlibs, $1)=no
10585	;;
10586
10587      m88k*)
10588        # FIXME: insert proper C++ library support
10589        _LT_TAGVAR(ld_shlibs, $1)=no
10590	;;
10591
10592      mvs*)
10593        case $cc_basename in
10594          cxx*)
10595	    # FIXME: insert proper C++ library support
10596	    _LT_TAGVAR(ld_shlibs, $1)=no
10597	    ;;
10598	  *)
10599	    # FIXME: insert proper C++ library support
10600	    _LT_TAGVAR(ld_shlibs, $1)=no
10601	    ;;
10602	esac
10603	;;
10604
10605      netbsd*)
10606        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10607	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
10608	  wlarc=
10609	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10610	  _LT_TAGVAR(hardcode_direct, $1)=yes
10611	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10612	fi
10613	# Workaround some broken pre-1.5 toolchains
10614	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
10615	;;
10616
10617      *nto* | *qnx*)
10618        _LT_TAGVAR(ld_shlibs, $1)=yes
10619	;;
10620
10621      openbsd* | bitrig*)
10622	if test -f /usr/libexec/ld.so; then
10623	  _LT_TAGVAR(hardcode_direct, $1)=yes
10624	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10625	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10626	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
10627	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10628	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
10629	    _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'
10630	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10631	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
10632	  fi
10633	  output_verbose_link_cmd=func_echo_all
10634	else
10635	  _LT_TAGVAR(ld_shlibs, $1)=no
10636	fi
10637	;;
10638
10639      osf3* | osf4* | osf5*)
10640        case $cc_basename in
10641          KCC*)
10642	    # Kuck and Associates, Inc. (KAI) C++ Compiler
10643
10644	    # KCC will only create a shared library if the output file
10645	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
10646	    # to its proper name (with version) after linking.
10647	    _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'
10648
10649	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10650	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10651
10652	    # Archives containing C++ object files must be created using
10653	    # the KAI C++ compiler.
10654	    case $host in
10655	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
10656	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
10657	    esac
10658	    ;;
10659          RCC*)
10660	    # Rational C++ 2.4.1
10661	    # FIXME: insert proper C++ library support
10662	    _LT_TAGVAR(ld_shlibs, $1)=no
10663	    ;;
10664          cxx*)
10665	    case $host in
10666	      osf3*)
10667	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10668	        _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'
10669	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10670		;;
10671	      *)
10672	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10673	        _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'
10674	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
10675                  echo "-hidden">> $lib.exp~
10676                  $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~
10677                  $RM $lib.exp'
10678	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10679		;;
10680	    esac
10681
10682	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10683
10684	    # Commands to make compiler produce verbose output that lists
10685	    # what "hidden" libraries, object files and flags are used when
10686	    # linking a shared library.
10687	    #
10688	    # There doesn't appear to be a way to prevent this compiler from
10689	    # explicitly linking system object files so we need to strip them
10690	    # from the output so that they don't get included in the library
10691	    # dependencies.
10692	    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"'
10693	    ;;
10694	  *)
10695	    if test yes,no = "$GXX,$with_gnu_ld"; then
10696	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10697	      case $host in
10698	        osf3*)
10699	          _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'
10700		  ;;
10701	        *)
10702	          _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'
10703		  ;;
10704	      esac
10705
10706	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10707	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10708
10709	      # Commands to make compiler produce verbose output that lists
10710	      # what "hidden" libraries, object files and flags are used when
10711	      # linking a shared library.
10712	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10713
10714	    else
10715	      # FIXME: insert proper C++ library support
10716	      _LT_TAGVAR(ld_shlibs, $1)=no
10717	    fi
10718	    ;;
10719        esac
10720        ;;
10721
10722      psos*)
10723        # FIXME: insert proper C++ library support
10724        _LT_TAGVAR(ld_shlibs, $1)=no
10725        ;;
10726
10727      sunos4*)
10728        case $cc_basename in
10729          CC*)
10730	    # Sun C++ 4.x
10731	    # FIXME: insert proper C++ library support
10732	    _LT_TAGVAR(ld_shlibs, $1)=no
10733	    ;;
10734          lcc*)
10735	    # Lucid
10736	    # FIXME: insert proper C++ library support
10737	    _LT_TAGVAR(ld_shlibs, $1)=no
10738	    ;;
10739          *)
10740	    # FIXME: insert proper C++ library support
10741	    _LT_TAGVAR(ld_shlibs, $1)=no
10742	    ;;
10743        esac
10744        ;;
10745
10746      solaris*)
10747        case $cc_basename in
10748          CC* | sunCC*)
10749	    # Sun C++ 4.2, 5.x and Centerline C++
10750            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
10751	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10752	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10753	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10754              $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'
10755
10756	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10757	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10758	    case $host_os in
10759	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10760	      *)
10761		# The compiler driver will combine and reorder linker options,
10762		# but understands '-z linker_flag'.
10763	        # Supported since Solaris 2.6 (maybe 2.5.1?)
10764		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
10765	        ;;
10766	    esac
10767	    _LT_TAGVAR(link_all_deplibs, $1)=yes
10768
10769	    output_verbose_link_cmd='func_echo_all'
10770
10771	    # Archives containing C++ object files must be created using
10772	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
10773	    # necessary to make sure instantiated templates are included
10774	    # in the archive.
10775	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10776	    ;;
10777          gcx*)
10778	    # Green Hills C++ Compiler
10779	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10780
10781	    # The C++ compiler must be used to create the archive.
10782	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
10783	    ;;
10784          *)
10785	    # GNU C++ compiler with Solaris linker
10786	    if test yes,no = "$GXX,$with_gnu_ld"; then
10787	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
10788	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
10789	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10790	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10791                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
10792
10793	        # Commands to make compiler produce verbose output that lists
10794	        # what "hidden" libraries, object files and flags are used when
10795	        # linking a shared library.
10796	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10797	      else
10798	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
10799	        # platform.
10800	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10801	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10802                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
10803
10804	        # Commands to make compiler produce verbose output that lists
10805	        # what "hidden" libraries, object files and flags are used when
10806	        # linking a shared library.
10807	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10808	      fi
10809
10810	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
10811	      case $host_os in
10812		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10813		*)
10814		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
10815		  ;;
10816	      esac
10817	    fi
10818	    ;;
10819        esac
10820        ;;
10821
10822    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
10823      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10824      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10825      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10826      runpath_var='LD_RUN_PATH'
10827
10828      case $cc_basename in
10829        CC*)
10830	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10831	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10832	  ;;
10833	*)
10834	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10835	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10836	  ;;
10837      esac
10838      ;;
10839
10840      sysv5* | sco3.2v5* | sco5v6*)
10841	# Note: We CANNOT use -z defs as we might desire, because we do not
10842	# link with -lc, and that would cause any symbols used from libc to
10843	# always be unresolved, which means just about no library would
10844	# ever link correctly.  If we're not using GNU ld we use -z text
10845	# though, which does catch some bad symbols but isn't as heavy-handed
10846	# as -z defs.
10847	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10848	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
10849	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
10850	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10851	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
10852	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10853	_LT_TAGVAR(link_all_deplibs, $1)=yes
10854	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
10855	runpath_var='LD_RUN_PATH'
10856
10857	case $cc_basename in
10858          CC*)
10859	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10860	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10861	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
10862              '"$_LT_TAGVAR(old_archive_cmds, $1)"
10863	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
10864              '"$_LT_TAGVAR(reload_cmds, $1)"
10865	    ;;
10866	  *)
10867	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10868	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10869	    ;;
10870	esac
10871      ;;
10872
10873      tandem*)
10874        case $cc_basename in
10875          NCC*)
10876	    # NonStop-UX NCC 3.20
10877	    # FIXME: insert proper C++ library support
10878	    _LT_TAGVAR(ld_shlibs, $1)=no
10879	    ;;
10880          *)
10881	    # FIXME: insert proper C++ library support
10882	    _LT_TAGVAR(ld_shlibs, $1)=no
10883	    ;;
10884        esac
10885        ;;
10886
10887      vxworks*)
10888        # FIXME: insert proper C++ library support
10889        _LT_TAGVAR(ld_shlibs, $1)=no
10890        ;;
10891
10892      *)
10893        # FIXME: insert proper C++ library support
10894        _LT_TAGVAR(ld_shlibs, $1)=no
10895        ;;
10896    esac
10897
10898    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
10899    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
10900
10901    _LT_TAGVAR(GCC, $1)=$GXX
10902    _LT_TAGVAR(LD, $1)=$LD
10903
10904    ## CAVEAT EMPTOR:
10905    ## There is no encapsulation within the following macros, do not change
10906    ## the running order or otherwise move them around unless you know exactly
10907    ## what you are doing...
10908    _LT_SYS_HIDDEN_LIBDEPS($1)
10909    _LT_COMPILER_PIC($1)
10910    _LT_COMPILER_C_O($1)
10911    _LT_COMPILER_FILE_LOCKS($1)
10912    _LT_LINKER_SHLIBS($1)
10913    _LT_SYS_DYNAMIC_LINKER($1)
10914    _LT_LINKER_HARDCODE_LIBPATH($1)
10915
10916    _LT_CONFIG($1)
10917  fi # test -n "$compiler"
10918
10919  CC=$lt_save_CC
10920  CFLAGS=$lt_save_CFLAGS
10921  LDCXX=$LD
10922  LD=$lt_save_LD
10923  GCC=$lt_save_GCC
10924  with_gnu_ld=$lt_save_with_gnu_ld
10925  lt_cv_path_LDCXX=$lt_cv_path_LD
10926  lt_cv_path_LD=$lt_save_path_LD
10927  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
10928  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
10929fi # test yes != "$_lt_caught_CXX_error"
10930
10931AC_LANG_POP
10932])# _LT_LANG_CXX_CONFIG
10933
10934
10935# _LT_FUNC_STRIPNAME_CNF
10936# ----------------------
10937# func_stripname_cnf prefix suffix name
10938# strip PREFIX and SUFFIX off of NAME.
10939# PREFIX and SUFFIX must not contain globbing or regex special
10940# characters, hashes, percent signs, but SUFFIX may contain a leading
10941# dot (in which case that matches only a dot).
10942#
10943# This function is identical to the (non-XSI) version of func_stripname,
10944# except this one can be used by m4 code that may be executed by configure,
10945# rather than the libtool script.
10946m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
10947AC_REQUIRE([_LT_DECL_SED])
10948AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
10949func_stripname_cnf ()
10950{
10951  case @S|@2 in
10952  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
10953  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
10954  esac
10955} # func_stripname_cnf
10956])# _LT_FUNC_STRIPNAME_CNF
10957
10958
10959# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
10960# ---------------------------------
10961# Figure out "hidden" library dependencies from verbose
10962# compiler output when linking a shared library.
10963# Parse the compiler output and extract the necessary
10964# objects, libraries and library flags.
10965m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
10966[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
10967AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
10968# Dependencies to place before and after the object being linked:
10969_LT_TAGVAR(predep_objects, $1)=
10970_LT_TAGVAR(postdep_objects, $1)=
10971_LT_TAGVAR(predeps, $1)=
10972_LT_TAGVAR(postdeps, $1)=
10973_LT_TAGVAR(compiler_lib_search_path, $1)=
10974
10975dnl we can't use the lt_simple_compile_test_code here,
10976dnl because it contains code intended for an executable,
10977dnl not a library.  It's possible we should let each
10978dnl tag define a new lt_????_link_test_code variable,
10979dnl but it's only used here...
10980m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
10981int a;
10982void foo (void) { a = 0; }
10983_LT_EOF
10984], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
10985class Foo
10986{
10987public:
10988  Foo (void) { a = 0; }
10989private:
10990  int a;
10991};
10992_LT_EOF
10993], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
10994      subroutine foo
10995      implicit none
10996      integer*4 a
10997      a=0
10998      return
10999      end
11000_LT_EOF
11001], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
11002      subroutine foo
11003      implicit none
11004      integer a
11005      a=0
11006      return
11007      end
11008_LT_EOF
11009], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
11010public class foo {
11011  private int a;
11012  public void bar (void) {
11013    a = 0;
11014  }
11015};
11016_LT_EOF
11017], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
11018package foo
11019func foo() {
11020}
11021_LT_EOF
11022])
11023
11024_lt_libdeps_save_CFLAGS=$CFLAGS
11025case "$CC $CFLAGS " in #(
11026*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
11027*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
11028*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
11029esac
11030
11031dnl Parse the compiler output and extract the necessary
11032dnl objects, libraries and library flags.
11033if AC_TRY_EVAL(ac_compile); then
11034  # Parse the compiler output and extract the necessary
11035  # objects, libraries and library flags.
11036
11037  # Sentinel used to keep track of whether or not we are before
11038  # the conftest object file.
11039  pre_test_object_deps_done=no
11040
11041  for p in `eval "$output_verbose_link_cmd"`; do
11042    case $prev$p in
11043
11044    -L* | -R* | -l*)
11045       # Some compilers place space between "-{L,R}" and the path.
11046       # Remove the space.
11047       if test x-L = "$p" ||
11048          test x-R = "$p"; then
11049	 prev=$p
11050	 continue
11051       fi
11052
11053       # Expand the sysroot to ease extracting the directories later.
11054       if test -z "$prev"; then
11055         case $p in
11056         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
11057         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
11058         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
11059         esac
11060       fi
11061       case $p in
11062       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
11063       esac
11064       if test no = "$pre_test_object_deps_done"; then
11065	 case $prev in
11066	 -L | -R)
11067	   # Internal compiler library paths should come after those
11068	   # provided the user.  The postdeps already come after the
11069	   # user supplied libs so there is no need to process them.
11070	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
11071	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
11072	   else
11073	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
11074	   fi
11075	   ;;
11076	 # The "-l" case would never come before the object being
11077	 # linked, so don't bother handling this case.
11078	 esac
11079       else
11080	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
11081	   _LT_TAGVAR(postdeps, $1)=$prev$p
11082	 else
11083	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
11084	 fi
11085       fi
11086       prev=
11087       ;;
11088
11089    *.lto.$objext) ;; # Ignore GCC LTO objects
11090    *.$objext)
11091       # This assumes that the test object file only shows up
11092       # once in the compiler output.
11093       if test "$p" = "conftest.$objext"; then
11094	 pre_test_object_deps_done=yes
11095	 continue
11096       fi
11097
11098       if test no = "$pre_test_object_deps_done"; then
11099	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
11100	   _LT_TAGVAR(predep_objects, $1)=$p
11101	 else
11102	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
11103	 fi
11104       else
11105	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
11106	   _LT_TAGVAR(postdep_objects, $1)=$p
11107	 else
11108	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
11109	 fi
11110       fi
11111       ;;
11112
11113    *) ;; # Ignore the rest.
11114
11115    esac
11116  done
11117
11118  # Clean up.
11119  rm -f a.out a.exe
11120else
11121  echo "libtool.m4: error: problem compiling $1 test program"
11122fi
11123
11124$RM -f confest.$objext
11125CFLAGS=$_lt_libdeps_save_CFLAGS
11126
11127# PORTME: override above test on systems where it is broken
11128m4_if([$1], [CXX],
11129[case $host_os in
11130interix[[3-9]]*)
11131  # Interix 3.5 installs completely hosed .la files for C++, so rather than
11132  # hack all around it, let's just trust "g++" to DTRT.
11133  _LT_TAGVAR(predep_objects,$1)=
11134  _LT_TAGVAR(postdep_objects,$1)=
11135  _LT_TAGVAR(postdeps,$1)=
11136  ;;
11137esac
11138])
11139
11140case " $_LT_TAGVAR(postdeps, $1) " in
11141*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
11142esac
11143 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
11144if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
11145 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
11146fi
11147_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
11148    [The directories searched by this compiler when creating a shared library])
11149_LT_TAGDECL([], [predep_objects], [1],
11150    [Dependencies to place before and after the objects being linked to
11151    create a shared library])
11152_LT_TAGDECL([], [postdep_objects], [1])
11153_LT_TAGDECL([], [predeps], [1])
11154_LT_TAGDECL([], [postdeps], [1])
11155_LT_TAGDECL([], [compiler_lib_search_path], [1],
11156    [The library search path used internally by the compiler when linking
11157    a shared library])
11158])# _LT_SYS_HIDDEN_LIBDEPS
11159
11160
11161# _LT_LANG_F77_CONFIG([TAG])
11162# --------------------------
11163# Ensure that the configuration variables for a Fortran 77 compiler are
11164# suitably defined.  These variables are subsequently used by _LT_CONFIG
11165# to write the compiler configuration to 'libtool'.
11166m4_defun([_LT_LANG_F77_CONFIG],
11167[AC_LANG_PUSH(Fortran 77)
11168if test -z "$F77" || test no = "$F77"; then
11169  _lt_disable_F77=yes
11170fi
11171
11172_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11173_LT_TAGVAR(allow_undefined_flag, $1)=
11174_LT_TAGVAR(always_export_symbols, $1)=no
11175_LT_TAGVAR(archive_expsym_cmds, $1)=
11176_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11177_LT_TAGVAR(hardcode_direct, $1)=no
11178_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11179_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11180_LT_TAGVAR(hardcode_libdir_separator, $1)=
11181_LT_TAGVAR(hardcode_minus_L, $1)=no
11182_LT_TAGVAR(hardcode_automatic, $1)=no
11183_LT_TAGVAR(inherit_rpath, $1)=no
11184_LT_TAGVAR(module_cmds, $1)=
11185_LT_TAGVAR(module_expsym_cmds, $1)=
11186_LT_TAGVAR(link_all_deplibs, $1)=unknown
11187_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11188_LT_TAGVAR(reload_flag, $1)=$reload_flag
11189_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11190_LT_TAGVAR(no_undefined_flag, $1)=
11191_LT_TAGVAR(whole_archive_flag_spec, $1)=
11192_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11193
11194# Source file extension for f77 test sources.
11195ac_ext=f
11196
11197# Object file extension for compiled f77 test sources.
11198objext=o
11199_LT_TAGVAR(objext, $1)=$objext
11200
11201# No sense in running all these tests if we already determined that
11202# the F77 compiler isn't working.  Some variables (like enable_shared)
11203# are currently assumed to apply to all compilers on this platform,
11204# and will be corrupted by setting them based on a non-working compiler.
11205if test yes != "$_lt_disable_F77"; then
11206  # Code to be used in simple compile tests
11207  lt_simple_compile_test_code="\
11208      subroutine t
11209      return
11210      end
11211"
11212
11213  # Code to be used in simple link tests
11214  lt_simple_link_test_code="\
11215      program t
11216      end
11217"
11218
11219  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11220  _LT_TAG_COMPILER
11221
11222  # save warnings/boilerplate of simple test code
11223  _LT_COMPILER_BOILERPLATE
11224  _LT_LINKER_BOILERPLATE
11225
11226  # Allow CC to be a program name with arguments.
11227  lt_save_CC=$CC
11228  lt_save_GCC=$GCC
11229  lt_save_CFLAGS=$CFLAGS
11230  CC=${F77-"f77"}
11231  CFLAGS=$FFLAGS
11232  compiler=$CC
11233  _LT_TAGVAR(compiler, $1)=$CC
11234  _LT_CC_BASENAME([$compiler])
11235  GCC=$G77
11236  if test -n "$compiler"; then
11237    AC_MSG_CHECKING([if libtool supports shared libraries])
11238    AC_MSG_RESULT([$can_build_shared])
11239
11240    AC_MSG_CHECKING([whether to build shared libraries])
11241    test no = "$can_build_shared" && enable_shared=no
11242
11243    # On AIX, shared libraries and static libraries use the same namespace, and
11244    # are all built from PIC.
11245    case $host_os in
11246      aix3*)
11247        test yes = "$enable_shared" && enable_static=no
11248        if test -n "$RANLIB"; then
11249          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11250          postinstall_cmds='$RANLIB $lib'
11251        fi
11252        ;;
11253      aix[[4-9]]*)
11254	if test ia64 != "$host_cpu"; then
11255	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11256	  yes,aix,yes) ;;		# shared object as lib.so file only
11257	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11258	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11259	  esac
11260	fi
11261        ;;
11262    esac
11263    AC_MSG_RESULT([$enable_shared])
11264
11265    AC_MSG_CHECKING([whether to build static libraries])
11266    # Make sure either enable_shared or enable_static is yes.
11267    test yes = "$enable_shared" || enable_static=yes
11268    AC_MSG_RESULT([$enable_static])
11269
11270    _LT_TAGVAR(GCC, $1)=$G77
11271    _LT_TAGVAR(LD, $1)=$LD
11272
11273    ## CAVEAT EMPTOR:
11274    ## There is no encapsulation within the following macros, do not change
11275    ## the running order or otherwise move them around unless you know exactly
11276    ## what you are doing...
11277    _LT_COMPILER_PIC($1)
11278    _LT_COMPILER_C_O($1)
11279    _LT_COMPILER_FILE_LOCKS($1)
11280    _LT_LINKER_SHLIBS($1)
11281    _LT_SYS_DYNAMIC_LINKER($1)
11282    _LT_LINKER_HARDCODE_LIBPATH($1)
11283
11284    _LT_CONFIG($1)
11285  fi # test -n "$compiler"
11286
11287  GCC=$lt_save_GCC
11288  CC=$lt_save_CC
11289  CFLAGS=$lt_save_CFLAGS
11290fi # test yes != "$_lt_disable_F77"
11291
11292AC_LANG_POP
11293])# _LT_LANG_F77_CONFIG
11294
11295
11296# _LT_LANG_FC_CONFIG([TAG])
11297# -------------------------
11298# Ensure that the configuration variables for a Fortran compiler are
11299# suitably defined.  These variables are subsequently used by _LT_CONFIG
11300# to write the compiler configuration to 'libtool'.
11301m4_defun([_LT_LANG_FC_CONFIG],
11302[AC_LANG_PUSH(Fortran)
11303
11304if test -z "$FC" || test no = "$FC"; then
11305  _lt_disable_FC=yes
11306fi
11307
11308_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11309_LT_TAGVAR(allow_undefined_flag, $1)=
11310_LT_TAGVAR(always_export_symbols, $1)=no
11311_LT_TAGVAR(archive_expsym_cmds, $1)=
11312_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11313_LT_TAGVAR(hardcode_direct, $1)=no
11314_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11315_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11316_LT_TAGVAR(hardcode_libdir_separator, $1)=
11317_LT_TAGVAR(hardcode_minus_L, $1)=no
11318_LT_TAGVAR(hardcode_automatic, $1)=no
11319_LT_TAGVAR(inherit_rpath, $1)=no
11320_LT_TAGVAR(module_cmds, $1)=
11321_LT_TAGVAR(module_expsym_cmds, $1)=
11322_LT_TAGVAR(link_all_deplibs, $1)=unknown
11323_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11324_LT_TAGVAR(reload_flag, $1)=$reload_flag
11325_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11326_LT_TAGVAR(no_undefined_flag, $1)=
11327_LT_TAGVAR(whole_archive_flag_spec, $1)=
11328_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11329
11330# Source file extension for fc test sources.
11331ac_ext=${ac_fc_srcext-f}
11332
11333# Object file extension for compiled fc test sources.
11334objext=o
11335_LT_TAGVAR(objext, $1)=$objext
11336
11337# No sense in running all these tests if we already determined that
11338# the FC compiler isn't working.  Some variables (like enable_shared)
11339# are currently assumed to apply to all compilers on this platform,
11340# and will be corrupted by setting them based on a non-working compiler.
11341if test yes != "$_lt_disable_FC"; then
11342  # Code to be used in simple compile tests
11343  lt_simple_compile_test_code="\
11344      subroutine t
11345      return
11346      end
11347"
11348
11349  # Code to be used in simple link tests
11350  lt_simple_link_test_code="\
11351      program t
11352      end
11353"
11354
11355  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11356  _LT_TAG_COMPILER
11357
11358  # save warnings/boilerplate of simple test code
11359  _LT_COMPILER_BOILERPLATE
11360  _LT_LINKER_BOILERPLATE
11361
11362  # Allow CC to be a program name with arguments.
11363  lt_save_CC=$CC
11364  lt_save_GCC=$GCC
11365  lt_save_CFLAGS=$CFLAGS
11366  CC=${FC-"f95"}
11367  CFLAGS=$FCFLAGS
11368  compiler=$CC
11369  GCC=$ac_cv_fc_compiler_gnu
11370
11371  _LT_TAGVAR(compiler, $1)=$CC
11372  _LT_CC_BASENAME([$compiler])
11373
11374  if test -n "$compiler"; then
11375    AC_MSG_CHECKING([if libtool supports shared libraries])
11376    AC_MSG_RESULT([$can_build_shared])
11377
11378    AC_MSG_CHECKING([whether to build shared libraries])
11379    test no = "$can_build_shared" && enable_shared=no
11380
11381    # On AIX, shared libraries and static libraries use the same namespace, and
11382    # are all built from PIC.
11383    case $host_os in
11384      aix3*)
11385        test yes = "$enable_shared" && enable_static=no
11386        if test -n "$RANLIB"; then
11387          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11388          postinstall_cmds='$RANLIB $lib'
11389        fi
11390        ;;
11391      aix[[4-9]]*)
11392	if test ia64 != "$host_cpu"; then
11393	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11394	  yes,aix,yes) ;;		# shared object as lib.so file only
11395	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11396	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11397	  esac
11398	fi
11399        ;;
11400    esac
11401    AC_MSG_RESULT([$enable_shared])
11402
11403    AC_MSG_CHECKING([whether to build static libraries])
11404    # Make sure either enable_shared or enable_static is yes.
11405    test yes = "$enable_shared" || enable_static=yes
11406    AC_MSG_RESULT([$enable_static])
11407
11408    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
11409    _LT_TAGVAR(LD, $1)=$LD
11410
11411    ## CAVEAT EMPTOR:
11412    ## There is no encapsulation within the following macros, do not change
11413    ## the running order or otherwise move them around unless you know exactly
11414    ## what you are doing...
11415    _LT_SYS_HIDDEN_LIBDEPS($1)
11416    _LT_COMPILER_PIC($1)
11417    _LT_COMPILER_C_O($1)
11418    _LT_COMPILER_FILE_LOCKS($1)
11419    _LT_LINKER_SHLIBS($1)
11420    _LT_SYS_DYNAMIC_LINKER($1)
11421    _LT_LINKER_HARDCODE_LIBPATH($1)
11422
11423    _LT_CONFIG($1)
11424  fi # test -n "$compiler"
11425
11426  GCC=$lt_save_GCC
11427  CC=$lt_save_CC
11428  CFLAGS=$lt_save_CFLAGS
11429fi # test yes != "$_lt_disable_FC"
11430
11431AC_LANG_POP
11432])# _LT_LANG_FC_CONFIG
11433
11434
11435# _LT_LANG_GCJ_CONFIG([TAG])
11436# --------------------------
11437# Ensure that the configuration variables for the GNU Java Compiler compiler
11438# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11439# to write the compiler configuration to 'libtool'.
11440m4_defun([_LT_LANG_GCJ_CONFIG],
11441[AC_REQUIRE([LT_PROG_GCJ])dnl
11442AC_LANG_SAVE
11443
11444# Source file extension for Java test sources.
11445ac_ext=java
11446
11447# Object file extension for compiled Java test sources.
11448objext=o
11449_LT_TAGVAR(objext, $1)=$objext
11450
11451# Code to be used in simple compile tests
11452lt_simple_compile_test_code="class foo {}"
11453
11454# Code to be used in simple link tests
11455lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
11456
11457# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11458_LT_TAG_COMPILER
11459
11460# save warnings/boilerplate of simple test code
11461_LT_COMPILER_BOILERPLATE
11462_LT_LINKER_BOILERPLATE
11463
11464# Allow CC to be a program name with arguments.
11465lt_save_CC=$CC
11466lt_save_CFLAGS=$CFLAGS
11467lt_save_GCC=$GCC
11468GCC=yes
11469CC=${GCJ-"gcj"}
11470CFLAGS=$GCJFLAGS
11471compiler=$CC
11472_LT_TAGVAR(compiler, $1)=$CC
11473_LT_TAGVAR(LD, $1)=$LD
11474_LT_CC_BASENAME([$compiler])
11475
11476# GCJ did not exist at the time GCC didn't implicitly link libc in.
11477_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11478
11479_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11480_LT_TAGVAR(reload_flag, $1)=$reload_flag
11481_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11482
11483if test -n "$compiler"; then
11484  _LT_COMPILER_NO_RTTI($1)
11485  _LT_COMPILER_PIC($1)
11486  _LT_COMPILER_C_O($1)
11487  _LT_COMPILER_FILE_LOCKS($1)
11488  _LT_LINKER_SHLIBS($1)
11489  _LT_LINKER_HARDCODE_LIBPATH($1)
11490
11491  _LT_CONFIG($1)
11492fi
11493
11494AC_LANG_RESTORE
11495
11496GCC=$lt_save_GCC
11497CC=$lt_save_CC
11498CFLAGS=$lt_save_CFLAGS
11499])# _LT_LANG_GCJ_CONFIG
11500
11501
11502# _LT_LANG_GO_CONFIG([TAG])
11503# --------------------------
11504# Ensure that the configuration variables for the GNU Go compiler
11505# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11506# to write the compiler configuration to 'libtool'.
11507m4_defun([_LT_LANG_GO_CONFIG],
11508[AC_REQUIRE([LT_PROG_GO])dnl
11509AC_LANG_SAVE
11510
11511# Source file extension for Go test sources.
11512ac_ext=go
11513
11514# Object file extension for compiled Go test sources.
11515objext=o
11516_LT_TAGVAR(objext, $1)=$objext
11517
11518# Code to be used in simple compile tests
11519lt_simple_compile_test_code="package main; func main() { }"
11520
11521# Code to be used in simple link tests
11522lt_simple_link_test_code='package main; func main() { }'
11523
11524# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11525_LT_TAG_COMPILER
11526
11527# save warnings/boilerplate of simple test code
11528_LT_COMPILER_BOILERPLATE
11529_LT_LINKER_BOILERPLATE
11530
11531# Allow CC to be a program name with arguments.
11532lt_save_CC=$CC
11533lt_save_CFLAGS=$CFLAGS
11534lt_save_GCC=$GCC
11535GCC=yes
11536CC=${GOC-"gccgo"}
11537CFLAGS=$GOFLAGS
11538compiler=$CC
11539_LT_TAGVAR(compiler, $1)=$CC
11540_LT_TAGVAR(LD, $1)=$LD
11541_LT_CC_BASENAME([$compiler])
11542
11543# Go did not exist at the time GCC didn't implicitly link libc in.
11544_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11545
11546_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11547_LT_TAGVAR(reload_flag, $1)=$reload_flag
11548_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11549
11550if test -n "$compiler"; then
11551  _LT_COMPILER_NO_RTTI($1)
11552  _LT_COMPILER_PIC($1)
11553  _LT_COMPILER_C_O($1)
11554  _LT_COMPILER_FILE_LOCKS($1)
11555  _LT_LINKER_SHLIBS($1)
11556  _LT_LINKER_HARDCODE_LIBPATH($1)
11557
11558  _LT_CONFIG($1)
11559fi
11560
11561AC_LANG_RESTORE
11562
11563GCC=$lt_save_GCC
11564CC=$lt_save_CC
11565CFLAGS=$lt_save_CFLAGS
11566])# _LT_LANG_GO_CONFIG
11567
11568
11569# _LT_LANG_RC_CONFIG([TAG])
11570# -------------------------
11571# Ensure that the configuration variables for the Windows resource compiler
11572# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11573# to write the compiler configuration to 'libtool'.
11574m4_defun([_LT_LANG_RC_CONFIG],
11575[AC_REQUIRE([LT_PROG_RC])dnl
11576AC_LANG_SAVE
11577
11578# Source file extension for RC test sources.
11579ac_ext=rc
11580
11581# Object file extension for compiled RC test sources.
11582objext=o
11583_LT_TAGVAR(objext, $1)=$objext
11584
11585# Code to be used in simple compile tests
11586lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
11587
11588# Code to be used in simple link tests
11589lt_simple_link_test_code=$lt_simple_compile_test_code
11590
11591# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11592_LT_TAG_COMPILER
11593
11594# save warnings/boilerplate of simple test code
11595_LT_COMPILER_BOILERPLATE
11596_LT_LINKER_BOILERPLATE
11597
11598# Allow CC to be a program name with arguments.
11599lt_save_CC=$CC
11600lt_save_CFLAGS=$CFLAGS
11601lt_save_GCC=$GCC
11602GCC=
11603CC=${RC-"windres"}
11604CFLAGS=
11605compiler=$CC
11606_LT_TAGVAR(compiler, $1)=$CC
11607_LT_CC_BASENAME([$compiler])
11608_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
11609
11610if test -n "$compiler"; then
11611  :
11612  _LT_CONFIG($1)
11613fi
11614
11615GCC=$lt_save_GCC
11616AC_LANG_RESTORE
11617CC=$lt_save_CC
11618CFLAGS=$lt_save_CFLAGS
11619])# _LT_LANG_RC_CONFIG
11620
11621
11622# LT_PROG_GCJ
11623# -----------
11624AC_DEFUN([LT_PROG_GCJ],
11625[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
11626  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
11627    [AC_CHECK_TOOL(GCJ, gcj,)
11628      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
11629      AC_SUBST(GCJFLAGS)])])[]dnl
11630])
11631
11632# Old name:
11633AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
11634dnl aclocal-1.4 backwards compatibility:
11635dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
11636
11637
11638# LT_PROG_GO
11639# ----------
11640AC_DEFUN([LT_PROG_GO],
11641[AC_CHECK_TOOL(GOC, gccgo,)
11642])
11643
11644
11645# LT_PROG_RC
11646# ----------
11647AC_DEFUN([LT_PROG_RC],
11648[AC_CHECK_TOOL(RC, windres,)
11649])
11650
11651# Old name:
11652AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
11653dnl aclocal-1.4 backwards compatibility:
11654dnl AC_DEFUN([LT_AC_PROG_RC], [])
11655
11656
11657# _LT_DECL_EGREP
11658# --------------
11659# If we don't have a new enough Autoconf to choose the best grep
11660# available, choose the one first in the user's PATH.
11661m4_defun([_LT_DECL_EGREP],
11662[AC_REQUIRE([AC_PROG_EGREP])dnl
11663AC_REQUIRE([AC_PROG_FGREP])dnl
11664test -z "$GREP" && GREP=grep
11665_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
11666_LT_DECL([], [EGREP], [1], [An ERE matcher])
11667_LT_DECL([], [FGREP], [1], [A literal string matcher])
11668dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
11669AC_SUBST([GREP])
11670])
11671
11672
11673# _LT_DECL_OBJDUMP
11674# --------------
11675# If we don't have a new enough Autoconf to choose the best objdump
11676# available, choose the one first in the user's PATH.
11677m4_defun([_LT_DECL_OBJDUMP],
11678[AC_CHECK_TOOL(OBJDUMP, objdump, false)
11679test -z "$OBJDUMP" && OBJDUMP=objdump
11680_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
11681AC_SUBST([OBJDUMP])
11682])
11683
11684# _LT_DECL_DLLTOOL
11685# ----------------
11686# Ensure DLLTOOL variable is set.
11687m4_defun([_LT_DECL_DLLTOOL],
11688[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
11689test -z "$DLLTOOL" && DLLTOOL=dlltool
11690_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
11691AC_SUBST([DLLTOOL])
11692])
11693
11694# _LT_DECL_SED
11695# ------------
11696# Check for a fully-functional sed program, that truncates
11697# as few characters as possible.  Prefer GNU sed if found.
11698m4_defun([_LT_DECL_SED],
11699[AC_PROG_SED
11700test -z "$SED" && SED=sed
11701Xsed="$SED -e 1s/^X//"
11702_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
11703_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
11704    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
11705])# _LT_DECL_SED
11706
11707m4_ifndef([AC_PROG_SED], [
11708# NOTE: This macro has been submitted for inclusion into   #
11709#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
11710#  a released version of Autoconf we should remove this    #
11711#  macro and use it instead.                               #
11712
11713m4_defun([AC_PROG_SED],
11714[AC_MSG_CHECKING([for a sed that does not truncate output])
11715AC_CACHE_VAL(lt_cv_path_SED,
11716[# Loop through the user's path and test for sed and gsed.
11717# Then use that list of sed's as ones to test for truncation.
11718as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11719for as_dir in $PATH
11720do
11721  IFS=$as_save_IFS
11722  test -z "$as_dir" && as_dir=.
11723  for lt_ac_prog in sed gsed; do
11724    for ac_exec_ext in '' $ac_executable_extensions; do
11725      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
11726        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
11727      fi
11728    done
11729  done
11730done
11731IFS=$as_save_IFS
11732lt_ac_max=0
11733lt_ac_count=0
11734# Add /usr/xpg4/bin/sed as it is typically found on Solaris
11735# along with /bin/sed that truncates output.
11736for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
11737  test ! -f "$lt_ac_sed" && continue
11738  cat /dev/null > conftest.in
11739  lt_ac_count=0
11740  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
11741  # Check for GNU sed and select it if it is found.
11742  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
11743    lt_cv_path_SED=$lt_ac_sed
11744    break
11745  fi
11746  while true; do
11747    cat conftest.in conftest.in >conftest.tmp
11748    mv conftest.tmp conftest.in
11749    cp conftest.in conftest.nl
11750    echo >>conftest.nl
11751    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
11752    cmp -s conftest.out conftest.nl || break
11753    # 10000 chars as input seems more than enough
11754    test 10 -lt "$lt_ac_count" && break
11755    lt_ac_count=`expr $lt_ac_count + 1`
11756    if test "$lt_ac_count" -gt "$lt_ac_max"; then
11757      lt_ac_max=$lt_ac_count
11758      lt_cv_path_SED=$lt_ac_sed
11759    fi
11760  done
11761done
11762])
11763SED=$lt_cv_path_SED
11764AC_SUBST([SED])
11765AC_MSG_RESULT([$SED])
11766])#AC_PROG_SED
11767])#m4_ifndef
11768
11769# Old name:
11770AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
11771dnl aclocal-1.4 backwards compatibility:
11772dnl AC_DEFUN([LT_AC_PROG_SED], [])
11773
11774
11775# _LT_CHECK_SHELL_FEATURES
11776# ------------------------
11777# Find out whether the shell is Bourne or XSI compatible,
11778# or has some other useful features.
11779m4_defun([_LT_CHECK_SHELL_FEATURES],
11780[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
11781  lt_unset=unset
11782else
11783  lt_unset=false
11784fi
11785_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
11786
11787# test EBCDIC or ASCII
11788case `echo X|tr X '\101'` in
11789 A) # ASCII based system
11790    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
11791  lt_SP2NL='tr \040 \012'
11792  lt_NL2SP='tr \015\012 \040\040'
11793  ;;
11794 *) # EBCDIC based system
11795  lt_SP2NL='tr \100 \n'
11796  lt_NL2SP='tr \r\n \100\100'
11797  ;;
11798esac
11799_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
11800_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
11801])# _LT_CHECK_SHELL_FEATURES
11802
11803
11804# _LT_PATH_CONVERSION_FUNCTIONS
11805# -----------------------------
11806# Determine what file name conversion functions should be used by
11807# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
11808# for certain cross-compile configurations and native mingw.
11809m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
11810[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11811AC_REQUIRE([AC_CANONICAL_BUILD])dnl
11812AC_MSG_CHECKING([how to convert $build file names to $host format])
11813AC_CACHE_VAL(lt_cv_to_host_file_cmd,
11814[case $host in
11815  *-*-mingw* )
11816    case $build in
11817      *-*-mingw* ) # actually msys
11818        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
11819        ;;
11820      *-*-cygwin* )
11821        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
11822        ;;
11823      * ) # otherwise, assume *nix
11824        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
11825        ;;
11826    esac
11827    ;;
11828  *-*-cygwin* )
11829    case $build in
11830      *-*-mingw* ) # actually msys
11831        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
11832        ;;
11833      *-*-cygwin* )
11834        lt_cv_to_host_file_cmd=func_convert_file_noop
11835        ;;
11836      * ) # otherwise, assume *nix
11837        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
11838        ;;
11839    esac
11840    ;;
11841  * ) # unhandled hosts (and "normal" native builds)
11842    lt_cv_to_host_file_cmd=func_convert_file_noop
11843    ;;
11844esac
11845])
11846to_host_file_cmd=$lt_cv_to_host_file_cmd
11847AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
11848_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
11849         [0], [convert $build file names to $host format])dnl
11850
11851AC_MSG_CHECKING([how to convert $build file names to toolchain format])
11852AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
11853[#assume ordinary cross tools, or native build.
11854lt_cv_to_tool_file_cmd=func_convert_file_noop
11855case $host in
11856  *-*-mingw* )
11857    case $build in
11858      *-*-mingw* ) # actually msys
11859        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
11860        ;;
11861    esac
11862    ;;
11863esac
11864])
11865to_tool_file_cmd=$lt_cv_to_tool_file_cmd
11866AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
11867_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
11868         [0], [convert $build files to toolchain format])dnl
11869])# _LT_PATH_CONVERSION_FUNCTIONS
11870
11871# Helper functions for option handling.                    -*- Autoconf -*-
11872#
11873#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
11874#   Foundation, Inc.
11875#   Written by Gary V. Vaughan, 2004
11876#
11877# This file is free software; the Free Software Foundation gives
11878# unlimited permission to copy and/or distribute it, with or without
11879# modifications, as long as this notice is preserved.
11880
11881# serial 8 ltoptions.m4
11882
11883# This is to help aclocal find these macros, as it can't see m4_define.
11884AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
11885
11886
11887# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
11888# ------------------------------------------
11889m4_define([_LT_MANGLE_OPTION],
11890[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
11891
11892
11893# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
11894# ---------------------------------------
11895# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
11896# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
11897# saved as a flag.
11898m4_define([_LT_SET_OPTION],
11899[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
11900m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
11901        _LT_MANGLE_DEFUN([$1], [$2]),
11902    [m4_warning([Unknown $1 option '$2'])])[]dnl
11903])
11904
11905
11906# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
11907# ------------------------------------------------------------
11908# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11909m4_define([_LT_IF_OPTION],
11910[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
11911
11912
11913# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
11914# -------------------------------------------------------
11915# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
11916# are set.
11917m4_define([_LT_UNLESS_OPTIONS],
11918[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11919	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
11920		      [m4_define([$0_found])])])[]dnl
11921m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
11922])[]dnl
11923])
11924
11925
11926# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
11927# ----------------------------------------
11928# OPTION-LIST is a space-separated list of Libtool options associated
11929# with MACRO-NAME.  If any OPTION has a matching handler declared with
11930# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
11931# the unknown option and exit.
11932m4_defun([_LT_SET_OPTIONS],
11933[# Set options
11934m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11935    [_LT_SET_OPTION([$1], _LT_Option)])
11936
11937m4_if([$1],[LT_INIT],[
11938  dnl
11939  dnl Simply set some default values (i.e off) if boolean options were not
11940  dnl specified:
11941  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
11942  ])
11943  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
11944  ])
11945  dnl
11946  dnl If no reference was made to various pairs of opposing options, then
11947  dnl we run the default mode handler for the pair.  For example, if neither
11948  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
11949  dnl archives by default:
11950  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
11951  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
11952  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
11953  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
11954		   [_LT_ENABLE_FAST_INSTALL])
11955  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
11956		   [_LT_WITH_AIX_SONAME([aix])])
11957  ])
11958])# _LT_SET_OPTIONS
11959
11960
11961
11962# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
11963# -----------------------------------------
11964m4_define([_LT_MANGLE_DEFUN],
11965[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
11966
11967
11968# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
11969# -----------------------------------------------
11970m4_define([LT_OPTION_DEFINE],
11971[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
11972])# LT_OPTION_DEFINE
11973
11974
11975# dlopen
11976# ------
11977LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
11978])
11979
11980AU_DEFUN([AC_LIBTOOL_DLOPEN],
11981[_LT_SET_OPTION([LT_INIT], [dlopen])
11982AC_DIAGNOSE([obsolete],
11983[$0: Remove this warning and the call to _LT_SET_OPTION when you
11984put the 'dlopen' option into LT_INIT's first parameter.])
11985])
11986
11987dnl aclocal-1.4 backwards compatibility:
11988dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
11989
11990
11991# win32-dll
11992# ---------
11993# Declare package support for building win32 dll's.
11994LT_OPTION_DEFINE([LT_INIT], [win32-dll],
11995[enable_win32_dll=yes
11996
11997case $host in
11998*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
11999  AC_CHECK_TOOL(AS, as, false)
12000  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
12001  AC_CHECK_TOOL(OBJDUMP, objdump, false)
12002  ;;
12003esac
12004
12005test -z "$AS" && AS=as
12006_LT_DECL([], [AS],      [1], [Assembler program])dnl
12007
12008test -z "$DLLTOOL" && DLLTOOL=dlltool
12009_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
12010
12011test -z "$OBJDUMP" && OBJDUMP=objdump
12012_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
12013])# win32-dll
12014
12015AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
12016[AC_REQUIRE([AC_CANONICAL_HOST])dnl
12017_LT_SET_OPTION([LT_INIT], [win32-dll])
12018AC_DIAGNOSE([obsolete],
12019[$0: Remove this warning and the call to _LT_SET_OPTION when you
12020put the 'win32-dll' option into LT_INIT's first parameter.])
12021])
12022
12023dnl aclocal-1.4 backwards compatibility:
12024dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
12025
12026
12027# _LT_ENABLE_SHARED([DEFAULT])
12028# ----------------------------
12029# implement the --enable-shared flag, and supports the 'shared' and
12030# 'disable-shared' LT_INIT options.
12031# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
12032m4_define([_LT_ENABLE_SHARED],
12033[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
12034AC_ARG_ENABLE([shared],
12035    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
12036	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
12037    [p=${PACKAGE-default}
12038    case $enableval in
12039    yes) enable_shared=yes ;;
12040    no) enable_shared=no ;;
12041    *)
12042      enable_shared=no
12043      # Look at the argument we got.  We use all the common list separators.
12044      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12045      for pkg in $enableval; do
12046	IFS=$lt_save_ifs
12047	if test "X$pkg" = "X$p"; then
12048	  enable_shared=yes
12049	fi
12050      done
12051      IFS=$lt_save_ifs
12052      ;;
12053    esac],
12054    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
12055
12056    _LT_DECL([build_libtool_libs], [enable_shared], [0],
12057	[Whether or not to build shared libraries])
12058])# _LT_ENABLE_SHARED
12059
12060LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
12061LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
12062
12063# Old names:
12064AC_DEFUN([AC_ENABLE_SHARED],
12065[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
12066])
12067
12068AC_DEFUN([AC_DISABLE_SHARED],
12069[_LT_SET_OPTION([LT_INIT], [disable-shared])
12070])
12071
12072AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
12073AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
12074
12075dnl aclocal-1.4 backwards compatibility:
12076dnl AC_DEFUN([AM_ENABLE_SHARED], [])
12077dnl AC_DEFUN([AM_DISABLE_SHARED], [])
12078
12079
12080
12081# _LT_ENABLE_STATIC([DEFAULT])
12082# ----------------------------
12083# implement the --enable-static flag, and support the 'static' and
12084# 'disable-static' LT_INIT options.
12085# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
12086m4_define([_LT_ENABLE_STATIC],
12087[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
12088AC_ARG_ENABLE([static],
12089    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
12090	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
12091    [p=${PACKAGE-default}
12092    case $enableval in
12093    yes) enable_static=yes ;;
12094    no) enable_static=no ;;
12095    *)
12096     enable_static=no
12097      # Look at the argument we got.  We use all the common list separators.
12098      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12099      for pkg in $enableval; do
12100	IFS=$lt_save_ifs
12101	if test "X$pkg" = "X$p"; then
12102	  enable_static=yes
12103	fi
12104      done
12105      IFS=$lt_save_ifs
12106      ;;
12107    esac],
12108    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
12109
12110    _LT_DECL([build_old_libs], [enable_static], [0],
12111	[Whether or not to build static libraries])
12112])# _LT_ENABLE_STATIC
12113
12114LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
12115LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
12116
12117# Old names:
12118AC_DEFUN([AC_ENABLE_STATIC],
12119[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
12120])
12121
12122AC_DEFUN([AC_DISABLE_STATIC],
12123[_LT_SET_OPTION([LT_INIT], [disable-static])
12124])
12125
12126AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
12127AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
12128
12129dnl aclocal-1.4 backwards compatibility:
12130dnl AC_DEFUN([AM_ENABLE_STATIC], [])
12131dnl AC_DEFUN([AM_DISABLE_STATIC], [])
12132
12133
12134
12135# _LT_ENABLE_FAST_INSTALL([DEFAULT])
12136# ----------------------------------
12137# implement the --enable-fast-install flag, and support the 'fast-install'
12138# and 'disable-fast-install' LT_INIT options.
12139# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
12140m4_define([_LT_ENABLE_FAST_INSTALL],
12141[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
12142AC_ARG_ENABLE([fast-install],
12143    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
12144    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
12145    [p=${PACKAGE-default}
12146    case $enableval in
12147    yes) enable_fast_install=yes ;;
12148    no) enable_fast_install=no ;;
12149    *)
12150      enable_fast_install=no
12151      # Look at the argument we got.  We use all the common list separators.
12152      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12153      for pkg in $enableval; do
12154	IFS=$lt_save_ifs
12155	if test "X$pkg" = "X$p"; then
12156	  enable_fast_install=yes
12157	fi
12158      done
12159      IFS=$lt_save_ifs
12160      ;;
12161    esac],
12162    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
12163
12164_LT_DECL([fast_install], [enable_fast_install], [0],
12165	 [Whether or not to optimize for fast installation])dnl
12166])# _LT_ENABLE_FAST_INSTALL
12167
12168LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
12169LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
12170
12171# Old names:
12172AU_DEFUN([AC_ENABLE_FAST_INSTALL],
12173[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
12174AC_DIAGNOSE([obsolete],
12175[$0: Remove this warning and the call to _LT_SET_OPTION when you put
12176the 'fast-install' option into LT_INIT's first parameter.])
12177])
12178
12179AU_DEFUN([AC_DISABLE_FAST_INSTALL],
12180[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
12181AC_DIAGNOSE([obsolete],
12182[$0: Remove this warning and the call to _LT_SET_OPTION when you put
12183the 'disable-fast-install' option into LT_INIT's first parameter.])
12184])
12185
12186dnl aclocal-1.4 backwards compatibility:
12187dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
12188dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
12189
12190
12191# _LT_WITH_AIX_SONAME([DEFAULT])
12192# ----------------------------------
12193# implement the --with-aix-soname flag, and support the `aix-soname=aix'
12194# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
12195# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
12196m4_define([_LT_WITH_AIX_SONAME],
12197[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
12198shared_archive_member_spec=
12199case $host,$enable_shared in
12200power*-*-aix[[5-9]]*,yes)
12201  AC_MSG_CHECKING([which variant of shared library versioning to provide])
12202  AC_ARG_WITH([aix-soname],
12203    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
12204      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
12205    [case $withval in
12206    aix|svr4|both)
12207      ;;
12208    *)
12209      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
12210      ;;
12211    esac
12212    lt_cv_with_aix_soname=$with_aix_soname],
12213    [AC_CACHE_VAL([lt_cv_with_aix_soname],
12214      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
12215    with_aix_soname=$lt_cv_with_aix_soname])
12216  AC_MSG_RESULT([$with_aix_soname])
12217  if test aix != "$with_aix_soname"; then
12218    # For the AIX way of multilib, we name the shared archive member
12219    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
12220    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
12221    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
12222    # the AIX toolchain works better with OBJECT_MODE set (default 32).
12223    if test 64 = "${OBJECT_MODE-32}"; then
12224      shared_archive_member_spec=shr_64
12225    else
12226      shared_archive_member_spec=shr
12227    fi
12228  fi
12229  ;;
12230*)
12231  with_aix_soname=aix
12232  ;;
12233esac
12234
12235_LT_DECL([], [shared_archive_member_spec], [0],
12236    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
12237])# _LT_WITH_AIX_SONAME
12238
12239LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
12240LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
12241LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
12242
12243
12244# _LT_WITH_PIC([MODE])
12245# --------------------
12246# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
12247# LT_INIT options.
12248# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
12249m4_define([_LT_WITH_PIC],
12250[AC_ARG_WITH([pic],
12251    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
12252	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
12253    [lt_p=${PACKAGE-default}
12254    case $withval in
12255    yes|no) pic_mode=$withval ;;
12256    *)
12257      pic_mode=default
12258      # Look at the argument we got.  We use all the common list separators.
12259      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12260      for lt_pkg in $withval; do
12261	IFS=$lt_save_ifs
12262	if test "X$lt_pkg" = "X$lt_p"; then
12263	  pic_mode=yes
12264	fi
12265      done
12266      IFS=$lt_save_ifs
12267      ;;
12268    esac],
12269    [pic_mode=m4_default([$1], [default])])
12270
12271_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
12272])# _LT_WITH_PIC
12273
12274LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
12275LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
12276
12277# Old name:
12278AU_DEFUN([AC_LIBTOOL_PICMODE],
12279[_LT_SET_OPTION([LT_INIT], [pic-only])
12280AC_DIAGNOSE([obsolete],
12281[$0: Remove this warning and the call to _LT_SET_OPTION when you
12282put the 'pic-only' option into LT_INIT's first parameter.])
12283])
12284
12285dnl aclocal-1.4 backwards compatibility:
12286dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
12287
12288
12289m4_define([_LTDL_MODE], [])
12290LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
12291		 [m4_define([_LTDL_MODE], [nonrecursive])])
12292LT_OPTION_DEFINE([LTDL_INIT], [recursive],
12293		 [m4_define([_LTDL_MODE], [recursive])])
12294LT_OPTION_DEFINE([LTDL_INIT], [subproject],
12295		 [m4_define([_LTDL_MODE], [subproject])])
12296
12297m4_define([_LTDL_TYPE], [])
12298LT_OPTION_DEFINE([LTDL_INIT], [installable],
12299		 [m4_define([_LTDL_TYPE], [installable])])
12300LT_OPTION_DEFINE([LTDL_INIT], [convenience],
12301		 [m4_define([_LTDL_TYPE], [convenience])])
12302
12303# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
12304#
12305# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
12306# Foundation, Inc.
12307# Written by Gary V. Vaughan, 2004
12308#
12309# This file is free software; the Free Software Foundation gives
12310# unlimited permission to copy and/or distribute it, with or without
12311# modifications, as long as this notice is preserved.
12312
12313# serial 6 ltsugar.m4
12314
12315# This is to help aclocal find these macros, as it can't see m4_define.
12316AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
12317
12318
12319# lt_join(SEP, ARG1, [ARG2...])
12320# -----------------------------
12321# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
12322# associated separator.
12323# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
12324# versions in m4sugar had bugs.
12325m4_define([lt_join],
12326[m4_if([$#], [1], [],
12327       [$#], [2], [[$2]],
12328       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
12329m4_define([_lt_join],
12330[m4_if([$#$2], [2], [],
12331       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
12332
12333
12334# lt_car(LIST)
12335# lt_cdr(LIST)
12336# ------------
12337# Manipulate m4 lists.
12338# These macros are necessary as long as will still need to support
12339# Autoconf-2.59, which quotes differently.
12340m4_define([lt_car], [[$1]])
12341m4_define([lt_cdr],
12342[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
12343       [$#], 1, [],
12344       [m4_dquote(m4_shift($@))])])
12345m4_define([lt_unquote], $1)
12346
12347
12348# lt_append(MACRO-NAME, STRING, [SEPARATOR])
12349# ------------------------------------------
12350# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
12351# Note that neither SEPARATOR nor STRING are expanded; they are appended
12352# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
12353# No SEPARATOR is output if MACRO-NAME was previously undefined (different
12354# than defined and empty).
12355#
12356# This macro is needed until we can rely on Autoconf 2.62, since earlier
12357# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
12358m4_define([lt_append],
12359[m4_define([$1],
12360	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
12361
12362
12363
12364# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
12365# ----------------------------------------------------------
12366# Produce a SEP delimited list of all paired combinations of elements of
12367# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
12368# has the form PREFIXmINFIXSUFFIXn.
12369# Needed until we can rely on m4_combine added in Autoconf 2.62.
12370m4_define([lt_combine],
12371[m4_if(m4_eval([$# > 3]), [1],
12372       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
12373[[m4_foreach([_Lt_prefix], [$2],
12374	     [m4_foreach([_Lt_suffix],
12375		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
12376	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
12377
12378
12379# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
12380# -----------------------------------------------------------------------
12381# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
12382# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
12383m4_define([lt_if_append_uniq],
12384[m4_ifdef([$1],
12385	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
12386		 [lt_append([$1], [$2], [$3])$4],
12387		 [$5])],
12388	  [lt_append([$1], [$2], [$3])$4])])
12389
12390
12391# lt_dict_add(DICT, KEY, VALUE)
12392# -----------------------------
12393m4_define([lt_dict_add],
12394[m4_define([$1($2)], [$3])])
12395
12396
12397# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
12398# --------------------------------------------
12399m4_define([lt_dict_add_subkey],
12400[m4_define([$1($2:$3)], [$4])])
12401
12402
12403# lt_dict_fetch(DICT, KEY, [SUBKEY])
12404# ----------------------------------
12405m4_define([lt_dict_fetch],
12406[m4_ifval([$3],
12407	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
12408    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
12409
12410
12411# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
12412# -----------------------------------------------------------------
12413m4_define([lt_if_dict_fetch],
12414[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
12415	[$5],
12416    [$6])])
12417
12418
12419# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
12420# --------------------------------------------------------------
12421m4_define([lt_dict_filter],
12422[m4_if([$5], [], [],
12423  [lt_join(m4_quote(m4_default([$4], [[, ]])),
12424           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
12425		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
12426])
12427
12428# ltversion.m4 -- version numbers			-*- Autoconf -*-
12429#
12430#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
12431#   Written by Scott James Remnant, 2004
12432#
12433# This file is free software; the Free Software Foundation gives
12434# unlimited permission to copy and/or distribute it, with or without
12435# modifications, as long as this notice is preserved.
12436
12437# @configure_input@
12438
12439# serial 4179 ltversion.m4
12440# This file is part of GNU Libtool
12441
12442m4_define([LT_PACKAGE_VERSION], [2.4.6])
12443m4_define([LT_PACKAGE_REVISION], [2.4.6])
12444
12445AC_DEFUN([LTVERSION_VERSION],
12446[macro_version='2.4.6'
12447macro_revision='2.4.6'
12448_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
12449_LT_DECL(, macro_revision, 0)
12450])
12451
12452# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
12453#
12454#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
12455#   Foundation, Inc.
12456#   Written by Scott James Remnant, 2004.
12457#
12458# This file is free software; the Free Software Foundation gives
12459# unlimited permission to copy and/or distribute it, with or without
12460# modifications, as long as this notice is preserved.
12461
12462# serial 5 lt~obsolete.m4
12463
12464# These exist entirely to fool aclocal when bootstrapping libtool.
12465#
12466# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
12467# which have later been changed to m4_define as they aren't part of the
12468# exported API, or moved to Autoconf or Automake where they belong.
12469#
12470# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
12471# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
12472# using a macro with the same name in our local m4/libtool.m4 it'll
12473# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
12474# and doesn't know about Autoconf macros at all.)
12475#
12476# So we provide this file, which has a silly filename so it's always
12477# included after everything else.  This provides aclocal with the
12478# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
12479# because those macros already exist, or will be overwritten later.
12480# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
12481#
12482# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
12483# Yes, that means every name once taken will need to remain here until
12484# we give up compatibility with versions before 1.7, at which point
12485# we need to keep only those names which we still refer to.
12486
12487# This is to help aclocal find these macros, as it can't see m4_define.
12488AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
12489
12490m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
12491m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
12492m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
12493m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
12494m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
12495m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
12496m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
12497m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
12498m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
12499m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
12500m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
12501m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
12502m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
12503m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
12504m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
12505m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
12506m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
12507m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
12508m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
12509m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
12510m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
12511m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
12512m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
12513m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
12514m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
12515m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
12516m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
12517m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
12518m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
12519m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
12520m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
12521m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
12522m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
12523m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
12524m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
12525m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
12526m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
12527m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
12528m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
12529m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
12530m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
12531m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
12532m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
12533m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
12534m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
12535m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
12536m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
12537m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
12538m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
12539m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
12540m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
12541m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
12542m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
12543m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
12544m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
12545m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
12546m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
12547m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
12548m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
12549m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
12550m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
12551
12552