aclocal.m4 revision e6d5e4e0
1# generated automatically by aclocal 1.13.2 -*- Autoconf -*-
2
3# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15m4_ifndef([AC_AUTOCONF_VERSION],
16  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18[m4_warning([this file was generated for autoconf 2.68.
19You have another version of autoconf.  It may work, but is not guaranteed to.
20If you have problems, you may need to regenerate the build system entirely.
21To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22
23# Copyright (C) 2002-2013 Free Software Foundation, Inc.
24#
25# This file is free software; the Free Software Foundation
26# gives unlimited permission to copy and/or distribute it,
27# with or without modifications, as long as this notice is preserved.
28
29# AM_AUTOMAKE_VERSION(VERSION)
30# ----------------------------
31# Automake X.Y traces this macro to ensure aclocal.m4 has been
32# generated from the m4 files accompanying Automake X.Y.
33# (This private macro should not be called outside this file.)
34AC_DEFUN([AM_AUTOMAKE_VERSION],
35[am__api_version='1.13'
36dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37dnl require some minimum version.  Point them to the right macro.
38m4_if([$1], [1.13.2], [],
39      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40])
41
42# _AM_AUTOCONF_VERSION(VERSION)
43# -----------------------------
44# aclocal traces this macro to find the Autoconf version.
45# This is a private macro too.  Using m4_define simplifies
46# the logic in aclocal, which can simply ignore this definition.
47m4_define([_AM_AUTOCONF_VERSION], [])
48
49# AM_SET_CURRENT_AUTOMAKE_VERSION
50# -------------------------------
51# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54[AM_AUTOMAKE_VERSION([1.13.2])dnl
55m4_ifndef([AC_AUTOCONF_VERSION],
56  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58
59# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60
61# Copyright (C) 2001-2013 Free Software Foundation, Inc.
62#
63# This file is free software; the Free Software Foundation
64# gives unlimited permission to copy and/or distribute it,
65# with or without modifications, as long as this notice is preserved.
66
67# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70#
71# Of course, Automake must honor this variable whenever it calls a
72# tool from the auxiliary directory.  The problem is that $srcdir (and
73# therefore $ac_aux_dir as well) can be either absolute or relative,
74# depending on how configure is run.  This is pretty annoying, since
75# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76# source directory, any form will work fine, but in subdirectories a
77# relative path needs to be adjusted first.
78#
79# $ac_aux_dir/missing
80#    fails when called from a subdirectory if $ac_aux_dir is relative
81# $top_srcdir/$ac_aux_dir/missing
82#    fails if $ac_aux_dir is absolute,
83#    fails when called from a subdirectory in a VPATH build with
84#          a relative $ac_aux_dir
85#
86# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87# are both prefixed by $srcdir.  In an in-source build this is usually
88# harmless because $srcdir is '.', but things will broke when you
89# start a VPATH build or use an absolute $srcdir.
90#
91# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94# and then we would define $MISSING as
95#   MISSING="\${SHELL} $am_aux_dir/missing"
96# This will work as long as MISSING is not called from configure, because
97# unfortunately $(top_srcdir) has no meaning in configure.
98# However there are other variables, like CC, which are often used in
99# configure, and could therefore not use this "fixed" $ac_aux_dir.
100#
101# Another solution, used here, is to always expand $ac_aux_dir to an
102# absolute PATH.  The drawback is that using absolute paths prevent a
103# configured tree to be moved without reconfiguration.
104
105AC_DEFUN([AM_AUX_DIR_EXPAND],
106[dnl Rely on autoconf to set up CDPATH properly.
107AC_PREREQ([2.50])dnl
108# expand $ac_aux_dir to an absolute path
109am_aux_dir=`cd $ac_aux_dir && pwd`
110])
111
112# AM_CONDITIONAL                                            -*- Autoconf -*-
113
114# Copyright (C) 1997-2013 Free Software Foundation, Inc.
115#
116# This file is free software; the Free Software Foundation
117# gives unlimited permission to copy and/or distribute it,
118# with or without modifications, as long as this notice is preserved.
119
120# AM_CONDITIONAL(NAME, SHELL-CONDITION)
121# -------------------------------------
122# Define a conditional.
123AC_DEFUN([AM_CONDITIONAL],
124[AC_PREREQ([2.52])dnl
125 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
126       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
127AC_SUBST([$1_TRUE])dnl
128AC_SUBST([$1_FALSE])dnl
129_AM_SUBST_NOTMAKE([$1_TRUE])dnl
130_AM_SUBST_NOTMAKE([$1_FALSE])dnl
131m4_define([_AM_COND_VALUE_$1], [$2])dnl
132if $2; then
133  $1_TRUE=
134  $1_FALSE='#'
135else
136  $1_TRUE='#'
137  $1_FALSE=
138fi
139AC_CONFIG_COMMANDS_PRE(
140[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
141  AC_MSG_ERROR([[conditional "$1" was never defined.
142Usually this means the macro was only invoked conditionally.]])
143fi])])
144
145# Copyright (C) 1999-2013 Free Software Foundation, Inc.
146#
147# This file is free software; the Free Software Foundation
148# gives unlimited permission to copy and/or distribute it,
149# with or without modifications, as long as this notice is preserved.
150
151
152# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
153# written in clear, in which case automake, when reading aclocal.m4,
154# will think it sees a *use*, and therefore will trigger all it's
155# C support machinery.  Also note that it means that autoscan, seeing
156# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
157
158
159# _AM_DEPENDENCIES(NAME)
160# ----------------------
161# See how the compiler implements dependency checking.
162# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
163# We try a few techniques and use that to set a single cache variable.
164#
165# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
166# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
167# dependency, and given that the user is not expected to run this macro,
168# just rely on AC_PROG_CC.
169AC_DEFUN([_AM_DEPENDENCIES],
170[AC_REQUIRE([AM_SET_DEPDIR])dnl
171AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
172AC_REQUIRE([AM_MAKE_INCLUDE])dnl
173AC_REQUIRE([AM_DEP_TRACK])dnl
174
175m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
176      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
177      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
178      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
179      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
180      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
181                    [depcc="$$1"   am_compiler_list=])
182
183AC_CACHE_CHECK([dependency style of $depcc],
184               [am_cv_$1_dependencies_compiler_type],
185[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
186  # We make a subdir and do the tests there.  Otherwise we can end up
187  # making bogus files that we don't know about and never remove.  For
188  # instance it was reported that on HP-UX the gcc test will end up
189  # making a dummy file named 'D' -- because '-MD' means "put the output
190  # in D".
191  rm -rf conftest.dir
192  mkdir conftest.dir
193  # Copy depcomp to subdir because otherwise we won't find it if we're
194  # using a relative directory.
195  cp "$am_depcomp" conftest.dir
196  cd conftest.dir
197  # We will build objects and dependencies in a subdirectory because
198  # it helps to detect inapplicable dependency modes.  For instance
199  # both Tru64's cc and ICC support -MD to output dependencies as a
200  # side effect of compilation, but ICC will put the dependencies in
201  # the current directory while Tru64 will put them in the object
202  # directory.
203  mkdir sub
204
205  am_cv_$1_dependencies_compiler_type=none
206  if test "$am_compiler_list" = ""; then
207     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
208  fi
209  am__universal=false
210  m4_case([$1], [CC],
211    [case " $depcc " in #(
212     *\ -arch\ *\ -arch\ *) am__universal=true ;;
213     esac],
214    [CXX],
215    [case " $depcc " in #(
216     *\ -arch\ *\ -arch\ *) am__universal=true ;;
217     esac])
218
219  for depmode in $am_compiler_list; do
220    # Setup a source with many dependencies, because some compilers
221    # like to wrap large dependency lists on column 80 (with \), and
222    # we should not choose a depcomp mode which is confused by this.
223    #
224    # We need to recreate these files for each test, as the compiler may
225    # overwrite some of them when testing with obscure command lines.
226    # This happens at least with the AIX C compiler.
227    : > sub/conftest.c
228    for i in 1 2 3 4 5 6; do
229      echo '#include "conftst'$i'.h"' >> sub/conftest.c
230      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
231      # Solaris 10 /bin/sh.
232      echo '/* dummy */' > sub/conftst$i.h
233    done
234    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
235
236    # We check with '-c' and '-o' for the sake of the "dashmstdout"
237    # mode.  It turns out that the SunPro C++ compiler does not properly
238    # handle '-M -o', and we need to detect this.  Also, some Intel
239    # versions had trouble with output in subdirs.
240    am__obj=sub/conftest.${OBJEXT-o}
241    am__minus_obj="-o $am__obj"
242    case $depmode in
243    gcc)
244      # This depmode causes a compiler race in universal mode.
245      test "$am__universal" = false || continue
246      ;;
247    nosideeffect)
248      # After this tag, mechanisms are not by side-effect, so they'll
249      # only be used when explicitly requested.
250      if test "x$enable_dependency_tracking" = xyes; then
251	continue
252      else
253	break
254      fi
255      ;;
256    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
257      # This compiler won't grok '-c -o', but also, the minuso test has
258      # not run yet.  These depmodes are late enough in the game, and
259      # so weak that their functioning should not be impacted.
260      am__obj=conftest.${OBJEXT-o}
261      am__minus_obj=
262      ;;
263    none) break ;;
264    esac
265    if depmode=$depmode \
266       source=sub/conftest.c object=$am__obj \
267       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
268       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
269         >/dev/null 2>conftest.err &&
270       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
271       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
272       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
273       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
274      # icc doesn't choke on unknown options, it will just issue warnings
275      # or remarks (even with -Werror).  So we grep stderr for any message
276      # that says an option was ignored or not supported.
277      # When given -MP, icc 7.0 and 7.1 complain thusly:
278      #   icc: Command line warning: ignoring option '-M'; no argument required
279      # The diagnosis changed in icc 8.0:
280      #   icc: Command line remark: option '-MP' not supported
281      if (grep 'ignoring option' conftest.err ||
282          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
283        am_cv_$1_dependencies_compiler_type=$depmode
284        break
285      fi
286    fi
287  done
288
289  cd ..
290  rm -rf conftest.dir
291else
292  am_cv_$1_dependencies_compiler_type=none
293fi
294])
295AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
296AM_CONDITIONAL([am__fastdep$1], [
297  test "x$enable_dependency_tracking" != xno \
298  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
299])
300
301
302# AM_SET_DEPDIR
303# -------------
304# Choose a directory name for dependency files.
305# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
306AC_DEFUN([AM_SET_DEPDIR],
307[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
308AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
309])
310
311
312# AM_DEP_TRACK
313# ------------
314AC_DEFUN([AM_DEP_TRACK],
315[AC_ARG_ENABLE([dependency-tracking], [dnl
316AS_HELP_STRING(
317  [--enable-dependency-tracking],
318  [do not reject slow dependency extractors])
319AS_HELP_STRING(
320  [--disable-dependency-tracking],
321  [speeds up one-time build])])
322if test "x$enable_dependency_tracking" != xno; then
323  am_depcomp="$ac_aux_dir/depcomp"
324  AMDEPBACKSLASH='\'
325  am__nodep='_no'
326fi
327AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
328AC_SUBST([AMDEPBACKSLASH])dnl
329_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
330AC_SUBST([am__nodep])dnl
331_AM_SUBST_NOTMAKE([am__nodep])dnl
332])
333
334# Generate code to set up dependency tracking.              -*- Autoconf -*-
335
336# Copyright (C) 1999-2013 Free Software Foundation, Inc.
337#
338# This file is free software; the Free Software Foundation
339# gives unlimited permission to copy and/or distribute it,
340# with or without modifications, as long as this notice is preserved.
341
342
343# _AM_OUTPUT_DEPENDENCY_COMMANDS
344# ------------------------------
345AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
346[{
347  # Older Autoconf quotes --file arguments for eval, but not when files
348  # are listed without --file.  Let's play safe and only enable the eval
349  # if we detect the quoting.
350  case $CONFIG_FILES in
351  *\'*) eval set x "$CONFIG_FILES" ;;
352  *)   set x $CONFIG_FILES ;;
353  esac
354  shift
355  for mf
356  do
357    # Strip MF so we end up with the name of the file.
358    mf=`echo "$mf" | sed -e 's/:.*$//'`
359    # Check whether this is an Automake generated Makefile or not.
360    # We used to match only the files named 'Makefile.in', but
361    # some people rename them; so instead we look at the file content.
362    # Grep'ing the first line is not enough: some people post-process
363    # each Makefile.in and add a new line on top of each file to say so.
364    # Grep'ing the whole file is not good either: AIX grep has a line
365    # limit of 2048, but all sed's we know have understand at least 4000.
366    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
367      dirpart=`AS_DIRNAME("$mf")`
368    else
369      continue
370    fi
371    # Extract the definition of DEPDIR, am__include, and am__quote
372    # from the Makefile without running 'make'.
373    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
374    test -z "$DEPDIR" && continue
375    am__include=`sed -n 's/^am__include = //p' < "$mf"`
376    test -z "$am__include" && continue
377    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
378    # Find all dependency output files, they are included files with
379    # $(DEPDIR) in their names.  We invoke sed twice because it is the
380    # simplest approach to changing $(DEPDIR) to its actual value in the
381    # expansion.
382    for file in `sed -n "
383      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
384	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
385      # Make sure the directory exists.
386      test -f "$dirpart/$file" && continue
387      fdir=`AS_DIRNAME(["$file"])`
388      AS_MKDIR_P([$dirpart/$fdir])
389      # echo "creating $dirpart/$file"
390      echo '# dummy' > "$dirpart/$file"
391    done
392  done
393}
394])# _AM_OUTPUT_DEPENDENCY_COMMANDS
395
396
397# AM_OUTPUT_DEPENDENCY_COMMANDS
398# -----------------------------
399# This macro should only be invoked once -- use via AC_REQUIRE.
400#
401# This code is only required when automatic dependency tracking
402# is enabled.  FIXME.  This creates each '.P' file that we will
403# need in order to bootstrap the dependency handling code.
404AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
405[AC_CONFIG_COMMANDS([depfiles],
406     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
407     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
408])
409
410# Do all the work for Automake.                             -*- Autoconf -*-
411
412# Copyright (C) 1996-2013 Free Software Foundation, Inc.
413#
414# This file is free software; the Free Software Foundation
415# gives unlimited permission to copy and/or distribute it,
416# with or without modifications, as long as this notice is preserved.
417
418# This macro actually does too much.  Some checks are only needed if
419# your package does certain things.  But this isn't really a big deal.
420
421# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
422# AM_INIT_AUTOMAKE([OPTIONS])
423# -----------------------------------------------
424# The call with PACKAGE and VERSION arguments is the old style
425# call (pre autoconf-2.50), which is being phased out.  PACKAGE
426# and VERSION should now be passed to AC_INIT and removed from
427# the call to AM_INIT_AUTOMAKE.
428# We support both call styles for the transition.  After
429# the next Automake release, Autoconf can make the AC_INIT
430# arguments mandatory, and then we can depend on a new Autoconf
431# release and drop the old call support.
432AC_DEFUN([AM_INIT_AUTOMAKE],
433[AC_PREREQ([2.65])dnl
434dnl Autoconf wants to disallow AM_ names.  We explicitly allow
435dnl the ones we care about.
436m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
437AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
438AC_REQUIRE([AC_PROG_INSTALL])dnl
439if test "`cd $srcdir && pwd`" != "`pwd`"; then
440  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
441  # is not polluted with repeated "-I."
442  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
443  # test to see if srcdir already configured
444  if test -f $srcdir/config.status; then
445    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
446  fi
447fi
448
449# test whether we have cygpath
450if test -z "$CYGPATH_W"; then
451  if (cygpath --version) >/dev/null 2>/dev/null; then
452    CYGPATH_W='cygpath -w'
453  else
454    CYGPATH_W=echo
455  fi
456fi
457AC_SUBST([CYGPATH_W])
458
459# Define the identity of the package.
460dnl Distinguish between old-style and new-style calls.
461m4_ifval([$2],
462[AC_DIAGNOSE([obsolete],
463             [$0: two- and three-arguments forms are deprecated.])
464m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465 AC_SUBST([PACKAGE], [$1])dnl
466 AC_SUBST([VERSION], [$2])],
467[_AM_SET_OPTIONS([$1])dnl
468dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469m4_if(
470  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
471  [ok:ok],,
472  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
473 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
474 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
475
476_AM_IF_OPTION([no-define],,
477[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
478 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
479
480# Some tools Automake needs.
481AC_REQUIRE([AM_SANITY_CHECK])dnl
482AC_REQUIRE([AC_ARG_PROGRAM])dnl
483AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
484AM_MISSING_PROG([AUTOCONF], [autoconf])
485AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
486AM_MISSING_PROG([AUTOHEADER], [autoheader])
487AM_MISSING_PROG([MAKEINFO], [makeinfo])
488AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
489AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
490AC_REQUIRE([AC_PROG_MKDIR_P])dnl
491# For better backward compatibility.  To be removed once Automake 1.9.x
492# dies out for good.  For more background, see:
493# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
494# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
495AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
496# We need awk for the "check" target.  The system "awk" is bad on
497# some platforms.
498AC_REQUIRE([AC_PROG_AWK])dnl
499AC_REQUIRE([AC_PROG_MAKE_SET])dnl
500AC_REQUIRE([AM_SET_LEADING_DOT])dnl
501_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
502	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
503			     [_AM_PROG_TAR([v7])])])
504_AM_IF_OPTION([no-dependencies],,
505[AC_PROVIDE_IFELSE([AC_PROG_CC],
506		  [_AM_DEPENDENCIES([CC])],
507		  [m4_define([AC_PROG_CC],
508			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
509AC_PROVIDE_IFELSE([AC_PROG_CXX],
510		  [_AM_DEPENDENCIES([CXX])],
511		  [m4_define([AC_PROG_CXX],
512			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
513AC_PROVIDE_IFELSE([AC_PROG_OBJC],
514		  [_AM_DEPENDENCIES([OBJC])],
515		  [m4_define([AC_PROG_OBJC],
516			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
517AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
518		  [_AM_DEPENDENCIES([OBJCXX])],
519		  [m4_define([AC_PROG_OBJCXX],
520			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
521])
522AC_REQUIRE([AM_SILENT_RULES])dnl
523dnl The testsuite driver may need to know about EXEEXT, so add the
524dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
525dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
526AC_CONFIG_COMMANDS_PRE(dnl
527[m4_provide_if([_AM_COMPILER_EXEEXT],
528  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
529])
530
531dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
532dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
533dnl mangled by Autoconf and run in a shell conditional statement.
534m4_define([_AC_COMPILER_EXEEXT],
535m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
536
537
538# When config.status generates a header, we must update the stamp-h file.
539# This file resides in the same directory as the config header
540# that is generated.  The stamp files are numbered to have different names.
541
542# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
543# loop where config.status creates the headers, so we can generate
544# our stamp files there.
545AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
546[# Compute $1's index in $config_headers.
547_am_arg=$1
548_am_stamp_count=1
549for _am_header in $config_headers :; do
550  case $_am_header in
551    $_am_arg | $_am_arg:* )
552      break ;;
553    * )
554      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
555  esac
556done
557echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
558
559# Copyright (C) 2001-2013 Free Software Foundation, Inc.
560#
561# This file is free software; the Free Software Foundation
562# gives unlimited permission to copy and/or distribute it,
563# with or without modifications, as long as this notice is preserved.
564
565# AM_PROG_INSTALL_SH
566# ------------------
567# Define $install_sh.
568AC_DEFUN([AM_PROG_INSTALL_SH],
569[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
570if test x"${install_sh}" != xset; then
571  case $am_aux_dir in
572  *\ * | *\	*)
573    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
574  *)
575    install_sh="\${SHELL} $am_aux_dir/install-sh"
576  esac
577fi
578AC_SUBST([install_sh])])
579
580# Copyright (C) 2003-2013 Free Software Foundation, Inc.
581#
582# This file is free software; the Free Software Foundation
583# gives unlimited permission to copy and/or distribute it,
584# with or without modifications, as long as this notice is preserved.
585
586# Check whether the underlying file-system supports filenames
587# with a leading dot.  For instance MS-DOS doesn't.
588AC_DEFUN([AM_SET_LEADING_DOT],
589[rm -rf .tst 2>/dev/null
590mkdir .tst 2>/dev/null
591if test -d .tst; then
592  am__leading_dot=.
593else
594  am__leading_dot=_
595fi
596rmdir .tst 2>/dev/null
597AC_SUBST([am__leading_dot])])
598
599# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
600# From Jim Meyering
601
602# Copyright (C) 1996-2013 Free Software Foundation, Inc.
603#
604# This file is free software; the Free Software Foundation
605# gives unlimited permission to copy and/or distribute it,
606# with or without modifications, as long as this notice is preserved.
607
608# AM_MAINTAINER_MODE([DEFAULT-MODE])
609# ----------------------------------
610# Control maintainer-specific portions of Makefiles.
611# Default is to disable them, unless 'enable' is passed literally.
612# For symmetry, 'disable' may be passed as well.  Anyway, the user
613# can override the default with the --enable/--disable switch.
614AC_DEFUN([AM_MAINTAINER_MODE],
615[m4_case(m4_default([$1], [disable]),
616       [enable], [m4_define([am_maintainer_other], [disable])],
617       [disable], [m4_define([am_maintainer_other], [enable])],
618       [m4_define([am_maintainer_other], [enable])
619        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
620AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
621  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
622  AC_ARG_ENABLE([maintainer-mode],
623    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
624      am_maintainer_other[ make rules and dependencies not useful
625      (and sometimes confusing) to the casual installer])],
626    [USE_MAINTAINER_MODE=$enableval],
627    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
628  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
629  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
630  MAINT=$MAINTAINER_MODE_TRUE
631  AC_SUBST([MAINT])dnl
632]
633)
634
635# Check to see how 'make' treats includes.	            -*- Autoconf -*-
636
637# Copyright (C) 2001-2013 Free Software Foundation, Inc.
638#
639# This file is free software; the Free Software Foundation
640# gives unlimited permission to copy and/or distribute it,
641# with or without modifications, as long as this notice is preserved.
642
643# AM_MAKE_INCLUDE()
644# -----------------
645# Check to see how make treats includes.
646AC_DEFUN([AM_MAKE_INCLUDE],
647[am_make=${MAKE-make}
648cat > confinc << 'END'
649am__doit:
650	@echo this is the am__doit target
651.PHONY: am__doit
652END
653# If we don't find an include directive, just comment out the code.
654AC_MSG_CHECKING([for style of include used by $am_make])
655am__include="#"
656am__quote=
657_am_result=none
658# First try GNU make style include.
659echo "include confinc" > confmf
660# Ignore all kinds of additional output from 'make'.
661case `$am_make -s -f confmf 2> /dev/null` in #(
662*the\ am__doit\ target*)
663  am__include=include
664  am__quote=
665  _am_result=GNU
666  ;;
667esac
668# Now try BSD make style include.
669if test "$am__include" = "#"; then
670   echo '.include "confinc"' > confmf
671   case `$am_make -s -f confmf 2> /dev/null` in #(
672   *the\ am__doit\ target*)
673     am__include=.include
674     am__quote="\""
675     _am_result=BSD
676     ;;
677   esac
678fi
679AC_SUBST([am__include])
680AC_SUBST([am__quote])
681AC_MSG_RESULT([$_am_result])
682rm -f confinc confmf
683])
684
685# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
686
687# Copyright (C) 1997-2013 Free Software Foundation, Inc.
688#
689# This file is free software; the Free Software Foundation
690# gives unlimited permission to copy and/or distribute it,
691# with or without modifications, as long as this notice is preserved.
692
693# AM_MISSING_PROG(NAME, PROGRAM)
694# ------------------------------
695AC_DEFUN([AM_MISSING_PROG],
696[AC_REQUIRE([AM_MISSING_HAS_RUN])
697$1=${$1-"${am_missing_run}$2"}
698AC_SUBST($1)])
699
700# AM_MISSING_HAS_RUN
701# ------------------
702# Define MISSING if not defined so far and test if it is modern enough.
703# If it is, set am_missing_run to use it, otherwise, to nothing.
704AC_DEFUN([AM_MISSING_HAS_RUN],
705[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
706AC_REQUIRE_AUX_FILE([missing])dnl
707if test x"${MISSING+set}" != xset; then
708  case $am_aux_dir in
709  *\ * | *\	*)
710    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
711  *)
712    MISSING="\${SHELL} $am_aux_dir/missing" ;;
713  esac
714fi
715# Use eval to expand $SHELL
716if eval "$MISSING --is-lightweight"; then
717  am_missing_run="$MISSING "
718else
719  am_missing_run=
720  AC_MSG_WARN(['missing' script is too old or missing])
721fi
722])
723
724# Helper functions for option handling.                     -*- Autoconf -*-
725
726# Copyright (C) 2001-2013 Free Software Foundation, Inc.
727#
728# This file is free software; the Free Software Foundation
729# gives unlimited permission to copy and/or distribute it,
730# with or without modifications, as long as this notice is preserved.
731
732# _AM_MANGLE_OPTION(NAME)
733# -----------------------
734AC_DEFUN([_AM_MANGLE_OPTION],
735[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
736
737# _AM_SET_OPTION(NAME)
738# --------------------
739# Set option NAME.  Presently that only means defining a flag for this option.
740AC_DEFUN([_AM_SET_OPTION],
741[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
742
743# _AM_SET_OPTIONS(OPTIONS)
744# ------------------------
745# OPTIONS is a space-separated list of Automake options.
746AC_DEFUN([_AM_SET_OPTIONS],
747[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
748
749# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
750# -------------------------------------------
751# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
752AC_DEFUN([_AM_IF_OPTION],
753[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
754
755# Check to make sure that the build environment is sane.    -*- Autoconf -*-
756
757# Copyright (C) 1996-2013 Free Software Foundation, Inc.
758#
759# This file is free software; the Free Software Foundation
760# gives unlimited permission to copy and/or distribute it,
761# with or without modifications, as long as this notice is preserved.
762
763# AM_SANITY_CHECK
764# ---------------
765AC_DEFUN([AM_SANITY_CHECK],
766[AC_MSG_CHECKING([whether build environment is sane])
767# Reject unsafe characters in $srcdir or the absolute working directory
768# name.  Accept space and tab only in the latter.
769am_lf='
770'
771case `pwd` in
772  *[[\\\"\#\$\&\'\`$am_lf]]*)
773    AC_MSG_ERROR([unsafe absolute working directory name]);;
774esac
775case $srcdir in
776  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
777    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
778esac
779
780# Do 'set' in a subshell so we don't clobber the current shell's
781# arguments.  Must try -L first in case configure is actually a
782# symlink; some systems play weird games with the mod time of symlinks
783# (eg FreeBSD returns the mod time of the symlink's containing
784# directory).
785if (
786   am_has_slept=no
787   for am_try in 1 2; do
788     echo "timestamp, slept: $am_has_slept" > conftest.file
789     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
790     if test "$[*]" = "X"; then
791	# -L didn't work.
792	set X `ls -t "$srcdir/configure" conftest.file`
793     fi
794     if test "$[*]" != "X $srcdir/configure conftest.file" \
795	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
796
797	# If neither matched, then we have a broken ls.  This can happen
798	# if, for instance, CONFIG_SHELL is bash and it inherits a
799	# broken ls alias from the environment.  This has actually
800	# happened.  Such a system could not be considered "sane".
801	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
802  alias in your environment])
803     fi
804     if test "$[2]" = conftest.file || test $am_try -eq 2; then
805       break
806     fi
807     # Just in case.
808     sleep 1
809     am_has_slept=yes
810   done
811   test "$[2]" = conftest.file
812   )
813then
814   # Ok.
815   :
816else
817   AC_MSG_ERROR([newly created file is older than distributed files!
818Check your system clock])
819fi
820AC_MSG_RESULT([yes])
821# If we didn't sleep, we still need to ensure time stamps of config.status and
822# generated files are strictly newer.
823am_sleep_pid=
824if grep 'slept: no' conftest.file >/dev/null 2>&1; then
825  ( sleep 1 ) &
826  am_sleep_pid=$!
827fi
828AC_CONFIG_COMMANDS_PRE(
829  [AC_MSG_CHECKING([that generated files are newer than configure])
830   if test -n "$am_sleep_pid"; then
831     # Hide warnings about reused PIDs.
832     wait $am_sleep_pid 2>/dev/null
833   fi
834   AC_MSG_RESULT([done])])
835rm -f conftest.file
836])
837
838# Copyright (C) 2009-2013 Free Software Foundation, Inc.
839#
840# This file is free software; the Free Software Foundation
841# gives unlimited permission to copy and/or distribute it,
842# with or without modifications, as long as this notice is preserved.
843
844# AM_SILENT_RULES([DEFAULT])
845# --------------------------
846# Enable less verbose build rules; with the default set to DEFAULT
847# ("yes" being less verbose, "no" or empty being verbose).
848AC_DEFUN([AM_SILENT_RULES],
849[AC_ARG_ENABLE([silent-rules], [dnl
850AS_HELP_STRING(
851  [--enable-silent-rules],
852  [less verbose build output (undo: "make V=1")])
853AS_HELP_STRING(
854  [--disable-silent-rules],
855  [verbose build output (undo: "make V=0")])dnl
856])
857case $enable_silent_rules in @%:@ (((
858  yes) AM_DEFAULT_VERBOSITY=0;;
859   no) AM_DEFAULT_VERBOSITY=1;;
860    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
861esac
862dnl
863dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
864dnl do not support nested variable expansions.
865dnl See automake bug#9928 and bug#10237.
866am_make=${MAKE-make}
867AC_CACHE_CHECK([whether $am_make supports nested variables],
868   [am_cv_make_support_nested_variables],
869   [if AS_ECHO([['TRUE=$(BAR$(V))
870BAR0=false
871BAR1=true
872V=1
873am__doit:
874	@$(TRUE)
875.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
876  am_cv_make_support_nested_variables=yes
877else
878  am_cv_make_support_nested_variables=no
879fi])
880if test $am_cv_make_support_nested_variables = yes; then
881  dnl Using '$V' instead of '$(V)' breaks IRIX make.
882  AM_V='$(V)'
883  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
884else
885  AM_V=$AM_DEFAULT_VERBOSITY
886  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
887fi
888AC_SUBST([AM_V])dnl
889AM_SUBST_NOTMAKE([AM_V])dnl
890AC_SUBST([AM_DEFAULT_V])dnl
891AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
892AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
893AM_BACKSLASH='\'
894AC_SUBST([AM_BACKSLASH])dnl
895_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
896])
897
898# Copyright (C) 2001-2013 Free Software Foundation, Inc.
899#
900# This file is free software; the Free Software Foundation
901# gives unlimited permission to copy and/or distribute it,
902# with or without modifications, as long as this notice is preserved.
903
904# AM_PROG_INSTALL_STRIP
905# ---------------------
906# One issue with vendor 'install' (even GNU) is that you can't
907# specify the program used to strip binaries.  This is especially
908# annoying in cross-compiling environments, where the build's strip
909# is unlikely to handle the host's binaries.
910# Fortunately install-sh will honor a STRIPPROG variable, so we
911# always use install-sh in "make install-strip", and initialize
912# STRIPPROG with the value of the STRIP variable (set by the user).
913AC_DEFUN([AM_PROG_INSTALL_STRIP],
914[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
915# Installed binaries are usually stripped using 'strip' when the user
916# run "make install-strip".  However 'strip' might not be the right
917# tool to use in cross-compilation environments, therefore Automake
918# will honor the 'STRIP' environment variable to overrule this program.
919dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
920if test "$cross_compiling" != no; then
921  AC_CHECK_TOOL([STRIP], [strip], :)
922fi
923INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
924AC_SUBST([INSTALL_STRIP_PROGRAM])])
925
926# Copyright (C) 2006-2013 Free Software Foundation, Inc.
927#
928# This file is free software; the Free Software Foundation
929# gives unlimited permission to copy and/or distribute it,
930# with or without modifications, as long as this notice is preserved.
931
932# _AM_SUBST_NOTMAKE(VARIABLE)
933# ---------------------------
934# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
935# This macro is traced by Automake.
936AC_DEFUN([_AM_SUBST_NOTMAKE])
937
938# AM_SUBST_NOTMAKE(VARIABLE)
939# --------------------------
940# Public sister of _AM_SUBST_NOTMAKE.
941AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
942
943# Check how to create a tarball.                            -*- Autoconf -*-
944
945# Copyright (C) 2004-2013 Free Software Foundation, Inc.
946#
947# This file is free software; the Free Software Foundation
948# gives unlimited permission to copy and/or distribute it,
949# with or without modifications, as long as this notice is preserved.
950
951# _AM_PROG_TAR(FORMAT)
952# --------------------
953# Check how to create a tarball in format FORMAT.
954# FORMAT should be one of 'v7', 'ustar', or 'pax'.
955#
956# Substitute a variable $(am__tar) that is a command
957# writing to stdout a FORMAT-tarball containing the directory
958# $tardir.
959#     tardir=directory && $(am__tar) > result.tar
960#
961# Substitute a variable $(am__untar) that extract such
962# a tarball read from stdin.
963#     $(am__untar) < result.tar
964#
965AC_DEFUN([_AM_PROG_TAR],
966[# Always define AMTAR for backward compatibility.  Yes, it's still used
967# in the wild :-(  We should find a proper way to deprecate it ...
968AC_SUBST([AMTAR], ['$${TAR-tar}'])
969
970# We'll loop over all known methods to create a tar archive until one works.
971_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
972
973m4_if([$1], [v7],
974  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
975
976  [m4_case([$1],
977    [ustar],
978     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
979      # There is notably a 21 bits limit for the UID and the GID.  In fact,
980      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
981      # and bug#13588).
982      am_max_uid=2097151 # 2^21 - 1
983      am_max_gid=$am_max_uid
984      # The $UID and $GID variables are not portable, so we need to resort
985      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
986      # below are definitely unexpected, so allow the users to see them
987      # (that is, avoid stderr redirection).
988      am_uid=`id -u || echo unknown`
989      am_gid=`id -g || echo unknown`
990      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
991      if test $am_uid -le $am_max_uid; then
992         AC_MSG_RESULT([yes])
993      else
994         AC_MSG_RESULT([no])
995         _am_tools=none
996      fi
997      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
998      if test $am_gid -le $am_max_gid; then
999         AC_MSG_RESULT([yes])
1000      else
1001        AC_MSG_RESULT([no])
1002        _am_tools=none
1003      fi],
1004
1005  [pax],
1006    [],
1007
1008  [m4_fatal([Unknown tar format])])
1009
1010  AC_MSG_CHECKING([how to create a $1 tar archive])
1011
1012  # Go ahead even if we have the value already cached.  We do so because we
1013  # need to set the values for the 'am__tar' and 'am__untar' variables.
1014  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1015
1016  for _am_tool in $_am_tools; do
1017    case $_am_tool in
1018    gnutar)
1019      for _am_tar in tar gnutar gtar; do
1020        AM_RUN_LOG([$_am_tar --version]) && break
1021      done
1022      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1023      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1024      am__untar="$_am_tar -xf -"
1025      ;;
1026    plaintar)
1027      # Must skip GNU tar: if it does not support --format= it doesn't create
1028      # ustar tarball either.
1029      (tar --version) >/dev/null 2>&1 && continue
1030      am__tar='tar chf - "$$tardir"'
1031      am__tar_='tar chf - "$tardir"'
1032      am__untar='tar xf -'
1033      ;;
1034    pax)
1035      am__tar='pax -L -x $1 -w "$$tardir"'
1036      am__tar_='pax -L -x $1 -w "$tardir"'
1037      am__untar='pax -r'
1038      ;;
1039    cpio)
1040      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1041      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1042      am__untar='cpio -i -H $1 -d'
1043      ;;
1044    none)
1045      am__tar=false
1046      am__tar_=false
1047      am__untar=false
1048      ;;
1049    esac
1050
1051    # If the value was cached, stop now.  We just wanted to have am__tar
1052    # and am__untar set.
1053    test -n "${am_cv_prog_tar_$1}" && break
1054
1055    # tar/untar a dummy directory, and stop if the command works.
1056    rm -rf conftest.dir
1057    mkdir conftest.dir
1058    echo GrepMe > conftest.dir/file
1059    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1060    rm -rf conftest.dir
1061    if test -s conftest.tar; then
1062      AM_RUN_LOG([$am__untar <conftest.tar])
1063      AM_RUN_LOG([cat conftest.dir/file])
1064      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1065    fi
1066  done
1067  rm -rf conftest.dir
1068
1069  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1070  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1071
1072AC_SUBST([am__tar])
1073AC_SUBST([am__untar])
1074]) # _AM_PROG_TAR
1075
1076# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1077#
1078#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1079#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1080#                 Foundation, Inc.
1081#   Written by Gordon Matzigkeit, 1996
1082#
1083# This file is free software; the Free Software Foundation gives
1084# unlimited permission to copy and/or distribute it, with or without
1085# modifications, as long as this notice is preserved.
1086
1087m4_define([_LT_COPYING], [dnl
1088#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1089#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1090#                 Foundation, Inc.
1091#   Written by Gordon Matzigkeit, 1996
1092#
1093#   This file is part of GNU Libtool.
1094#
1095# GNU Libtool is free software; you can redistribute it and/or
1096# modify it under the terms of the GNU General Public License as
1097# published by the Free Software Foundation; either version 2 of
1098# the License, or (at your option) any later version.
1099#
1100# As a special exception to the GNU General Public License,
1101# if you distribute this file as part of a program or library that
1102# is built using GNU Libtool, you may include this file under the
1103# same distribution terms that you use for the rest of that program.
1104#
1105# GNU Libtool is distributed in the hope that it will be useful,
1106# but WITHOUT ANY WARRANTY; without even the implied warranty of
1107# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1108# GNU General Public License for more details.
1109#
1110# You should have received a copy of the GNU General Public License
1111# along with GNU Libtool; see the file COPYING.  If not, a copy
1112# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1113# obtained by writing to the Free Software Foundation, Inc.,
1114# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1115])
1116
1117# serial 57 LT_INIT
1118
1119
1120# LT_PREREQ(VERSION)
1121# ------------------
1122# Complain and exit if this libtool version is less that VERSION.
1123m4_defun([LT_PREREQ],
1124[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1125       [m4_default([$3],
1126		   [m4_fatal([Libtool version $1 or higher is required],
1127		             63)])],
1128       [$2])])
1129
1130
1131# _LT_CHECK_BUILDDIR
1132# ------------------
1133# Complain if the absolute build directory name contains unusual characters
1134m4_defun([_LT_CHECK_BUILDDIR],
1135[case `pwd` in
1136  *\ * | *\	*)
1137    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1138esac
1139])
1140
1141
1142# LT_INIT([OPTIONS])
1143# ------------------
1144AC_DEFUN([LT_INIT],
1145[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1146AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1147AC_BEFORE([$0], [LT_LANG])dnl
1148AC_BEFORE([$0], [LT_OUTPUT])dnl
1149AC_BEFORE([$0], [LTDL_INIT])dnl
1150m4_require([_LT_CHECK_BUILDDIR])dnl
1151
1152dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1153m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1154m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1155dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1156dnl unless we require an AC_DEFUNed macro:
1157AC_REQUIRE([LTOPTIONS_VERSION])dnl
1158AC_REQUIRE([LTSUGAR_VERSION])dnl
1159AC_REQUIRE([LTVERSION_VERSION])dnl
1160AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1161m4_require([_LT_PROG_LTMAIN])dnl
1162
1163_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1164
1165dnl Parse OPTIONS
1166_LT_SET_OPTIONS([$0], [$1])
1167
1168# This can be used to rebuild libtool when needed
1169LIBTOOL_DEPS="$ltmain"
1170
1171# Always use our own libtool.
1172LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1173AC_SUBST(LIBTOOL)dnl
1174
1175_LT_SETUP
1176
1177# Only expand once:
1178m4_define([LT_INIT])
1179])# LT_INIT
1180
1181# Old names:
1182AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1183AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1184dnl aclocal-1.4 backwards compatibility:
1185dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1186dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1187
1188
1189# _LT_CC_BASENAME(CC)
1190# -------------------
1191# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1192m4_defun([_LT_CC_BASENAME],
1193[for cc_temp in $1""; do
1194  case $cc_temp in
1195    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1196    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1197    \-*) ;;
1198    *) break;;
1199  esac
1200done
1201cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1202])
1203
1204
1205# _LT_FILEUTILS_DEFAULTS
1206# ----------------------
1207# It is okay to use these file commands and assume they have been set
1208# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1209m4_defun([_LT_FILEUTILS_DEFAULTS],
1210[: ${CP="cp -f"}
1211: ${MV="mv -f"}
1212: ${RM="rm -f"}
1213])# _LT_FILEUTILS_DEFAULTS
1214
1215
1216# _LT_SETUP
1217# ---------
1218m4_defun([_LT_SETUP],
1219[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1220AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1221AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1222AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1223
1224_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1225dnl
1226_LT_DECL([], [host_alias], [0], [The host system])dnl
1227_LT_DECL([], [host], [0])dnl
1228_LT_DECL([], [host_os], [0])dnl
1229dnl
1230_LT_DECL([], [build_alias], [0], [The build system])dnl
1231_LT_DECL([], [build], [0])dnl
1232_LT_DECL([], [build_os], [0])dnl
1233dnl
1234AC_REQUIRE([AC_PROG_CC])dnl
1235AC_REQUIRE([LT_PATH_LD])dnl
1236AC_REQUIRE([LT_PATH_NM])dnl
1237dnl
1238AC_REQUIRE([AC_PROG_LN_S])dnl
1239test -z "$LN_S" && LN_S="ln -s"
1240_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1241dnl
1242AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1243_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1244_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1245dnl
1246m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1247m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1248m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1249m4_require([_LT_CMD_RELOAD])dnl
1250m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1251m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1252m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1253m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1254m4_require([_LT_WITH_SYSROOT])dnl
1255
1256_LT_CONFIG_LIBTOOL_INIT([
1257# See if we are running on zsh, and set the options which allow our
1258# commands through without removal of \ escapes INIT.
1259if test -n "\${ZSH_VERSION+set}" ; then
1260   setopt NO_GLOB_SUBST
1261fi
1262])
1263if test -n "${ZSH_VERSION+set}" ; then
1264   setopt NO_GLOB_SUBST
1265fi
1266
1267_LT_CHECK_OBJDIR
1268
1269m4_require([_LT_TAG_COMPILER])dnl
1270
1271case $host_os in
1272aix3*)
1273  # AIX sometimes has problems with the GCC collect2 program.  For some
1274  # reason, if we set the COLLECT_NAMES environment variable, the problems
1275  # vanish in a puff of smoke.
1276  if test "X${COLLECT_NAMES+set}" != Xset; then
1277    COLLECT_NAMES=
1278    export COLLECT_NAMES
1279  fi
1280  ;;
1281esac
1282
1283# Global variables:
1284ofile=libtool
1285can_build_shared=yes
1286
1287# All known linkers require a `.a' archive for static linking (except MSVC,
1288# which needs '.lib').
1289libext=a
1290
1291with_gnu_ld="$lt_cv_prog_gnu_ld"
1292
1293old_CC="$CC"
1294old_CFLAGS="$CFLAGS"
1295
1296# Set sane defaults for various variables
1297test -z "$CC" && CC=cc
1298test -z "$LTCC" && LTCC=$CC
1299test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1300test -z "$LD" && LD=ld
1301test -z "$ac_objext" && ac_objext=o
1302
1303_LT_CC_BASENAME([$compiler])
1304
1305# Only perform the check for file, if the check method requires it
1306test -z "$MAGIC_CMD" && MAGIC_CMD=file
1307case $deplibs_check_method in
1308file_magic*)
1309  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1310    _LT_PATH_MAGIC
1311  fi
1312  ;;
1313esac
1314
1315# Use C for the default configuration in the libtool script
1316LT_SUPPORTED_TAG([CC])
1317_LT_LANG_C_CONFIG
1318_LT_LANG_DEFAULT_CONFIG
1319_LT_CONFIG_COMMANDS
1320])# _LT_SETUP
1321
1322
1323# _LT_PREPARE_SED_QUOTE_VARS
1324# --------------------------
1325# Define a few sed substitution that help us do robust quoting.
1326m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1327[# Backslashify metacharacters that are still active within
1328# double-quoted strings.
1329sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1330
1331# Same as above, but do not quote variable references.
1332double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1333
1334# Sed substitution to delay expansion of an escaped shell variable in a
1335# double_quote_subst'ed string.
1336delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1337
1338# Sed substitution to delay expansion of an escaped single quote.
1339delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1340
1341# Sed substitution to avoid accidental globbing in evaled expressions
1342no_glob_subst='s/\*/\\\*/g'
1343])
1344
1345# _LT_PROG_LTMAIN
1346# ---------------
1347# Note that this code is called both from `configure', and `config.status'
1348# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1349# `config.status' has no value for ac_aux_dir unless we are using Automake,
1350# so we pass a copy along to make sure it has a sensible value anyway.
1351m4_defun([_LT_PROG_LTMAIN],
1352[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1353_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1354ltmain="$ac_aux_dir/ltmain.sh"
1355])# _LT_PROG_LTMAIN
1356
1357
1358
1359# So that we can recreate a full libtool script including additional
1360# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1361# in macros and then make a single call at the end using the `libtool'
1362# label.
1363
1364
1365# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1366# ----------------------------------------
1367# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1368m4_define([_LT_CONFIG_LIBTOOL_INIT],
1369[m4_ifval([$1],
1370          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1371                     [$1
1372])])])
1373
1374# Initialize.
1375m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1376
1377
1378# _LT_CONFIG_LIBTOOL([COMMANDS])
1379# ------------------------------
1380# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1381m4_define([_LT_CONFIG_LIBTOOL],
1382[m4_ifval([$1],
1383          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1384                     [$1
1385])])])
1386
1387# Initialize.
1388m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1389
1390
1391# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1392# -----------------------------------------------------
1393m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1394[_LT_CONFIG_LIBTOOL([$1])
1395_LT_CONFIG_LIBTOOL_INIT([$2])
1396])
1397
1398
1399# _LT_FORMAT_COMMENT([COMMENT])
1400# -----------------------------
1401# Add leading comment marks to the start of each line, and a trailing
1402# full-stop to the whole comment if one is not present already.
1403m4_define([_LT_FORMAT_COMMENT],
1404[m4_ifval([$1], [
1405m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1406              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1407)])
1408
1409
1410
1411
1412
1413# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1414# -------------------------------------------------------------------
1415# CONFIGNAME is the name given to the value in the libtool script.
1416# VARNAME is the (base) name used in the configure script.
1417# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1418# VARNAME.  Any other value will be used directly.
1419m4_define([_LT_DECL],
1420[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1421    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1422	[m4_ifval([$1], [$1], [$2])])
1423    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1424    m4_ifval([$4],
1425	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1426    lt_dict_add_subkey([lt_decl_dict], [$2],
1427	[tagged?], [m4_ifval([$5], [yes], [no])])])
1428])
1429
1430
1431# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1432# --------------------------------------------------------
1433m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1434
1435
1436# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1437# ------------------------------------------------
1438m4_define([lt_decl_tag_varnames],
1439[_lt_decl_filter([tagged?], [yes], $@)])
1440
1441
1442# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1443# ---------------------------------------------------------
1444m4_define([_lt_decl_filter],
1445[m4_case([$#],
1446  [0], [m4_fatal([$0: too few arguments: $#])],
1447  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1448  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1449  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1450  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1451])
1452
1453
1454# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1455# --------------------------------------------------
1456m4_define([lt_decl_quote_varnames],
1457[_lt_decl_filter([value], [1], $@)])
1458
1459
1460# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1461# ---------------------------------------------------
1462m4_define([lt_decl_dquote_varnames],
1463[_lt_decl_filter([value], [2], $@)])
1464
1465
1466# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1467# ---------------------------------------------------
1468m4_define([lt_decl_varnames_tagged],
1469[m4_assert([$# <= 2])dnl
1470_$0(m4_quote(m4_default([$1], [[, ]])),
1471    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1472    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1473m4_define([_lt_decl_varnames_tagged],
1474[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1475
1476
1477# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1478# ------------------------------------------------
1479m4_define([lt_decl_all_varnames],
1480[_$0(m4_quote(m4_default([$1], [[, ]])),
1481     m4_if([$2], [],
1482	   m4_quote(lt_decl_varnames),
1483	m4_quote(m4_shift($@))))[]dnl
1484])
1485m4_define([_lt_decl_all_varnames],
1486[lt_join($@, lt_decl_varnames_tagged([$1],
1487			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1488])
1489
1490
1491# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1492# ------------------------------------
1493# Quote a variable value, and forward it to `config.status' so that its
1494# declaration there will have the same value as in `configure'.  VARNAME
1495# must have a single quote delimited value for this to work.
1496m4_define([_LT_CONFIG_STATUS_DECLARE],
1497[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1498
1499
1500# _LT_CONFIG_STATUS_DECLARATIONS
1501# ------------------------------
1502# We delimit libtool config variables with single quotes, so when
1503# we write them to config.status, we have to be sure to quote all
1504# embedded single quotes properly.  In configure, this macro expands
1505# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1506#
1507#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1508m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1509[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1510    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1511
1512
1513# _LT_LIBTOOL_TAGS
1514# ----------------
1515# Output comment and list of tags supported by the script
1516m4_defun([_LT_LIBTOOL_TAGS],
1517[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1518available_tags="_LT_TAGS"dnl
1519])
1520
1521
1522# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1523# -----------------------------------
1524# Extract the dictionary values for VARNAME (optionally with TAG) and
1525# expand to a commented shell variable setting:
1526#
1527#    # Some comment about what VAR is for.
1528#    visible_name=$lt_internal_name
1529m4_define([_LT_LIBTOOL_DECLARE],
1530[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1531					   [description])))[]dnl
1532m4_pushdef([_libtool_name],
1533    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1534m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1535    [0], [_libtool_name=[$]$1],
1536    [1], [_libtool_name=$lt_[]$1],
1537    [2], [_libtool_name=$lt_[]$1],
1538    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1539m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1540])
1541
1542
1543# _LT_LIBTOOL_CONFIG_VARS
1544# -----------------------
1545# Produce commented declarations of non-tagged libtool config variables
1546# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1547# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1548# section) are produced by _LT_LIBTOOL_TAG_VARS.
1549m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1550[m4_foreach([_lt_var],
1551    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1552    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1553
1554
1555# _LT_LIBTOOL_TAG_VARS(TAG)
1556# -------------------------
1557m4_define([_LT_LIBTOOL_TAG_VARS],
1558[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1559    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1560
1561
1562# _LT_TAGVAR(VARNAME, [TAGNAME])
1563# ------------------------------
1564m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1565
1566
1567# _LT_CONFIG_COMMANDS
1568# -------------------
1569# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1570# variables for single and double quote escaping we saved from calls
1571# to _LT_DECL, we can put quote escaped variables declarations
1572# into `config.status', and then the shell code to quote escape them in
1573# for loops in `config.status'.  Finally, any additional code accumulated
1574# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1575m4_defun([_LT_CONFIG_COMMANDS],
1576[AC_PROVIDE_IFELSE([LT_OUTPUT],
1577	dnl If the libtool generation code has been placed in $CONFIG_LT,
1578	dnl instead of duplicating it all over again into config.status,
1579	dnl then we will have config.status run $CONFIG_LT later, so it
1580	dnl needs to know what name is stored there:
1581        [AC_CONFIG_COMMANDS([libtool],
1582            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1583    dnl If the libtool generation code is destined for config.status,
1584    dnl expand the accumulated commands and init code now:
1585    [AC_CONFIG_COMMANDS([libtool],
1586        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1587])#_LT_CONFIG_COMMANDS
1588
1589
1590# Initialize.
1591m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1592[
1593
1594# The HP-UX ksh and POSIX shell print the target directory to stdout
1595# if CDPATH is set.
1596(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1597
1598sed_quote_subst='$sed_quote_subst'
1599double_quote_subst='$double_quote_subst'
1600delay_variable_subst='$delay_variable_subst'
1601_LT_CONFIG_STATUS_DECLARATIONS
1602LTCC='$LTCC'
1603LTCFLAGS='$LTCFLAGS'
1604compiler='$compiler_DEFAULT'
1605
1606# A function that is used when there is no print builtin or printf.
1607func_fallback_echo ()
1608{
1609  eval 'cat <<_LTECHO_EOF
1610\$[]1
1611_LTECHO_EOF'
1612}
1613
1614# Quote evaled strings.
1615for var in lt_decl_all_varnames([[ \
1616]], lt_decl_quote_varnames); do
1617    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1618    *[[\\\\\\\`\\"\\\$]]*)
1619      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1620      ;;
1621    *)
1622      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1623      ;;
1624    esac
1625done
1626
1627# Double-quote double-evaled strings.
1628for var in lt_decl_all_varnames([[ \
1629]], lt_decl_dquote_varnames); do
1630    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1631    *[[\\\\\\\`\\"\\\$]]*)
1632      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1633      ;;
1634    *)
1635      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1636      ;;
1637    esac
1638done
1639
1640_LT_OUTPUT_LIBTOOL_INIT
1641])
1642
1643# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1644# ------------------------------------
1645# Generate a child script FILE with all initialization necessary to
1646# reuse the environment learned by the parent script, and make the
1647# file executable.  If COMMENT is supplied, it is inserted after the
1648# `#!' sequence but before initialization text begins.  After this
1649# macro, additional text can be appended to FILE to form the body of
1650# the child script.  The macro ends with non-zero status if the
1651# file could not be fully written (such as if the disk is full).
1652m4_ifdef([AS_INIT_GENERATED],
1653[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1654[m4_defun([_LT_GENERATED_FILE_INIT],
1655[m4_require([AS_PREPARE])]dnl
1656[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1657[lt_write_fail=0
1658cat >$1 <<_ASEOF || lt_write_fail=1
1659#! $SHELL
1660# Generated by $as_me.
1661$2
1662SHELL=\${CONFIG_SHELL-$SHELL}
1663export SHELL
1664_ASEOF
1665cat >>$1 <<\_ASEOF || lt_write_fail=1
1666AS_SHELL_SANITIZE
1667_AS_PREPARE
1668exec AS_MESSAGE_FD>&1
1669_ASEOF
1670test $lt_write_fail = 0 && chmod +x $1[]dnl
1671m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1672
1673# LT_OUTPUT
1674# ---------
1675# This macro allows early generation of the libtool script (before
1676# AC_OUTPUT is called), incase it is used in configure for compilation
1677# tests.
1678AC_DEFUN([LT_OUTPUT],
1679[: ${CONFIG_LT=./config.lt}
1680AC_MSG_NOTICE([creating $CONFIG_LT])
1681_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1682[# Run this file to recreate a libtool stub with the current configuration.])
1683
1684cat >>"$CONFIG_LT" <<\_LTEOF
1685lt_cl_silent=false
1686exec AS_MESSAGE_LOG_FD>>config.log
1687{
1688  echo
1689  AS_BOX([Running $as_me.])
1690} >&AS_MESSAGE_LOG_FD
1691
1692lt_cl_help="\
1693\`$as_me' creates a local libtool stub from the current configuration,
1694for use in further configure time tests before the real libtool is
1695generated.
1696
1697Usage: $[0] [[OPTIONS]]
1698
1699  -h, --help      print this help, then exit
1700  -V, --version   print version number, then exit
1701  -q, --quiet     do not print progress messages
1702  -d, --debug     don't remove temporary files
1703
1704Report bugs to <bug-libtool@gnu.org>."
1705
1706lt_cl_version="\
1707m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1708m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1709configured by $[0], generated by m4_PACKAGE_STRING.
1710
1711Copyright (C) 2011 Free Software Foundation, Inc.
1712This config.lt script is free software; the Free Software Foundation
1713gives unlimited permision to copy, distribute and modify it."
1714
1715while test $[#] != 0
1716do
1717  case $[1] in
1718    --version | --v* | -V )
1719      echo "$lt_cl_version"; exit 0 ;;
1720    --help | --h* | -h )
1721      echo "$lt_cl_help"; exit 0 ;;
1722    --debug | --d* | -d )
1723      debug=: ;;
1724    --quiet | --q* | --silent | --s* | -q )
1725      lt_cl_silent=: ;;
1726
1727    -*) AC_MSG_ERROR([unrecognized option: $[1]
1728Try \`$[0] --help' for more information.]) ;;
1729
1730    *) AC_MSG_ERROR([unrecognized argument: $[1]
1731Try \`$[0] --help' for more information.]) ;;
1732  esac
1733  shift
1734done
1735
1736if $lt_cl_silent; then
1737  exec AS_MESSAGE_FD>/dev/null
1738fi
1739_LTEOF
1740
1741cat >>"$CONFIG_LT" <<_LTEOF
1742_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1743_LTEOF
1744
1745cat >>"$CONFIG_LT" <<\_LTEOF
1746AC_MSG_NOTICE([creating $ofile])
1747_LT_OUTPUT_LIBTOOL_COMMANDS
1748AS_EXIT(0)
1749_LTEOF
1750chmod +x "$CONFIG_LT"
1751
1752# configure is writing to config.log, but config.lt does its own redirection,
1753# appending to config.log, which fails on DOS, as config.log is still kept
1754# open by configure.  Here we exec the FD to /dev/null, effectively closing
1755# config.log, so it can be properly (re)opened and appended to by config.lt.
1756lt_cl_success=:
1757test "$silent" = yes &&
1758  lt_config_lt_args="$lt_config_lt_args --quiet"
1759exec AS_MESSAGE_LOG_FD>/dev/null
1760$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1761exec AS_MESSAGE_LOG_FD>>config.log
1762$lt_cl_success || AS_EXIT(1)
1763])# LT_OUTPUT
1764
1765
1766# _LT_CONFIG(TAG)
1767# ---------------
1768# If TAG is the built-in tag, create an initial libtool script with a
1769# default configuration from the untagged config vars.  Otherwise add code
1770# to config.status for appending the configuration named by TAG from the
1771# matching tagged config vars.
1772m4_defun([_LT_CONFIG],
1773[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1774_LT_CONFIG_SAVE_COMMANDS([
1775  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1776  m4_if(_LT_TAG, [C], [
1777    # See if we are running on zsh, and set the options which allow our
1778    # commands through without removal of \ escapes.
1779    if test -n "${ZSH_VERSION+set}" ; then
1780      setopt NO_GLOB_SUBST
1781    fi
1782
1783    cfgfile="${ofile}T"
1784    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1785    $RM "$cfgfile"
1786
1787    cat <<_LT_EOF >> "$cfgfile"
1788#! $SHELL
1789
1790# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1791# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1792# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1793# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1794#
1795_LT_COPYING
1796_LT_LIBTOOL_TAGS
1797
1798# ### BEGIN LIBTOOL CONFIG
1799_LT_LIBTOOL_CONFIG_VARS
1800_LT_LIBTOOL_TAG_VARS
1801# ### END LIBTOOL CONFIG
1802
1803_LT_EOF
1804
1805  case $host_os in
1806  aix3*)
1807    cat <<\_LT_EOF >> "$cfgfile"
1808# AIX sometimes has problems with the GCC collect2 program.  For some
1809# reason, if we set the COLLECT_NAMES environment variable, the problems
1810# vanish in a puff of smoke.
1811if test "X${COLLECT_NAMES+set}" != Xset; then
1812  COLLECT_NAMES=
1813  export COLLECT_NAMES
1814fi
1815_LT_EOF
1816    ;;
1817  esac
1818
1819  _LT_PROG_LTMAIN
1820
1821  # We use sed instead of cat because bash on DJGPP gets confused if
1822  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1823  # text mode, it properly converts lines to CR/LF.  This bash problem
1824  # is reportedly fixed, but why not run on old versions too?
1825  sed '$q' "$ltmain" >> "$cfgfile" \
1826     || (rm -f "$cfgfile"; exit 1)
1827
1828  _LT_PROG_REPLACE_SHELLFNS
1829
1830   mv -f "$cfgfile" "$ofile" ||
1831    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1832  chmod +x "$ofile"
1833],
1834[cat <<_LT_EOF >> "$ofile"
1835
1836dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1837dnl in a comment (ie after a #).
1838# ### BEGIN LIBTOOL TAG CONFIG: $1
1839_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1840# ### END LIBTOOL TAG CONFIG: $1
1841_LT_EOF
1842])dnl /m4_if
1843],
1844[m4_if([$1], [], [
1845    PACKAGE='$PACKAGE'
1846    VERSION='$VERSION'
1847    TIMESTAMP='$TIMESTAMP'
1848    RM='$RM'
1849    ofile='$ofile'], [])
1850])dnl /_LT_CONFIG_SAVE_COMMANDS
1851])# _LT_CONFIG
1852
1853
1854# LT_SUPPORTED_TAG(TAG)
1855# ---------------------
1856# Trace this macro to discover what tags are supported by the libtool
1857# --tag option, using:
1858#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1859AC_DEFUN([LT_SUPPORTED_TAG], [])
1860
1861
1862# C support is built-in for now
1863m4_define([_LT_LANG_C_enabled], [])
1864m4_define([_LT_TAGS], [])
1865
1866
1867# LT_LANG(LANG)
1868# -------------
1869# Enable libtool support for the given language if not already enabled.
1870AC_DEFUN([LT_LANG],
1871[AC_BEFORE([$0], [LT_OUTPUT])dnl
1872m4_case([$1],
1873  [C],			[_LT_LANG(C)],
1874  [C++],		[_LT_LANG(CXX)],
1875  [Go],			[_LT_LANG(GO)],
1876  [Java],		[_LT_LANG(GCJ)],
1877  [Fortran 77],		[_LT_LANG(F77)],
1878  [Fortran],		[_LT_LANG(FC)],
1879  [Windows Resource],	[_LT_LANG(RC)],
1880  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1881    [_LT_LANG($1)],
1882    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1883])# LT_LANG
1884
1885
1886# _LT_LANG(LANGNAME)
1887# ------------------
1888m4_defun([_LT_LANG],
1889[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1890  [LT_SUPPORTED_TAG([$1])dnl
1891  m4_append([_LT_TAGS], [$1 ])dnl
1892  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1893  _LT_LANG_$1_CONFIG($1)])dnl
1894])# _LT_LANG
1895
1896
1897m4_ifndef([AC_PROG_GO], [
1898# NOTE: This macro has been submitted for inclusion into   #
1899#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1900#  a released version of Autoconf we should remove this    #
1901#  macro and use it instead.                               #
1902m4_defun([AC_PROG_GO],
1903[AC_LANG_PUSH(Go)dnl
1904AC_ARG_VAR([GOC],     [Go compiler command])dnl
1905AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1906_AC_ARG_VAR_LDFLAGS()dnl
1907AC_CHECK_TOOL(GOC, gccgo)
1908if test -z "$GOC"; then
1909  if test -n "$ac_tool_prefix"; then
1910    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1911  fi
1912fi
1913if test -z "$GOC"; then
1914  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1915fi
1916])#m4_defun
1917])#m4_ifndef
1918
1919
1920# _LT_LANG_DEFAULT_CONFIG
1921# -----------------------
1922m4_defun([_LT_LANG_DEFAULT_CONFIG],
1923[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1924  [LT_LANG(CXX)],
1925  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1926
1927AC_PROVIDE_IFELSE([AC_PROG_F77],
1928  [LT_LANG(F77)],
1929  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
1930
1931AC_PROVIDE_IFELSE([AC_PROG_FC],
1932  [LT_LANG(FC)],
1933  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
1934
1935dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
1936dnl pulling things in needlessly.
1937AC_PROVIDE_IFELSE([AC_PROG_GCJ],
1938  [LT_LANG(GCJ)],
1939  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1940    [LT_LANG(GCJ)],
1941    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
1942      [LT_LANG(GCJ)],
1943      [m4_ifdef([AC_PROG_GCJ],
1944	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
1945       m4_ifdef([A][M_PROG_GCJ],
1946	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
1947       m4_ifdef([LT_PROG_GCJ],
1948	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
1949
1950AC_PROVIDE_IFELSE([AC_PROG_GO],
1951  [LT_LANG(GO)],
1952  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
1953
1954AC_PROVIDE_IFELSE([LT_PROG_RC],
1955  [LT_LANG(RC)],
1956  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
1957])# _LT_LANG_DEFAULT_CONFIG
1958
1959# Obsolete macros:
1960AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
1961AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
1962AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
1963AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
1964AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
1965dnl aclocal-1.4 backwards compatibility:
1966dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
1967dnl AC_DEFUN([AC_LIBTOOL_F77], [])
1968dnl AC_DEFUN([AC_LIBTOOL_FC], [])
1969dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
1970dnl AC_DEFUN([AC_LIBTOOL_RC], [])
1971
1972
1973# _LT_TAG_COMPILER
1974# ----------------
1975m4_defun([_LT_TAG_COMPILER],
1976[AC_REQUIRE([AC_PROG_CC])dnl
1977
1978_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
1979_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
1980_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
1981_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
1982
1983# If no C compiler was specified, use CC.
1984LTCC=${LTCC-"$CC"}
1985
1986# If no C compiler flags were specified, use CFLAGS.
1987LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1988
1989# Allow CC to be a program name with arguments.
1990compiler=$CC
1991])# _LT_TAG_COMPILER
1992
1993
1994# _LT_COMPILER_BOILERPLATE
1995# ------------------------
1996# Check for compiler boilerplate output or warnings with
1997# the simple compiler test code.
1998m4_defun([_LT_COMPILER_BOILERPLATE],
1999[m4_require([_LT_DECL_SED])dnl
2000ac_outfile=conftest.$ac_objext
2001echo "$lt_simple_compile_test_code" >conftest.$ac_ext
2002eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2003_lt_compiler_boilerplate=`cat conftest.err`
2004$RM conftest*
2005])# _LT_COMPILER_BOILERPLATE
2006
2007
2008# _LT_LINKER_BOILERPLATE
2009# ----------------------
2010# Check for linker boilerplate output or warnings with
2011# the simple link test code.
2012m4_defun([_LT_LINKER_BOILERPLATE],
2013[m4_require([_LT_DECL_SED])dnl
2014ac_outfile=conftest.$ac_objext
2015echo "$lt_simple_link_test_code" >conftest.$ac_ext
2016eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2017_lt_linker_boilerplate=`cat conftest.err`
2018$RM -r conftest*
2019])# _LT_LINKER_BOILERPLATE
2020
2021# _LT_REQUIRED_DARWIN_CHECKS
2022# -------------------------
2023m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
2024  case $host_os in
2025    rhapsody* | darwin*)
2026    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
2027    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
2028    AC_CHECK_TOOL([LIPO], [lipo], [:])
2029    AC_CHECK_TOOL([OTOOL], [otool], [:])
2030    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
2031    _LT_DECL([], [DSYMUTIL], [1],
2032      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
2033    _LT_DECL([], [NMEDIT], [1],
2034      [Tool to change global to local symbols on Mac OS X])
2035    _LT_DECL([], [LIPO], [1],
2036      [Tool to manipulate fat objects and archives on Mac OS X])
2037    _LT_DECL([], [OTOOL], [1],
2038      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2039    _LT_DECL([], [OTOOL64], [1],
2040      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2041
2042    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2043      [lt_cv_apple_cc_single_mod=no
2044      if test -z "${LT_MULTI_MODULE}"; then
2045	# By default we will add the -single_module flag. You can override
2046	# by either setting the environment variable LT_MULTI_MODULE
2047	# non-empty at configure time, or by adding -multi_module to the
2048	# link flags.
2049	rm -rf libconftest.dylib*
2050	echo "int foo(void){return 1;}" > conftest.c
2051	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2052-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2053	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2054	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2055        _lt_result=$?
2056	# If there is a non-empty error log, and "single_module"
2057	# appears in it, assume the flag caused a linker warning
2058        if test -s conftest.err && $GREP single_module conftest.err; then
2059	  cat conftest.err >&AS_MESSAGE_LOG_FD
2060	# Otherwise, if the output was created with a 0 exit code from
2061	# the compiler, it worked.
2062	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2063	  lt_cv_apple_cc_single_mod=yes
2064	else
2065	  cat conftest.err >&AS_MESSAGE_LOG_FD
2066	fi
2067	rm -rf libconftest.dylib*
2068	rm -f conftest.*
2069      fi])
2070
2071    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2072      [lt_cv_ld_exported_symbols_list],
2073      [lt_cv_ld_exported_symbols_list=no
2074      save_LDFLAGS=$LDFLAGS
2075      echo "_main" > conftest.sym
2076      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2077      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2078	[lt_cv_ld_exported_symbols_list=yes],
2079	[lt_cv_ld_exported_symbols_list=no])
2080	LDFLAGS="$save_LDFLAGS"
2081    ])
2082
2083    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2084      [lt_cv_ld_force_load=no
2085      cat > conftest.c << _LT_EOF
2086int forced_loaded() { return 2;}
2087_LT_EOF
2088      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2089      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2090      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2091      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2092      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2093      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2094      cat > conftest.c << _LT_EOF
2095int main() { return 0;}
2096_LT_EOF
2097      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2098      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2099      _lt_result=$?
2100      if test -s conftest.err && $GREP force_load conftest.err; then
2101	cat conftest.err >&AS_MESSAGE_LOG_FD
2102      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2103	lt_cv_ld_force_load=yes
2104      else
2105	cat conftest.err >&AS_MESSAGE_LOG_FD
2106      fi
2107        rm -f conftest.err libconftest.a conftest conftest.c
2108        rm -rf conftest.dSYM
2109    ])
2110    case $host_os in
2111    rhapsody* | darwin1.[[012]])
2112      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2113    darwin1.*)
2114      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2115    darwin*) # darwin 5.x on
2116      # if running on 10.5 or later, the deployment target defaults
2117      # to the OS version, if on x86, and 10.4, the deployment
2118      # target defaults to 10.4. Don't you love it?
2119      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2120	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2121	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2122	10.[[012]]*)
2123	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2124	10.*)
2125	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2126      esac
2127    ;;
2128  esac
2129    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2130      _lt_dar_single_mod='$single_module'
2131    fi
2132    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2133      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2134    else
2135      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2136    fi
2137    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2138      _lt_dsymutil='~$DSYMUTIL $lib || :'
2139    else
2140      _lt_dsymutil=
2141    fi
2142    ;;
2143  esac
2144])
2145
2146
2147# _LT_DARWIN_LINKER_FEATURES([TAG])
2148# ---------------------------------
2149# Checks for linker and compiler features on darwin
2150m4_defun([_LT_DARWIN_LINKER_FEATURES],
2151[
2152  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2153  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2154  _LT_TAGVAR(hardcode_direct, $1)=no
2155  _LT_TAGVAR(hardcode_automatic, $1)=yes
2156  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2157  if test "$lt_cv_ld_force_load" = "yes"; then
2158    _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\"`'
2159    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2160                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2161  else
2162    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2163  fi
2164  _LT_TAGVAR(link_all_deplibs, $1)=yes
2165  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2166  case $cc_basename in
2167     ifort*) _lt_dar_can_shared=yes ;;
2168     *) _lt_dar_can_shared=$GCC ;;
2169  esac
2170  if test "$_lt_dar_can_shared" = "yes"; then
2171    output_verbose_link_cmd=func_echo_all
2172    _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}"
2173    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2174    _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}"
2175    _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}"
2176    m4_if([$1], [CXX],
2177[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2178      _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}"
2179      _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}"
2180    fi
2181],[])
2182  else
2183  _LT_TAGVAR(ld_shlibs, $1)=no
2184  fi
2185])
2186
2187# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2188# ----------------------------------
2189# Links a minimal program and checks the executable
2190# for the system default hardcoded library path. In most cases,
2191# this is /usr/lib:/lib, but when the MPI compilers are used
2192# the location of the communication and MPI libs are included too.
2193# If we don't find anything, use the default library path according
2194# to the aix ld manual.
2195# Store the results from the different compilers for each TAGNAME.
2196# Allow to override them for all tags through lt_cv_aix_libpath.
2197m4_defun([_LT_SYS_MODULE_PATH_AIX],
2198[m4_require([_LT_DECL_SED])dnl
2199if test "${lt_cv_aix_libpath+set}" = set; then
2200  aix_libpath=$lt_cv_aix_libpath
2201else
2202  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2203  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2204  lt_aix_libpath_sed='[
2205      /Import File Strings/,/^$/ {
2206	  /^0/ {
2207	      s/^0  *\([^ ]*\) *$/\1/
2208	      p
2209	  }
2210      }]'
2211  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2212  # Check for a 64-bit object if we didn't find anything.
2213  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2214    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2215  fi],[])
2216  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2217    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2218  fi
2219  ])
2220  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2221fi
2222])# _LT_SYS_MODULE_PATH_AIX
2223
2224
2225# _LT_SHELL_INIT(ARG)
2226# -------------------
2227m4_define([_LT_SHELL_INIT],
2228[m4_divert_text([M4SH-INIT], [$1
2229])])# _LT_SHELL_INIT
2230
2231
2232
2233# _LT_PROG_ECHO_BACKSLASH
2234# -----------------------
2235# Find how we can fake an echo command that does not interpret backslash.
2236# In particular, with Autoconf 2.60 or later we add some code to the start
2237# of the generated configure script which will find a shell with a builtin
2238# printf (which we can use as an echo command).
2239m4_defun([_LT_PROG_ECHO_BACKSLASH],
2240[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2241ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2242ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2243
2244AC_MSG_CHECKING([how to print strings])
2245# Test print first, because it will be a builtin if present.
2246if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2247   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2248  ECHO='print -r --'
2249elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2250  ECHO='printf %s\n'
2251else
2252  # Use this function as a fallback that always works.
2253  func_fallback_echo ()
2254  {
2255    eval 'cat <<_LTECHO_EOF
2256$[]1
2257_LTECHO_EOF'
2258  }
2259  ECHO='func_fallback_echo'
2260fi
2261
2262# func_echo_all arg...
2263# Invoke $ECHO with all args, space-separated.
2264func_echo_all ()
2265{
2266    $ECHO "$*" 
2267}
2268
2269case "$ECHO" in
2270  printf*) AC_MSG_RESULT([printf]) ;;
2271  print*) AC_MSG_RESULT([print -r]) ;;
2272  *) AC_MSG_RESULT([cat]) ;;
2273esac
2274
2275m4_ifdef([_AS_DETECT_SUGGESTED],
2276[_AS_DETECT_SUGGESTED([
2277  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2278    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2279    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2280    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2281    PATH=/empty FPATH=/empty; export PATH FPATH
2282    test "X`printf %s $ECHO`" = "X$ECHO" \
2283      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2284
2285_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2286_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2287])# _LT_PROG_ECHO_BACKSLASH
2288
2289
2290# _LT_WITH_SYSROOT
2291# ----------------
2292AC_DEFUN([_LT_WITH_SYSROOT],
2293[AC_MSG_CHECKING([for sysroot])
2294AC_ARG_WITH([sysroot],
2295[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2296                        (or the compiler's sysroot if not specified).],
2297[], [with_sysroot=no])
2298
2299dnl lt_sysroot will always be passed unquoted.  We quote it here
2300dnl in case the user passed a directory name.
2301lt_sysroot=
2302case ${with_sysroot} in #(
2303 yes)
2304   if test "$GCC" = yes; then
2305     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2306   fi
2307   ;; #(
2308 /*)
2309   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2310   ;; #(
2311 no|'')
2312   ;; #(
2313 *)
2314   AC_MSG_RESULT([${with_sysroot}])
2315   AC_MSG_ERROR([The sysroot must be an absolute path.])
2316   ;;
2317esac
2318
2319 AC_MSG_RESULT([${lt_sysroot:-no}])
2320_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2321[dependent libraries, and in which our libraries should be installed.])])
2322
2323# _LT_ENABLE_LOCK
2324# ---------------
2325m4_defun([_LT_ENABLE_LOCK],
2326[AC_ARG_ENABLE([libtool-lock],
2327  [AS_HELP_STRING([--disable-libtool-lock],
2328    [avoid locking (might break parallel builds)])])
2329test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2330
2331# Some flags need to be propagated to the compiler or linker for good
2332# libtool support.
2333case $host in
2334ia64-*-hpux*)
2335  # Find out which ABI we are using.
2336  echo 'int i;' > conftest.$ac_ext
2337  if AC_TRY_EVAL(ac_compile); then
2338    case `/usr/bin/file conftest.$ac_objext` in
2339      *ELF-32*)
2340	HPUX_IA64_MODE="32"
2341	;;
2342      *ELF-64*)
2343	HPUX_IA64_MODE="64"
2344	;;
2345    esac
2346  fi
2347  rm -rf conftest*
2348  ;;
2349*-*-irix6*)
2350  # Find out which ABI we are using.
2351  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2352  if AC_TRY_EVAL(ac_compile); then
2353    if test "$lt_cv_prog_gnu_ld" = yes; then
2354      case `/usr/bin/file conftest.$ac_objext` in
2355	*32-bit*)
2356	  LD="${LD-ld} -melf32bsmip"
2357	  ;;
2358	*N32*)
2359	  LD="${LD-ld} -melf32bmipn32"
2360	  ;;
2361	*64-bit*)
2362	  LD="${LD-ld} -melf64bmip"
2363	;;
2364      esac
2365    else
2366      case `/usr/bin/file conftest.$ac_objext` in
2367	*32-bit*)
2368	  LD="${LD-ld} -32"
2369	  ;;
2370	*N32*)
2371	  LD="${LD-ld} -n32"
2372	  ;;
2373	*64-bit*)
2374	  LD="${LD-ld} -64"
2375	  ;;
2376      esac
2377    fi
2378  fi
2379  rm -rf conftest*
2380  ;;
2381
2382x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2383s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2384  # Find out which ABI we are using.
2385  echo 'int i;' > conftest.$ac_ext
2386  if AC_TRY_EVAL(ac_compile); then
2387    case `/usr/bin/file conftest.o` in
2388      *32-bit*)
2389	case $host in
2390	  x86_64-*kfreebsd*-gnu)
2391	    LD="${LD-ld} -m elf_i386_fbsd"
2392	    ;;
2393	  x86_64-*linux*)
2394	    LD="${LD-ld} -m elf_i386"
2395	    ;;
2396	  ppc64-*linux*|powerpc64-*linux*)
2397	    LD="${LD-ld} -m elf32ppclinux"
2398	    ;;
2399	  s390x-*linux*)
2400	    LD="${LD-ld} -m elf_s390"
2401	    ;;
2402	  sparc64-*linux*)
2403	    LD="${LD-ld} -m elf32_sparc"
2404	    ;;
2405	esac
2406	;;
2407      *64-bit*)
2408	case $host in
2409	  x86_64-*kfreebsd*-gnu)
2410	    LD="${LD-ld} -m elf_x86_64_fbsd"
2411	    ;;
2412	  x86_64-*linux*)
2413	    LD="${LD-ld} -m elf_x86_64"
2414	    ;;
2415	  ppc*-*linux*|powerpc*-*linux*)
2416	    LD="${LD-ld} -m elf64ppc"
2417	    ;;
2418	  s390*-*linux*|s390*-*tpf*)
2419	    LD="${LD-ld} -m elf64_s390"
2420	    ;;
2421	  sparc*-*linux*)
2422	    LD="${LD-ld} -m elf64_sparc"
2423	    ;;
2424	esac
2425	;;
2426    esac
2427  fi
2428  rm -rf conftest*
2429  ;;
2430
2431*-*-sco3.2v5*)
2432  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2433  SAVE_CFLAGS="$CFLAGS"
2434  CFLAGS="$CFLAGS -belf"
2435  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2436    [AC_LANG_PUSH(C)
2437     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2438     AC_LANG_POP])
2439  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2440    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2441    CFLAGS="$SAVE_CFLAGS"
2442  fi
2443  ;;
2444*-*solaris*)
2445  # Find out which ABI we are using.
2446  echo 'int i;' > conftest.$ac_ext
2447  if AC_TRY_EVAL(ac_compile); then
2448    case `/usr/bin/file conftest.o` in
2449    *64-bit*)
2450      case $lt_cv_prog_gnu_ld in
2451      yes*)
2452        case $host in
2453        i?86-*-solaris*)
2454          LD="${LD-ld} -m elf_x86_64"
2455          ;;
2456        sparc*-*-solaris*)
2457          LD="${LD-ld} -m elf64_sparc"
2458          ;;
2459        esac
2460        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2461        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2462          LD="${LD-ld}_sol2"
2463        fi
2464        ;;
2465      *)
2466	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2467	  LD="${LD-ld} -64"
2468	fi
2469	;;
2470      esac
2471      ;;
2472    esac
2473  fi
2474  rm -rf conftest*
2475  ;;
2476esac
2477
2478need_locks="$enable_libtool_lock"
2479])# _LT_ENABLE_LOCK
2480
2481
2482# _LT_PROG_AR
2483# -----------
2484m4_defun([_LT_PROG_AR],
2485[AC_CHECK_TOOLS(AR, [ar], false)
2486: ${AR=ar}
2487: ${AR_FLAGS=cru}
2488_LT_DECL([], [AR], [1], [The archiver])
2489_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2490
2491AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2492  [lt_cv_ar_at_file=no
2493   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2494     [echo conftest.$ac_objext > conftest.lst
2495      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2496      AC_TRY_EVAL([lt_ar_try])
2497      if test "$ac_status" -eq 0; then
2498	# Ensure the archiver fails upon bogus file names.
2499	rm -f conftest.$ac_objext libconftest.a
2500	AC_TRY_EVAL([lt_ar_try])
2501	if test "$ac_status" -ne 0; then
2502          lt_cv_ar_at_file=@
2503        fi
2504      fi
2505      rm -f conftest.* libconftest.a
2506     ])
2507  ])
2508
2509if test "x$lt_cv_ar_at_file" = xno; then
2510  archiver_list_spec=
2511else
2512  archiver_list_spec=$lt_cv_ar_at_file
2513fi
2514_LT_DECL([], [archiver_list_spec], [1],
2515  [How to feed a file listing to the archiver])
2516])# _LT_PROG_AR
2517
2518
2519# _LT_CMD_OLD_ARCHIVE
2520# -------------------
2521m4_defun([_LT_CMD_OLD_ARCHIVE],
2522[_LT_PROG_AR
2523
2524AC_CHECK_TOOL(STRIP, strip, :)
2525test -z "$STRIP" && STRIP=:
2526_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2527
2528AC_CHECK_TOOL(RANLIB, ranlib, :)
2529test -z "$RANLIB" && RANLIB=:
2530_LT_DECL([], [RANLIB], [1],
2531    [Commands used to install an old-style archive])
2532
2533# Determine commands to create old-style static archives.
2534old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2535old_postinstall_cmds='chmod 644 $oldlib'
2536old_postuninstall_cmds=
2537
2538if test -n "$RANLIB"; then
2539  case $host_os in
2540  openbsd*)
2541    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2542    ;;
2543  *)
2544    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2545    ;;
2546  esac
2547  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2548fi
2549
2550case $host_os in
2551  darwin*)
2552    lock_old_archive_extraction=yes ;;
2553  *)
2554    lock_old_archive_extraction=no ;;
2555esac
2556_LT_DECL([], [old_postinstall_cmds], [2])
2557_LT_DECL([], [old_postuninstall_cmds], [2])
2558_LT_TAGDECL([], [old_archive_cmds], [2],
2559    [Commands used to build an old-style archive])
2560_LT_DECL([], [lock_old_archive_extraction], [0],
2561    [Whether to use a lock for old archive extraction])
2562])# _LT_CMD_OLD_ARCHIVE
2563
2564
2565# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2566#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2567# ----------------------------------------------------------------
2568# Check whether the given compiler option works
2569AC_DEFUN([_LT_COMPILER_OPTION],
2570[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2571m4_require([_LT_DECL_SED])dnl
2572AC_CACHE_CHECK([$1], [$2],
2573  [$2=no
2574   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2575   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2576   lt_compiler_flag="$3"
2577   # Insert the option either (1) after the last *FLAGS variable, or
2578   # (2) before a word containing "conftest.", or (3) at the end.
2579   # Note that $ac_compile itself does not contain backslashes and begins
2580   # with a dollar sign (not a hyphen), so the echo should work correctly.
2581   # The option is referenced via a variable to avoid confusing sed.
2582   lt_compile=`echo "$ac_compile" | $SED \
2583   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2584   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2585   -e 's:$: $lt_compiler_flag:'`
2586   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2587   (eval "$lt_compile" 2>conftest.err)
2588   ac_status=$?
2589   cat conftest.err >&AS_MESSAGE_LOG_FD
2590   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2591   if (exit $ac_status) && test -s "$ac_outfile"; then
2592     # The compiler can only warn and ignore the option if not recognized
2593     # So say no if there are warnings other than the usual output.
2594     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2595     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2596     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2597       $2=yes
2598     fi
2599   fi
2600   $RM conftest*
2601])
2602
2603if test x"[$]$2" = xyes; then
2604    m4_if([$5], , :, [$5])
2605else
2606    m4_if([$6], , :, [$6])
2607fi
2608])# _LT_COMPILER_OPTION
2609
2610# Old name:
2611AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2612dnl aclocal-1.4 backwards compatibility:
2613dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2614
2615
2616# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2617#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2618# ----------------------------------------------------
2619# Check whether the given linker option works
2620AC_DEFUN([_LT_LINKER_OPTION],
2621[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2622m4_require([_LT_DECL_SED])dnl
2623AC_CACHE_CHECK([$1], [$2],
2624  [$2=no
2625   save_LDFLAGS="$LDFLAGS"
2626   LDFLAGS="$LDFLAGS $3"
2627   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2628   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2629     # The linker can only warn and ignore the option if not recognized
2630     # So say no if there are warnings
2631     if test -s conftest.err; then
2632       # Append any errors to the config.log.
2633       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2634       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2635       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2636       if diff conftest.exp conftest.er2 >/dev/null; then
2637         $2=yes
2638       fi
2639     else
2640       $2=yes
2641     fi
2642   fi
2643   $RM -r conftest*
2644   LDFLAGS="$save_LDFLAGS"
2645])
2646
2647if test x"[$]$2" = xyes; then
2648    m4_if([$4], , :, [$4])
2649else
2650    m4_if([$5], , :, [$5])
2651fi
2652])# _LT_LINKER_OPTION
2653
2654# Old name:
2655AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2656dnl aclocal-1.4 backwards compatibility:
2657dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2658
2659
2660# LT_CMD_MAX_LEN
2661#---------------
2662AC_DEFUN([LT_CMD_MAX_LEN],
2663[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2664# find the maximum length of command line arguments
2665AC_MSG_CHECKING([the maximum length of command line arguments])
2666AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2667  i=0
2668  teststring="ABCD"
2669
2670  case $build_os in
2671  msdosdjgpp*)
2672    # On DJGPP, this test can blow up pretty badly due to problems in libc
2673    # (any single argument exceeding 2000 bytes causes a buffer overrun
2674    # during glob expansion).  Even if it were fixed, the result of this
2675    # check would be larger than it should be.
2676    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2677    ;;
2678
2679  gnu*)
2680    # Under GNU Hurd, this test is not required because there is
2681    # no limit to the length of command line arguments.
2682    # Libtool will interpret -1 as no limit whatsoever
2683    lt_cv_sys_max_cmd_len=-1;
2684    ;;
2685
2686  cygwin* | mingw* | cegcc*)
2687    # On Win9x/ME, this test blows up -- it succeeds, but takes
2688    # about 5 minutes as the teststring grows exponentially.
2689    # Worse, since 9x/ME are not pre-emptively multitasking,
2690    # you end up with a "frozen" computer, even though with patience
2691    # the test eventually succeeds (with a max line length of 256k).
2692    # Instead, let's just punt: use the minimum linelength reported by
2693    # all of the supported platforms: 8192 (on NT/2K/XP).
2694    lt_cv_sys_max_cmd_len=8192;
2695    ;;
2696
2697  mint*)
2698    # On MiNT this can take a long time and run out of memory.
2699    lt_cv_sys_max_cmd_len=8192;
2700    ;;
2701
2702  amigaos*)
2703    # On AmigaOS with pdksh, this test takes hours, literally.
2704    # So we just punt and use a minimum line length of 8192.
2705    lt_cv_sys_max_cmd_len=8192;
2706    ;;
2707
2708  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2709    # This has been around since 386BSD, at least.  Likely further.
2710    if test -x /sbin/sysctl; then
2711      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2712    elif test -x /usr/sbin/sysctl; then
2713      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2714    else
2715      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2716    fi
2717    # And add a safety zone
2718    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2719    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2720    ;;
2721
2722  interix*)
2723    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2724    lt_cv_sys_max_cmd_len=196608
2725    ;;
2726
2727  os2*)
2728    # The test takes a long time on OS/2.
2729    lt_cv_sys_max_cmd_len=8192
2730    ;;
2731
2732  osf*)
2733    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2734    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2735    # nice to cause kernel panics so lets avoid the loop below.
2736    # First set a reasonable default.
2737    lt_cv_sys_max_cmd_len=16384
2738    #
2739    if test -x /sbin/sysconfig; then
2740      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2741        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2742      esac
2743    fi
2744    ;;
2745  sco3.2v5*)
2746    lt_cv_sys_max_cmd_len=102400
2747    ;;
2748  sysv5* | sco5v6* | sysv4.2uw2*)
2749    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2750    if test -n "$kargmax"; then
2751      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2752    else
2753      lt_cv_sys_max_cmd_len=32768
2754    fi
2755    ;;
2756  *)
2757    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2758    if test -n "$lt_cv_sys_max_cmd_len"; then
2759      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2760      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2761    else
2762      # Make teststring a little bigger before we do anything with it.
2763      # a 1K string should be a reasonable start.
2764      for i in 1 2 3 4 5 6 7 8 ; do
2765        teststring=$teststring$teststring
2766      done
2767      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2768      # If test is not a shell built-in, we'll probably end up computing a
2769      # maximum length that is only half of the actual maximum length, but
2770      # we can't tell.
2771      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2772	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2773	      test $i != 17 # 1/2 MB should be enough
2774      do
2775        i=`expr $i + 1`
2776        teststring=$teststring$teststring
2777      done
2778      # Only check the string length outside the loop.
2779      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2780      teststring=
2781      # Add a significant safety factor because C++ compilers can tack on
2782      # massive amounts of additional arguments before passing them to the
2783      # linker.  It appears as though 1/2 is a usable value.
2784      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2785    fi
2786    ;;
2787  esac
2788])
2789if test -n $lt_cv_sys_max_cmd_len ; then
2790  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2791else
2792  AC_MSG_RESULT(none)
2793fi
2794max_cmd_len=$lt_cv_sys_max_cmd_len
2795_LT_DECL([], [max_cmd_len], [0],
2796    [What is the maximum length of a command?])
2797])# LT_CMD_MAX_LEN
2798
2799# Old name:
2800AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2801dnl aclocal-1.4 backwards compatibility:
2802dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2803
2804
2805# _LT_HEADER_DLFCN
2806# ----------------
2807m4_defun([_LT_HEADER_DLFCN],
2808[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2809])# _LT_HEADER_DLFCN
2810
2811
2812# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2813#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2814# ----------------------------------------------------------------
2815m4_defun([_LT_TRY_DLOPEN_SELF],
2816[m4_require([_LT_HEADER_DLFCN])dnl
2817if test "$cross_compiling" = yes; then :
2818  [$4]
2819else
2820  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2821  lt_status=$lt_dlunknown
2822  cat > conftest.$ac_ext <<_LT_EOF
2823[#line $LINENO "configure"
2824#include "confdefs.h"
2825
2826#if HAVE_DLFCN_H
2827#include <dlfcn.h>
2828#endif
2829
2830#include <stdio.h>
2831
2832#ifdef RTLD_GLOBAL
2833#  define LT_DLGLOBAL		RTLD_GLOBAL
2834#else
2835#  ifdef DL_GLOBAL
2836#    define LT_DLGLOBAL		DL_GLOBAL
2837#  else
2838#    define LT_DLGLOBAL		0
2839#  endif
2840#endif
2841
2842/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2843   find out it does not work in some platform. */
2844#ifndef LT_DLLAZY_OR_NOW
2845#  ifdef RTLD_LAZY
2846#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2847#  else
2848#    ifdef DL_LAZY
2849#      define LT_DLLAZY_OR_NOW		DL_LAZY
2850#    else
2851#      ifdef RTLD_NOW
2852#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2853#      else
2854#        ifdef DL_NOW
2855#          define LT_DLLAZY_OR_NOW	DL_NOW
2856#        else
2857#          define LT_DLLAZY_OR_NOW	0
2858#        endif
2859#      endif
2860#    endif
2861#  endif
2862#endif
2863
2864/* When -fvisbility=hidden is used, assume the code has been annotated
2865   correspondingly for the symbols needed.  */
2866#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2867int fnord () __attribute__((visibility("default")));
2868#endif
2869
2870int fnord () { return 42; }
2871int main ()
2872{
2873  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2874  int status = $lt_dlunknown;
2875
2876  if (self)
2877    {
2878      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2879      else
2880        {
2881	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2882          else puts (dlerror ());
2883	}
2884      /* dlclose (self); */
2885    }
2886  else
2887    puts (dlerror ());
2888
2889  return status;
2890}]
2891_LT_EOF
2892  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2893    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2894    lt_status=$?
2895    case x$lt_status in
2896      x$lt_dlno_uscore) $1 ;;
2897      x$lt_dlneed_uscore) $2 ;;
2898      x$lt_dlunknown|x*) $3 ;;
2899    esac
2900  else :
2901    # compilation failed
2902    $3
2903  fi
2904fi
2905rm -fr conftest*
2906])# _LT_TRY_DLOPEN_SELF
2907
2908
2909# LT_SYS_DLOPEN_SELF
2910# ------------------
2911AC_DEFUN([LT_SYS_DLOPEN_SELF],
2912[m4_require([_LT_HEADER_DLFCN])dnl
2913if test "x$enable_dlopen" != xyes; then
2914  enable_dlopen=unknown
2915  enable_dlopen_self=unknown
2916  enable_dlopen_self_static=unknown
2917else
2918  lt_cv_dlopen=no
2919  lt_cv_dlopen_libs=
2920
2921  case $host_os in
2922  beos*)
2923    lt_cv_dlopen="load_add_on"
2924    lt_cv_dlopen_libs=
2925    lt_cv_dlopen_self=yes
2926    ;;
2927
2928  mingw* | pw32* | cegcc*)
2929    lt_cv_dlopen="LoadLibrary"
2930    lt_cv_dlopen_libs=
2931    ;;
2932
2933  cygwin*)
2934    lt_cv_dlopen="dlopen"
2935    lt_cv_dlopen_libs=
2936    ;;
2937
2938  darwin*)
2939  # if libdl is installed we need to link against it
2940    AC_CHECK_LIB([dl], [dlopen],
2941		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2942    lt_cv_dlopen="dyld"
2943    lt_cv_dlopen_libs=
2944    lt_cv_dlopen_self=yes
2945    ])
2946    ;;
2947
2948  *)
2949    AC_CHECK_FUNC([shl_load],
2950	  [lt_cv_dlopen="shl_load"],
2951      [AC_CHECK_LIB([dld], [shl_load],
2952	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2953	[AC_CHECK_FUNC([dlopen],
2954	      [lt_cv_dlopen="dlopen"],
2955	  [AC_CHECK_LIB([dl], [dlopen],
2956		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2957	    [AC_CHECK_LIB([svld], [dlopen],
2958		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2959	      [AC_CHECK_LIB([dld], [dld_link],
2960		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
2961	      ])
2962	    ])
2963	  ])
2964	])
2965      ])
2966    ;;
2967  esac
2968
2969  if test "x$lt_cv_dlopen" != xno; then
2970    enable_dlopen=yes
2971  else
2972    enable_dlopen=no
2973  fi
2974
2975  case $lt_cv_dlopen in
2976  dlopen)
2977    save_CPPFLAGS="$CPPFLAGS"
2978    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2979
2980    save_LDFLAGS="$LDFLAGS"
2981    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2982
2983    save_LIBS="$LIBS"
2984    LIBS="$lt_cv_dlopen_libs $LIBS"
2985
2986    AC_CACHE_CHECK([whether a program can dlopen itself],
2987	  lt_cv_dlopen_self, [dnl
2988	  _LT_TRY_DLOPEN_SELF(
2989	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2990	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2991    ])
2992
2993    if test "x$lt_cv_dlopen_self" = xyes; then
2994      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2995      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2996	  lt_cv_dlopen_self_static, [dnl
2997	  _LT_TRY_DLOPEN_SELF(
2998	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2999	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
3000      ])
3001    fi
3002
3003    CPPFLAGS="$save_CPPFLAGS"
3004    LDFLAGS="$save_LDFLAGS"
3005    LIBS="$save_LIBS"
3006    ;;
3007  esac
3008
3009  case $lt_cv_dlopen_self in
3010  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
3011  *) enable_dlopen_self=unknown ;;
3012  esac
3013
3014  case $lt_cv_dlopen_self_static in
3015  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
3016  *) enable_dlopen_self_static=unknown ;;
3017  esac
3018fi
3019_LT_DECL([dlopen_support], [enable_dlopen], [0],
3020	 [Whether dlopen is supported])
3021_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
3022	 [Whether dlopen of programs is supported])
3023_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
3024	 [Whether dlopen of statically linked programs is supported])
3025])# LT_SYS_DLOPEN_SELF
3026
3027# Old name:
3028AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
3029dnl aclocal-1.4 backwards compatibility:
3030dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
3031
3032
3033# _LT_COMPILER_C_O([TAGNAME])
3034# ---------------------------
3035# Check to see if options -c and -o are simultaneously supported by compiler.
3036# This macro does not hard code the compiler like AC_PROG_CC_C_O.
3037m4_defun([_LT_COMPILER_C_O],
3038[m4_require([_LT_DECL_SED])dnl
3039m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3040m4_require([_LT_TAG_COMPILER])dnl
3041AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3042  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3043  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3044   $RM -r conftest 2>/dev/null
3045   mkdir conftest
3046   cd conftest
3047   mkdir out
3048   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3049
3050   lt_compiler_flag="-o out/conftest2.$ac_objext"
3051   # Insert the option either (1) after the last *FLAGS variable, or
3052   # (2) before a word containing "conftest.", or (3) at the end.
3053   # Note that $ac_compile itself does not contain backslashes and begins
3054   # with a dollar sign (not a hyphen), so the echo should work correctly.
3055   lt_compile=`echo "$ac_compile" | $SED \
3056   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3057   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3058   -e 's:$: $lt_compiler_flag:'`
3059   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3060   (eval "$lt_compile" 2>out/conftest.err)
3061   ac_status=$?
3062   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3063   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3064   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3065   then
3066     # The compiler can only warn and ignore the option if not recognized
3067     # So say no if there are warnings
3068     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3069     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3070     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3071       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3072     fi
3073   fi
3074   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3075   $RM conftest*
3076   # SGI C++ compiler will create directory out/ii_files/ for
3077   # template instantiation
3078   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3079   $RM out/* && rmdir out
3080   cd ..
3081   $RM -r conftest
3082   $RM conftest*
3083])
3084_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3085	[Does compiler simultaneously support -c and -o options?])
3086])# _LT_COMPILER_C_O
3087
3088
3089# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3090# ----------------------------------
3091# Check to see if we can do hard links to lock some files if needed
3092m4_defun([_LT_COMPILER_FILE_LOCKS],
3093[m4_require([_LT_ENABLE_LOCK])dnl
3094m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3095_LT_COMPILER_C_O([$1])
3096
3097hard_links="nottested"
3098if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3099  # do not overwrite the value of need_locks provided by the user
3100  AC_MSG_CHECKING([if we can lock with hard links])
3101  hard_links=yes
3102  $RM conftest*
3103  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3104  touch conftest.a
3105  ln conftest.a conftest.b 2>&5 || hard_links=no
3106  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3107  AC_MSG_RESULT([$hard_links])
3108  if test "$hard_links" = no; then
3109    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3110    need_locks=warn
3111  fi
3112else
3113  need_locks=no
3114fi
3115_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3116])# _LT_COMPILER_FILE_LOCKS
3117
3118
3119# _LT_CHECK_OBJDIR
3120# ----------------
3121m4_defun([_LT_CHECK_OBJDIR],
3122[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3123[rm -f .libs 2>/dev/null
3124mkdir .libs 2>/dev/null
3125if test -d .libs; then
3126  lt_cv_objdir=.libs
3127else
3128  # MS-DOS does not allow filenames that begin with a dot.
3129  lt_cv_objdir=_libs
3130fi
3131rmdir .libs 2>/dev/null])
3132objdir=$lt_cv_objdir
3133_LT_DECL([], [objdir], [0],
3134         [The name of the directory that contains temporary libtool files])dnl
3135m4_pattern_allow([LT_OBJDIR])dnl
3136AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3137  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3138])# _LT_CHECK_OBJDIR
3139
3140
3141# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3142# --------------------------------------
3143# Check hardcoding attributes.
3144m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3145[AC_MSG_CHECKING([how to hardcode library paths into programs])
3146_LT_TAGVAR(hardcode_action, $1)=
3147if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3148   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3149   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3150
3151  # We can hardcode non-existent directories.
3152  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3153     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3154     # have to relink, otherwise we might link with an installed library
3155     # when we should be linking with a yet-to-be-installed one
3156     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3157     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3158    # Linking always hardcodes the temporary library directory.
3159    _LT_TAGVAR(hardcode_action, $1)=relink
3160  else
3161    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3162    _LT_TAGVAR(hardcode_action, $1)=immediate
3163  fi
3164else
3165  # We cannot hardcode anything, or else we can only hardcode existing
3166  # directories.
3167  _LT_TAGVAR(hardcode_action, $1)=unsupported
3168fi
3169AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3170
3171if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3172   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3173  # Fast installation is not supported
3174  enable_fast_install=no
3175elif test "$shlibpath_overrides_runpath" = yes ||
3176     test "$enable_shared" = no; then
3177  # Fast installation is not necessary
3178  enable_fast_install=needless
3179fi
3180_LT_TAGDECL([], [hardcode_action], [0],
3181    [How to hardcode a shared library path into an executable])
3182])# _LT_LINKER_HARDCODE_LIBPATH
3183
3184
3185# _LT_CMD_STRIPLIB
3186# ----------------
3187m4_defun([_LT_CMD_STRIPLIB],
3188[m4_require([_LT_DECL_EGREP])
3189striplib=
3190old_striplib=
3191AC_MSG_CHECKING([whether stripping libraries is possible])
3192if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3193  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3194  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3195  AC_MSG_RESULT([yes])
3196else
3197# FIXME - insert some real tests, host_os isn't really good enough
3198  case $host_os in
3199  darwin*)
3200    if test -n "$STRIP" ; then
3201      striplib="$STRIP -x"
3202      old_striplib="$STRIP -S"
3203      AC_MSG_RESULT([yes])
3204    else
3205      AC_MSG_RESULT([no])
3206    fi
3207    ;;
3208  *)
3209    AC_MSG_RESULT([no])
3210    ;;
3211  esac
3212fi
3213_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3214_LT_DECL([], [striplib], [1])
3215])# _LT_CMD_STRIPLIB
3216
3217
3218# _LT_SYS_DYNAMIC_LINKER([TAG])
3219# -----------------------------
3220# PORTME Fill in your ld.so characteristics
3221m4_defun([_LT_SYS_DYNAMIC_LINKER],
3222[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3223m4_require([_LT_DECL_EGREP])dnl
3224m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3225m4_require([_LT_DECL_OBJDUMP])dnl
3226m4_require([_LT_DECL_SED])dnl
3227m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3228AC_MSG_CHECKING([dynamic linker characteristics])
3229m4_if([$1],
3230	[], [
3231if test "$GCC" = yes; then
3232  case $host_os in
3233    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3234    *) lt_awk_arg="/^libraries:/" ;;
3235  esac
3236  case $host_os in
3237    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3238    *) lt_sed_strip_eq="s,=/,/,g" ;;
3239  esac
3240  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3241  case $lt_search_path_spec in
3242  *\;*)
3243    # if the path contains ";" then we assume it to be the separator
3244    # otherwise default to the standard path separator (i.e. ":") - it is
3245    # assumed that no part of a normal pathname contains ";" but that should
3246    # okay in the real world where ";" in dirpaths is itself problematic.
3247    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3248    ;;
3249  *)
3250    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3251    ;;
3252  esac
3253  # Ok, now we have the path, separated by spaces, we can step through it
3254  # and add multilib dir if necessary.
3255  lt_tmp_lt_search_path_spec=
3256  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3257  for lt_sys_path in $lt_search_path_spec; do
3258    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3259      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3260    else
3261      test -d "$lt_sys_path" && \
3262	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3263    fi
3264  done
3265  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3266BEGIN {RS=" "; FS="/|\n";} {
3267  lt_foo="";
3268  lt_count=0;
3269  for (lt_i = NF; lt_i > 0; lt_i--) {
3270    if ($lt_i != "" && $lt_i != ".") {
3271      if ($lt_i == "..") {
3272        lt_count++;
3273      } else {
3274        if (lt_count == 0) {
3275          lt_foo="/" $lt_i lt_foo;
3276        } else {
3277          lt_count--;
3278        }
3279      }
3280    }
3281  }
3282  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3283  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3284}'`
3285  # AWK program above erroneously prepends '/' to C:/dos/paths
3286  # for these hosts.
3287  case $host_os in
3288    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3289      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3290  esac
3291  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3292else
3293  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3294fi])
3295library_names_spec=
3296libname_spec='lib$name'
3297soname_spec=
3298shrext_cmds=".so"
3299postinstall_cmds=
3300postuninstall_cmds=
3301finish_cmds=
3302finish_eval=
3303shlibpath_var=
3304shlibpath_overrides_runpath=unknown
3305version_type=none
3306dynamic_linker="$host_os ld.so"
3307sys_lib_dlsearch_path_spec="/lib /usr/lib"
3308need_lib_prefix=unknown
3309hardcode_into_libs=no
3310
3311# when you set need_version to no, make sure it does not cause -set_version
3312# flags to be left without arguments
3313need_version=unknown
3314
3315case $host_os in
3316aix3*)
3317  version_type=linux # correct to gnu/linux during the next big refactor
3318  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3319  shlibpath_var=LIBPATH
3320
3321  # AIX 3 has no versioning support, so we append a major version to the name.
3322  soname_spec='${libname}${release}${shared_ext}$major'
3323  ;;
3324
3325aix[[4-9]]*)
3326  version_type=linux # correct to gnu/linux during the next big refactor
3327  need_lib_prefix=no
3328  need_version=no
3329  hardcode_into_libs=yes
3330  if test "$host_cpu" = ia64; then
3331    # AIX 5 supports IA64
3332    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3333    shlibpath_var=LD_LIBRARY_PATH
3334  else
3335    # With GCC up to 2.95.x, collect2 would create an import file
3336    # for dependence libraries.  The import file would start with
3337    # the line `#! .'.  This would cause the generated library to
3338    # depend on `.', always an invalid library.  This was fixed in
3339    # development snapshots of GCC prior to 3.0.
3340    case $host_os in
3341      aix4 | aix4.[[01]] | aix4.[[01]].*)
3342      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3343	   echo ' yes '
3344	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3345	:
3346      else
3347	can_build_shared=no
3348      fi
3349      ;;
3350    esac
3351    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3352    # soname into executable. Probably we can add versioning support to
3353    # collect2, so additional links can be useful in future.
3354    if test "$aix_use_runtimelinking" = yes; then
3355      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3356      # instead of lib<name>.a to let people know that these are not
3357      # typical AIX shared libraries.
3358      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3359    else
3360      # We preserve .a as extension for shared libraries through AIX4.2
3361      # and later when we are not doing run time linking.
3362      library_names_spec='${libname}${release}.a $libname.a'
3363      soname_spec='${libname}${release}${shared_ext}$major'
3364    fi
3365    shlibpath_var=LIBPATH
3366  fi
3367  ;;
3368
3369amigaos*)
3370  case $host_cpu in
3371  powerpc)
3372    # Since July 2007 AmigaOS4 officially supports .so libraries.
3373    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3374    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3375    ;;
3376  m68k)
3377    library_names_spec='$libname.ixlibrary $libname.a'
3378    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3379    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
3380    ;;
3381  esac
3382  ;;
3383
3384beos*)
3385  library_names_spec='${libname}${shared_ext}'
3386  dynamic_linker="$host_os ld.so"
3387  shlibpath_var=LIBRARY_PATH
3388  ;;
3389
3390bsdi[[45]]*)
3391  version_type=linux # correct to gnu/linux during the next big refactor
3392  need_version=no
3393  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3394  soname_spec='${libname}${release}${shared_ext}$major'
3395  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3396  shlibpath_var=LD_LIBRARY_PATH
3397  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3398  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3399  # the default ld.so.conf also contains /usr/contrib/lib and
3400  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3401  # libtool to hard-code these into programs
3402  ;;
3403
3404cygwin* | mingw* | pw32* | cegcc*)
3405  version_type=windows
3406  shrext_cmds=".dll"
3407  need_version=no
3408  need_lib_prefix=no
3409
3410  case $GCC,$cc_basename in
3411  yes,*)
3412    # gcc
3413    library_names_spec='$libname.dll.a'
3414    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3415    postinstall_cmds='base_file=`basename \${file}`~
3416      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3417      dldir=$destdir/`dirname \$dlpath`~
3418      test -d \$dldir || mkdir -p \$dldir~
3419      $install_prog $dir/$dlname \$dldir/$dlname~
3420      chmod a+x \$dldir/$dlname~
3421      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3422        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3423      fi'
3424    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3425      dlpath=$dir/\$dldll~
3426       $RM \$dlpath'
3427    shlibpath_overrides_runpath=yes
3428
3429    case $host_os in
3430    cygwin*)
3431      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3432      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3433m4_if([$1], [],[
3434      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3435      ;;
3436    mingw* | cegcc*)
3437      # MinGW DLLs use traditional 'lib' prefix
3438      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3439      ;;
3440    pw32*)
3441      # pw32 DLLs use 'pw' prefix rather than 'lib'
3442      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3443      ;;
3444    esac
3445    dynamic_linker='Win32 ld.exe'
3446    ;;
3447
3448  *,cl*)
3449    # Native MSVC
3450    libname_spec='$name'
3451    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3452    library_names_spec='${libname}.dll.lib'
3453
3454    case $build_os in
3455    mingw*)
3456      sys_lib_search_path_spec=
3457      lt_save_ifs=$IFS
3458      IFS=';'
3459      for lt_path in $LIB
3460      do
3461        IFS=$lt_save_ifs
3462        # Let DOS variable expansion print the short 8.3 style file name.
3463        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3464        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3465      done
3466      IFS=$lt_save_ifs
3467      # Convert to MSYS style.
3468      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3469      ;;
3470    cygwin*)
3471      # Convert to unix form, then to dos form, then back to unix form
3472      # but this time dos style (no spaces!) so that the unix form looks
3473      # like /cygdrive/c/PROGRA~1:/cygdr...
3474      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3475      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3476      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3477      ;;
3478    *)
3479      sys_lib_search_path_spec="$LIB"
3480      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3481        # It is most probably a Windows format PATH.
3482        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3483      else
3484        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3485      fi
3486      # FIXME: find the short name or the path components, as spaces are
3487      # common. (e.g. "Program Files" -> "PROGRA~1")
3488      ;;
3489    esac
3490
3491    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3492    postinstall_cmds='base_file=`basename \${file}`~
3493      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3494      dldir=$destdir/`dirname \$dlpath`~
3495      test -d \$dldir || mkdir -p \$dldir~
3496      $install_prog $dir/$dlname \$dldir/$dlname'
3497    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3498      dlpath=$dir/\$dldll~
3499       $RM \$dlpath'
3500    shlibpath_overrides_runpath=yes
3501    dynamic_linker='Win32 link.exe'
3502    ;;
3503
3504  *)
3505    # Assume MSVC wrapper
3506    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3507    dynamic_linker='Win32 ld.exe'
3508    ;;
3509  esac
3510  # FIXME: first we should search . and the directory the executable is in
3511  shlibpath_var=PATH
3512  ;;
3513
3514darwin* | rhapsody*)
3515  dynamic_linker="$host_os dyld"
3516  version_type=darwin
3517  need_lib_prefix=no
3518  need_version=no
3519  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3520  soname_spec='${libname}${release}${major}$shared_ext'
3521  shlibpath_overrides_runpath=yes
3522  shlibpath_var=DYLD_LIBRARY_PATH
3523  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3524m4_if([$1], [],[
3525  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3526  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3527  ;;
3528
3529dgux*)
3530  version_type=linux # correct to gnu/linux during the next big refactor
3531  need_lib_prefix=no
3532  need_version=no
3533  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3534  soname_spec='${libname}${release}${shared_ext}$major'
3535  shlibpath_var=LD_LIBRARY_PATH
3536  ;;
3537
3538freebsd* | dragonfly*)
3539  # DragonFly does not have aout.  When/if they implement a new
3540  # versioning mechanism, adjust this.
3541  if test -x /usr/bin/objformat; then
3542    objformat=`/usr/bin/objformat`
3543  else
3544    case $host_os in
3545    freebsd[[23]].*) objformat=aout ;;
3546    *) objformat=elf ;;
3547    esac
3548  fi
3549  version_type=freebsd-$objformat
3550  case $version_type in
3551    freebsd-elf*)
3552      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3553      need_version=no
3554      need_lib_prefix=no
3555      ;;
3556    freebsd-*)
3557      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3558      need_version=yes
3559      ;;
3560  esac
3561  shlibpath_var=LD_LIBRARY_PATH
3562  case $host_os in
3563  freebsd2.*)
3564    shlibpath_overrides_runpath=yes
3565    ;;
3566  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3567    shlibpath_overrides_runpath=yes
3568    hardcode_into_libs=yes
3569    ;;
3570  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3571  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3572    shlibpath_overrides_runpath=no
3573    hardcode_into_libs=yes
3574    ;;
3575  *) # from 4.6 on, and DragonFly
3576    shlibpath_overrides_runpath=yes
3577    hardcode_into_libs=yes
3578    ;;
3579  esac
3580  ;;
3581
3582gnu*)
3583  version_type=linux # correct to gnu/linux during the next big refactor
3584  need_lib_prefix=no
3585  need_version=no
3586  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3587  soname_spec='${libname}${release}${shared_ext}$major'
3588  shlibpath_var=LD_LIBRARY_PATH
3589  shlibpath_overrides_runpath=no
3590  hardcode_into_libs=yes
3591  ;;
3592
3593haiku*)
3594  version_type=linux # correct to gnu/linux during the next big refactor
3595  need_lib_prefix=no
3596  need_version=no
3597  dynamic_linker="$host_os runtime_loader"
3598  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3599  soname_spec='${libname}${release}${shared_ext}$major'
3600  shlibpath_var=LIBRARY_PATH
3601  shlibpath_overrides_runpath=yes
3602  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3603  hardcode_into_libs=yes
3604  ;;
3605
3606hpux9* | hpux10* | hpux11*)
3607  # Give a soname corresponding to the major version so that dld.sl refuses to
3608  # link against other versions.
3609  version_type=sunos
3610  need_lib_prefix=no
3611  need_version=no
3612  case $host_cpu in
3613  ia64*)
3614    shrext_cmds='.so'
3615    hardcode_into_libs=yes
3616    dynamic_linker="$host_os dld.so"
3617    shlibpath_var=LD_LIBRARY_PATH
3618    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3619    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3620    soname_spec='${libname}${release}${shared_ext}$major'
3621    if test "X$HPUX_IA64_MODE" = X32; then
3622      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3623    else
3624      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3625    fi
3626    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3627    ;;
3628  hppa*64*)
3629    shrext_cmds='.sl'
3630    hardcode_into_libs=yes
3631    dynamic_linker="$host_os dld.sl"
3632    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3633    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3634    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3635    soname_spec='${libname}${release}${shared_ext}$major'
3636    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3637    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3638    ;;
3639  *)
3640    shrext_cmds='.sl'
3641    dynamic_linker="$host_os dld.sl"
3642    shlibpath_var=SHLIB_PATH
3643    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3644    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3645    soname_spec='${libname}${release}${shared_ext}$major'
3646    ;;
3647  esac
3648  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3649  postinstall_cmds='chmod 555 $lib'
3650  # or fails outright, so override atomically:
3651  install_override_mode=555
3652  ;;
3653
3654interix[[3-9]]*)
3655  version_type=linux # correct to gnu/linux during the next big refactor
3656  need_lib_prefix=no
3657  need_version=no
3658  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3659  soname_spec='${libname}${release}${shared_ext}$major'
3660  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3661  shlibpath_var=LD_LIBRARY_PATH
3662  shlibpath_overrides_runpath=no
3663  hardcode_into_libs=yes
3664  ;;
3665
3666irix5* | irix6* | nonstopux*)
3667  case $host_os in
3668    nonstopux*) version_type=nonstopux ;;
3669    *)
3670	if test "$lt_cv_prog_gnu_ld" = yes; then
3671		version_type=linux # correct to gnu/linux during the next big refactor
3672	else
3673		version_type=irix
3674	fi ;;
3675  esac
3676  need_lib_prefix=no
3677  need_version=no
3678  soname_spec='${libname}${release}${shared_ext}$major'
3679  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3680  case $host_os in
3681  irix5* | nonstopux*)
3682    libsuff= shlibsuff=
3683    ;;
3684  *)
3685    case $LD in # libtool.m4 will add one of these switches to LD
3686    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3687      libsuff= shlibsuff= libmagic=32-bit;;
3688    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3689      libsuff=32 shlibsuff=N32 libmagic=N32;;
3690    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3691      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3692    *) libsuff= shlibsuff= libmagic=never-match;;
3693    esac
3694    ;;
3695  esac
3696  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3697  shlibpath_overrides_runpath=no
3698  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3699  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3700  hardcode_into_libs=yes
3701  ;;
3702
3703# No shared lib support for Linux oldld, aout, or coff.
3704linux*oldld* | linux*aout* | linux*coff*)
3705  dynamic_linker=no
3706  ;;
3707
3708# This must be glibc/ELF.
3709linux* | k*bsd*-gnu | kopensolaris*-gnu)
3710  version_type=linux # correct to gnu/linux during the next big refactor
3711  need_lib_prefix=no
3712  need_version=no
3713  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3714  soname_spec='${libname}${release}${shared_ext}$major'
3715  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3716  shlibpath_var=LD_LIBRARY_PATH
3717  shlibpath_overrides_runpath=no
3718
3719  # Some binutils ld are patched to set DT_RUNPATH
3720  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3721    [lt_cv_shlibpath_overrides_runpath=no
3722    save_LDFLAGS=$LDFLAGS
3723    save_libdir=$libdir
3724    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3725	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3726    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3727      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3728	 [lt_cv_shlibpath_overrides_runpath=yes])])
3729    LDFLAGS=$save_LDFLAGS
3730    libdir=$save_libdir
3731    ])
3732  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3733
3734  # This implies no fast_install, which is unacceptable.
3735  # Some rework will be needed to allow for fast_install
3736  # before this can be enabled.
3737  hardcode_into_libs=yes
3738
3739  # Append ld.so.conf contents to the search path
3740  if test -f /etc/ld.so.conf; then
3741    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' ' '`
3742    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3743  fi
3744
3745  # We used to test for /lib/ld.so.1 and disable shared libraries on
3746  # powerpc, because MkLinux only supported shared libraries with the
3747  # GNU dynamic linker.  Since this was broken with cross compilers,
3748  # most powerpc-linux boxes support dynamic linking these days and
3749  # people can always --disable-shared, the test was removed, and we
3750  # assume the GNU/Linux dynamic linker is in use.
3751  dynamic_linker='GNU/Linux ld.so'
3752  ;;
3753
3754netbsd*)
3755  version_type=sunos
3756  need_lib_prefix=no
3757  need_version=no
3758  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3759    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3760    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3761    dynamic_linker='NetBSD (a.out) ld.so'
3762  else
3763    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3764    soname_spec='${libname}${release}${shared_ext}$major'
3765    dynamic_linker='NetBSD ld.elf_so'
3766  fi
3767  shlibpath_var=LD_LIBRARY_PATH
3768  shlibpath_overrides_runpath=yes
3769  hardcode_into_libs=yes
3770  ;;
3771
3772newsos6)
3773  version_type=linux # correct to gnu/linux during the next big refactor
3774  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3775  shlibpath_var=LD_LIBRARY_PATH
3776  shlibpath_overrides_runpath=yes
3777  ;;
3778
3779*nto* | *qnx*)
3780  version_type=qnx
3781  need_lib_prefix=no
3782  need_version=no
3783  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3784  soname_spec='${libname}${release}${shared_ext}$major'
3785  shlibpath_var=LD_LIBRARY_PATH
3786  shlibpath_overrides_runpath=no
3787  hardcode_into_libs=yes
3788  dynamic_linker='ldqnx.so'
3789  ;;
3790
3791openbsd*)
3792  version_type=sunos
3793  sys_lib_dlsearch_path_spec="/usr/lib"
3794  need_lib_prefix=no
3795  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3796  case $host_os in
3797    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3798    *)				need_version=no  ;;
3799  esac
3800  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3801  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3802  shlibpath_var=LD_LIBRARY_PATH
3803  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3804    case $host_os in
3805      openbsd2.[[89]] | openbsd2.[[89]].*)
3806	shlibpath_overrides_runpath=no
3807	;;
3808      *)
3809	shlibpath_overrides_runpath=yes
3810	;;
3811      esac
3812  else
3813    shlibpath_overrides_runpath=yes
3814  fi
3815  ;;
3816
3817os2*)
3818  libname_spec='$name'
3819  shrext_cmds=".dll"
3820  need_lib_prefix=no
3821  library_names_spec='$libname${shared_ext} $libname.a'
3822  dynamic_linker='OS/2 ld.exe'
3823  shlibpath_var=LIBPATH
3824  ;;
3825
3826osf3* | osf4* | osf5*)
3827  version_type=osf
3828  need_lib_prefix=no
3829  need_version=no
3830  soname_spec='${libname}${release}${shared_ext}$major'
3831  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3832  shlibpath_var=LD_LIBRARY_PATH
3833  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3834  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3835  ;;
3836
3837rdos*)
3838  dynamic_linker=no
3839  ;;
3840
3841solaris*)
3842  version_type=linux # correct to gnu/linux during the next big refactor
3843  need_lib_prefix=no
3844  need_version=no
3845  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3846  soname_spec='${libname}${release}${shared_ext}$major'
3847  shlibpath_var=LD_LIBRARY_PATH
3848  shlibpath_overrides_runpath=yes
3849  hardcode_into_libs=yes
3850  # ldd complains unless libraries are executable
3851  postinstall_cmds='chmod +x $lib'
3852  ;;
3853
3854sunos4*)
3855  version_type=sunos
3856  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3857  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3858  shlibpath_var=LD_LIBRARY_PATH
3859  shlibpath_overrides_runpath=yes
3860  if test "$with_gnu_ld" = yes; then
3861    need_lib_prefix=no
3862  fi
3863  need_version=yes
3864  ;;
3865
3866sysv4 | sysv4.3*)
3867  version_type=linux # correct to gnu/linux during the next big refactor
3868  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3869  soname_spec='${libname}${release}${shared_ext}$major'
3870  shlibpath_var=LD_LIBRARY_PATH
3871  case $host_vendor in
3872    sni)
3873      shlibpath_overrides_runpath=no
3874      need_lib_prefix=no
3875      runpath_var=LD_RUN_PATH
3876      ;;
3877    siemens)
3878      need_lib_prefix=no
3879      ;;
3880    motorola)
3881      need_lib_prefix=no
3882      need_version=no
3883      shlibpath_overrides_runpath=no
3884      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3885      ;;
3886  esac
3887  ;;
3888
3889sysv4*MP*)
3890  if test -d /usr/nec ;then
3891    version_type=linux # correct to gnu/linux during the next big refactor
3892    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3893    soname_spec='$libname${shared_ext}.$major'
3894    shlibpath_var=LD_LIBRARY_PATH
3895  fi
3896  ;;
3897
3898sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3899  version_type=freebsd-elf
3900  need_lib_prefix=no
3901  need_version=no
3902  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3903  soname_spec='${libname}${release}${shared_ext}$major'
3904  shlibpath_var=LD_LIBRARY_PATH
3905  shlibpath_overrides_runpath=yes
3906  hardcode_into_libs=yes
3907  if test "$with_gnu_ld" = yes; then
3908    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3909  else
3910    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3911    case $host_os in
3912      sco3.2v5*)
3913        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3914	;;
3915    esac
3916  fi
3917  sys_lib_dlsearch_path_spec='/usr/lib'
3918  ;;
3919
3920tpf*)
3921  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3922  version_type=linux # correct to gnu/linux during the next big refactor
3923  need_lib_prefix=no
3924  need_version=no
3925  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3926  shlibpath_var=LD_LIBRARY_PATH
3927  shlibpath_overrides_runpath=no
3928  hardcode_into_libs=yes
3929  ;;
3930
3931uts4*)
3932  version_type=linux # correct to gnu/linux during the next big refactor
3933  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3934  soname_spec='${libname}${release}${shared_ext}$major'
3935  shlibpath_var=LD_LIBRARY_PATH
3936  ;;
3937
3938*)
3939  dynamic_linker=no
3940  ;;
3941esac
3942AC_MSG_RESULT([$dynamic_linker])
3943test "$dynamic_linker" = no && can_build_shared=no
3944
3945variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3946if test "$GCC" = yes; then
3947  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3948fi
3949
3950if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3951  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3952fi
3953if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3954  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3955fi
3956
3957_LT_DECL([], [variables_saved_for_relink], [1],
3958    [Variables whose values should be saved in libtool wrapper scripts and
3959    restored at link time])
3960_LT_DECL([], [need_lib_prefix], [0],
3961    [Do we need the "lib" prefix for modules?])
3962_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3963_LT_DECL([], [version_type], [0], [Library versioning type])
3964_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3965_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3966_LT_DECL([], [shlibpath_overrides_runpath], [0],
3967    [Is shlibpath searched before the hard-coded library search path?])
3968_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3969_LT_DECL([], [library_names_spec], [1],
3970    [[List of archive names.  First name is the real one, the rest are links.
3971    The last name is the one that the linker finds with -lNAME]])
3972_LT_DECL([], [soname_spec], [1],
3973    [[The coded name of the library, if different from the real name]])
3974_LT_DECL([], [install_override_mode], [1],
3975    [Permission mode override for installation of shared libraries])
3976_LT_DECL([], [postinstall_cmds], [2],
3977    [Command to use after installation of a shared archive])
3978_LT_DECL([], [postuninstall_cmds], [2],
3979    [Command to use after uninstallation of a shared archive])
3980_LT_DECL([], [finish_cmds], [2],
3981    [Commands used to finish a libtool library installation in a directory])
3982_LT_DECL([], [finish_eval], [1],
3983    [[As "finish_cmds", except a single script fragment to be evaled but
3984    not shown]])
3985_LT_DECL([], [hardcode_into_libs], [0],
3986    [Whether we should hardcode library paths into libraries])
3987_LT_DECL([], [sys_lib_search_path_spec], [2],
3988    [Compile-time system search path for libraries])
3989_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3990    [Run-time system search path for libraries])
3991])# _LT_SYS_DYNAMIC_LINKER
3992
3993
3994# _LT_PATH_TOOL_PREFIX(TOOL)
3995# --------------------------
3996# find a file program which can recognize shared library
3997AC_DEFUN([_LT_PATH_TOOL_PREFIX],
3998[m4_require([_LT_DECL_EGREP])dnl
3999AC_MSG_CHECKING([for $1])
4000AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4001[case $MAGIC_CMD in
4002[[\\/*] |  ?:[\\/]*])
4003  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4004  ;;
4005*)
4006  lt_save_MAGIC_CMD="$MAGIC_CMD"
4007  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4008dnl $ac_dummy forces splitting on constant user-supplied paths.
4009dnl POSIX.2 word splitting is done only on the output of word expansions,
4010dnl not every word.  This closes a longstanding sh security hole.
4011  ac_dummy="m4_if([$2], , $PATH, [$2])"
4012  for ac_dir in $ac_dummy; do
4013    IFS="$lt_save_ifs"
4014    test -z "$ac_dir" && ac_dir=.
4015    if test -f $ac_dir/$1; then
4016      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4017      if test -n "$file_magic_test_file"; then
4018	case $deplibs_check_method in
4019	"file_magic "*)
4020	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
4021	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4022	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4023	    $EGREP "$file_magic_regex" > /dev/null; then
4024	    :
4025	  else
4026	    cat <<_LT_EOF 1>&2
4027
4028*** Warning: the command libtool uses to detect shared libraries,
4029*** $file_magic_cmd, produces output that libtool cannot recognize.
4030*** The result is that libtool may fail to recognize shared libraries
4031*** as such.  This will affect the creation of libtool libraries that
4032*** depend on shared libraries, but programs linked with such libtool
4033*** libraries will work regardless of this problem.  Nevertheless, you
4034*** may want to report the problem to your system manager and/or to
4035*** bug-libtool@gnu.org
4036
4037_LT_EOF
4038	  fi ;;
4039	esac
4040      fi
4041      break
4042    fi
4043  done
4044  IFS="$lt_save_ifs"
4045  MAGIC_CMD="$lt_save_MAGIC_CMD"
4046  ;;
4047esac])
4048MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4049if test -n "$MAGIC_CMD"; then
4050  AC_MSG_RESULT($MAGIC_CMD)
4051else
4052  AC_MSG_RESULT(no)
4053fi
4054_LT_DECL([], [MAGIC_CMD], [0],
4055	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4056])# _LT_PATH_TOOL_PREFIX
4057
4058# Old name:
4059AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4060dnl aclocal-1.4 backwards compatibility:
4061dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4062
4063
4064# _LT_PATH_MAGIC
4065# --------------
4066# find a file program which can recognize a shared library
4067m4_defun([_LT_PATH_MAGIC],
4068[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4069if test -z "$lt_cv_path_MAGIC_CMD"; then
4070  if test -n "$ac_tool_prefix"; then
4071    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4072  else
4073    MAGIC_CMD=:
4074  fi
4075fi
4076])# _LT_PATH_MAGIC
4077
4078
4079# LT_PATH_LD
4080# ----------
4081# find the pathname to the GNU or non-GNU linker
4082AC_DEFUN([LT_PATH_LD],
4083[AC_REQUIRE([AC_PROG_CC])dnl
4084AC_REQUIRE([AC_CANONICAL_HOST])dnl
4085AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4086m4_require([_LT_DECL_SED])dnl
4087m4_require([_LT_DECL_EGREP])dnl
4088m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4089
4090AC_ARG_WITH([gnu-ld],
4091    [AS_HELP_STRING([--with-gnu-ld],
4092	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4093    [test "$withval" = no || with_gnu_ld=yes],
4094    [with_gnu_ld=no])dnl
4095
4096ac_prog=ld
4097if test "$GCC" = yes; then
4098  # Check if gcc -print-prog-name=ld gives a path.
4099  AC_MSG_CHECKING([for ld used by $CC])
4100  case $host in
4101  *-*-mingw*)
4102    # gcc leaves a trailing carriage return which upsets mingw
4103    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4104  *)
4105    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4106  esac
4107  case $ac_prog in
4108    # Accept absolute paths.
4109    [[\\/]]* | ?:[[\\/]]*)
4110      re_direlt='/[[^/]][[^/]]*/\.\./'
4111      # Canonicalize the pathname of ld
4112      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4113      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4114	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4115      done
4116      test -z "$LD" && LD="$ac_prog"
4117      ;;
4118  "")
4119    # If it fails, then pretend we aren't using GCC.
4120    ac_prog=ld
4121    ;;
4122  *)
4123    # If it is relative, then search for the first ld in PATH.
4124    with_gnu_ld=unknown
4125    ;;
4126  esac
4127elif test "$with_gnu_ld" = yes; then
4128  AC_MSG_CHECKING([for GNU ld])
4129else
4130  AC_MSG_CHECKING([for non-GNU ld])
4131fi
4132AC_CACHE_VAL(lt_cv_path_LD,
4133[if test -z "$LD"; then
4134  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4135  for ac_dir in $PATH; do
4136    IFS="$lt_save_ifs"
4137    test -z "$ac_dir" && ac_dir=.
4138    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4139      lt_cv_path_LD="$ac_dir/$ac_prog"
4140      # Check to see if the program is GNU ld.  I'd rather use --version,
4141      # but apparently some variants of GNU ld only accept -v.
4142      # Break only if it was the GNU/non-GNU ld that we prefer.
4143      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4144      *GNU* | *'with BFD'*)
4145	test "$with_gnu_ld" != no && break
4146	;;
4147      *)
4148	test "$with_gnu_ld" != yes && break
4149	;;
4150      esac
4151    fi
4152  done
4153  IFS="$lt_save_ifs"
4154else
4155  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4156fi])
4157LD="$lt_cv_path_LD"
4158if test -n "$LD"; then
4159  AC_MSG_RESULT($LD)
4160else
4161  AC_MSG_RESULT(no)
4162fi
4163test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4164_LT_PATH_LD_GNU
4165AC_SUBST([LD])
4166
4167_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4168])# LT_PATH_LD
4169
4170# Old names:
4171AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4172AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4173dnl aclocal-1.4 backwards compatibility:
4174dnl AC_DEFUN([AM_PROG_LD], [])
4175dnl AC_DEFUN([AC_PROG_LD], [])
4176
4177
4178# _LT_PATH_LD_GNU
4179#- --------------
4180m4_defun([_LT_PATH_LD_GNU],
4181[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4182[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4183case `$LD -v 2>&1 </dev/null` in
4184*GNU* | *'with BFD'*)
4185  lt_cv_prog_gnu_ld=yes
4186  ;;
4187*)
4188  lt_cv_prog_gnu_ld=no
4189  ;;
4190esac])
4191with_gnu_ld=$lt_cv_prog_gnu_ld
4192])# _LT_PATH_LD_GNU
4193
4194
4195# _LT_CMD_RELOAD
4196# --------------
4197# find reload flag for linker
4198#   -- PORTME Some linkers may need a different reload flag.
4199m4_defun([_LT_CMD_RELOAD],
4200[AC_CACHE_CHECK([for $LD option to reload object files],
4201  lt_cv_ld_reload_flag,
4202  [lt_cv_ld_reload_flag='-r'])
4203reload_flag=$lt_cv_ld_reload_flag
4204case $reload_flag in
4205"" | " "*) ;;
4206*) reload_flag=" $reload_flag" ;;
4207esac
4208reload_cmds='$LD$reload_flag -o $output$reload_objs'
4209case $host_os in
4210  cygwin* | mingw* | pw32* | cegcc*)
4211    if test "$GCC" != yes; then
4212      reload_cmds=false
4213    fi
4214    ;;
4215  darwin*)
4216    if test "$GCC" = yes; then
4217      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4218    else
4219      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4220    fi
4221    ;;
4222esac
4223_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4224_LT_TAGDECL([], [reload_cmds], [2])dnl
4225])# _LT_CMD_RELOAD
4226
4227
4228# _LT_CHECK_MAGIC_METHOD
4229# ----------------------
4230# how to check for library dependencies
4231#  -- PORTME fill in with the dynamic library characteristics
4232m4_defun([_LT_CHECK_MAGIC_METHOD],
4233[m4_require([_LT_DECL_EGREP])
4234m4_require([_LT_DECL_OBJDUMP])
4235AC_CACHE_CHECK([how to recognize dependent libraries],
4236lt_cv_deplibs_check_method,
4237[lt_cv_file_magic_cmd='$MAGIC_CMD'
4238lt_cv_file_magic_test_file=
4239lt_cv_deplibs_check_method='unknown'
4240# Need to set the preceding variable on all platforms that support
4241# interlibrary dependencies.
4242# 'none' -- dependencies not supported.
4243# `unknown' -- same as none, but documents that we really don't know.
4244# 'pass_all' -- all dependencies passed with no checks.
4245# 'test_compile' -- check by making test program.
4246# 'file_magic [[regex]]' -- check by looking for files in library path
4247# which responds to the $file_magic_cmd with a given extended regex.
4248# If you have `file' or equivalent on your system and you're not sure
4249# whether `pass_all' will *always* work, you probably want this one.
4250
4251case $host_os in
4252aix[[4-9]]*)
4253  lt_cv_deplibs_check_method=pass_all
4254  ;;
4255
4256beos*)
4257  lt_cv_deplibs_check_method=pass_all
4258  ;;
4259
4260bsdi[[45]]*)
4261  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4262  lt_cv_file_magic_cmd='/usr/bin/file -L'
4263  lt_cv_file_magic_test_file=/shlib/libc.so
4264  ;;
4265
4266cygwin*)
4267  # func_win32_libid is a shell function defined in ltmain.sh
4268  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4269  lt_cv_file_magic_cmd='func_win32_libid'
4270  ;;
4271
4272mingw* | pw32*)
4273  # Base MSYS/MinGW do not provide the 'file' command needed by
4274  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4275  # unless we find 'file', for example because we are cross-compiling.
4276  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4277  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4278    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4279    lt_cv_file_magic_cmd='func_win32_libid'
4280  else
4281    # Keep this pattern in sync with the one in func_win32_libid.
4282    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4283    lt_cv_file_magic_cmd='$OBJDUMP -f'
4284  fi
4285  ;;
4286
4287cegcc*)
4288  # use the weaker test based on 'objdump'. See mingw*.
4289  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4290  lt_cv_file_magic_cmd='$OBJDUMP -f'
4291  ;;
4292
4293darwin* | rhapsody*)
4294  lt_cv_deplibs_check_method=pass_all
4295  ;;
4296
4297freebsd* | dragonfly*)
4298  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4299    case $host_cpu in
4300    i*86 )
4301      # Not sure whether the presence of OpenBSD here was a mistake.
4302      # Let's accept both of them until this is cleared up.
4303      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4304      lt_cv_file_magic_cmd=/usr/bin/file
4305      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4306      ;;
4307    esac
4308  else
4309    lt_cv_deplibs_check_method=pass_all
4310  fi
4311  ;;
4312
4313gnu*)
4314  lt_cv_deplibs_check_method=pass_all
4315  ;;
4316
4317haiku*)
4318  lt_cv_deplibs_check_method=pass_all
4319  ;;
4320
4321hpux10.20* | hpux11*)
4322  lt_cv_file_magic_cmd=/usr/bin/file
4323  case $host_cpu in
4324  ia64*)
4325    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4326    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4327    ;;
4328  hppa*64*)
4329    [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]']
4330    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4331    ;;
4332  *)
4333    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4334    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4335    ;;
4336  esac
4337  ;;
4338
4339interix[[3-9]]*)
4340  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4341  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4342  ;;
4343
4344irix5* | irix6* | nonstopux*)
4345  case $LD in
4346  *-32|*"-32 ") libmagic=32-bit;;
4347  *-n32|*"-n32 ") libmagic=N32;;
4348  *-64|*"-64 ") libmagic=64-bit;;
4349  *) libmagic=never-match;;
4350  esac
4351  lt_cv_deplibs_check_method=pass_all
4352  ;;
4353
4354# This must be glibc/ELF.
4355linux* | k*bsd*-gnu | kopensolaris*-gnu)
4356  lt_cv_deplibs_check_method=pass_all
4357  ;;
4358
4359netbsd*)
4360  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4361    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4362  else
4363    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4364  fi
4365  ;;
4366
4367newos6*)
4368  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4369  lt_cv_file_magic_cmd=/usr/bin/file
4370  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4371  ;;
4372
4373*nto* | *qnx*)
4374  lt_cv_deplibs_check_method=pass_all
4375  ;;
4376
4377openbsd*)
4378  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4379    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4380  else
4381    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4382  fi
4383  ;;
4384
4385osf3* | osf4* | osf5*)
4386  lt_cv_deplibs_check_method=pass_all
4387  ;;
4388
4389rdos*)
4390  lt_cv_deplibs_check_method=pass_all
4391  ;;
4392
4393solaris*)
4394  lt_cv_deplibs_check_method=pass_all
4395  ;;
4396
4397sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4398  lt_cv_deplibs_check_method=pass_all
4399  ;;
4400
4401sysv4 | sysv4.3*)
4402  case $host_vendor in
4403  motorola)
4404    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]]'
4405    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4406    ;;
4407  ncr)
4408    lt_cv_deplibs_check_method=pass_all
4409    ;;
4410  sequent)
4411    lt_cv_file_magic_cmd='/bin/file'
4412    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4413    ;;
4414  sni)
4415    lt_cv_file_magic_cmd='/bin/file'
4416    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4417    lt_cv_file_magic_test_file=/lib/libc.so
4418    ;;
4419  siemens)
4420    lt_cv_deplibs_check_method=pass_all
4421    ;;
4422  pc)
4423    lt_cv_deplibs_check_method=pass_all
4424    ;;
4425  esac
4426  ;;
4427
4428tpf*)
4429  lt_cv_deplibs_check_method=pass_all
4430  ;;
4431esac
4432])
4433
4434file_magic_glob=
4435want_nocaseglob=no
4436if test "$build" = "$host"; then
4437  case $host_os in
4438  mingw* | pw32*)
4439    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4440      want_nocaseglob=yes
4441    else
4442      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4443    fi
4444    ;;
4445  esac
4446fi
4447
4448file_magic_cmd=$lt_cv_file_magic_cmd
4449deplibs_check_method=$lt_cv_deplibs_check_method
4450test -z "$deplibs_check_method" && deplibs_check_method=unknown
4451
4452_LT_DECL([], [deplibs_check_method], [1],
4453    [Method to check whether dependent libraries are shared objects])
4454_LT_DECL([], [file_magic_cmd], [1],
4455    [Command to use when deplibs_check_method = "file_magic"])
4456_LT_DECL([], [file_magic_glob], [1],
4457    [How to find potential files when deplibs_check_method = "file_magic"])
4458_LT_DECL([], [want_nocaseglob], [1],
4459    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4460])# _LT_CHECK_MAGIC_METHOD
4461
4462
4463# LT_PATH_NM
4464# ----------
4465# find the pathname to a BSD- or MS-compatible name lister
4466AC_DEFUN([LT_PATH_NM],
4467[AC_REQUIRE([AC_PROG_CC])dnl
4468AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4469[if test -n "$NM"; then
4470  # Let the user override the test.
4471  lt_cv_path_NM="$NM"
4472else
4473  lt_nm_to_check="${ac_tool_prefix}nm"
4474  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4475    lt_nm_to_check="$lt_nm_to_check nm"
4476  fi
4477  for lt_tmp_nm in $lt_nm_to_check; do
4478    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4479    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4480      IFS="$lt_save_ifs"
4481      test -z "$ac_dir" && ac_dir=.
4482      tmp_nm="$ac_dir/$lt_tmp_nm"
4483      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4484	# Check to see if the nm accepts a BSD-compat flag.
4485	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4486	#   nm: unknown option "B" ignored
4487	# Tru64's nm complains that /dev/null is an invalid object file
4488	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4489	*/dev/null* | *'Invalid file or object type'*)
4490	  lt_cv_path_NM="$tmp_nm -B"
4491	  break
4492	  ;;
4493	*)
4494	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4495	  */dev/null*)
4496	    lt_cv_path_NM="$tmp_nm -p"
4497	    break
4498	    ;;
4499	  *)
4500	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4501	    continue # so that we can try to find one that supports BSD flags
4502	    ;;
4503	  esac
4504	  ;;
4505	esac
4506      fi
4507    done
4508    IFS="$lt_save_ifs"
4509  done
4510  : ${lt_cv_path_NM=no}
4511fi])
4512if test "$lt_cv_path_NM" != "no"; then
4513  NM="$lt_cv_path_NM"
4514else
4515  # Didn't find any BSD compatible name lister, look for dumpbin.
4516  if test -n "$DUMPBIN"; then :
4517    # Let the user override the test.
4518  else
4519    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4520    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4521    *COFF*)
4522      DUMPBIN="$DUMPBIN -symbols"
4523      ;;
4524    *)
4525      DUMPBIN=:
4526      ;;
4527    esac
4528  fi
4529  AC_SUBST([DUMPBIN])
4530  if test "$DUMPBIN" != ":"; then
4531    NM="$DUMPBIN"
4532  fi
4533fi
4534test -z "$NM" && NM=nm
4535AC_SUBST([NM])
4536_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4537
4538AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4539  [lt_cv_nm_interface="BSD nm"
4540  echo "int some_variable = 0;" > conftest.$ac_ext
4541  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4542  (eval "$ac_compile" 2>conftest.err)
4543  cat conftest.err >&AS_MESSAGE_LOG_FD
4544  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4545  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4546  cat conftest.err >&AS_MESSAGE_LOG_FD
4547  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4548  cat conftest.out >&AS_MESSAGE_LOG_FD
4549  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4550    lt_cv_nm_interface="MS dumpbin"
4551  fi
4552  rm -f conftest*])
4553])# LT_PATH_NM
4554
4555# Old names:
4556AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4557AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4558dnl aclocal-1.4 backwards compatibility:
4559dnl AC_DEFUN([AM_PROG_NM], [])
4560dnl AC_DEFUN([AC_PROG_NM], [])
4561
4562# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4563# --------------------------------
4564# how to determine the name of the shared library
4565# associated with a specific link library.
4566#  -- PORTME fill in with the dynamic library characteristics
4567m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4568[m4_require([_LT_DECL_EGREP])
4569m4_require([_LT_DECL_OBJDUMP])
4570m4_require([_LT_DECL_DLLTOOL])
4571AC_CACHE_CHECK([how to associate runtime and link libraries],
4572lt_cv_sharedlib_from_linklib_cmd,
4573[lt_cv_sharedlib_from_linklib_cmd='unknown'
4574
4575case $host_os in
4576cygwin* | mingw* | pw32* | cegcc*)
4577  # two different shell functions defined in ltmain.sh
4578  # decide which to use based on capabilities of $DLLTOOL
4579  case `$DLLTOOL --help 2>&1` in
4580  *--identify-strict*)
4581    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4582    ;;
4583  *)
4584    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4585    ;;
4586  esac
4587  ;;
4588*)
4589  # fallback: assume linklib IS sharedlib
4590  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4591  ;;
4592esac
4593])
4594sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4595test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4596
4597_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4598    [Command to associate shared and link libraries])
4599])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4600
4601
4602# _LT_PATH_MANIFEST_TOOL
4603# ----------------------
4604# locate the manifest tool
4605m4_defun([_LT_PATH_MANIFEST_TOOL],
4606[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4607test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4608AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4609  [lt_cv_path_mainfest_tool=no
4610  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4611  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4612  cat conftest.err >&AS_MESSAGE_LOG_FD
4613  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4614    lt_cv_path_mainfest_tool=yes
4615  fi
4616  rm -f conftest*])
4617if test "x$lt_cv_path_mainfest_tool" != xyes; then
4618  MANIFEST_TOOL=:
4619fi
4620_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4621])# _LT_PATH_MANIFEST_TOOL
4622
4623
4624# LT_LIB_M
4625# --------
4626# check for math library
4627AC_DEFUN([LT_LIB_M],
4628[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4629LIBM=
4630case $host in
4631*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4632  # These system don't have libm, or don't need it
4633  ;;
4634*-ncr-sysv4.3*)
4635  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4636  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4637  ;;
4638*)
4639  AC_CHECK_LIB(m, cos, LIBM="-lm")
4640  ;;
4641esac
4642AC_SUBST([LIBM])
4643])# LT_LIB_M
4644
4645# Old name:
4646AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4647dnl aclocal-1.4 backwards compatibility:
4648dnl AC_DEFUN([AC_CHECK_LIBM], [])
4649
4650
4651# _LT_COMPILER_NO_RTTI([TAGNAME])
4652# -------------------------------
4653m4_defun([_LT_COMPILER_NO_RTTI],
4654[m4_require([_LT_TAG_COMPILER])dnl
4655
4656_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4657
4658if test "$GCC" = yes; then
4659  case $cc_basename in
4660  nvcc*)
4661    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4662  *)
4663    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4664  esac
4665
4666  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4667    lt_cv_prog_compiler_rtti_exceptions,
4668    [-fno-rtti -fno-exceptions], [],
4669    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4670fi
4671_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4672	[Compiler flag to turn off builtin functions])
4673])# _LT_COMPILER_NO_RTTI
4674
4675
4676# _LT_CMD_GLOBAL_SYMBOLS
4677# ----------------------
4678m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4679[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4680AC_REQUIRE([AC_PROG_CC])dnl
4681AC_REQUIRE([AC_PROG_AWK])dnl
4682AC_REQUIRE([LT_PATH_NM])dnl
4683AC_REQUIRE([LT_PATH_LD])dnl
4684m4_require([_LT_DECL_SED])dnl
4685m4_require([_LT_DECL_EGREP])dnl
4686m4_require([_LT_TAG_COMPILER])dnl
4687
4688# Check for command to grab the raw symbol name followed by C symbol from nm.
4689AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4690AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4691[
4692# These are sane defaults that work on at least a few old systems.
4693# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4694
4695# Character class describing NM global symbol codes.
4696symcode='[[BCDEGRST]]'
4697
4698# Regexp to match symbols that can be accessed directly from C.
4699sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4700
4701# Define system-specific variables.
4702case $host_os in
4703aix*)
4704  symcode='[[BCDT]]'
4705  ;;
4706cygwin* | mingw* | pw32* | cegcc*)
4707  symcode='[[ABCDGISTW]]'
4708  ;;
4709hpux*)
4710  if test "$host_cpu" = ia64; then
4711    symcode='[[ABCDEGRST]]'
4712  fi
4713  ;;
4714irix* | nonstopux*)
4715  symcode='[[BCDEGRST]]'
4716  ;;
4717osf*)
4718  symcode='[[BCDEGQRST]]'
4719  ;;
4720solaris*)
4721  symcode='[[BDRT]]'
4722  ;;
4723sco3.2v5*)
4724  symcode='[[DT]]'
4725  ;;
4726sysv4.2uw2*)
4727  symcode='[[DT]]'
4728  ;;
4729sysv5* | sco5v6* | unixware* | OpenUNIX*)
4730  symcode='[[ABDT]]'
4731  ;;
4732sysv4)
4733  symcode='[[DFNSTU]]'
4734  ;;
4735esac
4736
4737# If we're using GNU nm, then use its standard symbol codes.
4738case `$NM -V 2>&1` in
4739*GNU* | *'with BFD'*)
4740  symcode='[[ABCDGIRSTW]]' ;;
4741esac
4742
4743# Transform an extracted symbol line into a proper C declaration.
4744# Some systems (esp. on ia64) link data and code symbols differently,
4745# so use this general approach.
4746lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4747
4748# Transform an extracted symbol line into symbol name and symbol address
4749lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4750lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
4751
4752# Handle CRLF in mingw tool chain
4753opt_cr=
4754case $build_os in
4755mingw*)
4756  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4757  ;;
4758esac
4759
4760# Try without a prefix underscore, then with it.
4761for ac_symprfx in "" "_"; do
4762
4763  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4764  symxfrm="\\1 $ac_symprfx\\2 \\2"
4765
4766  # Write the raw and C identifiers.
4767  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4768    # Fake it for dumpbin and say T for any non-static function
4769    # and D for any global variable.
4770    # Also find C++ and __fastcall symbols from MSVC++,
4771    # which start with @ or ?.
4772    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4773"     {last_section=section; section=\$ 3};"\
4774"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4775"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4776"     \$ 0!~/External *\|/{next};"\
4777"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4778"     {if(hide[section]) next};"\
4779"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4780"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4781"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4782"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4783"     ' prfx=^$ac_symprfx]"
4784  else
4785    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4786  fi
4787  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4788
4789  # Check to see that the pipe works correctly.
4790  pipe_works=no
4791
4792  rm -f conftest*
4793  cat > conftest.$ac_ext <<_LT_EOF
4794#ifdef __cplusplus
4795extern "C" {
4796#endif
4797char nm_test_var;
4798void nm_test_func(void);
4799void nm_test_func(void){}
4800#ifdef __cplusplus
4801}
4802#endif
4803int main(){nm_test_var='a';nm_test_func();return(0);}
4804_LT_EOF
4805
4806  if AC_TRY_EVAL(ac_compile); then
4807    # Now try to grab the symbols.
4808    nlist=conftest.nm
4809    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4810      # Try sorting and uniquifying the output.
4811      if sort "$nlist" | uniq > "$nlist"T; then
4812	mv -f "$nlist"T "$nlist"
4813      else
4814	rm -f "$nlist"T
4815      fi
4816
4817      # Make sure that we snagged all the symbols we need.
4818      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4819	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4820	  cat <<_LT_EOF > conftest.$ac_ext
4821/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4822#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4823/* DATA imports from DLLs on WIN32 con't be const, because runtime
4824   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4825# define LT@&t@_DLSYM_CONST
4826#elif defined(__osf__)
4827/* This system does not cope well with relocations in const data.  */
4828# define LT@&t@_DLSYM_CONST
4829#else
4830# define LT@&t@_DLSYM_CONST const
4831#endif
4832
4833#ifdef __cplusplus
4834extern "C" {
4835#endif
4836
4837_LT_EOF
4838	  # Now generate the symbol file.
4839	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4840
4841	  cat <<_LT_EOF >> conftest.$ac_ext
4842
4843/* The mapping between symbol names and symbols.  */
4844LT@&t@_DLSYM_CONST struct {
4845  const char *name;
4846  void       *address;
4847}
4848lt__PROGRAM__LTX_preloaded_symbols[[]] =
4849{
4850  { "@PROGRAM@", (void *) 0 },
4851_LT_EOF
4852	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4853	  cat <<\_LT_EOF >> conftest.$ac_ext
4854  {0, (void *) 0}
4855};
4856
4857/* This works around a problem in FreeBSD linker */
4858#ifdef FREEBSD_WORKAROUND
4859static const void *lt_preloaded_setup() {
4860  return lt__PROGRAM__LTX_preloaded_symbols;
4861}
4862#endif
4863
4864#ifdef __cplusplus
4865}
4866#endif
4867_LT_EOF
4868	  # Now try linking the two files.
4869	  mv conftest.$ac_objext conftstm.$ac_objext
4870	  lt_globsym_save_LIBS=$LIBS
4871	  lt_globsym_save_CFLAGS=$CFLAGS
4872	  LIBS="conftstm.$ac_objext"
4873	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4874	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4875	    pipe_works=yes
4876	  fi
4877	  LIBS=$lt_globsym_save_LIBS
4878	  CFLAGS=$lt_globsym_save_CFLAGS
4879	else
4880	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4881	fi
4882      else
4883	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4884      fi
4885    else
4886      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4887    fi
4888  else
4889    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4890    cat conftest.$ac_ext >&5
4891  fi
4892  rm -rf conftest* conftst*
4893
4894  # Do not use the global_symbol_pipe unless it works.
4895  if test "$pipe_works" = yes; then
4896    break
4897  else
4898    lt_cv_sys_global_symbol_pipe=
4899  fi
4900done
4901])
4902if test -z "$lt_cv_sys_global_symbol_pipe"; then
4903  lt_cv_sys_global_symbol_to_cdecl=
4904fi
4905if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4906  AC_MSG_RESULT(failed)
4907else
4908  AC_MSG_RESULT(ok)
4909fi
4910
4911# Response file support.
4912if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4913  nm_file_list_spec='@'
4914elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4915  nm_file_list_spec='@'
4916fi
4917
4918_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4919    [Take the output of nm and produce a listing of raw symbols and C names])
4920_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4921    [Transform the output of nm in a proper C declaration])
4922_LT_DECL([global_symbol_to_c_name_address],
4923    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4924    [Transform the output of nm in a C name address pair])
4925_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4926    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4927    [Transform the output of nm in a C name address pair when lib prefix is needed])
4928_LT_DECL([], [nm_file_list_spec], [1],
4929    [Specify filename containing input files for $NM])
4930]) # _LT_CMD_GLOBAL_SYMBOLS
4931
4932
4933# _LT_COMPILER_PIC([TAGNAME])
4934# ---------------------------
4935m4_defun([_LT_COMPILER_PIC],
4936[m4_require([_LT_TAG_COMPILER])dnl
4937_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4938_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4939_LT_TAGVAR(lt_prog_compiler_static, $1)=
4940
4941m4_if([$1], [CXX], [
4942  # C++ specific cases for pic, static, wl, etc.
4943  if test "$GXX" = yes; then
4944    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4945    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4946
4947    case $host_os in
4948    aix*)
4949      # All AIX code is PIC.
4950      if test "$host_cpu" = ia64; then
4951	# AIX 5 now supports IA64 processor
4952	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4953      fi
4954      ;;
4955
4956    amigaos*)
4957      case $host_cpu in
4958      powerpc)
4959            # see comment about AmigaOS4 .so support
4960            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4961        ;;
4962      m68k)
4963            # FIXME: we need at least 68020 code to build shared libraries, but
4964            # adding the `-m68020' flag to GCC prevents building anything better,
4965            # like `-m68040'.
4966            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4967        ;;
4968      esac
4969      ;;
4970
4971    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4972      # PIC is the default for these OSes.
4973      ;;
4974    mingw* | cygwin* | os2* | pw32* | cegcc*)
4975      # This hack is so that the source file can tell whether it is being
4976      # built for inclusion in a dll (and should export symbols for example).
4977      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4978      # (--disable-auto-import) libraries
4979      m4_if([$1], [GCJ], [],
4980	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4981      ;;
4982    darwin* | rhapsody*)
4983      # PIC is the default on this platform
4984      # Common symbols not allowed in MH_DYLIB files
4985      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4986      ;;
4987    *djgpp*)
4988      # DJGPP does not support shared libraries at all
4989      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4990      ;;
4991    haiku*)
4992      # PIC is the default for Haiku.
4993      # The "-static" flag exists, but is broken.
4994      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4995      ;;
4996    interix[[3-9]]*)
4997      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4998      # Instead, we relocate shared libraries at runtime.
4999      ;;
5000    sysv4*MP*)
5001      if test -d /usr/nec; then
5002	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5003      fi
5004      ;;
5005    hpux*)
5006      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5007      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5008      # sets the default TLS model and affects inlining.
5009      case $host_cpu in
5010      hppa*64*)
5011	;;
5012      *)
5013	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5014	;;
5015      esac
5016      ;;
5017    *qnx* | *nto*)
5018      # QNX uses GNU C++, but need to define -shared option too, otherwise
5019      # it will coredump.
5020      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5021      ;;
5022    *)
5023      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5024      ;;
5025    esac
5026  else
5027    case $host_os in
5028      aix[[4-9]]*)
5029	# All AIX code is PIC.
5030	if test "$host_cpu" = ia64; then
5031	  # AIX 5 now supports IA64 processor
5032	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5033	else
5034	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5035	fi
5036	;;
5037      chorus*)
5038	case $cc_basename in
5039	cxch68*)
5040	  # Green Hills C++ Compiler
5041	  # _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"
5042	  ;;
5043	esac
5044	;;
5045      mingw* | cygwin* | os2* | pw32* | cegcc*)
5046	# This hack is so that the source file can tell whether it is being
5047	# built for inclusion in a dll (and should export symbols for example).
5048	m4_if([$1], [GCJ], [],
5049	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5050	;;
5051      dgux*)
5052	case $cc_basename in
5053	  ec++*)
5054	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5055	    ;;
5056	  ghcx*)
5057	    # Green Hills C++ Compiler
5058	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5059	    ;;
5060	  *)
5061	    ;;
5062	esac
5063	;;
5064      freebsd* | dragonfly*)
5065	# FreeBSD uses GNU C++
5066	;;
5067      hpux9* | hpux10* | hpux11*)
5068	case $cc_basename in
5069	  CC*)
5070	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5071	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5072	    if test "$host_cpu" != ia64; then
5073	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5074	    fi
5075	    ;;
5076	  aCC*)
5077	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5078	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5079	    case $host_cpu in
5080	    hppa*64*|ia64*)
5081	      # +Z the default
5082	      ;;
5083	    *)
5084	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5085	      ;;
5086	    esac
5087	    ;;
5088	  *)
5089	    ;;
5090	esac
5091	;;
5092      interix*)
5093	# This is c89, which is MS Visual C++ (no shared libs)
5094	# Anyone wants to do a port?
5095	;;
5096      irix5* | irix6* | nonstopux*)
5097	case $cc_basename in
5098	  CC*)
5099	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5100	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5101	    # CC pic flag -KPIC is the default.
5102	    ;;
5103	  *)
5104	    ;;
5105	esac
5106	;;
5107      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5108	case $cc_basename in
5109	  KCC*)
5110	    # KAI C++ Compiler
5111	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5112	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5113	    ;;
5114	  ecpc* )
5115	    # old Intel C++ for x86_64 which still supported -KPIC.
5116	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5117	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5118	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5119	    ;;
5120	  icpc* )
5121	    # Intel C++, used to be incompatible with GCC.
5122	    # ICC 10 doesn't accept -KPIC any more.
5123	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5124	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5125	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5126	    ;;
5127	  pgCC* | pgcpp*)
5128	    # Portland Group C++ compiler
5129	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5130	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5131	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5132	    ;;
5133	  cxx*)
5134	    # Compaq C++
5135	    # Make sure the PIC flag is empty.  It appears that all Alpha
5136	    # Linux and Compaq Tru64 Unix objects are PIC.
5137	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5138	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5139	    ;;
5140	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5141	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5142	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5143	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5144	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5145	    ;;
5146	  *)
5147	    case `$CC -V 2>&1 | sed 5q` in
5148	    *Sun\ C*)
5149	      # Sun C++ 5.9
5150	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5151	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5152	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5153	      ;;
5154	    esac
5155	    ;;
5156	esac
5157	;;
5158      lynxos*)
5159	;;
5160      m88k*)
5161	;;
5162      mvs*)
5163	case $cc_basename in
5164	  cxx*)
5165	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5166	    ;;
5167	  *)
5168	    ;;
5169	esac
5170	;;
5171      netbsd*)
5172	;;
5173      *qnx* | *nto*)
5174        # QNX uses GNU C++, but need to define -shared option too, otherwise
5175        # it will coredump.
5176        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5177        ;;
5178      osf3* | osf4* | osf5*)
5179	case $cc_basename in
5180	  KCC*)
5181	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5182	    ;;
5183	  RCC*)
5184	    # Rational C++ 2.4.1
5185	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5186	    ;;
5187	  cxx*)
5188	    # Digital/Compaq C++
5189	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5190	    # Make sure the PIC flag is empty.  It appears that all Alpha
5191	    # Linux and Compaq Tru64 Unix objects are PIC.
5192	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5193	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5194	    ;;
5195	  *)
5196	    ;;
5197	esac
5198	;;
5199      psos*)
5200	;;
5201      solaris*)
5202	case $cc_basename in
5203	  CC* | sunCC*)
5204	    # Sun C++ 4.2, 5.x and Centerline C++
5205	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5206	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5207	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5208	    ;;
5209	  gcx*)
5210	    # Green Hills C++ Compiler
5211	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5212	    ;;
5213	  *)
5214	    ;;
5215	esac
5216	;;
5217      sunos4*)
5218	case $cc_basename in
5219	  CC*)
5220	    # Sun C++ 4.x
5221	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5222	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5223	    ;;
5224	  lcc*)
5225	    # Lucid
5226	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5227	    ;;
5228	  *)
5229	    ;;
5230	esac
5231	;;
5232      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5233	case $cc_basename in
5234	  CC*)
5235	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5236	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5237	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5238	    ;;
5239	esac
5240	;;
5241      tandem*)
5242	case $cc_basename in
5243	  NCC*)
5244	    # NonStop-UX NCC 3.20
5245	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5246	    ;;
5247	  *)
5248	    ;;
5249	esac
5250	;;
5251      vxworks*)
5252	;;
5253      *)
5254	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5255	;;
5256    esac
5257  fi
5258],
5259[
5260  if test "$GCC" = yes; then
5261    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5262    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5263
5264    case $host_os in
5265      aix*)
5266      # All AIX code is PIC.
5267      if test "$host_cpu" = ia64; then
5268	# AIX 5 now supports IA64 processor
5269	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5270      fi
5271      ;;
5272
5273    amigaos*)
5274      case $host_cpu in
5275      powerpc)
5276            # see comment about AmigaOS4 .so support
5277            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5278        ;;
5279      m68k)
5280            # FIXME: we need at least 68020 code to build shared libraries, but
5281            # adding the `-m68020' flag to GCC prevents building anything better,
5282            # like `-m68040'.
5283            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5284        ;;
5285      esac
5286      ;;
5287
5288    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5289      # PIC is the default for these OSes.
5290      ;;
5291
5292    mingw* | cygwin* | pw32* | os2* | cegcc*)
5293      # This hack is so that the source file can tell whether it is being
5294      # built for inclusion in a dll (and should export symbols for example).
5295      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5296      # (--disable-auto-import) libraries
5297      m4_if([$1], [GCJ], [],
5298	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5299      ;;
5300
5301    darwin* | rhapsody*)
5302      # PIC is the default on this platform
5303      # Common symbols not allowed in MH_DYLIB files
5304      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5305      ;;
5306
5307    haiku*)
5308      # PIC is the default for Haiku.
5309      # The "-static" flag exists, but is broken.
5310      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5311      ;;
5312
5313    hpux*)
5314      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5315      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5316      # sets the default TLS model and affects inlining.
5317      case $host_cpu in
5318      hppa*64*)
5319	# +Z the default
5320	;;
5321      *)
5322	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5323	;;
5324      esac
5325      ;;
5326
5327    interix[[3-9]]*)
5328      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5329      # Instead, we relocate shared libraries at runtime.
5330      ;;
5331
5332    msdosdjgpp*)
5333      # Just because we use GCC doesn't mean we suddenly get shared libraries
5334      # on systems that don't support them.
5335      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5336      enable_shared=no
5337      ;;
5338
5339    *nto* | *qnx*)
5340      # QNX uses GNU C++, but need to define -shared option too, otherwise
5341      # it will coredump.
5342      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5343      ;;
5344
5345    sysv4*MP*)
5346      if test -d /usr/nec; then
5347	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5348      fi
5349      ;;
5350
5351    *)
5352      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5353      ;;
5354    esac
5355
5356    case $cc_basename in
5357    nvcc*) # Cuda Compiler Driver 2.2
5358      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5359      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5360        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5361      fi
5362      ;;
5363    esac
5364  else
5365    # PORTME Check for flag to pass linker flags through the system compiler.
5366    case $host_os in
5367    aix*)
5368      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5369      if test "$host_cpu" = ia64; then
5370	# AIX 5 now supports IA64 processor
5371	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5372      else
5373	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5374      fi
5375      ;;
5376
5377    mingw* | cygwin* | pw32* | os2* | cegcc*)
5378      # This hack is so that the source file can tell whether it is being
5379      # built for inclusion in a dll (and should export symbols for example).
5380      m4_if([$1], [GCJ], [],
5381	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5382      ;;
5383
5384    hpux9* | hpux10* | hpux11*)
5385      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5386      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5387      # not for PA HP-UX.
5388      case $host_cpu in
5389      hppa*64*|ia64*)
5390	# +Z the default
5391	;;
5392      *)
5393	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5394	;;
5395      esac
5396      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5397      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5398      ;;
5399
5400    irix5* | irix6* | nonstopux*)
5401      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5402      # PIC (with -KPIC) is the default.
5403      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5404      ;;
5405
5406    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5407      case $cc_basename in
5408      # old Intel for x86_64 which still supported -KPIC.
5409      ecc*)
5410	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5411	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5412	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5413        ;;
5414      # icc used to be incompatible with GCC.
5415      # ICC 10 doesn't accept -KPIC any more.
5416      icc* | ifort*)
5417	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5418	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5419	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5420        ;;
5421      # Lahey Fortran 8.1.
5422      lf95*)
5423	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5424	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5425	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5426	;;
5427      nagfor*)
5428	# NAG Fortran compiler
5429	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5430	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5431	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5432	;;
5433      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5434        # Portland Group compilers (*not* the Pentium gcc compiler,
5435	# which looks to be a dead project)
5436	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5437	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5438	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5439        ;;
5440      ccc*)
5441        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5442        # All Alpha code is PIC.
5443        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5444        ;;
5445      xl* | bgxl* | bgf* | mpixl*)
5446	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5447	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5448	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5449	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5450	;;
5451      *)
5452	case `$CC -V 2>&1 | sed 5q` in
5453	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5454	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5455	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5456	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5457	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5458	  ;;
5459	*Sun\ F* | *Sun*Fortran*)
5460	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5461	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5462	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5463	  ;;
5464	*Sun\ C*)
5465	  # Sun C 5.9
5466	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5467	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5468	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5469	  ;;
5470        *Intel*\ [[CF]]*Compiler*)
5471	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5472	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5473	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5474	  ;;
5475	*Portland\ Group*)
5476	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5477	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5478	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5479	  ;;
5480	esac
5481	;;
5482      esac
5483      ;;
5484
5485    newsos6)
5486      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5487      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5488      ;;
5489
5490    *nto* | *qnx*)
5491      # QNX uses GNU C++, but need to define -shared option too, otherwise
5492      # it will coredump.
5493      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5494      ;;
5495
5496    osf3* | osf4* | osf5*)
5497      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5498      # All OSF/1 code is PIC.
5499      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5500      ;;
5501
5502    rdos*)
5503      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5504      ;;
5505
5506    solaris*)
5507      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5508      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5509      case $cc_basename in
5510      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5511	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5512      *)
5513	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5514      esac
5515      ;;
5516
5517    sunos4*)
5518      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5519      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5520      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5521      ;;
5522
5523    sysv4 | sysv4.2uw2* | sysv4.3*)
5524      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5525      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5526      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5527      ;;
5528
5529    sysv4*MP*)
5530      if test -d /usr/nec ;then
5531	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5532	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5533      fi
5534      ;;
5535
5536    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5537      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5538      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5539      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5540      ;;
5541
5542    unicos*)
5543      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5544      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5545      ;;
5546
5547    uts4*)
5548      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5549      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5550      ;;
5551
5552    *)
5553      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5554      ;;
5555    esac
5556  fi
5557])
5558case $host_os in
5559  # For platforms which do not support PIC, -DPIC is meaningless:
5560  *djgpp*)
5561    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5562    ;;
5563  *)
5564    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5565    ;;
5566esac
5567
5568AC_CACHE_CHECK([for $compiler option to produce PIC],
5569  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5570  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5571_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5572
5573#
5574# Check to make sure the PIC flag actually works.
5575#
5576if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5577  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5578    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5579    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5580    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5581     "" | " "*) ;;
5582     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5583     esac],
5584    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5585     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5586fi
5587_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5588	[Additional compiler flags for building library objects])
5589
5590_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5591	[How to pass a linker flag through the compiler])
5592#
5593# Check to make sure the static flag actually works.
5594#
5595wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5596_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5597  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5598  $lt_tmp_static_flag,
5599  [],
5600  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5601_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5602	[Compiler flag to prevent dynamic linking])
5603])# _LT_COMPILER_PIC
5604
5605
5606# _LT_LINKER_SHLIBS([TAGNAME])
5607# ----------------------------
5608# See if the linker supports building shared libraries.
5609m4_defun([_LT_LINKER_SHLIBS],
5610[AC_REQUIRE([LT_PATH_LD])dnl
5611AC_REQUIRE([LT_PATH_NM])dnl
5612m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5613m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5614m4_require([_LT_DECL_EGREP])dnl
5615m4_require([_LT_DECL_SED])dnl
5616m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5617m4_require([_LT_TAG_COMPILER])dnl
5618AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5619m4_if([$1], [CXX], [
5620  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5621  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5622  case $host_os in
5623  aix[[4-9]]*)
5624    # If we're using GNU nm, then we don't want the "-C" option.
5625    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5626    # Also, AIX nm treats weak defined symbols like other global defined
5627    # symbols, whereas GNU nm marks them as "W".
5628    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5629      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5630    else
5631      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5632    fi
5633    ;;
5634  pw32*)
5635    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5636    ;;
5637  cygwin* | mingw* | cegcc*)
5638    case $cc_basename in
5639    cl*)
5640      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5641      ;;
5642    *)
5643      _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'
5644      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5645      ;;
5646    esac
5647    ;;
5648  *)
5649    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5650    ;;
5651  esac
5652], [
5653  runpath_var=
5654  _LT_TAGVAR(allow_undefined_flag, $1)=
5655  _LT_TAGVAR(always_export_symbols, $1)=no
5656  _LT_TAGVAR(archive_cmds, $1)=
5657  _LT_TAGVAR(archive_expsym_cmds, $1)=
5658  _LT_TAGVAR(compiler_needs_object, $1)=no
5659  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5660  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5661  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5662  _LT_TAGVAR(hardcode_automatic, $1)=no
5663  _LT_TAGVAR(hardcode_direct, $1)=no
5664  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5665  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5666  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5667  _LT_TAGVAR(hardcode_minus_L, $1)=no
5668  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5669  _LT_TAGVAR(inherit_rpath, $1)=no
5670  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5671  _LT_TAGVAR(module_cmds, $1)=
5672  _LT_TAGVAR(module_expsym_cmds, $1)=
5673  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5674  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5675  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5676  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5677  # include_expsyms should be a list of space-separated symbols to be *always*
5678  # included in the symbol list
5679  _LT_TAGVAR(include_expsyms, $1)=
5680  # exclude_expsyms can be an extended regexp of symbols to exclude
5681  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5682  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5683  # as well as any symbol that contains `d'.
5684  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5685  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5686  # platforms (ab)use it in PIC code, but their linkers get confused if
5687  # the symbol is explicitly referenced.  Since portable code cannot
5688  # rely on this symbol name, it's probably fine to never include it in
5689  # preloaded symbol tables.
5690  # Exclude shared library initialization/finalization symbols.
5691dnl Note also adjust exclude_expsyms for C++ above.
5692  extract_expsyms_cmds=
5693
5694  case $host_os in
5695  cygwin* | mingw* | pw32* | cegcc*)
5696    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5697    # When not using gcc, we currently assume that we are using
5698    # Microsoft Visual C++.
5699    if test "$GCC" != yes; then
5700      with_gnu_ld=no
5701    fi
5702    ;;
5703  interix*)
5704    # we just hope/assume this is gcc and not c89 (= MSVC++)
5705    with_gnu_ld=yes
5706    ;;
5707  openbsd*)
5708    with_gnu_ld=no
5709    ;;
5710  esac
5711
5712  _LT_TAGVAR(ld_shlibs, $1)=yes
5713
5714  # On some targets, GNU ld is compatible enough with the native linker
5715  # that we're better off using the native interface for both.
5716  lt_use_gnu_ld_interface=no
5717  if test "$with_gnu_ld" = yes; then
5718    case $host_os in
5719      aix*)
5720	# The AIX port of GNU ld has always aspired to compatibility
5721	# with the native linker.  However, as the warning in the GNU ld
5722	# block says, versions before 2.19.5* couldn't really create working
5723	# shared libraries, regardless of the interface used.
5724	case `$LD -v 2>&1` in
5725	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5726	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5727	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5728	  *)
5729	    lt_use_gnu_ld_interface=yes
5730	    ;;
5731	esac
5732	;;
5733      *)
5734	lt_use_gnu_ld_interface=yes
5735	;;
5736    esac
5737  fi
5738
5739  if test "$lt_use_gnu_ld_interface" = yes; then
5740    # If archive_cmds runs LD, not CC, wlarc should be empty
5741    wlarc='${wl}'
5742
5743    # Set some defaults for GNU ld with shared library support. These
5744    # are reset later if shared libraries are not supported. Putting them
5745    # here allows them to be overridden if necessary.
5746    runpath_var=LD_RUN_PATH
5747    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5748    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5749    # ancient GNU ld didn't support --whole-archive et. al.
5750    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5751      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5752    else
5753      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5754    fi
5755    supports_anon_versioning=no
5756    case `$LD -v 2>&1` in
5757      *GNU\ gold*) supports_anon_versioning=yes ;;
5758      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5759      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5760      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5761      *\ 2.11.*) ;; # other 2.11 versions
5762      *) supports_anon_versioning=yes ;;
5763    esac
5764
5765    # See if GNU ld supports shared libraries.
5766    case $host_os in
5767    aix[[3-9]]*)
5768      # On AIX/PPC, the GNU linker is very broken
5769      if test "$host_cpu" != ia64; then
5770	_LT_TAGVAR(ld_shlibs, $1)=no
5771	cat <<_LT_EOF 1>&2
5772
5773*** Warning: the GNU linker, at least up to release 2.19, is reported
5774*** to be unable to reliably create shared libraries on AIX.
5775*** Therefore, libtool is disabling shared libraries support.  If you
5776*** really care for shared libraries, you may want to install binutils
5777*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5778*** You will then need to restart the configuration process.
5779
5780_LT_EOF
5781      fi
5782      ;;
5783
5784    amigaos*)
5785      case $host_cpu in
5786      powerpc)
5787            # see comment about AmigaOS4 .so support
5788            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5789            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5790        ;;
5791      m68k)
5792            _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)'
5793            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5794            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5795        ;;
5796      esac
5797      ;;
5798
5799    beos*)
5800      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5801	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5802	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5803	# support --undefined.  This deserves some investigation.  FIXME
5804	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5805      else
5806	_LT_TAGVAR(ld_shlibs, $1)=no
5807      fi
5808      ;;
5809
5810    cygwin* | mingw* | pw32* | cegcc*)
5811      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5812      # as there is no search path for DLLs.
5813      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5814      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5815      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5816      _LT_TAGVAR(always_export_symbols, $1)=no
5817      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5818      _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'
5819      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5820
5821      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5822        _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'
5823	# If the export-symbols file already is a .def file (1st line
5824	# is EXPORTS), use it as is; otherwise, prepend...
5825	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5826	  cp $export_symbols $output_objdir/$soname.def;
5827	else
5828	  echo EXPORTS > $output_objdir/$soname.def;
5829	  cat $export_symbols >> $output_objdir/$soname.def;
5830	fi~
5831	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5832      else
5833	_LT_TAGVAR(ld_shlibs, $1)=no
5834      fi
5835      ;;
5836
5837    haiku*)
5838      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5839      _LT_TAGVAR(link_all_deplibs, $1)=yes
5840      ;;
5841
5842    interix[[3-9]]*)
5843      _LT_TAGVAR(hardcode_direct, $1)=no
5844      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5845      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5846      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5847      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5848      # Instead, shared libraries are loaded at an image base (0x10000000 by
5849      # default) and relocated if they conflict, which is a slow very memory
5850      # consuming and fragmenting process.  To avoid this, we pick a random,
5851      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5852      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5853      _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'
5854      _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'
5855      ;;
5856
5857    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5858      tmp_diet=no
5859      if test "$host_os" = linux-dietlibc; then
5860	case $cc_basename in
5861	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5862	esac
5863      fi
5864      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5865	 && test "$tmp_diet" = no
5866      then
5867	tmp_addflag=' $pic_flag'
5868	tmp_sharedflag='-shared'
5869	case $cc_basename,$host_cpu in
5870        pgcc*)				# Portland Group C compiler
5871	  _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'
5872	  tmp_addflag=' $pic_flag'
5873	  ;;
5874	pgf77* | pgf90* | pgf95* | pgfortran*)
5875					# Portland Group f77 and f90 compilers
5876	  _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'
5877	  tmp_addflag=' $pic_flag -Mnomain' ;;
5878	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5879	  tmp_addflag=' -i_dynamic' ;;
5880	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5881	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5882	ifc* | ifort*)			# Intel Fortran compiler
5883	  tmp_addflag=' -nofor_main' ;;
5884	lf95*)				# Lahey Fortran 8.1
5885	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5886	  tmp_sharedflag='--shared' ;;
5887	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5888	  tmp_sharedflag='-qmkshrobj'
5889	  tmp_addflag= ;;
5890	nvcc*)	# Cuda Compiler Driver 2.2
5891	  _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'
5892	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5893	  ;;
5894	esac
5895	case `$CC -V 2>&1 | sed 5q` in
5896	*Sun\ C*)			# Sun C 5.9
5897	  _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'
5898	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5899	  tmp_sharedflag='-G' ;;
5900	*Sun\ F*)			# Sun Fortran 8.3
5901	  tmp_sharedflag='-G' ;;
5902	esac
5903	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5904
5905        if test "x$supports_anon_versioning" = xyes; then
5906          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5907	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5908	    echo "local: *; };" >> $output_objdir/$libname.ver~
5909	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5910        fi
5911
5912	case $cc_basename in
5913	xlf* | bgf* | bgxlf* | mpixlf*)
5914	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5915	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5916	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5917	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5918	  if test "x$supports_anon_versioning" = xyes; then
5919	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5920	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5921	      echo "local: *; };" >> $output_objdir/$libname.ver~
5922	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5923	  fi
5924	  ;;
5925	esac
5926      else
5927        _LT_TAGVAR(ld_shlibs, $1)=no
5928      fi
5929      ;;
5930
5931    netbsd*)
5932      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5933	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5934	wlarc=
5935      else
5936	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5937	_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'
5938      fi
5939      ;;
5940
5941    solaris*)
5942      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5943	_LT_TAGVAR(ld_shlibs, $1)=no
5944	cat <<_LT_EOF 1>&2
5945
5946*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5947*** create shared libraries on Solaris systems.  Therefore, libtool
5948*** is disabling shared libraries support.  We urge you to upgrade GNU
5949*** binutils to release 2.9.1 or newer.  Another option is to modify
5950*** your PATH or compiler configuration so that the native linker is
5951*** used, and then restart.
5952
5953_LT_EOF
5954      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5955	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5956	_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'
5957      else
5958	_LT_TAGVAR(ld_shlibs, $1)=no
5959      fi
5960      ;;
5961
5962    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5963      case `$LD -v 2>&1` in
5964        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5965	_LT_TAGVAR(ld_shlibs, $1)=no
5966	cat <<_LT_EOF 1>&2
5967
5968*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5969*** reliably create shared libraries on SCO systems.  Therefore, libtool
5970*** is disabling shared libraries support.  We urge you to upgrade GNU
5971*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5972*** your PATH or compiler configuration so that the native linker is
5973*** used, and then restart.
5974
5975_LT_EOF
5976	;;
5977	*)
5978	  # For security reasons, it is highly recommended that you always
5979	  # use absolute paths for naming shared libraries, and exclude the
5980	  # DT_RUNPATH tag from executables and libraries.  But doing so
5981	  # requires that you compile everything twice, which is a pain.
5982	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5983	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5984	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5985	    _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'
5986	  else
5987	    _LT_TAGVAR(ld_shlibs, $1)=no
5988	  fi
5989	;;
5990      esac
5991      ;;
5992
5993    sunos4*)
5994      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5995      wlarc=
5996      _LT_TAGVAR(hardcode_direct, $1)=yes
5997      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5998      ;;
5999
6000    *)
6001      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6002	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6003	_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'
6004      else
6005	_LT_TAGVAR(ld_shlibs, $1)=no
6006      fi
6007      ;;
6008    esac
6009
6010    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
6011      runpath_var=
6012      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6013      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6014      _LT_TAGVAR(whole_archive_flag_spec, $1)=
6015    fi
6016  else
6017    # PORTME fill in a description of your system's linker (not GNU ld)
6018    case $host_os in
6019    aix3*)
6020      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6021      _LT_TAGVAR(always_export_symbols, $1)=yes
6022      _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'
6023      # Note: this linker hardcodes the directories in LIBPATH if there
6024      # are no directories specified by -L.
6025      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6026      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6027	# Neither direct hardcoding nor static linking is supported with a
6028	# broken collect2.
6029	_LT_TAGVAR(hardcode_direct, $1)=unsupported
6030      fi
6031      ;;
6032
6033    aix[[4-9]]*)
6034      if test "$host_cpu" = ia64; then
6035	# On IA64, the linker does run time linking by default, so we don't
6036	# have to do anything special.
6037	aix_use_runtimelinking=no
6038	exp_sym_flag='-Bexport'
6039	no_entry_flag=""
6040      else
6041	# If we're using GNU nm, then we don't want the "-C" option.
6042	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6043	# Also, AIX nm treats weak defined symbols like other global
6044	# defined symbols, whereas GNU nm marks them as "W".
6045	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6046	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6047	else
6048	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6049	fi
6050	aix_use_runtimelinking=no
6051
6052	# Test if we are trying to use run time linking or normal
6053	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6054	# need to do runtime linking.
6055	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6056	  for ld_flag in $LDFLAGS; do
6057	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6058	    aix_use_runtimelinking=yes
6059	    break
6060	  fi
6061	  done
6062	  ;;
6063	esac
6064
6065	exp_sym_flag='-bexport'
6066	no_entry_flag='-bnoentry'
6067      fi
6068
6069      # When large executables or shared objects are built, AIX ld can
6070      # have problems creating the table of contents.  If linking a library
6071      # or program results in "error TOC overflow" add -mminimal-toc to
6072      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6073      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6074
6075      _LT_TAGVAR(archive_cmds, $1)=''
6076      _LT_TAGVAR(hardcode_direct, $1)=yes
6077      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6078      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6079      _LT_TAGVAR(link_all_deplibs, $1)=yes
6080      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6081
6082      if test "$GCC" = yes; then
6083	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6084	# We only want to do this on AIX 4.2 and lower, the check
6085	# below for broken collect2 doesn't work under 4.3+
6086	  collect2name=`${CC} -print-prog-name=collect2`
6087	  if test -f "$collect2name" &&
6088	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6089	  then
6090	  # We have reworked collect2
6091	  :
6092	  else
6093	  # We have old collect2
6094	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6095	  # It fails to find uninstalled libraries when the uninstalled
6096	  # path is not listed in the libpath.  Setting hardcode_minus_L
6097	  # to unsupported forces relinking
6098	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6099	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6100	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6101	  fi
6102	  ;;
6103	esac
6104	shared_flag='-shared'
6105	if test "$aix_use_runtimelinking" = yes; then
6106	  shared_flag="$shared_flag "'${wl}-G'
6107	fi
6108      else
6109	# not using gcc
6110	if test "$host_cpu" = ia64; then
6111	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6112	# chokes on -Wl,-G. The following line is correct:
6113	  shared_flag='-G'
6114	else
6115	  if test "$aix_use_runtimelinking" = yes; then
6116	    shared_flag='${wl}-G'
6117	  else
6118	    shared_flag='${wl}-bM:SRE'
6119	  fi
6120	fi
6121      fi
6122
6123      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6124      # It seems that -bexpall does not export symbols beginning with
6125      # underscore (_), so it is better to generate a list of symbols to export.
6126      _LT_TAGVAR(always_export_symbols, $1)=yes
6127      if test "$aix_use_runtimelinking" = yes; then
6128	# Warning - without using the other runtime loading flags (-brtl),
6129	# -berok will link without error, but may produce a broken library.
6130	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6131        # Determine the default libpath from the value encoded in an
6132        # empty executable.
6133        _LT_SYS_MODULE_PATH_AIX([$1])
6134        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6135        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6136      else
6137	if test "$host_cpu" = ia64; then
6138	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6139	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6140	  _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"
6141	else
6142	 # Determine the default libpath from the value encoded in an
6143	 # empty executable.
6144	 _LT_SYS_MODULE_PATH_AIX([$1])
6145	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6146	  # Warning - without using the other run time loading flags,
6147	  # -berok will link without error, but may produce a broken library.
6148	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6149	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6150	  if test "$with_gnu_ld" = yes; then
6151	    # We only use this code for GNU lds that support --whole-archive.
6152	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6153	  else
6154	    # Exported symbols can be pulled into shared objects from archives
6155	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6156	  fi
6157	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6158	  # This is similar to how AIX traditionally builds its shared libraries.
6159	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6160	fi
6161      fi
6162      ;;
6163
6164    amigaos*)
6165      case $host_cpu in
6166      powerpc)
6167            # see comment about AmigaOS4 .so support
6168            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6169            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6170        ;;
6171      m68k)
6172            _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)'
6173            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6174            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6175        ;;
6176      esac
6177      ;;
6178
6179    bsdi[[45]]*)
6180      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6181      ;;
6182
6183    cygwin* | mingw* | pw32* | cegcc*)
6184      # When not using gcc, we currently assume that we are using
6185      # Microsoft Visual C++.
6186      # hardcode_libdir_flag_spec is actually meaningless, as there is
6187      # no search path for DLLs.
6188      case $cc_basename in
6189      cl*)
6190	# Native MSVC
6191	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6192	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6193	_LT_TAGVAR(always_export_symbols, $1)=yes
6194	_LT_TAGVAR(file_list_spec, $1)='@'
6195	# Tell ltmain to make .lib files, not .a files.
6196	libext=lib
6197	# Tell ltmain to make .dll files, not .so files.
6198	shrext_cmds=".dll"
6199	# FIXME: Setting linknames here is a bad hack.
6200	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6201	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6202	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6203	  else
6204	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6205	  fi~
6206	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6207	  linknames='
6208	# The linker will not automatically build a static lib if we build a DLL.
6209	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6210	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6211	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6212	_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'
6213	# Don't use ranlib
6214	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6215	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6216	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6217	  case $lt_outputfile in
6218	    *.exe|*.EXE) ;;
6219	    *)
6220	      lt_outputfile="$lt_outputfile.exe"
6221	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6222	      ;;
6223	  esac~
6224	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6225	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6226	    $RM "$lt_outputfile.manifest";
6227	  fi'
6228	;;
6229      *)
6230	# Assume MSVC wrapper
6231	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6232	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6233	# Tell ltmain to make .lib files, not .a files.
6234	libext=lib
6235	# Tell ltmain to make .dll files, not .so files.
6236	shrext_cmds=".dll"
6237	# FIXME: Setting linknames here is a bad hack.
6238	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6239	# The linker will automatically build a .lib file if we build a DLL.
6240	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6241	# FIXME: Should let the user specify the lib program.
6242	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6243	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6244	;;
6245      esac
6246      ;;
6247
6248    darwin* | rhapsody*)
6249      _LT_DARWIN_LINKER_FEATURES($1)
6250      ;;
6251
6252    dgux*)
6253      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6254      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6255      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6256      ;;
6257
6258    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6259    # support.  Future versions do this automatically, but an explicit c++rt0.o
6260    # does not break anything, and helps significantly (at the cost of a little
6261    # extra space).
6262    freebsd2.2*)
6263      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6264      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6265      _LT_TAGVAR(hardcode_direct, $1)=yes
6266      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6267      ;;
6268
6269    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6270    freebsd2.*)
6271      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6272      _LT_TAGVAR(hardcode_direct, $1)=yes
6273      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6274      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6275      ;;
6276
6277    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6278    freebsd* | dragonfly*)
6279      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6280      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6281      _LT_TAGVAR(hardcode_direct, $1)=yes
6282      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6283      ;;
6284
6285    hpux9*)
6286      if test "$GCC" = yes; then
6287	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6288      else
6289	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6290      fi
6291      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6292      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6293      _LT_TAGVAR(hardcode_direct, $1)=yes
6294
6295      # hardcode_minus_L: Not really in the search PATH,
6296      # but as the default location of the library.
6297      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6298      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6299      ;;
6300
6301    hpux10*)
6302      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6303	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6304      else
6305	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6306      fi
6307      if test "$with_gnu_ld" = no; then
6308	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6309	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6310	_LT_TAGVAR(hardcode_direct, $1)=yes
6311	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6312	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6313	# hardcode_minus_L: Not really in the search PATH,
6314	# but as the default location of the library.
6315	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6316      fi
6317      ;;
6318
6319    hpux11*)
6320      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6321	case $host_cpu in
6322	hppa*64*)
6323	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6324	  ;;
6325	ia64*)
6326	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6327	  ;;
6328	*)
6329	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6330	  ;;
6331	esac
6332      else
6333	case $host_cpu in
6334	hppa*64*)
6335	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6336	  ;;
6337	ia64*)
6338	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6339	  ;;
6340	*)
6341	m4_if($1, [], [
6342	  # Older versions of the 11.00 compiler do not understand -b yet
6343	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6344	  _LT_LINKER_OPTION([if $CC understands -b],
6345	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6346	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6347	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6348	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6349	  ;;
6350	esac
6351      fi
6352      if test "$with_gnu_ld" = no; then
6353	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6354	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6355
6356	case $host_cpu in
6357	hppa*64*|ia64*)
6358	  _LT_TAGVAR(hardcode_direct, $1)=no
6359	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6360	  ;;
6361	*)
6362	  _LT_TAGVAR(hardcode_direct, $1)=yes
6363	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6364	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6365
6366	  # hardcode_minus_L: Not really in the search PATH,
6367	  # but as the default location of the library.
6368	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6369	  ;;
6370	esac
6371      fi
6372      ;;
6373
6374    irix5* | irix6* | nonstopux*)
6375      if test "$GCC" = yes; then
6376	_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'
6377	# Try to use the -exported_symbol ld option, if it does not
6378	# work, assume that -exports_file does not work either and
6379	# implicitly export all symbols.
6380	# This should be the same for all languages, so no per-tag cache variable.
6381	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6382	  [lt_cv_irix_exported_symbol],
6383	  [save_LDFLAGS="$LDFLAGS"
6384	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6385	   AC_LINK_IFELSE(
6386	     [AC_LANG_SOURCE(
6387	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6388			      [C++], [[int foo (void) { return 0; }]],
6389			      [Fortran 77], [[
6390      subroutine foo
6391      end]],
6392			      [Fortran], [[
6393      subroutine foo
6394      end]])])],
6395	      [lt_cv_irix_exported_symbol=yes],
6396	      [lt_cv_irix_exported_symbol=no])
6397           LDFLAGS="$save_LDFLAGS"])
6398	if test "$lt_cv_irix_exported_symbol" = yes; then
6399          _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'
6400	fi
6401      else
6402	_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'
6403	_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'
6404      fi
6405      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6406      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6407      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6408      _LT_TAGVAR(inherit_rpath, $1)=yes
6409      _LT_TAGVAR(link_all_deplibs, $1)=yes
6410      ;;
6411
6412    netbsd*)
6413      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6414	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6415      else
6416	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6417      fi
6418      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6419      _LT_TAGVAR(hardcode_direct, $1)=yes
6420      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6421      ;;
6422
6423    newsos6)
6424      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6425      _LT_TAGVAR(hardcode_direct, $1)=yes
6426      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6427      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6428      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6429      ;;
6430
6431    *nto* | *qnx*)
6432      ;;
6433
6434    openbsd*)
6435      if test -f /usr/libexec/ld.so; then
6436	_LT_TAGVAR(hardcode_direct, $1)=yes
6437	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6438	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6439	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6440	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6441	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6442	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6443	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6444	else
6445	  case $host_os in
6446	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6447	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6448	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6449	     ;;
6450	   *)
6451	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6452	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6453	     ;;
6454	  esac
6455	fi
6456      else
6457	_LT_TAGVAR(ld_shlibs, $1)=no
6458      fi
6459      ;;
6460
6461    os2*)
6462      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6463      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6464      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6465      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
6466      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6467      ;;
6468
6469    osf3*)
6470      if test "$GCC" = yes; then
6471	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6472	_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'
6473      else
6474	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6475	_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'
6476      fi
6477      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6478      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6479      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6480      ;;
6481
6482    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6483      if test "$GCC" = yes; then
6484	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6485	_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'
6486	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6487      else
6488	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6489	_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'
6490	_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~
6491	$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'
6492
6493	# Both c and cxx compiler support -rpath directly
6494	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6495      fi
6496      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6497      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6498      ;;
6499
6500    solaris*)
6501      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6502      if test "$GCC" = yes; then
6503	wlarc='${wl}'
6504	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6505	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6506	  $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'
6507      else
6508	case `$CC -V 2>&1` in
6509	*"Compilers 5.0"*)
6510	  wlarc=''
6511	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6512	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6513	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6514	  ;;
6515	*)
6516	  wlarc='${wl}'
6517	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6518	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6519	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6520	  ;;
6521	esac
6522      fi
6523      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6524      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6525      case $host_os in
6526      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6527      *)
6528	# The compiler driver will combine and reorder linker options,
6529	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6530	# but is careful enough not to reorder.
6531	# Supported since Solaris 2.6 (maybe 2.5.1?)
6532	if test "$GCC" = yes; then
6533	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6534	else
6535	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6536	fi
6537	;;
6538      esac
6539      _LT_TAGVAR(link_all_deplibs, $1)=yes
6540      ;;
6541
6542    sunos4*)
6543      if test "x$host_vendor" = xsequent; then
6544	# Use $CC to link under sequent, because it throws in some extra .o
6545	# files that make .init and .fini sections work.
6546	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6547      else
6548	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6549      fi
6550      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6551      _LT_TAGVAR(hardcode_direct, $1)=yes
6552      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6553      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6554      ;;
6555
6556    sysv4)
6557      case $host_vendor in
6558	sni)
6559	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6560	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6561	;;
6562	siemens)
6563	  ## LD is ld it makes a PLAMLIB
6564	  ## CC just makes a GrossModule.
6565	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6566	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6567	  _LT_TAGVAR(hardcode_direct, $1)=no
6568        ;;
6569	motorola)
6570	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6571	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6572	;;
6573      esac
6574      runpath_var='LD_RUN_PATH'
6575      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6576      ;;
6577
6578    sysv4.3*)
6579      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6580      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6581      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6582      ;;
6583
6584    sysv4*MP*)
6585      if test -d /usr/nec; then
6586	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6587	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6588	runpath_var=LD_RUN_PATH
6589	hardcode_runpath_var=yes
6590	_LT_TAGVAR(ld_shlibs, $1)=yes
6591      fi
6592      ;;
6593
6594    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6595      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6596      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6597      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6598      runpath_var='LD_RUN_PATH'
6599
6600      if test "$GCC" = yes; then
6601	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6602	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6603      else
6604	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6605	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6606      fi
6607      ;;
6608
6609    sysv5* | sco3.2v5* | sco5v6*)
6610      # Note: We can NOT use -z defs as we might desire, because we do not
6611      # link with -lc, and that would cause any symbols used from libc to
6612      # always be unresolved, which means just about no library would
6613      # ever link correctly.  If we're not using GNU ld we use -z text
6614      # though, which does catch some bad symbols but isn't as heavy-handed
6615      # as -z defs.
6616      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6617      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6618      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6619      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6620      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6621      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6622      _LT_TAGVAR(link_all_deplibs, $1)=yes
6623      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6624      runpath_var='LD_RUN_PATH'
6625
6626      if test "$GCC" = yes; then
6627	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6628	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6629      else
6630	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6631	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6632      fi
6633      ;;
6634
6635    uts4*)
6636      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6637      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6638      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6639      ;;
6640
6641    *)
6642      _LT_TAGVAR(ld_shlibs, $1)=no
6643      ;;
6644    esac
6645
6646    if test x$host_vendor = xsni; then
6647      case $host in
6648      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6649	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6650	;;
6651      esac
6652    fi
6653  fi
6654])
6655AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6656test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6657
6658_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6659
6660_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6661_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6662_LT_DECL([], [extract_expsyms_cmds], [2],
6663    [The commands to extract the exported symbol list from a shared archive])
6664
6665#
6666# Do we need to explicitly link libc?
6667#
6668case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6669x|xyes)
6670  # Assume -lc should be added
6671  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6672
6673  if test "$enable_shared" = yes && test "$GCC" = yes; then
6674    case $_LT_TAGVAR(archive_cmds, $1) in
6675    *'~'*)
6676      # FIXME: we may have to deal with multi-command sequences.
6677      ;;
6678    '$CC '*)
6679      # Test whether the compiler implicitly links with -lc since on some
6680      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6681      # to ld, don't add -lc before -lgcc.
6682      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6683	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6684	[$RM conftest*
6685	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6686
6687	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6688	  soname=conftest
6689	  lib=conftest
6690	  libobjs=conftest.$ac_objext
6691	  deplibs=
6692	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6693	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6694	  compiler_flags=-v
6695	  linker_flags=-v
6696	  verstring=
6697	  output_objdir=.
6698	  libname=conftest
6699	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6700	  _LT_TAGVAR(allow_undefined_flag, $1)=
6701	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6702	  then
6703	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6704	  else
6705	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6706	  fi
6707	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6708	else
6709	  cat conftest.err 1>&5
6710	fi
6711	$RM conftest*
6712	])
6713      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6714      ;;
6715    esac
6716  fi
6717  ;;
6718esac
6719
6720_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6721    [Whether or not to add -lc for building shared libraries])
6722_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6723    [enable_shared_with_static_runtimes], [0],
6724    [Whether or not to disallow shared libs when runtime libs are static])
6725_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6726    [Compiler flag to allow reflexive dlopens])
6727_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6728    [Compiler flag to generate shared objects directly from archives])
6729_LT_TAGDECL([], [compiler_needs_object], [1],
6730    [Whether the compiler copes with passing no objects directly])
6731_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6732    [Create an old-style archive from a shared archive])
6733_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6734    [Create a temporary old-style archive to link instead of a shared archive])
6735_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6736_LT_TAGDECL([], [archive_expsym_cmds], [2])
6737_LT_TAGDECL([], [module_cmds], [2],
6738    [Commands used to build a loadable module if different from building
6739    a shared archive.])
6740_LT_TAGDECL([], [module_expsym_cmds], [2])
6741_LT_TAGDECL([], [with_gnu_ld], [1],
6742    [Whether we are building with GNU ld or not])
6743_LT_TAGDECL([], [allow_undefined_flag], [1],
6744    [Flag that allows shared libraries with undefined symbols to be built])
6745_LT_TAGDECL([], [no_undefined_flag], [1],
6746    [Flag that enforces no undefined symbols])
6747_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6748    [Flag to hardcode $libdir into a binary during linking.
6749    This must work even if $libdir does not exist])
6750_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6751    [Whether we need a single "-rpath" flag with a separated argument])
6752_LT_TAGDECL([], [hardcode_direct], [0],
6753    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6754    DIR into the resulting binary])
6755_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6756    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6757    DIR into the resulting binary and the resulting library dependency is
6758    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6759    library is relocated])
6760_LT_TAGDECL([], [hardcode_minus_L], [0],
6761    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6762    into the resulting binary])
6763_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6764    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6765    into the resulting binary])
6766_LT_TAGDECL([], [hardcode_automatic], [0],
6767    [Set to "yes" if building a shared library automatically hardcodes DIR
6768    into the library and all subsequent libraries and executables linked
6769    against it])
6770_LT_TAGDECL([], [inherit_rpath], [0],
6771    [Set to yes if linker adds runtime paths of dependent libraries
6772    to runtime path list])
6773_LT_TAGDECL([], [link_all_deplibs], [0],
6774    [Whether libtool must link a program against all its dependency libraries])
6775_LT_TAGDECL([], [always_export_symbols], [0],
6776    [Set to "yes" if exported symbols are required])
6777_LT_TAGDECL([], [export_symbols_cmds], [2],
6778    [The commands to list exported symbols])
6779_LT_TAGDECL([], [exclude_expsyms], [1],
6780    [Symbols that should not be listed in the preloaded symbols])
6781_LT_TAGDECL([], [include_expsyms], [1],
6782    [Symbols that must always be exported])
6783_LT_TAGDECL([], [prelink_cmds], [2],
6784    [Commands necessary for linking programs (against libraries) with templates])
6785_LT_TAGDECL([], [postlink_cmds], [2],
6786    [Commands necessary for finishing linking programs])
6787_LT_TAGDECL([], [file_list_spec], [1],
6788    [Specify filename containing input files])
6789dnl FIXME: Not yet implemented
6790dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6791dnl    [Compiler flag to generate thread safe objects])
6792])# _LT_LINKER_SHLIBS
6793
6794
6795# _LT_LANG_C_CONFIG([TAG])
6796# ------------------------
6797# Ensure that the configuration variables for a C compiler are suitably
6798# defined.  These variables are subsequently used by _LT_CONFIG to write
6799# the compiler configuration to `libtool'.
6800m4_defun([_LT_LANG_C_CONFIG],
6801[m4_require([_LT_DECL_EGREP])dnl
6802lt_save_CC="$CC"
6803AC_LANG_PUSH(C)
6804
6805# Source file extension for C test sources.
6806ac_ext=c
6807
6808# Object file extension for compiled C test sources.
6809objext=o
6810_LT_TAGVAR(objext, $1)=$objext
6811
6812# Code to be used in simple compile tests
6813lt_simple_compile_test_code="int some_variable = 0;"
6814
6815# Code to be used in simple link tests
6816lt_simple_link_test_code='int main(){return(0);}'
6817
6818_LT_TAG_COMPILER
6819# Save the default compiler, since it gets overwritten when the other
6820# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6821compiler_DEFAULT=$CC
6822
6823# save warnings/boilerplate of simple test code
6824_LT_COMPILER_BOILERPLATE
6825_LT_LINKER_BOILERPLATE
6826
6827if test -n "$compiler"; then
6828  _LT_COMPILER_NO_RTTI($1)
6829  _LT_COMPILER_PIC($1)
6830  _LT_COMPILER_C_O($1)
6831  _LT_COMPILER_FILE_LOCKS($1)
6832  _LT_LINKER_SHLIBS($1)
6833  _LT_SYS_DYNAMIC_LINKER($1)
6834  _LT_LINKER_HARDCODE_LIBPATH($1)
6835  LT_SYS_DLOPEN_SELF
6836  _LT_CMD_STRIPLIB
6837
6838  # Report which library types will actually be built
6839  AC_MSG_CHECKING([if libtool supports shared libraries])
6840  AC_MSG_RESULT([$can_build_shared])
6841
6842  AC_MSG_CHECKING([whether to build shared libraries])
6843  test "$can_build_shared" = "no" && enable_shared=no
6844
6845  # On AIX, shared libraries and static libraries use the same namespace, and
6846  # are all built from PIC.
6847  case $host_os in
6848  aix3*)
6849    test "$enable_shared" = yes && enable_static=no
6850    if test -n "$RANLIB"; then
6851      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6852      postinstall_cmds='$RANLIB $lib'
6853    fi
6854    ;;
6855
6856  aix[[4-9]]*)
6857    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6858      test "$enable_shared" = yes && enable_static=no
6859    fi
6860    ;;
6861  esac
6862  AC_MSG_RESULT([$enable_shared])
6863
6864  AC_MSG_CHECKING([whether to build static libraries])
6865  # Make sure either enable_shared or enable_static is yes.
6866  test "$enable_shared" = yes || enable_static=yes
6867  AC_MSG_RESULT([$enable_static])
6868
6869  _LT_CONFIG($1)
6870fi
6871AC_LANG_POP
6872CC="$lt_save_CC"
6873])# _LT_LANG_C_CONFIG
6874
6875
6876# _LT_LANG_CXX_CONFIG([TAG])
6877# --------------------------
6878# Ensure that the configuration variables for a C++ compiler are suitably
6879# defined.  These variables are subsequently used by _LT_CONFIG to write
6880# the compiler configuration to `libtool'.
6881m4_defun([_LT_LANG_CXX_CONFIG],
6882[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6883m4_require([_LT_DECL_EGREP])dnl
6884m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6885if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6886    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6887    (test "X$CXX" != "Xg++"))) ; then
6888  AC_PROG_CXXCPP
6889else
6890  _lt_caught_CXX_error=yes
6891fi
6892
6893AC_LANG_PUSH(C++)
6894_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6895_LT_TAGVAR(allow_undefined_flag, $1)=
6896_LT_TAGVAR(always_export_symbols, $1)=no
6897_LT_TAGVAR(archive_expsym_cmds, $1)=
6898_LT_TAGVAR(compiler_needs_object, $1)=no
6899_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6900_LT_TAGVAR(hardcode_direct, $1)=no
6901_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6902_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6903_LT_TAGVAR(hardcode_libdir_separator, $1)=
6904_LT_TAGVAR(hardcode_minus_L, $1)=no
6905_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6906_LT_TAGVAR(hardcode_automatic, $1)=no
6907_LT_TAGVAR(inherit_rpath, $1)=no
6908_LT_TAGVAR(module_cmds, $1)=
6909_LT_TAGVAR(module_expsym_cmds, $1)=
6910_LT_TAGVAR(link_all_deplibs, $1)=unknown
6911_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6912_LT_TAGVAR(reload_flag, $1)=$reload_flag
6913_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6914_LT_TAGVAR(no_undefined_flag, $1)=
6915_LT_TAGVAR(whole_archive_flag_spec, $1)=
6916_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6917
6918# Source file extension for C++ test sources.
6919ac_ext=cpp
6920
6921# Object file extension for compiled C++ test sources.
6922objext=o
6923_LT_TAGVAR(objext, $1)=$objext
6924
6925# No sense in running all these tests if we already determined that
6926# the CXX compiler isn't working.  Some variables (like enable_shared)
6927# are currently assumed to apply to all compilers on this platform,
6928# and will be corrupted by setting them based on a non-working compiler.
6929if test "$_lt_caught_CXX_error" != yes; then
6930  # Code to be used in simple compile tests
6931  lt_simple_compile_test_code="int some_variable = 0;"
6932
6933  # Code to be used in simple link tests
6934  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6935
6936  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6937  _LT_TAG_COMPILER
6938
6939  # save warnings/boilerplate of simple test code
6940  _LT_COMPILER_BOILERPLATE
6941  _LT_LINKER_BOILERPLATE
6942
6943  # Allow CC to be a program name with arguments.
6944  lt_save_CC=$CC
6945  lt_save_CFLAGS=$CFLAGS
6946  lt_save_LD=$LD
6947  lt_save_GCC=$GCC
6948  GCC=$GXX
6949  lt_save_with_gnu_ld=$with_gnu_ld
6950  lt_save_path_LD=$lt_cv_path_LD
6951  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6952    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6953  else
6954    $as_unset lt_cv_prog_gnu_ld
6955  fi
6956  if test -n "${lt_cv_path_LDCXX+set}"; then
6957    lt_cv_path_LD=$lt_cv_path_LDCXX
6958  else
6959    $as_unset lt_cv_path_LD
6960  fi
6961  test -z "${LDCXX+set}" || LD=$LDCXX
6962  CC=${CXX-"c++"}
6963  CFLAGS=$CXXFLAGS
6964  compiler=$CC
6965  _LT_TAGVAR(compiler, $1)=$CC
6966  _LT_CC_BASENAME([$compiler])
6967
6968  if test -n "$compiler"; then
6969    # We don't want -fno-exception when compiling C++ code, so set the
6970    # no_builtin_flag separately
6971    if test "$GXX" = yes; then
6972      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6973    else
6974      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6975    fi
6976
6977    if test "$GXX" = yes; then
6978      # Set up default GNU C++ configuration
6979
6980      LT_PATH_LD
6981
6982      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6983      # archiving commands below assume that GNU ld is being used.
6984      if test "$with_gnu_ld" = yes; then
6985        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6986        _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'
6987
6988        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6989        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6990
6991        # If archive_cmds runs LD, not CC, wlarc should be empty
6992        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6993        #     investigate it a little bit more. (MM)
6994        wlarc='${wl}'
6995
6996        # ancient GNU ld didn't support --whole-archive et. al.
6997        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6998	  $GREP 'no-whole-archive' > /dev/null; then
6999          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7000        else
7001          _LT_TAGVAR(whole_archive_flag_spec, $1)=
7002        fi
7003      else
7004        with_gnu_ld=no
7005        wlarc=
7006
7007        # A generic and very simple default shared library creation
7008        # command for GNU C++ for the case where it uses the native
7009        # linker, instead of GNU ld.  If possible, this setting should
7010        # overridden to take advantage of the native linker features on
7011        # the platform it is being used on.
7012        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7013      fi
7014
7015      # Commands to make compiler produce verbose output that lists
7016      # what "hidden" libraries, object files and flags are used when
7017      # linking a shared library.
7018      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7019
7020    else
7021      GXX=no
7022      with_gnu_ld=no
7023      wlarc=
7024    fi
7025
7026    # PORTME: fill in a description of your system's C++ link characteristics
7027    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7028    _LT_TAGVAR(ld_shlibs, $1)=yes
7029    case $host_os in
7030      aix3*)
7031        # FIXME: insert proper C++ library support
7032        _LT_TAGVAR(ld_shlibs, $1)=no
7033        ;;
7034      aix[[4-9]]*)
7035        if test "$host_cpu" = ia64; then
7036          # On IA64, the linker does run time linking by default, so we don't
7037          # have to do anything special.
7038          aix_use_runtimelinking=no
7039          exp_sym_flag='-Bexport'
7040          no_entry_flag=""
7041        else
7042          aix_use_runtimelinking=no
7043
7044          # Test if we are trying to use run time linking or normal
7045          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7046          # need to do runtime linking.
7047          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7048	    for ld_flag in $LDFLAGS; do
7049	      case $ld_flag in
7050	      *-brtl*)
7051	        aix_use_runtimelinking=yes
7052	        break
7053	        ;;
7054	      esac
7055	    done
7056	    ;;
7057          esac
7058
7059          exp_sym_flag='-bexport'
7060          no_entry_flag='-bnoentry'
7061        fi
7062
7063        # When large executables or shared objects are built, AIX ld can
7064        # have problems creating the table of contents.  If linking a library
7065        # or program results in "error TOC overflow" add -mminimal-toc to
7066        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7067        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7068
7069        _LT_TAGVAR(archive_cmds, $1)=''
7070        _LT_TAGVAR(hardcode_direct, $1)=yes
7071        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7072        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7073        _LT_TAGVAR(link_all_deplibs, $1)=yes
7074        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7075
7076        if test "$GXX" = yes; then
7077          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7078          # We only want to do this on AIX 4.2 and lower, the check
7079          # below for broken collect2 doesn't work under 4.3+
7080	  collect2name=`${CC} -print-prog-name=collect2`
7081	  if test -f "$collect2name" &&
7082	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7083	  then
7084	    # We have reworked collect2
7085	    :
7086	  else
7087	    # We have old collect2
7088	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7089	    # It fails to find uninstalled libraries when the uninstalled
7090	    # path is not listed in the libpath.  Setting hardcode_minus_L
7091	    # to unsupported forces relinking
7092	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7093	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7094	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7095	  fi
7096          esac
7097          shared_flag='-shared'
7098	  if test "$aix_use_runtimelinking" = yes; then
7099	    shared_flag="$shared_flag "'${wl}-G'
7100	  fi
7101        else
7102          # not using gcc
7103          if test "$host_cpu" = ia64; then
7104	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7105	  # chokes on -Wl,-G. The following line is correct:
7106	  shared_flag='-G'
7107          else
7108	    if test "$aix_use_runtimelinking" = yes; then
7109	      shared_flag='${wl}-G'
7110	    else
7111	      shared_flag='${wl}-bM:SRE'
7112	    fi
7113          fi
7114        fi
7115
7116        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7117        # It seems that -bexpall does not export symbols beginning with
7118        # underscore (_), so it is better to generate a list of symbols to
7119	# export.
7120        _LT_TAGVAR(always_export_symbols, $1)=yes
7121        if test "$aix_use_runtimelinking" = yes; then
7122          # Warning - without using the other runtime loading flags (-brtl),
7123          # -berok will link without error, but may produce a broken library.
7124          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7125          # Determine the default libpath from the value encoded in an empty
7126          # executable.
7127          _LT_SYS_MODULE_PATH_AIX([$1])
7128          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7129
7130          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
7131        else
7132          if test "$host_cpu" = ia64; then
7133	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7134	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7135	    _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"
7136          else
7137	    # Determine the default libpath from the value encoded in an
7138	    # empty executable.
7139	    _LT_SYS_MODULE_PATH_AIX([$1])
7140	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7141	    # Warning - without using the other run time loading flags,
7142	    # -berok will link without error, but may produce a broken library.
7143	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7144	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7145	    if test "$with_gnu_ld" = yes; then
7146	      # We only use this code for GNU lds that support --whole-archive.
7147	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7148	    else
7149	      # Exported symbols can be pulled into shared objects from archives
7150	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7151	    fi
7152	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7153	    # This is similar to how AIX traditionally builds its shared
7154	    # libraries.
7155	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
7156          fi
7157        fi
7158        ;;
7159
7160      beos*)
7161	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7162	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7163	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7164	  # support --undefined.  This deserves some investigation.  FIXME
7165	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7166	else
7167	  _LT_TAGVAR(ld_shlibs, $1)=no
7168	fi
7169	;;
7170
7171      chorus*)
7172        case $cc_basename in
7173          *)
7174	  # FIXME: insert proper C++ library support
7175	  _LT_TAGVAR(ld_shlibs, $1)=no
7176	  ;;
7177        esac
7178        ;;
7179
7180      cygwin* | mingw* | pw32* | cegcc*)
7181	case $GXX,$cc_basename in
7182	,cl* | no,cl*)
7183	  # Native MSVC
7184	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7185	  # no search path for DLLs.
7186	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7187	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7188	  _LT_TAGVAR(always_export_symbols, $1)=yes
7189	  _LT_TAGVAR(file_list_spec, $1)='@'
7190	  # Tell ltmain to make .lib files, not .a files.
7191	  libext=lib
7192	  # Tell ltmain to make .dll files, not .so files.
7193	  shrext_cmds=".dll"
7194	  # FIXME: Setting linknames here is a bad hack.
7195	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7196	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7197	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7198	    else
7199	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7200	    fi~
7201	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7202	    linknames='
7203	  # The linker will not automatically build a static lib if we build a DLL.
7204	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7205	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7206	  # Don't use ranlib
7207	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7208	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7209	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7210	    case $lt_outputfile in
7211	      *.exe|*.EXE) ;;
7212	      *)
7213		lt_outputfile="$lt_outputfile.exe"
7214		lt_tool_outputfile="$lt_tool_outputfile.exe"
7215		;;
7216	    esac~
7217	    func_to_tool_file "$lt_outputfile"~
7218	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7219	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7220	      $RM "$lt_outputfile.manifest";
7221	    fi'
7222	  ;;
7223	*)
7224	  # g++
7225	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7226	  # as there is no search path for DLLs.
7227	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7228	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7229	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7230	  _LT_TAGVAR(always_export_symbols, $1)=no
7231	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7232
7233	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7234	    _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'
7235	    # If the export-symbols file already is a .def file (1st line
7236	    # is EXPORTS), use it as is; otherwise, prepend...
7237	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7238	      cp $export_symbols $output_objdir/$soname.def;
7239	    else
7240	      echo EXPORTS > $output_objdir/$soname.def;
7241	      cat $export_symbols >> $output_objdir/$soname.def;
7242	    fi~
7243	    $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'
7244	  else
7245	    _LT_TAGVAR(ld_shlibs, $1)=no
7246	  fi
7247	  ;;
7248	esac
7249	;;
7250      darwin* | rhapsody*)
7251        _LT_DARWIN_LINKER_FEATURES($1)
7252	;;
7253
7254      dgux*)
7255        case $cc_basename in
7256          ec++*)
7257	    # FIXME: insert proper C++ library support
7258	    _LT_TAGVAR(ld_shlibs, $1)=no
7259	    ;;
7260          ghcx*)
7261	    # Green Hills C++ Compiler
7262	    # FIXME: insert proper C++ library support
7263	    _LT_TAGVAR(ld_shlibs, $1)=no
7264	    ;;
7265          *)
7266	    # FIXME: insert proper C++ library support
7267	    _LT_TAGVAR(ld_shlibs, $1)=no
7268	    ;;
7269        esac
7270        ;;
7271
7272      freebsd2.*)
7273        # C++ shared libraries reported to be fairly broken before
7274	# switch to ELF
7275        _LT_TAGVAR(ld_shlibs, $1)=no
7276        ;;
7277
7278      freebsd-elf*)
7279        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7280        ;;
7281
7282      freebsd* | dragonfly*)
7283        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7284        # conventions
7285        _LT_TAGVAR(ld_shlibs, $1)=yes
7286        ;;
7287
7288      gnu*)
7289        ;;
7290
7291      haiku*)
7292        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7293        _LT_TAGVAR(link_all_deplibs, $1)=yes
7294        ;;
7295
7296      hpux9*)
7297        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7298        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7299        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7300        _LT_TAGVAR(hardcode_direct, $1)=yes
7301        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7302				             # but as the default
7303				             # location of the library.
7304
7305        case $cc_basename in
7306          CC*)
7307            # FIXME: insert proper C++ library support
7308            _LT_TAGVAR(ld_shlibs, $1)=no
7309            ;;
7310          aCC*)
7311            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
7312            # Commands to make compiler produce verbose output that lists
7313            # what "hidden" libraries, object files and flags are used when
7314            # linking a shared library.
7315            #
7316            # There doesn't appear to be a way to prevent this compiler from
7317            # explicitly linking system object files so we need to strip them
7318            # from the output so that they don't get included in the library
7319            # dependencies.
7320            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"'
7321            ;;
7322          *)
7323            if test "$GXX" = yes; then
7324              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
7325            else
7326              # FIXME: insert proper C++ library support
7327              _LT_TAGVAR(ld_shlibs, $1)=no
7328            fi
7329            ;;
7330        esac
7331        ;;
7332
7333      hpux10*|hpux11*)
7334        if test $with_gnu_ld = no; then
7335	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7336	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7337
7338          case $host_cpu in
7339            hppa*64*|ia64*)
7340              ;;
7341            *)
7342	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7343              ;;
7344          esac
7345        fi
7346        case $host_cpu in
7347          hppa*64*|ia64*)
7348            _LT_TAGVAR(hardcode_direct, $1)=no
7349            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7350            ;;
7351          *)
7352            _LT_TAGVAR(hardcode_direct, $1)=yes
7353            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7354            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7355					         # but as the default
7356					         # location of the library.
7357            ;;
7358        esac
7359
7360        case $cc_basename in
7361          CC*)
7362	    # FIXME: insert proper C++ library support
7363	    _LT_TAGVAR(ld_shlibs, $1)=no
7364	    ;;
7365          aCC*)
7366	    case $host_cpu in
7367	      hppa*64*)
7368	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7369	        ;;
7370	      ia64*)
7371	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7372	        ;;
7373	      *)
7374	        _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'
7375	        ;;
7376	    esac
7377	    # Commands to make compiler produce verbose output that lists
7378	    # what "hidden" libraries, object files and flags are used when
7379	    # linking a shared library.
7380	    #
7381	    # There doesn't appear to be a way to prevent this compiler from
7382	    # explicitly linking system object files so we need to strip them
7383	    # from the output so that they don't get included in the library
7384	    # dependencies.
7385	    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"'
7386	    ;;
7387          *)
7388	    if test "$GXX" = yes; then
7389	      if test $with_gnu_ld = no; then
7390	        case $host_cpu in
7391	          hppa*64*)
7392	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7393	            ;;
7394	          ia64*)
7395	            _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'
7396	            ;;
7397	          *)
7398	            _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'
7399	            ;;
7400	        esac
7401	      fi
7402	    else
7403	      # FIXME: insert proper C++ library support
7404	      _LT_TAGVAR(ld_shlibs, $1)=no
7405	    fi
7406	    ;;
7407        esac
7408        ;;
7409
7410      interix[[3-9]]*)
7411	_LT_TAGVAR(hardcode_direct, $1)=no
7412	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7413	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7414	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7415	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7416	# Instead, shared libraries are loaded at an image base (0x10000000 by
7417	# default) and relocated if they conflict, which is a slow very memory
7418	# consuming and fragmenting process.  To avoid this, we pick a random,
7419	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7420	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7421	_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'
7422	_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'
7423	;;
7424      irix5* | irix6*)
7425        case $cc_basename in
7426          CC*)
7427	    # SGI C++
7428	    _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'
7429
7430	    # Archives containing C++ object files must be created using
7431	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7432	    # necessary to make sure instantiated templates are included
7433	    # in the archive.
7434	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7435	    ;;
7436          *)
7437	    if test "$GXX" = yes; then
7438	      if test "$with_gnu_ld" = no; then
7439	        _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'
7440	      else
7441	        _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'
7442	      fi
7443	    fi
7444	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7445	    ;;
7446        esac
7447        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7448        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7449        _LT_TAGVAR(inherit_rpath, $1)=yes
7450        ;;
7451
7452      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7453        case $cc_basename in
7454          KCC*)
7455	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7456
7457	    # KCC will only create a shared library if the output file
7458	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7459	    # to its proper name (with version) after linking.
7460	    _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'
7461	    _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'
7462	    # Commands to make compiler produce verbose output that lists
7463	    # what "hidden" libraries, object files and flags are used when
7464	    # linking a shared library.
7465	    #
7466	    # There doesn't appear to be a way to prevent this compiler from
7467	    # explicitly linking system object files so we need to strip them
7468	    # from the output so that they don't get included in the library
7469	    # dependencies.
7470	    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"'
7471
7472	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7473	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7474
7475	    # Archives containing C++ object files must be created using
7476	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7477	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7478	    ;;
7479	  icpc* | ecpc* )
7480	    # Intel C++
7481	    with_gnu_ld=yes
7482	    # version 8.0 and above of icpc choke on multiply defined symbols
7483	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7484	    # earlier do not add the objects themselves.
7485	    case `$CC -V 2>&1` in
7486	      *"Version 7."*)
7487	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7488		_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'
7489		;;
7490	      *)  # Version 8.0 or newer
7491	        tmp_idyn=
7492	        case $host_cpu in
7493		  ia64*) tmp_idyn=' -i_dynamic';;
7494		esac
7495	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7496		_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'
7497		;;
7498	    esac
7499	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7500	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7501	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7502	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7503	    ;;
7504          pgCC* | pgcpp*)
7505            # Portland Group C++ compiler
7506	    case `$CC -V` in
7507	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7508	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7509		rm -rf $tpldir~
7510		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7511		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7512	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7513		rm -rf $tpldir~
7514		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7515		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7516		$RANLIB $oldlib'
7517	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7518		rm -rf $tpldir~
7519		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7520		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7521	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7522		rm -rf $tpldir~
7523		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7524		$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'
7525	      ;;
7526	    *) # Version 6 and above use weak symbols
7527	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7528	      _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'
7529	      ;;
7530	    esac
7531
7532	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7533	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7534	    _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'
7535            ;;
7536	  cxx*)
7537	    # Compaq C++
7538	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7539	    _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'
7540
7541	    runpath_var=LD_RUN_PATH
7542	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7543	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7544
7545	    # Commands to make compiler produce verbose output that lists
7546	    # what "hidden" libraries, object files and flags are used when
7547	    # linking a shared library.
7548	    #
7549	    # There doesn't appear to be a way to prevent this compiler from
7550	    # explicitly linking system object files so we need to strip them
7551	    # from the output so that they don't get included in the library
7552	    # dependencies.
7553	    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'
7554	    ;;
7555	  xl* | mpixl* | bgxl*)
7556	    # IBM XL 8.0 on PPC, with GNU ld
7557	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7558	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7559	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7560	    if test "x$supports_anon_versioning" = xyes; then
7561	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7562		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7563		echo "local: *; };" >> $output_objdir/$libname.ver~
7564		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7565	    fi
7566	    ;;
7567	  *)
7568	    case `$CC -V 2>&1 | sed 5q` in
7569	    *Sun\ C*)
7570	      # Sun C++ 5.9
7571	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7572	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7573	      _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'
7574	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7575	      _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'
7576	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7577
7578	      # Not sure whether something based on
7579	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7580	      # would be better.
7581	      output_verbose_link_cmd='func_echo_all'
7582
7583	      # Archives containing C++ object files must be created using
7584	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7585	      # necessary to make sure instantiated templates are included
7586	      # in the archive.
7587	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7588	      ;;
7589	    esac
7590	    ;;
7591	esac
7592	;;
7593
7594      lynxos*)
7595        # FIXME: insert proper C++ library support
7596	_LT_TAGVAR(ld_shlibs, $1)=no
7597	;;
7598
7599      m88k*)
7600        # FIXME: insert proper C++ library support
7601        _LT_TAGVAR(ld_shlibs, $1)=no
7602	;;
7603
7604      mvs*)
7605        case $cc_basename in
7606          cxx*)
7607	    # FIXME: insert proper C++ library support
7608	    _LT_TAGVAR(ld_shlibs, $1)=no
7609	    ;;
7610	  *)
7611	    # FIXME: insert proper C++ library support
7612	    _LT_TAGVAR(ld_shlibs, $1)=no
7613	    ;;
7614	esac
7615	;;
7616
7617      netbsd*)
7618        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7619	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7620	  wlarc=
7621	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7622	  _LT_TAGVAR(hardcode_direct, $1)=yes
7623	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7624	fi
7625	# Workaround some broken pre-1.5 toolchains
7626	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7627	;;
7628
7629      *nto* | *qnx*)
7630        _LT_TAGVAR(ld_shlibs, $1)=yes
7631	;;
7632
7633      openbsd2*)
7634        # C++ shared libraries are fairly broken
7635	_LT_TAGVAR(ld_shlibs, $1)=no
7636	;;
7637
7638      openbsd*)
7639	if test -f /usr/libexec/ld.so; then
7640	  _LT_TAGVAR(hardcode_direct, $1)=yes
7641	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7642	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7643	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7644	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7645	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7646	    _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'
7647	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7648	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7649	  fi
7650	  output_verbose_link_cmd=func_echo_all
7651	else
7652	  _LT_TAGVAR(ld_shlibs, $1)=no
7653	fi
7654	;;
7655
7656      osf3* | osf4* | osf5*)
7657        case $cc_basename in
7658          KCC*)
7659	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7660
7661	    # KCC will only create a shared library if the output file
7662	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7663	    # to its proper name (with version) after linking.
7664	    _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'
7665
7666	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7667	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7668
7669	    # Archives containing C++ object files must be created using
7670	    # the KAI C++ compiler.
7671	    case $host in
7672	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7673	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7674	    esac
7675	    ;;
7676          RCC*)
7677	    # Rational C++ 2.4.1
7678	    # FIXME: insert proper C++ library support
7679	    _LT_TAGVAR(ld_shlibs, $1)=no
7680	    ;;
7681          cxx*)
7682	    case $host in
7683	      osf3*)
7684	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7685	        _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'
7686	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7687		;;
7688	      *)
7689	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7690	        _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'
7691	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7692	          echo "-hidden">> $lib.exp~
7693	          $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~
7694	          $RM $lib.exp'
7695	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7696		;;
7697	    esac
7698
7699	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7700
7701	    # Commands to make compiler produce verbose output that lists
7702	    # what "hidden" libraries, object files and flags are used when
7703	    # linking a shared library.
7704	    #
7705	    # There doesn't appear to be a way to prevent this compiler from
7706	    # explicitly linking system object files so we need to strip them
7707	    # from the output so that they don't get included in the library
7708	    # dependencies.
7709	    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"'
7710	    ;;
7711	  *)
7712	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7713	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7714	      case $host in
7715	        osf3*)
7716	          _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'
7717		  ;;
7718	        *)
7719	          _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'
7720		  ;;
7721	      esac
7722
7723	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7724	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7725
7726	      # Commands to make compiler produce verbose output that lists
7727	      # what "hidden" libraries, object files and flags are used when
7728	      # linking a shared library.
7729	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7730
7731	    else
7732	      # FIXME: insert proper C++ library support
7733	      _LT_TAGVAR(ld_shlibs, $1)=no
7734	    fi
7735	    ;;
7736        esac
7737        ;;
7738
7739      psos*)
7740        # FIXME: insert proper C++ library support
7741        _LT_TAGVAR(ld_shlibs, $1)=no
7742        ;;
7743
7744      sunos4*)
7745        case $cc_basename in
7746          CC*)
7747	    # Sun C++ 4.x
7748	    # FIXME: insert proper C++ library support
7749	    _LT_TAGVAR(ld_shlibs, $1)=no
7750	    ;;
7751          lcc*)
7752	    # Lucid
7753	    # FIXME: insert proper C++ library support
7754	    _LT_TAGVAR(ld_shlibs, $1)=no
7755	    ;;
7756          *)
7757	    # FIXME: insert proper C++ library support
7758	    _LT_TAGVAR(ld_shlibs, $1)=no
7759	    ;;
7760        esac
7761        ;;
7762
7763      solaris*)
7764        case $cc_basename in
7765          CC* | sunCC*)
7766	    # Sun C++ 4.2, 5.x and Centerline C++
7767            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7768	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7769	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7770	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7771	      $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'
7772
7773	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7774	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7775	    case $host_os in
7776	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7777	      *)
7778		# The compiler driver will combine and reorder linker options,
7779		# but understands `-z linker_flag'.
7780	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7781		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7782	        ;;
7783	    esac
7784	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7785
7786	    output_verbose_link_cmd='func_echo_all'
7787
7788	    # Archives containing C++ object files must be created using
7789	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7790	    # necessary to make sure instantiated templates are included
7791	    # in the archive.
7792	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7793	    ;;
7794          gcx*)
7795	    # Green Hills C++ Compiler
7796	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7797
7798	    # The C++ compiler must be used to create the archive.
7799	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7800	    ;;
7801          *)
7802	    # GNU C++ compiler with Solaris linker
7803	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7804	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7805	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7806	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7807	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7808		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7809
7810	        # Commands to make compiler produce verbose output that lists
7811	        # what "hidden" libraries, object files and flags are used when
7812	        # linking a shared library.
7813	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7814	      else
7815	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7816	        # platform.
7817	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7818	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7819		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7820
7821	        # Commands to make compiler produce verbose output that lists
7822	        # what "hidden" libraries, object files and flags are used when
7823	        # linking a shared library.
7824	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7825	      fi
7826
7827	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7828	      case $host_os in
7829		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7830		*)
7831		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7832		  ;;
7833	      esac
7834	    fi
7835	    ;;
7836        esac
7837        ;;
7838
7839    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7840      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7841      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7842      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7843      runpath_var='LD_RUN_PATH'
7844
7845      case $cc_basename in
7846        CC*)
7847	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7848	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7849	  ;;
7850	*)
7851	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7852	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7853	  ;;
7854      esac
7855      ;;
7856
7857      sysv5* | sco3.2v5* | sco5v6*)
7858	# Note: We can NOT use -z defs as we might desire, because we do not
7859	# link with -lc, and that would cause any symbols used from libc to
7860	# always be unresolved, which means just about no library would
7861	# ever link correctly.  If we're not using GNU ld we use -z text
7862	# though, which does catch some bad symbols but isn't as heavy-handed
7863	# as -z defs.
7864	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7865	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7866	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7867	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7868	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7869	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7870	_LT_TAGVAR(link_all_deplibs, $1)=yes
7871	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7872	runpath_var='LD_RUN_PATH'
7873
7874	case $cc_basename in
7875          CC*)
7876	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7877	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7878	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7879	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7880	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7881	      '"$_LT_TAGVAR(reload_cmds, $1)"
7882	    ;;
7883	  *)
7884	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7885	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7886	    ;;
7887	esac
7888      ;;
7889
7890      tandem*)
7891        case $cc_basename in
7892          NCC*)
7893	    # NonStop-UX NCC 3.20
7894	    # FIXME: insert proper C++ library support
7895	    _LT_TAGVAR(ld_shlibs, $1)=no
7896	    ;;
7897          *)
7898	    # FIXME: insert proper C++ library support
7899	    _LT_TAGVAR(ld_shlibs, $1)=no
7900	    ;;
7901        esac
7902        ;;
7903
7904      vxworks*)
7905        # FIXME: insert proper C++ library support
7906        _LT_TAGVAR(ld_shlibs, $1)=no
7907        ;;
7908
7909      *)
7910        # FIXME: insert proper C++ library support
7911        _LT_TAGVAR(ld_shlibs, $1)=no
7912        ;;
7913    esac
7914
7915    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7916    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7917
7918    _LT_TAGVAR(GCC, $1)="$GXX"
7919    _LT_TAGVAR(LD, $1)="$LD"
7920
7921    ## CAVEAT EMPTOR:
7922    ## There is no encapsulation within the following macros, do not change
7923    ## the running order or otherwise move them around unless you know exactly
7924    ## what you are doing...
7925    _LT_SYS_HIDDEN_LIBDEPS($1)
7926    _LT_COMPILER_PIC($1)
7927    _LT_COMPILER_C_O($1)
7928    _LT_COMPILER_FILE_LOCKS($1)
7929    _LT_LINKER_SHLIBS($1)
7930    _LT_SYS_DYNAMIC_LINKER($1)
7931    _LT_LINKER_HARDCODE_LIBPATH($1)
7932
7933    _LT_CONFIG($1)
7934  fi # test -n "$compiler"
7935
7936  CC=$lt_save_CC
7937  CFLAGS=$lt_save_CFLAGS
7938  LDCXX=$LD
7939  LD=$lt_save_LD
7940  GCC=$lt_save_GCC
7941  with_gnu_ld=$lt_save_with_gnu_ld
7942  lt_cv_path_LDCXX=$lt_cv_path_LD
7943  lt_cv_path_LD=$lt_save_path_LD
7944  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7945  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7946fi # test "$_lt_caught_CXX_error" != yes
7947
7948AC_LANG_POP
7949])# _LT_LANG_CXX_CONFIG
7950
7951
7952# _LT_FUNC_STRIPNAME_CNF
7953# ----------------------
7954# func_stripname_cnf prefix suffix name
7955# strip PREFIX and SUFFIX off of NAME.
7956# PREFIX and SUFFIX must not contain globbing or regex special
7957# characters, hashes, percent signs, but SUFFIX may contain a leading
7958# dot (in which case that matches only a dot).
7959#
7960# This function is identical to the (non-XSI) version of func_stripname,
7961# except this one can be used by m4 code that may be executed by configure,
7962# rather than the libtool script.
7963m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7964AC_REQUIRE([_LT_DECL_SED])
7965AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7966func_stripname_cnf ()
7967{
7968  case ${2} in
7969  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7970  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7971  esac
7972} # func_stripname_cnf
7973])# _LT_FUNC_STRIPNAME_CNF
7974
7975# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7976# ---------------------------------
7977# Figure out "hidden" library dependencies from verbose
7978# compiler output when linking a shared library.
7979# Parse the compiler output and extract the necessary
7980# objects, libraries and library flags.
7981m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7982[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7983AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7984# Dependencies to place before and after the object being linked:
7985_LT_TAGVAR(predep_objects, $1)=
7986_LT_TAGVAR(postdep_objects, $1)=
7987_LT_TAGVAR(predeps, $1)=
7988_LT_TAGVAR(postdeps, $1)=
7989_LT_TAGVAR(compiler_lib_search_path, $1)=
7990
7991dnl we can't use the lt_simple_compile_test_code here,
7992dnl because it contains code intended for an executable,
7993dnl not a library.  It's possible we should let each
7994dnl tag define a new lt_????_link_test_code variable,
7995dnl but it's only used here...
7996m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7997int a;
7998void foo (void) { a = 0; }
7999_LT_EOF
8000], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
8001class Foo
8002{
8003public:
8004  Foo (void) { a = 0; }
8005private:
8006  int a;
8007};
8008_LT_EOF
8009], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
8010      subroutine foo
8011      implicit none
8012      integer*4 a
8013      a=0
8014      return
8015      end
8016_LT_EOF
8017], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
8018      subroutine foo
8019      implicit none
8020      integer a
8021      a=0
8022      return
8023      end
8024_LT_EOF
8025], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
8026public class foo {
8027  private int a;
8028  public void bar (void) {
8029    a = 0;
8030  }
8031};
8032_LT_EOF
8033], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
8034package foo
8035func foo() {
8036}
8037_LT_EOF
8038])
8039
8040_lt_libdeps_save_CFLAGS=$CFLAGS
8041case "$CC $CFLAGS " in #(
8042*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8043*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8044*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8045esac
8046
8047dnl Parse the compiler output and extract the necessary
8048dnl objects, libraries and library flags.
8049if AC_TRY_EVAL(ac_compile); then
8050  # Parse the compiler output and extract the necessary
8051  # objects, libraries and library flags.
8052
8053  # Sentinel used to keep track of whether or not we are before
8054  # the conftest object file.
8055  pre_test_object_deps_done=no
8056
8057  for p in `eval "$output_verbose_link_cmd"`; do
8058    case ${prev}${p} in
8059
8060    -L* | -R* | -l*)
8061       # Some compilers place space between "-{L,R}" and the path.
8062       # Remove the space.
8063       if test $p = "-L" ||
8064          test $p = "-R"; then
8065	 prev=$p
8066	 continue
8067       fi
8068
8069       # Expand the sysroot to ease extracting the directories later.
8070       if test -z "$prev"; then
8071         case $p in
8072         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8073         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8074         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8075         esac
8076       fi
8077       case $p in
8078       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8079       esac
8080       if test "$pre_test_object_deps_done" = no; then
8081	 case ${prev} in
8082	 -L | -R)
8083	   # Internal compiler library paths should come after those
8084	   # provided the user.  The postdeps already come after the
8085	   # user supplied libs so there is no need to process them.
8086	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8087	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8088	   else
8089	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8090	   fi
8091	   ;;
8092	 # The "-l" case would never come before the object being
8093	 # linked, so don't bother handling this case.
8094	 esac
8095       else
8096	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8097	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8098	 else
8099	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8100	 fi
8101       fi
8102       prev=
8103       ;;
8104
8105    *.lto.$objext) ;; # Ignore GCC LTO objects
8106    *.$objext)
8107       # This assumes that the test object file only shows up
8108       # once in the compiler output.
8109       if test "$p" = "conftest.$objext"; then
8110	 pre_test_object_deps_done=yes
8111	 continue
8112       fi
8113
8114       if test "$pre_test_object_deps_done" = no; then
8115	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8116	   _LT_TAGVAR(predep_objects, $1)="$p"
8117	 else
8118	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8119	 fi
8120       else
8121	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8122	   _LT_TAGVAR(postdep_objects, $1)="$p"
8123	 else
8124	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8125	 fi
8126       fi
8127       ;;
8128
8129    *) ;; # Ignore the rest.
8130
8131    esac
8132  done
8133
8134  # Clean up.
8135  rm -f a.out a.exe
8136else
8137  echo "libtool.m4: error: problem compiling $1 test program"
8138fi
8139
8140$RM -f confest.$objext
8141CFLAGS=$_lt_libdeps_save_CFLAGS
8142
8143# PORTME: override above test on systems where it is broken
8144m4_if([$1], [CXX],
8145[case $host_os in
8146interix[[3-9]]*)
8147  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8148  # hack all around it, let's just trust "g++" to DTRT.
8149  _LT_TAGVAR(predep_objects,$1)=
8150  _LT_TAGVAR(postdep_objects,$1)=
8151  _LT_TAGVAR(postdeps,$1)=
8152  ;;
8153
8154linux*)
8155  case `$CC -V 2>&1 | sed 5q` in
8156  *Sun\ C*)
8157    # Sun C++ 5.9
8158
8159    # The more standards-conforming stlport4 library is
8160    # incompatible with the Cstd library. Avoid specifying
8161    # it if it's in CXXFLAGS. Ignore libCrun as
8162    # -library=stlport4 depends on it.
8163    case " $CXX $CXXFLAGS " in
8164    *" -library=stlport4 "*)
8165      solaris_use_stlport4=yes
8166      ;;
8167    esac
8168
8169    if test "$solaris_use_stlport4" != yes; then
8170      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8171    fi
8172    ;;
8173  esac
8174  ;;
8175
8176solaris*)
8177  case $cc_basename in
8178  CC* | sunCC*)
8179    # The more standards-conforming stlport4 library is
8180    # incompatible with the Cstd library. Avoid specifying
8181    # it if it's in CXXFLAGS. Ignore libCrun as
8182    # -library=stlport4 depends on it.
8183    case " $CXX $CXXFLAGS " in
8184    *" -library=stlport4 "*)
8185      solaris_use_stlport4=yes
8186      ;;
8187    esac
8188
8189    # Adding this requires a known-good setup of shared libraries for
8190    # Sun compiler versions before 5.6, else PIC objects from an old
8191    # archive will be linked into the output, leading to subtle bugs.
8192    if test "$solaris_use_stlport4" != yes; then
8193      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8194    fi
8195    ;;
8196  esac
8197  ;;
8198esac
8199])
8200
8201case " $_LT_TAGVAR(postdeps, $1) " in
8202*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8203esac
8204 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8205if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8206 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8207fi
8208_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8209    [The directories searched by this compiler when creating a shared library])
8210_LT_TAGDECL([], [predep_objects], [1],
8211    [Dependencies to place before and after the objects being linked to
8212    create a shared library])
8213_LT_TAGDECL([], [postdep_objects], [1])
8214_LT_TAGDECL([], [predeps], [1])
8215_LT_TAGDECL([], [postdeps], [1])
8216_LT_TAGDECL([], [compiler_lib_search_path], [1],
8217    [The library search path used internally by the compiler when linking
8218    a shared library])
8219])# _LT_SYS_HIDDEN_LIBDEPS
8220
8221
8222# _LT_LANG_F77_CONFIG([TAG])
8223# --------------------------
8224# Ensure that the configuration variables for a Fortran 77 compiler are
8225# suitably defined.  These variables are subsequently used by _LT_CONFIG
8226# to write the compiler configuration to `libtool'.
8227m4_defun([_LT_LANG_F77_CONFIG],
8228[AC_LANG_PUSH(Fortran 77)
8229if test -z "$F77" || test "X$F77" = "Xno"; then
8230  _lt_disable_F77=yes
8231fi
8232
8233_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8234_LT_TAGVAR(allow_undefined_flag, $1)=
8235_LT_TAGVAR(always_export_symbols, $1)=no
8236_LT_TAGVAR(archive_expsym_cmds, $1)=
8237_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8238_LT_TAGVAR(hardcode_direct, $1)=no
8239_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8240_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8241_LT_TAGVAR(hardcode_libdir_separator, $1)=
8242_LT_TAGVAR(hardcode_minus_L, $1)=no
8243_LT_TAGVAR(hardcode_automatic, $1)=no
8244_LT_TAGVAR(inherit_rpath, $1)=no
8245_LT_TAGVAR(module_cmds, $1)=
8246_LT_TAGVAR(module_expsym_cmds, $1)=
8247_LT_TAGVAR(link_all_deplibs, $1)=unknown
8248_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8249_LT_TAGVAR(reload_flag, $1)=$reload_flag
8250_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8251_LT_TAGVAR(no_undefined_flag, $1)=
8252_LT_TAGVAR(whole_archive_flag_spec, $1)=
8253_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8254
8255# Source file extension for f77 test sources.
8256ac_ext=f
8257
8258# Object file extension for compiled f77 test sources.
8259objext=o
8260_LT_TAGVAR(objext, $1)=$objext
8261
8262# No sense in running all these tests if we already determined that
8263# the F77 compiler isn't working.  Some variables (like enable_shared)
8264# are currently assumed to apply to all compilers on this platform,
8265# and will be corrupted by setting them based on a non-working compiler.
8266if test "$_lt_disable_F77" != yes; then
8267  # Code to be used in simple compile tests
8268  lt_simple_compile_test_code="\
8269      subroutine t
8270      return
8271      end
8272"
8273
8274  # Code to be used in simple link tests
8275  lt_simple_link_test_code="\
8276      program t
8277      end
8278"
8279
8280  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8281  _LT_TAG_COMPILER
8282
8283  # save warnings/boilerplate of simple test code
8284  _LT_COMPILER_BOILERPLATE
8285  _LT_LINKER_BOILERPLATE
8286
8287  # Allow CC to be a program name with arguments.
8288  lt_save_CC="$CC"
8289  lt_save_GCC=$GCC
8290  lt_save_CFLAGS=$CFLAGS
8291  CC=${F77-"f77"}
8292  CFLAGS=$FFLAGS
8293  compiler=$CC
8294  _LT_TAGVAR(compiler, $1)=$CC
8295  _LT_CC_BASENAME([$compiler])
8296  GCC=$G77
8297  if test -n "$compiler"; then
8298    AC_MSG_CHECKING([if libtool supports shared libraries])
8299    AC_MSG_RESULT([$can_build_shared])
8300
8301    AC_MSG_CHECKING([whether to build shared libraries])
8302    test "$can_build_shared" = "no" && enable_shared=no
8303
8304    # On AIX, shared libraries and static libraries use the same namespace, and
8305    # are all built from PIC.
8306    case $host_os in
8307      aix3*)
8308        test "$enable_shared" = yes && enable_static=no
8309        if test -n "$RANLIB"; then
8310          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8311          postinstall_cmds='$RANLIB $lib'
8312        fi
8313        ;;
8314      aix[[4-9]]*)
8315	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8316	  test "$enable_shared" = yes && enable_static=no
8317	fi
8318        ;;
8319    esac
8320    AC_MSG_RESULT([$enable_shared])
8321
8322    AC_MSG_CHECKING([whether to build static libraries])
8323    # Make sure either enable_shared or enable_static is yes.
8324    test "$enable_shared" = yes || enable_static=yes
8325    AC_MSG_RESULT([$enable_static])
8326
8327    _LT_TAGVAR(GCC, $1)="$G77"
8328    _LT_TAGVAR(LD, $1)="$LD"
8329
8330    ## CAVEAT EMPTOR:
8331    ## There is no encapsulation within the following macros, do not change
8332    ## the running order or otherwise move them around unless you know exactly
8333    ## what you are doing...
8334    _LT_COMPILER_PIC($1)
8335    _LT_COMPILER_C_O($1)
8336    _LT_COMPILER_FILE_LOCKS($1)
8337    _LT_LINKER_SHLIBS($1)
8338    _LT_SYS_DYNAMIC_LINKER($1)
8339    _LT_LINKER_HARDCODE_LIBPATH($1)
8340
8341    _LT_CONFIG($1)
8342  fi # test -n "$compiler"
8343
8344  GCC=$lt_save_GCC
8345  CC="$lt_save_CC"
8346  CFLAGS="$lt_save_CFLAGS"
8347fi # test "$_lt_disable_F77" != yes
8348
8349AC_LANG_POP
8350])# _LT_LANG_F77_CONFIG
8351
8352
8353# _LT_LANG_FC_CONFIG([TAG])
8354# -------------------------
8355# Ensure that the configuration variables for a Fortran compiler are
8356# suitably defined.  These variables are subsequently used by _LT_CONFIG
8357# to write the compiler configuration to `libtool'.
8358m4_defun([_LT_LANG_FC_CONFIG],
8359[AC_LANG_PUSH(Fortran)
8360
8361if test -z "$FC" || test "X$FC" = "Xno"; then
8362  _lt_disable_FC=yes
8363fi
8364
8365_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8366_LT_TAGVAR(allow_undefined_flag, $1)=
8367_LT_TAGVAR(always_export_symbols, $1)=no
8368_LT_TAGVAR(archive_expsym_cmds, $1)=
8369_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8370_LT_TAGVAR(hardcode_direct, $1)=no
8371_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8372_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8373_LT_TAGVAR(hardcode_libdir_separator, $1)=
8374_LT_TAGVAR(hardcode_minus_L, $1)=no
8375_LT_TAGVAR(hardcode_automatic, $1)=no
8376_LT_TAGVAR(inherit_rpath, $1)=no
8377_LT_TAGVAR(module_cmds, $1)=
8378_LT_TAGVAR(module_expsym_cmds, $1)=
8379_LT_TAGVAR(link_all_deplibs, $1)=unknown
8380_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8381_LT_TAGVAR(reload_flag, $1)=$reload_flag
8382_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8383_LT_TAGVAR(no_undefined_flag, $1)=
8384_LT_TAGVAR(whole_archive_flag_spec, $1)=
8385_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8386
8387# Source file extension for fc test sources.
8388ac_ext=${ac_fc_srcext-f}
8389
8390# Object file extension for compiled fc test sources.
8391objext=o
8392_LT_TAGVAR(objext, $1)=$objext
8393
8394# No sense in running all these tests if we already determined that
8395# the FC compiler isn't working.  Some variables (like enable_shared)
8396# are currently assumed to apply to all compilers on this platform,
8397# and will be corrupted by setting them based on a non-working compiler.
8398if test "$_lt_disable_FC" != yes; then
8399  # Code to be used in simple compile tests
8400  lt_simple_compile_test_code="\
8401      subroutine t
8402      return
8403      end
8404"
8405
8406  # Code to be used in simple link tests
8407  lt_simple_link_test_code="\
8408      program t
8409      end
8410"
8411
8412  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8413  _LT_TAG_COMPILER
8414
8415  # save warnings/boilerplate of simple test code
8416  _LT_COMPILER_BOILERPLATE
8417  _LT_LINKER_BOILERPLATE
8418
8419  # Allow CC to be a program name with arguments.
8420  lt_save_CC="$CC"
8421  lt_save_GCC=$GCC
8422  lt_save_CFLAGS=$CFLAGS
8423  CC=${FC-"f95"}
8424  CFLAGS=$FCFLAGS
8425  compiler=$CC
8426  GCC=$ac_cv_fc_compiler_gnu
8427
8428  _LT_TAGVAR(compiler, $1)=$CC
8429  _LT_CC_BASENAME([$compiler])
8430
8431  if test -n "$compiler"; then
8432    AC_MSG_CHECKING([if libtool supports shared libraries])
8433    AC_MSG_RESULT([$can_build_shared])
8434
8435    AC_MSG_CHECKING([whether to build shared libraries])
8436    test "$can_build_shared" = "no" && enable_shared=no
8437
8438    # On AIX, shared libraries and static libraries use the same namespace, and
8439    # are all built from PIC.
8440    case $host_os in
8441      aix3*)
8442        test "$enable_shared" = yes && enable_static=no
8443        if test -n "$RANLIB"; then
8444          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8445          postinstall_cmds='$RANLIB $lib'
8446        fi
8447        ;;
8448      aix[[4-9]]*)
8449	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8450	  test "$enable_shared" = yes && enable_static=no
8451	fi
8452        ;;
8453    esac
8454    AC_MSG_RESULT([$enable_shared])
8455
8456    AC_MSG_CHECKING([whether to build static libraries])
8457    # Make sure either enable_shared or enable_static is yes.
8458    test "$enable_shared" = yes || enable_static=yes
8459    AC_MSG_RESULT([$enable_static])
8460
8461    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8462    _LT_TAGVAR(LD, $1)="$LD"
8463
8464    ## CAVEAT EMPTOR:
8465    ## There is no encapsulation within the following macros, do not change
8466    ## the running order or otherwise move them around unless you know exactly
8467    ## what you are doing...
8468    _LT_SYS_HIDDEN_LIBDEPS($1)
8469    _LT_COMPILER_PIC($1)
8470    _LT_COMPILER_C_O($1)
8471    _LT_COMPILER_FILE_LOCKS($1)
8472    _LT_LINKER_SHLIBS($1)
8473    _LT_SYS_DYNAMIC_LINKER($1)
8474    _LT_LINKER_HARDCODE_LIBPATH($1)
8475
8476    _LT_CONFIG($1)
8477  fi # test -n "$compiler"
8478
8479  GCC=$lt_save_GCC
8480  CC=$lt_save_CC
8481  CFLAGS=$lt_save_CFLAGS
8482fi # test "$_lt_disable_FC" != yes
8483
8484AC_LANG_POP
8485])# _LT_LANG_FC_CONFIG
8486
8487
8488# _LT_LANG_GCJ_CONFIG([TAG])
8489# --------------------------
8490# Ensure that the configuration variables for the GNU Java Compiler compiler
8491# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8492# to write the compiler configuration to `libtool'.
8493m4_defun([_LT_LANG_GCJ_CONFIG],
8494[AC_REQUIRE([LT_PROG_GCJ])dnl
8495AC_LANG_SAVE
8496
8497# Source file extension for Java test sources.
8498ac_ext=java
8499
8500# Object file extension for compiled Java test sources.
8501objext=o
8502_LT_TAGVAR(objext, $1)=$objext
8503
8504# Code to be used in simple compile tests
8505lt_simple_compile_test_code="class foo {}"
8506
8507# Code to be used in simple link tests
8508lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8509
8510# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8511_LT_TAG_COMPILER
8512
8513# save warnings/boilerplate of simple test code
8514_LT_COMPILER_BOILERPLATE
8515_LT_LINKER_BOILERPLATE
8516
8517# Allow CC to be a program name with arguments.
8518lt_save_CC=$CC
8519lt_save_CFLAGS=$CFLAGS
8520lt_save_GCC=$GCC
8521GCC=yes
8522CC=${GCJ-"gcj"}
8523CFLAGS=$GCJFLAGS
8524compiler=$CC
8525_LT_TAGVAR(compiler, $1)=$CC
8526_LT_TAGVAR(LD, $1)="$LD"
8527_LT_CC_BASENAME([$compiler])
8528
8529# GCJ did not exist at the time GCC didn't implicitly link libc in.
8530_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8531
8532_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8533_LT_TAGVAR(reload_flag, $1)=$reload_flag
8534_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8535
8536if test -n "$compiler"; then
8537  _LT_COMPILER_NO_RTTI($1)
8538  _LT_COMPILER_PIC($1)
8539  _LT_COMPILER_C_O($1)
8540  _LT_COMPILER_FILE_LOCKS($1)
8541  _LT_LINKER_SHLIBS($1)
8542  _LT_LINKER_HARDCODE_LIBPATH($1)
8543
8544  _LT_CONFIG($1)
8545fi
8546
8547AC_LANG_RESTORE
8548
8549GCC=$lt_save_GCC
8550CC=$lt_save_CC
8551CFLAGS=$lt_save_CFLAGS
8552])# _LT_LANG_GCJ_CONFIG
8553
8554
8555# _LT_LANG_GO_CONFIG([TAG])
8556# --------------------------
8557# Ensure that the configuration variables for the GNU Go compiler
8558# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8559# to write the compiler configuration to `libtool'.
8560m4_defun([_LT_LANG_GO_CONFIG],
8561[AC_REQUIRE([LT_PROG_GO])dnl
8562AC_LANG_SAVE
8563
8564# Source file extension for Go test sources.
8565ac_ext=go
8566
8567# Object file extension for compiled Go test sources.
8568objext=o
8569_LT_TAGVAR(objext, $1)=$objext
8570
8571# Code to be used in simple compile tests
8572lt_simple_compile_test_code="package main; func main() { }"
8573
8574# Code to be used in simple link tests
8575lt_simple_link_test_code='package main; func main() { }'
8576
8577# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8578_LT_TAG_COMPILER
8579
8580# save warnings/boilerplate of simple test code
8581_LT_COMPILER_BOILERPLATE
8582_LT_LINKER_BOILERPLATE
8583
8584# Allow CC to be a program name with arguments.
8585lt_save_CC=$CC
8586lt_save_CFLAGS=$CFLAGS
8587lt_save_GCC=$GCC
8588GCC=yes
8589CC=${GOC-"gccgo"}
8590CFLAGS=$GOFLAGS
8591compiler=$CC
8592_LT_TAGVAR(compiler, $1)=$CC
8593_LT_TAGVAR(LD, $1)="$LD"
8594_LT_CC_BASENAME([$compiler])
8595
8596# Go did not exist at the time GCC didn't implicitly link libc in.
8597_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8598
8599_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8600_LT_TAGVAR(reload_flag, $1)=$reload_flag
8601_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8602
8603if test -n "$compiler"; then
8604  _LT_COMPILER_NO_RTTI($1)
8605  _LT_COMPILER_PIC($1)
8606  _LT_COMPILER_C_O($1)
8607  _LT_COMPILER_FILE_LOCKS($1)
8608  _LT_LINKER_SHLIBS($1)
8609  _LT_LINKER_HARDCODE_LIBPATH($1)
8610
8611  _LT_CONFIG($1)
8612fi
8613
8614AC_LANG_RESTORE
8615
8616GCC=$lt_save_GCC
8617CC=$lt_save_CC
8618CFLAGS=$lt_save_CFLAGS
8619])# _LT_LANG_GO_CONFIG
8620
8621
8622# _LT_LANG_RC_CONFIG([TAG])
8623# -------------------------
8624# Ensure that the configuration variables for the Windows resource compiler
8625# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8626# to write the compiler configuration to `libtool'.
8627m4_defun([_LT_LANG_RC_CONFIG],
8628[AC_REQUIRE([LT_PROG_RC])dnl
8629AC_LANG_SAVE
8630
8631# Source file extension for RC test sources.
8632ac_ext=rc
8633
8634# Object file extension for compiled RC test sources.
8635objext=o
8636_LT_TAGVAR(objext, $1)=$objext
8637
8638# Code to be used in simple compile tests
8639lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8640
8641# Code to be used in simple link tests
8642lt_simple_link_test_code="$lt_simple_compile_test_code"
8643
8644# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8645_LT_TAG_COMPILER
8646
8647# save warnings/boilerplate of simple test code
8648_LT_COMPILER_BOILERPLATE
8649_LT_LINKER_BOILERPLATE
8650
8651# Allow CC to be a program name with arguments.
8652lt_save_CC="$CC"
8653lt_save_CFLAGS=$CFLAGS
8654lt_save_GCC=$GCC
8655GCC=
8656CC=${RC-"windres"}
8657CFLAGS=
8658compiler=$CC
8659_LT_TAGVAR(compiler, $1)=$CC
8660_LT_CC_BASENAME([$compiler])
8661_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8662
8663if test -n "$compiler"; then
8664  :
8665  _LT_CONFIG($1)
8666fi
8667
8668GCC=$lt_save_GCC
8669AC_LANG_RESTORE
8670CC=$lt_save_CC
8671CFLAGS=$lt_save_CFLAGS
8672])# _LT_LANG_RC_CONFIG
8673
8674
8675# LT_PROG_GCJ
8676# -----------
8677AC_DEFUN([LT_PROG_GCJ],
8678[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8679  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8680    [AC_CHECK_TOOL(GCJ, gcj,)
8681      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8682      AC_SUBST(GCJFLAGS)])])[]dnl
8683])
8684
8685# Old name:
8686AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8687dnl aclocal-1.4 backwards compatibility:
8688dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8689
8690
8691# LT_PROG_GO
8692# ----------
8693AC_DEFUN([LT_PROG_GO],
8694[AC_CHECK_TOOL(GOC, gccgo,)
8695])
8696
8697
8698# LT_PROG_RC
8699# ----------
8700AC_DEFUN([LT_PROG_RC],
8701[AC_CHECK_TOOL(RC, windres,)
8702])
8703
8704# Old name:
8705AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8706dnl aclocal-1.4 backwards compatibility:
8707dnl AC_DEFUN([LT_AC_PROG_RC], [])
8708
8709
8710# _LT_DECL_EGREP
8711# --------------
8712# If we don't have a new enough Autoconf to choose the best grep
8713# available, choose the one first in the user's PATH.
8714m4_defun([_LT_DECL_EGREP],
8715[AC_REQUIRE([AC_PROG_EGREP])dnl
8716AC_REQUIRE([AC_PROG_FGREP])dnl
8717test -z "$GREP" && GREP=grep
8718_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8719_LT_DECL([], [EGREP], [1], [An ERE matcher])
8720_LT_DECL([], [FGREP], [1], [A literal string matcher])
8721dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8722AC_SUBST([GREP])
8723])
8724
8725
8726# _LT_DECL_OBJDUMP
8727# --------------
8728# If we don't have a new enough Autoconf to choose the best objdump
8729# available, choose the one first in the user's PATH.
8730m4_defun([_LT_DECL_OBJDUMP],
8731[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8732test -z "$OBJDUMP" && OBJDUMP=objdump
8733_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8734AC_SUBST([OBJDUMP])
8735])
8736
8737# _LT_DECL_DLLTOOL
8738# ----------------
8739# Ensure DLLTOOL variable is set.
8740m4_defun([_LT_DECL_DLLTOOL],
8741[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8742test -z "$DLLTOOL" && DLLTOOL=dlltool
8743_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8744AC_SUBST([DLLTOOL])
8745])
8746
8747# _LT_DECL_SED
8748# ------------
8749# Check for a fully-functional sed program, that truncates
8750# as few characters as possible.  Prefer GNU sed if found.
8751m4_defun([_LT_DECL_SED],
8752[AC_PROG_SED
8753test -z "$SED" && SED=sed
8754Xsed="$SED -e 1s/^X//"
8755_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8756_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8757    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8758])# _LT_DECL_SED
8759
8760m4_ifndef([AC_PROG_SED], [
8761# NOTE: This macro has been submitted for inclusion into   #
8762#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8763#  a released version of Autoconf we should remove this    #
8764#  macro and use it instead.                               #
8765
8766m4_defun([AC_PROG_SED],
8767[AC_MSG_CHECKING([for a sed that does not truncate output])
8768AC_CACHE_VAL(lt_cv_path_SED,
8769[# Loop through the user's path and test for sed and gsed.
8770# Then use that list of sed's as ones to test for truncation.
8771as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8772for as_dir in $PATH
8773do
8774  IFS=$as_save_IFS
8775  test -z "$as_dir" && as_dir=.
8776  for lt_ac_prog in sed gsed; do
8777    for ac_exec_ext in '' $ac_executable_extensions; do
8778      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8779        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8780      fi
8781    done
8782  done
8783done
8784IFS=$as_save_IFS
8785lt_ac_max=0
8786lt_ac_count=0
8787# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8788# along with /bin/sed that truncates output.
8789for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8790  test ! -f $lt_ac_sed && continue
8791  cat /dev/null > conftest.in
8792  lt_ac_count=0
8793  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8794  # Check for GNU sed and select it if it is found.
8795  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8796    lt_cv_path_SED=$lt_ac_sed
8797    break
8798  fi
8799  while true; do
8800    cat conftest.in conftest.in >conftest.tmp
8801    mv conftest.tmp conftest.in
8802    cp conftest.in conftest.nl
8803    echo >>conftest.nl
8804    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8805    cmp -s conftest.out conftest.nl || break
8806    # 10000 chars as input seems more than enough
8807    test $lt_ac_count -gt 10 && break
8808    lt_ac_count=`expr $lt_ac_count + 1`
8809    if test $lt_ac_count -gt $lt_ac_max; then
8810      lt_ac_max=$lt_ac_count
8811      lt_cv_path_SED=$lt_ac_sed
8812    fi
8813  done
8814done
8815])
8816SED=$lt_cv_path_SED
8817AC_SUBST([SED])
8818AC_MSG_RESULT([$SED])
8819])#AC_PROG_SED
8820])#m4_ifndef
8821
8822# Old name:
8823AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8824dnl aclocal-1.4 backwards compatibility:
8825dnl AC_DEFUN([LT_AC_PROG_SED], [])
8826
8827
8828# _LT_CHECK_SHELL_FEATURES
8829# ------------------------
8830# Find out whether the shell is Bourne or XSI compatible,
8831# or has some other useful features.
8832m4_defun([_LT_CHECK_SHELL_FEATURES],
8833[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8834# Try some XSI features
8835xsi_shell=no
8836( _lt_dummy="a/b/c"
8837  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8838      = c,a/b,b/c, \
8839    && eval 'test $(( 1 + 1 )) -eq 2 \
8840    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8841  && xsi_shell=yes
8842AC_MSG_RESULT([$xsi_shell])
8843_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8844
8845AC_MSG_CHECKING([whether the shell understands "+="])
8846lt_shell_append=no
8847( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8848    >/dev/null 2>&1 \
8849  && lt_shell_append=yes
8850AC_MSG_RESULT([$lt_shell_append])
8851_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8852
8853if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8854  lt_unset=unset
8855else
8856  lt_unset=false
8857fi
8858_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8859
8860# test EBCDIC or ASCII
8861case `echo X|tr X '\101'` in
8862 A) # ASCII based system
8863    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8864  lt_SP2NL='tr \040 \012'
8865  lt_NL2SP='tr \015\012 \040\040'
8866  ;;
8867 *) # EBCDIC based system
8868  lt_SP2NL='tr \100 \n'
8869  lt_NL2SP='tr \r\n \100\100'
8870  ;;
8871esac
8872_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8873_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8874])# _LT_CHECK_SHELL_FEATURES
8875
8876
8877# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8878# ------------------------------------------------------
8879# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8880# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8881m4_defun([_LT_PROG_FUNCTION_REPLACE],
8882[dnl {
8883sed -e '/^$1 ()$/,/^} # $1 /c\
8884$1 ()\
8885{\
8886m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8887} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8888  && mv -f "$cfgfile.tmp" "$cfgfile" \
8889    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8890test 0 -eq $? || _lt_function_replace_fail=:
8891])
8892
8893
8894# _LT_PROG_REPLACE_SHELLFNS
8895# -------------------------
8896# Replace existing portable implementations of several shell functions with
8897# equivalent extended shell implementations where those features are available..
8898m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8899[if test x"$xsi_shell" = xyes; then
8900  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8901    case ${1} in
8902      */*) func_dirname_result="${1%/*}${2}" ;;
8903      *  ) func_dirname_result="${3}" ;;
8904    esac])
8905
8906  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8907    func_basename_result="${1##*/}"])
8908
8909  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8910    case ${1} in
8911      */*) func_dirname_result="${1%/*}${2}" ;;
8912      *  ) func_dirname_result="${3}" ;;
8913    esac
8914    func_basename_result="${1##*/}"])
8915
8916  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8917    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8918    # positional parameters, so assign one to ordinary parameter first.
8919    func_stripname_result=${3}
8920    func_stripname_result=${func_stripname_result#"${1}"}
8921    func_stripname_result=${func_stripname_result%"${2}"}])
8922
8923  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8924    func_split_long_opt_name=${1%%=*}
8925    func_split_long_opt_arg=${1#*=}])
8926
8927  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8928    func_split_short_opt_arg=${1#??}
8929    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8930
8931  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8932    case ${1} in
8933      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8934      *)    func_lo2o_result=${1} ;;
8935    esac])
8936
8937  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8938
8939  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8940
8941  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8942fi
8943
8944if test x"$lt_shell_append" = xyes; then
8945  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8946
8947  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8948    func_quote_for_eval "${2}"
8949dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8950    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8951
8952  # Save a `func_append' function call where possible by direct use of '+='
8953  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8954    && mv -f "$cfgfile.tmp" "$cfgfile" \
8955      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8956  test 0 -eq $? || _lt_function_replace_fail=:
8957else
8958  # Save a `func_append' function call even when '+=' is not available
8959  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8960    && mv -f "$cfgfile.tmp" "$cfgfile" \
8961      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8962  test 0 -eq $? || _lt_function_replace_fail=:
8963fi
8964
8965if test x"$_lt_function_replace_fail" = x":"; then
8966  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8967fi
8968])
8969
8970# _LT_PATH_CONVERSION_FUNCTIONS
8971# -----------------------------
8972# Determine which file name conversion functions should be used by
8973# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8974# for certain cross-compile configurations and native mingw.
8975m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8976[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8977AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8978AC_MSG_CHECKING([how to convert $build file names to $host format])
8979AC_CACHE_VAL(lt_cv_to_host_file_cmd,
8980[case $host in
8981  *-*-mingw* )
8982    case $build in
8983      *-*-mingw* ) # actually msys
8984        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8985        ;;
8986      *-*-cygwin* )
8987        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8988        ;;
8989      * ) # otherwise, assume *nix
8990        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8991        ;;
8992    esac
8993    ;;
8994  *-*-cygwin* )
8995    case $build in
8996      *-*-mingw* ) # actually msys
8997        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8998        ;;
8999      *-*-cygwin* )
9000        lt_cv_to_host_file_cmd=func_convert_file_noop
9001        ;;
9002      * ) # otherwise, assume *nix
9003        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
9004        ;;
9005    esac
9006    ;;
9007  * ) # unhandled hosts (and "normal" native builds)
9008    lt_cv_to_host_file_cmd=func_convert_file_noop
9009    ;;
9010esac
9011])
9012to_host_file_cmd=$lt_cv_to_host_file_cmd
9013AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
9014_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
9015         [0], [convert $build file names to $host format])dnl
9016
9017AC_MSG_CHECKING([how to convert $build file names to toolchain format])
9018AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
9019[#assume ordinary cross tools, or native build.
9020lt_cv_to_tool_file_cmd=func_convert_file_noop
9021case $host in
9022  *-*-mingw* )
9023    case $build in
9024      *-*-mingw* ) # actually msys
9025        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
9026        ;;
9027    esac
9028    ;;
9029esac
9030])
9031to_tool_file_cmd=$lt_cv_to_tool_file_cmd
9032AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
9033_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
9034         [0], [convert $build files to toolchain format])dnl
9035])# _LT_PATH_CONVERSION_FUNCTIONS
9036
9037# Helper functions for option handling.                    -*- Autoconf -*-
9038#
9039#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9040#   Inc.
9041#   Written by Gary V. Vaughan, 2004
9042#
9043# This file is free software; the Free Software Foundation gives
9044# unlimited permission to copy and/or distribute it, with or without
9045# modifications, as long as this notice is preserved.
9046
9047# serial 7 ltoptions.m4
9048
9049# This is to help aclocal find these macros, as it can't see m4_define.
9050AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9051
9052
9053# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9054# ------------------------------------------
9055m4_define([_LT_MANGLE_OPTION],
9056[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9057
9058
9059# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9060# ---------------------------------------
9061# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9062# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9063# saved as a flag.
9064m4_define([_LT_SET_OPTION],
9065[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9066m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9067        _LT_MANGLE_DEFUN([$1], [$2]),
9068    [m4_warning([Unknown $1 option `$2'])])[]dnl
9069])
9070
9071
9072# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9073# ------------------------------------------------------------
9074# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9075m4_define([_LT_IF_OPTION],
9076[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9077
9078
9079# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9080# -------------------------------------------------------
9081# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9082# are set.
9083m4_define([_LT_UNLESS_OPTIONS],
9084[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9085	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9086		      [m4_define([$0_found])])])[]dnl
9087m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9088])[]dnl
9089])
9090
9091
9092# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9093# ----------------------------------------
9094# OPTION-LIST is a space-separated list of Libtool options associated
9095# with MACRO-NAME.  If any OPTION has a matching handler declared with
9096# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9097# the unknown option and exit.
9098m4_defun([_LT_SET_OPTIONS],
9099[# Set options
9100m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9101    [_LT_SET_OPTION([$1], _LT_Option)])
9102
9103m4_if([$1],[LT_INIT],[
9104  dnl
9105  dnl Simply set some default values (i.e off) if boolean options were not
9106  dnl specified:
9107  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9108  ])
9109  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9110  ])
9111  dnl
9112  dnl If no reference was made to various pairs of opposing options, then
9113  dnl we run the default mode handler for the pair.  For example, if neither
9114  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9115  dnl archives by default:
9116  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9117  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9118  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9119  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9120  		   [_LT_ENABLE_FAST_INSTALL])
9121  ])
9122])# _LT_SET_OPTIONS
9123
9124
9125
9126# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9127# -----------------------------------------
9128m4_define([_LT_MANGLE_DEFUN],
9129[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9130
9131
9132# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9133# -----------------------------------------------
9134m4_define([LT_OPTION_DEFINE],
9135[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9136])# LT_OPTION_DEFINE
9137
9138
9139# dlopen
9140# ------
9141LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9142])
9143
9144AU_DEFUN([AC_LIBTOOL_DLOPEN],
9145[_LT_SET_OPTION([LT_INIT], [dlopen])
9146AC_DIAGNOSE([obsolete],
9147[$0: Remove this warning and the call to _LT_SET_OPTION when you
9148put the `dlopen' option into LT_INIT's first parameter.])
9149])
9150
9151dnl aclocal-1.4 backwards compatibility:
9152dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9153
9154
9155# win32-dll
9156# ---------
9157# Declare package support for building win32 dll's.
9158LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9159[enable_win32_dll=yes
9160
9161case $host in
9162*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9163  AC_CHECK_TOOL(AS, as, false)
9164  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9165  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9166  ;;
9167esac
9168
9169test -z "$AS" && AS=as
9170_LT_DECL([], [AS],      [1], [Assembler program])dnl
9171
9172test -z "$DLLTOOL" && DLLTOOL=dlltool
9173_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9174
9175test -z "$OBJDUMP" && OBJDUMP=objdump
9176_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9177])# win32-dll
9178
9179AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9180[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9181_LT_SET_OPTION([LT_INIT], [win32-dll])
9182AC_DIAGNOSE([obsolete],
9183[$0: Remove this warning and the call to _LT_SET_OPTION when you
9184put the `win32-dll' option into LT_INIT's first parameter.])
9185])
9186
9187dnl aclocal-1.4 backwards compatibility:
9188dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9189
9190
9191# _LT_ENABLE_SHARED([DEFAULT])
9192# ----------------------------
9193# implement the --enable-shared flag, and supports the `shared' and
9194# `disable-shared' LT_INIT options.
9195# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9196m4_define([_LT_ENABLE_SHARED],
9197[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9198AC_ARG_ENABLE([shared],
9199    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9200	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9201    [p=${PACKAGE-default}
9202    case $enableval in
9203    yes) enable_shared=yes ;;
9204    no) enable_shared=no ;;
9205    *)
9206      enable_shared=no
9207      # Look at the argument we got.  We use all the common list separators.
9208      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9209      for pkg in $enableval; do
9210	IFS="$lt_save_ifs"
9211	if test "X$pkg" = "X$p"; then
9212	  enable_shared=yes
9213	fi
9214      done
9215      IFS="$lt_save_ifs"
9216      ;;
9217    esac],
9218    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9219
9220    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9221	[Whether or not to build shared libraries])
9222])# _LT_ENABLE_SHARED
9223
9224LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9225LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9226
9227# Old names:
9228AC_DEFUN([AC_ENABLE_SHARED],
9229[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9230])
9231
9232AC_DEFUN([AC_DISABLE_SHARED],
9233[_LT_SET_OPTION([LT_INIT], [disable-shared])
9234])
9235
9236AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9237AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9238
9239dnl aclocal-1.4 backwards compatibility:
9240dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9241dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9242
9243
9244
9245# _LT_ENABLE_STATIC([DEFAULT])
9246# ----------------------------
9247# implement the --enable-static flag, and support the `static' and
9248# `disable-static' LT_INIT options.
9249# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9250m4_define([_LT_ENABLE_STATIC],
9251[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9252AC_ARG_ENABLE([static],
9253    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9254	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9255    [p=${PACKAGE-default}
9256    case $enableval in
9257    yes) enable_static=yes ;;
9258    no) enable_static=no ;;
9259    *)
9260     enable_static=no
9261      # Look at the argument we got.  We use all the common list separators.
9262      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9263      for pkg in $enableval; do
9264	IFS="$lt_save_ifs"
9265	if test "X$pkg" = "X$p"; then
9266	  enable_static=yes
9267	fi
9268      done
9269      IFS="$lt_save_ifs"
9270      ;;
9271    esac],
9272    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9273
9274    _LT_DECL([build_old_libs], [enable_static], [0],
9275	[Whether or not to build static libraries])
9276])# _LT_ENABLE_STATIC
9277
9278LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9279LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9280
9281# Old names:
9282AC_DEFUN([AC_ENABLE_STATIC],
9283[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9284])
9285
9286AC_DEFUN([AC_DISABLE_STATIC],
9287[_LT_SET_OPTION([LT_INIT], [disable-static])
9288])
9289
9290AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9291AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9292
9293dnl aclocal-1.4 backwards compatibility:
9294dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9295dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9296
9297
9298
9299# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9300# ----------------------------------
9301# implement the --enable-fast-install flag, and support the `fast-install'
9302# and `disable-fast-install' LT_INIT options.
9303# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9304m4_define([_LT_ENABLE_FAST_INSTALL],
9305[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9306AC_ARG_ENABLE([fast-install],
9307    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9308    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9309    [p=${PACKAGE-default}
9310    case $enableval in
9311    yes) enable_fast_install=yes ;;
9312    no) enable_fast_install=no ;;
9313    *)
9314      enable_fast_install=no
9315      # Look at the argument we got.  We use all the common list separators.
9316      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9317      for pkg in $enableval; do
9318	IFS="$lt_save_ifs"
9319	if test "X$pkg" = "X$p"; then
9320	  enable_fast_install=yes
9321	fi
9322      done
9323      IFS="$lt_save_ifs"
9324      ;;
9325    esac],
9326    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9327
9328_LT_DECL([fast_install], [enable_fast_install], [0],
9329	 [Whether or not to optimize for fast installation])dnl
9330])# _LT_ENABLE_FAST_INSTALL
9331
9332LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9333LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9334
9335# Old names:
9336AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9337[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9338AC_DIAGNOSE([obsolete],
9339[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9340the `fast-install' option into LT_INIT's first parameter.])
9341])
9342
9343AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9344[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9345AC_DIAGNOSE([obsolete],
9346[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9347the `disable-fast-install' option into LT_INIT's first parameter.])
9348])
9349
9350dnl aclocal-1.4 backwards compatibility:
9351dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9352dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9353
9354
9355# _LT_WITH_PIC([MODE])
9356# --------------------
9357# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9358# LT_INIT options.
9359# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9360m4_define([_LT_WITH_PIC],
9361[AC_ARG_WITH([pic],
9362    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9363	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9364    [lt_p=${PACKAGE-default}
9365    case $withval in
9366    yes|no) pic_mode=$withval ;;
9367    *)
9368      pic_mode=default
9369      # Look at the argument we got.  We use all the common list separators.
9370      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9371      for lt_pkg in $withval; do
9372	IFS="$lt_save_ifs"
9373	if test "X$lt_pkg" = "X$lt_p"; then
9374	  pic_mode=yes
9375	fi
9376      done
9377      IFS="$lt_save_ifs"
9378      ;;
9379    esac],
9380    [pic_mode=default])
9381
9382test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9383
9384_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9385])# _LT_WITH_PIC
9386
9387LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9388LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9389
9390# Old name:
9391AU_DEFUN([AC_LIBTOOL_PICMODE],
9392[_LT_SET_OPTION([LT_INIT], [pic-only])
9393AC_DIAGNOSE([obsolete],
9394[$0: Remove this warning and the call to _LT_SET_OPTION when you
9395put the `pic-only' option into LT_INIT's first parameter.])
9396])
9397
9398dnl aclocal-1.4 backwards compatibility:
9399dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9400
9401
9402m4_define([_LTDL_MODE], [])
9403LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9404		 [m4_define([_LTDL_MODE], [nonrecursive])])
9405LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9406		 [m4_define([_LTDL_MODE], [recursive])])
9407LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9408		 [m4_define([_LTDL_MODE], [subproject])])
9409
9410m4_define([_LTDL_TYPE], [])
9411LT_OPTION_DEFINE([LTDL_INIT], [installable],
9412		 [m4_define([_LTDL_TYPE], [installable])])
9413LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9414		 [m4_define([_LTDL_TYPE], [convenience])])
9415
9416# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9417#
9418# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9419# Written by Gary V. Vaughan, 2004
9420#
9421# This file is free software; the Free Software Foundation gives
9422# unlimited permission to copy and/or distribute it, with or without
9423# modifications, as long as this notice is preserved.
9424
9425# serial 6 ltsugar.m4
9426
9427# This is to help aclocal find these macros, as it can't see m4_define.
9428AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9429
9430
9431# lt_join(SEP, ARG1, [ARG2...])
9432# -----------------------------
9433# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9434# associated separator.
9435# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9436# versions in m4sugar had bugs.
9437m4_define([lt_join],
9438[m4_if([$#], [1], [],
9439       [$#], [2], [[$2]],
9440       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9441m4_define([_lt_join],
9442[m4_if([$#$2], [2], [],
9443       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9444
9445
9446# lt_car(LIST)
9447# lt_cdr(LIST)
9448# ------------
9449# Manipulate m4 lists.
9450# These macros are necessary as long as will still need to support
9451# Autoconf-2.59 which quotes differently.
9452m4_define([lt_car], [[$1]])
9453m4_define([lt_cdr],
9454[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9455       [$#], 1, [],
9456       [m4_dquote(m4_shift($@))])])
9457m4_define([lt_unquote], $1)
9458
9459
9460# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9461# ------------------------------------------
9462# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9463# Note that neither SEPARATOR nor STRING are expanded; they are appended
9464# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9465# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9466# than defined and empty).
9467#
9468# This macro is needed until we can rely on Autoconf 2.62, since earlier
9469# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9470m4_define([lt_append],
9471[m4_define([$1],
9472	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9473
9474
9475
9476# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9477# ----------------------------------------------------------
9478# Produce a SEP delimited list of all paired combinations of elements of
9479# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9480# has the form PREFIXmINFIXSUFFIXn.
9481# Needed until we can rely on m4_combine added in Autoconf 2.62.
9482m4_define([lt_combine],
9483[m4_if(m4_eval([$# > 3]), [1],
9484       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9485[[m4_foreach([_Lt_prefix], [$2],
9486	     [m4_foreach([_Lt_suffix],
9487		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9488	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9489
9490
9491# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9492# -----------------------------------------------------------------------
9493# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9494# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9495m4_define([lt_if_append_uniq],
9496[m4_ifdef([$1],
9497	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9498		 [lt_append([$1], [$2], [$3])$4],
9499		 [$5])],
9500	  [lt_append([$1], [$2], [$3])$4])])
9501
9502
9503# lt_dict_add(DICT, KEY, VALUE)
9504# -----------------------------
9505m4_define([lt_dict_add],
9506[m4_define([$1($2)], [$3])])
9507
9508
9509# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9510# --------------------------------------------
9511m4_define([lt_dict_add_subkey],
9512[m4_define([$1($2:$3)], [$4])])
9513
9514
9515# lt_dict_fetch(DICT, KEY, [SUBKEY])
9516# ----------------------------------
9517m4_define([lt_dict_fetch],
9518[m4_ifval([$3],
9519	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9520    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9521
9522
9523# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9524# -----------------------------------------------------------------
9525m4_define([lt_if_dict_fetch],
9526[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9527	[$5],
9528    [$6])])
9529
9530
9531# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9532# --------------------------------------------------------------
9533m4_define([lt_dict_filter],
9534[m4_if([$5], [], [],
9535  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9536           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9537		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9538])
9539
9540# ltversion.m4 -- version numbers			-*- Autoconf -*-
9541#
9542#   Copyright (C) 2004 Free Software Foundation, Inc.
9543#   Written by Scott James Remnant, 2004
9544#
9545# This file is free software; the Free Software Foundation gives
9546# unlimited permission to copy and/or distribute it, with or without
9547# modifications, as long as this notice is preserved.
9548
9549# @configure_input@
9550
9551# serial 3337 ltversion.m4
9552# This file is part of GNU Libtool
9553
9554m4_define([LT_PACKAGE_VERSION], [2.4.2])
9555m4_define([LT_PACKAGE_REVISION], [1.3337])
9556
9557AC_DEFUN([LTVERSION_VERSION],
9558[macro_version='2.4.2'
9559macro_revision='1.3337'
9560_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9561_LT_DECL(, macro_revision, 0)
9562])
9563
9564# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9565#
9566#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9567#   Written by Scott James Remnant, 2004.
9568#
9569# This file is free software; the Free Software Foundation gives
9570# unlimited permission to copy and/or distribute it, with or without
9571# modifications, as long as this notice is preserved.
9572
9573# serial 5 lt~obsolete.m4
9574
9575# These exist entirely to fool aclocal when bootstrapping libtool.
9576#
9577# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9578# which have later been changed to m4_define as they aren't part of the
9579# exported API, or moved to Autoconf or Automake where they belong.
9580#
9581# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9582# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9583# using a macro with the same name in our local m4/libtool.m4 it'll
9584# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9585# and doesn't know about Autoconf macros at all.)
9586#
9587# So we provide this file, which has a silly filename so it's always
9588# included after everything else.  This provides aclocal with the
9589# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9590# because those macros already exist, or will be overwritten later.
9591# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9592#
9593# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9594# Yes, that means every name once taken will need to remain here until
9595# we give up compatibility with versions before 1.7, at which point
9596# we need to keep only those names which we still refer to.
9597
9598# This is to help aclocal find these macros, as it can't see m4_define.
9599AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9600
9601m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9602m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9603m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9604m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9605m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9606m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9607m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9608m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9609m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9610m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9611m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9612m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9613m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9614m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9615m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9616m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9617m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9618m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9619m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9620m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9621m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9622m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9623m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9624m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9625m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9626m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9627m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9628m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9629m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9630m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9631m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9632m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9633m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9634m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9635m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9636m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9637m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9638m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9639m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9640m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9641m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9642m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9643m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9644m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9645m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9646m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9647m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9648m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9649m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9650m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9651m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9652m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9653m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9654m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9655m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9656m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9657m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9658m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9659m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9660m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9661m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9662
9663# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9664# 
9665# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9666#
9667# This program is free software; you can redistribute it and/or modify
9668# it under the terms of the GNU General Public License as published by
9669# the Free Software Foundation; either version 2 of the License, or
9670# (at your option) any later version.
9671#
9672# This program is distributed in the hope that it will be useful, but
9673# WITHOUT ANY WARRANTY; without even the implied warranty of
9674# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9675# General Public License for more details.
9676#
9677# You should have received a copy of the GNU General Public License
9678# along with this program; if not, write to the Free Software
9679# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9680#
9681# As a special exception to the GNU General Public License, if you
9682# distribute this file as part of a program that contains a
9683# configuration script generated by Autoconf, you may include it under
9684# the same distribution terms that you use for the rest of that program.
9685
9686# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9687# ----------------------------------
9688AC_DEFUN([PKG_PROG_PKG_CONFIG],
9689[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9690m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9691AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9692if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9693	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9694fi
9695if test -n "$PKG_CONFIG"; then
9696	_pkg_min_version=m4_default([$1], [0.9.0])
9697	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9698	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9699		AC_MSG_RESULT([yes])
9700	else
9701		AC_MSG_RESULT([no])
9702		PKG_CONFIG=""
9703	fi
9704		
9705fi[]dnl
9706])# PKG_PROG_PKG_CONFIG
9707
9708# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9709#
9710# Check to see whether a particular set of modules exists.  Similar
9711# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9712#
9713#
9714# Similar to PKG_CHECK_MODULES, make sure that the first instance of
9715# this or PKG_CHECK_MODULES is called, or make sure to call
9716# PKG_CHECK_EXISTS manually
9717# --------------------------------------------------------------
9718AC_DEFUN([PKG_CHECK_EXISTS],
9719[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9720if test -n "$PKG_CONFIG" && \
9721    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9722  m4_ifval([$2], [$2], [:])
9723m4_ifvaln([$3], [else
9724  $3])dnl
9725fi])
9726
9727
9728# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9729# ---------------------------------------------
9730m4_define([_PKG_CONFIG],
9731[if test -n "$$1"; then
9732    pkg_cv_[]$1="$$1"
9733 elif test -n "$PKG_CONFIG"; then
9734    PKG_CHECK_EXISTS([$3],
9735                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9736		     [pkg_failed=yes])
9737 else
9738    pkg_failed=untried
9739fi[]dnl
9740])# _PKG_CONFIG
9741
9742# _PKG_SHORT_ERRORS_SUPPORTED
9743# -----------------------------
9744AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9745[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9746if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9747        _pkg_short_errors_supported=yes
9748else
9749        _pkg_short_errors_supported=no
9750fi[]dnl
9751])# _PKG_SHORT_ERRORS_SUPPORTED
9752
9753
9754# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9755# [ACTION-IF-NOT-FOUND])
9756#
9757#
9758# Note that if there is a possibility the first call to
9759# PKG_CHECK_MODULES might not happen, you should be sure to include an
9760# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9761#
9762#
9763# --------------------------------------------------------------
9764AC_DEFUN([PKG_CHECK_MODULES],
9765[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9766AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9767AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9768
9769pkg_failed=no
9770AC_MSG_CHECKING([for $1])
9771
9772_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9773_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9774
9775m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9776and $1[]_LIBS to avoid the need to call pkg-config.
9777See the pkg-config man page for more details.])
9778
9779if test $pkg_failed = yes; then
9780        _PKG_SHORT_ERRORS_SUPPORTED
9781        if test $_pkg_short_errors_supported = yes; then
9782	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9783        else 
9784	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9785        fi
9786	# Put the nasty error message in config.log where it belongs
9787	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9788
9789	ifelse([$4], , [AC_MSG_ERROR(dnl
9790[Package requirements ($2) were not met:
9791
9792$$1_PKG_ERRORS
9793
9794Consider adjusting the PKG_CONFIG_PATH environment variable if you
9795installed software in a non-standard prefix.
9796
9797_PKG_TEXT
9798])],
9799		[AC_MSG_RESULT([no])
9800                $4])
9801elif test $pkg_failed = untried; then
9802	ifelse([$4], , [AC_MSG_FAILURE(dnl
9803[The pkg-config script could not be found or is too old.  Make sure it
9804is in your PATH or set the PKG_CONFIG environment variable to the full
9805path to pkg-config.
9806
9807_PKG_TEXT
9808
9809To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9810		[$4])
9811else
9812	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9813	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9814        AC_MSG_RESULT([yes])
9815	ifelse([$3], , :, [$3])
9816fi[]dnl
9817])# PKG_CHECK_MODULES
9818
9819dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9820dnl
9821dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9822dnl 
9823dnl Permission is hereby granted, free of charge, to any person obtaining a
9824dnl copy of this software and associated documentation files (the "Software"),
9825dnl to deal in the Software without restriction, including without limitation
9826dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9827dnl and/or sell copies of the Software, and to permit persons to whom the
9828dnl Software is furnished to do so, subject to the following conditions:
9829dnl
9830dnl The above copyright notice and this permission notice (including the next
9831dnl paragraph) shall be included in all copies or substantial portions of the
9832dnl Software.
9833dnl
9834dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9835dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9836dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9837dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9838dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9839dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9840dnl DEALINGS IN THE SOFTWARE.
9841
9842# XORG_MACROS_VERSION(required-version)
9843# -------------------------------------
9844# Minimum version: 1.1.0
9845#
9846# If you're using a macro added in Version 1.1 or newer, include this in
9847# your configure.ac with the minimum required version, such as:
9848# XORG_MACROS_VERSION(1.1)
9849#
9850# To ensure that this macro is defined, also add:
9851# m4_ifndef([XORG_MACROS_VERSION],
9852#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9853#
9854#
9855# See the "minimum version" comment for each macro you use to see what 
9856# version you require.
9857m4_defun([XORG_MACROS_VERSION],[
9858m4_define([vers_have], [1.17])
9859m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9860m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9861m4_if(m4_cmp(maj_have, maj_needed), 0,,
9862    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9863m4_if(m4_version_compare(vers_have, [$1]), -1,
9864    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9865m4_undefine([vers_have])
9866m4_undefine([maj_have])
9867m4_undefine([maj_needed])
9868]) # XORG_MACROS_VERSION
9869
9870# XORG_PROG_RAWCPP()
9871# ------------------
9872# Minimum version: 1.0.0
9873#
9874# Find cpp program and necessary flags for use in pre-processing text files
9875# such as man pages and config files
9876AC_DEFUN([XORG_PROG_RAWCPP],[
9877AC_REQUIRE([AC_PROG_CPP])
9878AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9879   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9880
9881# Check for flag to avoid builtin definitions - assumes unix is predefined,
9882# which is not the best choice for supporting other OS'es, but covers most
9883# of the ones we need for now.
9884AC_MSG_CHECKING([if $RAWCPP requires -undef])
9885AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9886if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9887	AC_MSG_RESULT([no])
9888else
9889	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9890		RAWCPPFLAGS=-undef
9891		AC_MSG_RESULT([yes])
9892	# under Cygwin unix is still defined even with -undef
9893	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9894		RAWCPPFLAGS="-undef -ansi"
9895		AC_MSG_RESULT([yes, with -ansi])
9896	else
9897		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9898	fi
9899fi
9900rm -f conftest.$ac_ext
9901
9902AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9903AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9904if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9905	AC_MSG_RESULT([no])
9906else
9907	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9908		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9909		AC_MSG_RESULT([yes])
9910	else
9911		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9912	fi
9913fi
9914rm -f conftest.$ac_ext
9915AC_SUBST(RAWCPPFLAGS)
9916]) # XORG_PROG_RAWCPP
9917
9918# XORG_MANPAGE_SECTIONS()
9919# -----------------------
9920# Minimum version: 1.0.0
9921#
9922# Determine which sections man pages go in for the different man page types
9923# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9924# Not sure if there's any better way than just hardcoding by OS name.
9925# Override default settings by setting environment variables
9926# Added MAN_SUBSTS in version 1.8
9927# Added AC_PROG_SED in version 1.8
9928
9929AC_DEFUN([XORG_MANPAGE_SECTIONS],[
9930AC_REQUIRE([AC_CANONICAL_HOST])
9931AC_REQUIRE([AC_PROG_SED])
9932
9933if test x$APP_MAN_SUFFIX = x    ; then
9934    APP_MAN_SUFFIX=1
9935fi
9936if test x$APP_MAN_DIR = x    ; then
9937    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9938fi
9939
9940if test x$LIB_MAN_SUFFIX = x    ; then
9941    LIB_MAN_SUFFIX=3
9942fi
9943if test x$LIB_MAN_DIR = x    ; then
9944    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9945fi
9946
9947if test x$FILE_MAN_SUFFIX = x    ; then
9948    case $host_os in
9949	solaris*)	FILE_MAN_SUFFIX=4  ;;
9950	*)		FILE_MAN_SUFFIX=5  ;;
9951    esac
9952fi
9953if test x$FILE_MAN_DIR = x    ; then
9954    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9955fi
9956
9957if test x$MISC_MAN_SUFFIX = x    ; then
9958    case $host_os in
9959	solaris*)	MISC_MAN_SUFFIX=5  ;;
9960	*)		MISC_MAN_SUFFIX=7  ;;
9961    esac
9962fi
9963if test x$MISC_MAN_DIR = x    ; then
9964    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9965fi
9966
9967if test x$DRIVER_MAN_SUFFIX = x    ; then
9968    case $host_os in
9969	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9970	*)		DRIVER_MAN_SUFFIX=4  ;;
9971    esac
9972fi
9973if test x$DRIVER_MAN_DIR = x    ; then
9974    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9975fi
9976
9977if test x$ADMIN_MAN_SUFFIX = x    ; then
9978    case $host_os in
9979	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9980	*)		ADMIN_MAN_SUFFIX=8  ;;
9981    esac
9982fi
9983if test x$ADMIN_MAN_DIR = x    ; then
9984    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9985fi
9986
9987
9988AC_SUBST([APP_MAN_SUFFIX])
9989AC_SUBST([LIB_MAN_SUFFIX])
9990AC_SUBST([FILE_MAN_SUFFIX])
9991AC_SUBST([MISC_MAN_SUFFIX])
9992AC_SUBST([DRIVER_MAN_SUFFIX])
9993AC_SUBST([ADMIN_MAN_SUFFIX])
9994AC_SUBST([APP_MAN_DIR])
9995AC_SUBST([LIB_MAN_DIR])
9996AC_SUBST([FILE_MAN_DIR])
9997AC_SUBST([MISC_MAN_DIR])
9998AC_SUBST([DRIVER_MAN_DIR])
9999AC_SUBST([ADMIN_MAN_DIR])
10000
10001XORG_MAN_PAGE="X Version 11"
10002AC_SUBST([XORG_MAN_PAGE])
10003MAN_SUBSTS="\
10004	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10005	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10006	-e 's|__xservername__|Xorg|g' \
10007	-e 's|__xconfigfile__|xorg.conf|g' \
10008	-e 's|__projectroot__|\$(prefix)|g' \
10009	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
10010	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
10011	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
10012	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
10013	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
10014	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
10015	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
10016AC_SUBST([MAN_SUBSTS])
10017
10018]) # XORG_MANPAGE_SECTIONS
10019
10020# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
10021# ------------------------
10022# Minimum version: 1.7.0
10023#
10024# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
10025# provided by xorg-sgml-doctools, if installed.
10026AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
10027AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
10028XORG_SGML_PATH=
10029PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
10030    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
10031    [m4_ifval([$1],[:],
10032        [if test x"$cross_compiling" != x"yes" ; then
10033            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
10034                          [XORG_SGML_PATH=$prefix/share/sgml])
10035         fi])
10036    ])
10037
10038# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10039# the path and the name of the doc stylesheet
10040if test "x$XORG_SGML_PATH" != "x" ; then
10041   AC_MSG_RESULT([$XORG_SGML_PATH])
10042   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10043   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10044else
10045   AC_MSG_RESULT([no])
10046fi
10047
10048AC_SUBST(XORG_SGML_PATH)
10049AC_SUBST(STYLESHEET_SRCDIR)
10050AC_SUBST(XSL_STYLESHEET)
10051AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10052]) # XORG_CHECK_SGML_DOCTOOLS
10053
10054# XORG_CHECK_LINUXDOC
10055# -------------------
10056# Minimum version: 1.0.0
10057#
10058# Defines the variable MAKE_TEXT if the necessary tools and
10059# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10060# Whether or not the necessary tools and files are found can be checked
10061# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10062AC_DEFUN([XORG_CHECK_LINUXDOC],[
10063AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10064AC_REQUIRE([XORG_WITH_PS2PDF])
10065
10066AC_PATH_PROG(LINUXDOC, linuxdoc)
10067
10068AC_MSG_CHECKING([whether to build documentation])
10069
10070if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10071   BUILDDOC=yes
10072else
10073   BUILDDOC=no
10074fi
10075
10076AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10077
10078AC_MSG_RESULT([$BUILDDOC])
10079
10080AC_MSG_CHECKING([whether to build pdf documentation])
10081
10082if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10083   BUILDPDFDOC=yes
10084else
10085   BUILDPDFDOC=no
10086fi
10087
10088AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10089
10090AC_MSG_RESULT([$BUILDPDFDOC])
10091
10092MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10093MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10094MAKE_PDF="$PS2PDF"
10095MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10096
10097AC_SUBST(MAKE_TEXT)
10098AC_SUBST(MAKE_PS)
10099AC_SUBST(MAKE_PDF)
10100AC_SUBST(MAKE_HTML)
10101]) # XORG_CHECK_LINUXDOC
10102
10103# XORG_CHECK_DOCBOOK
10104# -------------------
10105# Minimum version: 1.0.0
10106#
10107# Checks for the ability to build output formats from SGML DocBook source.
10108# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10109# indicates whether the necessary tools and files are found and, if set,
10110# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10111AC_DEFUN([XORG_CHECK_DOCBOOK],[
10112AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10113
10114BUILDTXTDOC=no
10115BUILDPDFDOC=no
10116BUILDPSDOC=no
10117BUILDHTMLDOC=no
10118
10119AC_PATH_PROG(DOCBOOKPS, docbook2ps)
10120AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10121AC_PATH_PROG(DOCBOOKHTML, docbook2html)
10122AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10123
10124AC_MSG_CHECKING([whether to build text documentation])
10125if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10126   test x$BUILD_TXTDOC != xno; then
10127	BUILDTXTDOC=yes
10128fi
10129AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10130AC_MSG_RESULT([$BUILDTXTDOC])
10131
10132AC_MSG_CHECKING([whether to build PDF documentation])
10133if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10134   test x$BUILD_PDFDOC != xno; then
10135	BUILDPDFDOC=yes
10136fi
10137AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10138AC_MSG_RESULT([$BUILDPDFDOC])
10139
10140AC_MSG_CHECKING([whether to build PostScript documentation])
10141if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10142   test x$BUILD_PSDOC != xno; then
10143	BUILDPSDOC=yes
10144fi
10145AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10146AC_MSG_RESULT([$BUILDPSDOC])
10147
10148AC_MSG_CHECKING([whether to build HTML documentation])
10149if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10150   test x$BUILD_HTMLDOC != xno; then
10151	BUILDHTMLDOC=yes
10152fi
10153AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10154AC_MSG_RESULT([$BUILDHTMLDOC])
10155
10156MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10157MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10158MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10159MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10160
10161AC_SUBST(MAKE_TEXT)
10162AC_SUBST(MAKE_PS)
10163AC_SUBST(MAKE_PDF)
10164AC_SUBST(MAKE_HTML)
10165]) # XORG_CHECK_DOCBOOK
10166
10167# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10168# ----------------
10169# Minimum version: 1.5.0
10170# Minimum version for optional DEFAULT argument: 1.11.0
10171#
10172# Documentation tools are not always available on all platforms and sometimes
10173# not at the appropriate level. This macro enables a module to test for the
10174# presence of the tool and obtain it's path in separate variables. Coupled with
10175# the --with-xmlto option, it allows maximum flexibilty in making decisions
10176# as whether or not to use the xmlto package. When DEFAULT is not specified,
10177# --with-xmlto assumes 'auto'.
10178#
10179# Interface to module:
10180# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10181# XMLTO:	returns the path of the xmlto program found
10182#		returns the path set by the user in the environment
10183# --with-xmlto:	'yes' user instructs the module to use xmlto
10184#		'no' user instructs the module not to use xmlto
10185#
10186# Added in version 1.10.0
10187# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10188#                  xmlto for text output requires either lynx, links, or w3m browsers
10189#
10190# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10191#
10192AC_DEFUN([XORG_WITH_XMLTO],[
10193AC_ARG_VAR([XMLTO], [Path to xmlto command])
10194m4_define([_defopt], m4_default([$2], [auto]))
10195AC_ARG_WITH(xmlto,
10196	AS_HELP_STRING([--with-xmlto],
10197	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10198	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10199m4_undefine([_defopt])
10200
10201if test "x$use_xmlto" = x"auto"; then
10202   AC_PATH_PROG([XMLTO], [xmlto])
10203   if test "x$XMLTO" = "x"; then
10204        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10205	have_xmlto=no
10206   else
10207        have_xmlto=yes
10208   fi
10209elif test "x$use_xmlto" = x"yes" ; then
10210   AC_PATH_PROG([XMLTO], [xmlto])
10211   if test "x$XMLTO" = "x"; then
10212        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10213   fi
10214   have_xmlto=yes
10215elif test "x$use_xmlto" = x"no" ; then
10216   if test "x$XMLTO" != "x"; then
10217      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10218   fi
10219   have_xmlto=no
10220else
10221   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10222fi
10223
10224# Test for a minimum version of xmlto, if provided.
10225m4_ifval([$1],
10226[if test "$have_xmlto" = yes; then
10227    # scrape the xmlto version
10228    AC_MSG_CHECKING([the xmlto version])
10229    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10230    AC_MSG_RESULT([$xmlto_version])
10231    AS_VERSION_COMPARE([$xmlto_version], [$1],
10232        [if test "x$use_xmlto" = xauto; then
10233            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10234            have_xmlto=no
10235        else
10236            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10237        fi])
10238fi])
10239
10240# Test for the ability of xmlto to generate a text target
10241have_xmlto_text=no
10242cat > conftest.xml << "EOF"
10243EOF
10244AS_IF([test "$have_xmlto" = yes],
10245      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10246             [have_xmlto_text=yes],
10247             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10248rm -f conftest.xml
10249AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10250AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10251]) # XORG_WITH_XMLTO
10252
10253# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10254# --------------------------------------------
10255# Minimum version: 1.12.0
10256# Minimum version for optional DEFAULT argument: 1.12.0
10257#
10258# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10259# XML-based language used for the transformation of XML documents.
10260# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10261# It is used under the cover by xmlto to generate html files from DocBook/XML.
10262# The XSLT processor is often used as a standalone tool for transformations.
10263# It should not be assumed that this tool is used only to work with documnetation.
10264# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10265#
10266# Interface to module:
10267# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10268# XSLTPROC:	 returns the path of the xsltproc program found
10269#		 returns the path set by the user in the environment
10270# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10271#		  'no' user instructs the module not to use xsltproc
10272# have_xsltproc: returns yes if xsltproc found in PATH or no
10273#
10274# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10275#
10276AC_DEFUN([XORG_WITH_XSLTPROC],[
10277AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10278# Preserves the interface, should it be implemented later
10279m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10280m4_define([_defopt], m4_default([$2], [auto]))
10281AC_ARG_WITH(xsltproc,
10282	AS_HELP_STRING([--with-xsltproc],
10283	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10284	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10285m4_undefine([_defopt])
10286
10287if test "x$use_xsltproc" = x"auto"; then
10288   AC_PATH_PROG([XSLTPROC], [xsltproc])
10289   if test "x$XSLTPROC" = "x"; then
10290        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10291	have_xsltproc=no
10292   else
10293        have_xsltproc=yes
10294   fi
10295elif test "x$use_xsltproc" = x"yes" ; then
10296   AC_PATH_PROG([XSLTPROC], [xsltproc])
10297   if test "x$XSLTPROC" = "x"; then
10298        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10299   fi
10300   have_xsltproc=yes
10301elif test "x$use_xsltproc" = x"no" ; then
10302   if test "x$XSLTPROC" != "x"; then
10303      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10304   fi
10305   have_xsltproc=no
10306else
10307   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10308fi
10309
10310AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10311]) # XORG_WITH_XSLTPROC
10312
10313# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10314# ----------------------------------------
10315# Minimum version: 1.15.0
10316#
10317# PERL (Practical Extraction and Report Language) is a language optimized for
10318# scanning arbitrary text files, extracting information from those text files,
10319# and printing reports based on that information.
10320#
10321# When DEFAULT is not specified, --with-perl assumes 'auto'.
10322#
10323# Interface to module:
10324# HAVE_PERL: used in makefiles to conditionally scan text files
10325# PERL:	     returns the path of the perl program found
10326#	     returns the path set by the user in the environment
10327# --with-perl: 'yes' user instructs the module to use perl
10328#	       'no' user instructs the module not to use perl
10329# have_perl: returns yes if perl found in PATH or no
10330#
10331# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10332#
10333AC_DEFUN([XORG_WITH_PERL],[
10334AC_ARG_VAR([PERL], [Path to perl command])
10335# Preserves the interface, should it be implemented later
10336m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10337m4_define([_defopt], m4_default([$2], [auto]))
10338AC_ARG_WITH(perl,
10339	AS_HELP_STRING([--with-perl],
10340	   [Use perl for extracting information from files (default: ]_defopt[)]),
10341	   [use_perl=$withval], [use_perl=]_defopt)
10342m4_undefine([_defopt])
10343
10344if test "x$use_perl" = x"auto"; then
10345   AC_PATH_PROG([PERL], [perl])
10346   if test "x$PERL" = "x"; then
10347        AC_MSG_WARN([perl not found - cannot extract information and report])
10348	have_perl=no
10349   else
10350        have_perl=yes
10351   fi
10352elif test "x$use_perl" = x"yes" ; then
10353   AC_PATH_PROG([PERL], [perl])
10354   if test "x$PERL" = "x"; then
10355        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10356   fi
10357   have_perl=yes
10358elif test "x$use_perl" = x"no" ; then
10359   if test "x$PERL" != "x"; then
10360      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10361   fi
10362   have_perl=no
10363else
10364   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10365fi
10366
10367AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10368]) # XORG_WITH_PERL
10369
10370# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10371# ----------------
10372# Minimum version: 1.5.0
10373# Minimum version for optional DEFAULT argument: 1.11.0
10374#
10375# Documentation tools are not always available on all platforms and sometimes
10376# not at the appropriate level. This macro enables a module to test for the
10377# presence of the tool and obtain it's path in separate variables. Coupled with
10378# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10379# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10380# --with-asciidoc assumes 'auto'.
10381#
10382# Interface to module:
10383# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10384# ASCIIDOC:	 returns the path of the asciidoc program found
10385#		 returns the path set by the user in the environment
10386# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10387#		  'no' user instructs the module not to use asciidoc
10388#
10389# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10390#
10391AC_DEFUN([XORG_WITH_ASCIIDOC],[
10392AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10393m4_define([_defopt], m4_default([$2], [auto]))
10394AC_ARG_WITH(asciidoc,
10395	AS_HELP_STRING([--with-asciidoc],
10396	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10397	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10398m4_undefine([_defopt])
10399
10400if test "x$use_asciidoc" = x"auto"; then
10401   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10402   if test "x$ASCIIDOC" = "x"; then
10403        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10404	have_asciidoc=no
10405   else
10406        have_asciidoc=yes
10407   fi
10408elif test "x$use_asciidoc" = x"yes" ; then
10409   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10410   if test "x$ASCIIDOC" = "x"; then
10411        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10412   fi
10413   have_asciidoc=yes
10414elif test "x$use_asciidoc" = x"no" ; then
10415   if test "x$ASCIIDOC" != "x"; then
10416      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10417   fi
10418   have_asciidoc=no
10419else
10420   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10421fi
10422m4_ifval([$1],
10423[if test "$have_asciidoc" = yes; then
10424    # scrape the asciidoc version
10425    AC_MSG_CHECKING([the asciidoc version])
10426    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10427    AC_MSG_RESULT([$asciidoc_version])
10428    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10429        [if test "x$use_asciidoc" = xauto; then
10430            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10431            have_asciidoc=no
10432        else
10433            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10434        fi])
10435fi])
10436AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10437]) # XORG_WITH_ASCIIDOC
10438
10439# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10440# --------------------------------
10441# Minimum version: 1.5.0
10442# Minimum version for optional DEFAULT argument: 1.11.0
10443#
10444# Documentation tools are not always available on all platforms and sometimes
10445# not at the appropriate level. This macro enables a module to test for the
10446# presence of the tool and obtain it's path in separate variables. Coupled with
10447# the --with-doxygen option, it allows maximum flexibilty in making decisions
10448# as whether or not to use the doxygen package. When DEFAULT is not specified,
10449# --with-doxygen assumes 'auto'.
10450#
10451# Interface to module:
10452# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10453# DOXYGEN:	 returns the path of the doxygen program found
10454#		 returns the path set by the user in the environment
10455# --with-doxygen: 'yes' user instructs the module to use doxygen
10456#		  'no' user instructs the module not to use doxygen
10457#
10458# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10459#
10460AC_DEFUN([XORG_WITH_DOXYGEN],[
10461AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10462m4_define([_defopt], m4_default([$2], [auto]))
10463AC_ARG_WITH(doxygen,
10464	AS_HELP_STRING([--with-doxygen],
10465	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10466	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10467m4_undefine([_defopt])
10468
10469if test "x$use_doxygen" = x"auto"; then
10470   AC_PATH_PROG([DOXYGEN], [doxygen])
10471   if test "x$DOXYGEN" = "x"; then
10472        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10473	have_doxygen=no
10474   else
10475        have_doxygen=yes
10476   fi
10477elif test "x$use_doxygen" = x"yes" ; then
10478   AC_PATH_PROG([DOXYGEN], [doxygen])
10479   if test "x$DOXYGEN" = "x"; then
10480        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10481   fi
10482   have_doxygen=yes
10483elif test "x$use_doxygen" = x"no" ; then
10484   if test "x$DOXYGEN" != "x"; then
10485      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10486   fi
10487   have_doxygen=no
10488else
10489   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10490fi
10491m4_ifval([$1],
10492[if test "$have_doxygen" = yes; then
10493    # scrape the doxygen version
10494    AC_MSG_CHECKING([the doxygen version])
10495    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10496    AC_MSG_RESULT([$doxygen_version])
10497    AS_VERSION_COMPARE([$doxygen_version], [$1],
10498        [if test "x$use_doxygen" = xauto; then
10499            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10500            have_doxygen=no
10501        else
10502            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10503        fi])
10504fi])
10505AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10506]) # XORG_WITH_DOXYGEN
10507
10508# XORG_WITH_GROFF([DEFAULT])
10509# ----------------
10510# Minimum version: 1.6.0
10511# Minimum version for optional DEFAULT argument: 1.11.0
10512#
10513# Documentation tools are not always available on all platforms and sometimes
10514# not at the appropriate level. This macro enables a module to test for the
10515# presence of the tool and obtain it's path in separate variables. Coupled with
10516# the --with-groff option, it allows maximum flexibilty in making decisions
10517# as whether or not to use the groff package. When DEFAULT is not specified,
10518# --with-groff assumes 'auto'.
10519#
10520# Interface to module:
10521# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10522# HAVE_GROFF_MM: the memorandum macros (-mm) package
10523# HAVE_GROFF_MS: the -ms macros package
10524# GROFF:	 returns the path of the groff program found
10525#		 returns the path set by the user in the environment
10526# --with-groff:	 'yes' user instructs the module to use groff
10527#		 'no' user instructs the module not to use groff
10528#
10529# Added in version 1.9.0:
10530# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10531#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10532#		   psselect from the psutils package.
10533#		   the ghostcript package. Refer to the grohtml man pages
10534#
10535# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10536#
10537# OS and distros often splits groff in a basic and full package, the former
10538# having the groff program and the later having devices, fonts and macros
10539# Checking for the groff executable is not enough.
10540#
10541# If macros are missing, we cannot assume that groff is useless, so we don't
10542# unset HAVE_GROFF or GROFF env variables.
10543# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10544#
10545AC_DEFUN([XORG_WITH_GROFF],[
10546AC_ARG_VAR([GROFF], [Path to groff command])
10547m4_define([_defopt], m4_default([$1], [auto]))
10548AC_ARG_WITH(groff,
10549	AS_HELP_STRING([--with-groff],
10550	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10551	   [use_groff=$withval], [use_groff=]_defopt)
10552m4_undefine([_defopt])
10553
10554if test "x$use_groff" = x"auto"; then
10555   AC_PATH_PROG([GROFF], [groff])
10556   if test "x$GROFF" = "x"; then
10557        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10558	have_groff=no
10559   else
10560        have_groff=yes
10561   fi
10562elif test "x$use_groff" = x"yes" ; then
10563   AC_PATH_PROG([GROFF], [groff])
10564   if test "x$GROFF" = "x"; then
10565        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10566   fi
10567   have_groff=yes
10568elif test "x$use_groff" = x"no" ; then
10569   if test "x$GROFF" != "x"; then
10570      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10571   fi
10572   have_groff=no
10573else
10574   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10575fi
10576
10577# We have groff, test for the presence of the macro packages
10578if test "x$have_groff" = x"yes"; then
10579    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10580    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10581        groff_ms_works=yes
10582    else
10583        groff_ms_works=no
10584    fi
10585    AC_MSG_RESULT([$groff_ms_works])
10586    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10587    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10588        groff_mm_works=yes
10589    else
10590        groff_mm_works=no
10591    fi
10592    AC_MSG_RESULT([$groff_mm_works])
10593fi
10594
10595# We have groff, test for HTML dependencies, one command per package
10596if test "x$have_groff" = x"yes"; then
10597   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10598   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10599   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10600   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10601      have_groff_html=yes
10602   else
10603      have_groff_html=no
10604      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10605   fi
10606fi
10607
10608# Set Automake conditionals for Makefiles
10609AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10610AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10611AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10612AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10613]) # XORG_WITH_GROFF
10614
10615# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10616# ---------------------------------------
10617# Minimum version: 1.6.0
10618# Minimum version for optional DEFAULT argument: 1.11.0
10619# Minimum version for optional MIN-VERSION argument: 1.15.0
10620#
10621# Documentation tools are not always available on all platforms and sometimes
10622# not at the appropriate level. This macro enables a module to test for the
10623# presence of the tool and obtain it's path in separate variables. Coupled with
10624# the --with-fop option, it allows maximum flexibilty in making decisions
10625# as whether or not to use the fop package. When DEFAULT is not specified,
10626# --with-fop assumes 'auto'.
10627#
10628# Interface to module:
10629# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10630# FOP:	 	returns the path of the fop program found
10631#		returns the path set by the user in the environment
10632# --with-fop: 	'yes' user instructs the module to use fop
10633#		'no' user instructs the module not to use fop
10634#
10635# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10636#
10637AC_DEFUN([XORG_WITH_FOP],[
10638AC_ARG_VAR([FOP], [Path to fop command])
10639m4_define([_defopt], m4_default([$2], [auto]))
10640AC_ARG_WITH(fop,
10641	AS_HELP_STRING([--with-fop],
10642	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10643	   [use_fop=$withval], [use_fop=]_defopt)
10644m4_undefine([_defopt])
10645
10646if test "x$use_fop" = x"auto"; then
10647   AC_PATH_PROG([FOP], [fop])
10648   if test "x$FOP" = "x"; then
10649        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10650	have_fop=no
10651   else
10652        have_fop=yes
10653   fi
10654elif test "x$use_fop" = x"yes" ; then
10655   AC_PATH_PROG([FOP], [fop])
10656   if test "x$FOP" = "x"; then
10657        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10658   fi
10659   have_fop=yes
10660elif test "x$use_fop" = x"no" ; then
10661   if test "x$FOP" != "x"; then
10662      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10663   fi
10664   have_fop=no
10665else
10666   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10667fi
10668
10669# Test for a minimum version of fop, if provided.
10670m4_ifval([$1],
10671[if test "$have_fop" = yes; then
10672    # scrape the fop version
10673    AC_MSG_CHECKING([for fop minimum version])
10674    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10675    AC_MSG_RESULT([$fop_version])
10676    AS_VERSION_COMPARE([$fop_version], [$1],
10677        [if test "x$use_fop" = xauto; then
10678            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10679            have_fop=no
10680        else
10681            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10682        fi])
10683fi])
10684AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10685]) # XORG_WITH_FOP
10686
10687# XORG_WITH_PS2PDF([DEFAULT])
10688# ----------------
10689# Minimum version: 1.6.0
10690# Minimum version for optional DEFAULT argument: 1.11.0
10691#
10692# Documentation tools are not always available on all platforms and sometimes
10693# not at the appropriate level. This macro enables a module to test for the
10694# presence of the tool and obtain it's path in separate variables. Coupled with
10695# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10696# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10697# --with-ps2pdf assumes 'auto'.
10698#
10699# Interface to module:
10700# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10701# PS2PDF:	returns the path of the ps2pdf program found
10702#		returns the path set by the user in the environment
10703# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10704#		 'no' user instructs the module not to use ps2pdf
10705#
10706# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10707#
10708AC_DEFUN([XORG_WITH_PS2PDF],[
10709AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10710m4_define([_defopt], m4_default([$1], [auto]))
10711AC_ARG_WITH(ps2pdf,
10712	AS_HELP_STRING([--with-ps2pdf],
10713	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10714	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10715m4_undefine([_defopt])
10716
10717if test "x$use_ps2pdf" = x"auto"; then
10718   AC_PATH_PROG([PS2PDF], [ps2pdf])
10719   if test "x$PS2PDF" = "x"; then
10720        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10721	have_ps2pdf=no
10722   else
10723        have_ps2pdf=yes
10724   fi
10725elif test "x$use_ps2pdf" = x"yes" ; then
10726   AC_PATH_PROG([PS2PDF], [ps2pdf])
10727   if test "x$PS2PDF" = "x"; then
10728        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10729   fi
10730   have_ps2pdf=yes
10731elif test "x$use_ps2pdf" = x"no" ; then
10732   if test "x$PS2PDF" != "x"; then
10733      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10734   fi
10735   have_ps2pdf=no
10736else
10737   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10738fi
10739AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10740]) # XORG_WITH_PS2PDF
10741
10742# XORG_ENABLE_DOCS (enable_docs=yes)
10743# ----------------
10744# Minimum version: 1.6.0
10745#
10746# Documentation tools are not always available on all platforms and sometimes
10747# not at the appropriate level. This macro enables a builder to skip all
10748# documentation targets except traditional man pages.
10749# Combined with the specific tool checking macros XORG_WITH_*, it provides
10750# maximum flexibilty in controlling documentation building.
10751# Refer to:
10752# XORG_WITH_XMLTO         --with-xmlto
10753# XORG_WITH_ASCIIDOC      --with-asciidoc
10754# XORG_WITH_DOXYGEN       --with-doxygen
10755# XORG_WITH_FOP           --with-fop
10756# XORG_WITH_GROFF         --with-groff
10757# XORG_WITH_PS2PDF        --with-ps2pdf
10758#
10759# Interface to module:
10760# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10761# --enable-docs: 'yes' user instructs the module to generate docs
10762#		 'no' user instructs the module not to generate docs
10763# parm1:	specify the default value, yes or no.
10764#
10765AC_DEFUN([XORG_ENABLE_DOCS],[
10766m4_define([docs_default], m4_default([$1], [yes]))
10767AC_ARG_ENABLE(docs,
10768	AS_HELP_STRING([--enable-docs],
10769	   [Enable building the documentation (default: ]docs_default[)]),
10770	   [build_docs=$enableval], [build_docs=]docs_default)
10771m4_undefine([docs_default])
10772AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10773AC_MSG_CHECKING([whether to build documentation])
10774AC_MSG_RESULT([$build_docs])
10775]) # XORG_ENABLE_DOCS
10776
10777# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10778# ----------------
10779# Minimum version: 1.6.0
10780#
10781# This macro enables a builder to skip all developer documentation.
10782# Combined with the specific tool checking macros XORG_WITH_*, it provides
10783# maximum flexibilty in controlling documentation building.
10784# Refer to:
10785# XORG_WITH_XMLTO         --with-xmlto
10786# XORG_WITH_ASCIIDOC      --with-asciidoc
10787# XORG_WITH_DOXYGEN       --with-doxygen
10788# XORG_WITH_FOP           --with-fop
10789# XORG_WITH_GROFF         --with-groff
10790# XORG_WITH_PS2PDF        --with-ps2pdf
10791#
10792# Interface to module:
10793# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10794# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10795#			'no' user instructs the module not to generate developer docs
10796# parm1:		specify the default value, yes or no.
10797#
10798AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10799m4_define([devel_default], m4_default([$1], [yes]))
10800AC_ARG_ENABLE(devel-docs,
10801	AS_HELP_STRING([--enable-devel-docs],
10802	   [Enable building the developer documentation (default: ]devel_default[)]),
10803	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10804m4_undefine([devel_default])
10805AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10806AC_MSG_CHECKING([whether to build developer documentation])
10807AC_MSG_RESULT([$build_devel_docs])
10808]) # XORG_ENABLE_DEVEL_DOCS
10809
10810# XORG_ENABLE_SPECS (enable_specs=yes)
10811# ----------------
10812# Minimum version: 1.6.0
10813#
10814# This macro enables a builder to skip all functional specification targets.
10815# Combined with the specific tool checking macros XORG_WITH_*, it provides
10816# maximum flexibilty in controlling documentation building.
10817# Refer to:
10818# XORG_WITH_XMLTO         --with-xmlto
10819# XORG_WITH_ASCIIDOC      --with-asciidoc
10820# XORG_WITH_DOXYGEN       --with-doxygen
10821# XORG_WITH_FOP           --with-fop
10822# XORG_WITH_GROFF         --with-groff
10823# XORG_WITH_PS2PDF        --with-ps2pdf
10824#
10825# Interface to module:
10826# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10827# --enable-specs:	'yes' user instructs the module to generate specs
10828#			'no' user instructs the module not to generate specs
10829# parm1:		specify the default value, yes or no.
10830#
10831AC_DEFUN([XORG_ENABLE_SPECS],[
10832m4_define([spec_default], m4_default([$1], [yes]))
10833AC_ARG_ENABLE(specs,
10834	AS_HELP_STRING([--enable-specs],
10835	   [Enable building the specs (default: ]spec_default[)]),
10836	   [build_specs=$enableval], [build_specs=]spec_default)
10837m4_undefine([spec_default])
10838AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10839AC_MSG_CHECKING([whether to build functional specifications])
10840AC_MSG_RESULT([$build_specs])
10841]) # XORG_ENABLE_SPECS
10842
10843# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10844# ----------------------------------------------
10845# Minimum version: 1.13.0
10846#
10847# This macro enables a builder to enable/disable unit testing
10848# It makes no assumption about the test cases implementation
10849# Test cases may or may not use Automake "Support for test suites"
10850# They may or may not use the software utility library GLib
10851#
10852# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10853# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10854# The variable enable_unit_tests is used by other macros in this file.
10855#
10856# Interface to module:
10857# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10858# enable_unit_tests:    used in configure.ac for additional configuration
10859# --enable-unit-tests:	'yes' user instructs the module to build tests
10860#			'no' user instructs the module not to build tests
10861# parm1:		specify the default value, yes or no.
10862#
10863AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10864AC_BEFORE([$0], [XORG_WITH_GLIB])
10865AC_BEFORE([$0], [XORG_LD_WRAP])
10866AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10867m4_define([_defopt], m4_default([$1], [auto]))
10868AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10869	[Enable building unit test cases (default: ]_defopt[)]),
10870	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10871m4_undefine([_defopt])
10872AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10873AC_MSG_CHECKING([whether to build unit test cases])
10874AC_MSG_RESULT([$enable_unit_tests])
10875]) # XORG_ENABLE_UNIT_TESTS
10876
10877# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10878# ------------------------------------------------------
10879# Minimum version: 1.17.0
10880#
10881# This macro enables a builder to enable/disable integration testing
10882# It makes no assumption about the test cases' implementation
10883# Test cases may or may not use Automake "Support for test suites"
10884#
10885# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10886# usually requires less dependencies and may be built and run under less
10887# stringent environments than integration tests.
10888#
10889# Interface to module:
10890# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10891# enable_integration_tests:   used in configure.ac for additional configuration
10892# --enable-integration-tests: 'yes' user instructs the module to build tests
10893#                             'no' user instructs the module not to build tests
10894# parm1:                      specify the default value, yes or no.
10895#
10896AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10897AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10898m4_define([_defopt], m4_default([$1], [auto]))
10899AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10900	[Enable building integration test cases (default: ]_defopt[)]),
10901	[enable_integration_tests=$enableval],
10902	[enable_integration_tests=]_defopt)
10903m4_undefine([_defopt])
10904AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10905	[test "x$enable_integration_tests" != xno])
10906AC_MSG_CHECKING([whether to build unit test cases])
10907AC_MSG_RESULT([$enable_integration_tests])
10908]) # XORG_ENABLE_INTEGRATION_TESTS
10909
10910# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10911# ----------------------------------------
10912# Minimum version: 1.13.0
10913#
10914# GLib is a library which provides advanced data structures and functions.
10915# This macro enables a module to test for the presence of Glib.
10916#
10917# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10918# Otherwise the value of $enable_unit_tests is blank.
10919#
10920# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10921# test support usually requires less dependencies and may be built and run under
10922# less stringent environments than integration tests.
10923#
10924# Interface to module:
10925# HAVE_GLIB: used in makefiles to conditionally build targets
10926# with_glib: used in configure.ac to know if GLib has been found
10927# --with-glib:	'yes' user instructs the module to use glib
10928#		'no' user instructs the module not to use glib
10929#
10930AC_DEFUN([XORG_WITH_GLIB],[
10931AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10932m4_define([_defopt], m4_default([$2], [auto]))
10933AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10934	[Use GLib library for unit testing (default: ]_defopt[)]),
10935	[with_glib=$withval], [with_glib=]_defopt)
10936m4_undefine([_defopt])
10937
10938have_glib=no
10939# Do not probe GLib if user explicitly disabled unit testing
10940if test "x$enable_unit_tests" != x"no"; then
10941  # Do not probe GLib if user explicitly disabled it
10942  if test "x$with_glib" != x"no"; then
10943    m4_ifval(
10944      [$1],
10945      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10946      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10947    )
10948  fi
10949fi
10950
10951# Not having GLib when unit testing has been explicitly requested is an error
10952if test "x$enable_unit_tests" = x"yes"; then
10953  if test "x$have_glib" = x"no"; then
10954    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10955  fi
10956fi
10957
10958# Having unit testing disabled when GLib has been explicitly requested is an error
10959if test "x$enable_unit_tests" = x"no"; then
10960  if test "x$with_glib" = x"yes"; then
10961    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10962  fi
10963fi
10964
10965# Not having GLib when it has been explicitly requested is an error
10966if test "x$with_glib" = x"yes"; then
10967  if test "x$have_glib" = x"no"; then
10968    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10969  fi
10970fi
10971
10972AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10973]) # XORG_WITH_GLIB
10974
10975# XORG_LD_WRAP([required|optional])
10976# ---------------------------------
10977# Minimum version: 1.13.0
10978#
10979# Check if linker supports -wrap, passed via compiler flags
10980#
10981# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10982# Otherwise the value of $enable_unit_tests is blank.
10983#
10984# Argument added in 1.16.0 - default is "required", to match existing behavior
10985# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10986# available, an argument of "optional" allows use when some unit tests require
10987# ld -wrap and others do not.
10988#
10989AC_DEFUN([XORG_LD_WRAP],[
10990XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10991    [AC_LANG_PROGRAM([#include <stdlib.h>
10992                      void __wrap_exit(int status) { return; }],
10993                     [exit(0);])])
10994# Not having ld wrap when unit testing has been explicitly requested is an error
10995if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10996  if test "x$have_ld_wrap" = x"no"; then
10997    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10998  fi
10999fi
11000AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
11001#
11002]) # XORG_LD_WRAP
11003
11004# XORG_CHECK_LINKER_FLAGS
11005# -----------------------
11006# SYNOPSIS
11007#
11008#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
11009#
11010# DESCRIPTION
11011#
11012#   Check whether the given linker FLAGS work with the current language's
11013#   linker, or whether they give an error.
11014#
11015#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
11016#   success/failure.
11017#
11018#   PROGRAM-SOURCE is the program source to link with, if needed
11019#
11020#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
11021#
11022# LICENSE
11023#
11024#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
11025#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
11026#   Copyright (c) 2009 Matteo Frigo
11027#
11028#   This program is free software: you can redistribute it and/or modify it
11029#   under the terms of the GNU General Public License as published by the
11030#   Free Software Foundation, either version 3 of the License, or (at your
11031#   option) any later version.
11032#
11033#   This program is distributed in the hope that it will be useful, but
11034#   WITHOUT ANY WARRANTY; without even the implied warranty of
11035#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11036#   Public License for more details.
11037#
11038#   You should have received a copy of the GNU General Public License along
11039#   with this program. If not, see <http://www.gnu.org/licenses/>.
11040#
11041#   As a special exception, the respective Autoconf Macro's copyright owner
11042#   gives unlimited permission to copy, distribute and modify the configure
11043#   scripts that are the output of Autoconf when processing the Macro. You
11044#   need not follow the terms of the GNU General Public License when using
11045#   or distributing such scripts, even though portions of the text of the
11046#   Macro appear in them. The GNU General Public License (GPL) does govern
11047#   all other use of the material that constitutes the Autoconf Macro.
11048#
11049#   This special exception to the GPL applies to versions of the Autoconf
11050#   Macro released by the Autoconf Archive. When you make and distribute a
11051#   modified version of the Autoconf Macro, you may extend this special
11052#   exception to the GPL to apply to your modified version as well.#
11053AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11054[AC_MSG_CHECKING([whether the linker accepts $1])
11055dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11056AS_LITERAL_IF([$1],
11057  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11058      ax_save_FLAGS=$LDFLAGS
11059      LDFLAGS="$1"
11060      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11061        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11062        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11063      LDFLAGS=$ax_save_FLAGS])],
11064  [ax_save_FLAGS=$LDFLAGS
11065   LDFLAGS="$1"
11066   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11067     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11068     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11069   LDFLAGS=$ax_save_FLAGS])
11070eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11071AC_MSG_RESULT($xorg_check_linker_flags)
11072if test "x$xorg_check_linker_flags" = xyes; then
11073	m4_default([$2], :)
11074else
11075	m4_default([$3], :)
11076fi
11077]) # XORG_CHECK_LINKER_FLAGS
11078
11079# XORG_MEMORY_CHECK_FLAGS
11080# -----------------------
11081# Minimum version: 1.16.0
11082#
11083# This macro attempts to find appropriate memory checking functionality
11084# for various platforms which unit testing code may use to catch various
11085# forms of memory allocation and access errors in testing.
11086#
11087# Interface to module:
11088# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11089#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11090#
11091# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11092#
11093AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11094
11095AC_REQUIRE([AC_CANONICAL_HOST])
11096AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11097           [Environment variables to enable memory checking in tests])
11098
11099# Check for different types of support on different platforms
11100case $host_os in
11101    solaris*)
11102        AC_CHECK_LIB([umem], [umem_alloc],
11103            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11104        ;;
11105    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11106        # both directly and inverted, so should not be 0 or 255.
11107        malloc_debug_env='MALLOC_PERTURB_=15'
11108        ;;
11109    darwin*)
11110        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11111        ;;
11112    *bsd*)
11113        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11114        ;;
11115esac
11116
11117# User supplied flags override default flags
11118if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11119    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11120fi
11121
11122AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11123]) # XORG_WITH_LINT
11124
11125# XORG_CHECK_MALLOC_ZERO
11126# ----------------------
11127# Minimum version: 1.0.0
11128#
11129# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11130# malloc(0) returns NULL.  Packages should add one of these cflags to
11131# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11132AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11133AC_ARG_ENABLE(malloc0returnsnull,
11134	AS_HELP_STRING([--enable-malloc0returnsnull],
11135		       [malloc(0) returns NULL (default: auto)]),
11136	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11137	[MALLOC_ZERO_RETURNS_NULL=auto])
11138
11139AC_MSG_CHECKING([whether malloc(0) returns NULL])
11140if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11141	AC_RUN_IFELSE([AC_LANG_PROGRAM([
11142#include <stdlib.h>
11143],[
11144    char *m0, *r0, *c0, *p;
11145    m0 = malloc(0);
11146    p = malloc(10);
11147    r0 = realloc(p,0);
11148    c0 = calloc(0,10);
11149    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11150])],
11151		[MALLOC_ZERO_RETURNS_NULL=yes],
11152		[MALLOC_ZERO_RETURNS_NULL=no],
11153		[MALLOC_ZERO_RETURNS_NULL=yes])
11154fi
11155AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11156
11157if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11158	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11159	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11160	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11161else
11162	MALLOC_ZERO_CFLAGS=""
11163	XMALLOC_ZERO_CFLAGS=""
11164	XTMALLOC_ZERO_CFLAGS=""
11165fi
11166
11167AC_SUBST([MALLOC_ZERO_CFLAGS])
11168AC_SUBST([XMALLOC_ZERO_CFLAGS])
11169AC_SUBST([XTMALLOC_ZERO_CFLAGS])
11170]) # XORG_CHECK_MALLOC_ZERO
11171
11172# XORG_WITH_LINT()
11173# ----------------
11174# Minimum version: 1.1.0
11175#
11176# This macro enables the use of a tool that flags some suspicious and
11177# non-portable constructs (likely to be bugs) in C language source code.
11178# It will attempt to locate the tool and use appropriate options.
11179# There are various lint type tools on different platforms.
11180#
11181# Interface to module:
11182# LINT:		returns the path to the tool found on the platform
11183#		or the value set to LINT on the configure cmd line
11184#		also an Automake conditional
11185# LINT_FLAGS:	an Automake variable with appropriate flags
11186#
11187# --with-lint:	'yes' user instructs the module to use lint
11188#		'no' user instructs the module not to use lint (default)
11189#
11190# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11191# If the user sets the value of LINT_FLAGS, they are used verbatim.
11192#
11193AC_DEFUN([XORG_WITH_LINT],[
11194
11195AC_ARG_VAR([LINT], [Path to a lint-style command])
11196AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11197AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11198		[Use a lint-style source code checker (default: disabled)])],
11199		[use_lint=$withval], [use_lint=no])
11200
11201# Obtain platform specific info like program name and options
11202# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11203case $host_os in
11204  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11205	lint_name=splint
11206	lint_options="-badflag"
11207	;;
11208  *freebsd* | *netbsd*)
11209	lint_name=lint
11210	lint_options="-u -b"
11211	;;
11212  *solaris*)
11213	lint_name=lint
11214	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11215	;;
11216esac
11217
11218# Test for the presence of the program (either guessed by the code or spelled out by the user)
11219if test "x$use_lint" = x"yes" ; then
11220   AC_PATH_PROG([LINT], [$lint_name])
11221   if test "x$LINT" = "x"; then
11222        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11223   fi
11224elif test "x$use_lint" = x"no" ; then
11225   if test "x$LINT" != "x"; then
11226      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11227   fi
11228else
11229   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11230fi
11231
11232# User supplied flags override default flags
11233if test "x$LINT_FLAGS" != "x"; then
11234   lint_options=$LINT_FLAGS
11235fi
11236
11237AC_SUBST([LINT_FLAGS],[$lint_options])
11238AM_CONDITIONAL(LINT, [test "x$LINT" != x])
11239
11240]) # XORG_WITH_LINT
11241
11242# XORG_LINT_LIBRARY(LIBNAME)
11243# --------------------------
11244# Minimum version: 1.1.0
11245#
11246# Sets up flags for building lint libraries for checking programs that call
11247# functions in the library.
11248#
11249# Interface to module:
11250# LINTLIB		- Automake variable with the name of lint library file to make
11251# MAKE_LINT_LIB		- Automake conditional
11252#
11253# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11254#			  - 'no' user instructs the module not to create a lint library (default)
11255
11256AC_DEFUN([XORG_LINT_LIBRARY],[
11257AC_REQUIRE([XORG_WITH_LINT])
11258AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11259	[Create lint library (default: disabled)])],
11260	[make_lint_lib=$enableval], [make_lint_lib=no])
11261
11262if test "x$make_lint_lib" = x"yes" ; then
11263   LINTLIB=llib-l$1.ln
11264   if test "x$LINT" = "x"; then
11265        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11266   fi
11267elif test "x$make_lint_lib" != x"no" ; then
11268   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11269fi
11270
11271AC_SUBST(LINTLIB)
11272AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11273
11274]) # XORG_LINT_LIBRARY
11275
11276# XORG_COMPILER_BRAND
11277# -------------------
11278# Minimum version: 1.14.0
11279#
11280# Checks for various brands of compilers and sets flags as appropriate:
11281#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11282#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11283#   clang compiler - sets CLANGCC to "yes"
11284#   Intel compiler - sets INTELCC to "yes"
11285#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11286#
11287AC_DEFUN([XORG_COMPILER_BRAND], [
11288AC_LANG_CASE(
11289	[C], [
11290		AC_REQUIRE([AC_PROG_CC_C99])
11291	],
11292	[C++], [
11293		AC_REQUIRE([AC_PROG_CXX])
11294	]
11295)
11296AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11297AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11298AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11299]) # XORG_COMPILER_BRAND
11300
11301# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11302# ---------------
11303# Minimum version: 1.16.0
11304#
11305# Test if the compiler works when passed the given flag as a command line argument.
11306# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11307# next flag in the list until there are no more options.
11308#
11309# Note that this does not guarantee that the compiler supports the flag as some
11310# compilers will simply ignore arguments that they do not understand, but we do
11311# attempt to weed out false positives by using -Werror=unknown-warning-option and
11312# -Werror=unused-command-line-argument
11313#
11314AC_DEFUN([XORG_TESTSET_CFLAG], [
11315m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11316m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11317
11318AC_LANG_COMPILER_REQUIRE
11319
11320AC_LANG_CASE(
11321	[C], [
11322		AC_REQUIRE([AC_PROG_CC_C99])
11323		define([PREFIX], [C])
11324		define([CACHE_PREFIX], [cc])
11325		define([COMPILER], [$CC])
11326	],
11327	[C++], [
11328		define([PREFIX], [CXX])
11329		define([CACHE_PREFIX], [cxx])
11330		define([COMPILER], [$CXX])
11331	]
11332)
11333
11334[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11335
11336if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11337	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11338	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11339			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11340			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11341					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11342					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11343	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11344	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11345fi
11346
11347if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11348	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11349		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11350	fi
11351	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11352	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11353			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11354			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11355					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11356					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11357	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11358	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11359fi
11360
11361found="no"
11362m4_foreach([flag], m4_cdr($@), [
11363	if test $found = "no" ; then
11364		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11365			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11366		fi
11367
11368		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11369			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11370		fi
11371
11372		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11373
11374dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11375		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11376		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11377		AC_CACHE_VAL($cacheid,
11378			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11379					     [eval $cacheid=yes],
11380					     [eval $cacheid=no])])
11381
11382		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11383
11384		eval supported=\$$cacheid
11385		AC_MSG_RESULT([$supported])
11386		if test "$supported" = "yes" ; then
11387			$1="$$1 ]flag["
11388			found="yes"
11389		fi
11390	fi
11391])
11392]) # XORG_TESTSET_CFLAG
11393
11394# XORG_COMPILER_FLAGS
11395# ---------------
11396# Minimum version: 1.16.0
11397#
11398# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11399# arguments supported by the selected compiler which do NOT alter the generated
11400# code.  These arguments will cause the compiler to print various warnings
11401# during compilation AND turn a conservative set of warnings into errors.
11402#
11403# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11404# future versions of util-macros as options are added to new compilers.
11405#
11406AC_DEFUN([XORG_COMPILER_FLAGS], [
11407AC_REQUIRE([XORG_COMPILER_BRAND])
11408
11409AC_ARG_ENABLE(selective-werror,
11410              AS_HELP_STRING([--disable-selective-werror],
11411                             [Turn off selective compiler errors. (default: enabled)]),
11412              [SELECTIVE_WERROR=$enableval],
11413              [SELECTIVE_WERROR=yes])
11414
11415AC_LANG_CASE(
11416        [C], [
11417                define([PREFIX], [C])
11418        ],
11419        [C++], [
11420                define([PREFIX], [CXX])
11421        ]
11422)
11423# -v is too short to test reliably with XORG_TESTSET_CFLAG
11424if test "x$SUNCC" = "xyes"; then
11425    [BASE_]PREFIX[FLAGS]="-v"
11426else
11427    [BASE_]PREFIX[FLAGS]=""
11428fi
11429
11430# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11431XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11432XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11433XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11434XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11435
11436AC_LANG_CASE(
11437	[C], [
11438		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11439		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11440		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11441		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11442		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11443		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11444	]
11445)
11446
11447# This chunk adds additional warnings that could catch undesired effects.
11448XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11449XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11450XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11451XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11452XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11453XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11454XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11455
11456# These are currently disabled because they are noisy.  They will be enabled
11457# in the future once the codebase is sufficiently modernized to silence
11458# them.  For now, I don't want them to drown out the other warnings.
11459# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11460# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11461# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11462
11463# Turn some warnings into errors, so we don't accidently get successful builds
11464# when there are problems that should be fixed.
11465
11466if test "x$SELECTIVE_WERROR" = "xyes" ; then
11467XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11468XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11469XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11470XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11471XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11472XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11473XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11474XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11475XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11476XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11477XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11478XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11479XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11480else
11481AC_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])
11482XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11483XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11484XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11485XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11486XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11487XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11488XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11489XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11490XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11491XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11492XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11493XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11494XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11495fi
11496
11497AC_SUBST([BASE_]PREFIX[FLAGS])
11498]) # XORG_COMPILER_FLAGS
11499
11500# XORG_CWARNFLAGS
11501# ---------------
11502# Minimum version: 1.2.0
11503# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11504#
11505# Defines CWARNFLAGS to enable C compiler warnings.
11506#
11507# This function is deprecated because it defines -fno-strict-aliasing
11508# which alters the code generated by the compiler.  If -fno-strict-aliasing
11509# is needed, then it should be added explicitly in the module when
11510# it is updated to use BASE_CFLAGS.
11511#
11512AC_DEFUN([XORG_CWARNFLAGS], [
11513AC_REQUIRE([XORG_COMPILER_FLAGS])
11514AC_REQUIRE([XORG_COMPILER_BRAND])
11515AC_LANG_CASE(
11516	[C], [
11517		CWARNFLAGS="$BASE_CFLAGS"
11518		if  test "x$GCC" = xyes ; then
11519		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11520		fi
11521		AC_SUBST(CWARNFLAGS)
11522	]
11523)
11524]) # XORG_CWARNFLAGS
11525
11526# XORG_STRICT_OPTION
11527# -----------------------
11528# Minimum version: 1.3.0
11529#
11530# Add configure option to enable strict compilation flags, such as treating
11531# warnings as fatal errors.
11532# If --enable-strict-compilation is passed to configure, adds strict flags to
11533# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11534#
11535# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11536# when strict compilation is unconditionally desired.
11537AC_DEFUN([XORG_STRICT_OPTION], [
11538AC_REQUIRE([XORG_CWARNFLAGS])
11539AC_REQUIRE([XORG_COMPILER_FLAGS])
11540
11541AC_ARG_ENABLE(strict-compilation,
11542			  AS_HELP_STRING([--enable-strict-compilation],
11543			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11544			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11545
11546AC_LANG_CASE(
11547        [C], [
11548                define([PREFIX], [C])
11549        ],
11550        [C++], [
11551                define([PREFIX], [CXX])
11552        ]
11553)
11554
11555[STRICT_]PREFIX[FLAGS]=""
11556XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11557XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11558
11559# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11560# activate it with -Werror, so we add it here explicitly.
11561XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11562
11563if test "x$STRICT_COMPILE" = "xyes"; then
11564    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11565    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11566fi
11567AC_SUBST([STRICT_]PREFIX[FLAGS])
11568AC_SUBST([BASE_]PREFIX[FLAGS])
11569AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11570]) # XORG_STRICT_OPTION
11571
11572# XORG_DEFAULT_OPTIONS
11573# --------------------
11574# Minimum version: 1.3.0
11575#
11576# Defines default options for X.Org modules.
11577#
11578AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11579AC_REQUIRE([AC_PROG_INSTALL])
11580XORG_COMPILER_FLAGS
11581XORG_CWARNFLAGS
11582XORG_STRICT_OPTION
11583XORG_RELEASE_VERSION
11584XORG_CHANGELOG
11585XORG_INSTALL
11586XORG_MANPAGE_SECTIONS
11587m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11588    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11589]) # XORG_DEFAULT_OPTIONS
11590
11591# XORG_INSTALL()
11592# ----------------
11593# Minimum version: 1.4.0
11594#
11595# Defines the variable INSTALL_CMD as the command to copy
11596# INSTALL from $prefix/share/util-macros.
11597#
11598AC_DEFUN([XORG_INSTALL], [
11599AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11600macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11601INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11602mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11603|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11604echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11605AC_SUBST([INSTALL_CMD])
11606]) # XORG_INSTALL
11607dnl Copyright 2005 Red Hat, Inc
11608dnl
11609dnl Permission to use, copy, modify, distribute, and sell this software and its
11610dnl documentation for any purpose is hereby granted without fee, provided that
11611dnl the above copyright notice appear in all copies and that both that
11612dnl copyright notice and this permission notice appear in supporting
11613dnl documentation.
11614dnl
11615dnl The above copyright notice and this permission notice shall be included
11616dnl in all copies or substantial portions of the Software.
11617dnl
11618dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11619dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11620dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11621dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11622dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11623dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11624dnl OTHER DEALINGS IN THE SOFTWARE.
11625dnl
11626dnl Except as contained in this notice, the name of the copyright holders shall
11627dnl not be used in advertising or otherwise to promote the sale, use or
11628dnl other dealings in this Software without prior written authorization
11629dnl from the copyright holders.
11630dnl
11631
11632# XORG_RELEASE_VERSION
11633# --------------------
11634# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11635 
11636AC_DEFUN([XORG_RELEASE_VERSION],[
11637	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11638		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11639		[Major version of this package])
11640	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11641	if test "x$PVM" = "x"; then
11642		PVM="0"
11643	fi
11644	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11645		[$PVM],
11646		[Minor version of this package])
11647	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11648	if test "x$PVP" = "x"; then
11649		PVP="0"
11650	fi
11651	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11652		[$PVP],
11653		[Patch version of this package])
11654])
11655
11656# XORG_CHANGELOG()
11657# ----------------
11658# Minimum version: 1.2.0
11659#
11660# Defines the variable CHANGELOG_CMD as the command to generate
11661# ChangeLog from git.
11662#
11663#
11664AC_DEFUN([XORG_CHANGELOG], [
11665CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11666mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11667|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11668echo 'git directory not found: installing possibly empty changelog.' >&2)"
11669AC_SUBST([CHANGELOG_CMD])
11670]) # XORG_CHANGELOG
11671
11672