aclocal.m4 revision 89c04b6c
189c04b6cSmrg# generated automatically by aclocal 1.13.2 -*- Autoconf -*-
289c04b6cSmrg
389c04b6cSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
41f0ac6a5Smrg
51f0ac6a5Smrg# This file is free software; the Free Software Foundation
61f0ac6a5Smrg# gives unlimited permission to copy and/or distribute it,
71f0ac6a5Smrg# with or without modifications, as long as this notice is preserved.
81f0ac6a5Smrg
91f0ac6a5Smrg# This program is distributed in the hope that it will be useful,
101f0ac6a5Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
111f0ac6a5Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
121f0ac6a5Smrg# PARTICULAR PURPOSE.
131f0ac6a5Smrg
1489c04b6cSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15e5410a46Smrgm4_ifndef([AC_AUTOCONF_VERSION],
16e5410a46Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
176fae4e5dSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
186fae4e5dSmrg[m4_warning([this file was generated for autoconf 2.68.
19e5410a46SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20e5410a46SmrgIf you have problems, you may need to regenerate the build system entirely.
2189c04b6cSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
221f0ac6a5Smrg
2389c04b6cSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
241f0ac6a5Smrg#
25e5410a46Smrg# This file is free software; the Free Software Foundation
26e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
27e5410a46Smrg# with or without modifications, as long as this notice is preserved.
281f0ac6a5Smrg
29e5410a46Smrg# AM_AUTOMAKE_VERSION(VERSION)
30e5410a46Smrg# ----------------------------
31e5410a46Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32e5410a46Smrg# generated from the m4 files accompanying Automake X.Y.
33e5410a46Smrg# (This private macro should not be called outside this file.)
34e5410a46SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3589c04b6cSmrg[am__api_version='1.13'
36e5410a46Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37e5410a46Smrgdnl require some minimum version.  Point them to the right macro.
3889c04b6cSmrgm4_if([$1], [1.13.2], [],
39e5410a46Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40e5410a46Smrg])
411f0ac6a5Smrg
42e5410a46Smrg# _AM_AUTOCONF_VERSION(VERSION)
43e5410a46Smrg# -----------------------------
44e5410a46Smrg# aclocal traces this macro to find the Autoconf version.
45e5410a46Smrg# This is a private macro too.  Using m4_define simplifies
46e5410a46Smrg# the logic in aclocal, which can simply ignore this definition.
47e5410a46Smrgm4_define([_AM_AUTOCONF_VERSION], [])
481f0ac6a5Smrg
49e5410a46Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50e5410a46Smrg# -------------------------------
51e5410a46Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52e5410a46Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53e5410a46SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5489c04b6cSmrg[AM_AUTOMAKE_VERSION([1.13.2])dnl
55e5410a46Smrgm4_ifndef([AC_AUTOCONF_VERSION],
56e5410a46Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57e5410a46Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
581f0ac6a5Smrg
59e5410a46Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
601f0ac6a5Smrg
6189c04b6cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
62e5410a46Smrg#
63e5410a46Smrg# This file is free software; the Free Software Foundation
64e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
65e5410a46Smrg# with or without modifications, as long as this notice is preserved.
661f0ac6a5Smrg
67e5410a46Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6889c04b6cSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
6989c04b6cSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
701f0ac6a5Smrg#
71e5410a46Smrg# Of course, Automake must honor this variable whenever it calls a
72e5410a46Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73e5410a46Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74e5410a46Smrg# depending on how configure is run.  This is pretty annoying, since
75e5410a46Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76e5410a46Smrg# source directory, any form will work fine, but in subdirectories a
77e5410a46Smrg# relative path needs to be adjusted first.
781f0ac6a5Smrg#
79e5410a46Smrg# $ac_aux_dir/missing
80e5410a46Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81e5410a46Smrg# $top_srcdir/$ac_aux_dir/missing
82e5410a46Smrg#    fails if $ac_aux_dir is absolute,
83e5410a46Smrg#    fails when called from a subdirectory in a VPATH build with
84e5410a46Smrg#          a relative $ac_aux_dir
851f0ac6a5Smrg#
86e5410a46Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87e5410a46Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8889c04b6cSmrg# harmless because $srcdir is '.', but things will broke when you
89e5410a46Smrg# start a VPATH build or use an absolute $srcdir.
901f0ac6a5Smrg#
91e5410a46Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92e5410a46Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93e5410a46Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94e5410a46Smrg# and then we would define $MISSING as
95e5410a46Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96e5410a46Smrg# This will work as long as MISSING is not called from configure, because
97e5410a46Smrg# unfortunately $(top_srcdir) has no meaning in configure.
98e5410a46Smrg# However there are other variables, like CC, which are often used in
99e5410a46Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
100e5410a46Smrg#
101e5410a46Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
102e5410a46Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
103e5410a46Smrg# configured tree to be moved without reconfiguration.
1041f0ac6a5Smrg
105e5410a46SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
106e5410a46Smrg[dnl Rely on autoconf to set up CDPATH properly.
107e5410a46SmrgAC_PREREQ([2.50])dnl
108e5410a46Smrg# expand $ac_aux_dir to an absolute path
109e5410a46Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
110e5410a46Smrg])
1111f0ac6a5Smrg
112e5410a46Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1131f0ac6a5Smrg
11489c04b6cSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
115e5410a46Smrg#
116e5410a46Smrg# This file is free software; the Free Software Foundation
117e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
118e5410a46Smrg# with or without modifications, as long as this notice is preserved.
1191f0ac6a5Smrg
120e5410a46Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
121e5410a46Smrg# -------------------------------------
122e5410a46Smrg# Define a conditional.
123e5410a46SmrgAC_DEFUN([AM_CONDITIONAL],
12489c04b6cSmrg[AC_PREREQ([2.52])dnl
12589c04b6cSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12689c04b6cSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
127e5410a46SmrgAC_SUBST([$1_TRUE])dnl
128e5410a46SmrgAC_SUBST([$1_FALSE])dnl
129e5410a46Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
130e5410a46Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
131e5410a46Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
132e5410a46Smrgif $2; then
133e5410a46Smrg  $1_TRUE=
134e5410a46Smrg  $1_FALSE='#'
135e5410a46Smrgelse
136e5410a46Smrg  $1_TRUE='#'
137e5410a46Smrg  $1_FALSE=
138e5410a46Smrgfi
139e5410a46SmrgAC_CONFIG_COMMANDS_PRE(
140e5410a46Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
141e5410a46Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
142e5410a46SmrgUsually this means the macro was only invoked conditionally.]])
143e5410a46Smrgfi])])
1441f0ac6a5Smrg
14589c04b6cSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
146e5410a46Smrg#
147e5410a46Smrg# This file is free software; the Free Software Foundation
148e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
149e5410a46Smrg# with or without modifications, as long as this notice is preserved.
1501f0ac6a5Smrg
1511f0ac6a5Smrg
15289c04b6cSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
153e5410a46Smrg# written in clear, in which case automake, when reading aclocal.m4,
154e5410a46Smrg# will think it sees a *use*, and therefore will trigger all it's
155e5410a46Smrg# C support machinery.  Also note that it means that autoscan, seeing
156e5410a46Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1571f0ac6a5Smrg
1581f0ac6a5Smrg
159e5410a46Smrg# _AM_DEPENDENCIES(NAME)
160e5410a46Smrg# ----------------------
161e5410a46Smrg# See how the compiler implements dependency checking.
16289c04b6cSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
163e5410a46Smrg# We try a few techniques and use that to set a single cache variable.
164e5410a46Smrg#
165e5410a46Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
166e5410a46Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
167e5410a46Smrg# dependency, and given that the user is not expected to run this macro,
168e5410a46Smrg# just rely on AC_PROG_CC.
169e5410a46SmrgAC_DEFUN([_AM_DEPENDENCIES],
170e5410a46Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
171e5410a46SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
172e5410a46SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
173e5410a46SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1741f0ac6a5Smrg
17589c04b6cSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
17689c04b6cSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
17789c04b6cSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
17889c04b6cSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
17989c04b6cSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
18089c04b6cSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18189c04b6cSmrg                    [depcc="$$1"   am_compiler_list=])
1821f0ac6a5Smrg
183e5410a46SmrgAC_CACHE_CHECK([dependency style of $depcc],
184e5410a46Smrg               [am_cv_$1_dependencies_compiler_type],
185e5410a46Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
186e5410a46Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
187e5410a46Smrg  # making bogus files that we don't know about and never remove.  For
188e5410a46Smrg  # instance it was reported that on HP-UX the gcc test will end up
18989c04b6cSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
19089c04b6cSmrg  # in D".
19189c04b6cSmrg  rm -rf conftest.dir
192e5410a46Smrg  mkdir conftest.dir
193e5410a46Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
194e5410a46Smrg  # using a relative directory.
195e5410a46Smrg  cp "$am_depcomp" conftest.dir
196e5410a46Smrg  cd conftest.dir
197e5410a46Smrg  # We will build objects and dependencies in a subdirectory because
198e5410a46Smrg  # it helps to detect inapplicable dependency modes.  For instance
199e5410a46Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
200e5410a46Smrg  # side effect of compilation, but ICC will put the dependencies in
201e5410a46Smrg  # the current directory while Tru64 will put them in the object
202e5410a46Smrg  # directory.
203e5410a46Smrg  mkdir sub
2041f0ac6a5Smrg
205e5410a46Smrg  am_cv_$1_dependencies_compiler_type=none
206e5410a46Smrg  if test "$am_compiler_list" = ""; then
207e5410a46Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
208e5410a46Smrg  fi
209e5410a46Smrg  am__universal=false
210e5410a46Smrg  m4_case([$1], [CC],
211e5410a46Smrg    [case " $depcc " in #(
212e5410a46Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
213e5410a46Smrg     esac],
214e5410a46Smrg    [CXX],
215e5410a46Smrg    [case " $depcc " in #(
216e5410a46Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
217e5410a46Smrg     esac])
2181f0ac6a5Smrg
219e5410a46Smrg  for depmode in $am_compiler_list; do
220e5410a46Smrg    # Setup a source with many dependencies, because some compilers
221e5410a46Smrg    # like to wrap large dependency lists on column 80 (with \), and
222e5410a46Smrg    # we should not choose a depcomp mode which is confused by this.
223e5410a46Smrg    #
224e5410a46Smrg    # We need to recreate these files for each test, as the compiler may
225e5410a46Smrg    # overwrite some of them when testing with obscure command lines.
226e5410a46Smrg    # This happens at least with the AIX C compiler.
227e5410a46Smrg    : > sub/conftest.c
228e5410a46Smrg    for i in 1 2 3 4 5 6; do
229e5410a46Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23089c04b6cSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
23189c04b6cSmrg      # Solaris 10 /bin/sh.
23289c04b6cSmrg      echo '/* dummy */' > sub/conftst$i.h
233e5410a46Smrg    done
234e5410a46Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
235e5410a46Smrg
23689c04b6cSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
237e5410a46Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
23889c04b6cSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
23989c04b6cSmrg    # versions had trouble with output in subdirs.
240e5410a46Smrg    am__obj=sub/conftest.${OBJEXT-o}
241e5410a46Smrg    am__minus_obj="-o $am__obj"
242e5410a46Smrg    case $depmode in
243e5410a46Smrg    gcc)
244e5410a46Smrg      # This depmode causes a compiler race in universal mode.
245e5410a46Smrg      test "$am__universal" = false || continue
246e5410a46Smrg      ;;
247e5410a46Smrg    nosideeffect)
24889c04b6cSmrg      # After this tag, mechanisms are not by side-effect, so they'll
24989c04b6cSmrg      # only be used when explicitly requested.
250e5410a46Smrg      if test "x$enable_dependency_tracking" = xyes; then
251e5410a46Smrg	continue
252e5410a46Smrg      else
253e5410a46Smrg	break
254e5410a46Smrg      fi
255e5410a46Smrg      ;;
25689c04b6cSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
25789c04b6cSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
258e5410a46Smrg      # not run yet.  These depmodes are late enough in the game, and
259e5410a46Smrg      # so weak that their functioning should not be impacted.
260e5410a46Smrg      am__obj=conftest.${OBJEXT-o}
261e5410a46Smrg      am__minus_obj=
262e5410a46Smrg      ;;
263e5410a46Smrg    none) break ;;
264e5410a46Smrg    esac
265e5410a46Smrg    if depmode=$depmode \
266e5410a46Smrg       source=sub/conftest.c object=$am__obj \
267e5410a46Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
268e5410a46Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
269e5410a46Smrg         >/dev/null 2>conftest.err &&
270e5410a46Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
271e5410a46Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
272e5410a46Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
273e5410a46Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
274e5410a46Smrg      # icc doesn't choke on unknown options, it will just issue warnings
275e5410a46Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
276e5410a46Smrg      # that says an option was ignored or not supported.
277e5410a46Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
278e5410a46Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
279e5410a46Smrg      # The diagnosis changed in icc 8.0:
280e5410a46Smrg      #   icc: Command line remark: option '-MP' not supported
281e5410a46Smrg      if (grep 'ignoring option' conftest.err ||
282e5410a46Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
283e5410a46Smrg        am_cv_$1_dependencies_compiler_type=$depmode
284e5410a46Smrg        break
285e5410a46Smrg      fi
286e5410a46Smrg    fi
287e5410a46Smrg  done
288e5410a46Smrg
289e5410a46Smrg  cd ..
290e5410a46Smrg  rm -rf conftest.dir
2911f0ac6a5Smrgelse
292e5410a46Smrg  am_cv_$1_dependencies_compiler_type=none
2931f0ac6a5Smrgfi
294e5410a46Smrg])
295e5410a46SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
296e5410a46SmrgAM_CONDITIONAL([am__fastdep$1], [
297e5410a46Smrg  test "x$enable_dependency_tracking" != xno \
298e5410a46Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
299e5410a46Smrg])
3001f0ac6a5Smrg
301e5410a46Smrg
302e5410a46Smrg# AM_SET_DEPDIR
303e5410a46Smrg# -------------
304e5410a46Smrg# Choose a directory name for dependency files.
30589c04b6cSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
306e5410a46SmrgAC_DEFUN([AM_SET_DEPDIR],
307e5410a46Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
308e5410a46SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
309e5410a46Smrg])
310e5410a46Smrg
311e5410a46Smrg
312e5410a46Smrg# AM_DEP_TRACK
313e5410a46Smrg# ------------
314e5410a46SmrgAC_DEFUN([AM_DEP_TRACK],
31589c04b6cSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
31689c04b6cSmrgAS_HELP_STRING(
31789c04b6cSmrg  [--enable-dependency-tracking],
31889c04b6cSmrg  [do not reject slow dependency extractors])
31989c04b6cSmrgAS_HELP_STRING(
32089c04b6cSmrg  [--disable-dependency-tracking],
32189c04b6cSmrg  [speeds up one-time build])])
322e5410a46Smrgif test "x$enable_dependency_tracking" != xno; then
323e5410a46Smrg  am_depcomp="$ac_aux_dir/depcomp"
324e5410a46Smrg  AMDEPBACKSLASH='\'
32589c04b6cSmrg  am__nodep='_no'
3261f0ac6a5Smrgfi
327e5410a46SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
328e5410a46SmrgAC_SUBST([AMDEPBACKSLASH])dnl
329e5410a46Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
33089c04b6cSmrgAC_SUBST([am__nodep])dnl
33189c04b6cSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
332e5410a46Smrg])
3331f0ac6a5Smrg
334e5410a46Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
335e5410a46Smrg
33689c04b6cSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
3371f0ac6a5Smrg#
338e5410a46Smrg# This file is free software; the Free Software Foundation
339e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
340e5410a46Smrg# with or without modifications, as long as this notice is preserved.
3411f0ac6a5Smrg
3421f0ac6a5Smrg
343e5410a46Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
344e5410a46Smrg# ------------------------------
345e5410a46SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
346e5410a46Smrg[{
34789c04b6cSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
348e5410a46Smrg  # are listed without --file.  Let's play safe and only enable the eval
349e5410a46Smrg  # if we detect the quoting.
350e5410a46Smrg  case $CONFIG_FILES in
351e5410a46Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
352e5410a46Smrg  *)   set x $CONFIG_FILES ;;
353e5410a46Smrg  esac
354e5410a46Smrg  shift
355e5410a46Smrg  for mf
356e5410a46Smrg  do
357e5410a46Smrg    # Strip MF so we end up with the name of the file.
358e5410a46Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
359e5410a46Smrg    # Check whether this is an Automake generated Makefile or not.
36089c04b6cSmrg    # We used to match only the files named 'Makefile.in', but
361e5410a46Smrg    # some people rename them; so instead we look at the file content.
362e5410a46Smrg    # Grep'ing the first line is not enough: some people post-process
363e5410a46Smrg    # each Makefile.in and add a new line on top of each file to say so.
364e5410a46Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
365e5410a46Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
366e5410a46Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
367e5410a46Smrg      dirpart=`AS_DIRNAME("$mf")`
368e5410a46Smrg    else
369e5410a46Smrg      continue
370e5410a46Smrg    fi
371e5410a46Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
37289c04b6cSmrg    # from the Makefile without running 'make'.
373e5410a46Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
374e5410a46Smrg    test -z "$DEPDIR" && continue
375e5410a46Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37689c04b6cSmrg    test -z "$am__include" && continue
377e5410a46Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
378e5410a46Smrg    # Find all dependency output files, they are included files with
379e5410a46Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
380e5410a46Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
381e5410a46Smrg    # expansion.
382e5410a46Smrg    for file in `sed -n "
383e5410a46Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38489c04b6cSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
385e5410a46Smrg      # Make sure the directory exists.
386e5410a46Smrg      test -f "$dirpart/$file" && continue
387e5410a46Smrg      fdir=`AS_DIRNAME(["$file"])`
388e5410a46Smrg      AS_MKDIR_P([$dirpart/$fdir])
389e5410a46Smrg      # echo "creating $dirpart/$file"
390e5410a46Smrg      echo '# dummy' > "$dirpart/$file"
391e5410a46Smrg    done
392e5410a46Smrg  done
393e5410a46Smrg}
394e5410a46Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3951f0ac6a5Smrg
3961f0ac6a5Smrg
397e5410a46Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
398e5410a46Smrg# -----------------------------
399e5410a46Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
400e5410a46Smrg#
401e5410a46Smrg# This code is only required when automatic dependency tracking
40289c04b6cSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
403e5410a46Smrg# need in order to bootstrap the dependency handling code.
404e5410a46SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
405e5410a46Smrg[AC_CONFIG_COMMANDS([depfiles],
406e5410a46Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
407e5410a46Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
408e5410a46Smrg])
4091f0ac6a5Smrg
410e5410a46Smrg# Do all the work for Automake.                             -*- Autoconf -*-
411e5410a46Smrg
41289c04b6cSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
413e5410a46Smrg#
414e5410a46Smrg# This file is free software; the Free Software Foundation
415e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
416e5410a46Smrg# with or without modifications, as long as this notice is preserved.
417e5410a46Smrg
418e5410a46Smrg# This macro actually does too much.  Some checks are only needed if
419e5410a46Smrg# your package does certain things.  But this isn't really a big deal.
420e5410a46Smrg
421e5410a46Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
422e5410a46Smrg# AM_INIT_AUTOMAKE([OPTIONS])
423e5410a46Smrg# -----------------------------------------------
424e5410a46Smrg# The call with PACKAGE and VERSION arguments is the old style
425e5410a46Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
426e5410a46Smrg# and VERSION should now be passed to AC_INIT and removed from
427e5410a46Smrg# the call to AM_INIT_AUTOMAKE.
428e5410a46Smrg# We support both call styles for the transition.  After
429e5410a46Smrg# the next Automake release, Autoconf can make the AC_INIT
430e5410a46Smrg# arguments mandatory, and then we can depend on a new Autoconf
431e5410a46Smrg# release and drop the old call support.
432e5410a46SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
43389c04b6cSmrg[AC_PREREQ([2.65])dnl
434e5410a46Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
435e5410a46Smrgdnl the ones we care about.
436e5410a46Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
437e5410a46SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
438e5410a46SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
439e5410a46Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
440e5410a46Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
441e5410a46Smrg  # is not polluted with repeated "-I."
442e5410a46Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
443e5410a46Smrg  # test to see if srcdir already configured
444e5410a46Smrg  if test -f $srcdir/config.status; then
445e5410a46Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
446e5410a46Smrg  fi
4471f0ac6a5Smrgfi
448e5410a46Smrg
449e5410a46Smrg# test whether we have cygpath
450e5410a46Smrgif test -z "$CYGPATH_W"; then
451e5410a46Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
452e5410a46Smrg    CYGPATH_W='cygpath -w'
453e5410a46Smrg  else
454e5410a46Smrg    CYGPATH_W=echo
455e5410a46Smrg  fi
4561f0ac6a5Smrgfi
457e5410a46SmrgAC_SUBST([CYGPATH_W])
458e5410a46Smrg
459e5410a46Smrg# Define the identity of the package.
460e5410a46Smrgdnl Distinguish between old-style and new-style calls.
461e5410a46Smrgm4_ifval([$2],
46289c04b6cSmrg[AC_DIAGNOSE([obsolete],
46389c04b6cSmrg             [$0: two- and three-arguments forms are deprecated.])
46489c04b6cSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465e5410a46Smrg AC_SUBST([PACKAGE], [$1])dnl
466e5410a46Smrg AC_SUBST([VERSION], [$2])],
467e5410a46Smrg[_AM_SET_OPTIONS([$1])dnl
468e5410a46Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
46989c04b6cSmrgm4_if(
47089c04b6cSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
47189c04b6cSmrg  [ok:ok],,
472e5410a46Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
473e5410a46Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
474e5410a46Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
475e5410a46Smrg
476e5410a46Smrg_AM_IF_OPTION([no-define],,
47789c04b6cSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
47889c04b6cSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
479e5410a46Smrg
480e5410a46Smrg# Some tools Automake needs.
481e5410a46SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
482e5410a46SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48389c04b6cSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
48489c04b6cSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
48589c04b6cSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
48689c04b6cSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
48789c04b6cSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
488e5410a46SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
489e5410a46SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
49089c04b6cSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
49189c04b6cSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
49289c04b6cSmrg# dies out for good.  For more background, see:
49389c04b6cSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
49489c04b6cSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
49589c04b6cSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
496e5410a46Smrg# We need awk for the "check" target.  The system "awk" is bad on
497e5410a46Smrg# some platforms.
498e5410a46SmrgAC_REQUIRE([AC_PROG_AWK])dnl
499e5410a46SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
500e5410a46SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
501e5410a46Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
502e5410a46Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
503e5410a46Smrg			     [_AM_PROG_TAR([v7])])])
504e5410a46Smrg_AM_IF_OPTION([no-dependencies],,
505e5410a46Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
50689c04b6cSmrg		  [_AM_DEPENDENCIES([CC])],
50789c04b6cSmrg		  [m4_define([AC_PROG_CC],
50889c04b6cSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
509e5410a46SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
51089c04b6cSmrg		  [_AM_DEPENDENCIES([CXX])],
51189c04b6cSmrg		  [m4_define([AC_PROG_CXX],
51289c04b6cSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
513e5410a46SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
51489c04b6cSmrg		  [_AM_DEPENDENCIES([OBJC])],
51589c04b6cSmrg		  [m4_define([AC_PROG_OBJC],
51689c04b6cSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
51789c04b6cSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
51889c04b6cSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
51989c04b6cSmrg		  [m4_define([AC_PROG_OBJCXX],
52089c04b6cSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
521e5410a46Smrg])
52289c04b6cSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
52389c04b6cSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
52489c04b6cSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
52589c04b6cSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
526e5410a46SmrgAC_CONFIG_COMMANDS_PRE(dnl
527e5410a46Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
528e5410a46Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
529e5410a46Smrg])
5301f0ac6a5Smrg
53189c04b6cSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
532e5410a46Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
533e5410a46Smrgdnl mangled by Autoconf and run in a shell conditional statement.
534e5410a46Smrgm4_define([_AC_COMPILER_EXEEXT],
535e5410a46Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5361f0ac6a5Smrg
5371f0ac6a5Smrg
538e5410a46Smrg# When config.status generates a header, we must update the stamp-h file.
539e5410a46Smrg# This file resides in the same directory as the config header
540e5410a46Smrg# that is generated.  The stamp files are numbered to have different names.
5411f0ac6a5Smrg
542e5410a46Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
543e5410a46Smrg# loop where config.status creates the headers, so we can generate
544e5410a46Smrg# our stamp files there.
545e5410a46SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
546e5410a46Smrg[# Compute $1's index in $config_headers.
547e5410a46Smrg_am_arg=$1
548e5410a46Smrg_am_stamp_count=1
549e5410a46Smrgfor _am_header in $config_headers :; do
550e5410a46Smrg  case $_am_header in
551e5410a46Smrg    $_am_arg | $_am_arg:* )
552e5410a46Smrg      break ;;
553e5410a46Smrg    * )
554e5410a46Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
555e5410a46Smrg  esac
556e5410a46Smrgdone
557e5410a46Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5581f0ac6a5Smrg
55989c04b6cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
5601f0ac6a5Smrg#
561e5410a46Smrg# This file is free software; the Free Software Foundation
562e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
563e5410a46Smrg# with or without modifications, as long as this notice is preserved.
5641f0ac6a5Smrg
565e5410a46Smrg# AM_PROG_INSTALL_SH
566e5410a46Smrg# ------------------
567e5410a46Smrg# Define $install_sh.
568e5410a46SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
569e5410a46Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
570e5410a46Smrgif test x"${install_sh}" != xset; then
571e5410a46Smrg  case $am_aux_dir in
572e5410a46Smrg  *\ * | *\	*)
573e5410a46Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
574e5410a46Smrg  *)
575e5410a46Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
576e5410a46Smrg  esac
577e5410a46Smrgfi
57889c04b6cSmrgAC_SUBST([install_sh])])
5791f0ac6a5Smrg
58089c04b6cSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
581e5410a46Smrg#
582e5410a46Smrg# This file is free software; the Free Software Foundation
583e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
584e5410a46Smrg# with or without modifications, as long as this notice is preserved.
5851f0ac6a5Smrg
586e5410a46Smrg# Check whether the underlying file-system supports filenames
587e5410a46Smrg# with a leading dot.  For instance MS-DOS doesn't.
588e5410a46SmrgAC_DEFUN([AM_SET_LEADING_DOT],
589e5410a46Smrg[rm -rf .tst 2>/dev/null
590e5410a46Smrgmkdir .tst 2>/dev/null
591e5410a46Smrgif test -d .tst; then
592e5410a46Smrg  am__leading_dot=.
5931f0ac6a5Smrgelse
594e5410a46Smrg  am__leading_dot=_
5951f0ac6a5Smrgfi
596e5410a46Smrgrmdir .tst 2>/dev/null
597e5410a46SmrgAC_SUBST([am__leading_dot])])
5981f0ac6a5Smrg
599e5410a46Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6001f0ac6a5Smrg
60189c04b6cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
602e5410a46Smrg#
603e5410a46Smrg# This file is free software; the Free Software Foundation
604e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
605e5410a46Smrg# with or without modifications, as long as this notice is preserved.
6061f0ac6a5Smrg
607e5410a46Smrg# AM_MAKE_INCLUDE()
608e5410a46Smrg# -----------------
609e5410a46Smrg# Check to see how make treats includes.
610e5410a46SmrgAC_DEFUN([AM_MAKE_INCLUDE],
611e5410a46Smrg[am_make=${MAKE-make}
612e5410a46Smrgcat > confinc << 'END'
613e5410a46Smrgam__doit:
614e5410a46Smrg	@echo this is the am__doit target
615e5410a46Smrg.PHONY: am__doit
616e5410a46SmrgEND
617e5410a46Smrg# If we don't find an include directive, just comment out the code.
618e5410a46SmrgAC_MSG_CHECKING([for style of include used by $am_make])
619e5410a46Smrgam__include="#"
620e5410a46Smrgam__quote=
621e5410a46Smrg_am_result=none
622e5410a46Smrg# First try GNU make style include.
623e5410a46Smrgecho "include confinc" > confmf
62489c04b6cSmrg# Ignore all kinds of additional output from 'make'.
625e5410a46Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
626e5410a46Smrg*the\ am__doit\ target*)
627e5410a46Smrg  am__include=include
628e5410a46Smrg  am__quote=
629e5410a46Smrg  _am_result=GNU
630e5410a46Smrg  ;;
631e5410a46Smrgesac
632e5410a46Smrg# Now try BSD make style include.
633e5410a46Smrgif test "$am__include" = "#"; then
634e5410a46Smrg   echo '.include "confinc"' > confmf
635e5410a46Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
636e5410a46Smrg   *the\ am__doit\ target*)
637e5410a46Smrg     am__include=.include
638e5410a46Smrg     am__quote="\""
639e5410a46Smrg     _am_result=BSD
640e5410a46Smrg     ;;
641e5410a46Smrg   esac
642e5410a46Smrgfi
643e5410a46SmrgAC_SUBST([am__include])
644e5410a46SmrgAC_SUBST([am__quote])
645e5410a46SmrgAC_MSG_RESULT([$_am_result])
646e5410a46Smrgrm -f confinc confmf
647e5410a46Smrg])
648e5410a46Smrg
649e5410a46Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
650e5410a46Smrg
65189c04b6cSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
6521f0ac6a5Smrg#
653e5410a46Smrg# This file is free software; the Free Software Foundation
654e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
655e5410a46Smrg# with or without modifications, as long as this notice is preserved.
6561f0ac6a5Smrg
657e5410a46Smrg# AM_MISSING_PROG(NAME, PROGRAM)
658e5410a46Smrg# ------------------------------
659e5410a46SmrgAC_DEFUN([AM_MISSING_PROG],
660e5410a46Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
661e5410a46Smrg$1=${$1-"${am_missing_run}$2"}
662e5410a46SmrgAC_SUBST($1)])
6631f0ac6a5Smrg
664e5410a46Smrg# AM_MISSING_HAS_RUN
665e5410a46Smrg# ------------------
66689c04b6cSmrg# Define MISSING if not defined so far and test if it is modern enough.
66789c04b6cSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
668e5410a46SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
669e5410a46Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
670e5410a46SmrgAC_REQUIRE_AUX_FILE([missing])dnl
671e5410a46Smrgif test x"${MISSING+set}" != xset; then
672e5410a46Smrg  case $am_aux_dir in
673e5410a46Smrg  *\ * | *\	*)
674e5410a46Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
675e5410a46Smrg  *)
676e5410a46Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
677e5410a46Smrg  esac
6781f0ac6a5Smrgfi
679e5410a46Smrg# Use eval to expand $SHELL
68089c04b6cSmrgif eval "$MISSING --is-lightweight"; then
68189c04b6cSmrg  am_missing_run="$MISSING "
682e5410a46Smrgelse
683e5410a46Smrg  am_missing_run=
68489c04b6cSmrg  AC_MSG_WARN(['missing' script is too old or missing])
6851f0ac6a5Smrgfi
686e5410a46Smrg])
687e5410a46Smrg
688e5410a46Smrg# Helper functions for option handling.                     -*- Autoconf -*-
6891f0ac6a5Smrg
69089c04b6cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
691e5410a46Smrg#
692e5410a46Smrg# This file is free software; the Free Software Foundation
693e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
694e5410a46Smrg# with or without modifications, as long as this notice is preserved.
6951f0ac6a5Smrg
696e5410a46Smrg# _AM_MANGLE_OPTION(NAME)
697e5410a46Smrg# -----------------------
698e5410a46SmrgAC_DEFUN([_AM_MANGLE_OPTION],
699e5410a46Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7001f0ac6a5Smrg
701e5410a46Smrg# _AM_SET_OPTION(NAME)
70289c04b6cSmrg# --------------------
703e5410a46Smrg# Set option NAME.  Presently that only means defining a flag for this option.
704e5410a46SmrgAC_DEFUN([_AM_SET_OPTION],
70589c04b6cSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
7061f0ac6a5Smrg
707e5410a46Smrg# _AM_SET_OPTIONS(OPTIONS)
70889c04b6cSmrg# ------------------------
709e5410a46Smrg# OPTIONS is a space-separated list of Automake options.
710e5410a46SmrgAC_DEFUN([_AM_SET_OPTIONS],
711e5410a46Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7121f0ac6a5Smrg
713e5410a46Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
714e5410a46Smrg# -------------------------------------------
715e5410a46Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
716e5410a46SmrgAC_DEFUN([_AM_IF_OPTION],
717e5410a46Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7181f0ac6a5Smrg
719e5410a46Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7201f0ac6a5Smrg
72189c04b6cSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
7221f0ac6a5Smrg#
723e5410a46Smrg# This file is free software; the Free Software Foundation
724e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
725e5410a46Smrg# with or without modifications, as long as this notice is preserved.
7261f0ac6a5Smrg
727e5410a46Smrg# AM_SANITY_CHECK
728e5410a46Smrg# ---------------
729e5410a46SmrgAC_DEFUN([AM_SANITY_CHECK],
730e5410a46Smrg[AC_MSG_CHECKING([whether build environment is sane])
731e5410a46Smrg# Reject unsafe characters in $srcdir or the absolute working directory
732e5410a46Smrg# name.  Accept space and tab only in the latter.
733e5410a46Smrgam_lf='
734e5410a46Smrg'
735e5410a46Smrgcase `pwd` in
736e5410a46Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
737e5410a46Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
738e5410a46Smrgesac
739e5410a46Smrgcase $srcdir in
740e5410a46Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
74189c04b6cSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
742e5410a46Smrgesac
7431f0ac6a5Smrg
74489c04b6cSmrg# Do 'set' in a subshell so we don't clobber the current shell's
745e5410a46Smrg# arguments.  Must try -L first in case configure is actually a
746e5410a46Smrg# symlink; some systems play weird games with the mod time of symlinks
747e5410a46Smrg# (eg FreeBSD returns the mod time of the symlink's containing
748e5410a46Smrg# directory).
749e5410a46Smrgif (
75089c04b6cSmrg   am_has_slept=no
75189c04b6cSmrg   for am_try in 1 2; do
75289c04b6cSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
75389c04b6cSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
75489c04b6cSmrg     if test "$[*]" = "X"; then
75589c04b6cSmrg	# -L didn't work.
75689c04b6cSmrg	set X `ls -t "$srcdir/configure" conftest.file`
75789c04b6cSmrg     fi
75889c04b6cSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
75989c04b6cSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
76089c04b6cSmrg
76189c04b6cSmrg	# If neither matched, then we have a broken ls.  This can happen
76289c04b6cSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
76389c04b6cSmrg	# broken ls alias from the environment.  This has actually
76489c04b6cSmrg	# happened.  Such a system could not be considered "sane".
76589c04b6cSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
76689c04b6cSmrg  alias in your environment])
76789c04b6cSmrg     fi
76889c04b6cSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
76989c04b6cSmrg       break
77089c04b6cSmrg     fi
77189c04b6cSmrg     # Just in case.
77289c04b6cSmrg     sleep 1
77389c04b6cSmrg     am_has_slept=yes
77489c04b6cSmrg   done
775e5410a46Smrg   test "$[2]" = conftest.file
776e5410a46Smrg   )
777e5410a46Smrgthen
778e5410a46Smrg   # Ok.
779e5410a46Smrg   :
780e5410a46Smrgelse
781e5410a46Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
782e5410a46SmrgCheck your system clock])
7831f0ac6a5Smrgfi
78489c04b6cSmrgAC_MSG_RESULT([yes])
78589c04b6cSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
78689c04b6cSmrg# generated files are strictly newer.
78789c04b6cSmrgam_sleep_pid=
78889c04b6cSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
78989c04b6cSmrg  ( sleep 1 ) &
79089c04b6cSmrg  am_sleep_pid=$!
79189c04b6cSmrgfi
79289c04b6cSmrgAC_CONFIG_COMMANDS_PRE(
79389c04b6cSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
79489c04b6cSmrg   if test -n "$am_sleep_pid"; then
79589c04b6cSmrg     # Hide warnings about reused PIDs.
79689c04b6cSmrg     wait $am_sleep_pid 2>/dev/null
79789c04b6cSmrg   fi
79889c04b6cSmrg   AC_MSG_RESULT([done])])
79989c04b6cSmrgrm -f conftest.file
80089c04b6cSmrg])
8011f0ac6a5Smrg
80289c04b6cSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
803e5410a46Smrg#
804e5410a46Smrg# This file is free software; the Free Software Foundation
805e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
806e5410a46Smrg# with or without modifications, as long as this notice is preserved.
8071f0ac6a5Smrg
808e5410a46Smrg# AM_SILENT_RULES([DEFAULT])
809e5410a46Smrg# --------------------------
810e5410a46Smrg# Enable less verbose build rules; with the default set to DEFAULT
81189c04b6cSmrg# ("yes" being less verbose, "no" or empty being verbose).
812e5410a46SmrgAC_DEFUN([AM_SILENT_RULES],
81389c04b6cSmrg[AC_ARG_ENABLE([silent-rules], [dnl
81489c04b6cSmrgAS_HELP_STRING(
81589c04b6cSmrg  [--enable-silent-rules],
81689c04b6cSmrg  [less verbose build output (undo: "make V=1")])
81789c04b6cSmrgAS_HELP_STRING(
81889c04b6cSmrg  [--disable-silent-rules],
81989c04b6cSmrg  [verbose build output (undo: "make V=0")])dnl
82089c04b6cSmrg])
82189c04b6cSmrgcase $enable_silent_rules in @%:@ (((
82289c04b6cSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
82389c04b6cSmrg   no) AM_DEFAULT_VERBOSITY=1;;
82489c04b6cSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
825e5410a46Smrgesac
82689c04b6cSmrgdnl
82789c04b6cSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
82889c04b6cSmrgdnl do not support nested variable expansions.
82989c04b6cSmrgdnl See automake bug#9928 and bug#10237.
83089c04b6cSmrgam_make=${MAKE-make}
83189c04b6cSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
83289c04b6cSmrg   [am_cv_make_support_nested_variables],
83389c04b6cSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
83489c04b6cSmrgBAR0=false
83589c04b6cSmrgBAR1=true
83689c04b6cSmrgV=1
83789c04b6cSmrgam__doit:
83889c04b6cSmrg	@$(TRUE)
83989c04b6cSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
84089c04b6cSmrg  am_cv_make_support_nested_variables=yes
84189c04b6cSmrgelse
84289c04b6cSmrg  am_cv_make_support_nested_variables=no
84389c04b6cSmrgfi])
84489c04b6cSmrgif test $am_cv_make_support_nested_variables = yes; then
84589c04b6cSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
84689c04b6cSmrg  AM_V='$(V)'
84789c04b6cSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
84889c04b6cSmrgelse
84989c04b6cSmrg  AM_V=$AM_DEFAULT_VERBOSITY
85089c04b6cSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
85189c04b6cSmrgfi
85289c04b6cSmrgAC_SUBST([AM_V])dnl
85389c04b6cSmrgAM_SUBST_NOTMAKE([AM_V])dnl
85489c04b6cSmrgAC_SUBST([AM_DEFAULT_V])dnl
85589c04b6cSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
856e5410a46SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
857e5410a46SmrgAM_BACKSLASH='\'
858e5410a46SmrgAC_SUBST([AM_BACKSLASH])dnl
859e5410a46Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8601f0ac6a5Smrg])
8611f0ac6a5Smrg
86289c04b6cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
863e5410a46Smrg#
864e5410a46Smrg# This file is free software; the Free Software Foundation
865e5410a46Smrg# gives unlimited permission to copy and/or distribute it,
866e5410a46Smrg# with or without modifications, as long as this notice is preserved.
867e5410a46Smrg
868e5410a46Smrg# AM_PROG_INSTALL_STRIP
869e5410a46Smrg# ---------------------
87089c04b6cSmrg# One issue with vendor 'install' (even GNU) is that you can't
871e5410a46Smrg# specify the program used to strip binaries.  This is especially
872e5410a46Smrg# annoying in cross-compiling environments, where the build's strip
873e5410a46Smrg# is unlikely to handle the host's binaries.
874e5410a46Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
87589c04b6cSmrg# always use install-sh in "make install-strip", and initialize
876e5410a46Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
877e5410a46SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
878e5410a46Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
87989c04b6cSmrg# Installed binaries are usually stripped using 'strip' when the user
88089c04b6cSmrg# run "make install-strip".  However 'strip' might not be the right
881e5410a46Smrg# tool to use in cross-compilation environments, therefore Automake
88289c04b6cSmrg# will honor the 'STRIP' environment variable to overrule this program.
88389c04b6cSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
884e5410a46Smrgif test "$cross_compiling" != no; then
885e5410a46Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
886e5410a46Smrgfi
887e5410a46SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
888e5410a46SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
889e5410a46Smrg
89089c04b6cSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
8911f0ac6a5Smrg#
8921f0ac6a5Smrg# This file is free software; the Free Software Foundation
8931f0ac6a5Smrg# gives unlimited permission to copy and/or distribute it,
8941f0ac6a5Smrg# with or without modifications, as long as this notice is preserved.
8951f0ac6a5Smrg
896e5410a46Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
897e5410a46Smrg# ---------------------------
898e5410a46Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
899e5410a46Smrg# This macro is traced by Automake.
900e5410a46SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9011f0ac6a5Smrg
902e5410a46Smrg# AM_SUBST_NOTMAKE(VARIABLE)
90389c04b6cSmrg# --------------------------
904e5410a46Smrg# Public sister of _AM_SUBST_NOTMAKE.
905e5410a46SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9061f0ac6a5Smrg
907e5410a46Smrg# Check how to create a tarball.                            -*- Autoconf -*-
9081f0ac6a5Smrg
90989c04b6cSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
9101f0ac6a5Smrg#
9111f0ac6a5Smrg# This file is free software; the Free Software Foundation
9121f0ac6a5Smrg# gives unlimited permission to copy and/or distribute it,
9131f0ac6a5Smrg# with or without modifications, as long as this notice is preserved.
9141f0ac6a5Smrg
915e5410a46Smrg# _AM_PROG_TAR(FORMAT)
916e5410a46Smrg# --------------------
917e5410a46Smrg# Check how to create a tarball in format FORMAT.
91889c04b6cSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
9191f0ac6a5Smrg#
920e5410a46Smrg# Substitute a variable $(am__tar) that is a command
921e5410a46Smrg# writing to stdout a FORMAT-tarball containing the directory
922e5410a46Smrg# $tardir.
923e5410a46Smrg#     tardir=directory && $(am__tar) > result.tar
9241f0ac6a5Smrg#
925e5410a46Smrg# Substitute a variable $(am__untar) that extract such
926e5410a46Smrg# a tarball read from stdin.
927e5410a46Smrg#     $(am__untar) < result.tar
9286fae4e5dSmrg#
92989c04b6cSmrgAC_DEFUN([_AM_PROG_TAR],
93089c04b6cSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
93189c04b6cSmrg# in the wild :-(  We should find a proper way to deprecate it ...
93289c04b6cSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
9331f0ac6a5Smrg
93489c04b6cSmrg# We'll loop over all known methods to create a tar archive until one works.
93589c04b6cSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9361f0ac6a5Smrg
93789c04b6cSmrgm4_if([$1], [v7],
93889c04b6cSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
93989c04b6cSmrg
94089c04b6cSmrg  [m4_case([$1],
94189c04b6cSmrg    [ustar],
94289c04b6cSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
94389c04b6cSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
94489c04b6cSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
94589c04b6cSmrg      # and bug#13588).
94689c04b6cSmrg      am_max_uid=2097151 # 2^21 - 1
94789c04b6cSmrg      am_max_gid=$am_max_uid
94889c04b6cSmrg      # The $UID and $GID variables are not portable, so we need to resort
94989c04b6cSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
95089c04b6cSmrg      # below are definitely unexpected, so allow the users to see them
95189c04b6cSmrg      # (that is, avoid stderr redirection).
95289c04b6cSmrg      am_uid=`id -u || echo unknown`
95389c04b6cSmrg      am_gid=`id -g || echo unknown`
95489c04b6cSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
95589c04b6cSmrg      if test $am_uid -le $am_max_uid; then
95689c04b6cSmrg         AC_MSG_RESULT([yes])
95789c04b6cSmrg      else
95889c04b6cSmrg         AC_MSG_RESULT([no])
95989c04b6cSmrg         _am_tools=none
96089c04b6cSmrg      fi
96189c04b6cSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
96289c04b6cSmrg      if test $am_gid -le $am_max_gid; then
96389c04b6cSmrg         AC_MSG_RESULT([yes])
96489c04b6cSmrg      else
96589c04b6cSmrg        AC_MSG_RESULT([no])
96689c04b6cSmrg        _am_tools=none
96789c04b6cSmrg      fi],
9681f0ac6a5Smrg
96989c04b6cSmrg  [pax],
97089c04b6cSmrg    [],
9711f0ac6a5Smrg
97289c04b6cSmrg  [m4_fatal([Unknown tar format])])
9739c9ff80cSmrg
97489c04b6cSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
9759c9ff80cSmrg
97689c04b6cSmrg  # Go ahead even if we have the value already cached.  We do so because we
97789c04b6cSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
97889c04b6cSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
9791f0ac6a5Smrg
98089c04b6cSmrg  for _am_tool in $_am_tools; do
98189c04b6cSmrg    case $_am_tool in
98289c04b6cSmrg    gnutar)
98389c04b6cSmrg      for _am_tar in tar gnutar gtar; do
98489c04b6cSmrg        AM_RUN_LOG([$_am_tar --version]) && break
98589c04b6cSmrg      done
98689c04b6cSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
98789c04b6cSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
98889c04b6cSmrg      am__untar="$_am_tar -xf -"
98989c04b6cSmrg      ;;
99089c04b6cSmrg    plaintar)
99189c04b6cSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
99289c04b6cSmrg      # ustar tarball either.
99389c04b6cSmrg      (tar --version) >/dev/null 2>&1 && continue
99489c04b6cSmrg      am__tar='tar chf - "$$tardir"'
99589c04b6cSmrg      am__tar_='tar chf - "$tardir"'
99689c04b6cSmrg      am__untar='tar xf -'
99789c04b6cSmrg      ;;
99889c04b6cSmrg    pax)
99989c04b6cSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
100089c04b6cSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
100189c04b6cSmrg      am__untar='pax -r'
100289c04b6cSmrg      ;;
100389c04b6cSmrg    cpio)
100489c04b6cSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
100589c04b6cSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
100689c04b6cSmrg      am__untar='cpio -i -H $1 -d'
100789c04b6cSmrg      ;;
100889c04b6cSmrg    none)
100989c04b6cSmrg      am__tar=false
101089c04b6cSmrg      am__tar_=false
101189c04b6cSmrg      am__untar=false
101289c04b6cSmrg      ;;
101389c04b6cSmrg    esac
10149c9ff80cSmrg
101589c04b6cSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
101689c04b6cSmrg    # and am__untar set.
101789c04b6cSmrg    test -n "${am_cv_prog_tar_$1}" && break
101889c04b6cSmrg
101989c04b6cSmrg    # tar/untar a dummy directory, and stop if the command works.
102089c04b6cSmrg    rm -rf conftest.dir
102189c04b6cSmrg    mkdir conftest.dir
102289c04b6cSmrg    echo GrepMe > conftest.dir/file
102389c04b6cSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
102489c04b6cSmrg    rm -rf conftest.dir
102589c04b6cSmrg    if test -s conftest.tar; then
102689c04b6cSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
102789c04b6cSmrg      AM_RUN_LOG([cat conftest.dir/file])
102889c04b6cSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
102989c04b6cSmrg    fi
103089c04b6cSmrg  done
103189c04b6cSmrg  rm -rf conftest.dir
10326fae4e5dSmrg
103389c04b6cSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
103489c04b6cSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
10356fae4e5dSmrg
103689c04b6cSmrgAC_SUBST([am__tar])
103789c04b6cSmrgAC_SUBST([am__untar])
103889c04b6cSmrg]) # _AM_PROG_TAR
10399c9ff80cSmrg
10406fae4e5dSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
10416fae4e5dSmrg#
10426fae4e5dSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
104389c04b6cSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
104489c04b6cSmrg#                 Foundation, Inc.
10456fae4e5dSmrg#   Written by Gordon Matzigkeit, 1996
10466fae4e5dSmrg#
10476fae4e5dSmrg# This file is free software; the Free Software Foundation gives
10486fae4e5dSmrg# unlimited permission to copy and/or distribute it, with or without
10496fae4e5dSmrg# modifications, as long as this notice is preserved.
10509c9ff80cSmrg
10516fae4e5dSmrgm4_define([_LT_COPYING], [dnl
10526fae4e5dSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
105389c04b6cSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
105489c04b6cSmrg#                 Foundation, Inc.
10556fae4e5dSmrg#   Written by Gordon Matzigkeit, 1996
1056e5410a46Smrg#
10576fae4e5dSmrg#   This file is part of GNU Libtool.
10586fae4e5dSmrg#
10596fae4e5dSmrg# GNU Libtool is free software; you can redistribute it and/or
10606fae4e5dSmrg# modify it under the terms of the GNU General Public License as
10616fae4e5dSmrg# published by the Free Software Foundation; either version 2 of
10626fae4e5dSmrg# the License, or (at your option) any later version.
10636fae4e5dSmrg#
10646fae4e5dSmrg# As a special exception to the GNU General Public License,
10656fae4e5dSmrg# if you distribute this file as part of a program or library that
10666fae4e5dSmrg# is built using GNU Libtool, you may include this file under the
10676fae4e5dSmrg# same distribution terms that you use for the rest of that program.
10686fae4e5dSmrg#
10696fae4e5dSmrg# GNU Libtool is distributed in the hope that it will be useful,
10706fae4e5dSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
10716fae4e5dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10726fae4e5dSmrg# GNU General Public License for more details.
10736fae4e5dSmrg#
10746fae4e5dSmrg# You should have received a copy of the GNU General Public License
10756fae4e5dSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
10766fae4e5dSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
10776fae4e5dSmrg# obtained by writing to the Free Software Foundation, Inc.,
10786fae4e5dSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
10796fae4e5dSmrg])
10801f0ac6a5Smrg
10816fae4e5dSmrg# serial 57 LT_INIT
10821f0ac6a5Smrg
10831f0ac6a5Smrg
10846fae4e5dSmrg# LT_PREREQ(VERSION)
10856fae4e5dSmrg# ------------------
10866fae4e5dSmrg# Complain and exit if this libtool version is less that VERSION.
10876fae4e5dSmrgm4_defun([LT_PREREQ],
10886fae4e5dSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
10896fae4e5dSmrg       [m4_default([$3],
10906fae4e5dSmrg		   [m4_fatal([Libtool version $1 or higher is required],
10916fae4e5dSmrg		             63)])],
10926fae4e5dSmrg       [$2])])
10931f0ac6a5Smrg
1094e5410a46Smrg
10956fae4e5dSmrg# _LT_CHECK_BUILDDIR
10966fae4e5dSmrg# ------------------
10976fae4e5dSmrg# Complain if the absolute build directory name contains unusual characters
10986fae4e5dSmrgm4_defun([_LT_CHECK_BUILDDIR],
10996fae4e5dSmrg[case `pwd` in
11006fae4e5dSmrg  *\ * | *\	*)
11016fae4e5dSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
11026fae4e5dSmrgesac
11036fae4e5dSmrg])
1104e5410a46Smrg
11051f0ac6a5Smrg
11066fae4e5dSmrg# LT_INIT([OPTIONS])
11076fae4e5dSmrg# ------------------
11086fae4e5dSmrgAC_DEFUN([LT_INIT],
11096fae4e5dSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
11106fae4e5dSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
11116fae4e5dSmrgAC_BEFORE([$0], [LT_LANG])dnl
11126fae4e5dSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
11136fae4e5dSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
11146fae4e5dSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
11151f0ac6a5Smrg
11166fae4e5dSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
11176fae4e5dSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
11186fae4e5dSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
11196fae4e5dSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
11206fae4e5dSmrgdnl unless we require an AC_DEFUNed macro:
11216fae4e5dSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
11226fae4e5dSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
11236fae4e5dSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
11246fae4e5dSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
11256fae4e5dSmrgm4_require([_LT_PROG_LTMAIN])dnl
11261f0ac6a5Smrg
11276fae4e5dSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
11281f0ac6a5Smrg
11296fae4e5dSmrgdnl Parse OPTIONS
11306fae4e5dSmrg_LT_SET_OPTIONS([$0], [$1])
11311f0ac6a5Smrg
11326fae4e5dSmrg# This can be used to rebuild libtool when needed
11336fae4e5dSmrgLIBTOOL_DEPS="$ltmain"
11341f0ac6a5Smrg
11356fae4e5dSmrg# Always use our own libtool.
11366fae4e5dSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
11376fae4e5dSmrgAC_SUBST(LIBTOOL)dnl
11389c9ff80cSmrg
11396fae4e5dSmrg_LT_SETUP
11401f0ac6a5Smrg
11416fae4e5dSmrg# Only expand once:
11426fae4e5dSmrgm4_define([LT_INIT])
11436fae4e5dSmrg])# LT_INIT
11441f0ac6a5Smrg
11456fae4e5dSmrg# Old names:
11466fae4e5dSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
11476fae4e5dSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
11486fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
11496fae4e5dSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
11506fae4e5dSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
11511f0ac6a5Smrg
11521f0ac6a5Smrg
11536fae4e5dSmrg# _LT_CC_BASENAME(CC)
11546fae4e5dSmrg# -------------------
11556fae4e5dSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
11566fae4e5dSmrgm4_defun([_LT_CC_BASENAME],
11576fae4e5dSmrg[for cc_temp in $1""; do
11586fae4e5dSmrg  case $cc_temp in
11596fae4e5dSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
11606fae4e5dSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
11616fae4e5dSmrg    \-*) ;;
11626fae4e5dSmrg    *) break;;
11636fae4e5dSmrg  esac
11646fae4e5dSmrgdone
11656fae4e5dSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
11666fae4e5dSmrg])
11671f0ac6a5Smrg
11681f0ac6a5Smrg
11696fae4e5dSmrg# _LT_FILEUTILS_DEFAULTS
11706fae4e5dSmrg# ----------------------
11716fae4e5dSmrg# It is okay to use these file commands and assume they have been set
11726fae4e5dSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
11736fae4e5dSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
11746fae4e5dSmrg[: ${CP="cp -f"}
11756fae4e5dSmrg: ${MV="mv -f"}
11766fae4e5dSmrg: ${RM="rm -f"}
11776fae4e5dSmrg])# _LT_FILEUTILS_DEFAULTS
1178e5410a46Smrg
1179e5410a46Smrg
11806fae4e5dSmrg# _LT_SETUP
11816fae4e5dSmrg# ---------
11826fae4e5dSmrgm4_defun([_LT_SETUP],
11836fae4e5dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11846fae4e5dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
11856fae4e5dSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
11866fae4e5dSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
11879c9ff80cSmrg
118889c04b6cSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
118989c04b6cSmrgdnl
11906fae4e5dSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
11916fae4e5dSmrg_LT_DECL([], [host], [0])dnl
11926fae4e5dSmrg_LT_DECL([], [host_os], [0])dnl
11936fae4e5dSmrgdnl
11946fae4e5dSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
11956fae4e5dSmrg_LT_DECL([], [build], [0])dnl
11966fae4e5dSmrg_LT_DECL([], [build_os], [0])dnl
11976fae4e5dSmrgdnl
11986fae4e5dSmrgAC_REQUIRE([AC_PROG_CC])dnl
11996fae4e5dSmrgAC_REQUIRE([LT_PATH_LD])dnl
12006fae4e5dSmrgAC_REQUIRE([LT_PATH_NM])dnl
12016fae4e5dSmrgdnl
12026fae4e5dSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
12036fae4e5dSmrgtest -z "$LN_S" && LN_S="ln -s"
12046fae4e5dSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
12056fae4e5dSmrgdnl
12066fae4e5dSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
12076fae4e5dSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
12086fae4e5dSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
12096fae4e5dSmrgdnl
12106fae4e5dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
12116fae4e5dSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
12126fae4e5dSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
12136fae4e5dSmrgm4_require([_LT_CMD_RELOAD])dnl
12146fae4e5dSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
12156fae4e5dSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
12166fae4e5dSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
12176fae4e5dSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
12186fae4e5dSmrgm4_require([_LT_WITH_SYSROOT])dnl
12196fae4e5dSmrg
12206fae4e5dSmrg_LT_CONFIG_LIBTOOL_INIT([
12216fae4e5dSmrg# See if we are running on zsh, and set the options which allow our
12226fae4e5dSmrg# commands through without removal of \ escapes INIT.
12236fae4e5dSmrgif test -n "\${ZSH_VERSION+set}" ; then
12246fae4e5dSmrg   setopt NO_GLOB_SUBST
12256fae4e5dSmrgfi
12266fae4e5dSmrg])
12276fae4e5dSmrgif test -n "${ZSH_VERSION+set}" ; then
12286fae4e5dSmrg   setopt NO_GLOB_SUBST
12299c9ff80cSmrgfi
12309c9ff80cSmrg
12316fae4e5dSmrg_LT_CHECK_OBJDIR
12329c9ff80cSmrg
12336fae4e5dSmrgm4_require([_LT_TAG_COMPILER])dnl
12349c9ff80cSmrg
12356fae4e5dSmrgcase $host_os in
12366fae4e5dSmrgaix3*)
12376fae4e5dSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
12386fae4e5dSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
12396fae4e5dSmrg  # vanish in a puff of smoke.
12406fae4e5dSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
12416fae4e5dSmrg    COLLECT_NAMES=
12426fae4e5dSmrg    export COLLECT_NAMES
12436fae4e5dSmrg  fi
12446fae4e5dSmrg  ;;
12456fae4e5dSmrgesac
12469c9ff80cSmrg
12476fae4e5dSmrg# Global variables:
12486fae4e5dSmrgofile=libtool
12496fae4e5dSmrgcan_build_shared=yes
12509c9ff80cSmrg
12516fae4e5dSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
12526fae4e5dSmrg# which needs '.lib').
12536fae4e5dSmrglibext=a
12549c9ff80cSmrg
12556fae4e5dSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
12569c9ff80cSmrg
12576fae4e5dSmrgold_CC="$CC"
12586fae4e5dSmrgold_CFLAGS="$CFLAGS"
12599c9ff80cSmrg
12606fae4e5dSmrg# Set sane defaults for various variables
12616fae4e5dSmrgtest -z "$CC" && CC=cc
12626fae4e5dSmrgtest -z "$LTCC" && LTCC=$CC
12636fae4e5dSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
12646fae4e5dSmrgtest -z "$LD" && LD=ld
12656fae4e5dSmrgtest -z "$ac_objext" && ac_objext=o
12669c9ff80cSmrg
12676fae4e5dSmrg_LT_CC_BASENAME([$compiler])
12689c9ff80cSmrg
12696fae4e5dSmrg# Only perform the check for file, if the check method requires it
12706fae4e5dSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
12716fae4e5dSmrgcase $deplibs_check_method in
12726fae4e5dSmrgfile_magic*)
12736fae4e5dSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
12746fae4e5dSmrg    _LT_PATH_MAGIC
12756fae4e5dSmrg  fi
12766fae4e5dSmrg  ;;
12776fae4e5dSmrgesac
12789c9ff80cSmrg
12796fae4e5dSmrg# Use C for the default configuration in the libtool script
12806fae4e5dSmrgLT_SUPPORTED_TAG([CC])
12816fae4e5dSmrg_LT_LANG_C_CONFIG
12826fae4e5dSmrg_LT_LANG_DEFAULT_CONFIG
12836fae4e5dSmrg_LT_CONFIG_COMMANDS
12846fae4e5dSmrg])# _LT_SETUP
12859c9ff80cSmrg
12869c9ff80cSmrg
12876fae4e5dSmrg# _LT_PREPARE_SED_QUOTE_VARS
12886fae4e5dSmrg# --------------------------
12896fae4e5dSmrg# Define a few sed substitution that help us do robust quoting.
12906fae4e5dSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
12916fae4e5dSmrg[# Backslashify metacharacters that are still active within
12926fae4e5dSmrg# double-quoted strings.
12936fae4e5dSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
12949c9ff80cSmrg
12956fae4e5dSmrg# Same as above, but do not quote variable references.
12966fae4e5dSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
1297e5410a46Smrg
12986fae4e5dSmrg# Sed substitution to delay expansion of an escaped shell variable in a
12996fae4e5dSmrg# double_quote_subst'ed string.
13006fae4e5dSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
13011f0ac6a5Smrg
13026fae4e5dSmrg# Sed substitution to delay expansion of an escaped single quote.
13036fae4e5dSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
13041f0ac6a5Smrg
13056fae4e5dSmrg# Sed substitution to avoid accidental globbing in evaled expressions
13066fae4e5dSmrgno_glob_subst='s/\*/\\\*/g'
13076fae4e5dSmrg])
13081f0ac6a5Smrg
13096fae4e5dSmrg# _LT_PROG_LTMAIN
13106fae4e5dSmrg# ---------------
13116fae4e5dSmrg# Note that this code is called both from `configure', and `config.status'
13126fae4e5dSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
13136fae4e5dSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
13146fae4e5dSmrg# so we pass a copy along to make sure it has a sensible value anyway.
13156fae4e5dSmrgm4_defun([_LT_PROG_LTMAIN],
13166fae4e5dSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
13176fae4e5dSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
13186fae4e5dSmrgltmain="$ac_aux_dir/ltmain.sh"
13196fae4e5dSmrg])# _LT_PROG_LTMAIN
13201f0ac6a5Smrg
13219c9ff80cSmrg
13229c9ff80cSmrg
13236fae4e5dSmrg# So that we can recreate a full libtool script including additional
13246fae4e5dSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
13256fae4e5dSmrg# in macros and then make a single call at the end using the `libtool'
13266fae4e5dSmrg# label.
13279c9ff80cSmrg
13281f0ac6a5Smrg
13296fae4e5dSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
13306fae4e5dSmrg# ----------------------------------------
13316fae4e5dSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
13326fae4e5dSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
13336fae4e5dSmrg[m4_ifval([$1],
13346fae4e5dSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
13356fae4e5dSmrg                     [$1
13366fae4e5dSmrg])])])
13371f0ac6a5Smrg
13386fae4e5dSmrg# Initialize.
13396fae4e5dSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
13401f0ac6a5Smrg
13411f0ac6a5Smrg
13426fae4e5dSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
13436fae4e5dSmrg# ------------------------------
13446fae4e5dSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
13456fae4e5dSmrgm4_define([_LT_CONFIG_LIBTOOL],
13466fae4e5dSmrg[m4_ifval([$1],
13476fae4e5dSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
13486fae4e5dSmrg                     [$1
13496fae4e5dSmrg])])])
13509c9ff80cSmrg
13516fae4e5dSmrg# Initialize.
13526fae4e5dSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
13539c9ff80cSmrg
1354e5410a46Smrg
13556fae4e5dSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
13566fae4e5dSmrg# -----------------------------------------------------
13576fae4e5dSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
13586fae4e5dSmrg[_LT_CONFIG_LIBTOOL([$1])
13596fae4e5dSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
13606fae4e5dSmrg])
1361e5410a46Smrg
13621f0ac6a5Smrg
13636fae4e5dSmrg# _LT_FORMAT_COMMENT([COMMENT])
13646fae4e5dSmrg# -----------------------------
13656fae4e5dSmrg# Add leading comment marks to the start of each line, and a trailing
13666fae4e5dSmrg# full-stop to the whole comment if one is not present already.
13676fae4e5dSmrgm4_define([_LT_FORMAT_COMMENT],
13686fae4e5dSmrg[m4_ifval([$1], [
13696fae4e5dSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
13706fae4e5dSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
13716fae4e5dSmrg)])
1372e5410a46Smrg
13731f0ac6a5Smrg
13741f0ac6a5Smrg
13751f0ac6a5Smrg
13761f0ac6a5Smrg
13776fae4e5dSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
13786fae4e5dSmrg# -------------------------------------------------------------------
13796fae4e5dSmrg# CONFIGNAME is the name given to the value in the libtool script.
13806fae4e5dSmrg# VARNAME is the (base) name used in the configure script.
13816fae4e5dSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
13826fae4e5dSmrg# VARNAME.  Any other value will be used directly.
13836fae4e5dSmrgm4_define([_LT_DECL],
13846fae4e5dSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
13856fae4e5dSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
13866fae4e5dSmrg	[m4_ifval([$1], [$1], [$2])])
13876fae4e5dSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
13886fae4e5dSmrg    m4_ifval([$4],
13896fae4e5dSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
13906fae4e5dSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
13916fae4e5dSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
13926fae4e5dSmrg])
13931f0ac6a5Smrg
13941f0ac6a5Smrg
13956fae4e5dSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
13966fae4e5dSmrg# --------------------------------------------------------
13976fae4e5dSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
13981f0ac6a5Smrg
13991f0ac6a5Smrg
14006fae4e5dSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
14016fae4e5dSmrg# ------------------------------------------------
14026fae4e5dSmrgm4_define([lt_decl_tag_varnames],
14036fae4e5dSmrg[_lt_decl_filter([tagged?], [yes], $@)])
14041f0ac6a5Smrg
14051f0ac6a5Smrg
14066fae4e5dSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
14076fae4e5dSmrg# ---------------------------------------------------------
14086fae4e5dSmrgm4_define([_lt_decl_filter],
14096fae4e5dSmrg[m4_case([$#],
14106fae4e5dSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
14116fae4e5dSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
14126fae4e5dSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
14136fae4e5dSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
14146fae4e5dSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
14156fae4e5dSmrg])
14161f0ac6a5Smrg
14171f0ac6a5Smrg
14186fae4e5dSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
14196fae4e5dSmrg# --------------------------------------------------
14206fae4e5dSmrgm4_define([lt_decl_quote_varnames],
14216fae4e5dSmrg[_lt_decl_filter([value], [1], $@)])
14221f0ac6a5Smrg
14239c9ff80cSmrg
14246fae4e5dSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
14256fae4e5dSmrg# ---------------------------------------------------
14266fae4e5dSmrgm4_define([lt_decl_dquote_varnames],
14276fae4e5dSmrg[_lt_decl_filter([value], [2], $@)])
14289c9ff80cSmrg
14299c9ff80cSmrg
14306fae4e5dSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
14316fae4e5dSmrg# ---------------------------------------------------
14326fae4e5dSmrgm4_define([lt_decl_varnames_tagged],
14336fae4e5dSmrg[m4_assert([$# <= 2])dnl
14346fae4e5dSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
14356fae4e5dSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
14366fae4e5dSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
14376fae4e5dSmrgm4_define([_lt_decl_varnames_tagged],
14386fae4e5dSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
14399c9ff80cSmrg
14409c9ff80cSmrg
14416fae4e5dSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
14426fae4e5dSmrg# ------------------------------------------------
14436fae4e5dSmrgm4_define([lt_decl_all_varnames],
14446fae4e5dSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
14456fae4e5dSmrg     m4_if([$2], [],
14466fae4e5dSmrg	   m4_quote(lt_decl_varnames),
14476fae4e5dSmrg	m4_quote(m4_shift($@))))[]dnl
14486fae4e5dSmrg])
14496fae4e5dSmrgm4_define([_lt_decl_all_varnames],
14506fae4e5dSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
14516fae4e5dSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
14526fae4e5dSmrg])
14539c9ff80cSmrg
14549c9ff80cSmrg
14556fae4e5dSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
14566fae4e5dSmrg# ------------------------------------
14576fae4e5dSmrg# Quote a variable value, and forward it to `config.status' so that its
14586fae4e5dSmrg# declaration there will have the same value as in `configure'.  VARNAME
14596fae4e5dSmrg# must have a single quote delimited value for this to work.
14606fae4e5dSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
14616fae4e5dSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
14629c9ff80cSmrg
14639c9ff80cSmrg
14646fae4e5dSmrg# _LT_CONFIG_STATUS_DECLARATIONS
14656fae4e5dSmrg# ------------------------------
14666fae4e5dSmrg# We delimit libtool config variables with single quotes, so when
14676fae4e5dSmrg# we write them to config.status, we have to be sure to quote all
14686fae4e5dSmrg# embedded single quotes properly.  In configure, this macro expands
14696fae4e5dSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
14709c9ff80cSmrg#
14716fae4e5dSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
14726fae4e5dSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
14736fae4e5dSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
14746fae4e5dSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
14756fae4e5dSmrg
14766fae4e5dSmrg
14776fae4e5dSmrg# _LT_LIBTOOL_TAGS
14786fae4e5dSmrg# ----------------
14796fae4e5dSmrg# Output comment and list of tags supported by the script
14806fae4e5dSmrgm4_defun([_LT_LIBTOOL_TAGS],
14816fae4e5dSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
14826fae4e5dSmrgavailable_tags="_LT_TAGS"dnl
14839c9ff80cSmrg])
14849c9ff80cSmrg
14859c9ff80cSmrg
14866fae4e5dSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
14876fae4e5dSmrg# -----------------------------------
14886fae4e5dSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
14896fae4e5dSmrg# expand to a commented shell variable setting:
14906fae4e5dSmrg#
14916fae4e5dSmrg#    # Some comment about what VAR is for.
14926fae4e5dSmrg#    visible_name=$lt_internal_name
14936fae4e5dSmrgm4_define([_LT_LIBTOOL_DECLARE],
14946fae4e5dSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
14956fae4e5dSmrg					   [description])))[]dnl
14966fae4e5dSmrgm4_pushdef([_libtool_name],
14976fae4e5dSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
14986fae4e5dSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
14996fae4e5dSmrg    [0], [_libtool_name=[$]$1],
15006fae4e5dSmrg    [1], [_libtool_name=$lt_[]$1],
15016fae4e5dSmrg    [2], [_libtool_name=$lt_[]$1],
15026fae4e5dSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
15036fae4e5dSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
15046fae4e5dSmrg])
15059c9ff80cSmrg
15069c9ff80cSmrg
15076fae4e5dSmrg# _LT_LIBTOOL_CONFIG_VARS
15086fae4e5dSmrg# -----------------------
15096fae4e5dSmrg# Produce commented declarations of non-tagged libtool config variables
15106fae4e5dSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
15116fae4e5dSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
15126fae4e5dSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
15136fae4e5dSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
15146fae4e5dSmrg[m4_foreach([_lt_var],
15156fae4e5dSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
15166fae4e5dSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
15179c9ff80cSmrg
15189c9ff80cSmrg
15196fae4e5dSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
15206fae4e5dSmrg# -------------------------
15216fae4e5dSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
15226fae4e5dSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
15236fae4e5dSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
15249c9ff80cSmrg
15259c9ff80cSmrg
15266fae4e5dSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
15276fae4e5dSmrg# ------------------------------
15286fae4e5dSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
15299c9ff80cSmrg
15309c9ff80cSmrg
15316fae4e5dSmrg# _LT_CONFIG_COMMANDS
15326fae4e5dSmrg# -------------------
15336fae4e5dSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
15346fae4e5dSmrg# variables for single and double quote escaping we saved from calls
15356fae4e5dSmrg# to _LT_DECL, we can put quote escaped variables declarations
15366fae4e5dSmrg# into `config.status', and then the shell code to quote escape them in
15376fae4e5dSmrg# for loops in `config.status'.  Finally, any additional code accumulated
15386fae4e5dSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
15396fae4e5dSmrgm4_defun([_LT_CONFIG_COMMANDS],
15406fae4e5dSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
15416fae4e5dSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
15426fae4e5dSmrg	dnl instead of duplicating it all over again into config.status,
15436fae4e5dSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
15446fae4e5dSmrg	dnl needs to know what name is stored there:
15456fae4e5dSmrg        [AC_CONFIG_COMMANDS([libtool],
15466fae4e5dSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
15476fae4e5dSmrg    dnl If the libtool generation code is destined for config.status,
15486fae4e5dSmrg    dnl expand the accumulated commands and init code now:
15496fae4e5dSmrg    [AC_CONFIG_COMMANDS([libtool],
15506fae4e5dSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
15516fae4e5dSmrg])#_LT_CONFIG_COMMANDS
15529c9ff80cSmrg
15539c9ff80cSmrg
15546fae4e5dSmrg# Initialize.
15556fae4e5dSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
15566fae4e5dSmrg[
15579c9ff80cSmrg
15586fae4e5dSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
15596fae4e5dSmrg# if CDPATH is set.
15606fae4e5dSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
15619c9ff80cSmrg
15626fae4e5dSmrgsed_quote_subst='$sed_quote_subst'
15636fae4e5dSmrgdouble_quote_subst='$double_quote_subst'
15646fae4e5dSmrgdelay_variable_subst='$delay_variable_subst'
15656fae4e5dSmrg_LT_CONFIG_STATUS_DECLARATIONS
15666fae4e5dSmrgLTCC='$LTCC'
15676fae4e5dSmrgLTCFLAGS='$LTCFLAGS'
15686fae4e5dSmrgcompiler='$compiler_DEFAULT'
15699c9ff80cSmrg
15706fae4e5dSmrg# A function that is used when there is no print builtin or printf.
15716fae4e5dSmrgfunc_fallback_echo ()
15726fae4e5dSmrg{
15736fae4e5dSmrg  eval 'cat <<_LTECHO_EOF
15746fae4e5dSmrg\$[]1
15756fae4e5dSmrg_LTECHO_EOF'
15766fae4e5dSmrg}
15779c9ff80cSmrg
15786fae4e5dSmrg# Quote evaled strings.
15796fae4e5dSmrgfor var in lt_decl_all_varnames([[ \
15806fae4e5dSmrg]], lt_decl_quote_varnames); do
15816fae4e5dSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
15826fae4e5dSmrg    *[[\\\\\\\`\\"\\\$]]*)
15836fae4e5dSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
15846fae4e5dSmrg      ;;
15856fae4e5dSmrg    *)
15866fae4e5dSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
15876fae4e5dSmrg      ;;
15886fae4e5dSmrg    esac
15899c9ff80cSmrgdone
15909c9ff80cSmrg
15916fae4e5dSmrg# Double-quote double-evaled strings.
15926fae4e5dSmrgfor var in lt_decl_all_varnames([[ \
15936fae4e5dSmrg]], lt_decl_dquote_varnames); do
15946fae4e5dSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
15956fae4e5dSmrg    *[[\\\\\\\`\\"\\\$]]*)
15966fae4e5dSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
15976fae4e5dSmrg      ;;
15986fae4e5dSmrg    *)
15996fae4e5dSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
16006fae4e5dSmrg      ;;
16016fae4e5dSmrg    esac
16026fae4e5dSmrgdone
16039c9ff80cSmrg
16046fae4e5dSmrg_LT_OUTPUT_LIBTOOL_INIT
16056fae4e5dSmrg])
16069c9ff80cSmrg
16076fae4e5dSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
16086fae4e5dSmrg# ------------------------------------
16096fae4e5dSmrg# Generate a child script FILE with all initialization necessary to
16106fae4e5dSmrg# reuse the environment learned by the parent script, and make the
16116fae4e5dSmrg# file executable.  If COMMENT is supplied, it is inserted after the
16126fae4e5dSmrg# `#!' sequence but before initialization text begins.  After this
16136fae4e5dSmrg# macro, additional text can be appended to FILE to form the body of
16146fae4e5dSmrg# the child script.  The macro ends with non-zero status if the
16156fae4e5dSmrg# file could not be fully written (such as if the disk is full).
16166fae4e5dSmrgm4_ifdef([AS_INIT_GENERATED],
16176fae4e5dSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
16186fae4e5dSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
16196fae4e5dSmrg[m4_require([AS_PREPARE])]dnl
16206fae4e5dSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
16216fae4e5dSmrg[lt_write_fail=0
16226fae4e5dSmrgcat >$1 <<_ASEOF || lt_write_fail=1
16236fae4e5dSmrg#! $SHELL
16246fae4e5dSmrg# Generated by $as_me.
16256fae4e5dSmrg$2
16266fae4e5dSmrgSHELL=\${CONFIG_SHELL-$SHELL}
16276fae4e5dSmrgexport SHELL
16286fae4e5dSmrg_ASEOF
16296fae4e5dSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
16306fae4e5dSmrgAS_SHELL_SANITIZE
16316fae4e5dSmrg_AS_PREPARE
16326fae4e5dSmrgexec AS_MESSAGE_FD>&1
16336fae4e5dSmrg_ASEOF
16346fae4e5dSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
16356fae4e5dSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
16361f0ac6a5Smrg
16376fae4e5dSmrg# LT_OUTPUT
16386fae4e5dSmrg# ---------
16396fae4e5dSmrg# This macro allows early generation of the libtool script (before
16406fae4e5dSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
16416fae4e5dSmrg# tests.
16426fae4e5dSmrgAC_DEFUN([LT_OUTPUT],
16436fae4e5dSmrg[: ${CONFIG_LT=./config.lt}
16446fae4e5dSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
16456fae4e5dSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
16466fae4e5dSmrg[# Run this file to recreate a libtool stub with the current configuration.])
16471f0ac6a5Smrg
16486fae4e5dSmrgcat >>"$CONFIG_LT" <<\_LTEOF
16496fae4e5dSmrglt_cl_silent=false
16506fae4e5dSmrgexec AS_MESSAGE_LOG_FD>>config.log
16516fae4e5dSmrg{
16526fae4e5dSmrg  echo
16536fae4e5dSmrg  AS_BOX([Running $as_me.])
16546fae4e5dSmrg} >&AS_MESSAGE_LOG_FD
16551f0ac6a5Smrg
16566fae4e5dSmrglt_cl_help="\
16576fae4e5dSmrg\`$as_me' creates a local libtool stub from the current configuration,
16586fae4e5dSmrgfor use in further configure time tests before the real libtool is
16596fae4e5dSmrggenerated.
16601f0ac6a5Smrg
16616fae4e5dSmrgUsage: $[0] [[OPTIONS]]
16621f0ac6a5Smrg
16636fae4e5dSmrg  -h, --help      print this help, then exit
16646fae4e5dSmrg  -V, --version   print version number, then exit
16656fae4e5dSmrg  -q, --quiet     do not print progress messages
16666fae4e5dSmrg  -d, --debug     don't remove temporary files
16671f0ac6a5Smrg
16686fae4e5dSmrgReport bugs to <bug-libtool@gnu.org>."
16699c9ff80cSmrg
16706fae4e5dSmrglt_cl_version="\
16716fae4e5dSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
16726fae4e5dSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
16736fae4e5dSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
16741f0ac6a5Smrg
167589c04b6cSmrgCopyright (C) 2011 Free Software Foundation, Inc.
16766fae4e5dSmrgThis config.lt script is free software; the Free Software Foundation
16776fae4e5dSmrggives unlimited permision to copy, distribute and modify it."
16781f0ac6a5Smrg
16796fae4e5dSmrgwhile test $[#] != 0
16806fae4e5dSmrgdo
16816fae4e5dSmrg  case $[1] in
16826fae4e5dSmrg    --version | --v* | -V )
16836fae4e5dSmrg      echo "$lt_cl_version"; exit 0 ;;
16846fae4e5dSmrg    --help | --h* | -h )
16856fae4e5dSmrg      echo "$lt_cl_help"; exit 0 ;;
16866fae4e5dSmrg    --debug | --d* | -d )
16876fae4e5dSmrg      debug=: ;;
16886fae4e5dSmrg    --quiet | --q* | --silent | --s* | -q )
16896fae4e5dSmrg      lt_cl_silent=: ;;
16901f0ac6a5Smrg
16916fae4e5dSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
16926fae4e5dSmrgTry \`$[0] --help' for more information.]) ;;
16931f0ac6a5Smrg
16946fae4e5dSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
16956fae4e5dSmrgTry \`$[0] --help' for more information.]) ;;
16966fae4e5dSmrg  esac
16976fae4e5dSmrg  shift
16986fae4e5dSmrgdone
16991f0ac6a5Smrg
17006fae4e5dSmrgif $lt_cl_silent; then
17016fae4e5dSmrg  exec AS_MESSAGE_FD>/dev/null
17026fae4e5dSmrgfi
17036fae4e5dSmrg_LTEOF
17041f0ac6a5Smrg
17056fae4e5dSmrgcat >>"$CONFIG_LT" <<_LTEOF
17066fae4e5dSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
17076fae4e5dSmrg_LTEOF
17081f0ac6a5Smrg
17096fae4e5dSmrgcat >>"$CONFIG_LT" <<\_LTEOF
17106fae4e5dSmrgAC_MSG_NOTICE([creating $ofile])
17116fae4e5dSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
17126fae4e5dSmrgAS_EXIT(0)
17136fae4e5dSmrg_LTEOF
17146fae4e5dSmrgchmod +x "$CONFIG_LT"
17151f0ac6a5Smrg
17166fae4e5dSmrg# configure is writing to config.log, but config.lt does its own redirection,
17176fae4e5dSmrg# appending to config.log, which fails on DOS, as config.log is still kept
17186fae4e5dSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
17196fae4e5dSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
17206fae4e5dSmrglt_cl_success=:
17216fae4e5dSmrgtest "$silent" = yes &&
17226fae4e5dSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
17236fae4e5dSmrgexec AS_MESSAGE_LOG_FD>/dev/null
17246fae4e5dSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
17256fae4e5dSmrgexec AS_MESSAGE_LOG_FD>>config.log
17266fae4e5dSmrg$lt_cl_success || AS_EXIT(1)
17276fae4e5dSmrg])# LT_OUTPUT
1728e5410a46Smrg
17291f0ac6a5Smrg
17306fae4e5dSmrg# _LT_CONFIG(TAG)
17319c9ff80cSmrg# ---------------
17326fae4e5dSmrg# If TAG is the built-in tag, create an initial libtool script with a
17336fae4e5dSmrg# default configuration from the untagged config vars.  Otherwise add code
17346fae4e5dSmrg# to config.status for appending the configuration named by TAG from the
17356fae4e5dSmrg# matching tagged config vars.
17366fae4e5dSmrgm4_defun([_LT_CONFIG],
17376fae4e5dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
17386fae4e5dSmrg_LT_CONFIG_SAVE_COMMANDS([
17396fae4e5dSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
17406fae4e5dSmrg  m4_if(_LT_TAG, [C], [
17416fae4e5dSmrg    # See if we are running on zsh, and set the options which allow our
17426fae4e5dSmrg    # commands through without removal of \ escapes.
17436fae4e5dSmrg    if test -n "${ZSH_VERSION+set}" ; then
17446fae4e5dSmrg      setopt NO_GLOB_SUBST
17456fae4e5dSmrg    fi
17461f0ac6a5Smrg
17476fae4e5dSmrg    cfgfile="${ofile}T"
17486fae4e5dSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
17496fae4e5dSmrg    $RM "$cfgfile"
17501f0ac6a5Smrg
17516fae4e5dSmrg    cat <<_LT_EOF >> "$cfgfile"
17526fae4e5dSmrg#! $SHELL
17531f0ac6a5Smrg
17546fae4e5dSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
17556fae4e5dSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
17566fae4e5dSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17576fae4e5dSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
17586fae4e5dSmrg#
17596fae4e5dSmrg_LT_COPYING
17606fae4e5dSmrg_LT_LIBTOOL_TAGS
17611f0ac6a5Smrg
17626fae4e5dSmrg# ### BEGIN LIBTOOL CONFIG
17636fae4e5dSmrg_LT_LIBTOOL_CONFIG_VARS
17646fae4e5dSmrg_LT_LIBTOOL_TAG_VARS
17656fae4e5dSmrg# ### END LIBTOOL CONFIG
17661f0ac6a5Smrg
17676fae4e5dSmrg_LT_EOF
17681f0ac6a5Smrg
17696fae4e5dSmrg  case $host_os in
17706fae4e5dSmrg  aix3*)
17716fae4e5dSmrg    cat <<\_LT_EOF >> "$cfgfile"
17726fae4e5dSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
17736fae4e5dSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
17746fae4e5dSmrg# vanish in a puff of smoke.
17756fae4e5dSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
17766fae4e5dSmrg  COLLECT_NAMES=
17776fae4e5dSmrg  export COLLECT_NAMES
17786fae4e5dSmrgfi
17796fae4e5dSmrg_LT_EOF
17806fae4e5dSmrg    ;;
17816fae4e5dSmrg  esac
17821f0ac6a5Smrg
17836fae4e5dSmrg  _LT_PROG_LTMAIN
17841f0ac6a5Smrg
17856fae4e5dSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
17866fae4e5dSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
17876fae4e5dSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
17886fae4e5dSmrg  # is reportedly fixed, but why not run on old versions too?
17896fae4e5dSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
17906fae4e5dSmrg     || (rm -f "$cfgfile"; exit 1)
17919c9ff80cSmrg
17926fae4e5dSmrg  _LT_PROG_REPLACE_SHELLFNS
17939c9ff80cSmrg
17946fae4e5dSmrg   mv -f "$cfgfile" "$ofile" ||
17956fae4e5dSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
17966fae4e5dSmrg  chmod +x "$ofile"
17976fae4e5dSmrg],
17986fae4e5dSmrg[cat <<_LT_EOF >> "$ofile"
17999c9ff80cSmrg
18006fae4e5dSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
18016fae4e5dSmrgdnl in a comment (ie after a #).
18026fae4e5dSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
18036fae4e5dSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
18046fae4e5dSmrg# ### END LIBTOOL TAG CONFIG: $1
18056fae4e5dSmrg_LT_EOF
18066fae4e5dSmrg])dnl /m4_if
18076fae4e5dSmrg],
18086fae4e5dSmrg[m4_if([$1], [], [
18096fae4e5dSmrg    PACKAGE='$PACKAGE'
18106fae4e5dSmrg    VERSION='$VERSION'
18116fae4e5dSmrg    TIMESTAMP='$TIMESTAMP'
18126fae4e5dSmrg    RM='$RM'
18136fae4e5dSmrg    ofile='$ofile'], [])
18146fae4e5dSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
18156fae4e5dSmrg])# _LT_CONFIG
18169c9ff80cSmrg
18179c9ff80cSmrg
18186fae4e5dSmrg# LT_SUPPORTED_TAG(TAG)
18196fae4e5dSmrg# ---------------------
18206fae4e5dSmrg# Trace this macro to discover what tags are supported by the libtool
18216fae4e5dSmrg# --tag option, using:
18226fae4e5dSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
18236fae4e5dSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
18249c9ff80cSmrg
18259c9ff80cSmrg
18266fae4e5dSmrg# C support is built-in for now
18276fae4e5dSmrgm4_define([_LT_LANG_C_enabled], [])
18286fae4e5dSmrgm4_define([_LT_TAGS], [])
18299c9ff80cSmrg
18301f0ac6a5Smrg
18316fae4e5dSmrg# LT_LANG(LANG)
18326fae4e5dSmrg# -------------
18336fae4e5dSmrg# Enable libtool support for the given language if not already enabled.
18346fae4e5dSmrgAC_DEFUN([LT_LANG],
18356fae4e5dSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
18366fae4e5dSmrgm4_case([$1],
18376fae4e5dSmrg  [C],			[_LT_LANG(C)],
18386fae4e5dSmrg  [C++],		[_LT_LANG(CXX)],
183989c04b6cSmrg  [Go],			[_LT_LANG(GO)],
18406fae4e5dSmrg  [Java],		[_LT_LANG(GCJ)],
18416fae4e5dSmrg  [Fortran 77],		[_LT_LANG(F77)],
18426fae4e5dSmrg  [Fortran],		[_LT_LANG(FC)],
18436fae4e5dSmrg  [Windows Resource],	[_LT_LANG(RC)],
18446fae4e5dSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
18456fae4e5dSmrg    [_LT_LANG($1)],
18466fae4e5dSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
18476fae4e5dSmrg])# LT_LANG
18481f0ac6a5Smrg
18491f0ac6a5Smrg
18506fae4e5dSmrg# _LT_LANG(LANGNAME)
18516fae4e5dSmrg# ------------------
18526fae4e5dSmrgm4_defun([_LT_LANG],
18536fae4e5dSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
18546fae4e5dSmrg  [LT_SUPPORTED_TAG([$1])dnl
18556fae4e5dSmrg  m4_append([_LT_TAGS], [$1 ])dnl
18566fae4e5dSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
18576fae4e5dSmrg  _LT_LANG_$1_CONFIG($1)])dnl
18586fae4e5dSmrg])# _LT_LANG
18591f0ac6a5Smrg
18601f0ac6a5Smrg
186189c04b6cSmrgm4_ifndef([AC_PROG_GO], [
186289c04b6cSmrg# NOTE: This macro has been submitted for inclusion into   #
186389c04b6cSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
186489c04b6cSmrg#  a released version of Autoconf we should remove this    #
186589c04b6cSmrg#  macro and use it instead.                               #
186689c04b6cSmrgm4_defun([AC_PROG_GO],
186789c04b6cSmrg[AC_LANG_PUSH(Go)dnl
186889c04b6cSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
186989c04b6cSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
187089c04b6cSmrg_AC_ARG_VAR_LDFLAGS()dnl
187189c04b6cSmrgAC_CHECK_TOOL(GOC, gccgo)
187289c04b6cSmrgif test -z "$GOC"; then
187389c04b6cSmrg  if test -n "$ac_tool_prefix"; then
187489c04b6cSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
187589c04b6cSmrg  fi
187689c04b6cSmrgfi
187789c04b6cSmrgif test -z "$GOC"; then
187889c04b6cSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
187989c04b6cSmrgfi
188089c04b6cSmrg])#m4_defun
188189c04b6cSmrg])#m4_ifndef
188289c04b6cSmrg
188389c04b6cSmrg
18846fae4e5dSmrg# _LT_LANG_DEFAULT_CONFIG
18856fae4e5dSmrg# -----------------------
18866fae4e5dSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
18876fae4e5dSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
18886fae4e5dSmrg  [LT_LANG(CXX)],
18896fae4e5dSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1890e5410a46Smrg
18916fae4e5dSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
18926fae4e5dSmrg  [LT_LANG(F77)],
18936fae4e5dSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
18941f0ac6a5Smrg
18956fae4e5dSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
18966fae4e5dSmrg  [LT_LANG(FC)],
18976fae4e5dSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
18981f0ac6a5Smrg
18996fae4e5dSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
19006fae4e5dSmrgdnl pulling things in needlessly.
19016fae4e5dSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
19026fae4e5dSmrg  [LT_LANG(GCJ)],
19036fae4e5dSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
19046fae4e5dSmrg    [LT_LANG(GCJ)],
19056fae4e5dSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
19066fae4e5dSmrg      [LT_LANG(GCJ)],
19076fae4e5dSmrg      [m4_ifdef([AC_PROG_GCJ],
19086fae4e5dSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
19096fae4e5dSmrg       m4_ifdef([A][M_PROG_GCJ],
19106fae4e5dSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
19116fae4e5dSmrg       m4_ifdef([LT_PROG_GCJ],
19126fae4e5dSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
19139c9ff80cSmrg
191489c04b6cSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
191589c04b6cSmrg  [LT_LANG(GO)],
191689c04b6cSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
191789c04b6cSmrg
19186fae4e5dSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
19196fae4e5dSmrg  [LT_LANG(RC)],
19206fae4e5dSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
19216fae4e5dSmrg])# _LT_LANG_DEFAULT_CONFIG
19229c9ff80cSmrg
19236fae4e5dSmrg# Obsolete macros:
19246fae4e5dSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
19256fae4e5dSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
19266fae4e5dSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
19276fae4e5dSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
19286fae4e5dSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
19296fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
19306fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
19316fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
19326fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
19336fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
19346fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
19359c9ff80cSmrg
19369c9ff80cSmrg
19376fae4e5dSmrg# _LT_TAG_COMPILER
19386fae4e5dSmrg# ----------------
19396fae4e5dSmrgm4_defun([_LT_TAG_COMPILER],
19406fae4e5dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
19419c9ff80cSmrg
19426fae4e5dSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
19436fae4e5dSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
19446fae4e5dSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
19456fae4e5dSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
19469c9ff80cSmrg
19476fae4e5dSmrg# If no C compiler was specified, use CC.
19486fae4e5dSmrgLTCC=${LTCC-"$CC"}
19499c9ff80cSmrg
19506fae4e5dSmrg# If no C compiler flags were specified, use CFLAGS.
19516fae4e5dSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
19529c9ff80cSmrg
19536fae4e5dSmrg# Allow CC to be a program name with arguments.
19546fae4e5dSmrgcompiler=$CC
19556fae4e5dSmrg])# _LT_TAG_COMPILER
19569c9ff80cSmrg
19579c9ff80cSmrg
19586fae4e5dSmrg# _LT_COMPILER_BOILERPLATE
19596fae4e5dSmrg# ------------------------
19606fae4e5dSmrg# Check for compiler boilerplate output or warnings with
19616fae4e5dSmrg# the simple compiler test code.
19626fae4e5dSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
19636fae4e5dSmrg[m4_require([_LT_DECL_SED])dnl
19646fae4e5dSmrgac_outfile=conftest.$ac_objext
19656fae4e5dSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
19666fae4e5dSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
19676fae4e5dSmrg_lt_compiler_boilerplate=`cat conftest.err`
19686fae4e5dSmrg$RM conftest*
19696fae4e5dSmrg])# _LT_COMPILER_BOILERPLATE
19709c9ff80cSmrg
19719c9ff80cSmrg
19726fae4e5dSmrg# _LT_LINKER_BOILERPLATE
19736fae4e5dSmrg# ----------------------
19746fae4e5dSmrg# Check for linker boilerplate output or warnings with
19756fae4e5dSmrg# the simple link test code.
19766fae4e5dSmrgm4_defun([_LT_LINKER_BOILERPLATE],
19776fae4e5dSmrg[m4_require([_LT_DECL_SED])dnl
19786fae4e5dSmrgac_outfile=conftest.$ac_objext
19796fae4e5dSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
19806fae4e5dSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
19816fae4e5dSmrg_lt_linker_boilerplate=`cat conftest.err`
19826fae4e5dSmrg$RM -r conftest*
19836fae4e5dSmrg])# _LT_LINKER_BOILERPLATE
19849c9ff80cSmrg
19856fae4e5dSmrg# _LT_REQUIRED_DARWIN_CHECKS
19866fae4e5dSmrg# -------------------------
19876fae4e5dSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
19886fae4e5dSmrg  case $host_os in
19896fae4e5dSmrg    rhapsody* | darwin*)
19906fae4e5dSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
19916fae4e5dSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
19926fae4e5dSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
19936fae4e5dSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
19946fae4e5dSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
19956fae4e5dSmrg    _LT_DECL([], [DSYMUTIL], [1],
19966fae4e5dSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
19976fae4e5dSmrg    _LT_DECL([], [NMEDIT], [1],
19986fae4e5dSmrg      [Tool to change global to local symbols on Mac OS X])
19996fae4e5dSmrg    _LT_DECL([], [LIPO], [1],
20006fae4e5dSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
20016fae4e5dSmrg    _LT_DECL([], [OTOOL], [1],
20026fae4e5dSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
20036fae4e5dSmrg    _LT_DECL([], [OTOOL64], [1],
20046fae4e5dSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
20059c9ff80cSmrg
20066fae4e5dSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
20076fae4e5dSmrg      [lt_cv_apple_cc_single_mod=no
20086fae4e5dSmrg      if test -z "${LT_MULTI_MODULE}"; then
20096fae4e5dSmrg	# By default we will add the -single_module flag. You can override
20106fae4e5dSmrg	# by either setting the environment variable LT_MULTI_MODULE
20116fae4e5dSmrg	# non-empty at configure time, or by adding -multi_module to the
20126fae4e5dSmrg	# link flags.
20136fae4e5dSmrg	rm -rf libconftest.dylib*
20146fae4e5dSmrg	echo "int foo(void){return 1;}" > conftest.c
20156fae4e5dSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
20166fae4e5dSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
20176fae4e5dSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
20186fae4e5dSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
20196fae4e5dSmrg        _lt_result=$?
202089c04b6cSmrg	# If there is a non-empty error log, and "single_module"
202189c04b6cSmrg	# appears in it, assume the flag caused a linker warning
202289c04b6cSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
202389c04b6cSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
202489c04b6cSmrg	# Otherwise, if the output was created with a 0 exit code from
202589c04b6cSmrg	# the compiler, it worked.
202689c04b6cSmrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
20276fae4e5dSmrg	  lt_cv_apple_cc_single_mod=yes
20286fae4e5dSmrg	else
20296fae4e5dSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
20306fae4e5dSmrg	fi
20316fae4e5dSmrg	rm -rf libconftest.dylib*
20326fae4e5dSmrg	rm -f conftest.*
20336fae4e5dSmrg      fi])
203489c04b6cSmrg
20356fae4e5dSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
20366fae4e5dSmrg      [lt_cv_ld_exported_symbols_list],
20376fae4e5dSmrg      [lt_cv_ld_exported_symbols_list=no
20386fae4e5dSmrg      save_LDFLAGS=$LDFLAGS
20396fae4e5dSmrg      echo "_main" > conftest.sym
20406fae4e5dSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
20416fae4e5dSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
20426fae4e5dSmrg	[lt_cv_ld_exported_symbols_list=yes],
20436fae4e5dSmrg	[lt_cv_ld_exported_symbols_list=no])
20446fae4e5dSmrg	LDFLAGS="$save_LDFLAGS"
20456fae4e5dSmrg    ])
204689c04b6cSmrg
20476fae4e5dSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
20486fae4e5dSmrg      [lt_cv_ld_force_load=no
20496fae4e5dSmrg      cat > conftest.c << _LT_EOF
20506fae4e5dSmrgint forced_loaded() { return 2;}
20516fae4e5dSmrg_LT_EOF
20526fae4e5dSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
20536fae4e5dSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
20546fae4e5dSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
20556fae4e5dSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
20566fae4e5dSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
20576fae4e5dSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
20586fae4e5dSmrg      cat > conftest.c << _LT_EOF
20596fae4e5dSmrgint main() { return 0;}
20606fae4e5dSmrg_LT_EOF
20616fae4e5dSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
20626fae4e5dSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
20636fae4e5dSmrg      _lt_result=$?
206489c04b6cSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
206589c04b6cSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
206689c04b6cSmrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
20676fae4e5dSmrg	lt_cv_ld_force_load=yes
20686fae4e5dSmrg      else
20696fae4e5dSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
20706fae4e5dSmrg      fi
20716fae4e5dSmrg        rm -f conftest.err libconftest.a conftest conftest.c
20726fae4e5dSmrg        rm -rf conftest.dSYM
20736fae4e5dSmrg    ])
20746fae4e5dSmrg    case $host_os in
20756fae4e5dSmrg    rhapsody* | darwin1.[[012]])
20766fae4e5dSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
20776fae4e5dSmrg    darwin1.*)
20786fae4e5dSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
20796fae4e5dSmrg    darwin*) # darwin 5.x on
20806fae4e5dSmrg      # if running on 10.5 or later, the deployment target defaults
20816fae4e5dSmrg      # to the OS version, if on x86, and 10.4, the deployment
20826fae4e5dSmrg      # target defaults to 10.4. Don't you love it?
20836fae4e5dSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
20846fae4e5dSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
20856fae4e5dSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
20866fae4e5dSmrg	10.[[012]]*)
20876fae4e5dSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
20886fae4e5dSmrg	10.*)
20896fae4e5dSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
20906fae4e5dSmrg      esac
20916fae4e5dSmrg    ;;
20926fae4e5dSmrg  esac
20936fae4e5dSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
20946fae4e5dSmrg      _lt_dar_single_mod='$single_module'
20956fae4e5dSmrg    fi
20966fae4e5dSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
20976fae4e5dSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
20986fae4e5dSmrg    else
20996fae4e5dSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
21006fae4e5dSmrg    fi
21016fae4e5dSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
21026fae4e5dSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
21036fae4e5dSmrg    else
21046fae4e5dSmrg      _lt_dsymutil=
21056fae4e5dSmrg    fi
21066fae4e5dSmrg    ;;
21076fae4e5dSmrg  esac
21089c9ff80cSmrg])
21099c9ff80cSmrg
21109c9ff80cSmrg
211189c04b6cSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
211289c04b6cSmrg# ---------------------------------
21136fae4e5dSmrg# Checks for linker and compiler features on darwin
21146fae4e5dSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
21156fae4e5dSmrg[
21166fae4e5dSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
21176fae4e5dSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
21186fae4e5dSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
21196fae4e5dSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
21206fae4e5dSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
21216fae4e5dSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
21226fae4e5dSmrg    _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\"`'
212389c04b6cSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
212489c04b6cSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
21256fae4e5dSmrg  else
21266fae4e5dSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
21276fae4e5dSmrg  fi
21286fae4e5dSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
21296fae4e5dSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
21306fae4e5dSmrg  case $cc_basename in
21316fae4e5dSmrg     ifort*) _lt_dar_can_shared=yes ;;
21326fae4e5dSmrg     *) _lt_dar_can_shared=$GCC ;;
21336fae4e5dSmrg  esac
21346fae4e5dSmrg  if test "$_lt_dar_can_shared" = "yes"; then
21356fae4e5dSmrg    output_verbose_link_cmd=func_echo_all
21366fae4e5dSmrg    _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}"
21376fae4e5dSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
21386fae4e5dSmrg    _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}"
21396fae4e5dSmrg    _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}"
21406fae4e5dSmrg    m4_if([$1], [CXX],
21416fae4e5dSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
21426fae4e5dSmrg      _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}"
21436fae4e5dSmrg      _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}"
21446fae4e5dSmrg    fi
21456fae4e5dSmrg],[])
21466fae4e5dSmrg  else
21476fae4e5dSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
21486fae4e5dSmrg  fi
21496fae4e5dSmrg])
21509c9ff80cSmrg
21516fae4e5dSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
21526fae4e5dSmrg# ----------------------------------
21536fae4e5dSmrg# Links a minimal program and checks the executable
21546fae4e5dSmrg# for the system default hardcoded library path. In most cases,
21556fae4e5dSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
21566fae4e5dSmrg# the location of the communication and MPI libs are included too.
21576fae4e5dSmrg# If we don't find anything, use the default library path according
21586fae4e5dSmrg# to the aix ld manual.
21596fae4e5dSmrg# Store the results from the different compilers for each TAGNAME.
21606fae4e5dSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
21616fae4e5dSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
21626fae4e5dSmrg[m4_require([_LT_DECL_SED])dnl
21636fae4e5dSmrgif test "${lt_cv_aix_libpath+set}" = set; then
21646fae4e5dSmrg  aix_libpath=$lt_cv_aix_libpath
21656fae4e5dSmrgelse
21666fae4e5dSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
21676fae4e5dSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
21686fae4e5dSmrg  lt_aix_libpath_sed='[
21696fae4e5dSmrg      /Import File Strings/,/^$/ {
21706fae4e5dSmrg	  /^0/ {
21716fae4e5dSmrg	      s/^0  *\([^ ]*\) *$/\1/
21726fae4e5dSmrg	      p
21736fae4e5dSmrg	  }
21746fae4e5dSmrg      }]'
21756fae4e5dSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
21766fae4e5dSmrg  # Check for a 64-bit object if we didn't find anything.
21776fae4e5dSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
21786fae4e5dSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
21796fae4e5dSmrg  fi],[])
21806fae4e5dSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
21816fae4e5dSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
21826fae4e5dSmrg  fi
21836fae4e5dSmrg  ])
21846fae4e5dSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
21856fae4e5dSmrgfi
21866fae4e5dSmrg])# _LT_SYS_MODULE_PATH_AIX
21879c9ff80cSmrg
21889c9ff80cSmrg
21896fae4e5dSmrg# _LT_SHELL_INIT(ARG)
21909c9ff80cSmrg# -------------------
21916fae4e5dSmrgm4_define([_LT_SHELL_INIT],
21926fae4e5dSmrg[m4_divert_text([M4SH-INIT], [$1
21936fae4e5dSmrg])])# _LT_SHELL_INIT
21949c9ff80cSmrg
21959c9ff80cSmrg
21969c9ff80cSmrg
21976fae4e5dSmrg# _LT_PROG_ECHO_BACKSLASH
21986fae4e5dSmrg# -----------------------
21996fae4e5dSmrg# Find how we can fake an echo command that does not interpret backslash.
22006fae4e5dSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
22016fae4e5dSmrg# of the generated configure script which will find a shell with a builtin
22026fae4e5dSmrg# printf (which we can use as an echo command).
22036fae4e5dSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
22046fae4e5dSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
22056fae4e5dSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
22066fae4e5dSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
22076fae4e5dSmrg
22086fae4e5dSmrgAC_MSG_CHECKING([how to print strings])
22096fae4e5dSmrg# Test print first, because it will be a builtin if present.
22106fae4e5dSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
22116fae4e5dSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
22126fae4e5dSmrg  ECHO='print -r --'
22136fae4e5dSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
22146fae4e5dSmrg  ECHO='printf %s\n'
22156fae4e5dSmrgelse
22166fae4e5dSmrg  # Use this function as a fallback that always works.
22176fae4e5dSmrg  func_fallback_echo ()
22186fae4e5dSmrg  {
22196fae4e5dSmrg    eval 'cat <<_LTECHO_EOF
22206fae4e5dSmrg$[]1
22216fae4e5dSmrg_LTECHO_EOF'
22226fae4e5dSmrg  }
22236fae4e5dSmrg  ECHO='func_fallback_echo'
22246fae4e5dSmrgfi
22259c9ff80cSmrg
22266fae4e5dSmrg# func_echo_all arg...
22276fae4e5dSmrg# Invoke $ECHO with all args, space-separated.
22286fae4e5dSmrgfunc_echo_all ()
22296fae4e5dSmrg{
22306fae4e5dSmrg    $ECHO "$*" 
22316fae4e5dSmrg}
22329c9ff80cSmrg
22336fae4e5dSmrgcase "$ECHO" in
22346fae4e5dSmrg  printf*) AC_MSG_RESULT([printf]) ;;
22356fae4e5dSmrg  print*) AC_MSG_RESULT([print -r]) ;;
22366fae4e5dSmrg  *) AC_MSG_RESULT([cat]) ;;
22379c9ff80cSmrgesac
22389c9ff80cSmrg
22396fae4e5dSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
22406fae4e5dSmrg[_AS_DETECT_SUGGESTED([
22416fae4e5dSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
22426fae4e5dSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
22436fae4e5dSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
22446fae4e5dSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
22456fae4e5dSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
22466fae4e5dSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
22476fae4e5dSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
22489c9ff80cSmrg
22496fae4e5dSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
22506fae4e5dSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
22516fae4e5dSmrg])# _LT_PROG_ECHO_BACKSLASH
22529c9ff80cSmrg
22539c9ff80cSmrg
22546fae4e5dSmrg# _LT_WITH_SYSROOT
22556fae4e5dSmrg# ----------------
22566fae4e5dSmrgAC_DEFUN([_LT_WITH_SYSROOT],
22576fae4e5dSmrg[AC_MSG_CHECKING([for sysroot])
22586fae4e5dSmrgAC_ARG_WITH([sysroot],
22596fae4e5dSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
22606fae4e5dSmrg                        (or the compiler's sysroot if not specified).],
22616fae4e5dSmrg[], [with_sysroot=no])
22626fae4e5dSmrg
22636fae4e5dSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
22646fae4e5dSmrgdnl in case the user passed a directory name.
22656fae4e5dSmrglt_sysroot=
22666fae4e5dSmrgcase ${with_sysroot} in #(
22676fae4e5dSmrg yes)
22686fae4e5dSmrg   if test "$GCC" = yes; then
22696fae4e5dSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
22706fae4e5dSmrg   fi
22716fae4e5dSmrg   ;; #(
22726fae4e5dSmrg /*)
22736fae4e5dSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
22746fae4e5dSmrg   ;; #(
22756fae4e5dSmrg no|'')
22766fae4e5dSmrg   ;; #(
22776fae4e5dSmrg *)
22786fae4e5dSmrg   AC_MSG_RESULT([${with_sysroot}])
22796fae4e5dSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
22806fae4e5dSmrg   ;;
22816fae4e5dSmrgesac
22829c9ff80cSmrg
22836fae4e5dSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
22846fae4e5dSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
22856fae4e5dSmrg[dependent libraries, and in which our libraries should be installed.])])
22869c9ff80cSmrg
22876fae4e5dSmrg# _LT_ENABLE_LOCK
22886fae4e5dSmrg# ---------------
22896fae4e5dSmrgm4_defun([_LT_ENABLE_LOCK],
22906fae4e5dSmrg[AC_ARG_ENABLE([libtool-lock],
22916fae4e5dSmrg  [AS_HELP_STRING([--disable-libtool-lock],
22926fae4e5dSmrg    [avoid locking (might break parallel builds)])])
22936fae4e5dSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
22949c9ff80cSmrg
22956fae4e5dSmrg# Some flags need to be propagated to the compiler or linker for good
22966fae4e5dSmrg# libtool support.
22976fae4e5dSmrgcase $host in
22986fae4e5dSmrgia64-*-hpux*)
22996fae4e5dSmrg  # Find out which ABI we are using.
23006fae4e5dSmrg  echo 'int i;' > conftest.$ac_ext
23016fae4e5dSmrg  if AC_TRY_EVAL(ac_compile); then
23026fae4e5dSmrg    case `/usr/bin/file conftest.$ac_objext` in
23036fae4e5dSmrg      *ELF-32*)
23046fae4e5dSmrg	HPUX_IA64_MODE="32"
23056fae4e5dSmrg	;;
23066fae4e5dSmrg      *ELF-64*)
23076fae4e5dSmrg	HPUX_IA64_MODE="64"
23086fae4e5dSmrg	;;
23096fae4e5dSmrg    esac
23106fae4e5dSmrg  fi
23116fae4e5dSmrg  rm -rf conftest*
23126fae4e5dSmrg  ;;
23136fae4e5dSmrg*-*-irix6*)
23146fae4e5dSmrg  # Find out which ABI we are using.
23156fae4e5dSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
23166fae4e5dSmrg  if AC_TRY_EVAL(ac_compile); then
23176fae4e5dSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
23186fae4e5dSmrg      case `/usr/bin/file conftest.$ac_objext` in
23196fae4e5dSmrg	*32-bit*)
23206fae4e5dSmrg	  LD="${LD-ld} -melf32bsmip"
23216fae4e5dSmrg	  ;;
23226fae4e5dSmrg	*N32*)
23236fae4e5dSmrg	  LD="${LD-ld} -melf32bmipn32"
23246fae4e5dSmrg	  ;;
23256fae4e5dSmrg	*64-bit*)
23266fae4e5dSmrg	  LD="${LD-ld} -melf64bmip"
23276fae4e5dSmrg	;;
23286fae4e5dSmrg      esac
23296fae4e5dSmrg    else
23306fae4e5dSmrg      case `/usr/bin/file conftest.$ac_objext` in
23316fae4e5dSmrg	*32-bit*)
23326fae4e5dSmrg	  LD="${LD-ld} -32"
23336fae4e5dSmrg	  ;;
23346fae4e5dSmrg	*N32*)
23356fae4e5dSmrg	  LD="${LD-ld} -n32"
23366fae4e5dSmrg	  ;;
23376fae4e5dSmrg	*64-bit*)
23386fae4e5dSmrg	  LD="${LD-ld} -64"
23396fae4e5dSmrg	  ;;
23406fae4e5dSmrg      esac
23416fae4e5dSmrg    fi
23426fae4e5dSmrg  fi
23436fae4e5dSmrg  rm -rf conftest*
23446fae4e5dSmrg  ;;
23459c9ff80cSmrg
23466fae4e5dSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
23476fae4e5dSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
23486fae4e5dSmrg  # Find out which ABI we are using.
23496fae4e5dSmrg  echo 'int i;' > conftest.$ac_ext
23506fae4e5dSmrg  if AC_TRY_EVAL(ac_compile); then
23516fae4e5dSmrg    case `/usr/bin/file conftest.o` in
23526fae4e5dSmrg      *32-bit*)
23536fae4e5dSmrg	case $host in
23546fae4e5dSmrg	  x86_64-*kfreebsd*-gnu)
23556fae4e5dSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
23566fae4e5dSmrg	    ;;
23576fae4e5dSmrg	  x86_64-*linux*)
23586fae4e5dSmrg	    LD="${LD-ld} -m elf_i386"
23596fae4e5dSmrg	    ;;
23606fae4e5dSmrg	  ppc64-*linux*|powerpc64-*linux*)
23616fae4e5dSmrg	    LD="${LD-ld} -m elf32ppclinux"
23626fae4e5dSmrg	    ;;
23636fae4e5dSmrg	  s390x-*linux*)
23646fae4e5dSmrg	    LD="${LD-ld} -m elf_s390"
23656fae4e5dSmrg	    ;;
23666fae4e5dSmrg	  sparc64-*linux*)
23676fae4e5dSmrg	    LD="${LD-ld} -m elf32_sparc"
23686fae4e5dSmrg	    ;;
23696fae4e5dSmrg	esac
23706fae4e5dSmrg	;;
23716fae4e5dSmrg      *64-bit*)
23726fae4e5dSmrg	case $host in
23736fae4e5dSmrg	  x86_64-*kfreebsd*-gnu)
23746fae4e5dSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
23756fae4e5dSmrg	    ;;
23766fae4e5dSmrg	  x86_64-*linux*)
23776fae4e5dSmrg	    LD="${LD-ld} -m elf_x86_64"
23786fae4e5dSmrg	    ;;
23796fae4e5dSmrg	  ppc*-*linux*|powerpc*-*linux*)
23806fae4e5dSmrg	    LD="${LD-ld} -m elf64ppc"
23816fae4e5dSmrg	    ;;
23826fae4e5dSmrg	  s390*-*linux*|s390*-*tpf*)
23836fae4e5dSmrg	    LD="${LD-ld} -m elf64_s390"
23846fae4e5dSmrg	    ;;
23856fae4e5dSmrg	  sparc*-*linux*)
23866fae4e5dSmrg	    LD="${LD-ld} -m elf64_sparc"
23876fae4e5dSmrg	    ;;
23886fae4e5dSmrg	esac
23896fae4e5dSmrg	;;
23906fae4e5dSmrg    esac
23916fae4e5dSmrg  fi
23926fae4e5dSmrg  rm -rf conftest*
23936fae4e5dSmrg  ;;
23949c9ff80cSmrg
23956fae4e5dSmrg*-*-sco3.2v5*)
23966fae4e5dSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
23976fae4e5dSmrg  SAVE_CFLAGS="$CFLAGS"
23986fae4e5dSmrg  CFLAGS="$CFLAGS -belf"
23996fae4e5dSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
24006fae4e5dSmrg    [AC_LANG_PUSH(C)
24016fae4e5dSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
24026fae4e5dSmrg     AC_LANG_POP])
24036fae4e5dSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
24046fae4e5dSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
24056fae4e5dSmrg    CFLAGS="$SAVE_CFLAGS"
24066fae4e5dSmrg  fi
24076fae4e5dSmrg  ;;
240889c04b6cSmrg*-*solaris*)
24096fae4e5dSmrg  # Find out which ABI we are using.
24106fae4e5dSmrg  echo 'int i;' > conftest.$ac_ext
24116fae4e5dSmrg  if AC_TRY_EVAL(ac_compile); then
24126fae4e5dSmrg    case `/usr/bin/file conftest.o` in
24136fae4e5dSmrg    *64-bit*)
24146fae4e5dSmrg      case $lt_cv_prog_gnu_ld in
241589c04b6cSmrg      yes*)
241689c04b6cSmrg        case $host in
241789c04b6cSmrg        i?86-*-solaris*)
241889c04b6cSmrg          LD="${LD-ld} -m elf_x86_64"
241989c04b6cSmrg          ;;
242089c04b6cSmrg        sparc*-*-solaris*)
242189c04b6cSmrg          LD="${LD-ld} -m elf64_sparc"
242289c04b6cSmrg          ;;
242389c04b6cSmrg        esac
242489c04b6cSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
242589c04b6cSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
242689c04b6cSmrg          LD="${LD-ld}_sol2"
242789c04b6cSmrg        fi
242889c04b6cSmrg        ;;
24296fae4e5dSmrg      *)
24306fae4e5dSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
24316fae4e5dSmrg	  LD="${LD-ld} -64"
24326fae4e5dSmrg	fi
24336fae4e5dSmrg	;;
24346fae4e5dSmrg      esac
24356fae4e5dSmrg      ;;
24366fae4e5dSmrg    esac
24376fae4e5dSmrg  fi
24386fae4e5dSmrg  rm -rf conftest*
24396fae4e5dSmrg  ;;
24406fae4e5dSmrgesac
24419c9ff80cSmrg
24426fae4e5dSmrgneed_locks="$enable_libtool_lock"
24436fae4e5dSmrg])# _LT_ENABLE_LOCK
24449c9ff80cSmrg
24459c9ff80cSmrg
24466fae4e5dSmrg# _LT_PROG_AR
24476fae4e5dSmrg# -----------
24486fae4e5dSmrgm4_defun([_LT_PROG_AR],
24496fae4e5dSmrg[AC_CHECK_TOOLS(AR, [ar], false)
24506fae4e5dSmrg: ${AR=ar}
24516fae4e5dSmrg: ${AR_FLAGS=cru}
24526fae4e5dSmrg_LT_DECL([], [AR], [1], [The archiver])
24536fae4e5dSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
24546fae4e5dSmrg
24556fae4e5dSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
24566fae4e5dSmrg  [lt_cv_ar_at_file=no
24576fae4e5dSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
24586fae4e5dSmrg     [echo conftest.$ac_objext > conftest.lst
24596fae4e5dSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
24606fae4e5dSmrg      AC_TRY_EVAL([lt_ar_try])
24616fae4e5dSmrg      if test "$ac_status" -eq 0; then
24626fae4e5dSmrg	# Ensure the archiver fails upon bogus file names.
24636fae4e5dSmrg	rm -f conftest.$ac_objext libconftest.a
24646fae4e5dSmrg	AC_TRY_EVAL([lt_ar_try])
24656fae4e5dSmrg	if test "$ac_status" -ne 0; then
24666fae4e5dSmrg          lt_cv_ar_at_file=@
24676fae4e5dSmrg        fi
24686fae4e5dSmrg      fi
24696fae4e5dSmrg      rm -f conftest.* libconftest.a
24706fae4e5dSmrg     ])
24716fae4e5dSmrg  ])
24729c9ff80cSmrg
24736fae4e5dSmrgif test "x$lt_cv_ar_at_file" = xno; then
24746fae4e5dSmrg  archiver_list_spec=
24756fae4e5dSmrgelse
24766fae4e5dSmrg  archiver_list_spec=$lt_cv_ar_at_file
24779c9ff80cSmrgfi
24786fae4e5dSmrg_LT_DECL([], [archiver_list_spec], [1],
24796fae4e5dSmrg  [How to feed a file listing to the archiver])
24806fae4e5dSmrg])# _LT_PROG_AR
24819c9ff80cSmrg
24829c9ff80cSmrg
24836fae4e5dSmrg# _LT_CMD_OLD_ARCHIVE
24846fae4e5dSmrg# -------------------
24856fae4e5dSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
24866fae4e5dSmrg[_LT_PROG_AR
24879c9ff80cSmrg
24886fae4e5dSmrgAC_CHECK_TOOL(STRIP, strip, :)
24896fae4e5dSmrgtest -z "$STRIP" && STRIP=:
24906fae4e5dSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
24919c9ff80cSmrg
24926fae4e5dSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
24936fae4e5dSmrgtest -z "$RANLIB" && RANLIB=:
24946fae4e5dSmrg_LT_DECL([], [RANLIB], [1],
24956fae4e5dSmrg    [Commands used to install an old-style archive])
24969c9ff80cSmrg
24976fae4e5dSmrg# Determine commands to create old-style static archives.
24986fae4e5dSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
24996fae4e5dSmrgold_postinstall_cmds='chmod 644 $oldlib'
25006fae4e5dSmrgold_postuninstall_cmds=
25019c9ff80cSmrg
25026fae4e5dSmrgif test -n "$RANLIB"; then
25036fae4e5dSmrg  case $host_os in
25046fae4e5dSmrg  openbsd*)
250589c04b6cSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
25066fae4e5dSmrg    ;;
25076fae4e5dSmrg  *)
250889c04b6cSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
25096fae4e5dSmrg    ;;
25106fae4e5dSmrg  esac
251189c04b6cSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
25126fae4e5dSmrgfi
25139c9ff80cSmrg
25146fae4e5dSmrgcase $host_os in
25156fae4e5dSmrg  darwin*)
25166fae4e5dSmrg    lock_old_archive_extraction=yes ;;
25176fae4e5dSmrg  *)
25186fae4e5dSmrg    lock_old_archive_extraction=no ;;
25196fae4e5dSmrgesac
25206fae4e5dSmrg_LT_DECL([], [old_postinstall_cmds], [2])
25216fae4e5dSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
25226fae4e5dSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
25236fae4e5dSmrg    [Commands used to build an old-style archive])
25246fae4e5dSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
25256fae4e5dSmrg    [Whether to use a lock for old archive extraction])
25266fae4e5dSmrg])# _LT_CMD_OLD_ARCHIVE
25279c9ff80cSmrg
25289c9ff80cSmrg
25296fae4e5dSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
25306fae4e5dSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
25316fae4e5dSmrg# ----------------------------------------------------------------
25326fae4e5dSmrg# Check whether the given compiler option works
25336fae4e5dSmrgAC_DEFUN([_LT_COMPILER_OPTION],
25346fae4e5dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
25356fae4e5dSmrgm4_require([_LT_DECL_SED])dnl
25366fae4e5dSmrgAC_CACHE_CHECK([$1], [$2],
25376fae4e5dSmrg  [$2=no
25386fae4e5dSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
25396fae4e5dSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
25406fae4e5dSmrg   lt_compiler_flag="$3"
25416fae4e5dSmrg   # Insert the option either (1) after the last *FLAGS variable, or
25426fae4e5dSmrg   # (2) before a word containing "conftest.", or (3) at the end.
25436fae4e5dSmrg   # Note that $ac_compile itself does not contain backslashes and begins
25446fae4e5dSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
25456fae4e5dSmrg   # The option is referenced via a variable to avoid confusing sed.
25466fae4e5dSmrg   lt_compile=`echo "$ac_compile" | $SED \
25476fae4e5dSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
25486fae4e5dSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
25496fae4e5dSmrg   -e 's:$: $lt_compiler_flag:'`
25506fae4e5dSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
25516fae4e5dSmrg   (eval "$lt_compile" 2>conftest.err)
25526fae4e5dSmrg   ac_status=$?
25536fae4e5dSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
25546fae4e5dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
25556fae4e5dSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
25566fae4e5dSmrg     # The compiler can only warn and ignore the option if not recognized
25576fae4e5dSmrg     # So say no if there are warnings other than the usual output.
25586fae4e5dSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
25596fae4e5dSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
25606fae4e5dSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
25616fae4e5dSmrg       $2=yes
25626fae4e5dSmrg     fi
25636fae4e5dSmrg   fi
25646fae4e5dSmrg   $RM conftest*
25656fae4e5dSmrg])
25669c9ff80cSmrg
25676fae4e5dSmrgif test x"[$]$2" = xyes; then
25686fae4e5dSmrg    m4_if([$5], , :, [$5])
25696fae4e5dSmrgelse
25706fae4e5dSmrg    m4_if([$6], , :, [$6])
25719c9ff80cSmrgfi
25726fae4e5dSmrg])# _LT_COMPILER_OPTION
25739c9ff80cSmrg
25746fae4e5dSmrg# Old name:
25756fae4e5dSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
25766fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
25776fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
25789c9ff80cSmrg
25799c9ff80cSmrg
25806fae4e5dSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
25816fae4e5dSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
25826fae4e5dSmrg# ----------------------------------------------------
25836fae4e5dSmrg# Check whether the given linker option works
25846fae4e5dSmrgAC_DEFUN([_LT_LINKER_OPTION],
25856fae4e5dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
25866fae4e5dSmrgm4_require([_LT_DECL_SED])dnl
25876fae4e5dSmrgAC_CACHE_CHECK([$1], [$2],
25886fae4e5dSmrg  [$2=no
25896fae4e5dSmrg   save_LDFLAGS="$LDFLAGS"
25906fae4e5dSmrg   LDFLAGS="$LDFLAGS $3"
25916fae4e5dSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
25926fae4e5dSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
25936fae4e5dSmrg     # The linker can only warn and ignore the option if not recognized
25946fae4e5dSmrg     # So say no if there are warnings
25956fae4e5dSmrg     if test -s conftest.err; then
25966fae4e5dSmrg       # Append any errors to the config.log.
25976fae4e5dSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
25986fae4e5dSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
25996fae4e5dSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
26006fae4e5dSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
26016fae4e5dSmrg         $2=yes
26026fae4e5dSmrg       fi
26036fae4e5dSmrg     else
26046fae4e5dSmrg       $2=yes
26056fae4e5dSmrg     fi
26066fae4e5dSmrg   fi
26076fae4e5dSmrg   $RM -r conftest*
26086fae4e5dSmrg   LDFLAGS="$save_LDFLAGS"
26096fae4e5dSmrg])
26109c9ff80cSmrg
26116fae4e5dSmrgif test x"[$]$2" = xyes; then
26126fae4e5dSmrg    m4_if([$4], , :, [$4])
26136fae4e5dSmrgelse
26146fae4e5dSmrg    m4_if([$5], , :, [$5])
26156fae4e5dSmrgfi
26166fae4e5dSmrg])# _LT_LINKER_OPTION
26179c9ff80cSmrg
26186fae4e5dSmrg# Old name:
26196fae4e5dSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
26206fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
26216fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
26229c9ff80cSmrg
26239c9ff80cSmrg
26246fae4e5dSmrg# LT_CMD_MAX_LEN
26256fae4e5dSmrg#---------------
26266fae4e5dSmrgAC_DEFUN([LT_CMD_MAX_LEN],
26276fae4e5dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
26286fae4e5dSmrg# find the maximum length of command line arguments
26296fae4e5dSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
26306fae4e5dSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
26316fae4e5dSmrg  i=0
26326fae4e5dSmrg  teststring="ABCD"
26339c9ff80cSmrg
26346fae4e5dSmrg  case $build_os in
26356fae4e5dSmrg  msdosdjgpp*)
26366fae4e5dSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
26376fae4e5dSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
26386fae4e5dSmrg    # during glob expansion).  Even if it were fixed, the result of this
26396fae4e5dSmrg    # check would be larger than it should be.
26406fae4e5dSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
26416fae4e5dSmrg    ;;
26429c9ff80cSmrg
26436fae4e5dSmrg  gnu*)
26446fae4e5dSmrg    # Under GNU Hurd, this test is not required because there is
26456fae4e5dSmrg    # no limit to the length of command line arguments.
26466fae4e5dSmrg    # Libtool will interpret -1 as no limit whatsoever
26476fae4e5dSmrg    lt_cv_sys_max_cmd_len=-1;
26486fae4e5dSmrg    ;;
26499c9ff80cSmrg
26506fae4e5dSmrg  cygwin* | mingw* | cegcc*)
26516fae4e5dSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
26526fae4e5dSmrg    # about 5 minutes as the teststring grows exponentially.
26536fae4e5dSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
26546fae4e5dSmrg    # you end up with a "frozen" computer, even though with patience
26556fae4e5dSmrg    # the test eventually succeeds (with a max line length of 256k).
26566fae4e5dSmrg    # Instead, let's just punt: use the minimum linelength reported by
26576fae4e5dSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
26586fae4e5dSmrg    lt_cv_sys_max_cmd_len=8192;
26596fae4e5dSmrg    ;;
26609c9ff80cSmrg
26616fae4e5dSmrg  mint*)
26626fae4e5dSmrg    # On MiNT this can take a long time and run out of memory.
26636fae4e5dSmrg    lt_cv_sys_max_cmd_len=8192;
26646fae4e5dSmrg    ;;
26659c9ff80cSmrg
26666fae4e5dSmrg  amigaos*)
26676fae4e5dSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
26686fae4e5dSmrg    # So we just punt and use a minimum line length of 8192.
26696fae4e5dSmrg    lt_cv_sys_max_cmd_len=8192;
26706fae4e5dSmrg    ;;
26719c9ff80cSmrg
26726fae4e5dSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
26736fae4e5dSmrg    # This has been around since 386BSD, at least.  Likely further.
26746fae4e5dSmrg    if test -x /sbin/sysctl; then
26756fae4e5dSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
26766fae4e5dSmrg    elif test -x /usr/sbin/sysctl; then
26776fae4e5dSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
26786fae4e5dSmrg    else
26796fae4e5dSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
26806fae4e5dSmrg    fi
26816fae4e5dSmrg    # And add a safety zone
26826fae4e5dSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
26836fae4e5dSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
26846fae4e5dSmrg    ;;
26859c9ff80cSmrg
26866fae4e5dSmrg  interix*)
26876fae4e5dSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
26886fae4e5dSmrg    lt_cv_sys_max_cmd_len=196608
26896fae4e5dSmrg    ;;
26909c9ff80cSmrg
269189c04b6cSmrg  os2*)
269289c04b6cSmrg    # The test takes a long time on OS/2.
269389c04b6cSmrg    lt_cv_sys_max_cmd_len=8192
269489c04b6cSmrg    ;;
269589c04b6cSmrg
26966fae4e5dSmrg  osf*)
26976fae4e5dSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
26986fae4e5dSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
26996fae4e5dSmrg    # nice to cause kernel panics so lets avoid the loop below.
27006fae4e5dSmrg    # First set a reasonable default.
27016fae4e5dSmrg    lt_cv_sys_max_cmd_len=16384
27026fae4e5dSmrg    #
27036fae4e5dSmrg    if test -x /sbin/sysconfig; then
27046fae4e5dSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
27056fae4e5dSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
27069c9ff80cSmrg      esac
27079c9ff80cSmrg    fi
27086fae4e5dSmrg    ;;
27096fae4e5dSmrg  sco3.2v5*)
27106fae4e5dSmrg    lt_cv_sys_max_cmd_len=102400
27116fae4e5dSmrg    ;;
27126fae4e5dSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
27136fae4e5dSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
27146fae4e5dSmrg    if test -n "$kargmax"; then
27156fae4e5dSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
27169c9ff80cSmrg    else
27176fae4e5dSmrg      lt_cv_sys_max_cmd_len=32768
27189c9ff80cSmrg    fi
27196fae4e5dSmrg    ;;
27206fae4e5dSmrg  *)
27216fae4e5dSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
27226fae4e5dSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
27236fae4e5dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
27246fae4e5dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
27259c9ff80cSmrg    else
27266fae4e5dSmrg      # Make teststring a little bigger before we do anything with it.
27276fae4e5dSmrg      # a 1K string should be a reasonable start.
27286fae4e5dSmrg      for i in 1 2 3 4 5 6 7 8 ; do
27296fae4e5dSmrg        teststring=$teststring$teststring
27306fae4e5dSmrg      done
27316fae4e5dSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
27326fae4e5dSmrg      # If test is not a shell built-in, we'll probably end up computing a
27336fae4e5dSmrg      # maximum length that is only half of the actual maximum length, but
27346fae4e5dSmrg      # we can't tell.
273589c04b6cSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
27366fae4e5dSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
27376fae4e5dSmrg	      test $i != 17 # 1/2 MB should be enough
27386fae4e5dSmrg      do
27396fae4e5dSmrg        i=`expr $i + 1`
27406fae4e5dSmrg        teststring=$teststring$teststring
27416fae4e5dSmrg      done
27426fae4e5dSmrg      # Only check the string length outside the loop.
27436fae4e5dSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
27446fae4e5dSmrg      teststring=
27456fae4e5dSmrg      # Add a significant safety factor because C++ compilers can tack on
27466fae4e5dSmrg      # massive amounts of additional arguments before passing them to the
27476fae4e5dSmrg      # linker.  It appears as though 1/2 is a usable value.
27486fae4e5dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
27499c9ff80cSmrg    fi
27509c9ff80cSmrg    ;;
27519c9ff80cSmrg  esac
27529c9ff80cSmrg])
27536fae4e5dSmrgif test -n $lt_cv_sys_max_cmd_len ; then
27546fae4e5dSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
27556fae4e5dSmrgelse
27566fae4e5dSmrg  AC_MSG_RESULT(none)
27576fae4e5dSmrgfi
27586fae4e5dSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
27596fae4e5dSmrg_LT_DECL([], [max_cmd_len], [0],
27606fae4e5dSmrg    [What is the maximum length of a command?])
27616fae4e5dSmrg])# LT_CMD_MAX_LEN
27629c9ff80cSmrg
27636fae4e5dSmrg# Old name:
27646fae4e5dSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
27656fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
27666fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
27679c9ff80cSmrg
27689c9ff80cSmrg
27696fae4e5dSmrg# _LT_HEADER_DLFCN
27706fae4e5dSmrg# ----------------
27716fae4e5dSmrgm4_defun([_LT_HEADER_DLFCN],
27726fae4e5dSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
27736fae4e5dSmrg])# _LT_HEADER_DLFCN
27749c9ff80cSmrg
27759c9ff80cSmrg
27766fae4e5dSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
27776fae4e5dSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
27786fae4e5dSmrg# ----------------------------------------------------------------
27796fae4e5dSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
27806fae4e5dSmrg[m4_require([_LT_HEADER_DLFCN])dnl
27816fae4e5dSmrgif test "$cross_compiling" = yes; then :
27826fae4e5dSmrg  [$4]
27836fae4e5dSmrgelse
27846fae4e5dSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
27856fae4e5dSmrg  lt_status=$lt_dlunknown
27866fae4e5dSmrg  cat > conftest.$ac_ext <<_LT_EOF
27876fae4e5dSmrg[#line $LINENO "configure"
27886fae4e5dSmrg#include "confdefs.h"
27891f0ac6a5Smrg
27906fae4e5dSmrg#if HAVE_DLFCN_H
27916fae4e5dSmrg#include <dlfcn.h>
27926fae4e5dSmrg#endif
27931f0ac6a5Smrg
27946fae4e5dSmrg#include <stdio.h>
27951f0ac6a5Smrg
27966fae4e5dSmrg#ifdef RTLD_GLOBAL
27976fae4e5dSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
27986fae4e5dSmrg#else
27996fae4e5dSmrg#  ifdef DL_GLOBAL
28006fae4e5dSmrg#    define LT_DLGLOBAL		DL_GLOBAL
28016fae4e5dSmrg#  else
28026fae4e5dSmrg#    define LT_DLGLOBAL		0
28036fae4e5dSmrg#  endif
28046fae4e5dSmrg#endif
28051f0ac6a5Smrg
28066fae4e5dSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
28076fae4e5dSmrg   find out it does not work in some platform. */
28086fae4e5dSmrg#ifndef LT_DLLAZY_OR_NOW
28096fae4e5dSmrg#  ifdef RTLD_LAZY
28106fae4e5dSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
28116fae4e5dSmrg#  else
28126fae4e5dSmrg#    ifdef DL_LAZY
28136fae4e5dSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
28146fae4e5dSmrg#    else
28156fae4e5dSmrg#      ifdef RTLD_NOW
28166fae4e5dSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
28176fae4e5dSmrg#      else
28186fae4e5dSmrg#        ifdef DL_NOW
28196fae4e5dSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
28206fae4e5dSmrg#        else
28216fae4e5dSmrg#          define LT_DLLAZY_OR_NOW	0
28226fae4e5dSmrg#        endif
28236fae4e5dSmrg#      endif
28246fae4e5dSmrg#    endif
28256fae4e5dSmrg#  endif
28266fae4e5dSmrg#endif
28276fae4e5dSmrg
28286fae4e5dSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
28296fae4e5dSmrg   correspondingly for the symbols needed.  */
28306fae4e5dSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
28316fae4e5dSmrgint fnord () __attribute__((visibility("default")));
28326fae4e5dSmrg#endif
28336fae4e5dSmrg
28346fae4e5dSmrgint fnord () { return 42; }
28356fae4e5dSmrgint main ()
28366fae4e5dSmrg{
28376fae4e5dSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
28386fae4e5dSmrg  int status = $lt_dlunknown;
28396fae4e5dSmrg
28406fae4e5dSmrg  if (self)
28416fae4e5dSmrg    {
28426fae4e5dSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
28436fae4e5dSmrg      else
28446fae4e5dSmrg        {
28456fae4e5dSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
28466fae4e5dSmrg          else puts (dlerror ());
28476fae4e5dSmrg	}
28486fae4e5dSmrg      /* dlclose (self); */
28496fae4e5dSmrg    }
28506fae4e5dSmrg  else
28516fae4e5dSmrg    puts (dlerror ());
28526fae4e5dSmrg
28536fae4e5dSmrg  return status;
28546fae4e5dSmrg}]
28559c9ff80cSmrg_LT_EOF
28566fae4e5dSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
28576fae4e5dSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
28586fae4e5dSmrg    lt_status=$?
28596fae4e5dSmrg    case x$lt_status in
28606fae4e5dSmrg      x$lt_dlno_uscore) $1 ;;
28616fae4e5dSmrg      x$lt_dlneed_uscore) $2 ;;
28626fae4e5dSmrg      x$lt_dlunknown|x*) $3 ;;
28636fae4e5dSmrg    esac
28646fae4e5dSmrg  else :
28656fae4e5dSmrg    # compilation failed
28666fae4e5dSmrg    $3
28676fae4e5dSmrg  fi
28681f0ac6a5Smrgfi
28696fae4e5dSmrgrm -fr conftest*
28706fae4e5dSmrg])# _LT_TRY_DLOPEN_SELF
28711f0ac6a5Smrg
28721f0ac6a5Smrg
28736fae4e5dSmrg# LT_SYS_DLOPEN_SELF
28746fae4e5dSmrg# ------------------
28756fae4e5dSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
28766fae4e5dSmrg[m4_require([_LT_HEADER_DLFCN])dnl
28776fae4e5dSmrgif test "x$enable_dlopen" != xyes; then
28786fae4e5dSmrg  enable_dlopen=unknown
28796fae4e5dSmrg  enable_dlopen_self=unknown
28806fae4e5dSmrg  enable_dlopen_self_static=unknown
28816fae4e5dSmrgelse
28826fae4e5dSmrg  lt_cv_dlopen=no
28836fae4e5dSmrg  lt_cv_dlopen_libs=
28841f0ac6a5Smrg
28856fae4e5dSmrg  case $host_os in
28866fae4e5dSmrg  beos*)
28876fae4e5dSmrg    lt_cv_dlopen="load_add_on"
28886fae4e5dSmrg    lt_cv_dlopen_libs=
28896fae4e5dSmrg    lt_cv_dlopen_self=yes
28906fae4e5dSmrg    ;;
28919c9ff80cSmrg
28926fae4e5dSmrg  mingw* | pw32* | cegcc*)
28936fae4e5dSmrg    lt_cv_dlopen="LoadLibrary"
28946fae4e5dSmrg    lt_cv_dlopen_libs=
28956fae4e5dSmrg    ;;
28961f0ac6a5Smrg
28976fae4e5dSmrg  cygwin*)
28986fae4e5dSmrg    lt_cv_dlopen="dlopen"
28996fae4e5dSmrg    lt_cv_dlopen_libs=
29006fae4e5dSmrg    ;;
29011f0ac6a5Smrg
29026fae4e5dSmrg  darwin*)
29036fae4e5dSmrg  # if libdl is installed we need to link against it
29046fae4e5dSmrg    AC_CHECK_LIB([dl], [dlopen],
29056fae4e5dSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
29066fae4e5dSmrg    lt_cv_dlopen="dyld"
29076fae4e5dSmrg    lt_cv_dlopen_libs=
29086fae4e5dSmrg    lt_cv_dlopen_self=yes
29096fae4e5dSmrg    ])
29106fae4e5dSmrg    ;;
29111f0ac6a5Smrg
29126fae4e5dSmrg  *)
29136fae4e5dSmrg    AC_CHECK_FUNC([shl_load],
29146fae4e5dSmrg	  [lt_cv_dlopen="shl_load"],
29156fae4e5dSmrg      [AC_CHECK_LIB([dld], [shl_load],
29166fae4e5dSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
29176fae4e5dSmrg	[AC_CHECK_FUNC([dlopen],
29186fae4e5dSmrg	      [lt_cv_dlopen="dlopen"],
29196fae4e5dSmrg	  [AC_CHECK_LIB([dl], [dlopen],
29206fae4e5dSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
29216fae4e5dSmrg	    [AC_CHECK_LIB([svld], [dlopen],
29226fae4e5dSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
29236fae4e5dSmrg	      [AC_CHECK_LIB([dld], [dld_link],
29246fae4e5dSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
29256fae4e5dSmrg	      ])
29266fae4e5dSmrg	    ])
29276fae4e5dSmrg	  ])
29286fae4e5dSmrg	])
29296fae4e5dSmrg      ])
29306fae4e5dSmrg    ;;
29316fae4e5dSmrg  esac
29326fae4e5dSmrg
29336fae4e5dSmrg  if test "x$lt_cv_dlopen" != xno; then
29346fae4e5dSmrg    enable_dlopen=yes
29356fae4e5dSmrg  else
29366fae4e5dSmrg    enable_dlopen=no
29371f0ac6a5Smrg  fi
29381f0ac6a5Smrg
29396fae4e5dSmrg  case $lt_cv_dlopen in
29406fae4e5dSmrg  dlopen)
29416fae4e5dSmrg    save_CPPFLAGS="$CPPFLAGS"
29426fae4e5dSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
29431f0ac6a5Smrg
29446fae4e5dSmrg    save_LDFLAGS="$LDFLAGS"
29456fae4e5dSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
29461f0ac6a5Smrg
29476fae4e5dSmrg    save_LIBS="$LIBS"
29486fae4e5dSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
29491f0ac6a5Smrg
29506fae4e5dSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
29516fae4e5dSmrg	  lt_cv_dlopen_self, [dnl
29526fae4e5dSmrg	  _LT_TRY_DLOPEN_SELF(
29536fae4e5dSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
29546fae4e5dSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
29556fae4e5dSmrg    ])
29561f0ac6a5Smrg
29576fae4e5dSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
29586fae4e5dSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
29596fae4e5dSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
29606fae4e5dSmrg	  lt_cv_dlopen_self_static, [dnl
29616fae4e5dSmrg	  _LT_TRY_DLOPEN_SELF(
29626fae4e5dSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
29636fae4e5dSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
29646fae4e5dSmrg      ])
29659c9ff80cSmrg    fi
29661f0ac6a5Smrg
29676fae4e5dSmrg    CPPFLAGS="$save_CPPFLAGS"
29686fae4e5dSmrg    LDFLAGS="$save_LDFLAGS"
29696fae4e5dSmrg    LIBS="$save_LIBS"
29706fae4e5dSmrg    ;;
29716fae4e5dSmrg  esac
29729c9ff80cSmrg
29736fae4e5dSmrg  case $lt_cv_dlopen_self in
29746fae4e5dSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
29756fae4e5dSmrg  *) enable_dlopen_self=unknown ;;
29766fae4e5dSmrg  esac
29771f0ac6a5Smrg
29786fae4e5dSmrg  case $lt_cv_dlopen_self_static in
29796fae4e5dSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
29806fae4e5dSmrg  *) enable_dlopen_self_static=unknown ;;
29819c9ff80cSmrg  esac
29829c9ff80cSmrgfi
29836fae4e5dSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
29846fae4e5dSmrg	 [Whether dlopen is supported])
29856fae4e5dSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
29866fae4e5dSmrg	 [Whether dlopen of programs is supported])
29876fae4e5dSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
29886fae4e5dSmrg	 [Whether dlopen of statically linked programs is supported])
29896fae4e5dSmrg])# LT_SYS_DLOPEN_SELF
29906fae4e5dSmrg
29916fae4e5dSmrg# Old name:
29926fae4e5dSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
29936fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
29946fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
29951f0ac6a5Smrg
29961f0ac6a5Smrg
29976fae4e5dSmrg# _LT_COMPILER_C_O([TAGNAME])
29986fae4e5dSmrg# ---------------------------
29996fae4e5dSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
30006fae4e5dSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
30016fae4e5dSmrgm4_defun([_LT_COMPILER_C_O],
30026fae4e5dSmrg[m4_require([_LT_DECL_SED])dnl
30036fae4e5dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
30046fae4e5dSmrgm4_require([_LT_TAG_COMPILER])dnl
30056fae4e5dSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
30066fae4e5dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
30076fae4e5dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
30086fae4e5dSmrg   $RM -r conftest 2>/dev/null
30096fae4e5dSmrg   mkdir conftest
30106fae4e5dSmrg   cd conftest
30116fae4e5dSmrg   mkdir out
3012e5410a46Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
30136fae4e5dSmrg
30146fae4e5dSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
30151f0ac6a5Smrg   # Insert the option either (1) after the last *FLAGS variable, or
30161f0ac6a5Smrg   # (2) before a word containing "conftest.", or (3) at the end.
30171f0ac6a5Smrg   # Note that $ac_compile itself does not contain backslashes and begins
30181f0ac6a5Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
30191f0ac6a5Smrg   lt_compile=`echo "$ac_compile" | $SED \
30201f0ac6a5Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
30211f0ac6a5Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
30221f0ac6a5Smrg   -e 's:$: $lt_compiler_flag:'`
30236fae4e5dSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
30246fae4e5dSmrg   (eval "$lt_compile" 2>out/conftest.err)
30251f0ac6a5Smrg   ac_status=$?
30266fae4e5dSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
30276fae4e5dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
30286fae4e5dSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
30296fae4e5dSmrg   then
30301f0ac6a5Smrg     # The compiler can only warn and ignore the option if not recognized
30316fae4e5dSmrg     # So say no if there are warnings
30326fae4e5dSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
30336fae4e5dSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
30346fae4e5dSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
30356fae4e5dSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
30361f0ac6a5Smrg     fi
30371f0ac6a5Smrg   fi
30386fae4e5dSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
30396fae4e5dSmrg   $RM conftest*
30406fae4e5dSmrg   # SGI C++ compiler will create directory out/ii_files/ for
30416fae4e5dSmrg   # template instantiation
30426fae4e5dSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
30436fae4e5dSmrg   $RM out/* && rmdir out
30446fae4e5dSmrg   cd ..
30456fae4e5dSmrg   $RM -r conftest
30469c9ff80cSmrg   $RM conftest*
30471f0ac6a5Smrg])
30486fae4e5dSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
30496fae4e5dSmrg	[Does compiler simultaneously support -c and -o options?])
30506fae4e5dSmrg])# _LT_COMPILER_C_O
30511f0ac6a5Smrg
30529c9ff80cSmrg
30536fae4e5dSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
30546fae4e5dSmrg# ----------------------------------
30556fae4e5dSmrg# Check to see if we can do hard links to lock some files if needed
30566fae4e5dSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
30576fae4e5dSmrg[m4_require([_LT_ENABLE_LOCK])dnl
30586fae4e5dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
30596fae4e5dSmrg_LT_COMPILER_C_O([$1])
30601f0ac6a5Smrg
30616fae4e5dSmrghard_links="nottested"
30626fae4e5dSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
30636fae4e5dSmrg  # do not overwrite the value of need_locks provided by the user
30646fae4e5dSmrg  AC_MSG_CHECKING([if we can lock with hard links])
30656fae4e5dSmrg  hard_links=yes
30666fae4e5dSmrg  $RM conftest*
30676fae4e5dSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
30686fae4e5dSmrg  touch conftest.a
30696fae4e5dSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
30706fae4e5dSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
30716fae4e5dSmrg  AC_MSG_RESULT([$hard_links])
30726fae4e5dSmrg  if test "$hard_links" = no; then
30736fae4e5dSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
30746fae4e5dSmrg    need_locks=warn
30756fae4e5dSmrg  fi
30761f0ac6a5Smrgelse
30776fae4e5dSmrg  need_locks=no
30781f0ac6a5Smrgfi
30796fae4e5dSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
30806fae4e5dSmrg])# _LT_COMPILER_FILE_LOCKS
30811f0ac6a5Smrg
30821f0ac6a5Smrg
30836fae4e5dSmrg# _LT_CHECK_OBJDIR
30846fae4e5dSmrg# ----------------
30856fae4e5dSmrgm4_defun([_LT_CHECK_OBJDIR],
30866fae4e5dSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
30876fae4e5dSmrg[rm -f .libs 2>/dev/null
30886fae4e5dSmrgmkdir .libs 2>/dev/null
30896fae4e5dSmrgif test -d .libs; then
30906fae4e5dSmrg  lt_cv_objdir=.libs
30916fae4e5dSmrgelse
30926fae4e5dSmrg  # MS-DOS does not allow filenames that begin with a dot.
30936fae4e5dSmrg  lt_cv_objdir=_libs
30946fae4e5dSmrgfi
30956fae4e5dSmrgrmdir .libs 2>/dev/null])
30966fae4e5dSmrgobjdir=$lt_cv_objdir
30976fae4e5dSmrg_LT_DECL([], [objdir], [0],
30986fae4e5dSmrg         [The name of the directory that contains temporary libtool files])dnl
30996fae4e5dSmrgm4_pattern_allow([LT_OBJDIR])dnl
31006fae4e5dSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
31016fae4e5dSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
31026fae4e5dSmrg])# _LT_CHECK_OBJDIR
31039c9ff80cSmrg
31041f0ac6a5Smrg
31056fae4e5dSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
31066fae4e5dSmrg# --------------------------------------
31076fae4e5dSmrg# Check hardcoding attributes.
31086fae4e5dSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
31096fae4e5dSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
31106fae4e5dSmrg_LT_TAGVAR(hardcode_action, $1)=
31116fae4e5dSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
31126fae4e5dSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
31136fae4e5dSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
31141f0ac6a5Smrg
31156fae4e5dSmrg  # We can hardcode non-existent directories.
31166fae4e5dSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
31176fae4e5dSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
31186fae4e5dSmrg     # have to relink, otherwise we might link with an installed library
31196fae4e5dSmrg     # when we should be linking with a yet-to-be-installed one
31206fae4e5dSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
31216fae4e5dSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
31226fae4e5dSmrg    # Linking always hardcodes the temporary library directory.
31236fae4e5dSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
31246fae4e5dSmrg  else
31256fae4e5dSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
31266fae4e5dSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
31276fae4e5dSmrg  fi
31286fae4e5dSmrgelse
31296fae4e5dSmrg  # We cannot hardcode anything, or else we can only hardcode existing
31306fae4e5dSmrg  # directories.
31316fae4e5dSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
31326fae4e5dSmrgfi
31336fae4e5dSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
31341f0ac6a5Smrg
31356fae4e5dSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
31366fae4e5dSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
31376fae4e5dSmrg  # Fast installation is not supported
31386fae4e5dSmrg  enable_fast_install=no
31396fae4e5dSmrgelif test "$shlibpath_overrides_runpath" = yes ||
31406fae4e5dSmrg     test "$enable_shared" = no; then
31416fae4e5dSmrg  # Fast installation is not necessary
31426fae4e5dSmrg  enable_fast_install=needless
31436fae4e5dSmrgfi
31446fae4e5dSmrg_LT_TAGDECL([], [hardcode_action], [0],
31456fae4e5dSmrg    [How to hardcode a shared library path into an executable])
31466fae4e5dSmrg])# _LT_LINKER_HARDCODE_LIBPATH
31471f0ac6a5Smrg
31481f0ac6a5Smrg
31496fae4e5dSmrg# _LT_CMD_STRIPLIB
31506fae4e5dSmrg# ----------------
31516fae4e5dSmrgm4_defun([_LT_CMD_STRIPLIB],
31526fae4e5dSmrg[m4_require([_LT_DECL_EGREP])
31536fae4e5dSmrgstriplib=
31546fae4e5dSmrgold_striplib=
31556fae4e5dSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
31566fae4e5dSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
31576fae4e5dSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
31586fae4e5dSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
31596fae4e5dSmrg  AC_MSG_RESULT([yes])
31606fae4e5dSmrgelse
31616fae4e5dSmrg# FIXME - insert some real tests, host_os isn't really good enough
31626fae4e5dSmrg  case $host_os in
31636fae4e5dSmrg  darwin*)
31646fae4e5dSmrg    if test -n "$STRIP" ; then
31656fae4e5dSmrg      striplib="$STRIP -x"
31666fae4e5dSmrg      old_striplib="$STRIP -S"
31676fae4e5dSmrg      AC_MSG_RESULT([yes])
31681f0ac6a5Smrg    else
31696fae4e5dSmrg      AC_MSG_RESULT([no])
31701f0ac6a5Smrg    fi
31711f0ac6a5Smrg    ;;
31726fae4e5dSmrg  *)
31736fae4e5dSmrg    AC_MSG_RESULT([no])
31741f0ac6a5Smrg    ;;
31756fae4e5dSmrg  esac
31766fae4e5dSmrgfi
31776fae4e5dSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
31786fae4e5dSmrg_LT_DECL([], [striplib], [1])
31796fae4e5dSmrg])# _LT_CMD_STRIPLIB
31801f0ac6a5Smrg
31816fae4e5dSmrg
31826fae4e5dSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
31836fae4e5dSmrg# -----------------------------
31846fae4e5dSmrg# PORTME Fill in your ld.so characteristics
31856fae4e5dSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
31866fae4e5dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
31876fae4e5dSmrgm4_require([_LT_DECL_EGREP])dnl
31886fae4e5dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
31896fae4e5dSmrgm4_require([_LT_DECL_OBJDUMP])dnl
31906fae4e5dSmrgm4_require([_LT_DECL_SED])dnl
31916fae4e5dSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
31926fae4e5dSmrgAC_MSG_CHECKING([dynamic linker characteristics])
31936fae4e5dSmrgm4_if([$1],
31946fae4e5dSmrg	[], [
31956fae4e5dSmrgif test "$GCC" = yes; then
31966fae4e5dSmrg  case $host_os in
31976fae4e5dSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
31986fae4e5dSmrg    *) lt_awk_arg="/^libraries:/" ;;
31996fae4e5dSmrg  esac
32006fae4e5dSmrg  case $host_os in
32016fae4e5dSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
32026fae4e5dSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
32036fae4e5dSmrg  esac
32046fae4e5dSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
32056fae4e5dSmrg  case $lt_search_path_spec in
32066fae4e5dSmrg  *\;*)
32076fae4e5dSmrg    # if the path contains ";" then we assume it to be the separator
32086fae4e5dSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
32096fae4e5dSmrg    # assumed that no part of a normal pathname contains ";" but that should
32106fae4e5dSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
32116fae4e5dSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
32121f0ac6a5Smrg    ;;
32131f0ac6a5Smrg  *)
32146fae4e5dSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
32156fae4e5dSmrg    ;;
32166fae4e5dSmrg  esac
32176fae4e5dSmrg  # Ok, now we have the path, separated by spaces, we can step through it
32186fae4e5dSmrg  # and add multilib dir if necessary.
32196fae4e5dSmrg  lt_tmp_lt_search_path_spec=
32206fae4e5dSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
32216fae4e5dSmrg  for lt_sys_path in $lt_search_path_spec; do
32226fae4e5dSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
32236fae4e5dSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3224e5410a46Smrg    else
32256fae4e5dSmrg      test -d "$lt_sys_path" && \
32266fae4e5dSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3227e5410a46Smrg    fi
32286fae4e5dSmrg  done
32296fae4e5dSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
32306fae4e5dSmrgBEGIN {RS=" "; FS="/|\n";} {
32316fae4e5dSmrg  lt_foo="";
32326fae4e5dSmrg  lt_count=0;
32336fae4e5dSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
32346fae4e5dSmrg    if ($lt_i != "" && $lt_i != ".") {
32356fae4e5dSmrg      if ($lt_i == "..") {
32366fae4e5dSmrg        lt_count++;
32376fae4e5dSmrg      } else {
32386fae4e5dSmrg        if (lt_count == 0) {
32396fae4e5dSmrg          lt_foo="/" $lt_i lt_foo;
32406fae4e5dSmrg        } else {
32416fae4e5dSmrg          lt_count--;
32426fae4e5dSmrg        }
32436fae4e5dSmrg      }
32446fae4e5dSmrg    }
32456fae4e5dSmrg  }
32466fae4e5dSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
32476fae4e5dSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
32486fae4e5dSmrg}'`
32496fae4e5dSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
32506fae4e5dSmrg  # for these hosts.
32516fae4e5dSmrg  case $host_os in
32526fae4e5dSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
32536fae4e5dSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
32541f0ac6a5Smrg  esac
32556fae4e5dSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
32561f0ac6a5Smrgelse
32576fae4e5dSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
32586fae4e5dSmrgfi])
32596fae4e5dSmrglibrary_names_spec=
32606fae4e5dSmrglibname_spec='lib$name'
32616fae4e5dSmrgsoname_spec=
32626fae4e5dSmrgshrext_cmds=".so"
32636fae4e5dSmrgpostinstall_cmds=
32646fae4e5dSmrgpostuninstall_cmds=
32656fae4e5dSmrgfinish_cmds=
32666fae4e5dSmrgfinish_eval=
32676fae4e5dSmrgshlibpath_var=
32686fae4e5dSmrgshlibpath_overrides_runpath=unknown
32696fae4e5dSmrgversion_type=none
32706fae4e5dSmrgdynamic_linker="$host_os ld.so"
32716fae4e5dSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
32726fae4e5dSmrgneed_lib_prefix=unknown
32736fae4e5dSmrghardcode_into_libs=no
32741f0ac6a5Smrg
32756fae4e5dSmrg# when you set need_version to no, make sure it does not cause -set_version
32766fae4e5dSmrg# flags to be left without arguments
32776fae4e5dSmrgneed_version=unknown
32781f0ac6a5Smrg
32796fae4e5dSmrgcase $host_os in
32806fae4e5dSmrgaix3*)
328189c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
32826fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
32836fae4e5dSmrg  shlibpath_var=LIBPATH
32841f0ac6a5Smrg
32856fae4e5dSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
32866fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
32876fae4e5dSmrg  ;;
32881f0ac6a5Smrg
32896fae4e5dSmrgaix[[4-9]]*)
329089c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
32916fae4e5dSmrg  need_lib_prefix=no
32926fae4e5dSmrg  need_version=no
32936fae4e5dSmrg  hardcode_into_libs=yes
32946fae4e5dSmrg  if test "$host_cpu" = ia64; then
32956fae4e5dSmrg    # AIX 5 supports IA64
32966fae4e5dSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
32976fae4e5dSmrg    shlibpath_var=LD_LIBRARY_PATH
32981f0ac6a5Smrg  else
32996fae4e5dSmrg    # With GCC up to 2.95.x, collect2 would create an import file
33006fae4e5dSmrg    # for dependence libraries.  The import file would start with
33016fae4e5dSmrg    # the line `#! .'.  This would cause the generated library to
33026fae4e5dSmrg    # depend on `.', always an invalid library.  This was fixed in
33036fae4e5dSmrg    # development snapshots of GCC prior to 3.0.
33046fae4e5dSmrg    case $host_os in
33056fae4e5dSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
33066fae4e5dSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
33076fae4e5dSmrg	   echo ' yes '
33086fae4e5dSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
33096fae4e5dSmrg	:
33106fae4e5dSmrg      else
33116fae4e5dSmrg	can_build_shared=no
33126fae4e5dSmrg      fi
33136fae4e5dSmrg      ;;
33141f0ac6a5Smrg    esac
33156fae4e5dSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
33166fae4e5dSmrg    # soname into executable. Probably we can add versioning support to
33176fae4e5dSmrg    # collect2, so additional links can be useful in future.
33186fae4e5dSmrg    if test "$aix_use_runtimelinking" = yes; then
33196fae4e5dSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
33206fae4e5dSmrg      # instead of lib<name>.a to let people know that these are not
33216fae4e5dSmrg      # typical AIX shared libraries.
33226fae4e5dSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
33236fae4e5dSmrg    else
33246fae4e5dSmrg      # We preserve .a as extension for shared libraries through AIX4.2
33256fae4e5dSmrg      # and later when we are not doing run time linking.
33266fae4e5dSmrg      library_names_spec='${libname}${release}.a $libname.a'
33276fae4e5dSmrg      soname_spec='${libname}${release}${shared_ext}$major'
33286fae4e5dSmrg    fi
33296fae4e5dSmrg    shlibpath_var=LIBPATH
33301f0ac6a5Smrg  fi
33316fae4e5dSmrg  ;;
33321f0ac6a5Smrg
33336fae4e5dSmrgamigaos*)
33346fae4e5dSmrg  case $host_cpu in
33356fae4e5dSmrg  powerpc)
33366fae4e5dSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
33376fae4e5dSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
33386fae4e5dSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
33396fae4e5dSmrg    ;;
33406fae4e5dSmrg  m68k)
33416fae4e5dSmrg    library_names_spec='$libname.ixlibrary $libname.a'
33426fae4e5dSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
33436fae4e5dSmrg    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'
33446fae4e5dSmrg    ;;
33456fae4e5dSmrg  esac
33466fae4e5dSmrg  ;;
33471f0ac6a5Smrg
33486fae4e5dSmrgbeos*)
33496fae4e5dSmrg  library_names_spec='${libname}${shared_ext}'
33506fae4e5dSmrg  dynamic_linker="$host_os ld.so"
33516fae4e5dSmrg  shlibpath_var=LIBRARY_PATH
33526fae4e5dSmrg  ;;
33531f0ac6a5Smrg
33546fae4e5dSmrgbsdi[[45]]*)
335589c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
33566fae4e5dSmrg  need_version=no
33576fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
33586fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
33596fae4e5dSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
33606fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
33616fae4e5dSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
33626fae4e5dSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
33636fae4e5dSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
33646fae4e5dSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
33656fae4e5dSmrg  # libtool to hard-code these into programs
33666fae4e5dSmrg  ;;
33671f0ac6a5Smrg
33686fae4e5dSmrgcygwin* | mingw* | pw32* | cegcc*)
33696fae4e5dSmrg  version_type=windows
33706fae4e5dSmrg  shrext_cmds=".dll"
33716fae4e5dSmrg  need_version=no
33726fae4e5dSmrg  need_lib_prefix=no
33731f0ac6a5Smrg
33746fae4e5dSmrg  case $GCC,$cc_basename in
33756fae4e5dSmrg  yes,*)
33766fae4e5dSmrg    # gcc
33776fae4e5dSmrg    library_names_spec='$libname.dll.a'
33786fae4e5dSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
33796fae4e5dSmrg    postinstall_cmds='base_file=`basename \${file}`~
33806fae4e5dSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
33816fae4e5dSmrg      dldir=$destdir/`dirname \$dlpath`~
33826fae4e5dSmrg      test -d \$dldir || mkdir -p \$dldir~
33836fae4e5dSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
33846fae4e5dSmrg      chmod a+x \$dldir/$dlname~
33856fae4e5dSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
33866fae4e5dSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
33876fae4e5dSmrg      fi'
33886fae4e5dSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
33896fae4e5dSmrg      dlpath=$dir/\$dldll~
33906fae4e5dSmrg       $RM \$dlpath'
33916fae4e5dSmrg    shlibpath_overrides_runpath=yes
33921f0ac6a5Smrg
33936fae4e5dSmrg    case $host_os in
33946fae4e5dSmrg    cygwin*)
33956fae4e5dSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
33966fae4e5dSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
33976fae4e5dSmrgm4_if([$1], [],[
33986fae4e5dSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
33996fae4e5dSmrg      ;;
34006fae4e5dSmrg    mingw* | cegcc*)
34016fae4e5dSmrg      # MinGW DLLs use traditional 'lib' prefix
34026fae4e5dSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34036fae4e5dSmrg      ;;
34046fae4e5dSmrg    pw32*)
34056fae4e5dSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
34066fae4e5dSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34076fae4e5dSmrg      ;;
34086fae4e5dSmrg    esac
34096fae4e5dSmrg    dynamic_linker='Win32 ld.exe'
34106fae4e5dSmrg    ;;
34116fae4e5dSmrg
34126fae4e5dSmrg  *,cl*)
34136fae4e5dSmrg    # Native MSVC
34146fae4e5dSmrg    libname_spec='$name'
34156fae4e5dSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34166fae4e5dSmrg    library_names_spec='${libname}.dll.lib'
34176fae4e5dSmrg
34186fae4e5dSmrg    case $build_os in
34196fae4e5dSmrg    mingw*)
34206fae4e5dSmrg      sys_lib_search_path_spec=
34216fae4e5dSmrg      lt_save_ifs=$IFS
34226fae4e5dSmrg      IFS=';'
34236fae4e5dSmrg      for lt_path in $LIB
34246fae4e5dSmrg      do
34256fae4e5dSmrg        IFS=$lt_save_ifs
34266fae4e5dSmrg        # Let DOS variable expansion print the short 8.3 style file name.
34276fae4e5dSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
34286fae4e5dSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
34296fae4e5dSmrg      done
34306fae4e5dSmrg      IFS=$lt_save_ifs
34316fae4e5dSmrg      # Convert to MSYS style.
34326fae4e5dSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
34336fae4e5dSmrg      ;;
34346fae4e5dSmrg    cygwin*)
34356fae4e5dSmrg      # Convert to unix form, then to dos form, then back to unix form
34366fae4e5dSmrg      # but this time dos style (no spaces!) so that the unix form looks
34376fae4e5dSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
34386fae4e5dSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
34396fae4e5dSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
34406fae4e5dSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
34416fae4e5dSmrg      ;;
34426fae4e5dSmrg    *)
34436fae4e5dSmrg      sys_lib_search_path_spec="$LIB"
34446fae4e5dSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
34456fae4e5dSmrg        # It is most probably a Windows format PATH.
34466fae4e5dSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
34476fae4e5dSmrg      else
34486fae4e5dSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
34496fae4e5dSmrg      fi
34506fae4e5dSmrg      # FIXME: find the short name or the path components, as spaces are
34516fae4e5dSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
34526fae4e5dSmrg      ;;
34536fae4e5dSmrg    esac
34546fae4e5dSmrg
34556fae4e5dSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
34566fae4e5dSmrg    postinstall_cmds='base_file=`basename \${file}`~
34576fae4e5dSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
34586fae4e5dSmrg      dldir=$destdir/`dirname \$dlpath`~
34596fae4e5dSmrg      test -d \$dldir || mkdir -p \$dldir~
34606fae4e5dSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
34616fae4e5dSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
34626fae4e5dSmrg      dlpath=$dir/\$dldll~
34636fae4e5dSmrg       $RM \$dlpath'
34646fae4e5dSmrg    shlibpath_overrides_runpath=yes
34656fae4e5dSmrg    dynamic_linker='Win32 link.exe'
34669c9ff80cSmrg    ;;
34671f0ac6a5Smrg
34681f0ac6a5Smrg  *)
34696fae4e5dSmrg    # Assume MSVC wrapper
34706fae4e5dSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
34716fae4e5dSmrg    dynamic_linker='Win32 ld.exe'
34721f0ac6a5Smrg    ;;
34731f0ac6a5Smrg  esac
34746fae4e5dSmrg  # FIXME: first we should search . and the directory the executable is in
34756fae4e5dSmrg  shlibpath_var=PATH
34766fae4e5dSmrg  ;;
34771f0ac6a5Smrg
34786fae4e5dSmrgdarwin* | rhapsody*)
34796fae4e5dSmrg  dynamic_linker="$host_os dyld"
34806fae4e5dSmrg  version_type=darwin
34816fae4e5dSmrg  need_lib_prefix=no
34826fae4e5dSmrg  need_version=no
34836fae4e5dSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
34846fae4e5dSmrg  soname_spec='${libname}${release}${major}$shared_ext'
34856fae4e5dSmrg  shlibpath_overrides_runpath=yes
34866fae4e5dSmrg  shlibpath_var=DYLD_LIBRARY_PATH
34876fae4e5dSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
34886fae4e5dSmrgm4_if([$1], [],[
34896fae4e5dSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
34906fae4e5dSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
34916fae4e5dSmrg  ;;
34921f0ac6a5Smrg
34936fae4e5dSmrgdgux*)
349489c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
34956fae4e5dSmrg  need_lib_prefix=no
34966fae4e5dSmrg  need_version=no
34976fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
349889c04b6cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
349989c04b6cSmrg  shlibpath_var=LD_LIBRARY_PATH
35006fae4e5dSmrg  ;;
35011f0ac6a5Smrg
35026fae4e5dSmrgfreebsd* | dragonfly*)
35036fae4e5dSmrg  # DragonFly does not have aout.  When/if they implement a new
35046fae4e5dSmrg  # versioning mechanism, adjust this.
35056fae4e5dSmrg  if test -x /usr/bin/objformat; then
35066fae4e5dSmrg    objformat=`/usr/bin/objformat`
35076fae4e5dSmrg  else
35086fae4e5dSmrg    case $host_os in
350989c04b6cSmrg    freebsd[[23]].*) objformat=aout ;;
35106fae4e5dSmrg    *) objformat=elf ;;
35116fae4e5dSmrg    esac
35126fae4e5dSmrg  fi
35136fae4e5dSmrg  version_type=freebsd-$objformat
35146fae4e5dSmrg  case $version_type in
35156fae4e5dSmrg    freebsd-elf*)
35166fae4e5dSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
35176fae4e5dSmrg      need_version=no
35186fae4e5dSmrg      need_lib_prefix=no
35196fae4e5dSmrg      ;;
35206fae4e5dSmrg    freebsd-*)
35216fae4e5dSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
35226fae4e5dSmrg      need_version=yes
35236fae4e5dSmrg      ;;
35246fae4e5dSmrg  esac
35256fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
35266fae4e5dSmrg  case $host_os in
352789c04b6cSmrg  freebsd2.*)
35286fae4e5dSmrg    shlibpath_overrides_runpath=yes
35296fae4e5dSmrg    ;;
35306fae4e5dSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
35316fae4e5dSmrg    shlibpath_overrides_runpath=yes
35326fae4e5dSmrg    hardcode_into_libs=yes
35336fae4e5dSmrg    ;;
35346fae4e5dSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
35356fae4e5dSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
35366fae4e5dSmrg    shlibpath_overrides_runpath=no
35376fae4e5dSmrg    hardcode_into_libs=yes
35386fae4e5dSmrg    ;;
35396fae4e5dSmrg  *) # from 4.6 on, and DragonFly
35406fae4e5dSmrg    shlibpath_overrides_runpath=yes
35416fae4e5dSmrg    hardcode_into_libs=yes
35426fae4e5dSmrg    ;;
35436fae4e5dSmrg  esac
35446fae4e5dSmrg  ;;
35451f0ac6a5Smrg
35466fae4e5dSmrggnu*)
354789c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
35486fae4e5dSmrg  need_lib_prefix=no
35496fae4e5dSmrg  need_version=no
35506fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
35516fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
35526fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
355389c04b6cSmrg  shlibpath_overrides_runpath=no
35546fae4e5dSmrg  hardcode_into_libs=yes
35556fae4e5dSmrg  ;;
35561f0ac6a5Smrg
35576fae4e5dSmrghaiku*)
355889c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
35596fae4e5dSmrg  need_lib_prefix=no
35606fae4e5dSmrg  need_version=no
35616fae4e5dSmrg  dynamic_linker="$host_os runtime_loader"
35626fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
35636fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
35646fae4e5dSmrg  shlibpath_var=LIBRARY_PATH
35656fae4e5dSmrg  shlibpath_overrides_runpath=yes
35666fae4e5dSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
35676fae4e5dSmrg  hardcode_into_libs=yes
35686fae4e5dSmrg  ;;
35691f0ac6a5Smrg
35706fae4e5dSmrghpux9* | hpux10* | hpux11*)
35716fae4e5dSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
35726fae4e5dSmrg  # link against other versions.
35736fae4e5dSmrg  version_type=sunos
35746fae4e5dSmrg  need_lib_prefix=no
35756fae4e5dSmrg  need_version=no
35766fae4e5dSmrg  case $host_cpu in
35776fae4e5dSmrg  ia64*)
35786fae4e5dSmrg    shrext_cmds='.so'
35796fae4e5dSmrg    hardcode_into_libs=yes
35806fae4e5dSmrg    dynamic_linker="$host_os dld.so"
35816fae4e5dSmrg    shlibpath_var=LD_LIBRARY_PATH
35826fae4e5dSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
35836fae4e5dSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35846fae4e5dSmrg    soname_spec='${libname}${release}${shared_ext}$major'
35856fae4e5dSmrg    if test "X$HPUX_IA64_MODE" = X32; then
35866fae4e5dSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
35876fae4e5dSmrg    else
35886fae4e5dSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
35896fae4e5dSmrg    fi
35906fae4e5dSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
35916fae4e5dSmrg    ;;
35926fae4e5dSmrg  hppa*64*)
35936fae4e5dSmrg    shrext_cmds='.sl'
35946fae4e5dSmrg    hardcode_into_libs=yes
35956fae4e5dSmrg    dynamic_linker="$host_os dld.sl"
35966fae4e5dSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
35976fae4e5dSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
35986fae4e5dSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35996fae4e5dSmrg    soname_spec='${libname}${release}${shared_ext}$major'
36006fae4e5dSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
36016fae4e5dSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
36026fae4e5dSmrg    ;;
36036fae4e5dSmrg  *)
36046fae4e5dSmrg    shrext_cmds='.sl'
36056fae4e5dSmrg    dynamic_linker="$host_os dld.sl"
36066fae4e5dSmrg    shlibpath_var=SHLIB_PATH
36076fae4e5dSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
36086fae4e5dSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36096fae4e5dSmrg    soname_spec='${libname}${release}${shared_ext}$major'
36101f0ac6a5Smrg    ;;
36111f0ac6a5Smrg  esac
36126fae4e5dSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
36136fae4e5dSmrg  postinstall_cmds='chmod 555 $lib'
36146fae4e5dSmrg  # or fails outright, so override atomically:
36156fae4e5dSmrg  install_override_mode=555
36166fae4e5dSmrg  ;;
36171f0ac6a5Smrg
36186fae4e5dSmrginterix[[3-9]]*)
361989c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
36206fae4e5dSmrg  need_lib_prefix=no
36216fae4e5dSmrg  need_version=no
36226fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
36236fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36246fae4e5dSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
36256fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
36266fae4e5dSmrg  shlibpath_overrides_runpath=no
36276fae4e5dSmrg  hardcode_into_libs=yes
36286fae4e5dSmrg  ;;
36291f0ac6a5Smrg
36306fae4e5dSmrgirix5* | irix6* | nonstopux*)
36316fae4e5dSmrg  case $host_os in
36326fae4e5dSmrg    nonstopux*) version_type=nonstopux ;;
36336fae4e5dSmrg    *)
36346fae4e5dSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
363589c04b6cSmrg		version_type=linux # correct to gnu/linux during the next big refactor
36366fae4e5dSmrg	else
36376fae4e5dSmrg		version_type=irix
36386fae4e5dSmrg	fi ;;
36391f0ac6a5Smrg  esac
36406fae4e5dSmrg  need_lib_prefix=no
36416fae4e5dSmrg  need_version=no
36426fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36436fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
36446fae4e5dSmrg  case $host_os in
36456fae4e5dSmrg  irix5* | nonstopux*)
36466fae4e5dSmrg    libsuff= shlibsuff=
36476fae4e5dSmrg    ;;
36486fae4e5dSmrg  *)
36496fae4e5dSmrg    case $LD in # libtool.m4 will add one of these switches to LD
36506fae4e5dSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
36516fae4e5dSmrg      libsuff= shlibsuff= libmagic=32-bit;;
36526fae4e5dSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
36536fae4e5dSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
36546fae4e5dSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
36556fae4e5dSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
36566fae4e5dSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
36576fae4e5dSmrg    esac
36586fae4e5dSmrg    ;;
36596fae4e5dSmrg  esac
36606fae4e5dSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
36616fae4e5dSmrg  shlibpath_overrides_runpath=no
36626fae4e5dSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
36636fae4e5dSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
36646fae4e5dSmrg  hardcode_into_libs=yes
36656fae4e5dSmrg  ;;
36661f0ac6a5Smrg
36676fae4e5dSmrg# No shared lib support for Linux oldld, aout, or coff.
36686fae4e5dSmrglinux*oldld* | linux*aout* | linux*coff*)
36696fae4e5dSmrg  dynamic_linker=no
36706fae4e5dSmrg  ;;
36711f0ac6a5Smrg
367289c04b6cSmrg# This must be glibc/ELF.
36736fae4e5dSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
367489c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
36756fae4e5dSmrg  need_lib_prefix=no
36766fae4e5dSmrg  need_version=no
36776fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36786fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36796fae4e5dSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
36806fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
36816fae4e5dSmrg  shlibpath_overrides_runpath=no
36821f0ac6a5Smrg
36836fae4e5dSmrg  # Some binutils ld are patched to set DT_RUNPATH
36846fae4e5dSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
36856fae4e5dSmrg    [lt_cv_shlibpath_overrides_runpath=no
36866fae4e5dSmrg    save_LDFLAGS=$LDFLAGS
36876fae4e5dSmrg    save_libdir=$libdir
36886fae4e5dSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
36896fae4e5dSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
36906fae4e5dSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
36916fae4e5dSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
36926fae4e5dSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
36936fae4e5dSmrg    LDFLAGS=$save_LDFLAGS
36946fae4e5dSmrg    libdir=$save_libdir
36956fae4e5dSmrg    ])
36966fae4e5dSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
36971f0ac6a5Smrg
36986fae4e5dSmrg  # This implies no fast_install, which is unacceptable.
36996fae4e5dSmrg  # Some rework will be needed to allow for fast_install
37006fae4e5dSmrg  # before this can be enabled.
37016fae4e5dSmrg  hardcode_into_libs=yes
37026fae4e5dSmrg
37036fae4e5dSmrg  # Append ld.so.conf contents to the search path
37046fae4e5dSmrg  if test -f /etc/ld.so.conf; then
37056fae4e5dSmrg    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' ' '`
37066fae4e5dSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
37071f0ac6a5Smrg  fi
37081f0ac6a5Smrg
37096fae4e5dSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
37106fae4e5dSmrg  # powerpc, because MkLinux only supported shared libraries with the
37116fae4e5dSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
37126fae4e5dSmrg  # most powerpc-linux boxes support dynamic linking these days and
37136fae4e5dSmrg  # people can always --disable-shared, the test was removed, and we
37146fae4e5dSmrg  # assume the GNU/Linux dynamic linker is in use.
37156fae4e5dSmrg  dynamic_linker='GNU/Linux ld.so'
37166fae4e5dSmrg  ;;
37171f0ac6a5Smrg
37186fae4e5dSmrgnetbsd*)
37196fae4e5dSmrg  version_type=sunos
37206fae4e5dSmrg  need_lib_prefix=no
37216fae4e5dSmrg  need_version=no
37226fae4e5dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
37236fae4e5dSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
37246fae4e5dSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
37256fae4e5dSmrg    dynamic_linker='NetBSD (a.out) ld.so'
37266fae4e5dSmrg  else
37276fae4e5dSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
37286fae4e5dSmrg    soname_spec='${libname}${release}${shared_ext}$major'
37296fae4e5dSmrg    dynamic_linker='NetBSD ld.elf_so'
37306fae4e5dSmrg  fi
37316fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
37326fae4e5dSmrg  shlibpath_overrides_runpath=yes
37336fae4e5dSmrg  hardcode_into_libs=yes
37346fae4e5dSmrg  ;;
37351f0ac6a5Smrg
37366fae4e5dSmrgnewsos6)
373789c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
37386fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37396fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
37406fae4e5dSmrg  shlibpath_overrides_runpath=yes
37416fae4e5dSmrg  ;;
37421f0ac6a5Smrg
37436fae4e5dSmrg*nto* | *qnx*)
37446fae4e5dSmrg  version_type=qnx
37456fae4e5dSmrg  need_lib_prefix=no
37466fae4e5dSmrg  need_version=no
37476fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37486fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
37496fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
37506fae4e5dSmrg  shlibpath_overrides_runpath=no
37516fae4e5dSmrg  hardcode_into_libs=yes
37526fae4e5dSmrg  dynamic_linker='ldqnx.so'
37536fae4e5dSmrg  ;;
37541f0ac6a5Smrg
37556fae4e5dSmrgopenbsd*)
37566fae4e5dSmrg  version_type=sunos
37576fae4e5dSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
37586fae4e5dSmrg  need_lib_prefix=no
37596fae4e5dSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
37606fae4e5dSmrg  case $host_os in
37616fae4e5dSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
37626fae4e5dSmrg    *)				need_version=no  ;;
37636fae4e5dSmrg  esac
37646fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
37656fae4e5dSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
37666fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
37676fae4e5dSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
37686fae4e5dSmrg    case $host_os in
37696fae4e5dSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
37706fae4e5dSmrg	shlibpath_overrides_runpath=no
37716fae4e5dSmrg	;;
37726fae4e5dSmrg      *)
37736fae4e5dSmrg	shlibpath_overrides_runpath=yes
37746fae4e5dSmrg	;;
37756fae4e5dSmrg      esac
37761f0ac6a5Smrg  else
37776fae4e5dSmrg    shlibpath_overrides_runpath=yes
37781f0ac6a5Smrg  fi
37796fae4e5dSmrg  ;;
37801f0ac6a5Smrg
37816fae4e5dSmrgos2*)
37826fae4e5dSmrg  libname_spec='$name'
37836fae4e5dSmrg  shrext_cmds=".dll"
37846fae4e5dSmrg  need_lib_prefix=no
37856fae4e5dSmrg  library_names_spec='$libname${shared_ext} $libname.a'
37866fae4e5dSmrg  dynamic_linker='OS/2 ld.exe'
37876fae4e5dSmrg  shlibpath_var=LIBPATH
37886fae4e5dSmrg  ;;
37891f0ac6a5Smrg
37906fae4e5dSmrgosf3* | osf4* | osf5*)
37916fae4e5dSmrg  version_type=osf
37926fae4e5dSmrg  need_lib_prefix=no
37936fae4e5dSmrg  need_version=no
37946fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
37956fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37966fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
37976fae4e5dSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
37986fae4e5dSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
37996fae4e5dSmrg  ;;
38001f0ac6a5Smrg
38016fae4e5dSmrgrdos*)
38026fae4e5dSmrg  dynamic_linker=no
38036fae4e5dSmrg  ;;
38041f0ac6a5Smrg
38056fae4e5dSmrgsolaris*)
380689c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38076fae4e5dSmrg  need_lib_prefix=no
38086fae4e5dSmrg  need_version=no
38096fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38106fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
38116fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
38126fae4e5dSmrg  shlibpath_overrides_runpath=yes
38136fae4e5dSmrg  hardcode_into_libs=yes
38146fae4e5dSmrg  # ldd complains unless libraries are executable
38156fae4e5dSmrg  postinstall_cmds='chmod +x $lib'
38166fae4e5dSmrg  ;;
38171f0ac6a5Smrg
38186fae4e5dSmrgsunos4*)
38196fae4e5dSmrg  version_type=sunos
38206fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
38216fae4e5dSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
38226fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
38236fae4e5dSmrg  shlibpath_overrides_runpath=yes
38246fae4e5dSmrg  if test "$with_gnu_ld" = yes; then
38256fae4e5dSmrg    need_lib_prefix=no
38261f0ac6a5Smrg  fi
38276fae4e5dSmrg  need_version=yes
38286fae4e5dSmrg  ;;
38291f0ac6a5Smrg
38306fae4e5dSmrgsysv4 | sysv4.3*)
383189c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38326fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38331f0ac6a5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
38346fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
38356fae4e5dSmrg  case $host_vendor in
38366fae4e5dSmrg    sni)
38376fae4e5dSmrg      shlibpath_overrides_runpath=no
38386fae4e5dSmrg      need_lib_prefix=no
38396fae4e5dSmrg      runpath_var=LD_RUN_PATH
38406fae4e5dSmrg      ;;
38416fae4e5dSmrg    siemens)
38426fae4e5dSmrg      need_lib_prefix=no
38436fae4e5dSmrg      ;;
38446fae4e5dSmrg    motorola)
38456fae4e5dSmrg      need_lib_prefix=no
38466fae4e5dSmrg      need_version=no
38476fae4e5dSmrg      shlibpath_overrides_runpath=no
38486fae4e5dSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
38496fae4e5dSmrg      ;;
38506fae4e5dSmrg  esac
38511f0ac6a5Smrg  ;;
38521f0ac6a5Smrg
38536fae4e5dSmrgsysv4*MP*)
38546fae4e5dSmrg  if test -d /usr/nec ;then
385589c04b6cSmrg    version_type=linux # correct to gnu/linux during the next big refactor
38566fae4e5dSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
38576fae4e5dSmrg    soname_spec='$libname${shared_ext}.$major'
38586fae4e5dSmrg    shlibpath_var=LD_LIBRARY_PATH
38596fae4e5dSmrg  fi
38606fae4e5dSmrg  ;;
38616fae4e5dSmrg
38626fae4e5dSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
38636fae4e5dSmrg  version_type=freebsd-elf
38641f0ac6a5Smrg  need_lib_prefix=no
38651f0ac6a5Smrg  need_version=no
38666fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
38676fae4e5dSmrg  soname_spec='${libname}${release}${shared_ext}$major'
38686fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
38696fae4e5dSmrg  shlibpath_overrides_runpath=yes
38701f0ac6a5Smrg  hardcode_into_libs=yes
38716fae4e5dSmrg  if test "$with_gnu_ld" = yes; then
38726fae4e5dSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
38731f0ac6a5Smrg  else
38746fae4e5dSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
38751f0ac6a5Smrg    case $host_os in
38766fae4e5dSmrg      sco3.2v5*)
38776fae4e5dSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
38786fae4e5dSmrg	;;
38791f0ac6a5Smrg    esac
38801f0ac6a5Smrg  fi
38816fae4e5dSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
38821f0ac6a5Smrg  ;;
38831f0ac6a5Smrg
38846fae4e5dSmrgtpf*)
38856fae4e5dSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
388689c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38876fae4e5dSmrg  need_lib_prefix=no
38886fae4e5dSmrg  need_version=no
38896fae4e5dSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38906fae4e5dSmrg  shlibpath_var=LD_LIBRARY_PATH
38916fae4e5dSmrg  shlibpath_overrides_runpath=no
38926fae4e5dSmrg  hardcode_into_libs=yes
38931f0ac6a5Smrg  ;;
38941f0ac6a5Smrg
38956fae4e5dSmrguts4*)
389689c04b6cSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38971f0ac6a5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38981f0ac6a5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
38991f0ac6a5Smrg  shlibpath_var=LD_LIBRARY_PATH
39001f0ac6a5Smrg  ;;
39011f0ac6a5Smrg
39026fae4e5dSmrg*)
39036fae4e5dSmrg  dynamic_linker=no
39046fae4e5dSmrg  ;;
39056fae4e5dSmrgesac
39066fae4e5dSmrgAC_MSG_RESULT([$dynamic_linker])
39076fae4e5dSmrgtest "$dynamic_linker" = no && can_build_shared=no
39081f0ac6a5Smrg
39096fae4e5dSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
39106fae4e5dSmrgif test "$GCC" = yes; then
39116fae4e5dSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
39126fae4e5dSmrgfi
39131f0ac6a5Smrg
39146fae4e5dSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
39156fae4e5dSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
39166fae4e5dSmrgfi
39176fae4e5dSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
39186fae4e5dSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
39196fae4e5dSmrgfi
39201f0ac6a5Smrg
39216fae4e5dSmrg_LT_DECL([], [variables_saved_for_relink], [1],
39226fae4e5dSmrg    [Variables whose values should be saved in libtool wrapper scripts and
39236fae4e5dSmrg    restored at link time])
39246fae4e5dSmrg_LT_DECL([], [need_lib_prefix], [0],
39256fae4e5dSmrg    [Do we need the "lib" prefix for modules?])
39266fae4e5dSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
39276fae4e5dSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
39286fae4e5dSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
39296fae4e5dSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
39306fae4e5dSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
39316fae4e5dSmrg    [Is shlibpath searched before the hard-coded library search path?])
39326fae4e5dSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
39336fae4e5dSmrg_LT_DECL([], [library_names_spec], [1],
39346fae4e5dSmrg    [[List of archive names.  First name is the real one, the rest are links.
39356fae4e5dSmrg    The last name is the one that the linker finds with -lNAME]])
39366fae4e5dSmrg_LT_DECL([], [soname_spec], [1],
39376fae4e5dSmrg    [[The coded name of the library, if different from the real name]])
39386fae4e5dSmrg_LT_DECL([], [install_override_mode], [1],
39396fae4e5dSmrg    [Permission mode override for installation of shared libraries])
39406fae4e5dSmrg_LT_DECL([], [postinstall_cmds], [2],
39416fae4e5dSmrg    [Command to use after installation of a shared archive])
39426fae4e5dSmrg_LT_DECL([], [postuninstall_cmds], [2],
39436fae4e5dSmrg    [Command to use after uninstallation of a shared archive])
39446fae4e5dSmrg_LT_DECL([], [finish_cmds], [2],
39456fae4e5dSmrg    [Commands used to finish a libtool library installation in a directory])
39466fae4e5dSmrg_LT_DECL([], [finish_eval], [1],
39476fae4e5dSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
39486fae4e5dSmrg    not shown]])
39496fae4e5dSmrg_LT_DECL([], [hardcode_into_libs], [0],
39506fae4e5dSmrg    [Whether we should hardcode library paths into libraries])
39516fae4e5dSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
39526fae4e5dSmrg    [Compile-time system search path for libraries])
39536fae4e5dSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
39546fae4e5dSmrg    [Run-time system search path for libraries])
39556fae4e5dSmrg])# _LT_SYS_DYNAMIC_LINKER
39561f0ac6a5Smrg
39576fae4e5dSmrg
39586fae4e5dSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
39596fae4e5dSmrg# --------------------------
39606fae4e5dSmrg# find a file program which can recognize shared library
39616fae4e5dSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
39626fae4e5dSmrg[m4_require([_LT_DECL_EGREP])dnl
39636fae4e5dSmrgAC_MSG_CHECKING([for $1])
39646fae4e5dSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
39656fae4e5dSmrg[case $MAGIC_CMD in
39666fae4e5dSmrg[[\\/*] |  ?:[\\/]*])
39676fae4e5dSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
39681f0ac6a5Smrg  ;;
39696fae4e5dSmrg*)
39706fae4e5dSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
39716fae4e5dSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
39726fae4e5dSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
39736fae4e5dSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
39746fae4e5dSmrgdnl not every word.  This closes a longstanding sh security hole.
39756fae4e5dSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
39766fae4e5dSmrg  for ac_dir in $ac_dummy; do
39776fae4e5dSmrg    IFS="$lt_save_ifs"
39786fae4e5dSmrg    test -z "$ac_dir" && ac_dir=.
39796fae4e5dSmrg    if test -f $ac_dir/$1; then
39806fae4e5dSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
39816fae4e5dSmrg      if test -n "$file_magic_test_file"; then
39826fae4e5dSmrg	case $deplibs_check_method in
39836fae4e5dSmrg	"file_magic "*)
39846fae4e5dSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
39856fae4e5dSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
39866fae4e5dSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
39876fae4e5dSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
39886fae4e5dSmrg	    :
39896fae4e5dSmrg	  else
39906fae4e5dSmrg	    cat <<_LT_EOF 1>&2
39911f0ac6a5Smrg
39926fae4e5dSmrg*** Warning: the command libtool uses to detect shared libraries,
39936fae4e5dSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
39946fae4e5dSmrg*** The result is that libtool may fail to recognize shared libraries
39956fae4e5dSmrg*** as such.  This will affect the creation of libtool libraries that
39966fae4e5dSmrg*** depend on shared libraries, but programs linked with such libtool
39976fae4e5dSmrg*** libraries will work regardless of this problem.  Nevertheless, you
39986fae4e5dSmrg*** may want to report the problem to your system manager and/or to
39996fae4e5dSmrg*** bug-libtool@gnu.org
40006fae4e5dSmrg
40016fae4e5dSmrg_LT_EOF
40026fae4e5dSmrg	  fi ;;
40036fae4e5dSmrg	esac
40046fae4e5dSmrg      fi
40056fae4e5dSmrg      break
40066fae4e5dSmrg    fi
40076fae4e5dSmrg  done
40086fae4e5dSmrg  IFS="$lt_save_ifs"
40096fae4e5dSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
40101f0ac6a5Smrg  ;;
40116fae4e5dSmrgesac])
40126fae4e5dSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
40136fae4e5dSmrgif test -n "$MAGIC_CMD"; then
40146fae4e5dSmrg  AC_MSG_RESULT($MAGIC_CMD)
40156fae4e5dSmrgelse
40166fae4e5dSmrg  AC_MSG_RESULT(no)
40176fae4e5dSmrgfi
40186fae4e5dSmrg_LT_DECL([], [MAGIC_CMD], [0],
40196fae4e5dSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
40206fae4e5dSmrg])# _LT_PATH_TOOL_PREFIX
40211f0ac6a5Smrg
40226fae4e5dSmrg# Old name:
40236fae4e5dSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
40246fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
40256fae4e5dSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
40266fae4e5dSmrg
40276fae4e5dSmrg
40286fae4e5dSmrg# _LT_PATH_MAGIC
40296fae4e5dSmrg# --------------
40306fae4e5dSmrg# find a file program which can recognize a shared library
40316fae4e5dSmrgm4_defun([_LT_PATH_MAGIC],
40326fae4e5dSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
40336fae4e5dSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
40346fae4e5dSmrg  if test -n "$ac_tool_prefix"; then
40356fae4e5dSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
40361f0ac6a5Smrg  else
40376fae4e5dSmrg    MAGIC_CMD=:
40381f0ac6a5Smrg  fi
40396fae4e5dSmrgfi
40406fae4e5dSmrg])# _LT_PATH_MAGIC
40411f0ac6a5Smrg
40421f0ac6a5Smrg
40436fae4e5dSmrg# LT_PATH_LD
40446fae4e5dSmrg# ----------
40456fae4e5dSmrg# find the pathname to the GNU or non-GNU linker
40466fae4e5dSmrgAC_DEFUN([LT_PATH_LD],
40476fae4e5dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
40486fae4e5dSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
40496fae4e5dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
40506fae4e5dSmrgm4_require([_LT_DECL_SED])dnl
40516fae4e5dSmrgm4_require([_LT_DECL_EGREP])dnl
40526fae4e5dSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
40531f0ac6a5Smrg
40546fae4e5dSmrgAC_ARG_WITH([gnu-ld],
40556fae4e5dSmrg    [AS_HELP_STRING([--with-gnu-ld],
40566fae4e5dSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
40576fae4e5dSmrg    [test "$withval" = no || with_gnu_ld=yes],
40586fae4e5dSmrg    [with_gnu_ld=no])dnl
40591f0ac6a5Smrg
40606fae4e5dSmrgac_prog=ld
40616fae4e5dSmrgif test "$GCC" = yes; then
40626fae4e5dSmrg  # Check if gcc -print-prog-name=ld gives a path.
40636fae4e5dSmrg  AC_MSG_CHECKING([for ld used by $CC])
40646fae4e5dSmrg  case $host in
40656fae4e5dSmrg  *-*-mingw*)
40666fae4e5dSmrg    # gcc leaves a trailing carriage return which upsets mingw
40676fae4e5dSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
40686fae4e5dSmrg  *)
40696fae4e5dSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
40701f0ac6a5Smrg  esac
40716fae4e5dSmrg  case $ac_prog in
40726fae4e5dSmrg    # Accept absolute paths.
40736fae4e5dSmrg    [[\\/]]* | ?:[[\\/]]*)
40746fae4e5dSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
40756fae4e5dSmrg      # Canonicalize the pathname of ld
40766fae4e5dSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
40776fae4e5dSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
40786fae4e5dSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
40796fae4e5dSmrg      done
40806fae4e5dSmrg      test -z "$LD" && LD="$ac_prog"
40816fae4e5dSmrg      ;;
40826fae4e5dSmrg  "")
40836fae4e5dSmrg    # If it fails, then pretend we aren't using GCC.
40846fae4e5dSmrg    ac_prog=ld
40851f0ac6a5Smrg    ;;
40861f0ac6a5Smrg  *)
40876fae4e5dSmrg    # If it is relative, then search for the first ld in PATH.
40886fae4e5dSmrg    with_gnu_ld=unknown
40891f0ac6a5Smrg    ;;
40901f0ac6a5Smrg  esac
40916fae4e5dSmrgelif test "$with_gnu_ld" = yes; then
40926fae4e5dSmrg  AC_MSG_CHECKING([for GNU ld])
40936fae4e5dSmrgelse
40946fae4e5dSmrg  AC_MSG_CHECKING([for non-GNU ld])
40956fae4e5dSmrgfi
40966fae4e5dSmrgAC_CACHE_VAL(lt_cv_path_LD,
40976fae4e5dSmrg[if test -z "$LD"; then
40986fae4e5dSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
40996fae4e5dSmrg  for ac_dir in $PATH; do
41006fae4e5dSmrg    IFS="$lt_save_ifs"
41016fae4e5dSmrg    test -z "$ac_dir" && ac_dir=.
41026fae4e5dSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
41036fae4e5dSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
41046fae4e5dSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
41056fae4e5dSmrg      # but apparently some variants of GNU ld only accept -v.
41066fae4e5dSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
41076fae4e5dSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
41086fae4e5dSmrg      *GNU* | *'with BFD'*)
41096fae4e5dSmrg	test "$with_gnu_ld" != no && break
41106fae4e5dSmrg	;;
41116fae4e5dSmrg      *)
41126fae4e5dSmrg	test "$with_gnu_ld" != yes && break
41136fae4e5dSmrg	;;
41146fae4e5dSmrg      esac
41156fae4e5dSmrg    fi
41166fae4e5dSmrg  done
41176fae4e5dSmrg  IFS="$lt_save_ifs"
41186fae4e5dSmrgelse
41196fae4e5dSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
41206fae4e5dSmrgfi])
41216fae4e5dSmrgLD="$lt_cv_path_LD"
41226fae4e5dSmrgif test -n "$LD"; then
41236fae4e5dSmrg  AC_MSG_RESULT($LD)
41246fae4e5dSmrgelse
41256fae4e5dSmrg  AC_MSG_RESULT(no)
41266fae4e5dSmrgfi
41276fae4e5dSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
41286fae4e5dSmrg_LT_PATH_LD_GNU
41296fae4e5dSmrgAC_SUBST([LD])
41309c9ff80cSmrg
41316fae4e5dSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
41326fae4e5dSmrg])# LT_PATH_LD
41331f0ac6a5Smrg
41346fae4e5dSmrg# Old names:
41356fae4e5dSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
41366fae4e5dSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
41376fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
41386fae4e5dSmrgdnl AC_DEFUN([AM_PROG_LD], [])
41396fae4e5dSmrgdnl AC_DEFUN([AC_PROG_LD], [])
41401f0ac6a5Smrg
41411f0ac6a5Smrg
41426fae4e5dSmrg# _LT_PATH_LD_GNU
41436fae4e5dSmrg#- --------------
41446fae4e5dSmrgm4_defun([_LT_PATH_LD_GNU],
41456fae4e5dSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
41466fae4e5dSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
41476fae4e5dSmrgcase `$LD -v 2>&1 </dev/null` in
41486fae4e5dSmrg*GNU* | *'with BFD'*)
41496fae4e5dSmrg  lt_cv_prog_gnu_ld=yes
41501f0ac6a5Smrg  ;;
41516fae4e5dSmrg*)
41526fae4e5dSmrg  lt_cv_prog_gnu_ld=no
41531f0ac6a5Smrg  ;;
41546fae4e5dSmrgesac])
41556fae4e5dSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
41566fae4e5dSmrg])# _LT_PATH_LD_GNU
41571f0ac6a5Smrg
41581f0ac6a5Smrg
41596fae4e5dSmrg# _LT_CMD_RELOAD
41606fae4e5dSmrg# --------------
41616fae4e5dSmrg# find reload flag for linker
41626fae4e5dSmrg#   -- PORTME Some linkers may need a different reload flag.
41636fae4e5dSmrgm4_defun([_LT_CMD_RELOAD],
41646fae4e5dSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
41656fae4e5dSmrg  lt_cv_ld_reload_flag,
41666fae4e5dSmrg  [lt_cv_ld_reload_flag='-r'])
41676fae4e5dSmrgreload_flag=$lt_cv_ld_reload_flag
41686fae4e5dSmrgcase $reload_flag in
41696fae4e5dSmrg"" | " "*) ;;
41706fae4e5dSmrg*) reload_flag=" $reload_flag" ;;
41716fae4e5dSmrgesac
41726fae4e5dSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
41736fae4e5dSmrgcase $host_os in
41746fae4e5dSmrg  cygwin* | mingw* | pw32* | cegcc*)
41756fae4e5dSmrg    if test "$GCC" != yes; then
41766fae4e5dSmrg      reload_cmds=false
41776fae4e5dSmrg    fi
41786fae4e5dSmrg    ;;
41796fae4e5dSmrg  darwin*)
41806fae4e5dSmrg    if test "$GCC" = yes; then
41816fae4e5dSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
41826fae4e5dSmrg    else
41836fae4e5dSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
41846fae4e5dSmrg    fi
41856fae4e5dSmrg    ;;
41866fae4e5dSmrgesac
41876fae4e5dSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
41886fae4e5dSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
41896fae4e5dSmrg])# _LT_CMD_RELOAD
41906fae4e5dSmrg
41916fae4e5dSmrg
41926fae4e5dSmrg# _LT_CHECK_MAGIC_METHOD
41936fae4e5dSmrg# ----------------------
41946fae4e5dSmrg# how to check for library dependencies
41956fae4e5dSmrg#  -- PORTME fill in with the dynamic library characteristics
41966fae4e5dSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
41976fae4e5dSmrg[m4_require([_LT_DECL_EGREP])
41986fae4e5dSmrgm4_require([_LT_DECL_OBJDUMP])
41996fae4e5dSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
42006fae4e5dSmrglt_cv_deplibs_check_method,
42016fae4e5dSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
42026fae4e5dSmrglt_cv_file_magic_test_file=
42036fae4e5dSmrglt_cv_deplibs_check_method='unknown'
42046fae4e5dSmrg# Need to set the preceding variable on all platforms that support
42056fae4e5dSmrg# interlibrary dependencies.
42066fae4e5dSmrg# 'none' -- dependencies not supported.
42076fae4e5dSmrg# `unknown' -- same as none, but documents that we really don't know.
42086fae4e5dSmrg# 'pass_all' -- all dependencies passed with no checks.
42096fae4e5dSmrg# 'test_compile' -- check by making test program.
42106fae4e5dSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
42116fae4e5dSmrg# which responds to the $file_magic_cmd with a given extended regex.
42126fae4e5dSmrg# If you have `file' or equivalent on your system and you're not sure
42136fae4e5dSmrg# whether `pass_all' will *always* work, you probably want this one.
42146fae4e5dSmrg
42156fae4e5dSmrgcase $host_os in
42166fae4e5dSmrgaix[[4-9]]*)
42176fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
42186fae4e5dSmrg  ;;
42196fae4e5dSmrg
42206fae4e5dSmrgbeos*)
42216fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
42226fae4e5dSmrg  ;;
42236fae4e5dSmrg
42246fae4e5dSmrgbsdi[[45]]*)
42256fae4e5dSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
42266fae4e5dSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
42276fae4e5dSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
42286fae4e5dSmrg  ;;
42296fae4e5dSmrg
42306fae4e5dSmrgcygwin*)
42316fae4e5dSmrg  # func_win32_libid is a shell function defined in ltmain.sh
42326fae4e5dSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
42336fae4e5dSmrg  lt_cv_file_magic_cmd='func_win32_libid'
42346fae4e5dSmrg  ;;
42356fae4e5dSmrg
42366fae4e5dSmrgmingw* | pw32*)
42376fae4e5dSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
42386fae4e5dSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
42396fae4e5dSmrg  # unless we find 'file', for example because we are cross-compiling.
42406fae4e5dSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
42416fae4e5dSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
42426fae4e5dSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
42436fae4e5dSmrg    lt_cv_file_magic_cmd='func_win32_libid'
42441f0ac6a5Smrg  else
42456fae4e5dSmrg    # Keep this pattern in sync with the one in func_win32_libid.
42466fae4e5dSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
42476fae4e5dSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
42481f0ac6a5Smrg  fi
42491f0ac6a5Smrg  ;;
42501f0ac6a5Smrg
42516fae4e5dSmrgcegcc*)
42526fae4e5dSmrg  # use the weaker test based on 'objdump'. See mingw*.
42536fae4e5dSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
42546fae4e5dSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
42551f0ac6a5Smrg  ;;
42561f0ac6a5Smrg
42576fae4e5dSmrgdarwin* | rhapsody*)
42586fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
42591f0ac6a5Smrg  ;;
42601f0ac6a5Smrg
42616fae4e5dSmrgfreebsd* | dragonfly*)
42626fae4e5dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
42636fae4e5dSmrg    case $host_cpu in
42646fae4e5dSmrg    i*86 )
42656fae4e5dSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
42666fae4e5dSmrg      # Let's accept both of them until this is cleared up.
42676fae4e5dSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
42686fae4e5dSmrg      lt_cv_file_magic_cmd=/usr/bin/file
42696fae4e5dSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
42706fae4e5dSmrg      ;;
42716fae4e5dSmrg    esac
42726fae4e5dSmrg  else
42736fae4e5dSmrg    lt_cv_deplibs_check_method=pass_all
42746fae4e5dSmrg  fi
4275e5410a46Smrg  ;;
4276e5410a46Smrg
42776fae4e5dSmrggnu*)
42786fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
42791f0ac6a5Smrg  ;;
42801f0ac6a5Smrg
42816fae4e5dSmrghaiku*)
42826fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
42831f0ac6a5Smrg  ;;
42841f0ac6a5Smrg
42856fae4e5dSmrghpux10.20* | hpux11*)
42866fae4e5dSmrg  lt_cv_file_magic_cmd=/usr/bin/file
42876fae4e5dSmrg  case $host_cpu in
42886fae4e5dSmrg  ia64*)
42896fae4e5dSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
42906fae4e5dSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
42916fae4e5dSmrg    ;;
42926fae4e5dSmrg  hppa*64*)
42936fae4e5dSmrg    [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]']
42946fae4e5dSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
42956fae4e5dSmrg    ;;
42966fae4e5dSmrg  *)
42976fae4e5dSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
42986fae4e5dSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
42996fae4e5dSmrg    ;;
43001f0ac6a5Smrg  esac
43011f0ac6a5Smrg  ;;
43021f0ac6a5Smrg
43036fae4e5dSmrginterix[[3-9]]*)
43046fae4e5dSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
43056fae4e5dSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
43061f0ac6a5Smrg  ;;
43071f0ac6a5Smrg
43086fae4e5dSmrgirix5* | irix6* | nonstopux*)
43096fae4e5dSmrg  case $LD in
43106fae4e5dSmrg  *-32|*"-32 ") libmagic=32-bit;;
43116fae4e5dSmrg  *-n32|*"-n32 ") libmagic=N32;;
43126fae4e5dSmrg  *-64|*"-64 ") libmagic=64-bit;;
43136fae4e5dSmrg  *) libmagic=never-match;;
43146fae4e5dSmrg  esac
43156fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
43166fae4e5dSmrg  ;;
43176fae4e5dSmrg
431889c04b6cSmrg# This must be glibc/ELF.
43196fae4e5dSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
43206fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
43216fae4e5dSmrg  ;;
43226fae4e5dSmrg
43236fae4e5dSmrgnetbsd*)
43246fae4e5dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
43256fae4e5dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
43261f0ac6a5Smrg  else
43276fae4e5dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
43281f0ac6a5Smrg  fi
43291f0ac6a5Smrg  ;;
43301f0ac6a5Smrg
43316fae4e5dSmrgnewos6*)
43326fae4e5dSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
43336fae4e5dSmrg  lt_cv_file_magic_cmd=/usr/bin/file
43346fae4e5dSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
43359c9ff80cSmrg  ;;
43369c9ff80cSmrg
43376fae4e5dSmrg*nto* | *qnx*)
43386fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
43391f0ac6a5Smrg  ;;
43401f0ac6a5Smrg
43416fae4e5dSmrgopenbsd*)
43426fae4e5dSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
43436fae4e5dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
43446fae4e5dSmrg  else
43456fae4e5dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
43466fae4e5dSmrg  fi
43471f0ac6a5Smrg  ;;
43481f0ac6a5Smrg
43496fae4e5dSmrgosf3* | osf4* | osf5*)
43506fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
43516fae4e5dSmrg  ;;
43521f0ac6a5Smrg
43536fae4e5dSmrgrdos*)
43546fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
43556fae4e5dSmrg  ;;
43561f0ac6a5Smrg
43576fae4e5dSmrgsolaris*)
43586fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
43596fae4e5dSmrg  ;;
43609c9ff80cSmrg
43616fae4e5dSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
43626fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
43636fae4e5dSmrg  ;;
43649c9ff80cSmrg
43656fae4e5dSmrgsysv4 | sysv4.3*)
43666fae4e5dSmrg  case $host_vendor in
43676fae4e5dSmrg  motorola)
43686fae4e5dSmrg    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]]'
43696fae4e5dSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
43706fae4e5dSmrg    ;;
43716fae4e5dSmrg  ncr)
43726fae4e5dSmrg    lt_cv_deplibs_check_method=pass_all
43736fae4e5dSmrg    ;;
43746fae4e5dSmrg  sequent)
43756fae4e5dSmrg    lt_cv_file_magic_cmd='/bin/file'
43766fae4e5dSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
43776fae4e5dSmrg    ;;
43786fae4e5dSmrg  sni)
43796fae4e5dSmrg    lt_cv_file_magic_cmd='/bin/file'
43806fae4e5dSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
43816fae4e5dSmrg    lt_cv_file_magic_test_file=/lib/libc.so
43826fae4e5dSmrg    ;;
43836fae4e5dSmrg  siemens)
43846fae4e5dSmrg    lt_cv_deplibs_check_method=pass_all
43856fae4e5dSmrg    ;;
43866fae4e5dSmrg  pc)
43876fae4e5dSmrg    lt_cv_deplibs_check_method=pass_all
43886fae4e5dSmrg    ;;
43896fae4e5dSmrg  esac
43909c9ff80cSmrg  ;;
43911f0ac6a5Smrg
43926fae4e5dSmrgtpf*)
43936fae4e5dSmrg  lt_cv_deplibs_check_method=pass_all
43946fae4e5dSmrg  ;;
43956fae4e5dSmrgesac
43966fae4e5dSmrg])
43971f0ac6a5Smrg
43986fae4e5dSmrgfile_magic_glob=
43996fae4e5dSmrgwant_nocaseglob=no
44006fae4e5dSmrgif test "$build" = "$host"; then
44016fae4e5dSmrg  case $host_os in
44026fae4e5dSmrg  mingw* | pw32*)
44036fae4e5dSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
44046fae4e5dSmrg      want_nocaseglob=yes
44056fae4e5dSmrg    else
44066fae4e5dSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
44071f0ac6a5Smrg    fi
44086fae4e5dSmrg    ;;
44096fae4e5dSmrg  esac
44101f0ac6a5Smrgfi
44111f0ac6a5Smrg
44126fae4e5dSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
44136fae4e5dSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
44146fae4e5dSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
44151f0ac6a5Smrg
44166fae4e5dSmrg_LT_DECL([], [deplibs_check_method], [1],
44176fae4e5dSmrg    [Method to check whether dependent libraries are shared objects])
44186fae4e5dSmrg_LT_DECL([], [file_magic_cmd], [1],
44196fae4e5dSmrg    [Command to use when deplibs_check_method = "file_magic"])
44206fae4e5dSmrg_LT_DECL([], [file_magic_glob], [1],
44216fae4e5dSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
44226fae4e5dSmrg_LT_DECL([], [want_nocaseglob], [1],
44236fae4e5dSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
44246fae4e5dSmrg])# _LT_CHECK_MAGIC_METHOD
44259c9ff80cSmrg
44266fae4e5dSmrg
44276fae4e5dSmrg# LT_PATH_NM
44286fae4e5dSmrg# ----------
44296fae4e5dSmrg# find the pathname to a BSD- or MS-compatible name lister
44306fae4e5dSmrgAC_DEFUN([LT_PATH_NM],
44316fae4e5dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
44326fae4e5dSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
44336fae4e5dSmrg[if test -n "$NM"; then
44346fae4e5dSmrg  # Let the user override the test.
44356fae4e5dSmrg  lt_cv_path_NM="$NM"
44366fae4e5dSmrgelse
44376fae4e5dSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
44386fae4e5dSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
44396fae4e5dSmrg    lt_nm_to_check="$lt_nm_to_check nm"
44406fae4e5dSmrg  fi
44416fae4e5dSmrg  for lt_tmp_nm in $lt_nm_to_check; do
44426fae4e5dSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
44436fae4e5dSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
44446fae4e5dSmrg      IFS="$lt_save_ifs"
44456fae4e5dSmrg      test -z "$ac_dir" && ac_dir=.
44466fae4e5dSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
44476fae4e5dSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
44486fae4e5dSmrg	# Check to see if the nm accepts a BSD-compat flag.
44496fae4e5dSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
44506fae4e5dSmrg	#   nm: unknown option "B" ignored
44516fae4e5dSmrg	# Tru64's nm complains that /dev/null is an invalid object file
44526fae4e5dSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
44536fae4e5dSmrg	*/dev/null* | *'Invalid file or object type'*)
44546fae4e5dSmrg	  lt_cv_path_NM="$tmp_nm -B"
44556fae4e5dSmrg	  break
44566fae4e5dSmrg	  ;;
44576fae4e5dSmrg	*)
44586fae4e5dSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
44596fae4e5dSmrg	  */dev/null*)
44606fae4e5dSmrg	    lt_cv_path_NM="$tmp_nm -p"
44616fae4e5dSmrg	    break
44626fae4e5dSmrg	    ;;
44636fae4e5dSmrg	  *)
44646fae4e5dSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
44656fae4e5dSmrg	    continue # so that we can try to find one that supports BSD flags
44666fae4e5dSmrg	    ;;
44676fae4e5dSmrg	  esac
44686fae4e5dSmrg	  ;;
44696fae4e5dSmrg	esac
44706fae4e5dSmrg      fi
44716fae4e5dSmrg    done
44726fae4e5dSmrg    IFS="$lt_save_ifs"
44736fae4e5dSmrg  done
44746fae4e5dSmrg  : ${lt_cv_path_NM=no}
44756fae4e5dSmrgfi])
44766fae4e5dSmrgif test "$lt_cv_path_NM" != "no"; then
44776fae4e5dSmrg  NM="$lt_cv_path_NM"
44786fae4e5dSmrgelse
44796fae4e5dSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
44806fae4e5dSmrg  if test -n "$DUMPBIN"; then :
44816fae4e5dSmrg    # Let the user override the test.
44821f0ac6a5Smrg  else
44836fae4e5dSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
44846fae4e5dSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
44856fae4e5dSmrg    *COFF*)
44866fae4e5dSmrg      DUMPBIN="$DUMPBIN -symbols"
44876fae4e5dSmrg      ;;
44886fae4e5dSmrg    *)
44896fae4e5dSmrg      DUMPBIN=:
44906fae4e5dSmrg      ;;
44916fae4e5dSmrg    esac
44926fae4e5dSmrg  fi
44936fae4e5dSmrg  AC_SUBST([DUMPBIN])
44946fae4e5dSmrg  if test "$DUMPBIN" != ":"; then
44956fae4e5dSmrg    NM="$DUMPBIN"
44961f0ac6a5Smrg  fi
44971f0ac6a5Smrgfi
44986fae4e5dSmrgtest -z "$NM" && NM=nm
44996fae4e5dSmrgAC_SUBST([NM])
45006fae4e5dSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
45011f0ac6a5Smrg
45026fae4e5dSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
45036fae4e5dSmrg  [lt_cv_nm_interface="BSD nm"
45046fae4e5dSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
45056fae4e5dSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
45066fae4e5dSmrg  (eval "$ac_compile" 2>conftest.err)
45076fae4e5dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
45086fae4e5dSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
45096fae4e5dSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
45106fae4e5dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
45116fae4e5dSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
45126fae4e5dSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
45136fae4e5dSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
45146fae4e5dSmrg    lt_cv_nm_interface="MS dumpbin"
45156fae4e5dSmrg  fi
45166fae4e5dSmrg  rm -f conftest*])
45176fae4e5dSmrg])# LT_PATH_NM
45189c9ff80cSmrg
45196fae4e5dSmrg# Old names:
45206fae4e5dSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
45216fae4e5dSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
45226fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
45236fae4e5dSmrgdnl AC_DEFUN([AM_PROG_NM], [])
45246fae4e5dSmrgdnl AC_DEFUN([AC_PROG_NM], [])
45259c9ff80cSmrg
45266fae4e5dSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
45276fae4e5dSmrg# --------------------------------
45286fae4e5dSmrg# how to determine the name of the shared library
45296fae4e5dSmrg# associated with a specific link library.
45306fae4e5dSmrg#  -- PORTME fill in with the dynamic library characteristics
45316fae4e5dSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
45326fae4e5dSmrg[m4_require([_LT_DECL_EGREP])
45336fae4e5dSmrgm4_require([_LT_DECL_OBJDUMP])
45346fae4e5dSmrgm4_require([_LT_DECL_DLLTOOL])
45356fae4e5dSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
45366fae4e5dSmrglt_cv_sharedlib_from_linklib_cmd,
45376fae4e5dSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
45386fae4e5dSmrg
45396fae4e5dSmrgcase $host_os in
45406fae4e5dSmrgcygwin* | mingw* | pw32* | cegcc*)
45416fae4e5dSmrg  # two different shell functions defined in ltmain.sh
45426fae4e5dSmrg  # decide which to use based on capabilities of $DLLTOOL
45436fae4e5dSmrg  case `$DLLTOOL --help 2>&1` in
45446fae4e5dSmrg  *--identify-strict*)
45456fae4e5dSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
45461f0ac6a5Smrg    ;;
45471f0ac6a5Smrg  *)
45486fae4e5dSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
45491f0ac6a5Smrg    ;;
45501f0ac6a5Smrg  esac
45511f0ac6a5Smrg  ;;
45521f0ac6a5Smrg*)
45536fae4e5dSmrg  # fallback: assume linklib IS sharedlib
45546fae4e5dSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
45551f0ac6a5Smrg  ;;
45561f0ac6a5Smrgesac
45576fae4e5dSmrg])
45586fae4e5dSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
45596fae4e5dSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
45601f0ac6a5Smrg
45616fae4e5dSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
45626fae4e5dSmrg    [Command to associate shared and link libraries])
45636fae4e5dSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
45641f0ac6a5Smrg
45651f0ac6a5Smrg
45666fae4e5dSmrg# _LT_PATH_MANIFEST_TOOL
45676fae4e5dSmrg# ----------------------
45686fae4e5dSmrg# locate the manifest tool
45696fae4e5dSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
45706fae4e5dSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
45716fae4e5dSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
45726fae4e5dSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
45736fae4e5dSmrg  [lt_cv_path_mainfest_tool=no
45746fae4e5dSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
45756fae4e5dSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
45766fae4e5dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
45776fae4e5dSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
45786fae4e5dSmrg    lt_cv_path_mainfest_tool=yes
45796fae4e5dSmrg  fi
45806fae4e5dSmrg  rm -f conftest*])
45816fae4e5dSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
45826fae4e5dSmrg  MANIFEST_TOOL=:
45836fae4e5dSmrgfi
45846fae4e5dSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
45856fae4e5dSmrg])# _LT_PATH_MANIFEST_TOOL
45861f0ac6a5Smrg
45871f0ac6a5Smrg
45886fae4e5dSmrg# LT_LIB_M
45896fae4e5dSmrg# --------
45906fae4e5dSmrg# check for math library
45916fae4e5dSmrgAC_DEFUN([LT_LIB_M],
45926fae4e5dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
45936fae4e5dSmrgLIBM=
45946fae4e5dSmrgcase $host in
45956fae4e5dSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
45966fae4e5dSmrg  # These system don't have libm, or don't need it
45971f0ac6a5Smrg  ;;
45986fae4e5dSmrg*-ncr-sysv4.3*)
45996fae4e5dSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
46006fae4e5dSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
46011f0ac6a5Smrg  ;;
46026fae4e5dSmrg*)
46036fae4e5dSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
46041f0ac6a5Smrg  ;;
46056fae4e5dSmrgesac
46066fae4e5dSmrgAC_SUBST([LIBM])
46076fae4e5dSmrg])# LT_LIB_M
46081f0ac6a5Smrg
46096fae4e5dSmrg# Old name:
46106fae4e5dSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
46116fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
46126fae4e5dSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
46139c9ff80cSmrg
46141f0ac6a5Smrg
46156fae4e5dSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
46166fae4e5dSmrg# -------------------------------
46176fae4e5dSmrgm4_defun([_LT_COMPILER_NO_RTTI],
46186fae4e5dSmrg[m4_require([_LT_TAG_COMPILER])dnl
46191f0ac6a5Smrg
46206fae4e5dSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
46211f0ac6a5Smrg
46226fae4e5dSmrgif test "$GCC" = yes; then
46236fae4e5dSmrg  case $cc_basename in
46246fae4e5dSmrg  nvcc*)
46256fae4e5dSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
46261f0ac6a5Smrg  *)
46276fae4e5dSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
46281f0ac6a5Smrg  esac
46291f0ac6a5Smrg
46309c9ff80cSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
46319c9ff80cSmrg    lt_cv_prog_compiler_rtti_exceptions,
46329c9ff80cSmrg    [-fno-rtti -fno-exceptions], [],
46339c9ff80cSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
46349c9ff80cSmrgfi
46359c9ff80cSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
46369c9ff80cSmrg	[Compiler flag to turn off builtin functions])
46379c9ff80cSmrg])# _LT_COMPILER_NO_RTTI
46381f0ac6a5Smrg
46391f0ac6a5Smrg
46409c9ff80cSmrg# _LT_CMD_GLOBAL_SYMBOLS
46419c9ff80cSmrg# ----------------------
46429c9ff80cSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
46439c9ff80cSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
46449c9ff80cSmrgAC_REQUIRE([AC_PROG_CC])dnl
46456fae4e5dSmrgAC_REQUIRE([AC_PROG_AWK])dnl
46469c9ff80cSmrgAC_REQUIRE([LT_PATH_NM])dnl
46479c9ff80cSmrgAC_REQUIRE([LT_PATH_LD])dnl
46489c9ff80cSmrgm4_require([_LT_DECL_SED])dnl
46499c9ff80cSmrgm4_require([_LT_DECL_EGREP])dnl
46509c9ff80cSmrgm4_require([_LT_TAG_COMPILER])dnl
46511f0ac6a5Smrg
46529c9ff80cSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
46539c9ff80cSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
46549c9ff80cSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
46551f0ac6a5Smrg[
46569c9ff80cSmrg# These are sane defaults that work on at least a few old systems.
46579c9ff80cSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
46581f0ac6a5Smrg
46599c9ff80cSmrg# Character class describing NM global symbol codes.
46609c9ff80cSmrgsymcode='[[BCDEGRST]]'
46611f0ac6a5Smrg
46629c9ff80cSmrg# Regexp to match symbols that can be accessed directly from C.
46639c9ff80cSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
46641f0ac6a5Smrg
46659c9ff80cSmrg# Define system-specific variables.
46669c9ff80cSmrgcase $host_os in
46679c9ff80cSmrgaix*)
46689c9ff80cSmrg  symcode='[[BCDT]]'
46699c9ff80cSmrg  ;;
46709c9ff80cSmrgcygwin* | mingw* | pw32* | cegcc*)
46719c9ff80cSmrg  symcode='[[ABCDGISTW]]'
46729c9ff80cSmrg  ;;
46739c9ff80cSmrghpux*)
46749c9ff80cSmrg  if test "$host_cpu" = ia64; then
46759c9ff80cSmrg    symcode='[[ABCDEGRST]]'
46769c9ff80cSmrg  fi
46779c9ff80cSmrg  ;;
46789c9ff80cSmrgirix* | nonstopux*)
46799c9ff80cSmrg  symcode='[[BCDEGRST]]'
46809c9ff80cSmrg  ;;
46819c9ff80cSmrgosf*)
46829c9ff80cSmrg  symcode='[[BCDEGQRST]]'
46839c9ff80cSmrg  ;;
46849c9ff80cSmrgsolaris*)
46859c9ff80cSmrg  symcode='[[BDRT]]'
46869c9ff80cSmrg  ;;
46879c9ff80cSmrgsco3.2v5*)
46889c9ff80cSmrg  symcode='[[DT]]'
46899c9ff80cSmrg  ;;
46909c9ff80cSmrgsysv4.2uw2*)
46919c9ff80cSmrg  symcode='[[DT]]'
46929c9ff80cSmrg  ;;
46939c9ff80cSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
46949c9ff80cSmrg  symcode='[[ABDT]]'
46959c9ff80cSmrg  ;;
46969c9ff80cSmrgsysv4)
46979c9ff80cSmrg  symcode='[[DFNSTU]]'
46989c9ff80cSmrg  ;;
46999c9ff80cSmrgesac
47001f0ac6a5Smrg
47019c9ff80cSmrg# If we're using GNU nm, then use its standard symbol codes.
47029c9ff80cSmrgcase `$NM -V 2>&1` in
47039c9ff80cSmrg*GNU* | *'with BFD'*)
47049c9ff80cSmrg  symcode='[[ABCDGIRSTW]]' ;;
47059c9ff80cSmrgesac
47061f0ac6a5Smrg
47079c9ff80cSmrg# Transform an extracted symbol line into a proper C declaration.
47089c9ff80cSmrg# Some systems (esp. on ia64) link data and code symbols differently,
47099c9ff80cSmrg# so use this general approach.
47109c9ff80cSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
47111f0ac6a5Smrg
47129c9ff80cSmrg# Transform an extracted symbol line into symbol name and symbol address
47136fae4e5dSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
47146fae4e5dSmrglt_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'"
47151f0ac6a5Smrg
47169c9ff80cSmrg# Handle CRLF in mingw tool chain
47179c9ff80cSmrgopt_cr=
47189c9ff80cSmrgcase $build_os in
47199c9ff80cSmrgmingw*)
47209c9ff80cSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
47219c9ff80cSmrg  ;;
47229c9ff80cSmrgesac
47231f0ac6a5Smrg
47249c9ff80cSmrg# Try without a prefix underscore, then with it.
47259c9ff80cSmrgfor ac_symprfx in "" "_"; do
47261f0ac6a5Smrg
47279c9ff80cSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
47289c9ff80cSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
47291f0ac6a5Smrg
47309c9ff80cSmrg  # Write the raw and C identifiers.
47319c9ff80cSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
47329c9ff80cSmrg    # Fake it for dumpbin and say T for any non-static function
47339c9ff80cSmrg    # and D for any global variable.
47349c9ff80cSmrg    # Also find C++ and __fastcall symbols from MSVC++,
47359c9ff80cSmrg    # which start with @ or ?.
47369c9ff80cSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
47379c9ff80cSmrg"     {last_section=section; section=\$ 3};"\
473889c04b6cSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
47399c9ff80cSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
47409c9ff80cSmrg"     \$ 0!~/External *\|/{next};"\
47419c9ff80cSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
47429c9ff80cSmrg"     {if(hide[section]) next};"\
47439c9ff80cSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
47449c9ff80cSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
47459c9ff80cSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
47469c9ff80cSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
47479c9ff80cSmrg"     ' prfx=^$ac_symprfx]"
47489c9ff80cSmrg  else
47499c9ff80cSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
47501f0ac6a5Smrg  fi
47516fae4e5dSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
47521f0ac6a5Smrg
47539c9ff80cSmrg  # Check to see that the pipe works correctly.
47549c9ff80cSmrg  pipe_works=no
47551f0ac6a5Smrg
47569c9ff80cSmrg  rm -f conftest*
47579c9ff80cSmrg  cat > conftest.$ac_ext <<_LT_EOF
47589c9ff80cSmrg#ifdef __cplusplus
47599c9ff80cSmrgextern "C" {
47609c9ff80cSmrg#endif
47619c9ff80cSmrgchar nm_test_var;
47629c9ff80cSmrgvoid nm_test_func(void);
47639c9ff80cSmrgvoid nm_test_func(void){}
47649c9ff80cSmrg#ifdef __cplusplus
47659c9ff80cSmrg}
47669c9ff80cSmrg#endif
47679c9ff80cSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
47689c9ff80cSmrg_LT_EOF
47691f0ac6a5Smrg
47709c9ff80cSmrg  if AC_TRY_EVAL(ac_compile); then
47719c9ff80cSmrg    # Now try to grab the symbols.
47729c9ff80cSmrg    nlist=conftest.nm
47736fae4e5dSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
47749c9ff80cSmrg      # Try sorting and uniquifying the output.
47759c9ff80cSmrg      if sort "$nlist" | uniq > "$nlist"T; then
47769c9ff80cSmrg	mv -f "$nlist"T "$nlist"
47779c9ff80cSmrg      else
47789c9ff80cSmrg	rm -f "$nlist"T
47799c9ff80cSmrg      fi
47801f0ac6a5Smrg
47819c9ff80cSmrg      # Make sure that we snagged all the symbols we need.
47829c9ff80cSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
47839c9ff80cSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
47849c9ff80cSmrg	  cat <<_LT_EOF > conftest.$ac_ext
47856fae4e5dSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
47866fae4e5dSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
47876fae4e5dSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
47886fae4e5dSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
47896fae4e5dSmrg# define LT@&t@_DLSYM_CONST
47906fae4e5dSmrg#elif defined(__osf__)
47916fae4e5dSmrg/* This system does not cope well with relocations in const data.  */
47926fae4e5dSmrg# define LT@&t@_DLSYM_CONST
47936fae4e5dSmrg#else
47946fae4e5dSmrg# define LT@&t@_DLSYM_CONST const
47956fae4e5dSmrg#endif
47966fae4e5dSmrg
47979c9ff80cSmrg#ifdef __cplusplus
47989c9ff80cSmrgextern "C" {
47999c9ff80cSmrg#endif
48001f0ac6a5Smrg
48019c9ff80cSmrg_LT_EOF
48029c9ff80cSmrg	  # Now generate the symbol file.
48039c9ff80cSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
48041f0ac6a5Smrg
48059c9ff80cSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
48061f0ac6a5Smrg
48079c9ff80cSmrg/* The mapping between symbol names and symbols.  */
48086fae4e5dSmrgLT@&t@_DLSYM_CONST struct {
48099c9ff80cSmrg  const char *name;
48109c9ff80cSmrg  void       *address;
48119c9ff80cSmrg}
48129c9ff80cSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
48139c9ff80cSmrg{
48149c9ff80cSmrg  { "@PROGRAM@", (void *) 0 },
48159c9ff80cSmrg_LT_EOF
48169c9ff80cSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
48179c9ff80cSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
48189c9ff80cSmrg  {0, (void *) 0}
48199c9ff80cSmrg};
48201f0ac6a5Smrg
48219c9ff80cSmrg/* This works around a problem in FreeBSD linker */
48229c9ff80cSmrg#ifdef FREEBSD_WORKAROUND
48239c9ff80cSmrgstatic const void *lt_preloaded_setup() {
48249c9ff80cSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
48259c9ff80cSmrg}
48269c9ff80cSmrg#endif
48271f0ac6a5Smrg
48289c9ff80cSmrg#ifdef __cplusplus
48299c9ff80cSmrg}
48309c9ff80cSmrg#endif
48319c9ff80cSmrg_LT_EOF
48329c9ff80cSmrg	  # Now try linking the two files.
48339c9ff80cSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
48346fae4e5dSmrg	  lt_globsym_save_LIBS=$LIBS
48356fae4e5dSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
48369c9ff80cSmrg	  LIBS="conftstm.$ac_objext"
48379c9ff80cSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
48389c9ff80cSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
48399c9ff80cSmrg	    pipe_works=yes
48409c9ff80cSmrg	  fi
48416fae4e5dSmrg	  LIBS=$lt_globsym_save_LIBS
48426fae4e5dSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
48439c9ff80cSmrg	else
48449c9ff80cSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
48459c9ff80cSmrg	fi
48469c9ff80cSmrg      else
48479c9ff80cSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
48489c9ff80cSmrg      fi
48491f0ac6a5Smrg    else
48509c9ff80cSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
48511f0ac6a5Smrg    fi
48521f0ac6a5Smrg  else
48539c9ff80cSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
48549c9ff80cSmrg    cat conftest.$ac_ext >&5
48551f0ac6a5Smrg  fi
48569c9ff80cSmrg  rm -rf conftest* conftst*
48571f0ac6a5Smrg
48589c9ff80cSmrg  # Do not use the global_symbol_pipe unless it works.
48599c9ff80cSmrg  if test "$pipe_works" = yes; then
48609c9ff80cSmrg    break
48619c9ff80cSmrg  else
48629c9ff80cSmrg    lt_cv_sys_global_symbol_pipe=
48639c9ff80cSmrg  fi
48646fae4e5dSmrgdone
48656fae4e5dSmrg])
48666fae4e5dSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
48676fae4e5dSmrg  lt_cv_sys_global_symbol_to_cdecl=
48686fae4e5dSmrgfi
48696fae4e5dSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
48706fae4e5dSmrg  AC_MSG_RESULT(failed)
48716fae4e5dSmrgelse
48726fae4e5dSmrg  AC_MSG_RESULT(ok)
48736fae4e5dSmrgfi
48746fae4e5dSmrg
48756fae4e5dSmrg# Response file support.
48766fae4e5dSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
48776fae4e5dSmrg  nm_file_list_spec='@'
48786fae4e5dSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
48796fae4e5dSmrg  nm_file_list_spec='@'
48806fae4e5dSmrgfi
48816fae4e5dSmrg
48826fae4e5dSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
48836fae4e5dSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
48846fae4e5dSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
48856fae4e5dSmrg    [Transform the output of nm in a proper C declaration])
48866fae4e5dSmrg_LT_DECL([global_symbol_to_c_name_address],
48876fae4e5dSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
48886fae4e5dSmrg    [Transform the output of nm in a C name address pair])
48896fae4e5dSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
48906fae4e5dSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
48916fae4e5dSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
48926fae4e5dSmrg_LT_DECL([], [nm_file_list_spec], [1],
48936fae4e5dSmrg    [Specify filename containing input files for $NM])
48946fae4e5dSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
48956fae4e5dSmrg
48966fae4e5dSmrg
48976fae4e5dSmrg# _LT_COMPILER_PIC([TAGNAME])
48986fae4e5dSmrg# ---------------------------
48996fae4e5dSmrgm4_defun([_LT_COMPILER_PIC],
49006fae4e5dSmrg[m4_require([_LT_TAG_COMPILER])dnl
49016fae4e5dSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
49026fae4e5dSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
49036fae4e5dSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
49046fae4e5dSmrg
49056fae4e5dSmrgm4_if([$1], [CXX], [
49066fae4e5dSmrg  # C++ specific cases for pic, static, wl, etc.
49076fae4e5dSmrg  if test "$GXX" = yes; then
49086fae4e5dSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
49096fae4e5dSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
49106fae4e5dSmrg
49116fae4e5dSmrg    case $host_os in
49126fae4e5dSmrg    aix*)
49136fae4e5dSmrg      # All AIX code is PIC.
49146fae4e5dSmrg      if test "$host_cpu" = ia64; then
49156fae4e5dSmrg	# AIX 5 now supports IA64 processor
49166fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
49176fae4e5dSmrg      fi
49186fae4e5dSmrg      ;;
49196fae4e5dSmrg
49206fae4e5dSmrg    amigaos*)
49216fae4e5dSmrg      case $host_cpu in
49226fae4e5dSmrg      powerpc)
49236fae4e5dSmrg            # see comment about AmigaOS4 .so support
49246fae4e5dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49256fae4e5dSmrg        ;;
49266fae4e5dSmrg      m68k)
49276fae4e5dSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
49286fae4e5dSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
49296fae4e5dSmrg            # like `-m68040'.
49306fae4e5dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
49316fae4e5dSmrg        ;;
49326fae4e5dSmrg      esac
49336fae4e5dSmrg      ;;
49346fae4e5dSmrg
49356fae4e5dSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
49366fae4e5dSmrg      # PIC is the default for these OSes.
49376fae4e5dSmrg      ;;
49386fae4e5dSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
49396fae4e5dSmrg      # This hack is so that the source file can tell whether it is being
49406fae4e5dSmrg      # built for inclusion in a dll (and should export symbols for example).
49416fae4e5dSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
49426fae4e5dSmrg      # (--disable-auto-import) libraries
49436fae4e5dSmrg      m4_if([$1], [GCJ], [],
49446fae4e5dSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
49456fae4e5dSmrg      ;;
49466fae4e5dSmrg    darwin* | rhapsody*)
49476fae4e5dSmrg      # PIC is the default on this platform
49486fae4e5dSmrg      # Common symbols not allowed in MH_DYLIB files
49496fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
49506fae4e5dSmrg      ;;
49516fae4e5dSmrg    *djgpp*)
49526fae4e5dSmrg      # DJGPP does not support shared libraries at all
49536fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
49546fae4e5dSmrg      ;;
49556fae4e5dSmrg    haiku*)
49566fae4e5dSmrg      # PIC is the default for Haiku.
49576fae4e5dSmrg      # The "-static" flag exists, but is broken.
49586fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
49596fae4e5dSmrg      ;;
49606fae4e5dSmrg    interix[[3-9]]*)
49616fae4e5dSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
49626fae4e5dSmrg      # Instead, we relocate shared libraries at runtime.
49636fae4e5dSmrg      ;;
49646fae4e5dSmrg    sysv4*MP*)
49656fae4e5dSmrg      if test -d /usr/nec; then
49666fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
49676fae4e5dSmrg      fi
49686fae4e5dSmrg      ;;
49696fae4e5dSmrg    hpux*)
49706fae4e5dSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
49716fae4e5dSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
49726fae4e5dSmrg      # sets the default TLS model and affects inlining.
49736fae4e5dSmrg      case $host_cpu in
49746fae4e5dSmrg      hppa*64*)
49756fae4e5dSmrg	;;
49766fae4e5dSmrg      *)
49776fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49786fae4e5dSmrg	;;
49796fae4e5dSmrg      esac
49806fae4e5dSmrg      ;;
49816fae4e5dSmrg    *qnx* | *nto*)
49826fae4e5dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
49836fae4e5dSmrg      # it will coredump.
49846fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
49856fae4e5dSmrg      ;;
49866fae4e5dSmrg    *)
49876fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49886fae4e5dSmrg      ;;
49896fae4e5dSmrg    esac
49906fae4e5dSmrg  else
49916fae4e5dSmrg    case $host_os in
49926fae4e5dSmrg      aix[[4-9]]*)
49936fae4e5dSmrg	# All AIX code is PIC.
49946fae4e5dSmrg	if test "$host_cpu" = ia64; then
49956fae4e5dSmrg	  # AIX 5 now supports IA64 processor
49966fae4e5dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
49976fae4e5dSmrg	else
49986fae4e5dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
49996fae4e5dSmrg	fi
50006fae4e5dSmrg	;;
50016fae4e5dSmrg      chorus*)
50026fae4e5dSmrg	case $cc_basename in
50036fae4e5dSmrg	cxch68*)
50046fae4e5dSmrg	  # Green Hills C++ Compiler
50056fae4e5dSmrg	  # _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"
50066fae4e5dSmrg	  ;;
50076fae4e5dSmrg	esac
50086fae4e5dSmrg	;;
50096fae4e5dSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
50106fae4e5dSmrg	# This hack is so that the source file can tell whether it is being
50116fae4e5dSmrg	# built for inclusion in a dll (and should export symbols for example).
50126fae4e5dSmrg	m4_if([$1], [GCJ], [],
50136fae4e5dSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
50146fae4e5dSmrg	;;
50156fae4e5dSmrg      dgux*)
50166fae4e5dSmrg	case $cc_basename in
50176fae4e5dSmrg	  ec++*)
50186fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50196fae4e5dSmrg	    ;;
50206fae4e5dSmrg	  ghcx*)
50216fae4e5dSmrg	    # Green Hills C++ Compiler
50226fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
50236fae4e5dSmrg	    ;;
50246fae4e5dSmrg	  *)
50256fae4e5dSmrg	    ;;
50266fae4e5dSmrg	esac
50276fae4e5dSmrg	;;
50286fae4e5dSmrg      freebsd* | dragonfly*)
50296fae4e5dSmrg	# FreeBSD uses GNU C++
50306fae4e5dSmrg	;;
50316fae4e5dSmrg      hpux9* | hpux10* | hpux11*)
50326fae4e5dSmrg	case $cc_basename in
50336fae4e5dSmrg	  CC*)
50346fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50356fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
50366fae4e5dSmrg	    if test "$host_cpu" != ia64; then
50376fae4e5dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
50386fae4e5dSmrg	    fi
50396fae4e5dSmrg	    ;;
50406fae4e5dSmrg	  aCC*)
50416fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50426fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
50436fae4e5dSmrg	    case $host_cpu in
50446fae4e5dSmrg	    hppa*64*|ia64*)
50456fae4e5dSmrg	      # +Z the default
50466fae4e5dSmrg	      ;;
50476fae4e5dSmrg	    *)
50486fae4e5dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
50496fae4e5dSmrg	      ;;
50506fae4e5dSmrg	    esac
50516fae4e5dSmrg	    ;;
50526fae4e5dSmrg	  *)
50536fae4e5dSmrg	    ;;
50546fae4e5dSmrg	esac
50556fae4e5dSmrg	;;
50566fae4e5dSmrg      interix*)
50576fae4e5dSmrg	# This is c89, which is MS Visual C++ (no shared libs)
50586fae4e5dSmrg	# Anyone wants to do a port?
50596fae4e5dSmrg	;;
50606fae4e5dSmrg      irix5* | irix6* | nonstopux*)
50616fae4e5dSmrg	case $cc_basename in
50626fae4e5dSmrg	  CC*)
50636fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50646fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
50656fae4e5dSmrg	    # CC pic flag -KPIC is the default.
50666fae4e5dSmrg	    ;;
50676fae4e5dSmrg	  *)
50686fae4e5dSmrg	    ;;
50696fae4e5dSmrg	esac
50706fae4e5dSmrg	;;
50716fae4e5dSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
50726fae4e5dSmrg	case $cc_basename in
50736fae4e5dSmrg	  KCC*)
50746fae4e5dSmrg	    # KAI C++ Compiler
50756fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
50766fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
50776fae4e5dSmrg	    ;;
50786fae4e5dSmrg	  ecpc* )
50796fae4e5dSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
50806fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50816fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50826fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
50836fae4e5dSmrg	    ;;
50846fae4e5dSmrg	  icpc* )
50856fae4e5dSmrg	    # Intel C++, used to be incompatible with GCC.
50866fae4e5dSmrg	    # ICC 10 doesn't accept -KPIC any more.
50876fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50886fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
50896fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
50906fae4e5dSmrg	    ;;
50916fae4e5dSmrg	  pgCC* | pgcpp*)
50926fae4e5dSmrg	    # Portland Group C++ compiler
50936fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50946fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
50956fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
50966fae4e5dSmrg	    ;;
50976fae4e5dSmrg	  cxx*)
50986fae4e5dSmrg	    # Compaq C++
50996fae4e5dSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
51006fae4e5dSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
51016fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
51026fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
51036fae4e5dSmrg	    ;;
51046fae4e5dSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
51056fae4e5dSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
51066fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51076fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
51086fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
51096fae4e5dSmrg	    ;;
51106fae4e5dSmrg	  *)
51116fae4e5dSmrg	    case `$CC -V 2>&1 | sed 5q` in
51126fae4e5dSmrg	    *Sun\ C*)
51136fae4e5dSmrg	      # Sun C++ 5.9
51146fae4e5dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
51156fae4e5dSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51166fae4e5dSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
51176fae4e5dSmrg	      ;;
51186fae4e5dSmrg	    esac
51196fae4e5dSmrg	    ;;
51206fae4e5dSmrg	esac
51216fae4e5dSmrg	;;
51226fae4e5dSmrg      lynxos*)
51236fae4e5dSmrg	;;
51246fae4e5dSmrg      m88k*)
51256fae4e5dSmrg	;;
51266fae4e5dSmrg      mvs*)
51276fae4e5dSmrg	case $cc_basename in
51286fae4e5dSmrg	  cxx*)
51296fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
51306fae4e5dSmrg	    ;;
51316fae4e5dSmrg	  *)
51326fae4e5dSmrg	    ;;
51336fae4e5dSmrg	esac
51346fae4e5dSmrg	;;
51356fae4e5dSmrg      netbsd*)
51366fae4e5dSmrg	;;
51376fae4e5dSmrg      *qnx* | *nto*)
51386fae4e5dSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
51396fae4e5dSmrg        # it will coredump.
51406fae4e5dSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
51416fae4e5dSmrg        ;;
51426fae4e5dSmrg      osf3* | osf4* | osf5*)
51436fae4e5dSmrg	case $cc_basename in
51446fae4e5dSmrg	  KCC*)
51456fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
51466fae4e5dSmrg	    ;;
51476fae4e5dSmrg	  RCC*)
51486fae4e5dSmrg	    # Rational C++ 2.4.1
51496fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51506fae4e5dSmrg	    ;;
51516fae4e5dSmrg	  cxx*)
51526fae4e5dSmrg	    # Digital/Compaq C++
51536fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51546fae4e5dSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
51556fae4e5dSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
51566fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
51576fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
51586fae4e5dSmrg	    ;;
51596fae4e5dSmrg	  *)
51606fae4e5dSmrg	    ;;
51616fae4e5dSmrg	esac
51626fae4e5dSmrg	;;
51636fae4e5dSmrg      psos*)
51646fae4e5dSmrg	;;
51656fae4e5dSmrg      solaris*)
51666fae4e5dSmrg	case $cc_basename in
51676fae4e5dSmrg	  CC* | sunCC*)
51686fae4e5dSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
51696fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
51706fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51716fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
51726fae4e5dSmrg	    ;;
51736fae4e5dSmrg	  gcx*)
51746fae4e5dSmrg	    # Green Hills C++ Compiler
51756fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
51766fae4e5dSmrg	    ;;
51776fae4e5dSmrg	  *)
51786fae4e5dSmrg	    ;;
51796fae4e5dSmrg	esac
51806fae4e5dSmrg	;;
51816fae4e5dSmrg      sunos4*)
51826fae4e5dSmrg	case $cc_basename in
51836fae4e5dSmrg	  CC*)
51846fae4e5dSmrg	    # Sun C++ 4.x
51856fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51866fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51876fae4e5dSmrg	    ;;
51886fae4e5dSmrg	  lcc*)
51896fae4e5dSmrg	    # Lucid
51906fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51916fae4e5dSmrg	    ;;
51926fae4e5dSmrg	  *)
51936fae4e5dSmrg	    ;;
51946fae4e5dSmrg	esac
51956fae4e5dSmrg	;;
51966fae4e5dSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
51976fae4e5dSmrg	case $cc_basename in
51986fae4e5dSmrg	  CC*)
51996fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52006fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52016fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52026fae4e5dSmrg	    ;;
52036fae4e5dSmrg	esac
52046fae4e5dSmrg	;;
52056fae4e5dSmrg      tandem*)
52066fae4e5dSmrg	case $cc_basename in
52076fae4e5dSmrg	  NCC*)
52086fae4e5dSmrg	    # NonStop-UX NCC 3.20
52096fae4e5dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52106fae4e5dSmrg	    ;;
52116fae4e5dSmrg	  *)
52126fae4e5dSmrg	    ;;
52136fae4e5dSmrg	esac
52146fae4e5dSmrg	;;
52156fae4e5dSmrg      vxworks*)
52166fae4e5dSmrg	;;
52176fae4e5dSmrg      *)
52186fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
52196fae4e5dSmrg	;;
52206fae4e5dSmrg    esac
52216fae4e5dSmrg  fi
52226fae4e5dSmrg],
52236fae4e5dSmrg[
52246fae4e5dSmrg  if test "$GCC" = yes; then
52259c9ff80cSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52269c9ff80cSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
52271f0ac6a5Smrg
52289c9ff80cSmrg    case $host_os in
52296fae4e5dSmrg      aix*)
52309c9ff80cSmrg      # All AIX code is PIC.
52311f0ac6a5Smrg      if test "$host_cpu" = ia64; then
52329c9ff80cSmrg	# AIX 5 now supports IA64 processor
52339c9ff80cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52341f0ac6a5Smrg      fi
52359c9ff80cSmrg      ;;
52361f0ac6a5Smrg
52379c9ff80cSmrg    amigaos*)
52389c9ff80cSmrg      case $host_cpu in
52399c9ff80cSmrg      powerpc)
52409c9ff80cSmrg            # see comment about AmigaOS4 .so support
52419c9ff80cSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
52429c9ff80cSmrg        ;;
52439c9ff80cSmrg      m68k)
52449c9ff80cSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
52459c9ff80cSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
52469c9ff80cSmrg            # like `-m68040'.
52479c9ff80cSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
52481f0ac6a5Smrg        ;;
52499c9ff80cSmrg      esac
52509c9ff80cSmrg      ;;
52511f0ac6a5Smrg
52529c9ff80cSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
52539c9ff80cSmrg      # PIC is the default for these OSes.
52549c9ff80cSmrg      ;;
52556fae4e5dSmrg
52566fae4e5dSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
52579c9ff80cSmrg      # This hack is so that the source file can tell whether it is being
52589c9ff80cSmrg      # built for inclusion in a dll (and should export symbols for example).
52599c9ff80cSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
52609c9ff80cSmrg      # (--disable-auto-import) libraries
52619c9ff80cSmrg      m4_if([$1], [GCJ], [],
52629c9ff80cSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
52639c9ff80cSmrg      ;;
52646fae4e5dSmrg
52659c9ff80cSmrg    darwin* | rhapsody*)
52669c9ff80cSmrg      # PIC is the default on this platform
52679c9ff80cSmrg      # Common symbols not allowed in MH_DYLIB files
52689c9ff80cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
52699c9ff80cSmrg      ;;
52706fae4e5dSmrg
52716fae4e5dSmrg    haiku*)
52726fae4e5dSmrg      # PIC is the default for Haiku.
52736fae4e5dSmrg      # The "-static" flag exists, but is broken.
52746fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
52756fae4e5dSmrg      ;;
52766fae4e5dSmrg
52776fae4e5dSmrg    hpux*)
52786fae4e5dSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
52796fae4e5dSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
52806fae4e5dSmrg      # sets the default TLS model and affects inlining.
52816fae4e5dSmrg      case $host_cpu in
52826fae4e5dSmrg      hppa*64*)
52836fae4e5dSmrg	# +Z the default
52846fae4e5dSmrg	;;
52856fae4e5dSmrg      *)
52866fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
52876fae4e5dSmrg	;;
52886fae4e5dSmrg      esac
52896fae4e5dSmrg      ;;
52906fae4e5dSmrg
52916fae4e5dSmrg    interix[[3-9]]*)
52926fae4e5dSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
52936fae4e5dSmrg      # Instead, we relocate shared libraries at runtime.
52946fae4e5dSmrg      ;;
52956fae4e5dSmrg
52966fae4e5dSmrg    msdosdjgpp*)
52976fae4e5dSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
52986fae4e5dSmrg      # on systems that don't support them.
52996fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
53006fae4e5dSmrg      enable_shared=no
53016fae4e5dSmrg      ;;
53026fae4e5dSmrg
53036fae4e5dSmrg    *nto* | *qnx*)
53046fae4e5dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
53056fae4e5dSmrg      # it will coredump.
53066fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
53076fae4e5dSmrg      ;;
53086fae4e5dSmrg
53096fae4e5dSmrg    sysv4*MP*)
53106fae4e5dSmrg      if test -d /usr/nec; then
53116fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
53126fae4e5dSmrg      fi
53136fae4e5dSmrg      ;;
53146fae4e5dSmrg
53156fae4e5dSmrg    *)
53166fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
53176fae4e5dSmrg      ;;
53186fae4e5dSmrg    esac
53196fae4e5dSmrg
53206fae4e5dSmrg    case $cc_basename in
53216fae4e5dSmrg    nvcc*) # Cuda Compiler Driver 2.2
53226fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
532389c04b6cSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
532489c04b6cSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
532589c04b6cSmrg      fi
53266fae4e5dSmrg      ;;
53276fae4e5dSmrg    esac
53286fae4e5dSmrg  else
53296fae4e5dSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
53306fae4e5dSmrg    case $host_os in
53316fae4e5dSmrg    aix*)
53326fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53336fae4e5dSmrg      if test "$host_cpu" = ia64; then
53346fae4e5dSmrg	# AIX 5 now supports IA64 processor
53356fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
53366fae4e5dSmrg      else
53376fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
53386fae4e5dSmrg      fi
53396fae4e5dSmrg      ;;
53406fae4e5dSmrg
53416fae4e5dSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
53426fae4e5dSmrg      # This hack is so that the source file can tell whether it is being
53436fae4e5dSmrg      # built for inclusion in a dll (and should export symbols for example).
53446fae4e5dSmrg      m4_if([$1], [GCJ], [],
53456fae4e5dSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
53466fae4e5dSmrg      ;;
53476fae4e5dSmrg
53486fae4e5dSmrg    hpux9* | hpux10* | hpux11*)
53496fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53506fae4e5dSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
53516fae4e5dSmrg      # not for PA HP-UX.
53526fae4e5dSmrg      case $host_cpu in
53536fae4e5dSmrg      hppa*64*|ia64*)
53546fae4e5dSmrg	# +Z the default
53556fae4e5dSmrg	;;
53566fae4e5dSmrg      *)
53576fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
53586fae4e5dSmrg	;;
53596fae4e5dSmrg      esac
53606fae4e5dSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
53616fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
53626fae4e5dSmrg      ;;
53636fae4e5dSmrg
53646fae4e5dSmrg    irix5* | irix6* | nonstopux*)
53656fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53666fae4e5dSmrg      # PIC (with -KPIC) is the default.
53676fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
53686fae4e5dSmrg      ;;
53696fae4e5dSmrg
53706fae4e5dSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
53716fae4e5dSmrg      case $cc_basename in
53726fae4e5dSmrg      # old Intel for x86_64 which still supported -KPIC.
53736fae4e5dSmrg      ecc*)
53746fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53756fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
53766fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
53776fae4e5dSmrg        ;;
53786fae4e5dSmrg      # icc used to be incompatible with GCC.
53796fae4e5dSmrg      # ICC 10 doesn't accept -KPIC any more.
53806fae4e5dSmrg      icc* | ifort*)
53816fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53826fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
53836fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
53846fae4e5dSmrg        ;;
53856fae4e5dSmrg      # Lahey Fortran 8.1.
53866fae4e5dSmrg      lf95*)
53876fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53886fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
53896fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
53906fae4e5dSmrg	;;
53916fae4e5dSmrg      nagfor*)
53926fae4e5dSmrg	# NAG Fortran compiler
53936fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
53946fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
53956fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
53966fae4e5dSmrg	;;
53976fae4e5dSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
53986fae4e5dSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
53996fae4e5dSmrg	# which looks to be a dead project)
54006fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54016fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
54026fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54036fae4e5dSmrg        ;;
54046fae4e5dSmrg      ccc*)
54056fae4e5dSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54066fae4e5dSmrg        # All Alpha code is PIC.
54076fae4e5dSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54086fae4e5dSmrg        ;;
54096fae4e5dSmrg      xl* | bgxl* | bgf* | mpixl*)
54106fae4e5dSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
54116fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54126fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
54136fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
54146fae4e5dSmrg	;;
54156fae4e5dSmrg      *)
54166fae4e5dSmrg	case `$CC -V 2>&1 | sed 5q` in
541789c04b6cSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
54186fae4e5dSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
54196fae4e5dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54206fae4e5dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54216fae4e5dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
54226fae4e5dSmrg	  ;;
542389c04b6cSmrg	*Sun\ F* | *Sun*Fortran*)
542489c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
542589c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
542689c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
542789c04b6cSmrg	  ;;
54286fae4e5dSmrg	*Sun\ C*)
54296fae4e5dSmrg	  # Sun C 5.9
54306fae4e5dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54316fae4e5dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54326fae4e5dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54336fae4e5dSmrg	  ;;
543489c04b6cSmrg        *Intel*\ [[CF]]*Compiler*)
543589c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
543689c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
543789c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
543889c04b6cSmrg	  ;;
543989c04b6cSmrg	*Portland\ Group*)
544089c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
544189c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
544289c04b6cSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
544389c04b6cSmrg	  ;;
54446fae4e5dSmrg	esac
54456fae4e5dSmrg	;;
54466fae4e5dSmrg      esac
54476fae4e5dSmrg      ;;
54486fae4e5dSmrg
54496fae4e5dSmrg    newsos6)
54506fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54516fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54526fae4e5dSmrg      ;;
54536fae4e5dSmrg
54546fae4e5dSmrg    *nto* | *qnx*)
54556fae4e5dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
54566fae4e5dSmrg      # it will coredump.
54576fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
54586fae4e5dSmrg      ;;
54596fae4e5dSmrg
54606fae4e5dSmrg    osf3* | osf4* | osf5*)
54616fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54626fae4e5dSmrg      # All OSF/1 code is PIC.
54636fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54646fae4e5dSmrg      ;;
54656fae4e5dSmrg
54666fae4e5dSmrg    rdos*)
54676fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54686fae4e5dSmrg      ;;
54696fae4e5dSmrg
54706fae4e5dSmrg    solaris*)
54716fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54726fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54736fae4e5dSmrg      case $cc_basename in
54746fae4e5dSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
54756fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
54766fae4e5dSmrg      *)
54776fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
54786fae4e5dSmrg      esac
54796fae4e5dSmrg      ;;
54806fae4e5dSmrg
54816fae4e5dSmrg    sunos4*)
54826fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
54836fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
54846fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54859c9ff80cSmrg      ;;
54866fae4e5dSmrg
54876fae4e5dSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
54886fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54896fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54906fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54919c9ff80cSmrg      ;;
54926fae4e5dSmrg
54939c9ff80cSmrg    sysv4*MP*)
54946fae4e5dSmrg      if test -d /usr/nec ;then
54956fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
54966fae4e5dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54979c9ff80cSmrg      fi
54989c9ff80cSmrg      ;;
54996fae4e5dSmrg
55006fae4e5dSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
55016fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55026fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
55036fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55041f0ac6a5Smrg      ;;
55056fae4e5dSmrg
55066fae4e5dSmrg    unicos*)
55076fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55086fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
55096fae4e5dSmrg      ;;
55106fae4e5dSmrg
55116fae4e5dSmrg    uts4*)
55126fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
55136fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55141f0ac6a5Smrg      ;;
55156fae4e5dSmrg
55161f0ac6a5Smrg    *)
55176fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
55181f0ac6a5Smrg      ;;
55191f0ac6a5Smrg    esac
55206fae4e5dSmrg  fi
55216fae4e5dSmrg])
55226fae4e5dSmrgcase $host_os in
55236fae4e5dSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
55246fae4e5dSmrg  *djgpp*)
55256fae4e5dSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
55266fae4e5dSmrg    ;;
55276fae4e5dSmrg  *)
55286fae4e5dSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
55296fae4e5dSmrg    ;;
55306fae4e5dSmrgesac
55316fae4e5dSmrg
55326fae4e5dSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
55336fae4e5dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
55346fae4e5dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
55356fae4e5dSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
55366fae4e5dSmrg
55376fae4e5dSmrg#
55386fae4e5dSmrg# Check to make sure the PIC flag actually works.
55396fae4e5dSmrg#
55406fae4e5dSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
55416fae4e5dSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
55426fae4e5dSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
55436fae4e5dSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
55446fae4e5dSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
55456fae4e5dSmrg     "" | " "*) ;;
55466fae4e5dSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
55476fae4e5dSmrg     esac],
55486fae4e5dSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
55496fae4e5dSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
55506fae4e5dSmrgfi
55516fae4e5dSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
55526fae4e5dSmrg	[Additional compiler flags for building library objects])
55536fae4e5dSmrg
55546fae4e5dSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
55556fae4e5dSmrg	[How to pass a linker flag through the compiler])
55566fae4e5dSmrg#
55576fae4e5dSmrg# Check to make sure the static flag actually works.
55586fae4e5dSmrg#
55596fae4e5dSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
55606fae4e5dSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
55616fae4e5dSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
55626fae4e5dSmrg  $lt_tmp_static_flag,
55636fae4e5dSmrg  [],
55646fae4e5dSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
55656fae4e5dSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
55666fae4e5dSmrg	[Compiler flag to prevent dynamic linking])
55676fae4e5dSmrg])# _LT_COMPILER_PIC
55686fae4e5dSmrg
55696fae4e5dSmrg
55706fae4e5dSmrg# _LT_LINKER_SHLIBS([TAGNAME])
55716fae4e5dSmrg# ----------------------------
55726fae4e5dSmrg# See if the linker supports building shared libraries.
55736fae4e5dSmrgm4_defun([_LT_LINKER_SHLIBS],
55746fae4e5dSmrg[AC_REQUIRE([LT_PATH_LD])dnl
55756fae4e5dSmrgAC_REQUIRE([LT_PATH_NM])dnl
55766fae4e5dSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
55776fae4e5dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
55786fae4e5dSmrgm4_require([_LT_DECL_EGREP])dnl
55796fae4e5dSmrgm4_require([_LT_DECL_SED])dnl
55806fae4e5dSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
55816fae4e5dSmrgm4_require([_LT_TAG_COMPILER])dnl
55826fae4e5dSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
55836fae4e5dSmrgm4_if([$1], [CXX], [
55846fae4e5dSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
55856fae4e5dSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
55866fae4e5dSmrg  case $host_os in
55876fae4e5dSmrg  aix[[4-9]]*)
55886fae4e5dSmrg    # If we're using GNU nm, then we don't want the "-C" option.
55896fae4e5dSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
55906fae4e5dSmrg    # Also, AIX nm treats weak defined symbols like other global defined
55916fae4e5dSmrg    # symbols, whereas GNU nm marks them as "W".
55926fae4e5dSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
55936fae4e5dSmrg      _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'
55946fae4e5dSmrg    else
55956fae4e5dSmrg      _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'
55966fae4e5dSmrg    fi
55976fae4e5dSmrg    ;;
55986fae4e5dSmrg  pw32*)
55996fae4e5dSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
56006fae4e5dSmrg    ;;
56016fae4e5dSmrg  cygwin* | mingw* | cegcc*)
56026fae4e5dSmrg    case $cc_basename in
560389c04b6cSmrg    cl*)
560489c04b6cSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
560589c04b6cSmrg      ;;
56066fae4e5dSmrg    *)
56076fae4e5dSmrg      _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'
56086fae4e5dSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
56096fae4e5dSmrg      ;;
56106fae4e5dSmrg    esac
56116fae4e5dSmrg    ;;
56126fae4e5dSmrg  *)
56136fae4e5dSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
56146fae4e5dSmrg    ;;
56156fae4e5dSmrg  esac
56166fae4e5dSmrg], [
56176fae4e5dSmrg  runpath_var=
56186fae4e5dSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
56196fae4e5dSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
56206fae4e5dSmrg  _LT_TAGVAR(archive_cmds, $1)=
56216fae4e5dSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
56226fae4e5dSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
56236fae4e5dSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
56246fae4e5dSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
56256fae4e5dSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
56266fae4e5dSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
56276fae4e5dSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
56286fae4e5dSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
56296fae4e5dSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
56306fae4e5dSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
56316fae4e5dSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
56326fae4e5dSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
56336fae4e5dSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
56346fae4e5dSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
56356fae4e5dSmrg  _LT_TAGVAR(module_cmds, $1)=
56366fae4e5dSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
56376fae4e5dSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
56386fae4e5dSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
56396fae4e5dSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
56406fae4e5dSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
56416fae4e5dSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
56426fae4e5dSmrg  # included in the symbol list
56436fae4e5dSmrg  _LT_TAGVAR(include_expsyms, $1)=
56446fae4e5dSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
56456fae4e5dSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
56466fae4e5dSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
56476fae4e5dSmrg  # as well as any symbol that contains `d'.
56486fae4e5dSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
56496fae4e5dSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
56506fae4e5dSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
56516fae4e5dSmrg  # the symbol is explicitly referenced.  Since portable code cannot
56526fae4e5dSmrg  # rely on this symbol name, it's probably fine to never include it in
56536fae4e5dSmrg  # preloaded symbol tables.
56546fae4e5dSmrg  # Exclude shared library initialization/finalization symbols.
56556fae4e5dSmrgdnl Note also adjust exclude_expsyms for C++ above.
56566fae4e5dSmrg  extract_expsyms_cmds=
56576fae4e5dSmrg
56586fae4e5dSmrg  case $host_os in
56596fae4e5dSmrg  cygwin* | mingw* | pw32* | cegcc*)
56606fae4e5dSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
56616fae4e5dSmrg    # When not using gcc, we currently assume that we are using
56626fae4e5dSmrg    # Microsoft Visual C++.
56636fae4e5dSmrg    if test "$GCC" != yes; then
56646fae4e5dSmrg      with_gnu_ld=no
56656fae4e5dSmrg    fi
56666fae4e5dSmrg    ;;
56676fae4e5dSmrg  interix*)
56686fae4e5dSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
56696fae4e5dSmrg    with_gnu_ld=yes
56706fae4e5dSmrg    ;;
56716fae4e5dSmrg  openbsd*)
56726fae4e5dSmrg    with_gnu_ld=no
56736fae4e5dSmrg    ;;
56746fae4e5dSmrg  esac
56756fae4e5dSmrg
56766fae4e5dSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
56776fae4e5dSmrg
56786fae4e5dSmrg  # On some targets, GNU ld is compatible enough with the native linker
56796fae4e5dSmrg  # that we're better off using the native interface for both.
56806fae4e5dSmrg  lt_use_gnu_ld_interface=no
56816fae4e5dSmrg  if test "$with_gnu_ld" = yes; then
56826fae4e5dSmrg    case $host_os in
56836fae4e5dSmrg      aix*)
56846fae4e5dSmrg	# The AIX port of GNU ld has always aspired to compatibility
56856fae4e5dSmrg	# with the native linker.  However, as the warning in the GNU ld
56866fae4e5dSmrg	# block says, versions before 2.19.5* couldn't really create working
56876fae4e5dSmrg	# shared libraries, regardless of the interface used.
56886fae4e5dSmrg	case `$LD -v 2>&1` in
56896fae4e5dSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
56906fae4e5dSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
56916fae4e5dSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
56929c9ff80cSmrg	  *)
56936fae4e5dSmrg	    lt_use_gnu_ld_interface=yes
56949c9ff80cSmrg	    ;;
56959c9ff80cSmrg	esac
56961f0ac6a5Smrg	;;
56976fae4e5dSmrg      *)
56986fae4e5dSmrg	lt_use_gnu_ld_interface=yes
56991f0ac6a5Smrg	;;
57006fae4e5dSmrg    esac
57016fae4e5dSmrg  fi
57026fae4e5dSmrg
57036fae4e5dSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
57046fae4e5dSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
57056fae4e5dSmrg    wlarc='${wl}'
57066fae4e5dSmrg
57076fae4e5dSmrg    # Set some defaults for GNU ld with shared library support. These
57086fae4e5dSmrg    # are reset later if shared libraries are not supported. Putting them
57096fae4e5dSmrg    # here allows them to be overridden if necessary.
57106fae4e5dSmrg    runpath_var=LD_RUN_PATH
57116fae4e5dSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
57126fae4e5dSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
57136fae4e5dSmrg    # ancient GNU ld didn't support --whole-archive et. al.
57146fae4e5dSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
57156fae4e5dSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
57166fae4e5dSmrg    else
57176fae4e5dSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
57186fae4e5dSmrg    fi
57196fae4e5dSmrg    supports_anon_versioning=no
57206fae4e5dSmrg    case `$LD -v 2>&1` in
57216fae4e5dSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
57226fae4e5dSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
57236fae4e5dSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
57246fae4e5dSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
57256fae4e5dSmrg      *\ 2.11.*) ;; # other 2.11 versions
57266fae4e5dSmrg      *) supports_anon_versioning=yes ;;
57276fae4e5dSmrg    esac
57286fae4e5dSmrg
57296fae4e5dSmrg    # See if GNU ld supports shared libraries.
57306fae4e5dSmrg    case $host_os in
57316fae4e5dSmrg    aix[[3-9]]*)
57326fae4e5dSmrg      # On AIX/PPC, the GNU linker is very broken
57336fae4e5dSmrg      if test "$host_cpu" != ia64; then
57346fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
57356fae4e5dSmrg	cat <<_LT_EOF 1>&2
57366fae4e5dSmrg
57376fae4e5dSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
57386fae4e5dSmrg*** to be unable to reliably create shared libraries on AIX.
57396fae4e5dSmrg*** Therefore, libtool is disabling shared libraries support.  If you
57406fae4e5dSmrg*** really care for shared libraries, you may want to install binutils
57416fae4e5dSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
57426fae4e5dSmrg*** You will then need to restart the configuration process.
57436fae4e5dSmrg
57446fae4e5dSmrg_LT_EOF
57456fae4e5dSmrg      fi
57466fae4e5dSmrg      ;;
57476fae4e5dSmrg
57486fae4e5dSmrg    amigaos*)
57496fae4e5dSmrg      case $host_cpu in
57506fae4e5dSmrg      powerpc)
57516fae4e5dSmrg            # see comment about AmigaOS4 .so support
57526fae4e5dSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
57536fae4e5dSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
57549c9ff80cSmrg        ;;
57556fae4e5dSmrg      m68k)
57566fae4e5dSmrg            _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)'
57576fae4e5dSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
57586fae4e5dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
57596fae4e5dSmrg        ;;
57606fae4e5dSmrg      esac
57616fae4e5dSmrg      ;;
57626fae4e5dSmrg
57636fae4e5dSmrg    beos*)
57646fae4e5dSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
57656fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
57666fae4e5dSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
57676fae4e5dSmrg	# support --undefined.  This deserves some investigation.  FIXME
57686fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
57696fae4e5dSmrg      else
57706fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
57716fae4e5dSmrg      fi
57726fae4e5dSmrg      ;;
57736fae4e5dSmrg
57746fae4e5dSmrg    cygwin* | mingw* | pw32* | cegcc*)
57756fae4e5dSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
57766fae4e5dSmrg      # as there is no search path for DLLs.
57776fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
57786fae4e5dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
57796fae4e5dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
57806fae4e5dSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
57816fae4e5dSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
57826fae4e5dSmrg      _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'
57836fae4e5dSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
57846fae4e5dSmrg
57856fae4e5dSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
57866fae4e5dSmrg        _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'
57876fae4e5dSmrg	# If the export-symbols file already is a .def file (1st line
57886fae4e5dSmrg	# is EXPORTS), use it as is; otherwise, prepend...
57896fae4e5dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
57906fae4e5dSmrg	  cp $export_symbols $output_objdir/$soname.def;
57916fae4e5dSmrg	else
57926fae4e5dSmrg	  echo EXPORTS > $output_objdir/$soname.def;
57936fae4e5dSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
57946fae4e5dSmrg	fi~
57956fae4e5dSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
57966fae4e5dSmrg      else
57976fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
57986fae4e5dSmrg      fi
57996fae4e5dSmrg      ;;
58006fae4e5dSmrg
58016fae4e5dSmrg    haiku*)
58026fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
58036fae4e5dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
58046fae4e5dSmrg      ;;
58056fae4e5dSmrg
58066fae4e5dSmrg    interix[[3-9]]*)
58076fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
58086fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58096fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
58106fae4e5dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
58116fae4e5dSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
58126fae4e5dSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
58136fae4e5dSmrg      # default) and relocated if they conflict, which is a slow very memory
58146fae4e5dSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
58156fae4e5dSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
58166fae4e5dSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
58176fae4e5dSmrg      _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'
58186fae4e5dSmrg      _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'
58196fae4e5dSmrg      ;;
58206fae4e5dSmrg
58216fae4e5dSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
58226fae4e5dSmrg      tmp_diet=no
58236fae4e5dSmrg      if test "$host_os" = linux-dietlibc; then
58249c9ff80cSmrg	case $cc_basename in
58256fae4e5dSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
58261f0ac6a5Smrg	esac
58276fae4e5dSmrg      fi
58286fae4e5dSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
58296fae4e5dSmrg	 && test "$tmp_diet" = no
58306fae4e5dSmrg      then
58316fae4e5dSmrg	tmp_addflag=' $pic_flag'
58326fae4e5dSmrg	tmp_sharedflag='-shared'
58336fae4e5dSmrg	case $cc_basename,$host_cpu in
58346fae4e5dSmrg        pgcc*)				# Portland Group C compiler
58356fae4e5dSmrg	  _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'
58366fae4e5dSmrg	  tmp_addflag=' $pic_flag'
58376fae4e5dSmrg	  ;;
58386fae4e5dSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
58396fae4e5dSmrg					# Portland Group f77 and f90 compilers
58406fae4e5dSmrg	  _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'
58416fae4e5dSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
58426fae4e5dSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
58436fae4e5dSmrg	  tmp_addflag=' -i_dynamic' ;;
58446fae4e5dSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
58456fae4e5dSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
58466fae4e5dSmrg	ifc* | ifort*)			# Intel Fortran compiler
58476fae4e5dSmrg	  tmp_addflag=' -nofor_main' ;;
58486fae4e5dSmrg	lf95*)				# Lahey Fortran 8.1
58496fae4e5dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
58506fae4e5dSmrg	  tmp_sharedflag='--shared' ;;
58516fae4e5dSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
58526fae4e5dSmrg	  tmp_sharedflag='-qmkshrobj'
58536fae4e5dSmrg	  tmp_addflag= ;;
58546fae4e5dSmrg	nvcc*)	# Cuda Compiler Driver 2.2
58556fae4e5dSmrg	  _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'
58566fae4e5dSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
58576fae4e5dSmrg	  ;;
58589c9ff80cSmrg	esac
58596fae4e5dSmrg	case `$CC -V 2>&1 | sed 5q` in
58606fae4e5dSmrg	*Sun\ C*)			# Sun C 5.9
58616fae4e5dSmrg	  _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'
58626fae4e5dSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
58636fae4e5dSmrg	  tmp_sharedflag='-G' ;;
58646fae4e5dSmrg	*Sun\ F*)			# Sun Fortran 8.3
58656fae4e5dSmrg	  tmp_sharedflag='-G' ;;
58669c9ff80cSmrg	esac
58676fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
58686fae4e5dSmrg
58696fae4e5dSmrg        if test "x$supports_anon_versioning" = xyes; then
58706fae4e5dSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
58716fae4e5dSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
58726fae4e5dSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
58736fae4e5dSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
58746fae4e5dSmrg        fi
58756fae4e5dSmrg
58769c9ff80cSmrg	case $cc_basename in
58776fae4e5dSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
58786fae4e5dSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
58796fae4e5dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
588089c04b6cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
58816fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
58826fae4e5dSmrg	  if test "x$supports_anon_versioning" = xyes; then
58836fae4e5dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
58846fae4e5dSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
58856fae4e5dSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
58866fae4e5dSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
58876fae4e5dSmrg	  fi
58886fae4e5dSmrg	  ;;
58899c9ff80cSmrg	esac
58906fae4e5dSmrg      else
58916fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
58926fae4e5dSmrg      fi
58936fae4e5dSmrg      ;;
58946fae4e5dSmrg
58956fae4e5dSmrg    netbsd*)
58966fae4e5dSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58976fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
58986fae4e5dSmrg	wlarc=
58996fae4e5dSmrg      else
59006fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59016fae4e5dSmrg	_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'
59026fae4e5dSmrg      fi
59036fae4e5dSmrg      ;;
59046fae4e5dSmrg
59056fae4e5dSmrg    solaris*)
59066fae4e5dSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
59076fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59086fae4e5dSmrg	cat <<_LT_EOF 1>&2
59096fae4e5dSmrg
59106fae4e5dSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
59116fae4e5dSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
59126fae4e5dSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
59136fae4e5dSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
59146fae4e5dSmrg*** your PATH or compiler configuration so that the native linker is
59156fae4e5dSmrg*** used, and then restart.
59166fae4e5dSmrg
59176fae4e5dSmrg_LT_EOF
59186fae4e5dSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
59196fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59206fae4e5dSmrg	_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'
59216fae4e5dSmrg      else
59226fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59236fae4e5dSmrg      fi
59246fae4e5dSmrg      ;;
59256fae4e5dSmrg
59266fae4e5dSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
59276fae4e5dSmrg      case `$LD -v 2>&1` in
59286fae4e5dSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
59296fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59306fae4e5dSmrg	cat <<_LT_EOF 1>&2
59316fae4e5dSmrg
59326fae4e5dSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
59336fae4e5dSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
59346fae4e5dSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
59356fae4e5dSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
59366fae4e5dSmrg*** your PATH or compiler configuration so that the native linker is
59376fae4e5dSmrg*** used, and then restart.
59386fae4e5dSmrg
59396fae4e5dSmrg_LT_EOF
59401f0ac6a5Smrg	;;
59416fae4e5dSmrg	*)
59426fae4e5dSmrg	  # For security reasons, it is highly recommended that you always
59436fae4e5dSmrg	  # use absolute paths for naming shared libraries, and exclude the
59446fae4e5dSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
59456fae4e5dSmrg	  # requires that you compile everything twice, which is a pain.
59466fae4e5dSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
59476fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59486fae4e5dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59496fae4e5dSmrg	    _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'
59506fae4e5dSmrg	  else
59516fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
59526fae4e5dSmrg	  fi
59531f0ac6a5Smrg	;;
59546fae4e5dSmrg      esac
59556fae4e5dSmrg      ;;
59566fae4e5dSmrg
59576fae4e5dSmrg    sunos4*)
59586fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
59596fae4e5dSmrg      wlarc=
59606fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
59616fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59626fae4e5dSmrg      ;;
59636fae4e5dSmrg
59646fae4e5dSmrg    *)
59656fae4e5dSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
59666fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59676fae4e5dSmrg	_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'
59686fae4e5dSmrg      else
59696fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59706fae4e5dSmrg      fi
59716fae4e5dSmrg      ;;
59721f0ac6a5Smrg    esac
59731f0ac6a5Smrg
59746fae4e5dSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
59756fae4e5dSmrg      runpath_var=
59766fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
59776fae4e5dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
59786fae4e5dSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
59796fae4e5dSmrg    fi
59806fae4e5dSmrg  else
59816fae4e5dSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
59829c9ff80cSmrg    case $host_os in
59836fae4e5dSmrg    aix3*)
59846fae4e5dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
59856fae4e5dSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
59866fae4e5dSmrg      _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'
59876fae4e5dSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
59886fae4e5dSmrg      # are no directories specified by -L.
59896fae4e5dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
59906fae4e5dSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
59916fae4e5dSmrg	# Neither direct hardcoding nor static linking is supported with a
59926fae4e5dSmrg	# broken collect2.
59936fae4e5dSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
59946fae4e5dSmrg      fi
59956fae4e5dSmrg      ;;
59966fae4e5dSmrg
59976fae4e5dSmrg    aix[[4-9]]*)
59989c9ff80cSmrg      if test "$host_cpu" = ia64; then
59996fae4e5dSmrg	# On IA64, the linker does run time linking by default, so we don't
60006fae4e5dSmrg	# have to do anything special.
60016fae4e5dSmrg	aix_use_runtimelinking=no
60026fae4e5dSmrg	exp_sym_flag='-Bexport'
60036fae4e5dSmrg	no_entry_flag=""
60046fae4e5dSmrg      else
60056fae4e5dSmrg	# If we're using GNU nm, then we don't want the "-C" option.
60066fae4e5dSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
60076fae4e5dSmrg	# Also, AIX nm treats weak defined symbols like other global
60086fae4e5dSmrg	# defined symbols, whereas GNU nm marks them as "W".
60096fae4e5dSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
60106fae4e5dSmrg	  _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'
60116fae4e5dSmrg	else
60126fae4e5dSmrg	  _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'
60136fae4e5dSmrg	fi
60146fae4e5dSmrg	aix_use_runtimelinking=no
60156fae4e5dSmrg
60166fae4e5dSmrg	# Test if we are trying to use run time linking or normal
60176fae4e5dSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
60186fae4e5dSmrg	# need to do runtime linking.
60196fae4e5dSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
60206fae4e5dSmrg	  for ld_flag in $LDFLAGS; do
60216fae4e5dSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
60226fae4e5dSmrg	    aix_use_runtimelinking=yes
60236fae4e5dSmrg	    break
60246fae4e5dSmrg	  fi
60256fae4e5dSmrg	  done
60266fae4e5dSmrg	  ;;
60276fae4e5dSmrg	esac
60286fae4e5dSmrg
60296fae4e5dSmrg	exp_sym_flag='-bexport'
60306fae4e5dSmrg	no_entry_flag='-bnoentry'
60316fae4e5dSmrg      fi
60326fae4e5dSmrg
60336fae4e5dSmrg      # When large executables or shared objects are built, AIX ld can
60346fae4e5dSmrg      # have problems creating the table of contents.  If linking a library
60356fae4e5dSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
60366fae4e5dSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
60376fae4e5dSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
60386fae4e5dSmrg
60396fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)=''
60406fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
60416fae4e5dSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60426fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60436fae4e5dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
60446fae4e5dSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
60456fae4e5dSmrg
60466fae4e5dSmrg      if test "$GCC" = yes; then
60476fae4e5dSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
60486fae4e5dSmrg	# We only want to do this on AIX 4.2 and lower, the check
60496fae4e5dSmrg	# below for broken collect2 doesn't work under 4.3+
60506fae4e5dSmrg	  collect2name=`${CC} -print-prog-name=collect2`
60516fae4e5dSmrg	  if test -f "$collect2name" &&
60526fae4e5dSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60536fae4e5dSmrg	  then
60546fae4e5dSmrg	  # We have reworked collect2
60556fae4e5dSmrg	  :
60566fae4e5dSmrg	  else
60576fae4e5dSmrg	  # We have old collect2
60586fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
60596fae4e5dSmrg	  # It fails to find uninstalled libraries when the uninstalled
60606fae4e5dSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
60616fae4e5dSmrg	  # to unsupported forces relinking
60626fae4e5dSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
60636fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60646fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
60656fae4e5dSmrg	  fi
60666fae4e5dSmrg	  ;;
60676fae4e5dSmrg	esac
60686fae4e5dSmrg	shared_flag='-shared'
60696fae4e5dSmrg	if test "$aix_use_runtimelinking" = yes; then
60706fae4e5dSmrg	  shared_flag="$shared_flag "'${wl}-G'
60716fae4e5dSmrg	fi
60726fae4e5dSmrg      else
60736fae4e5dSmrg	# not using gcc
60746fae4e5dSmrg	if test "$host_cpu" = ia64; then
60756fae4e5dSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60766fae4e5dSmrg	# chokes on -Wl,-G. The following line is correct:
60776fae4e5dSmrg	  shared_flag='-G'
60786fae4e5dSmrg	else
60796fae4e5dSmrg	  if test "$aix_use_runtimelinking" = yes; then
60806fae4e5dSmrg	    shared_flag='${wl}-G'
60816fae4e5dSmrg	  else
60826fae4e5dSmrg	    shared_flag='${wl}-bM:SRE'
60836fae4e5dSmrg	  fi
60846fae4e5dSmrg	fi
60856fae4e5dSmrg      fi
60866fae4e5dSmrg
60876fae4e5dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
60886fae4e5dSmrg      # It seems that -bexpall does not export symbols beginning with
60896fae4e5dSmrg      # underscore (_), so it is better to generate a list of symbols to export.
60906fae4e5dSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
60916fae4e5dSmrg      if test "$aix_use_runtimelinking" = yes; then
60926fae4e5dSmrg	# Warning - without using the other runtime loading flags (-brtl),
60936fae4e5dSmrg	# -berok will link without error, but may produce a broken library.
60946fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
60956fae4e5dSmrg        # Determine the default libpath from the value encoded in an
60966fae4e5dSmrg        # empty executable.
60976fae4e5dSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
60986fae4e5dSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60996fae4e5dSmrg        _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"
61006fae4e5dSmrg      else
61016fae4e5dSmrg	if test "$host_cpu" = ia64; then
61026fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
61036fae4e5dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
61046fae4e5dSmrg	  _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"
61056fae4e5dSmrg	else
61066fae4e5dSmrg	 # Determine the default libpath from the value encoded in an
61076fae4e5dSmrg	 # empty executable.
61086fae4e5dSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
61096fae4e5dSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
61106fae4e5dSmrg	  # Warning - without using the other run time loading flags,
61116fae4e5dSmrg	  # -berok will link without error, but may produce a broken library.
61126fae4e5dSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
61136fae4e5dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
61146fae4e5dSmrg	  if test "$with_gnu_ld" = yes; then
61156fae4e5dSmrg	    # We only use this code for GNU lds that support --whole-archive.
61166fae4e5dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
61176fae4e5dSmrg	  else
61186fae4e5dSmrg	    # Exported symbols can be pulled into shared objects from archives
61196fae4e5dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
61206fae4e5dSmrg	  fi
61216fae4e5dSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61226fae4e5dSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
61236fae4e5dSmrg	  _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'
61246fae4e5dSmrg	fi
61259c9ff80cSmrg      fi
61269c9ff80cSmrg      ;;
61271f0ac6a5Smrg
61289c9ff80cSmrg    amigaos*)
61299c9ff80cSmrg      case $host_cpu in
61309c9ff80cSmrg      powerpc)
61319c9ff80cSmrg            # see comment about AmigaOS4 .so support
61326fae4e5dSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61336fae4e5dSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
61349c9ff80cSmrg        ;;
61359c9ff80cSmrg      m68k)
61366fae4e5dSmrg            _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)'
61376fae4e5dSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61386fae4e5dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
61399c9ff80cSmrg        ;;
61409c9ff80cSmrg      esac
61419c9ff80cSmrg      ;;
61421f0ac6a5Smrg
61436fae4e5dSmrg    bsdi[[45]]*)
61446fae4e5dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
61459c9ff80cSmrg      ;;
61461f0ac6a5Smrg
61476fae4e5dSmrg    cygwin* | mingw* | pw32* | cegcc*)
61486fae4e5dSmrg      # When not using gcc, we currently assume that we are using
61496fae4e5dSmrg      # Microsoft Visual C++.
61506fae4e5dSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
61516fae4e5dSmrg      # no search path for DLLs.
61526fae4e5dSmrg      case $cc_basename in
61536fae4e5dSmrg      cl*)
61546fae4e5dSmrg	# Native MSVC
61556fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
61566fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61576fae4e5dSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
61586fae4e5dSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
61596fae4e5dSmrg	# Tell ltmain to make .lib files, not .a files.
61606fae4e5dSmrg	libext=lib
61616fae4e5dSmrg	# Tell ltmain to make .dll files, not .so files.
61626fae4e5dSmrg	shrext_cmds=".dll"
61636fae4e5dSmrg	# FIXME: Setting linknames here is a bad hack.
61646fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
61656fae4e5dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61666fae4e5dSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
61676fae4e5dSmrg	  else
61686fae4e5dSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
61696fae4e5dSmrg	  fi~
61706fae4e5dSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
61716fae4e5dSmrg	  linknames='
61726fae4e5dSmrg	# The linker will not automatically build a static lib if we build a DLL.
61736fae4e5dSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
61746fae4e5dSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
617589c04b6cSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
61766fae4e5dSmrg	_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'
61776fae4e5dSmrg	# Don't use ranlib
61786fae4e5dSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
61796fae4e5dSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
61806fae4e5dSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
61816fae4e5dSmrg	  case $lt_outputfile in
61826fae4e5dSmrg	    *.exe|*.EXE) ;;
61836fae4e5dSmrg	    *)
61846fae4e5dSmrg	      lt_outputfile="$lt_outputfile.exe"
61856fae4e5dSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
61866fae4e5dSmrg	      ;;
61876fae4e5dSmrg	  esac~
61886fae4e5dSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
61896fae4e5dSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
61906fae4e5dSmrg	    $RM "$lt_outputfile.manifest";
61916fae4e5dSmrg	  fi'
61929c9ff80cSmrg	;;
61939c9ff80cSmrg      *)
61946fae4e5dSmrg	# Assume MSVC wrapper
61956fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
61966fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61976fae4e5dSmrg	# Tell ltmain to make .lib files, not .a files.
61986fae4e5dSmrg	libext=lib
61996fae4e5dSmrg	# Tell ltmain to make .dll files, not .so files.
62006fae4e5dSmrg	shrext_cmds=".dll"
62016fae4e5dSmrg	# FIXME: Setting linknames here is a bad hack.
62026fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
62036fae4e5dSmrg	# The linker will automatically build a .lib file if we build a DLL.
62046fae4e5dSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
62056fae4e5dSmrg	# FIXME: Should let the user specify the lib program.
62066fae4e5dSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
62076fae4e5dSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
62089c9ff80cSmrg	;;
62099c9ff80cSmrg      esac
62109c9ff80cSmrg      ;;
62111f0ac6a5Smrg
62126fae4e5dSmrg    darwin* | rhapsody*)
62136fae4e5dSmrg      _LT_DARWIN_LINKER_FEATURES($1)
62149c9ff80cSmrg      ;;
62151f0ac6a5Smrg
62166fae4e5dSmrg    dgux*)
62176fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
62186fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
62196fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62209c9ff80cSmrg      ;;
62211f0ac6a5Smrg
62226fae4e5dSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
62236fae4e5dSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
62246fae4e5dSmrg    # does not break anything, and helps significantly (at the cost of a little
62256fae4e5dSmrg    # extra space).
62266fae4e5dSmrg    freebsd2.2*)
62276fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
62286fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
62296fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62306fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62319c9ff80cSmrg      ;;
62321f0ac6a5Smrg
62336fae4e5dSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
623489c04b6cSmrg    freebsd2.*)
62356fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
62366fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62376fae4e5dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
62386fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62399c9ff80cSmrg      ;;
62401f0ac6a5Smrg
62416fae4e5dSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
62426fae4e5dSmrg    freebsd* | dragonfly*)
62436fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
62446fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
62456fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62466fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62479c9ff80cSmrg      ;;
62481f0ac6a5Smrg
62496fae4e5dSmrg    hpux9*)
62506fae4e5dSmrg      if test "$GCC" = yes; then
62516fae4e5dSmrg	_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'
62526fae4e5dSmrg      else
62536fae4e5dSmrg	_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'
62546fae4e5dSmrg      fi
62556fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62566fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62576fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62586fae4e5dSmrg
62596fae4e5dSmrg      # hardcode_minus_L: Not really in the search PATH,
62606fae4e5dSmrg      # but as the default location of the library.
62616fae4e5dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
62626fae4e5dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62639c9ff80cSmrg      ;;
62641f0ac6a5Smrg
62656fae4e5dSmrg    hpux10*)
62666fae4e5dSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
62676fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
62686fae4e5dSmrg      else
62696fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
62706fae4e5dSmrg      fi
62716fae4e5dSmrg      if test "$with_gnu_ld" = no; then
62726fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62736fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
62746fae4e5dSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
62756fae4e5dSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
62766fae4e5dSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62776fae4e5dSmrg	# hardcode_minus_L: Not really in the search PATH,
62786fae4e5dSmrg	# but as the default location of the library.
62796fae4e5dSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
62806fae4e5dSmrg      fi
62819c9ff80cSmrg      ;;
62821f0ac6a5Smrg
62836fae4e5dSmrg    hpux11*)
62846fae4e5dSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
62856fae4e5dSmrg	case $host_cpu in
62866fae4e5dSmrg	hppa*64*)
62876fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
62886fae4e5dSmrg	  ;;
62896fae4e5dSmrg	ia64*)
62906fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
62916fae4e5dSmrg	  ;;
62926fae4e5dSmrg	*)
62936fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
62946fae4e5dSmrg	  ;;
62956fae4e5dSmrg	esac
62966fae4e5dSmrg      else
62976fae4e5dSmrg	case $host_cpu in
62986fae4e5dSmrg	hppa*64*)
62996fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
63006fae4e5dSmrg	  ;;
63016fae4e5dSmrg	ia64*)
63026fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
63036fae4e5dSmrg	  ;;
63046fae4e5dSmrg	*)
63056fae4e5dSmrg	m4_if($1, [], [
63066fae4e5dSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
63076fae4e5dSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
63086fae4e5dSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
63096fae4e5dSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
63106fae4e5dSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
63116fae4e5dSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
63126fae4e5dSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
63139c9ff80cSmrg	  ;;
63146fae4e5dSmrg	esac
63156fae4e5dSmrg      fi
63166fae4e5dSmrg      if test "$with_gnu_ld" = no; then
63176fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
63186fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
63196fae4e5dSmrg
63206fae4e5dSmrg	case $host_cpu in
63216fae4e5dSmrg	hppa*64*|ia64*)
63226fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
63236fae4e5dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63246fae4e5dSmrg	  ;;
63256fae4e5dSmrg	*)
63266fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
63276fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63286fae4e5dSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63296fae4e5dSmrg
63306fae4e5dSmrg	  # hardcode_minus_L: Not really in the search PATH,
63316fae4e5dSmrg	  # but as the default location of the library.
63326fae4e5dSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
63339c9ff80cSmrg	  ;;
63349c9ff80cSmrg	esac
63356fae4e5dSmrg      fi
63366fae4e5dSmrg      ;;
63376fae4e5dSmrg
63386fae4e5dSmrg    irix5* | irix6* | nonstopux*)
63396fae4e5dSmrg      if test "$GCC" = yes; then
63406fae4e5dSmrg	_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'
63416fae4e5dSmrg	# Try to use the -exported_symbol ld option, if it does not
63426fae4e5dSmrg	# work, assume that -exports_file does not work either and
63436fae4e5dSmrg	# implicitly export all symbols.
63446fae4e5dSmrg	# This should be the same for all languages, so no per-tag cache variable.
63456fae4e5dSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
63466fae4e5dSmrg	  [lt_cv_irix_exported_symbol],
63476fae4e5dSmrg	  [save_LDFLAGS="$LDFLAGS"
63486fae4e5dSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
63496fae4e5dSmrg	   AC_LINK_IFELSE(
63506fae4e5dSmrg	     [AC_LANG_SOURCE(
63516fae4e5dSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
63526fae4e5dSmrg			      [C++], [[int foo (void) { return 0; }]],
63536fae4e5dSmrg			      [Fortran 77], [[
63546fae4e5dSmrg      subroutine foo
63556fae4e5dSmrg      end]],
63566fae4e5dSmrg			      [Fortran], [[
63576fae4e5dSmrg      subroutine foo
63586fae4e5dSmrg      end]])])],
63596fae4e5dSmrg	      [lt_cv_irix_exported_symbol=yes],
63606fae4e5dSmrg	      [lt_cv_irix_exported_symbol=no])
63616fae4e5dSmrg           LDFLAGS="$save_LDFLAGS"])
63626fae4e5dSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
63636fae4e5dSmrg          _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'
63646fae4e5dSmrg	fi
63656fae4e5dSmrg      else
63666fae4e5dSmrg	_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'
63676fae4e5dSmrg	_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'
63686fae4e5dSmrg      fi
63696fae4e5dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
63706fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
63716fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63726fae4e5dSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
63736fae4e5dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
63746fae4e5dSmrg      ;;
63756fae4e5dSmrg
63766fae4e5dSmrg    netbsd*)
63776fae4e5dSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
63786fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
63796fae4e5dSmrg      else
63806fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
63816fae4e5dSmrg      fi
63826fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
63836fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63846fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63859c9ff80cSmrg      ;;
63861f0ac6a5Smrg
63879c9ff80cSmrg    newsos6)
63886fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
63896fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63906fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
63916fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63926fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63939c9ff80cSmrg      ;;
6394e5410a46Smrg
63959c9ff80cSmrg    *nto* | *qnx*)
63969c9ff80cSmrg      ;;
63971f0ac6a5Smrg
63986fae4e5dSmrg    openbsd*)
63996fae4e5dSmrg      if test -f /usr/libexec/ld.so; then
64006fae4e5dSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
64016fae4e5dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64026fae4e5dSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
64036fae4e5dSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
64046fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
64056fae4e5dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
64066fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64076fae4e5dSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
64086fae4e5dSmrg	else
64096fae4e5dSmrg	  case $host_os in
64106fae4e5dSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
64116fae4e5dSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
64126fae4e5dSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64136fae4e5dSmrg	     ;;
64146fae4e5dSmrg	   *)
64156fae4e5dSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
64166fae4e5dSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64176fae4e5dSmrg	     ;;
64186fae4e5dSmrg	  esac
64196fae4e5dSmrg	fi
64206fae4e5dSmrg      else
64216fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
64226fae4e5dSmrg      fi
6423e5410a46Smrg      ;;
6424e5410a46Smrg
64256fae4e5dSmrg    os2*)
64266fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
64276fae4e5dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
64286fae4e5dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
64296fae4e5dSmrg      _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'
64306fae4e5dSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
64316fae4e5dSmrg      ;;
64326fae4e5dSmrg
64336fae4e5dSmrg    osf3*)
64346fae4e5dSmrg      if test "$GCC" = yes; then
64356fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
64366fae4e5dSmrg	_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'
64376fae4e5dSmrg      else
64386fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
64396fae4e5dSmrg	_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'
64406fae4e5dSmrg      fi
64416fae4e5dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
64426fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64436fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64446fae4e5dSmrg      ;;
64456fae4e5dSmrg
64466fae4e5dSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
64476fae4e5dSmrg      if test "$GCC" = yes; then
64486fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
64496fae4e5dSmrg	_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'
64506fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64516fae4e5dSmrg      else
64526fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
64536fae4e5dSmrg	_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'
64546fae4e5dSmrg	_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~
64556fae4e5dSmrg	$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'
64566fae4e5dSmrg
64576fae4e5dSmrg	# Both c and cxx compiler support -rpath directly
64586fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
64596fae4e5dSmrg      fi
64606fae4e5dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
64616fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6462e5410a46Smrg      ;;
6463e5410a46Smrg
64649c9ff80cSmrg    solaris*)
64656fae4e5dSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
64666fae4e5dSmrg      if test "$GCC" = yes; then
64676fae4e5dSmrg	wlarc='${wl}'
64686fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
64696fae4e5dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
64706fae4e5dSmrg	  $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'
64716fae4e5dSmrg      else
64726fae4e5dSmrg	case `$CC -V 2>&1` in
64736fae4e5dSmrg	*"Compilers 5.0"*)
64746fae4e5dSmrg	  wlarc=''
64756fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
64766fae4e5dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
64776fae4e5dSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
64786fae4e5dSmrg	  ;;
64796fae4e5dSmrg	*)
64806fae4e5dSmrg	  wlarc='${wl}'
64816fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
64826fae4e5dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
64836fae4e5dSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
64846fae4e5dSmrg	  ;;
64856fae4e5dSmrg	esac
64866fae4e5dSmrg      fi
64876fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64886fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64896fae4e5dSmrg      case $host_os in
64906fae4e5dSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
64919c9ff80cSmrg      *)
64926fae4e5dSmrg	# The compiler driver will combine and reorder linker options,
64936fae4e5dSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
64946fae4e5dSmrg	# but is careful enough not to reorder.
64956fae4e5dSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
64966fae4e5dSmrg	if test "$GCC" = yes; then
64976fae4e5dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
64986fae4e5dSmrg	else
64996fae4e5dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
65006fae4e5dSmrg	fi
65016fae4e5dSmrg	;;
65029c9ff80cSmrg      esac
65036fae4e5dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
65049c9ff80cSmrg      ;;
65051f0ac6a5Smrg
65069c9ff80cSmrg    sunos4*)
65076fae4e5dSmrg      if test "x$host_vendor" = xsequent; then
65086fae4e5dSmrg	# Use $CC to link under sequent, because it throws in some extra .o
65096fae4e5dSmrg	# files that make .init and .fini sections work.
65106fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
65116fae4e5dSmrg      else
65126fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
65136fae4e5dSmrg      fi
65146fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65156fae4e5dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
65166fae4e5dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
65176fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65189c9ff80cSmrg      ;;
65191f0ac6a5Smrg
65206fae4e5dSmrg    sysv4)
65216fae4e5dSmrg      case $host_vendor in
65226fae4e5dSmrg	sni)
65236fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65246fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
65256fae4e5dSmrg	;;
65266fae4e5dSmrg	siemens)
65276fae4e5dSmrg	  ## LD is ld it makes a PLAMLIB
65286fae4e5dSmrg	  ## CC just makes a GrossModule.
65296fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
65306fae4e5dSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
65316fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
65326fae4e5dSmrg        ;;
65336fae4e5dSmrg	motorola)
65346fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65356fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
65366fae4e5dSmrg	;;
65376fae4e5dSmrg      esac
65386fae4e5dSmrg      runpath_var='LD_RUN_PATH'
65396fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65406fae4e5dSmrg      ;;
65416fae4e5dSmrg
65426fae4e5dSmrg    sysv4.3*)
65436fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65446fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65456fae4e5dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
65469c9ff80cSmrg      ;;
65471f0ac6a5Smrg
65489c9ff80cSmrg    sysv4*MP*)
65496fae4e5dSmrg      if test -d /usr/nec; then
65506fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65516fae4e5dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65526fae4e5dSmrg	runpath_var=LD_RUN_PATH
65536fae4e5dSmrg	hardcode_runpath_var=yes
65546fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
65559c9ff80cSmrg      fi
65569c9ff80cSmrg      ;;
65571f0ac6a5Smrg
65586fae4e5dSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
65596fae4e5dSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
65606fae4e5dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
65616fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65626fae4e5dSmrg      runpath_var='LD_RUN_PATH'
65636fae4e5dSmrg
65646fae4e5dSmrg      if test "$GCC" = yes; then
65656fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65666fae4e5dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65676fae4e5dSmrg      else
65686fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65696fae4e5dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65706fae4e5dSmrg      fi
65719c9ff80cSmrg      ;;
65721f0ac6a5Smrg
65736fae4e5dSmrg    sysv5* | sco3.2v5* | sco5v6*)
65746fae4e5dSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
65756fae4e5dSmrg      # link with -lc, and that would cause any symbols used from libc to
65766fae4e5dSmrg      # always be unresolved, which means just about no library would
65776fae4e5dSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
65786fae4e5dSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
65796fae4e5dSmrg      # as -z defs.
65806fae4e5dSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
65816fae4e5dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
65826fae4e5dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
65836fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65846fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
65856fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
65866fae4e5dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
65876fae4e5dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
65886fae4e5dSmrg      runpath_var='LD_RUN_PATH'
65896fae4e5dSmrg
65906fae4e5dSmrg      if test "$GCC" = yes; then
65916fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65926fae4e5dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65936fae4e5dSmrg      else
65946fae4e5dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65956fae4e5dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65966fae4e5dSmrg      fi
65979c9ff80cSmrg      ;;
65981f0ac6a5Smrg
65999c9ff80cSmrg    uts4*)
66006fae4e5dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66016fae4e5dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
66026fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66039c9ff80cSmrg      ;;
66041f0ac6a5Smrg
66059c9ff80cSmrg    *)
66066fae4e5dSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
66079c9ff80cSmrg      ;;
66089c9ff80cSmrg    esac
66096fae4e5dSmrg
66106fae4e5dSmrg    if test x$host_vendor = xsni; then
66116fae4e5dSmrg      case $host in
66126fae4e5dSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
66136fae4e5dSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
66146fae4e5dSmrg	;;
66156fae4e5dSmrg      esac
66166fae4e5dSmrg    fi
66179c9ff80cSmrg  fi
66189c9ff80cSmrg])
66196fae4e5dSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
66206fae4e5dSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
66211f0ac6a5Smrg
66226fae4e5dSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
66236fae4e5dSmrg
66246fae4e5dSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
66256fae4e5dSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
66266fae4e5dSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
66276fae4e5dSmrg    [The commands to extract the exported symbol list from a shared archive])
66281f0ac6a5Smrg
66299c9ff80cSmrg#
66306fae4e5dSmrg# Do we need to explicitly link libc?
66319c9ff80cSmrg#
66326fae4e5dSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
66336fae4e5dSmrgx|xyes)
66346fae4e5dSmrg  # Assume -lc should be added
66356fae4e5dSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66361f0ac6a5Smrg
66376fae4e5dSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
66386fae4e5dSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
66396fae4e5dSmrg    *'~'*)
66406fae4e5dSmrg      # FIXME: we may have to deal with multi-command sequences.
66416fae4e5dSmrg      ;;
66426fae4e5dSmrg    '$CC '*)
66436fae4e5dSmrg      # Test whether the compiler implicitly links with -lc since on some
66446fae4e5dSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
66456fae4e5dSmrg      # to ld, don't add -lc before -lgcc.
66466fae4e5dSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
66476fae4e5dSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
66486fae4e5dSmrg	[$RM conftest*
66496fae4e5dSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
66506fae4e5dSmrg
66516fae4e5dSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
66526fae4e5dSmrg	  soname=conftest
66536fae4e5dSmrg	  lib=conftest
66546fae4e5dSmrg	  libobjs=conftest.$ac_objext
66556fae4e5dSmrg	  deplibs=
66566fae4e5dSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
66576fae4e5dSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
66586fae4e5dSmrg	  compiler_flags=-v
66596fae4e5dSmrg	  linker_flags=-v
66606fae4e5dSmrg	  verstring=
66616fae4e5dSmrg	  output_objdir=.
66626fae4e5dSmrg	  libname=conftest
66636fae4e5dSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
66646fae4e5dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
66656fae4e5dSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
66666fae4e5dSmrg	  then
66676fae4e5dSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
66686fae4e5dSmrg	  else
66696fae4e5dSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66706fae4e5dSmrg	  fi
66716fae4e5dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
66726fae4e5dSmrg	else
66736fae4e5dSmrg	  cat conftest.err 1>&5
66746fae4e5dSmrg	fi
66756fae4e5dSmrg	$RM conftest*
66766fae4e5dSmrg	])
66776fae4e5dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
66786fae4e5dSmrg      ;;
66796fae4e5dSmrg    esac
66806fae4e5dSmrg  fi
66819c9ff80cSmrg  ;;
66826fae4e5dSmrgesac
66831f0ac6a5Smrg
66846fae4e5dSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
66856fae4e5dSmrg    [Whether or not to add -lc for building shared libraries])
66866fae4e5dSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
66876fae4e5dSmrg    [enable_shared_with_static_runtimes], [0],
66886fae4e5dSmrg    [Whether or not to disallow shared libs when runtime libs are static])
66896fae4e5dSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
66906fae4e5dSmrg    [Compiler flag to allow reflexive dlopens])
66916fae4e5dSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
66926fae4e5dSmrg    [Compiler flag to generate shared objects directly from archives])
66936fae4e5dSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
66946fae4e5dSmrg    [Whether the compiler copes with passing no objects directly])
66956fae4e5dSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
66966fae4e5dSmrg    [Create an old-style archive from a shared archive])
66976fae4e5dSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
66986fae4e5dSmrg    [Create a temporary old-style archive to link instead of a shared archive])
66996fae4e5dSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
67006fae4e5dSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
67016fae4e5dSmrg_LT_TAGDECL([], [module_cmds], [2],
67026fae4e5dSmrg    [Commands used to build a loadable module if different from building
67036fae4e5dSmrg    a shared archive.])
67046fae4e5dSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
67056fae4e5dSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
67066fae4e5dSmrg    [Whether we are building with GNU ld or not])
67076fae4e5dSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
67086fae4e5dSmrg    [Flag that allows shared libraries with undefined symbols to be built])
67096fae4e5dSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
67106fae4e5dSmrg    [Flag that enforces no undefined symbols])
67116fae4e5dSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
67126fae4e5dSmrg    [Flag to hardcode $libdir into a binary during linking.
67136fae4e5dSmrg    This must work even if $libdir does not exist])
67146fae4e5dSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
67156fae4e5dSmrg    [Whether we need a single "-rpath" flag with a separated argument])
67166fae4e5dSmrg_LT_TAGDECL([], [hardcode_direct], [0],
67176fae4e5dSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
67186fae4e5dSmrg    DIR into the resulting binary])
67196fae4e5dSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
67206fae4e5dSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
67216fae4e5dSmrg    DIR into the resulting binary and the resulting library dependency is
67226fae4e5dSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
67236fae4e5dSmrg    library is relocated])
67246fae4e5dSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
67256fae4e5dSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
67266fae4e5dSmrg    into the resulting binary])
67276fae4e5dSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
67286fae4e5dSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
67296fae4e5dSmrg    into the resulting binary])
67306fae4e5dSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
67316fae4e5dSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
67326fae4e5dSmrg    into the library and all subsequent libraries and executables linked
67336fae4e5dSmrg    against it])
67346fae4e5dSmrg_LT_TAGDECL([], [inherit_rpath], [0],
67356fae4e5dSmrg    [Set to yes if linker adds runtime paths of dependent libraries
67366fae4e5dSmrg    to runtime path list])
67376fae4e5dSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
67386fae4e5dSmrg    [Whether libtool must link a program against all its dependency libraries])
67396fae4e5dSmrg_LT_TAGDECL([], [always_export_symbols], [0],
67406fae4e5dSmrg    [Set to "yes" if exported symbols are required])
67416fae4e5dSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
67426fae4e5dSmrg    [The commands to list exported symbols])
67436fae4e5dSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
67446fae4e5dSmrg    [Symbols that should not be listed in the preloaded symbols])
67456fae4e5dSmrg_LT_TAGDECL([], [include_expsyms], [1],
67466fae4e5dSmrg    [Symbols that must always be exported])
67476fae4e5dSmrg_LT_TAGDECL([], [prelink_cmds], [2],
67486fae4e5dSmrg    [Commands necessary for linking programs (against libraries) with templates])
67496fae4e5dSmrg_LT_TAGDECL([], [postlink_cmds], [2],
67506fae4e5dSmrg    [Commands necessary for finishing linking programs])
67516fae4e5dSmrg_LT_TAGDECL([], [file_list_spec], [1],
67526fae4e5dSmrg    [Specify filename containing input files])
67536fae4e5dSmrgdnl FIXME: Not yet implemented
67546fae4e5dSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
67556fae4e5dSmrgdnl    [Compiler flag to generate thread safe objects])
67566fae4e5dSmrg])# _LT_LINKER_SHLIBS
67571f0ac6a5Smrg
67581f0ac6a5Smrg
67596fae4e5dSmrg# _LT_LANG_C_CONFIG([TAG])
67606fae4e5dSmrg# ------------------------
67616fae4e5dSmrg# Ensure that the configuration variables for a C compiler are suitably
67626fae4e5dSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
67636fae4e5dSmrg# the compiler configuration to `libtool'.
67646fae4e5dSmrgm4_defun([_LT_LANG_C_CONFIG],
67656fae4e5dSmrg[m4_require([_LT_DECL_EGREP])dnl
67666fae4e5dSmrglt_save_CC="$CC"
67676fae4e5dSmrgAC_LANG_PUSH(C)
67681f0ac6a5Smrg
67696fae4e5dSmrg# Source file extension for C test sources.
67706fae4e5dSmrgac_ext=c
67711f0ac6a5Smrg
67726fae4e5dSmrg# Object file extension for compiled C test sources.
67736fae4e5dSmrgobjext=o
67746fae4e5dSmrg_LT_TAGVAR(objext, $1)=$objext
67751f0ac6a5Smrg
67766fae4e5dSmrg# Code to be used in simple compile tests
67776fae4e5dSmrglt_simple_compile_test_code="int some_variable = 0;"
67781f0ac6a5Smrg
67796fae4e5dSmrg# Code to be used in simple link tests
67806fae4e5dSmrglt_simple_link_test_code='int main(){return(0);}'
67811f0ac6a5Smrg
67826fae4e5dSmrg_LT_TAG_COMPILER
67836fae4e5dSmrg# Save the default compiler, since it gets overwritten when the other
67846fae4e5dSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
67856fae4e5dSmrgcompiler_DEFAULT=$CC
67861f0ac6a5Smrg
67876fae4e5dSmrg# save warnings/boilerplate of simple test code
67886fae4e5dSmrg_LT_COMPILER_BOILERPLATE
67896fae4e5dSmrg_LT_LINKER_BOILERPLATE
67909c9ff80cSmrg
67916fae4e5dSmrgif test -n "$compiler"; then
67926fae4e5dSmrg  _LT_COMPILER_NO_RTTI($1)
67936fae4e5dSmrg  _LT_COMPILER_PIC($1)
67946fae4e5dSmrg  _LT_COMPILER_C_O($1)
67956fae4e5dSmrg  _LT_COMPILER_FILE_LOCKS($1)
67966fae4e5dSmrg  _LT_LINKER_SHLIBS($1)
67976fae4e5dSmrg  _LT_SYS_DYNAMIC_LINKER($1)
67986fae4e5dSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
67996fae4e5dSmrg  LT_SYS_DLOPEN_SELF
68006fae4e5dSmrg  _LT_CMD_STRIPLIB
68011f0ac6a5Smrg
68026fae4e5dSmrg  # Report which library types will actually be built
68036fae4e5dSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
68046fae4e5dSmrg  AC_MSG_RESULT([$can_build_shared])
68051f0ac6a5Smrg
68066fae4e5dSmrg  AC_MSG_CHECKING([whether to build shared libraries])
68076fae4e5dSmrg  test "$can_build_shared" = "no" && enable_shared=no
68081f0ac6a5Smrg
68096fae4e5dSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
68106fae4e5dSmrg  # are all built from PIC.
68116fae4e5dSmrg  case $host_os in
68126fae4e5dSmrg  aix3*)
68136fae4e5dSmrg    test "$enable_shared" = yes && enable_static=no
68146fae4e5dSmrg    if test -n "$RANLIB"; then
68156fae4e5dSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
68166fae4e5dSmrg      postinstall_cmds='$RANLIB $lib'
68176fae4e5dSmrg    fi
68186fae4e5dSmrg    ;;
68191f0ac6a5Smrg
68206fae4e5dSmrg  aix[[4-9]]*)
68216fae4e5dSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
68226fae4e5dSmrg      test "$enable_shared" = yes && enable_static=no
68236fae4e5dSmrg    fi
68246fae4e5dSmrg    ;;
68256fae4e5dSmrg  esac
68266fae4e5dSmrg  AC_MSG_RESULT([$enable_shared])
68271f0ac6a5Smrg
68286fae4e5dSmrg  AC_MSG_CHECKING([whether to build static libraries])
68296fae4e5dSmrg  # Make sure either enable_shared or enable_static is yes.
68306fae4e5dSmrg  test "$enable_shared" = yes || enable_static=yes
68316fae4e5dSmrg  AC_MSG_RESULT([$enable_static])
68321f0ac6a5Smrg
68336fae4e5dSmrg  _LT_CONFIG($1)
68346fae4e5dSmrgfi
68356fae4e5dSmrgAC_LANG_POP
68366fae4e5dSmrgCC="$lt_save_CC"
68376fae4e5dSmrg])# _LT_LANG_C_CONFIG
68381f0ac6a5Smrg
68391f0ac6a5Smrg
68406fae4e5dSmrg# _LT_LANG_CXX_CONFIG([TAG])
68416fae4e5dSmrg# --------------------------
68426fae4e5dSmrg# Ensure that the configuration variables for a C++ compiler are suitably
68436fae4e5dSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
68446fae4e5dSmrg# the compiler configuration to `libtool'.
68456fae4e5dSmrgm4_defun([_LT_LANG_CXX_CONFIG],
68466fae4e5dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
68476fae4e5dSmrgm4_require([_LT_DECL_EGREP])dnl
68486fae4e5dSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
68496fae4e5dSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
68506fae4e5dSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
68516fae4e5dSmrg    (test "X$CXX" != "Xg++"))) ; then
68526fae4e5dSmrg  AC_PROG_CXXCPP
68536fae4e5dSmrgelse
68546fae4e5dSmrg  _lt_caught_CXX_error=yes
68556fae4e5dSmrgfi
68561f0ac6a5Smrg
68576fae4e5dSmrgAC_LANG_PUSH(C++)
68586fae4e5dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
68596fae4e5dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
68606fae4e5dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
68616fae4e5dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
68626fae4e5dSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
68636fae4e5dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
68646fae4e5dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
68656fae4e5dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
68666fae4e5dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
68676fae4e5dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
68686fae4e5dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
68696fae4e5dSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
68706fae4e5dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
68716fae4e5dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
68726fae4e5dSmrg_LT_TAGVAR(module_cmds, $1)=
68736fae4e5dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
68746fae4e5dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
68756fae4e5dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
68766fae4e5dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
68776fae4e5dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
68786fae4e5dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
68796fae4e5dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
68806fae4e5dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
68811f0ac6a5Smrg
68826fae4e5dSmrg# Source file extension for C++ test sources.
68836fae4e5dSmrgac_ext=cpp
68841f0ac6a5Smrg
68856fae4e5dSmrg# Object file extension for compiled C++ test sources.
68866fae4e5dSmrgobjext=o
68876fae4e5dSmrg_LT_TAGVAR(objext, $1)=$objext
68881f0ac6a5Smrg
68896fae4e5dSmrg# No sense in running all these tests if we already determined that
68906fae4e5dSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
68916fae4e5dSmrg# are currently assumed to apply to all compilers on this platform,
68926fae4e5dSmrg# and will be corrupted by setting them based on a non-working compiler.
68936fae4e5dSmrgif test "$_lt_caught_CXX_error" != yes; then
68946fae4e5dSmrg  # Code to be used in simple compile tests
68956fae4e5dSmrg  lt_simple_compile_test_code="int some_variable = 0;"
68969c9ff80cSmrg
68976fae4e5dSmrg  # Code to be used in simple link tests
68986fae4e5dSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
68991f0ac6a5Smrg
69006fae4e5dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
69016fae4e5dSmrg  _LT_TAG_COMPILER
69021f0ac6a5Smrg
69036fae4e5dSmrg  # save warnings/boilerplate of simple test code
69046fae4e5dSmrg  _LT_COMPILER_BOILERPLATE
69056fae4e5dSmrg  _LT_LINKER_BOILERPLATE
69061f0ac6a5Smrg
69076fae4e5dSmrg  # Allow CC to be a program name with arguments.
69086fae4e5dSmrg  lt_save_CC=$CC
69096fae4e5dSmrg  lt_save_CFLAGS=$CFLAGS
69106fae4e5dSmrg  lt_save_LD=$LD
69116fae4e5dSmrg  lt_save_GCC=$GCC
69126fae4e5dSmrg  GCC=$GXX
69136fae4e5dSmrg  lt_save_with_gnu_ld=$with_gnu_ld
69146fae4e5dSmrg  lt_save_path_LD=$lt_cv_path_LD
69156fae4e5dSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
69166fae4e5dSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
69176fae4e5dSmrg  else
69186fae4e5dSmrg    $as_unset lt_cv_prog_gnu_ld
69196fae4e5dSmrg  fi
69206fae4e5dSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
69216fae4e5dSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
69226fae4e5dSmrg  else
69236fae4e5dSmrg    $as_unset lt_cv_path_LD
69246fae4e5dSmrg  fi
69256fae4e5dSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
69266fae4e5dSmrg  CC=${CXX-"c++"}
69276fae4e5dSmrg  CFLAGS=$CXXFLAGS
69286fae4e5dSmrg  compiler=$CC
69296fae4e5dSmrg  _LT_TAGVAR(compiler, $1)=$CC
69306fae4e5dSmrg  _LT_CC_BASENAME([$compiler])
69311f0ac6a5Smrg
69326fae4e5dSmrg  if test -n "$compiler"; then
69336fae4e5dSmrg    # We don't want -fno-exception when compiling C++ code, so set the
69346fae4e5dSmrg    # no_builtin_flag separately
69356fae4e5dSmrg    if test "$GXX" = yes; then
69366fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
69376fae4e5dSmrg    else
69386fae4e5dSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
69396fae4e5dSmrg    fi
69401f0ac6a5Smrg
69416fae4e5dSmrg    if test "$GXX" = yes; then
69426fae4e5dSmrg      # Set up default GNU C++ configuration
69431f0ac6a5Smrg
69446fae4e5dSmrg      LT_PATH_LD
69451f0ac6a5Smrg
69466fae4e5dSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
69476fae4e5dSmrg      # archiving commands below assume that GNU ld is being used.
69486fae4e5dSmrg      if test "$with_gnu_ld" = yes; then
69496fae4e5dSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
69506fae4e5dSmrg        _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'
69511f0ac6a5Smrg
69526fae4e5dSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
69536fae4e5dSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
69541f0ac6a5Smrg
69556fae4e5dSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
69566fae4e5dSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
69576fae4e5dSmrg        #     investigate it a little bit more. (MM)
69586fae4e5dSmrg        wlarc='${wl}'
69591f0ac6a5Smrg
69606fae4e5dSmrg        # ancient GNU ld didn't support --whole-archive et. al.
69616fae4e5dSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
69626fae4e5dSmrg	  $GREP 'no-whole-archive' > /dev/null; then
69636fae4e5dSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
69646fae4e5dSmrg        else
69656fae4e5dSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
69666fae4e5dSmrg        fi
69676fae4e5dSmrg      else
69686fae4e5dSmrg        with_gnu_ld=no
69696fae4e5dSmrg        wlarc=
69701f0ac6a5Smrg
69716fae4e5dSmrg        # A generic and very simple default shared library creation
69726fae4e5dSmrg        # command for GNU C++ for the case where it uses the native
69736fae4e5dSmrg        # linker, instead of GNU ld.  If possible, this setting should
69746fae4e5dSmrg        # overridden to take advantage of the native linker features on
69756fae4e5dSmrg        # the platform it is being used on.
69766fae4e5dSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
69776fae4e5dSmrg      fi
69781f0ac6a5Smrg
69796fae4e5dSmrg      # Commands to make compiler produce verbose output that lists
69806fae4e5dSmrg      # what "hidden" libraries, object files and flags are used when
69816fae4e5dSmrg      # linking a shared library.
69826fae4e5dSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
69831f0ac6a5Smrg
69846fae4e5dSmrg    else
69856fae4e5dSmrg      GXX=no
69866fae4e5dSmrg      with_gnu_ld=no
69876fae4e5dSmrg      wlarc=
69886fae4e5dSmrg    fi
69891f0ac6a5Smrg
69906fae4e5dSmrg    # PORTME: fill in a description of your system's C++ link characteristics
69916fae4e5dSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
69926fae4e5dSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
69936fae4e5dSmrg    case $host_os in
69946fae4e5dSmrg      aix3*)
69956fae4e5dSmrg        # FIXME: insert proper C++ library support
69966fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
69976fae4e5dSmrg        ;;
69986fae4e5dSmrg      aix[[4-9]]*)
69996fae4e5dSmrg        if test "$host_cpu" = ia64; then
70006fae4e5dSmrg          # On IA64, the linker does run time linking by default, so we don't
70016fae4e5dSmrg          # have to do anything special.
70026fae4e5dSmrg          aix_use_runtimelinking=no
70036fae4e5dSmrg          exp_sym_flag='-Bexport'
70046fae4e5dSmrg          no_entry_flag=""
70056fae4e5dSmrg        else
70066fae4e5dSmrg          aix_use_runtimelinking=no
70071f0ac6a5Smrg
70086fae4e5dSmrg          # Test if we are trying to use run time linking or normal
70096fae4e5dSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
70106fae4e5dSmrg          # need to do runtime linking.
70116fae4e5dSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
70126fae4e5dSmrg	    for ld_flag in $LDFLAGS; do
70136fae4e5dSmrg	      case $ld_flag in
70146fae4e5dSmrg	      *-brtl*)
70156fae4e5dSmrg	        aix_use_runtimelinking=yes
70166fae4e5dSmrg	        break
70176fae4e5dSmrg	        ;;
70186fae4e5dSmrg	      esac
70196fae4e5dSmrg	    done
70206fae4e5dSmrg	    ;;
70216fae4e5dSmrg          esac
70221f0ac6a5Smrg
70236fae4e5dSmrg          exp_sym_flag='-bexport'
70246fae4e5dSmrg          no_entry_flag='-bnoentry'
70256fae4e5dSmrg        fi
70261f0ac6a5Smrg
70276fae4e5dSmrg        # When large executables or shared objects are built, AIX ld can
70286fae4e5dSmrg        # have problems creating the table of contents.  If linking a library
70296fae4e5dSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
70306fae4e5dSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
70316fae4e5dSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
70321f0ac6a5Smrg
70336fae4e5dSmrg        _LT_TAGVAR(archive_cmds, $1)=''
70346fae4e5dSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
70356fae4e5dSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
70366fae4e5dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
70376fae4e5dSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
70386fae4e5dSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
70391f0ac6a5Smrg
70406fae4e5dSmrg        if test "$GXX" = yes; then
70416fae4e5dSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
70426fae4e5dSmrg          # We only want to do this on AIX 4.2 and lower, the check
70436fae4e5dSmrg          # below for broken collect2 doesn't work under 4.3+
70446fae4e5dSmrg	  collect2name=`${CC} -print-prog-name=collect2`
70456fae4e5dSmrg	  if test -f "$collect2name" &&
70466fae4e5dSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
70476fae4e5dSmrg	  then
70486fae4e5dSmrg	    # We have reworked collect2
70496fae4e5dSmrg	    :
70506fae4e5dSmrg	  else
70516fae4e5dSmrg	    # We have old collect2
70526fae4e5dSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
70536fae4e5dSmrg	    # It fails to find uninstalled libraries when the uninstalled
70546fae4e5dSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
70556fae4e5dSmrg	    # to unsupported forces relinking
70566fae4e5dSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
70576fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
70586fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
70596fae4e5dSmrg	  fi
70606fae4e5dSmrg          esac
70616fae4e5dSmrg          shared_flag='-shared'
70626fae4e5dSmrg	  if test "$aix_use_runtimelinking" = yes; then
70636fae4e5dSmrg	    shared_flag="$shared_flag "'${wl}-G'
70646fae4e5dSmrg	  fi
70656fae4e5dSmrg        else
70666fae4e5dSmrg          # not using gcc
70676fae4e5dSmrg          if test "$host_cpu" = ia64; then
70686fae4e5dSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
70696fae4e5dSmrg	  # chokes on -Wl,-G. The following line is correct:
70706fae4e5dSmrg	  shared_flag='-G'
70716fae4e5dSmrg          else
70726fae4e5dSmrg	    if test "$aix_use_runtimelinking" = yes; then
70736fae4e5dSmrg	      shared_flag='${wl}-G'
70746fae4e5dSmrg	    else
70756fae4e5dSmrg	      shared_flag='${wl}-bM:SRE'
70766fae4e5dSmrg	    fi
70776fae4e5dSmrg          fi
70786fae4e5dSmrg        fi
70791f0ac6a5Smrg
70806fae4e5dSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
70816fae4e5dSmrg        # It seems that -bexpall does not export symbols beginning with
70826fae4e5dSmrg        # underscore (_), so it is better to generate a list of symbols to
70836fae4e5dSmrg	# export.
70846fae4e5dSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
70856fae4e5dSmrg        if test "$aix_use_runtimelinking" = yes; then
70866fae4e5dSmrg          # Warning - without using the other runtime loading flags (-brtl),
70876fae4e5dSmrg          # -berok will link without error, but may produce a broken library.
70886fae4e5dSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
70896fae4e5dSmrg          # Determine the default libpath from the value encoded in an empty
70906fae4e5dSmrg          # executable.
70916fae4e5dSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
70926fae4e5dSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
70931f0ac6a5Smrg
70946fae4e5dSmrg          _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"
70956fae4e5dSmrg        else
70966fae4e5dSmrg          if test "$host_cpu" = ia64; then
70976fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
70986fae4e5dSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
70996fae4e5dSmrg	    _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"
71006fae4e5dSmrg          else
71016fae4e5dSmrg	    # Determine the default libpath from the value encoded in an
71026fae4e5dSmrg	    # empty executable.
71036fae4e5dSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
71046fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
71056fae4e5dSmrg	    # Warning - without using the other run time loading flags,
71066fae4e5dSmrg	    # -berok will link without error, but may produce a broken library.
71076fae4e5dSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
71086fae4e5dSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
71096fae4e5dSmrg	    if test "$with_gnu_ld" = yes; then
71106fae4e5dSmrg	      # We only use this code for GNU lds that support --whole-archive.
71116fae4e5dSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
71126fae4e5dSmrg	    else
71136fae4e5dSmrg	      # Exported symbols can be pulled into shared objects from archives
71146fae4e5dSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
71156fae4e5dSmrg	    fi
71166fae4e5dSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
71176fae4e5dSmrg	    # This is similar to how AIX traditionally builds its shared
71186fae4e5dSmrg	    # libraries.
71196fae4e5dSmrg	    _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'
71206fae4e5dSmrg          fi
71216fae4e5dSmrg        fi
71226fae4e5dSmrg        ;;
71236fae4e5dSmrg
71246fae4e5dSmrg      beos*)
71256fae4e5dSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
71266fae4e5dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
71276fae4e5dSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
71286fae4e5dSmrg	  # support --undefined.  This deserves some investigation.  FIXME
71296fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
71306fae4e5dSmrg	else
71316fae4e5dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71326fae4e5dSmrg	fi
71336fae4e5dSmrg	;;
71346fae4e5dSmrg
71356fae4e5dSmrg      chorus*)
71366fae4e5dSmrg        case $cc_basename in
71376fae4e5dSmrg          *)
71386fae4e5dSmrg	  # FIXME: insert proper C++ library support
71396fae4e5dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71409c9ff80cSmrg	  ;;
71416fae4e5dSmrg        esac
71426fae4e5dSmrg        ;;
71436fae4e5dSmrg
71446fae4e5dSmrg      cygwin* | mingw* | pw32* | cegcc*)
71456fae4e5dSmrg	case $GXX,$cc_basename in
71466fae4e5dSmrg	,cl* | no,cl*)
71476fae4e5dSmrg	  # Native MSVC
71486fae4e5dSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
71496fae4e5dSmrg	  # no search path for DLLs.
71506fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
71516fae4e5dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
71526fae4e5dSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
71536fae4e5dSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
71546fae4e5dSmrg	  # Tell ltmain to make .lib files, not .a files.
71556fae4e5dSmrg	  libext=lib
71566fae4e5dSmrg	  # Tell ltmain to make .dll files, not .so files.
71576fae4e5dSmrg	  shrext_cmds=".dll"
71586fae4e5dSmrg	  # FIXME: Setting linknames here is a bad hack.
71596fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
71606fae4e5dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
71616fae4e5dSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
71626fae4e5dSmrg	    else
71636fae4e5dSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
71646fae4e5dSmrg	    fi~
71656fae4e5dSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
71666fae4e5dSmrg	    linknames='
71676fae4e5dSmrg	  # The linker will not automatically build a static lib if we build a DLL.
71686fae4e5dSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
71696fae4e5dSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
71706fae4e5dSmrg	  # Don't use ranlib
71716fae4e5dSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
71726fae4e5dSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
71736fae4e5dSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
71746fae4e5dSmrg	    case $lt_outputfile in
71756fae4e5dSmrg	      *.exe|*.EXE) ;;
71766fae4e5dSmrg	      *)
71776fae4e5dSmrg		lt_outputfile="$lt_outputfile.exe"
71786fae4e5dSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
71796fae4e5dSmrg		;;
71806fae4e5dSmrg	    esac~
71816fae4e5dSmrg	    func_to_tool_file "$lt_outputfile"~
71826fae4e5dSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
71836fae4e5dSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
71846fae4e5dSmrg	      $RM "$lt_outputfile.manifest";
71856fae4e5dSmrg	    fi'
71869c9ff80cSmrg	  ;;
71879c9ff80cSmrg	*)
71886fae4e5dSmrg	  # g++
71896fae4e5dSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
71906fae4e5dSmrg	  # as there is no search path for DLLs.
71916fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
71926fae4e5dSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
71936fae4e5dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
71946fae4e5dSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
71956fae4e5dSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
71966fae4e5dSmrg
71976fae4e5dSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
71986fae4e5dSmrg	    _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'
71996fae4e5dSmrg	    # If the export-symbols file already is a .def file (1st line
72006fae4e5dSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
72016fae4e5dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
72026fae4e5dSmrg	      cp $export_symbols $output_objdir/$soname.def;
72036fae4e5dSmrg	    else
72046fae4e5dSmrg	      echo EXPORTS > $output_objdir/$soname.def;
72056fae4e5dSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
72066fae4e5dSmrg	    fi~
72076fae4e5dSmrg	    $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'
72086fae4e5dSmrg	  else
72096fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72106fae4e5dSmrg	  fi
72119c9ff80cSmrg	  ;;
72129c9ff80cSmrg	esac
72136fae4e5dSmrg	;;
72146fae4e5dSmrg      darwin* | rhapsody*)
72156fae4e5dSmrg        _LT_DARWIN_LINKER_FEATURES($1)
72166fae4e5dSmrg	;;
72171f0ac6a5Smrg
72186fae4e5dSmrg      dgux*)
72196fae4e5dSmrg        case $cc_basename in
72206fae4e5dSmrg          ec++*)
72216fae4e5dSmrg	    # FIXME: insert proper C++ library support
72226fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72236fae4e5dSmrg	    ;;
72246fae4e5dSmrg          ghcx*)
72256fae4e5dSmrg	    # Green Hills C++ Compiler
72266fae4e5dSmrg	    # FIXME: insert proper C++ library support
72276fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72286fae4e5dSmrg	    ;;
72296fae4e5dSmrg          *)
72306fae4e5dSmrg	    # FIXME: insert proper C++ library support
72316fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72326fae4e5dSmrg	    ;;
72336fae4e5dSmrg        esac
72346fae4e5dSmrg        ;;
72351f0ac6a5Smrg
723689c04b6cSmrg      freebsd2.*)
72376fae4e5dSmrg        # C++ shared libraries reported to be fairly broken before
72386fae4e5dSmrg	# switch to ELF
72396fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
72406fae4e5dSmrg        ;;
72411f0ac6a5Smrg
72426fae4e5dSmrg      freebsd-elf*)
72436fae4e5dSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
72446fae4e5dSmrg        ;;
72451f0ac6a5Smrg
72466fae4e5dSmrg      freebsd* | dragonfly*)
72476fae4e5dSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
72486fae4e5dSmrg        # conventions
72496fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
72506fae4e5dSmrg        ;;
72511f0ac6a5Smrg
72526fae4e5dSmrg      gnu*)
72536fae4e5dSmrg        ;;
72541f0ac6a5Smrg
72556fae4e5dSmrg      haiku*)
72566fae4e5dSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
72576fae4e5dSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
72586fae4e5dSmrg        ;;
72591f0ac6a5Smrg
72606fae4e5dSmrg      hpux9*)
72616fae4e5dSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
72626fae4e5dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72636fae4e5dSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
72646fae4e5dSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
72656fae4e5dSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
72666fae4e5dSmrg				             # but as the default
72676fae4e5dSmrg				             # location of the library.
72686fae4e5dSmrg
72696fae4e5dSmrg        case $cc_basename in
72706fae4e5dSmrg          CC*)
72716fae4e5dSmrg            # FIXME: insert proper C++ library support
72726fae4e5dSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
72736fae4e5dSmrg            ;;
72746fae4e5dSmrg          aCC*)
72756fae4e5dSmrg            _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'
72766fae4e5dSmrg            # Commands to make compiler produce verbose output that lists
72776fae4e5dSmrg            # what "hidden" libraries, object files and flags are used when
72786fae4e5dSmrg            # linking a shared library.
72796fae4e5dSmrg            #
72806fae4e5dSmrg            # There doesn't appear to be a way to prevent this compiler from
72816fae4e5dSmrg            # explicitly linking system object files so we need to strip them
72826fae4e5dSmrg            # from the output so that they don't get included in the library
72836fae4e5dSmrg            # dependencies.
72846fae4e5dSmrg            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"'
72856fae4e5dSmrg            ;;
72866fae4e5dSmrg          *)
72876fae4e5dSmrg            if test "$GXX" = yes; then
72886fae4e5dSmrg              _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'
72896fae4e5dSmrg            else
72906fae4e5dSmrg              # FIXME: insert proper C++ library support
72916fae4e5dSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
72926fae4e5dSmrg            fi
72936fae4e5dSmrg            ;;
72946fae4e5dSmrg        esac
72956fae4e5dSmrg        ;;
72966fae4e5dSmrg
72976fae4e5dSmrg      hpux10*|hpux11*)
72986fae4e5dSmrg        if test $with_gnu_ld = no; then
72996fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
73006fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
73016fae4e5dSmrg
73026fae4e5dSmrg          case $host_cpu in
73036fae4e5dSmrg            hppa*64*|ia64*)
73046fae4e5dSmrg              ;;
73056fae4e5dSmrg            *)
73066fae4e5dSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73076fae4e5dSmrg              ;;
73086fae4e5dSmrg          esac
73096fae4e5dSmrg        fi
73106fae4e5dSmrg        case $host_cpu in
73116fae4e5dSmrg          hppa*64*|ia64*)
73126fae4e5dSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
73136fae4e5dSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73146fae4e5dSmrg            ;;
73156fae4e5dSmrg          *)
73166fae4e5dSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
73176fae4e5dSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
73186fae4e5dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
73196fae4e5dSmrg					         # but as the default
73206fae4e5dSmrg					         # location of the library.
73216fae4e5dSmrg            ;;
73226fae4e5dSmrg        esac
73236fae4e5dSmrg
73246fae4e5dSmrg        case $cc_basename in
73256fae4e5dSmrg          CC*)
73266fae4e5dSmrg	    # FIXME: insert proper C++ library support
73276fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73286fae4e5dSmrg	    ;;
73296fae4e5dSmrg          aCC*)
73306fae4e5dSmrg	    case $host_cpu in
73316fae4e5dSmrg	      hppa*64*)
73326fae4e5dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73336fae4e5dSmrg	        ;;
73346fae4e5dSmrg	      ia64*)
73356fae4e5dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73366fae4e5dSmrg	        ;;
73376fae4e5dSmrg	      *)
73386fae4e5dSmrg	        _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'
73396fae4e5dSmrg	        ;;
73406fae4e5dSmrg	    esac
73416fae4e5dSmrg	    # Commands to make compiler produce verbose output that lists
73426fae4e5dSmrg	    # what "hidden" libraries, object files and flags are used when
73436fae4e5dSmrg	    # linking a shared library.
73446fae4e5dSmrg	    #
73456fae4e5dSmrg	    # There doesn't appear to be a way to prevent this compiler from
73466fae4e5dSmrg	    # explicitly linking system object files so we need to strip them
73476fae4e5dSmrg	    # from the output so that they don't get included in the library
73486fae4e5dSmrg	    # dependencies.
73496fae4e5dSmrg	    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"'
73506fae4e5dSmrg	    ;;
73516fae4e5dSmrg          *)
73526fae4e5dSmrg	    if test "$GXX" = yes; then
73536fae4e5dSmrg	      if test $with_gnu_ld = no; then
73546fae4e5dSmrg	        case $host_cpu in
73556fae4e5dSmrg	          hppa*64*)
73566fae4e5dSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73576fae4e5dSmrg	            ;;
73586fae4e5dSmrg	          ia64*)
73596fae4e5dSmrg	            _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'
73606fae4e5dSmrg	            ;;
73616fae4e5dSmrg	          *)
73626fae4e5dSmrg	            _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'
73636fae4e5dSmrg	            ;;
73646fae4e5dSmrg	        esac
73656fae4e5dSmrg	      fi
73666fae4e5dSmrg	    else
73676fae4e5dSmrg	      # FIXME: insert proper C++ library support
73686fae4e5dSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
73696fae4e5dSmrg	    fi
73706fae4e5dSmrg	    ;;
73716fae4e5dSmrg        esac
73726fae4e5dSmrg        ;;
73736fae4e5dSmrg
73746fae4e5dSmrg      interix[[3-9]]*)
73756fae4e5dSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
73769c9ff80cSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73776fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
73786fae4e5dSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73796fae4e5dSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
73806fae4e5dSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
73816fae4e5dSmrg	# default) and relocated if they conflict, which is a slow very memory
73826fae4e5dSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
73836fae4e5dSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
73846fae4e5dSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
73856fae4e5dSmrg	_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'
73866fae4e5dSmrg	_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'
73876fae4e5dSmrg	;;
73886fae4e5dSmrg      irix5* | irix6*)
73896fae4e5dSmrg        case $cc_basename in
73906fae4e5dSmrg          CC*)
73916fae4e5dSmrg	    # SGI C++
73926fae4e5dSmrg	    _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'
73931f0ac6a5Smrg
73946fae4e5dSmrg	    # Archives containing C++ object files must be created using
73956fae4e5dSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
73966fae4e5dSmrg	    # necessary to make sure instantiated templates are included
73976fae4e5dSmrg	    # in the archive.
73986fae4e5dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
73996fae4e5dSmrg	    ;;
74006fae4e5dSmrg          *)
74016fae4e5dSmrg	    if test "$GXX" = yes; then
74026fae4e5dSmrg	      if test "$with_gnu_ld" = no; then
74036fae4e5dSmrg	        _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'
74046fae4e5dSmrg	      else
74056fae4e5dSmrg	        _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'
74066fae4e5dSmrg	      fi
74076fae4e5dSmrg	    fi
74086fae4e5dSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
74096fae4e5dSmrg	    ;;
74106fae4e5dSmrg        esac
74116fae4e5dSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
74126fae4e5dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
74136fae4e5dSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
74146fae4e5dSmrg        ;;
74151f0ac6a5Smrg
74166fae4e5dSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
74176fae4e5dSmrg        case $cc_basename in
74186fae4e5dSmrg          KCC*)
74196fae4e5dSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
74201f0ac6a5Smrg
74216fae4e5dSmrg	    # KCC will only create a shared library if the output file
74226fae4e5dSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
74236fae4e5dSmrg	    # to its proper name (with version) after linking.
74246fae4e5dSmrg	    _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'
74256fae4e5dSmrg	    _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'
74266fae4e5dSmrg	    # Commands to make compiler produce verbose output that lists
74276fae4e5dSmrg	    # what "hidden" libraries, object files and flags are used when
74286fae4e5dSmrg	    # linking a shared library.
74296fae4e5dSmrg	    #
74306fae4e5dSmrg	    # There doesn't appear to be a way to prevent this compiler from
74316fae4e5dSmrg	    # explicitly linking system object files so we need to strip them
74326fae4e5dSmrg	    # from the output so that they don't get included in the library
74336fae4e5dSmrg	    # dependencies.
74346fae4e5dSmrg	    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"'
74351f0ac6a5Smrg
74366fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
74376fae4e5dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
74381f0ac6a5Smrg
74396fae4e5dSmrg	    # Archives containing C++ object files must be created using
74406fae4e5dSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
74416fae4e5dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
74426fae4e5dSmrg	    ;;
74436fae4e5dSmrg	  icpc* | ecpc* )
74446fae4e5dSmrg	    # Intel C++
74456fae4e5dSmrg	    with_gnu_ld=yes
74466fae4e5dSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
74476fae4e5dSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
74486fae4e5dSmrg	    # earlier do not add the objects themselves.
74496fae4e5dSmrg	    case `$CC -V 2>&1` in
74506fae4e5dSmrg	      *"Version 7."*)
74516fae4e5dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
74526fae4e5dSmrg		_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'
74536fae4e5dSmrg		;;
74546fae4e5dSmrg	      *)  # Version 8.0 or newer
74556fae4e5dSmrg	        tmp_idyn=
74566fae4e5dSmrg	        case $host_cpu in
74576fae4e5dSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
74586fae4e5dSmrg		esac
74596fae4e5dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
74606fae4e5dSmrg		_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'
74616fae4e5dSmrg		;;
74626fae4e5dSmrg	    esac
74636fae4e5dSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
74646fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
74656fae4e5dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
74666fae4e5dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
74676fae4e5dSmrg	    ;;
74686fae4e5dSmrg          pgCC* | pgcpp*)
74696fae4e5dSmrg            # Portland Group C++ compiler
74706fae4e5dSmrg	    case `$CC -V` in
74716fae4e5dSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
74726fae4e5dSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
74736fae4e5dSmrg		rm -rf $tpldir~
74746fae4e5dSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
74756fae4e5dSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
74766fae4e5dSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
74776fae4e5dSmrg		rm -rf $tpldir~
74786fae4e5dSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
74796fae4e5dSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
74806fae4e5dSmrg		$RANLIB $oldlib'
74816fae4e5dSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
74826fae4e5dSmrg		rm -rf $tpldir~
74836fae4e5dSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
74846fae4e5dSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
74856fae4e5dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
74866fae4e5dSmrg		rm -rf $tpldir~
74876fae4e5dSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
74886fae4e5dSmrg		$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'
74896fae4e5dSmrg	      ;;
74906fae4e5dSmrg	    *) # Version 6 and above use weak symbols
74916fae4e5dSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
74926fae4e5dSmrg	      _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'
74936fae4e5dSmrg	      ;;
74946fae4e5dSmrg	    esac
74951f0ac6a5Smrg
74966fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
74976fae4e5dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
74986fae4e5dSmrg	    _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'
74996fae4e5dSmrg            ;;
75006fae4e5dSmrg	  cxx*)
75016fae4e5dSmrg	    # Compaq C++
75026fae4e5dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
75036fae4e5dSmrg	    _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'
75041f0ac6a5Smrg
75056fae4e5dSmrg	    runpath_var=LD_RUN_PATH
75066fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
75076fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
75081f0ac6a5Smrg
75096fae4e5dSmrg	    # Commands to make compiler produce verbose output that lists
75106fae4e5dSmrg	    # what "hidden" libraries, object files and flags are used when
75116fae4e5dSmrg	    # linking a shared library.
75126fae4e5dSmrg	    #
75136fae4e5dSmrg	    # There doesn't appear to be a way to prevent this compiler from
75146fae4e5dSmrg	    # explicitly linking system object files so we need to strip them
75156fae4e5dSmrg	    # from the output so that they don't get included in the library
75166fae4e5dSmrg	    # dependencies.
75176fae4e5dSmrg	    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'
75186fae4e5dSmrg	    ;;
75196fae4e5dSmrg	  xl* | mpixl* | bgxl*)
75206fae4e5dSmrg	    # IBM XL 8.0 on PPC, with GNU ld
75216fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
75226fae4e5dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75236fae4e5dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
75246fae4e5dSmrg	    if test "x$supports_anon_versioning" = xyes; then
75256fae4e5dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
75266fae4e5dSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
75276fae4e5dSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
75286fae4e5dSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
75296fae4e5dSmrg	    fi
75306fae4e5dSmrg	    ;;
75316fae4e5dSmrg	  *)
75326fae4e5dSmrg	    case `$CC -V 2>&1 | sed 5q` in
75336fae4e5dSmrg	    *Sun\ C*)
75346fae4e5dSmrg	      # Sun C++ 5.9
75356fae4e5dSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
75366fae4e5dSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
75376fae4e5dSmrg	      _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'
75386fae4e5dSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
75396fae4e5dSmrg	      _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'
75406fae4e5dSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
75411f0ac6a5Smrg
75426fae4e5dSmrg	      # Not sure whether something based on
75436fae4e5dSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
75446fae4e5dSmrg	      # would be better.
75456fae4e5dSmrg	      output_verbose_link_cmd='func_echo_all'
75461f0ac6a5Smrg
75476fae4e5dSmrg	      # Archives containing C++ object files must be created using
75486fae4e5dSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
75496fae4e5dSmrg	      # necessary to make sure instantiated templates are included
75506fae4e5dSmrg	      # in the archive.
75516fae4e5dSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
75526fae4e5dSmrg	      ;;
75536fae4e5dSmrg	    esac
75546fae4e5dSmrg	    ;;
75556fae4e5dSmrg	esac
75566fae4e5dSmrg	;;
75571f0ac6a5Smrg
75586fae4e5dSmrg      lynxos*)
75596fae4e5dSmrg        # FIXME: insert proper C++ library support
75606fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
75616fae4e5dSmrg	;;
75621f0ac6a5Smrg
75636fae4e5dSmrg      m88k*)
75646fae4e5dSmrg        # FIXME: insert proper C++ library support
75656fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
75666fae4e5dSmrg	;;
75671f0ac6a5Smrg
75686fae4e5dSmrg      mvs*)
75696fae4e5dSmrg        case $cc_basename in
75706fae4e5dSmrg          cxx*)
75716fae4e5dSmrg	    # FIXME: insert proper C++ library support
75726fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
75736fae4e5dSmrg	    ;;
75746fae4e5dSmrg	  *)
75756fae4e5dSmrg	    # FIXME: insert proper C++ library support
75766fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
75776fae4e5dSmrg	    ;;
75786fae4e5dSmrg	esac
75796fae4e5dSmrg	;;
75801f0ac6a5Smrg
75816fae4e5dSmrg      netbsd*)
75826fae4e5dSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
75836fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
75846fae4e5dSmrg	  wlarc=
75856fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
75866fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
75876fae4e5dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
75886fae4e5dSmrg	fi
75896fae4e5dSmrg	# Workaround some broken pre-1.5 toolchains
75906fae4e5dSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
75916fae4e5dSmrg	;;
75921f0ac6a5Smrg
75936fae4e5dSmrg      *nto* | *qnx*)
75946fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
75956fae4e5dSmrg	;;
75961f0ac6a5Smrg
75976fae4e5dSmrg      openbsd2*)
75986fae4e5dSmrg        # C++ shared libraries are fairly broken
75996fae4e5dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
76009c9ff80cSmrg	;;
76011f0ac6a5Smrg
76026fae4e5dSmrg      openbsd*)
76036fae4e5dSmrg	if test -f /usr/libexec/ld.so; then
76046fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
76056fae4e5dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
76066fae4e5dSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
76076fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
76086fae4e5dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
76096fae4e5dSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
76106fae4e5dSmrg	    _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'
76116fae4e5dSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
76126fae4e5dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
76136fae4e5dSmrg	  fi
76146fae4e5dSmrg	  output_verbose_link_cmd=func_echo_all
76156fae4e5dSmrg	else
76166fae4e5dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
76176fae4e5dSmrg	fi
76186fae4e5dSmrg	;;
76191f0ac6a5Smrg
76206fae4e5dSmrg      osf3* | osf4* | osf5*)
76216fae4e5dSmrg        case $cc_basename in
76226fae4e5dSmrg          KCC*)
76236fae4e5dSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
76241f0ac6a5Smrg
76256fae4e5dSmrg	    # KCC will only create a shared library if the output file
76266fae4e5dSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
76276fae4e5dSmrg	    # to its proper name (with version) after linking.
76286fae4e5dSmrg	    _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'
76291f0ac6a5Smrg
76306fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
76316fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
76321f0ac6a5Smrg
76336fae4e5dSmrg	    # Archives containing C++ object files must be created using
76346fae4e5dSmrg	    # the KAI C++ compiler.
76356fae4e5dSmrg	    case $host in
76366fae4e5dSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
76376fae4e5dSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
76386fae4e5dSmrg	    esac
76396fae4e5dSmrg	    ;;
76406fae4e5dSmrg          RCC*)
76416fae4e5dSmrg	    # Rational C++ 2.4.1
76426fae4e5dSmrg	    # FIXME: insert proper C++ library support
76436fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
76446fae4e5dSmrg	    ;;
76456fae4e5dSmrg          cxx*)
76466fae4e5dSmrg	    case $host in
76476fae4e5dSmrg	      osf3*)
76486fae4e5dSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
76496fae4e5dSmrg	        _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'
76506fae4e5dSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
76516fae4e5dSmrg		;;
76526fae4e5dSmrg	      *)
76536fae4e5dSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
76546fae4e5dSmrg	        _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'
76556fae4e5dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
76566fae4e5dSmrg	          echo "-hidden">> $lib.exp~
76576fae4e5dSmrg	          $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~
76586fae4e5dSmrg	          $RM $lib.exp'
76596fae4e5dSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
76606fae4e5dSmrg		;;
76616fae4e5dSmrg	    esac
76629c9ff80cSmrg
76636fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
76649c9ff80cSmrg
76656fae4e5dSmrg	    # Commands to make compiler produce verbose output that lists
76666fae4e5dSmrg	    # what "hidden" libraries, object files and flags are used when
76676fae4e5dSmrg	    # linking a shared library.
76686fae4e5dSmrg	    #
76696fae4e5dSmrg	    # There doesn't appear to be a way to prevent this compiler from
76706fae4e5dSmrg	    # explicitly linking system object files so we need to strip them
76716fae4e5dSmrg	    # from the output so that they don't get included in the library
76726fae4e5dSmrg	    # dependencies.
76736fae4e5dSmrg	    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"'
76746fae4e5dSmrg	    ;;
76756fae4e5dSmrg	  *)
76766fae4e5dSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
76776fae4e5dSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
76786fae4e5dSmrg	      case $host in
76796fae4e5dSmrg	        osf3*)
76806fae4e5dSmrg	          _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'
76816fae4e5dSmrg		  ;;
76826fae4e5dSmrg	        *)
76836fae4e5dSmrg	          _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'
76846fae4e5dSmrg		  ;;
76856fae4e5dSmrg	      esac
76861f0ac6a5Smrg
76876fae4e5dSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
76886fae4e5dSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
76891f0ac6a5Smrg
76906fae4e5dSmrg	      # Commands to make compiler produce verbose output that lists
76916fae4e5dSmrg	      # what "hidden" libraries, object files and flags are used when
76926fae4e5dSmrg	      # linking a shared library.
76936fae4e5dSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
76941f0ac6a5Smrg
76956fae4e5dSmrg	    else
76966fae4e5dSmrg	      # FIXME: insert proper C++ library support
76976fae4e5dSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
76986fae4e5dSmrg	    fi
76996fae4e5dSmrg	    ;;
77006fae4e5dSmrg        esac
77016fae4e5dSmrg        ;;
77021f0ac6a5Smrg
77036fae4e5dSmrg      psos*)
77046fae4e5dSmrg        # FIXME: insert proper C++ library support
77056fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
77066fae4e5dSmrg        ;;
77071f0ac6a5Smrg
77086fae4e5dSmrg      sunos4*)
77096fae4e5dSmrg        case $cc_basename in
77106fae4e5dSmrg          CC*)
77116fae4e5dSmrg	    # Sun C++ 4.x
77126fae4e5dSmrg	    # FIXME: insert proper C++ library support
77136fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77146fae4e5dSmrg	    ;;
77156fae4e5dSmrg          lcc*)
77166fae4e5dSmrg	    # Lucid
77176fae4e5dSmrg	    # FIXME: insert proper C++ library support
77186fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77196fae4e5dSmrg	    ;;
77206fae4e5dSmrg          *)
77216fae4e5dSmrg	    # FIXME: insert proper C++ library support
77226fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77236fae4e5dSmrg	    ;;
77246fae4e5dSmrg        esac
77256fae4e5dSmrg        ;;
77261f0ac6a5Smrg
77276fae4e5dSmrg      solaris*)
77286fae4e5dSmrg        case $cc_basename in
77296fae4e5dSmrg          CC* | sunCC*)
77306fae4e5dSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
77316fae4e5dSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
77326fae4e5dSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
77336fae4e5dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
77346fae4e5dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
77356fae4e5dSmrg	      $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'
77361f0ac6a5Smrg
77376fae4e5dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
77386fae4e5dSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
77396fae4e5dSmrg	    case $host_os in
77406fae4e5dSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
77416fae4e5dSmrg	      *)
77426fae4e5dSmrg		# The compiler driver will combine and reorder linker options,
77436fae4e5dSmrg		# but understands `-z linker_flag'.
77446fae4e5dSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
77456fae4e5dSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
77466fae4e5dSmrg	        ;;
77476fae4e5dSmrg	    esac
77486fae4e5dSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
77499c9ff80cSmrg
77506fae4e5dSmrg	    output_verbose_link_cmd='func_echo_all'
77519c9ff80cSmrg
77526fae4e5dSmrg	    # Archives containing C++ object files must be created using
77536fae4e5dSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
77546fae4e5dSmrg	    # necessary to make sure instantiated templates are included
77556fae4e5dSmrg	    # in the archive.
77566fae4e5dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
77576fae4e5dSmrg	    ;;
77586fae4e5dSmrg          gcx*)
77596fae4e5dSmrg	    # Green Hills C++ Compiler
77606fae4e5dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
77619c9ff80cSmrg
77626fae4e5dSmrg	    # The C++ compiler must be used to create the archive.
77636fae4e5dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
77646fae4e5dSmrg	    ;;
77656fae4e5dSmrg          *)
77666fae4e5dSmrg	    # GNU C++ compiler with Solaris linker
77676fae4e5dSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
77686fae4e5dSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
77696fae4e5dSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
77706fae4e5dSmrg	        _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'
77716fae4e5dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
77726fae4e5dSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
77731f0ac6a5Smrg
77746fae4e5dSmrg	        # Commands to make compiler produce verbose output that lists
77756fae4e5dSmrg	        # what "hidden" libraries, object files and flags are used when
77766fae4e5dSmrg	        # linking a shared library.
77776fae4e5dSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
77786fae4e5dSmrg	      else
77796fae4e5dSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
77806fae4e5dSmrg	        # platform.
77816fae4e5dSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
77826fae4e5dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
77836fae4e5dSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
77841f0ac6a5Smrg
77856fae4e5dSmrg	        # Commands to make compiler produce verbose output that lists
77866fae4e5dSmrg	        # what "hidden" libraries, object files and flags are used when
77876fae4e5dSmrg	        # linking a shared library.
77886fae4e5dSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
77896fae4e5dSmrg	      fi
77901f0ac6a5Smrg
77916fae4e5dSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
77926fae4e5dSmrg	      case $host_os in
77936fae4e5dSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
77946fae4e5dSmrg		*)
77956fae4e5dSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
77966fae4e5dSmrg		  ;;
77976fae4e5dSmrg	      esac
77986fae4e5dSmrg	    fi
77996fae4e5dSmrg	    ;;
78006fae4e5dSmrg        esac
78016fae4e5dSmrg        ;;
78021f0ac6a5Smrg
78036fae4e5dSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
78046fae4e5dSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
78056fae4e5dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
78066fae4e5dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
78076fae4e5dSmrg      runpath_var='LD_RUN_PATH'
78081f0ac6a5Smrg
78096fae4e5dSmrg      case $cc_basename in
78106fae4e5dSmrg        CC*)
78116fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78126fae4e5dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78136fae4e5dSmrg	  ;;
78146fae4e5dSmrg	*)
78156fae4e5dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78166fae4e5dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78176fae4e5dSmrg	  ;;
78186fae4e5dSmrg      esac
78196fae4e5dSmrg      ;;
78201f0ac6a5Smrg
78216fae4e5dSmrg      sysv5* | sco3.2v5* | sco5v6*)
78226fae4e5dSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
78236fae4e5dSmrg	# link with -lc, and that would cause any symbols used from libc to
78246fae4e5dSmrg	# always be unresolved, which means just about no library would
78256fae4e5dSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
78266fae4e5dSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
78276fae4e5dSmrg	# as -z defs.
78286fae4e5dSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
78296fae4e5dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
78306fae4e5dSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78316fae4e5dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
78326fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
78336fae4e5dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
78346fae4e5dSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
78356fae4e5dSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
78366fae4e5dSmrg	runpath_var='LD_RUN_PATH'
78376fae4e5dSmrg
78386fae4e5dSmrg	case $cc_basename in
78396fae4e5dSmrg          CC*)
78406fae4e5dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78416fae4e5dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78426fae4e5dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
78436fae4e5dSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
78446fae4e5dSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
78456fae4e5dSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
78466fae4e5dSmrg	    ;;
78476fae4e5dSmrg	  *)
78486fae4e5dSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78496fae4e5dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78506fae4e5dSmrg	    ;;
78516fae4e5dSmrg	esac
78526fae4e5dSmrg      ;;
78536fae4e5dSmrg
78546fae4e5dSmrg      tandem*)
78556fae4e5dSmrg        case $cc_basename in
78566fae4e5dSmrg          NCC*)
78576fae4e5dSmrg	    # NonStop-UX NCC 3.20
78586fae4e5dSmrg	    # FIXME: insert proper C++ library support
78596fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78606fae4e5dSmrg	    ;;
78616fae4e5dSmrg          *)
78626fae4e5dSmrg	    # FIXME: insert proper C++ library support
78636fae4e5dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78646fae4e5dSmrg	    ;;
78656fae4e5dSmrg        esac
78666fae4e5dSmrg        ;;
78676fae4e5dSmrg
78686fae4e5dSmrg      vxworks*)
78696fae4e5dSmrg        # FIXME: insert proper C++ library support
78706fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
78716fae4e5dSmrg        ;;
78721f0ac6a5Smrg
78736fae4e5dSmrg      *)
78746fae4e5dSmrg        # FIXME: insert proper C++ library support
78756fae4e5dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
78766fae4e5dSmrg        ;;
78776fae4e5dSmrg    esac
78781f0ac6a5Smrg
78796fae4e5dSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
78806fae4e5dSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
78819c9ff80cSmrg
78826fae4e5dSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
78836fae4e5dSmrg    _LT_TAGVAR(LD, $1)="$LD"
78841f0ac6a5Smrg
78856fae4e5dSmrg    ## CAVEAT EMPTOR:
78866fae4e5dSmrg    ## There is no encapsulation within the following macros, do not change
78876fae4e5dSmrg    ## the running order or otherwise move them around unless you know exactly
78886fae4e5dSmrg    ## what you are doing...
78896fae4e5dSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
78906fae4e5dSmrg    _LT_COMPILER_PIC($1)
78916fae4e5dSmrg    _LT_COMPILER_C_O($1)
78926fae4e5dSmrg    _LT_COMPILER_FILE_LOCKS($1)
78936fae4e5dSmrg    _LT_LINKER_SHLIBS($1)
78946fae4e5dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
78956fae4e5dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7896e5410a46Smrg
78976fae4e5dSmrg    _LT_CONFIG($1)
78986fae4e5dSmrg  fi # test -n "$compiler"
78999c9ff80cSmrg
79006fae4e5dSmrg  CC=$lt_save_CC
79016fae4e5dSmrg  CFLAGS=$lt_save_CFLAGS
79026fae4e5dSmrg  LDCXX=$LD
79036fae4e5dSmrg  LD=$lt_save_LD
79046fae4e5dSmrg  GCC=$lt_save_GCC
79056fae4e5dSmrg  with_gnu_ld=$lt_save_with_gnu_ld
79066fae4e5dSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
79076fae4e5dSmrg  lt_cv_path_LD=$lt_save_path_LD
79086fae4e5dSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
79096fae4e5dSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
79106fae4e5dSmrgfi # test "$_lt_caught_CXX_error" != yes
79119c9ff80cSmrg
79126fae4e5dSmrgAC_LANG_POP
79136fae4e5dSmrg])# _LT_LANG_CXX_CONFIG
79149c9ff80cSmrg
79159c9ff80cSmrg
79166fae4e5dSmrg# _LT_FUNC_STRIPNAME_CNF
79176fae4e5dSmrg# ----------------------
79186fae4e5dSmrg# func_stripname_cnf prefix suffix name
79196fae4e5dSmrg# strip PREFIX and SUFFIX off of NAME.
79206fae4e5dSmrg# PREFIX and SUFFIX must not contain globbing or regex special
79216fae4e5dSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
79226fae4e5dSmrg# dot (in which case that matches only a dot).
79236fae4e5dSmrg#
79246fae4e5dSmrg# This function is identical to the (non-XSI) version of func_stripname,
79256fae4e5dSmrg# except this one can be used by m4 code that may be executed by configure,
79266fae4e5dSmrg# rather than the libtool script.
79276fae4e5dSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
79286fae4e5dSmrgAC_REQUIRE([_LT_DECL_SED])
79296fae4e5dSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
79306fae4e5dSmrgfunc_stripname_cnf ()
79316fae4e5dSmrg{
79326fae4e5dSmrg  case ${2} in
79336fae4e5dSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
79346fae4e5dSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
79356fae4e5dSmrg  esac
79366fae4e5dSmrg} # func_stripname_cnf
79376fae4e5dSmrg])# _LT_FUNC_STRIPNAME_CNF
79389c9ff80cSmrg
79396fae4e5dSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
79406fae4e5dSmrg# ---------------------------------
79416fae4e5dSmrg# Figure out "hidden" library dependencies from verbose
79426fae4e5dSmrg# compiler output when linking a shared library.
79436fae4e5dSmrg# Parse the compiler output and extract the necessary
79446fae4e5dSmrg# objects, libraries and library flags.
79456fae4e5dSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
79466fae4e5dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
79476fae4e5dSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
79486fae4e5dSmrg# Dependencies to place before and after the object being linked:
79496fae4e5dSmrg_LT_TAGVAR(predep_objects, $1)=
79506fae4e5dSmrg_LT_TAGVAR(postdep_objects, $1)=
79516fae4e5dSmrg_LT_TAGVAR(predeps, $1)=
79526fae4e5dSmrg_LT_TAGVAR(postdeps, $1)=
79536fae4e5dSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
79541f0ac6a5Smrg
79556fae4e5dSmrgdnl we can't use the lt_simple_compile_test_code here,
79566fae4e5dSmrgdnl because it contains code intended for an executable,
79576fae4e5dSmrgdnl not a library.  It's possible we should let each
79586fae4e5dSmrgdnl tag define a new lt_????_link_test_code variable,
79596fae4e5dSmrgdnl but it's only used here...
79606fae4e5dSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
79616fae4e5dSmrgint a;
79626fae4e5dSmrgvoid foo (void) { a = 0; }
79636fae4e5dSmrg_LT_EOF
79646fae4e5dSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
79656fae4e5dSmrgclass Foo
79666fae4e5dSmrg{
79676fae4e5dSmrgpublic:
79686fae4e5dSmrg  Foo (void) { a = 0; }
79696fae4e5dSmrgprivate:
79706fae4e5dSmrg  int a;
79716fae4e5dSmrg};
79726fae4e5dSmrg_LT_EOF
79736fae4e5dSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
79746fae4e5dSmrg      subroutine foo
79756fae4e5dSmrg      implicit none
79766fae4e5dSmrg      integer*4 a
79776fae4e5dSmrg      a=0
79786fae4e5dSmrg      return
79796fae4e5dSmrg      end
79806fae4e5dSmrg_LT_EOF
79816fae4e5dSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
79826fae4e5dSmrg      subroutine foo
79836fae4e5dSmrg      implicit none
79846fae4e5dSmrg      integer a
79856fae4e5dSmrg      a=0
79866fae4e5dSmrg      return
79876fae4e5dSmrg      end
79886fae4e5dSmrg_LT_EOF
79896fae4e5dSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
79906fae4e5dSmrgpublic class foo {
79916fae4e5dSmrg  private int a;
79926fae4e5dSmrg  public void bar (void) {
79936fae4e5dSmrg    a = 0;
79946fae4e5dSmrg  }
79956fae4e5dSmrg};
79966fae4e5dSmrg_LT_EOF
799789c04b6cSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
799889c04b6cSmrgpackage foo
799989c04b6cSmrgfunc foo() {
800089c04b6cSmrg}
800189c04b6cSmrg_LT_EOF
80026fae4e5dSmrg])
80031f0ac6a5Smrg
80046fae4e5dSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
80056fae4e5dSmrgcase "$CC $CFLAGS " in #(
80066fae4e5dSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
80076fae4e5dSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
800889c04b6cSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
80096fae4e5dSmrgesac
80101f0ac6a5Smrg
80116fae4e5dSmrgdnl Parse the compiler output and extract the necessary
80126fae4e5dSmrgdnl objects, libraries and library flags.
80136fae4e5dSmrgif AC_TRY_EVAL(ac_compile); then
80146fae4e5dSmrg  # Parse the compiler output and extract the necessary
80156fae4e5dSmrg  # objects, libraries and library flags.
80161f0ac6a5Smrg
80176fae4e5dSmrg  # Sentinel used to keep track of whether or not we are before
80186fae4e5dSmrg  # the conftest object file.
80196fae4e5dSmrg  pre_test_object_deps_done=no
80201f0ac6a5Smrg
80216fae4e5dSmrg  for p in `eval "$output_verbose_link_cmd"`; do
80226fae4e5dSmrg    case ${prev}${p} in
80231f0ac6a5Smrg
80246fae4e5dSmrg    -L* | -R* | -l*)
80256fae4e5dSmrg       # Some compilers place space between "-{L,R}" and the path.
80266fae4e5dSmrg       # Remove the space.
80276fae4e5dSmrg       if test $p = "-L" ||
80286fae4e5dSmrg          test $p = "-R"; then
80296fae4e5dSmrg	 prev=$p
80306fae4e5dSmrg	 continue
80316fae4e5dSmrg       fi
80321f0ac6a5Smrg
80336fae4e5dSmrg       # Expand the sysroot to ease extracting the directories later.
80346fae4e5dSmrg       if test -z "$prev"; then
80356fae4e5dSmrg         case $p in
80366fae4e5dSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
80376fae4e5dSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
80386fae4e5dSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
80396fae4e5dSmrg         esac
80406fae4e5dSmrg       fi
80416fae4e5dSmrg       case $p in
80426fae4e5dSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
80436fae4e5dSmrg       esac
80446fae4e5dSmrg       if test "$pre_test_object_deps_done" = no; then
80456fae4e5dSmrg	 case ${prev} in
80466fae4e5dSmrg	 -L | -R)
80476fae4e5dSmrg	   # Internal compiler library paths should come after those
80486fae4e5dSmrg	   # provided the user.  The postdeps already come after the
80496fae4e5dSmrg	   # user supplied libs so there is no need to process them.
80506fae4e5dSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
80516fae4e5dSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
80526fae4e5dSmrg	   else
80536fae4e5dSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
80546fae4e5dSmrg	   fi
80556fae4e5dSmrg	   ;;
80566fae4e5dSmrg	 # The "-l" case would never come before the object being
80576fae4e5dSmrg	 # linked, so don't bother handling this case.
80586fae4e5dSmrg	 esac
80596fae4e5dSmrg       else
80606fae4e5dSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
80616fae4e5dSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
80626fae4e5dSmrg	 else
80636fae4e5dSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
80646fae4e5dSmrg	 fi
80656fae4e5dSmrg       fi
80666fae4e5dSmrg       prev=
80676fae4e5dSmrg       ;;
80689c9ff80cSmrg
80696fae4e5dSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
80706fae4e5dSmrg    *.$objext)
80716fae4e5dSmrg       # This assumes that the test object file only shows up
80726fae4e5dSmrg       # once in the compiler output.
80736fae4e5dSmrg       if test "$p" = "conftest.$objext"; then
80746fae4e5dSmrg	 pre_test_object_deps_done=yes
80756fae4e5dSmrg	 continue
80766fae4e5dSmrg       fi
80771f0ac6a5Smrg
80786fae4e5dSmrg       if test "$pre_test_object_deps_done" = no; then
80796fae4e5dSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
80806fae4e5dSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
80816fae4e5dSmrg	 else
80826fae4e5dSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
80836fae4e5dSmrg	 fi
80846fae4e5dSmrg       else
80856fae4e5dSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
80866fae4e5dSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
80876fae4e5dSmrg	 else
80886fae4e5dSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
80896fae4e5dSmrg	 fi
80906fae4e5dSmrg       fi
80916fae4e5dSmrg       ;;
80921f0ac6a5Smrg
80936fae4e5dSmrg    *) ;; # Ignore the rest.
80941f0ac6a5Smrg
80956fae4e5dSmrg    esac
80966fae4e5dSmrg  done
80979c9ff80cSmrg
80986fae4e5dSmrg  # Clean up.
80996fae4e5dSmrg  rm -f a.out a.exe
81006fae4e5dSmrgelse
81016fae4e5dSmrg  echo "libtool.m4: error: problem compiling $1 test program"
81026fae4e5dSmrgfi
81031f0ac6a5Smrg
81046fae4e5dSmrg$RM -f confest.$objext
81056fae4e5dSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
81061f0ac6a5Smrg
81076fae4e5dSmrg# PORTME: override above test on systems where it is broken
81086fae4e5dSmrgm4_if([$1], [CXX],
81096fae4e5dSmrg[case $host_os in
81106fae4e5dSmrginterix[[3-9]]*)
81116fae4e5dSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
81126fae4e5dSmrg  # hack all around it, let's just trust "g++" to DTRT.
81136fae4e5dSmrg  _LT_TAGVAR(predep_objects,$1)=
81146fae4e5dSmrg  _LT_TAGVAR(postdep_objects,$1)=
81156fae4e5dSmrg  _LT_TAGVAR(postdeps,$1)=
81166fae4e5dSmrg  ;;
81179c9ff80cSmrg
81186fae4e5dSmrglinux*)
81196fae4e5dSmrg  case `$CC -V 2>&1 | sed 5q` in
81206fae4e5dSmrg  *Sun\ C*)
81216fae4e5dSmrg    # Sun C++ 5.9
81229c9ff80cSmrg
81236fae4e5dSmrg    # The more standards-conforming stlport4 library is
81246fae4e5dSmrg    # incompatible with the Cstd library. Avoid specifying
81256fae4e5dSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
81266fae4e5dSmrg    # -library=stlport4 depends on it.
81276fae4e5dSmrg    case " $CXX $CXXFLAGS " in
81286fae4e5dSmrg    *" -library=stlport4 "*)
81296fae4e5dSmrg      solaris_use_stlport4=yes
81306fae4e5dSmrg      ;;
81316fae4e5dSmrg    esac
81321f0ac6a5Smrg
81336fae4e5dSmrg    if test "$solaris_use_stlport4" != yes; then
81346fae4e5dSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
81356fae4e5dSmrg    fi
81366fae4e5dSmrg    ;;
81376fae4e5dSmrg  esac
81386fae4e5dSmrg  ;;
81399c9ff80cSmrg
81406fae4e5dSmrgsolaris*)
81416fae4e5dSmrg  case $cc_basename in
81426fae4e5dSmrg  CC* | sunCC*)
81436fae4e5dSmrg    # The more standards-conforming stlport4 library is
81446fae4e5dSmrg    # incompatible with the Cstd library. Avoid specifying
81456fae4e5dSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
81466fae4e5dSmrg    # -library=stlport4 depends on it.
81476fae4e5dSmrg    case " $CXX $CXXFLAGS " in
81486fae4e5dSmrg    *" -library=stlport4 "*)
81496fae4e5dSmrg      solaris_use_stlport4=yes
81506fae4e5dSmrg      ;;
81516fae4e5dSmrg    esac
81521f0ac6a5Smrg
81536fae4e5dSmrg    # Adding this requires a known-good setup of shared libraries for
81546fae4e5dSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
81556fae4e5dSmrg    # archive will be linked into the output, leading to subtle bugs.
81566fae4e5dSmrg    if test "$solaris_use_stlport4" != yes; then
81576fae4e5dSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
81586fae4e5dSmrg    fi
81596fae4e5dSmrg    ;;
81606fae4e5dSmrg  esac
81616fae4e5dSmrg  ;;
81626fae4e5dSmrgesac
81636fae4e5dSmrg])
81641f0ac6a5Smrg
81656fae4e5dSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
81666fae4e5dSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
81676fae4e5dSmrgesac
81686fae4e5dSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
81696fae4e5dSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
81706fae4e5dSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
81716fae4e5dSmrgfi
81726fae4e5dSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
81736fae4e5dSmrg    [The directories searched by this compiler when creating a shared library])
81746fae4e5dSmrg_LT_TAGDECL([], [predep_objects], [1],
81756fae4e5dSmrg    [Dependencies to place before and after the objects being linked to
81766fae4e5dSmrg    create a shared library])
81776fae4e5dSmrg_LT_TAGDECL([], [postdep_objects], [1])
81786fae4e5dSmrg_LT_TAGDECL([], [predeps], [1])
81796fae4e5dSmrg_LT_TAGDECL([], [postdeps], [1])
81806fae4e5dSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
81816fae4e5dSmrg    [The library search path used internally by the compiler when linking
81826fae4e5dSmrg    a shared library])
81836fae4e5dSmrg])# _LT_SYS_HIDDEN_LIBDEPS
81841f0ac6a5Smrg
81851f0ac6a5Smrg
81866fae4e5dSmrg# _LT_LANG_F77_CONFIG([TAG])
81876fae4e5dSmrg# --------------------------
81886fae4e5dSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
81896fae4e5dSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
81906fae4e5dSmrg# to write the compiler configuration to `libtool'.
81916fae4e5dSmrgm4_defun([_LT_LANG_F77_CONFIG],
81926fae4e5dSmrg[AC_LANG_PUSH(Fortran 77)
81936fae4e5dSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
81946fae4e5dSmrg  _lt_disable_F77=yes
81956fae4e5dSmrgfi
81966fae4e5dSmrg
81976fae4e5dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
81986fae4e5dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
81996fae4e5dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
82006fae4e5dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
82016fae4e5dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
82026fae4e5dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
82036fae4e5dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
82046fae4e5dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
82056fae4e5dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
82066fae4e5dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
82076fae4e5dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
82086fae4e5dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
82096fae4e5dSmrg_LT_TAGVAR(module_cmds, $1)=
82106fae4e5dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
82116fae4e5dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
82126fae4e5dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
82136fae4e5dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
82146fae4e5dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
82156fae4e5dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
82166fae4e5dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
82176fae4e5dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
82181f0ac6a5Smrg
82196fae4e5dSmrg# Source file extension for f77 test sources.
82206fae4e5dSmrgac_ext=f
82211f0ac6a5Smrg
82226fae4e5dSmrg# Object file extension for compiled f77 test sources.
82236fae4e5dSmrgobjext=o
82246fae4e5dSmrg_LT_TAGVAR(objext, $1)=$objext
82251f0ac6a5Smrg
82266fae4e5dSmrg# No sense in running all these tests if we already determined that
82276fae4e5dSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
82286fae4e5dSmrg# are currently assumed to apply to all compilers on this platform,
82296fae4e5dSmrg# and will be corrupted by setting them based on a non-working compiler.
82306fae4e5dSmrgif test "$_lt_disable_F77" != yes; then
82316fae4e5dSmrg  # Code to be used in simple compile tests
82326fae4e5dSmrg  lt_simple_compile_test_code="\
82336fae4e5dSmrg      subroutine t
82346fae4e5dSmrg      return
82356fae4e5dSmrg      end
82366fae4e5dSmrg"
82371f0ac6a5Smrg
82386fae4e5dSmrg  # Code to be used in simple link tests
82396fae4e5dSmrg  lt_simple_link_test_code="\
82406fae4e5dSmrg      program t
82416fae4e5dSmrg      end
82426fae4e5dSmrg"
82431f0ac6a5Smrg
82446fae4e5dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
82456fae4e5dSmrg  _LT_TAG_COMPILER
82469c9ff80cSmrg
82476fae4e5dSmrg  # save warnings/boilerplate of simple test code
82486fae4e5dSmrg  _LT_COMPILER_BOILERPLATE
82496fae4e5dSmrg  _LT_LINKER_BOILERPLATE
82501f0ac6a5Smrg
82516fae4e5dSmrg  # Allow CC to be a program name with arguments.
82526fae4e5dSmrg  lt_save_CC="$CC"
82536fae4e5dSmrg  lt_save_GCC=$GCC
82546fae4e5dSmrg  lt_save_CFLAGS=$CFLAGS
82556fae4e5dSmrg  CC=${F77-"f77"}
82566fae4e5dSmrg  CFLAGS=$FFLAGS
82576fae4e5dSmrg  compiler=$CC
82586fae4e5dSmrg  _LT_TAGVAR(compiler, $1)=$CC
82596fae4e5dSmrg  _LT_CC_BASENAME([$compiler])
82606fae4e5dSmrg  GCC=$G77
82616fae4e5dSmrg  if test -n "$compiler"; then
82626fae4e5dSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
82636fae4e5dSmrg    AC_MSG_RESULT([$can_build_shared])
82649c9ff80cSmrg
82656fae4e5dSmrg    AC_MSG_CHECKING([whether to build shared libraries])
82666fae4e5dSmrg    test "$can_build_shared" = "no" && enable_shared=no
82679c9ff80cSmrg
82686fae4e5dSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
82696fae4e5dSmrg    # are all built from PIC.
82706fae4e5dSmrg    case $host_os in
82716fae4e5dSmrg      aix3*)
82726fae4e5dSmrg        test "$enable_shared" = yes && enable_static=no
82736fae4e5dSmrg        if test -n "$RANLIB"; then
82746fae4e5dSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
82756fae4e5dSmrg          postinstall_cmds='$RANLIB $lib'
82766fae4e5dSmrg        fi
82776fae4e5dSmrg        ;;
82786fae4e5dSmrg      aix[[4-9]]*)
82796fae4e5dSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
82806fae4e5dSmrg	  test "$enable_shared" = yes && enable_static=no
82816fae4e5dSmrg	fi
82829c9ff80cSmrg        ;;
82836fae4e5dSmrg    esac
82846fae4e5dSmrg    AC_MSG_RESULT([$enable_shared])
82851f0ac6a5Smrg
82866fae4e5dSmrg    AC_MSG_CHECKING([whether to build static libraries])
82876fae4e5dSmrg    # Make sure either enable_shared or enable_static is yes.
82886fae4e5dSmrg    test "$enable_shared" = yes || enable_static=yes
82896fae4e5dSmrg    AC_MSG_RESULT([$enable_static])
82909c9ff80cSmrg
82916fae4e5dSmrg    _LT_TAGVAR(GCC, $1)="$G77"
82926fae4e5dSmrg    _LT_TAGVAR(LD, $1)="$LD"
82936fae4e5dSmrg
82946fae4e5dSmrg    ## CAVEAT EMPTOR:
82956fae4e5dSmrg    ## There is no encapsulation within the following macros, do not change
82966fae4e5dSmrg    ## the running order or otherwise move them around unless you know exactly
82976fae4e5dSmrg    ## what you are doing...
82986fae4e5dSmrg    _LT_COMPILER_PIC($1)
82996fae4e5dSmrg    _LT_COMPILER_C_O($1)
83006fae4e5dSmrg    _LT_COMPILER_FILE_LOCKS($1)
83016fae4e5dSmrg    _LT_LINKER_SHLIBS($1)
83026fae4e5dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
83036fae4e5dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
83041f0ac6a5Smrg
83056fae4e5dSmrg    _LT_CONFIG($1)
83066fae4e5dSmrg  fi # test -n "$compiler"
83079c9ff80cSmrg
83086fae4e5dSmrg  GCC=$lt_save_GCC
83096fae4e5dSmrg  CC="$lt_save_CC"
83106fae4e5dSmrg  CFLAGS="$lt_save_CFLAGS"
83116fae4e5dSmrgfi # test "$_lt_disable_F77" != yes
83129c9ff80cSmrg
83136fae4e5dSmrgAC_LANG_POP
83146fae4e5dSmrg])# _LT_LANG_F77_CONFIG
83159c9ff80cSmrg
83161f0ac6a5Smrg
83176fae4e5dSmrg# _LT_LANG_FC_CONFIG([TAG])
83186fae4e5dSmrg# -------------------------
83196fae4e5dSmrg# Ensure that the configuration variables for a Fortran compiler are
83206fae4e5dSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
83216fae4e5dSmrg# to write the compiler configuration to `libtool'.
83226fae4e5dSmrgm4_defun([_LT_LANG_FC_CONFIG],
83236fae4e5dSmrg[AC_LANG_PUSH(Fortran)
83241f0ac6a5Smrg
83256fae4e5dSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
83266fae4e5dSmrg  _lt_disable_FC=yes
83276fae4e5dSmrgfi
83281f0ac6a5Smrg
83296fae4e5dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
83306fae4e5dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
83316fae4e5dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
83326fae4e5dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
83336fae4e5dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
83346fae4e5dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
83356fae4e5dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
83366fae4e5dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
83376fae4e5dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
83386fae4e5dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
83396fae4e5dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
83406fae4e5dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
83416fae4e5dSmrg_LT_TAGVAR(module_cmds, $1)=
83426fae4e5dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
83436fae4e5dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
83446fae4e5dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
83456fae4e5dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
83466fae4e5dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
83476fae4e5dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
83486fae4e5dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
83496fae4e5dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
83509c9ff80cSmrg
83516fae4e5dSmrg# Source file extension for fc test sources.
83526fae4e5dSmrgac_ext=${ac_fc_srcext-f}
83539c9ff80cSmrg
83546fae4e5dSmrg# Object file extension for compiled fc test sources.
83556fae4e5dSmrgobjext=o
83566fae4e5dSmrg_LT_TAGVAR(objext, $1)=$objext
83571f0ac6a5Smrg
83586fae4e5dSmrg# No sense in running all these tests if we already determined that
83596fae4e5dSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
83606fae4e5dSmrg# are currently assumed to apply to all compilers on this platform,
83616fae4e5dSmrg# and will be corrupted by setting them based on a non-working compiler.
83626fae4e5dSmrgif test "$_lt_disable_FC" != yes; then
83636fae4e5dSmrg  # Code to be used in simple compile tests
83646fae4e5dSmrg  lt_simple_compile_test_code="\
83656fae4e5dSmrg      subroutine t
83666fae4e5dSmrg      return
83676fae4e5dSmrg      end
83686fae4e5dSmrg"
83691f0ac6a5Smrg
83706fae4e5dSmrg  # Code to be used in simple link tests
83716fae4e5dSmrg  lt_simple_link_test_code="\
83726fae4e5dSmrg      program t
83736fae4e5dSmrg      end
83746fae4e5dSmrg"
83751f0ac6a5Smrg
83766fae4e5dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
83776fae4e5dSmrg  _LT_TAG_COMPILER
83781f0ac6a5Smrg
83796fae4e5dSmrg  # save warnings/boilerplate of simple test code
83806fae4e5dSmrg  _LT_COMPILER_BOILERPLATE
83816fae4e5dSmrg  _LT_LINKER_BOILERPLATE
83821f0ac6a5Smrg
83836fae4e5dSmrg  # Allow CC to be a program name with arguments.
83846fae4e5dSmrg  lt_save_CC="$CC"
83856fae4e5dSmrg  lt_save_GCC=$GCC
83866fae4e5dSmrg  lt_save_CFLAGS=$CFLAGS
83876fae4e5dSmrg  CC=${FC-"f95"}
83886fae4e5dSmrg  CFLAGS=$FCFLAGS
83896fae4e5dSmrg  compiler=$CC
83906fae4e5dSmrg  GCC=$ac_cv_fc_compiler_gnu
83911f0ac6a5Smrg
83926fae4e5dSmrg  _LT_TAGVAR(compiler, $1)=$CC
83936fae4e5dSmrg  _LT_CC_BASENAME([$compiler])
83941f0ac6a5Smrg
83956fae4e5dSmrg  if test -n "$compiler"; then
83966fae4e5dSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
83976fae4e5dSmrg    AC_MSG_RESULT([$can_build_shared])
83986fae4e5dSmrg
83996fae4e5dSmrg    AC_MSG_CHECKING([whether to build shared libraries])
84006fae4e5dSmrg    test "$can_build_shared" = "no" && enable_shared=no
84016fae4e5dSmrg
84026fae4e5dSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
84036fae4e5dSmrg    # are all built from PIC.
84046fae4e5dSmrg    case $host_os in
84056fae4e5dSmrg      aix3*)
84066fae4e5dSmrg        test "$enable_shared" = yes && enable_static=no
84076fae4e5dSmrg        if test -n "$RANLIB"; then
84086fae4e5dSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
84096fae4e5dSmrg          postinstall_cmds='$RANLIB $lib'
84106fae4e5dSmrg        fi
84116fae4e5dSmrg        ;;
84126fae4e5dSmrg      aix[[4-9]]*)
84136fae4e5dSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
84146fae4e5dSmrg	  test "$enable_shared" = yes && enable_static=no
84159c9ff80cSmrg	fi
84166fae4e5dSmrg        ;;
84176fae4e5dSmrg    esac
84186fae4e5dSmrg    AC_MSG_RESULT([$enable_shared])
84191f0ac6a5Smrg
84206fae4e5dSmrg    AC_MSG_CHECKING([whether to build static libraries])
84216fae4e5dSmrg    # Make sure either enable_shared or enable_static is yes.
84226fae4e5dSmrg    test "$enable_shared" = yes || enable_static=yes
84236fae4e5dSmrg    AC_MSG_RESULT([$enable_static])
84249c9ff80cSmrg
84256fae4e5dSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
84266fae4e5dSmrg    _LT_TAGVAR(LD, $1)="$LD"
84279c9ff80cSmrg
84286fae4e5dSmrg    ## CAVEAT EMPTOR:
84296fae4e5dSmrg    ## There is no encapsulation within the following macros, do not change
84306fae4e5dSmrg    ## the running order or otherwise move them around unless you know exactly
84316fae4e5dSmrg    ## what you are doing...
84326fae4e5dSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
84336fae4e5dSmrg    _LT_COMPILER_PIC($1)
84346fae4e5dSmrg    _LT_COMPILER_C_O($1)
84356fae4e5dSmrg    _LT_COMPILER_FILE_LOCKS($1)
84366fae4e5dSmrg    _LT_LINKER_SHLIBS($1)
84376fae4e5dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
84386fae4e5dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
84399c9ff80cSmrg
84406fae4e5dSmrg    _LT_CONFIG($1)
84416fae4e5dSmrg  fi # test -n "$compiler"
84421f0ac6a5Smrg
84436fae4e5dSmrg  GCC=$lt_save_GCC
84446fae4e5dSmrg  CC=$lt_save_CC
84456fae4e5dSmrg  CFLAGS=$lt_save_CFLAGS
84466fae4e5dSmrgfi # test "$_lt_disable_FC" != yes
84471f0ac6a5Smrg
84486fae4e5dSmrgAC_LANG_POP
84496fae4e5dSmrg])# _LT_LANG_FC_CONFIG
84509c9ff80cSmrg
84519c9ff80cSmrg
84526fae4e5dSmrg# _LT_LANG_GCJ_CONFIG([TAG])
84536fae4e5dSmrg# --------------------------
84546fae4e5dSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
84556fae4e5dSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
84566fae4e5dSmrg# to write the compiler configuration to `libtool'.
84576fae4e5dSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
84586fae4e5dSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
84596fae4e5dSmrgAC_LANG_SAVE
84609c9ff80cSmrg
84616fae4e5dSmrg# Source file extension for Java test sources.
84626fae4e5dSmrgac_ext=java
84631f0ac6a5Smrg
84646fae4e5dSmrg# Object file extension for compiled Java test sources.
84656fae4e5dSmrgobjext=o
84666fae4e5dSmrg_LT_TAGVAR(objext, $1)=$objext
84671f0ac6a5Smrg
84686fae4e5dSmrg# Code to be used in simple compile tests
84696fae4e5dSmrglt_simple_compile_test_code="class foo {}"
84701f0ac6a5Smrg
84716fae4e5dSmrg# Code to be used in simple link tests
84726fae4e5dSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
84739c9ff80cSmrg
84746fae4e5dSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
84756fae4e5dSmrg_LT_TAG_COMPILER
84761f0ac6a5Smrg
84776fae4e5dSmrg# save warnings/boilerplate of simple test code
84786fae4e5dSmrg_LT_COMPILER_BOILERPLATE
84796fae4e5dSmrg_LT_LINKER_BOILERPLATE
84801f0ac6a5Smrg
84816fae4e5dSmrg# Allow CC to be a program name with arguments.
84826fae4e5dSmrglt_save_CC=$CC
84836fae4e5dSmrglt_save_CFLAGS=$CFLAGS
84846fae4e5dSmrglt_save_GCC=$GCC
84856fae4e5dSmrgGCC=yes
84866fae4e5dSmrgCC=${GCJ-"gcj"}
84876fae4e5dSmrgCFLAGS=$GCJFLAGS
84886fae4e5dSmrgcompiler=$CC
84896fae4e5dSmrg_LT_TAGVAR(compiler, $1)=$CC
84906fae4e5dSmrg_LT_TAGVAR(LD, $1)="$LD"
84916fae4e5dSmrg_LT_CC_BASENAME([$compiler])
84921f0ac6a5Smrg
84936fae4e5dSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
84946fae4e5dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
84959c9ff80cSmrg
84966fae4e5dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
84976fae4e5dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
84986fae4e5dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
84999c9ff80cSmrg
85006fae4e5dSmrgif test -n "$compiler"; then
85016fae4e5dSmrg  _LT_COMPILER_NO_RTTI($1)
85026fae4e5dSmrg  _LT_COMPILER_PIC($1)
85036fae4e5dSmrg  _LT_COMPILER_C_O($1)
85046fae4e5dSmrg  _LT_COMPILER_FILE_LOCKS($1)
85056fae4e5dSmrg  _LT_LINKER_SHLIBS($1)
85066fae4e5dSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
85079c9ff80cSmrg
85086fae4e5dSmrg  _LT_CONFIG($1)
85096fae4e5dSmrgfi
85101f0ac6a5Smrg
85116fae4e5dSmrgAC_LANG_RESTORE
85121f0ac6a5Smrg
85136fae4e5dSmrgGCC=$lt_save_GCC
85146fae4e5dSmrgCC=$lt_save_CC
85156fae4e5dSmrgCFLAGS=$lt_save_CFLAGS
85166fae4e5dSmrg])# _LT_LANG_GCJ_CONFIG
85171f0ac6a5Smrg
85181f0ac6a5Smrg
851989c04b6cSmrg# _LT_LANG_GO_CONFIG([TAG])
852089c04b6cSmrg# --------------------------
852189c04b6cSmrg# Ensure that the configuration variables for the GNU Go compiler
852289c04b6cSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
852389c04b6cSmrg# to write the compiler configuration to `libtool'.
852489c04b6cSmrgm4_defun([_LT_LANG_GO_CONFIG],
852589c04b6cSmrg[AC_REQUIRE([LT_PROG_GO])dnl
852689c04b6cSmrgAC_LANG_SAVE
852789c04b6cSmrg
852889c04b6cSmrg# Source file extension for Go test sources.
852989c04b6cSmrgac_ext=go
853089c04b6cSmrg
853189c04b6cSmrg# Object file extension for compiled Go test sources.
853289c04b6cSmrgobjext=o
853389c04b6cSmrg_LT_TAGVAR(objext, $1)=$objext
853489c04b6cSmrg
853589c04b6cSmrg# Code to be used in simple compile tests
853689c04b6cSmrglt_simple_compile_test_code="package main; func main() { }"
853789c04b6cSmrg
853889c04b6cSmrg# Code to be used in simple link tests
853989c04b6cSmrglt_simple_link_test_code='package main; func main() { }'
854089c04b6cSmrg
854189c04b6cSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
854289c04b6cSmrg_LT_TAG_COMPILER
854389c04b6cSmrg
854489c04b6cSmrg# save warnings/boilerplate of simple test code
854589c04b6cSmrg_LT_COMPILER_BOILERPLATE
854689c04b6cSmrg_LT_LINKER_BOILERPLATE
854789c04b6cSmrg
854889c04b6cSmrg# Allow CC to be a program name with arguments.
854989c04b6cSmrglt_save_CC=$CC
855089c04b6cSmrglt_save_CFLAGS=$CFLAGS
855189c04b6cSmrglt_save_GCC=$GCC
855289c04b6cSmrgGCC=yes
855389c04b6cSmrgCC=${GOC-"gccgo"}
855489c04b6cSmrgCFLAGS=$GOFLAGS
855589c04b6cSmrgcompiler=$CC
855689c04b6cSmrg_LT_TAGVAR(compiler, $1)=$CC
855789c04b6cSmrg_LT_TAGVAR(LD, $1)="$LD"
855889c04b6cSmrg_LT_CC_BASENAME([$compiler])
855989c04b6cSmrg
856089c04b6cSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
856189c04b6cSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
856289c04b6cSmrg
856389c04b6cSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
856489c04b6cSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
856589c04b6cSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
856689c04b6cSmrg
856789c04b6cSmrgif test -n "$compiler"; then
856889c04b6cSmrg  _LT_COMPILER_NO_RTTI($1)
856989c04b6cSmrg  _LT_COMPILER_PIC($1)
857089c04b6cSmrg  _LT_COMPILER_C_O($1)
857189c04b6cSmrg  _LT_COMPILER_FILE_LOCKS($1)
857289c04b6cSmrg  _LT_LINKER_SHLIBS($1)
857389c04b6cSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
857489c04b6cSmrg
857589c04b6cSmrg  _LT_CONFIG($1)
857689c04b6cSmrgfi
857789c04b6cSmrg
857889c04b6cSmrgAC_LANG_RESTORE
857989c04b6cSmrg
858089c04b6cSmrgGCC=$lt_save_GCC
858189c04b6cSmrgCC=$lt_save_CC
858289c04b6cSmrgCFLAGS=$lt_save_CFLAGS
858389c04b6cSmrg])# _LT_LANG_GO_CONFIG
858489c04b6cSmrg
858589c04b6cSmrg
85866fae4e5dSmrg# _LT_LANG_RC_CONFIG([TAG])
85876fae4e5dSmrg# -------------------------
85886fae4e5dSmrg# Ensure that the configuration variables for the Windows resource compiler
85896fae4e5dSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
85906fae4e5dSmrg# to write the compiler configuration to `libtool'.
85916fae4e5dSmrgm4_defun([_LT_LANG_RC_CONFIG],
85926fae4e5dSmrg[AC_REQUIRE([LT_PROG_RC])dnl
85936fae4e5dSmrgAC_LANG_SAVE
85941f0ac6a5Smrg
85956fae4e5dSmrg# Source file extension for RC test sources.
85966fae4e5dSmrgac_ext=rc
85971f0ac6a5Smrg
85986fae4e5dSmrg# Object file extension for compiled RC test sources.
85996fae4e5dSmrgobjext=o
86006fae4e5dSmrg_LT_TAGVAR(objext, $1)=$objext
86011f0ac6a5Smrg
86026fae4e5dSmrg# Code to be used in simple compile tests
86036fae4e5dSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
86041f0ac6a5Smrg
86056fae4e5dSmrg# Code to be used in simple link tests
86066fae4e5dSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
86079c9ff80cSmrg
86086fae4e5dSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
86096fae4e5dSmrg_LT_TAG_COMPILER
86109c9ff80cSmrg
86116fae4e5dSmrg# save warnings/boilerplate of simple test code
86126fae4e5dSmrg_LT_COMPILER_BOILERPLATE
86136fae4e5dSmrg_LT_LINKER_BOILERPLATE
86149c9ff80cSmrg
86156fae4e5dSmrg# Allow CC to be a program name with arguments.
86166fae4e5dSmrglt_save_CC="$CC"
86176fae4e5dSmrglt_save_CFLAGS=$CFLAGS
86186fae4e5dSmrglt_save_GCC=$GCC
86196fae4e5dSmrgGCC=
86206fae4e5dSmrgCC=${RC-"windres"}
86216fae4e5dSmrgCFLAGS=
86226fae4e5dSmrgcompiler=$CC
86236fae4e5dSmrg_LT_TAGVAR(compiler, $1)=$CC
86246fae4e5dSmrg_LT_CC_BASENAME([$compiler])
86256fae4e5dSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
86269c9ff80cSmrg
86276fae4e5dSmrgif test -n "$compiler"; then
86286fae4e5dSmrg  :
86296fae4e5dSmrg  _LT_CONFIG($1)
86306fae4e5dSmrgfi
86311f0ac6a5Smrg
86326fae4e5dSmrgGCC=$lt_save_GCC
86336fae4e5dSmrgAC_LANG_RESTORE
86346fae4e5dSmrgCC=$lt_save_CC
86356fae4e5dSmrgCFLAGS=$lt_save_CFLAGS
86366fae4e5dSmrg])# _LT_LANG_RC_CONFIG
86371f0ac6a5Smrg
86381f0ac6a5Smrg
86396fae4e5dSmrg# LT_PROG_GCJ
86406fae4e5dSmrg# -----------
86416fae4e5dSmrgAC_DEFUN([LT_PROG_GCJ],
86426fae4e5dSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
86436fae4e5dSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
86446fae4e5dSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
86456fae4e5dSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
86466fae4e5dSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
86476fae4e5dSmrg])
86481f0ac6a5Smrg
86496fae4e5dSmrg# Old name:
86506fae4e5dSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
86516fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
86526fae4e5dSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
86536fae4e5dSmrg
86546fae4e5dSmrg
865589c04b6cSmrg# LT_PROG_GO
865689c04b6cSmrg# ----------
865789c04b6cSmrgAC_DEFUN([LT_PROG_GO],
865889c04b6cSmrg[AC_CHECK_TOOL(GOC, gccgo,)
865989c04b6cSmrg])
866089c04b6cSmrg
866189c04b6cSmrg
86626fae4e5dSmrg# LT_PROG_RC
86636fae4e5dSmrg# ----------
86646fae4e5dSmrgAC_DEFUN([LT_PROG_RC],
86656fae4e5dSmrg[AC_CHECK_TOOL(RC, windres,)
86661f0ac6a5Smrg])
86671f0ac6a5Smrg
86686fae4e5dSmrg# Old name:
86696fae4e5dSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
86706fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
86716fae4e5dSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
86721f0ac6a5Smrg
86731f0ac6a5Smrg
86746fae4e5dSmrg# _LT_DECL_EGREP
86756fae4e5dSmrg# --------------
86766fae4e5dSmrg# If we don't have a new enough Autoconf to choose the best grep
86776fae4e5dSmrg# available, choose the one first in the user's PATH.
86786fae4e5dSmrgm4_defun([_LT_DECL_EGREP],
86796fae4e5dSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
86806fae4e5dSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
86816fae4e5dSmrgtest -z "$GREP" && GREP=grep
86826fae4e5dSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
86836fae4e5dSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
86846fae4e5dSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
86856fae4e5dSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
86866fae4e5dSmrgAC_SUBST([GREP])
86876fae4e5dSmrg])
86881f0ac6a5Smrg
86891f0ac6a5Smrg
86906fae4e5dSmrg# _LT_DECL_OBJDUMP
86916fae4e5dSmrg# --------------
86926fae4e5dSmrg# If we don't have a new enough Autoconf to choose the best objdump
86936fae4e5dSmrg# available, choose the one first in the user's PATH.
86946fae4e5dSmrgm4_defun([_LT_DECL_OBJDUMP],
86956fae4e5dSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
86966fae4e5dSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
86976fae4e5dSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
86986fae4e5dSmrgAC_SUBST([OBJDUMP])
86996fae4e5dSmrg])
87006fae4e5dSmrg
87016fae4e5dSmrg# _LT_DECL_DLLTOOL
87026fae4e5dSmrg# ----------------
87036fae4e5dSmrg# Ensure DLLTOOL variable is set.
87046fae4e5dSmrgm4_defun([_LT_DECL_DLLTOOL],
87056fae4e5dSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
87066fae4e5dSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
87076fae4e5dSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
87086fae4e5dSmrgAC_SUBST([DLLTOOL])
87096fae4e5dSmrg])
87109c9ff80cSmrg
87116fae4e5dSmrg# _LT_DECL_SED
87126fae4e5dSmrg# ------------
87136fae4e5dSmrg# Check for a fully-functional sed program, that truncates
87146fae4e5dSmrg# as few characters as possible.  Prefer GNU sed if found.
87156fae4e5dSmrgm4_defun([_LT_DECL_SED],
87166fae4e5dSmrg[AC_PROG_SED
87176fae4e5dSmrgtest -z "$SED" && SED=sed
87186fae4e5dSmrgXsed="$SED -e 1s/^X//"
87196fae4e5dSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
87206fae4e5dSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
87216fae4e5dSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
87226fae4e5dSmrg])# _LT_DECL_SED
87231f0ac6a5Smrg
87246fae4e5dSmrgm4_ifndef([AC_PROG_SED], [
87256fae4e5dSmrg# NOTE: This macro has been submitted for inclusion into   #
87266fae4e5dSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
87276fae4e5dSmrg#  a released version of Autoconf we should remove this    #
87286fae4e5dSmrg#  macro and use it instead.                               #
87291f0ac6a5Smrg
87306fae4e5dSmrgm4_defun([AC_PROG_SED],
87316fae4e5dSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
87326fae4e5dSmrgAC_CACHE_VAL(lt_cv_path_SED,
87336fae4e5dSmrg[# Loop through the user's path and test for sed and gsed.
87346fae4e5dSmrg# Then use that list of sed's as ones to test for truncation.
87356fae4e5dSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
87366fae4e5dSmrgfor as_dir in $PATH
87376fae4e5dSmrgdo
87386fae4e5dSmrg  IFS=$as_save_IFS
87396fae4e5dSmrg  test -z "$as_dir" && as_dir=.
87406fae4e5dSmrg  for lt_ac_prog in sed gsed; do
87416fae4e5dSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
87426fae4e5dSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
87436fae4e5dSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
87446fae4e5dSmrg      fi
87456fae4e5dSmrg    done
87466fae4e5dSmrg  done
87476fae4e5dSmrgdone
87486fae4e5dSmrgIFS=$as_save_IFS
87496fae4e5dSmrglt_ac_max=0
87506fae4e5dSmrglt_ac_count=0
87516fae4e5dSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
87526fae4e5dSmrg# along with /bin/sed that truncates output.
87536fae4e5dSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
87546fae4e5dSmrg  test ! -f $lt_ac_sed && continue
87556fae4e5dSmrg  cat /dev/null > conftest.in
87566fae4e5dSmrg  lt_ac_count=0
87576fae4e5dSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
87586fae4e5dSmrg  # Check for GNU sed and select it if it is found.
87596fae4e5dSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
87606fae4e5dSmrg    lt_cv_path_SED=$lt_ac_sed
87616fae4e5dSmrg    break
87626fae4e5dSmrg  fi
87636fae4e5dSmrg  while true; do
87646fae4e5dSmrg    cat conftest.in conftest.in >conftest.tmp
87656fae4e5dSmrg    mv conftest.tmp conftest.in
87666fae4e5dSmrg    cp conftest.in conftest.nl
87676fae4e5dSmrg    echo >>conftest.nl
87686fae4e5dSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
87696fae4e5dSmrg    cmp -s conftest.out conftest.nl || break
87706fae4e5dSmrg    # 10000 chars as input seems more than enough
87716fae4e5dSmrg    test $lt_ac_count -gt 10 && break
87726fae4e5dSmrg    lt_ac_count=`expr $lt_ac_count + 1`
87736fae4e5dSmrg    if test $lt_ac_count -gt $lt_ac_max; then
87746fae4e5dSmrg      lt_ac_max=$lt_ac_count
87756fae4e5dSmrg      lt_cv_path_SED=$lt_ac_sed
87766fae4e5dSmrg    fi
87779c9ff80cSmrg  done
87786fae4e5dSmrgdone
87796fae4e5dSmrg])
87806fae4e5dSmrgSED=$lt_cv_path_SED
87816fae4e5dSmrgAC_SUBST([SED])
87826fae4e5dSmrgAC_MSG_RESULT([$SED])
87836fae4e5dSmrg])#AC_PROG_SED
87846fae4e5dSmrg])#m4_ifndef
87851f0ac6a5Smrg
87866fae4e5dSmrg# Old name:
87876fae4e5dSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
87886fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
87896fae4e5dSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
87901f0ac6a5Smrg
87911f0ac6a5Smrg
87926fae4e5dSmrg# _LT_CHECK_SHELL_FEATURES
87936fae4e5dSmrg# ------------------------
87946fae4e5dSmrg# Find out whether the shell is Bourne or XSI compatible,
87956fae4e5dSmrg# or has some other useful features.
87966fae4e5dSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
87976fae4e5dSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
87986fae4e5dSmrg# Try some XSI features
87996fae4e5dSmrgxsi_shell=no
88006fae4e5dSmrg( _lt_dummy="a/b/c"
88016fae4e5dSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
88026fae4e5dSmrg      = c,a/b,b/c, \
88036fae4e5dSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
88046fae4e5dSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
88056fae4e5dSmrg  && xsi_shell=yes
88066fae4e5dSmrgAC_MSG_RESULT([$xsi_shell])
88076fae4e5dSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
88081f0ac6a5Smrg
88096fae4e5dSmrgAC_MSG_CHECKING([whether the shell understands "+="])
88106fae4e5dSmrglt_shell_append=no
88116fae4e5dSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
88126fae4e5dSmrg    >/dev/null 2>&1 \
88136fae4e5dSmrg  && lt_shell_append=yes
88146fae4e5dSmrgAC_MSG_RESULT([$lt_shell_append])
88156fae4e5dSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
88161f0ac6a5Smrg
88176fae4e5dSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
88186fae4e5dSmrg  lt_unset=unset
88196fae4e5dSmrgelse
88206fae4e5dSmrg  lt_unset=false
88216fae4e5dSmrgfi
88226fae4e5dSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
88231f0ac6a5Smrg
88246fae4e5dSmrg# test EBCDIC or ASCII
88256fae4e5dSmrgcase `echo X|tr X '\101'` in
88266fae4e5dSmrg A) # ASCII based system
88276fae4e5dSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
88286fae4e5dSmrg  lt_SP2NL='tr \040 \012'
88296fae4e5dSmrg  lt_NL2SP='tr \015\012 \040\040'
88309c9ff80cSmrg  ;;
88316fae4e5dSmrg *) # EBCDIC based system
88326fae4e5dSmrg  lt_SP2NL='tr \100 \n'
88336fae4e5dSmrg  lt_NL2SP='tr \r\n \100\100'
88349c9ff80cSmrg  ;;
88359c9ff80cSmrgesac
88366fae4e5dSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
88376fae4e5dSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
88386fae4e5dSmrg])# _LT_CHECK_SHELL_FEATURES
88399c9ff80cSmrg
88409c9ff80cSmrg
88416fae4e5dSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
88426fae4e5dSmrg# ------------------------------------------------------
88436fae4e5dSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
88446fae4e5dSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
88456fae4e5dSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
88466fae4e5dSmrg[dnl {
88476fae4e5dSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
88486fae4e5dSmrg$1 ()\
88496fae4e5dSmrg{\
88506fae4e5dSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
88516fae4e5dSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
88526fae4e5dSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
88536fae4e5dSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
88546fae4e5dSmrgtest 0 -eq $? || _lt_function_replace_fail=:
88556fae4e5dSmrg])
88561f0ac6a5Smrg
88571f0ac6a5Smrg
88586fae4e5dSmrg# _LT_PROG_REPLACE_SHELLFNS
88596fae4e5dSmrg# -------------------------
88606fae4e5dSmrg# Replace existing portable implementations of several shell functions with
88616fae4e5dSmrg# equivalent extended shell implementations where those features are available..
88626fae4e5dSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
88636fae4e5dSmrg[if test x"$xsi_shell" = xyes; then
88646fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
88656fae4e5dSmrg    case ${1} in
88666fae4e5dSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
88676fae4e5dSmrg      *  ) func_dirname_result="${3}" ;;
88686fae4e5dSmrg    esac])
88696fae4e5dSmrg
88706fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
88716fae4e5dSmrg    func_basename_result="${1##*/}"])
88726fae4e5dSmrg
88736fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
88746fae4e5dSmrg    case ${1} in
88756fae4e5dSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
88766fae4e5dSmrg      *  ) func_dirname_result="${3}" ;;
88776fae4e5dSmrg    esac
88786fae4e5dSmrg    func_basename_result="${1##*/}"])
88791f0ac6a5Smrg
88806fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
88816fae4e5dSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
88826fae4e5dSmrg    # positional parameters, so assign one to ordinary parameter first.
88836fae4e5dSmrg    func_stripname_result=${3}
88846fae4e5dSmrg    func_stripname_result=${func_stripname_result#"${1}"}
88856fae4e5dSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
88869c9ff80cSmrg
88876fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
88886fae4e5dSmrg    func_split_long_opt_name=${1%%=*}
88896fae4e5dSmrg    func_split_long_opt_arg=${1#*=}])
88909c9ff80cSmrg
88916fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
88926fae4e5dSmrg    func_split_short_opt_arg=${1#??}
88936fae4e5dSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
88949c9ff80cSmrg
88956fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
88966fae4e5dSmrg    case ${1} in
88976fae4e5dSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
88986fae4e5dSmrg      *)    func_lo2o_result=${1} ;;
88996fae4e5dSmrg    esac])
89009c9ff80cSmrg
89016fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
89029c9ff80cSmrg
89036fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
89049c9ff80cSmrg
89056fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
89066fae4e5dSmrgfi
89079c9ff80cSmrg
89086fae4e5dSmrgif test x"$lt_shell_append" = xyes; then
89096fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
89109c9ff80cSmrg
89116fae4e5dSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
89126fae4e5dSmrg    func_quote_for_eval "${2}"
89136fae4e5dSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
89146fae4e5dSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
89159c9ff80cSmrg
89166fae4e5dSmrg  # Save a `func_append' function call where possible by direct use of '+='
89176fae4e5dSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
89186fae4e5dSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
89196fae4e5dSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
89206fae4e5dSmrg  test 0 -eq $? || _lt_function_replace_fail=:
89216fae4e5dSmrgelse
89226fae4e5dSmrg  # Save a `func_append' function call even when '+=' is not available
89236fae4e5dSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
89246fae4e5dSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
89256fae4e5dSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
89266fae4e5dSmrg  test 0 -eq $? || _lt_function_replace_fail=:
89276fae4e5dSmrgfi
89289c9ff80cSmrg
89296fae4e5dSmrgif test x"$_lt_function_replace_fail" = x":"; then
89306fae4e5dSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
89316fae4e5dSmrgfi
89326fae4e5dSmrg])
89336fae4e5dSmrg
89346fae4e5dSmrg# _LT_PATH_CONVERSION_FUNCTIONS
89356fae4e5dSmrg# -----------------------------
89366fae4e5dSmrg# Determine which file name conversion functions should be used by
89376fae4e5dSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
89386fae4e5dSmrg# for certain cross-compile configurations and native mingw.
89396fae4e5dSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
89406fae4e5dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
89416fae4e5dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
89426fae4e5dSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
89436fae4e5dSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
89446fae4e5dSmrg[case $host in
89456fae4e5dSmrg  *-*-mingw* )
89466fae4e5dSmrg    case $build in
89476fae4e5dSmrg      *-*-mingw* ) # actually msys
89486fae4e5dSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
89491f0ac6a5Smrg        ;;
89506fae4e5dSmrg      *-*-cygwin* )
89516fae4e5dSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
89526fae4e5dSmrg        ;;
89536fae4e5dSmrg      * ) # otherwise, assume *nix
89546fae4e5dSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
89551f0ac6a5Smrg        ;;
89569c9ff80cSmrg    esac
89576fae4e5dSmrg    ;;
89586fae4e5dSmrg  *-*-cygwin* )
89596fae4e5dSmrg    case $build in
89606fae4e5dSmrg      *-*-mingw* ) # actually msys
89616fae4e5dSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
89626fae4e5dSmrg        ;;
89636fae4e5dSmrg      *-*-cygwin* )
89646fae4e5dSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
89656fae4e5dSmrg        ;;
89666fae4e5dSmrg      * ) # otherwise, assume *nix
89676fae4e5dSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
89686fae4e5dSmrg        ;;
89696fae4e5dSmrg    esac
89706fae4e5dSmrg    ;;
89716fae4e5dSmrg  * ) # unhandled hosts (and "normal" native builds)
89726fae4e5dSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
89736fae4e5dSmrg    ;;
89746fae4e5dSmrgesac
89756fae4e5dSmrg])
89766fae4e5dSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
89776fae4e5dSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
89786fae4e5dSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
89796fae4e5dSmrg         [0], [convert $build file names to $host format])dnl
89806fae4e5dSmrg
89816fae4e5dSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
89826fae4e5dSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
89836fae4e5dSmrg[#assume ordinary cross tools, or native build.
89846fae4e5dSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
89856fae4e5dSmrgcase $host in
89866fae4e5dSmrg  *-*-mingw* )
89876fae4e5dSmrg    case $build in
89886fae4e5dSmrg      *-*-mingw* ) # actually msys
89896fae4e5dSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
89906fae4e5dSmrg        ;;
89916fae4e5dSmrg    esac
89926fae4e5dSmrg    ;;
89936fae4e5dSmrgesac
89946fae4e5dSmrg])
89956fae4e5dSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
89966fae4e5dSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
89976fae4e5dSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
89986fae4e5dSmrg         [0], [convert $build files to toolchain format])dnl
89996fae4e5dSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
90009c9ff80cSmrg
90016fae4e5dSmrg# Helper functions for option handling.                    -*- Autoconf -*-
90026fae4e5dSmrg#
90036fae4e5dSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
90046fae4e5dSmrg#   Inc.
90056fae4e5dSmrg#   Written by Gary V. Vaughan, 2004
90066fae4e5dSmrg#
90076fae4e5dSmrg# This file is free software; the Free Software Foundation gives
90086fae4e5dSmrg# unlimited permission to copy and/or distribute it, with or without
90096fae4e5dSmrg# modifications, as long as this notice is preserved.
90109c9ff80cSmrg
90116fae4e5dSmrg# serial 7 ltoptions.m4
90129c9ff80cSmrg
90136fae4e5dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
90146fae4e5dSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
90159c9ff80cSmrg
90169c9ff80cSmrg
90176fae4e5dSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
90186fae4e5dSmrg# ------------------------------------------
90196fae4e5dSmrgm4_define([_LT_MANGLE_OPTION],
90206fae4e5dSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
90219c9ff80cSmrg
90229c9ff80cSmrg
90236fae4e5dSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
90246fae4e5dSmrg# ---------------------------------------
90256fae4e5dSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
90266fae4e5dSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
90276fae4e5dSmrg# saved as a flag.
90286fae4e5dSmrgm4_define([_LT_SET_OPTION],
90296fae4e5dSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
90306fae4e5dSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
90316fae4e5dSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
90326fae4e5dSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
90336fae4e5dSmrg])
90349c9ff80cSmrg
90359c9ff80cSmrg
90366fae4e5dSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
90376fae4e5dSmrg# ------------------------------------------------------------
90386fae4e5dSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
90396fae4e5dSmrgm4_define([_LT_IF_OPTION],
90406fae4e5dSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
90419c9ff80cSmrg
90429c9ff80cSmrg
90436fae4e5dSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
90446fae4e5dSmrg# -------------------------------------------------------
90456fae4e5dSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
90466fae4e5dSmrg# are set.
90476fae4e5dSmrgm4_define([_LT_UNLESS_OPTIONS],
90486fae4e5dSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
90496fae4e5dSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
90506fae4e5dSmrg		      [m4_define([$0_found])])])[]dnl
90516fae4e5dSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
90526fae4e5dSmrg])[]dnl
90536fae4e5dSmrg])
90549c9ff80cSmrg
90559c9ff80cSmrg
90566fae4e5dSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
90576fae4e5dSmrg# ----------------------------------------
90586fae4e5dSmrg# OPTION-LIST is a space-separated list of Libtool options associated
90596fae4e5dSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
90606fae4e5dSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
90616fae4e5dSmrg# the unknown option and exit.
90626fae4e5dSmrgm4_defun([_LT_SET_OPTIONS],
90636fae4e5dSmrg[# Set options
90646fae4e5dSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
90656fae4e5dSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
90669c9ff80cSmrg
90676fae4e5dSmrgm4_if([$1],[LT_INIT],[
90686fae4e5dSmrg  dnl
90696fae4e5dSmrg  dnl Simply set some default values (i.e off) if boolean options were not
90706fae4e5dSmrg  dnl specified:
90716fae4e5dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
90726fae4e5dSmrg  ])
90736fae4e5dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
90746fae4e5dSmrg  ])
90756fae4e5dSmrg  dnl
90766fae4e5dSmrg  dnl If no reference was made to various pairs of opposing options, then
90776fae4e5dSmrg  dnl we run the default mode handler for the pair.  For example, if neither
90786fae4e5dSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
90796fae4e5dSmrg  dnl archives by default:
90806fae4e5dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
90816fae4e5dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
90826fae4e5dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
90836fae4e5dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
90846fae4e5dSmrg  		   [_LT_ENABLE_FAST_INSTALL])
90856fae4e5dSmrg  ])
90866fae4e5dSmrg])# _LT_SET_OPTIONS
90879c9ff80cSmrg
90889c9ff80cSmrg
90899c9ff80cSmrg
90906fae4e5dSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
90916fae4e5dSmrg# -----------------------------------------
90926fae4e5dSmrgm4_define([_LT_MANGLE_DEFUN],
90936fae4e5dSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
90949c9ff80cSmrg
90959c9ff80cSmrg
90966fae4e5dSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
90976fae4e5dSmrg# -----------------------------------------------
90986fae4e5dSmrgm4_define([LT_OPTION_DEFINE],
90996fae4e5dSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
91006fae4e5dSmrg])# LT_OPTION_DEFINE
91019c9ff80cSmrg
91029c9ff80cSmrg
91036fae4e5dSmrg# dlopen
91046fae4e5dSmrg# ------
91056fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
91066fae4e5dSmrg])
91076fae4e5dSmrg
91086fae4e5dSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
91096fae4e5dSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
91106fae4e5dSmrgAC_DIAGNOSE([obsolete],
91116fae4e5dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
91126fae4e5dSmrgput the `dlopen' option into LT_INIT's first parameter.])
91136fae4e5dSmrg])
91146fae4e5dSmrg
91156fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
91166fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
91179c9ff80cSmrg
91189c9ff80cSmrg
91196fae4e5dSmrg# win32-dll
91206fae4e5dSmrg# ---------
91216fae4e5dSmrg# Declare package support for building win32 dll's.
91226fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
91236fae4e5dSmrg[enable_win32_dll=yes
91249c9ff80cSmrg
91256fae4e5dSmrgcase $host in
91266fae4e5dSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
91276fae4e5dSmrg  AC_CHECK_TOOL(AS, as, false)
91286fae4e5dSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
91296fae4e5dSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
91306fae4e5dSmrg  ;;
91316fae4e5dSmrgesac
91329c9ff80cSmrg
91336fae4e5dSmrgtest -z "$AS" && AS=as
91346fae4e5dSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
91359c9ff80cSmrg
91366fae4e5dSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
91376fae4e5dSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
91389c9ff80cSmrg
91396fae4e5dSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
91406fae4e5dSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
91416fae4e5dSmrg])# win32-dll
91429c9ff80cSmrg
91436fae4e5dSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
91446fae4e5dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
91456fae4e5dSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
91466fae4e5dSmrgAC_DIAGNOSE([obsolete],
91476fae4e5dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
91486fae4e5dSmrgput the `win32-dll' option into LT_INIT's first parameter.])
91496fae4e5dSmrg])
91509c9ff80cSmrg
91516fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
91526fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
91539c9ff80cSmrg
91549c9ff80cSmrg
91556fae4e5dSmrg# _LT_ENABLE_SHARED([DEFAULT])
91566fae4e5dSmrg# ----------------------------
91576fae4e5dSmrg# implement the --enable-shared flag, and supports the `shared' and
91586fae4e5dSmrg# `disable-shared' LT_INIT options.
91596fae4e5dSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
91606fae4e5dSmrgm4_define([_LT_ENABLE_SHARED],
91616fae4e5dSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
91626fae4e5dSmrgAC_ARG_ENABLE([shared],
91636fae4e5dSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
91646fae4e5dSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
91656fae4e5dSmrg    [p=${PACKAGE-default}
91666fae4e5dSmrg    case $enableval in
91676fae4e5dSmrg    yes) enable_shared=yes ;;
91686fae4e5dSmrg    no) enable_shared=no ;;
91696fae4e5dSmrg    *)
91706fae4e5dSmrg      enable_shared=no
91716fae4e5dSmrg      # Look at the argument we got.  We use all the common list separators.
91726fae4e5dSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
91736fae4e5dSmrg      for pkg in $enableval; do
91746fae4e5dSmrg	IFS="$lt_save_ifs"
91756fae4e5dSmrg	if test "X$pkg" = "X$p"; then
91766fae4e5dSmrg	  enable_shared=yes
91776fae4e5dSmrg	fi
91786fae4e5dSmrg      done
91796fae4e5dSmrg      IFS="$lt_save_ifs"
91806fae4e5dSmrg      ;;
91816fae4e5dSmrg    esac],
91826fae4e5dSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
91839c9ff80cSmrg
91846fae4e5dSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
91856fae4e5dSmrg	[Whether or not to build shared libraries])
91866fae4e5dSmrg])# _LT_ENABLE_SHARED
91879c9ff80cSmrg
91886fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
91896fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
91909c9ff80cSmrg
91916fae4e5dSmrg# Old names:
91926fae4e5dSmrgAC_DEFUN([AC_ENABLE_SHARED],
91936fae4e5dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
91946fae4e5dSmrg])
91959c9ff80cSmrg
91966fae4e5dSmrgAC_DEFUN([AC_DISABLE_SHARED],
91976fae4e5dSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
91986fae4e5dSmrg])
91999c9ff80cSmrg
92006fae4e5dSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
92016fae4e5dSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
92029c9ff80cSmrg
92036fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
92046fae4e5dSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
92056fae4e5dSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
92069c9ff80cSmrg
92071f0ac6a5Smrg
92081f0ac6a5Smrg
92096fae4e5dSmrg# _LT_ENABLE_STATIC([DEFAULT])
92106fae4e5dSmrg# ----------------------------
92116fae4e5dSmrg# implement the --enable-static flag, and support the `static' and
92126fae4e5dSmrg# `disable-static' LT_INIT options.
92136fae4e5dSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
92146fae4e5dSmrgm4_define([_LT_ENABLE_STATIC],
92156fae4e5dSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
92166fae4e5dSmrgAC_ARG_ENABLE([static],
92176fae4e5dSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
92186fae4e5dSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
92196fae4e5dSmrg    [p=${PACKAGE-default}
92206fae4e5dSmrg    case $enableval in
92216fae4e5dSmrg    yes) enable_static=yes ;;
92226fae4e5dSmrg    no) enable_static=no ;;
92236fae4e5dSmrg    *)
92246fae4e5dSmrg     enable_static=no
92256fae4e5dSmrg      # Look at the argument we got.  We use all the common list separators.
92266fae4e5dSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
92276fae4e5dSmrg      for pkg in $enableval; do
92286fae4e5dSmrg	IFS="$lt_save_ifs"
92296fae4e5dSmrg	if test "X$pkg" = "X$p"; then
92306fae4e5dSmrg	  enable_static=yes
92316fae4e5dSmrg	fi
92326fae4e5dSmrg      done
92336fae4e5dSmrg      IFS="$lt_save_ifs"
92346fae4e5dSmrg      ;;
92356fae4e5dSmrg    esac],
92366fae4e5dSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9237e5410a46Smrg
92386fae4e5dSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
92396fae4e5dSmrg	[Whether or not to build static libraries])
92406fae4e5dSmrg])# _LT_ENABLE_STATIC
92411f0ac6a5Smrg
92426fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
92436fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
92441f0ac6a5Smrg
92456fae4e5dSmrg# Old names:
92466fae4e5dSmrgAC_DEFUN([AC_ENABLE_STATIC],
92476fae4e5dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
92486fae4e5dSmrg])
92491f0ac6a5Smrg
92506fae4e5dSmrgAC_DEFUN([AC_DISABLE_STATIC],
92516fae4e5dSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
92526fae4e5dSmrg])
92531f0ac6a5Smrg
92546fae4e5dSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
92556fae4e5dSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
92561f0ac6a5Smrg
92576fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
92586fae4e5dSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
92596fae4e5dSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
92601f0ac6a5Smrg
92611f0ac6a5Smrg
92621f0ac6a5Smrg
92636fae4e5dSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
92646fae4e5dSmrg# ----------------------------------
92656fae4e5dSmrg# implement the --enable-fast-install flag, and support the `fast-install'
92666fae4e5dSmrg# and `disable-fast-install' LT_INIT options.
92676fae4e5dSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
92686fae4e5dSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
92696fae4e5dSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
92706fae4e5dSmrgAC_ARG_ENABLE([fast-install],
92716fae4e5dSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
92726fae4e5dSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
92736fae4e5dSmrg    [p=${PACKAGE-default}
92746fae4e5dSmrg    case $enableval in
92756fae4e5dSmrg    yes) enable_fast_install=yes ;;
92766fae4e5dSmrg    no) enable_fast_install=no ;;
92776fae4e5dSmrg    *)
92786fae4e5dSmrg      enable_fast_install=no
92796fae4e5dSmrg      # Look at the argument we got.  We use all the common list separators.
92806fae4e5dSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
92816fae4e5dSmrg      for pkg in $enableval; do
92826fae4e5dSmrg	IFS="$lt_save_ifs"
92836fae4e5dSmrg	if test "X$pkg" = "X$p"; then
92846fae4e5dSmrg	  enable_fast_install=yes
92856fae4e5dSmrg	fi
92866fae4e5dSmrg      done
92876fae4e5dSmrg      IFS="$lt_save_ifs"
92886fae4e5dSmrg      ;;
92896fae4e5dSmrg    esac],
92906fae4e5dSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
92919c9ff80cSmrg
92926fae4e5dSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
92936fae4e5dSmrg	 [Whether or not to optimize for fast installation])dnl
92946fae4e5dSmrg])# _LT_ENABLE_FAST_INSTALL
92959c9ff80cSmrg
92966fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
92976fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
92989c9ff80cSmrg
92996fae4e5dSmrg# Old names:
93006fae4e5dSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
93016fae4e5dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
93026fae4e5dSmrgAC_DIAGNOSE([obsolete],
93036fae4e5dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
93046fae4e5dSmrgthe `fast-install' option into LT_INIT's first parameter.])
93056fae4e5dSmrg])
93069c9ff80cSmrg
93076fae4e5dSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
93086fae4e5dSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
93096fae4e5dSmrgAC_DIAGNOSE([obsolete],
93106fae4e5dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
93116fae4e5dSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
93126fae4e5dSmrg])
93139c9ff80cSmrg
93146fae4e5dSmrgdnl aclocal-1.4 backwards compatibility:
93156fae4e5dSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
93166fae4e5dSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
93171f0ac6a5Smrg
93189c9ff80cSmrg
93196fae4e5dSmrg# _LT_WITH_PIC([MODE])
93206fae4e5dSmrg# --------------------
93216fae4e5dSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
93226fae4e5dSmrg# LT_INIT options.
93236fae4e5dSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
93246fae4e5dSmrgm4_define([_LT_WITH_PIC],
93256fae4e5dSmrg[AC_ARG_WITH([pic],
932689c04b6cSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
93276fae4e5dSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
932889c04b6cSmrg    [lt_p=${PACKAGE-default}
932989c04b6cSmrg    case $withval in
933089c04b6cSmrg    yes|no) pic_mode=$withval ;;
933189c04b6cSmrg    *)
933289c04b6cSmrg      pic_mode=default
933389c04b6cSmrg      # Look at the argument we got.  We use all the common list separators.
933489c04b6cSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
933589c04b6cSmrg      for lt_pkg in $withval; do
933689c04b6cSmrg	IFS="$lt_save_ifs"
933789c04b6cSmrg	if test "X$lt_pkg" = "X$lt_p"; then
933889c04b6cSmrg	  pic_mode=yes
933989c04b6cSmrg	fi
934089c04b6cSmrg      done
934189c04b6cSmrg      IFS="$lt_save_ifs"
934289c04b6cSmrg      ;;
934389c04b6cSmrg    esac],
93446fae4e5dSmrg    [pic_mode=default])
93459c9ff80cSmrg
93466fae4e5dSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
93471f0ac6a5Smrg
93486fae4e5dSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
93496fae4e5dSmrg])# _LT_WITH_PIC
93501f0ac6a5Smrg
93516fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
93526fae4e5dSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
93531f0ac6a5Smrg
93546fae4e5dSmrg# Old name:
93556fae4e5dSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
93566fae4e5dSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
93576fae4e5dSmrgAC_DIAGNOSE([obsolete],
93586fae4e5dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
93596fae4e5dSmrgput the `pic-only' option into LT_INIT's first parameter.])
93609c9ff80cSmrg])
93611f0ac6a5Smrg
93629c9ff80cSmrgdnl aclocal-1.4 backwards compatibility:
93636fae4e5dSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
93641f0ac6a5Smrg
93651f0ac6a5Smrg
93666fae4e5dSmrgm4_define([_LTDL_MODE], [])
93676fae4e5dSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
93686fae4e5dSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
93696fae4e5dSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
93706fae4e5dSmrg		 [m4_define([_LTDL_MODE], [recursive])])
93716fae4e5dSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
93726fae4e5dSmrg		 [m4_define([_LTDL_MODE], [subproject])])
93731f0ac6a5Smrg
93746fae4e5dSmrgm4_define([_LTDL_TYPE], [])
93756fae4e5dSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
93766fae4e5dSmrg		 [m4_define([_LTDL_TYPE], [installable])])
93776fae4e5dSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
93786fae4e5dSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
93791f0ac6a5Smrg
93806fae4e5dSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
93816fae4e5dSmrg#
93826fae4e5dSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
93836fae4e5dSmrg# Written by Gary V. Vaughan, 2004
93846fae4e5dSmrg#
93856fae4e5dSmrg# This file is free software; the Free Software Foundation gives
93866fae4e5dSmrg# unlimited permission to copy and/or distribute it, with or without
93876fae4e5dSmrg# modifications, as long as this notice is preserved.
93881f0ac6a5Smrg
93896fae4e5dSmrg# serial 6 ltsugar.m4
93901f0ac6a5Smrg
93916fae4e5dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
93926fae4e5dSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
93939c9ff80cSmrg
93949c9ff80cSmrg
93956fae4e5dSmrg# lt_join(SEP, ARG1, [ARG2...])
93966fae4e5dSmrg# -----------------------------
93976fae4e5dSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
93986fae4e5dSmrg# associated separator.
93996fae4e5dSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
94006fae4e5dSmrg# versions in m4sugar had bugs.
94016fae4e5dSmrgm4_define([lt_join],
94026fae4e5dSmrg[m4_if([$#], [1], [],
94036fae4e5dSmrg       [$#], [2], [[$2]],
94046fae4e5dSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
94056fae4e5dSmrgm4_define([_lt_join],
94066fae4e5dSmrg[m4_if([$#$2], [2], [],
94076fae4e5dSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
94089c9ff80cSmrg
94096fae4e5dSmrg
94106fae4e5dSmrg# lt_car(LIST)
94116fae4e5dSmrg# lt_cdr(LIST)
94126fae4e5dSmrg# ------------
94136fae4e5dSmrg# Manipulate m4 lists.
94146fae4e5dSmrg# These macros are necessary as long as will still need to support
94156fae4e5dSmrg# Autoconf-2.59 which quotes differently.
94166fae4e5dSmrgm4_define([lt_car], [[$1]])
94176fae4e5dSmrgm4_define([lt_cdr],
94186fae4e5dSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
94196fae4e5dSmrg       [$#], 1, [],
94206fae4e5dSmrg       [m4_dquote(m4_shift($@))])])
94216fae4e5dSmrgm4_define([lt_unquote], $1)
94229c9ff80cSmrg
94239c9ff80cSmrg
94246fae4e5dSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
94256fae4e5dSmrg# ------------------------------------------
94266fae4e5dSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
94276fae4e5dSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
94286fae4e5dSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
94296fae4e5dSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
94306fae4e5dSmrg# than defined and empty).
94316fae4e5dSmrg#
94326fae4e5dSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
94336fae4e5dSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
94346fae4e5dSmrgm4_define([lt_append],
94356fae4e5dSmrg[m4_define([$1],
94366fae4e5dSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
94379c9ff80cSmrg
94389c9ff80cSmrg
94399c9ff80cSmrg
94406fae4e5dSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
94416fae4e5dSmrg# ----------------------------------------------------------
94426fae4e5dSmrg# Produce a SEP delimited list of all paired combinations of elements of
94436fae4e5dSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
94446fae4e5dSmrg# has the form PREFIXmINFIXSUFFIXn.
94456fae4e5dSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
94466fae4e5dSmrgm4_define([lt_combine],
94476fae4e5dSmrg[m4_if(m4_eval([$# > 3]), [1],
94486fae4e5dSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
94496fae4e5dSmrg[[m4_foreach([_Lt_prefix], [$2],
94506fae4e5dSmrg	     [m4_foreach([_Lt_suffix],
94516fae4e5dSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
94526fae4e5dSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
94531f0ac6a5Smrg
94541f0ac6a5Smrg
94556fae4e5dSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
94566fae4e5dSmrg# -----------------------------------------------------------------------
94576fae4e5dSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
94586fae4e5dSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
94596fae4e5dSmrgm4_define([lt_if_append_uniq],
94606fae4e5dSmrg[m4_ifdef([$1],
94616fae4e5dSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
94626fae4e5dSmrg		 [lt_append([$1], [$2], [$3])$4],
94636fae4e5dSmrg		 [$5])],
94646fae4e5dSmrg	  [lt_append([$1], [$2], [$3])$4])])
94651f0ac6a5Smrg
94661f0ac6a5Smrg
94676fae4e5dSmrg# lt_dict_add(DICT, KEY, VALUE)
94686fae4e5dSmrg# -----------------------------
94696fae4e5dSmrgm4_define([lt_dict_add],
94706fae4e5dSmrg[m4_define([$1($2)], [$3])])
94711f0ac6a5Smrg
94721f0ac6a5Smrg
94736fae4e5dSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
94746fae4e5dSmrg# --------------------------------------------
94756fae4e5dSmrgm4_define([lt_dict_add_subkey],
94766fae4e5dSmrg[m4_define([$1($2:$3)], [$4])])
94771f0ac6a5Smrg
94781f0ac6a5Smrg
94796fae4e5dSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
94806fae4e5dSmrg# ----------------------------------
94816fae4e5dSmrgm4_define([lt_dict_fetch],
94826fae4e5dSmrg[m4_ifval([$3],
94836fae4e5dSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
94846fae4e5dSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
94851f0ac6a5Smrg
94869c9ff80cSmrg
94876fae4e5dSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
94886fae4e5dSmrg# -----------------------------------------------------------------
94896fae4e5dSmrgm4_define([lt_if_dict_fetch],
94906fae4e5dSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
94916fae4e5dSmrg	[$5],
94926fae4e5dSmrg    [$6])])
94931f0ac6a5Smrg
94941f0ac6a5Smrg
94956fae4e5dSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
94966fae4e5dSmrg# --------------------------------------------------------------
94976fae4e5dSmrgm4_define([lt_dict_filter],
94986fae4e5dSmrg[m4_if([$5], [], [],
94996fae4e5dSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
95006fae4e5dSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
95016fae4e5dSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
95026fae4e5dSmrg])
95031f0ac6a5Smrg
95046fae4e5dSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
95056fae4e5dSmrg#
95066fae4e5dSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
95076fae4e5dSmrg#   Written by Scott James Remnant, 2004
95086fae4e5dSmrg#
95096fae4e5dSmrg# This file is free software; the Free Software Foundation gives
95106fae4e5dSmrg# unlimited permission to copy and/or distribute it, with or without
95116fae4e5dSmrg# modifications, as long as this notice is preserved.
95121f0ac6a5Smrg
95136fae4e5dSmrg# @configure_input@
95149c9ff80cSmrg
951589c04b6cSmrg# serial 3337 ltversion.m4
95166fae4e5dSmrg# This file is part of GNU Libtool
95171f0ac6a5Smrg
951889c04b6cSmrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
951989c04b6cSmrgm4_define([LT_PACKAGE_REVISION], [1.3337])
95201f0ac6a5Smrg
95216fae4e5dSmrgAC_DEFUN([LTVERSION_VERSION],
952289c04b6cSmrg[macro_version='2.4.2'
952389c04b6cSmrgmacro_revision='1.3337'
95246fae4e5dSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
95256fae4e5dSmrg_LT_DECL(, macro_revision, 0)
95266fae4e5dSmrg])
95271f0ac6a5Smrg
95286fae4e5dSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
95296fae4e5dSmrg#
95306fae4e5dSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
95316fae4e5dSmrg#   Written by Scott James Remnant, 2004.
95326fae4e5dSmrg#
95336fae4e5dSmrg# This file is free software; the Free Software Foundation gives
95346fae4e5dSmrg# unlimited permission to copy and/or distribute it, with or without
95356fae4e5dSmrg# modifications, as long as this notice is preserved.
95361f0ac6a5Smrg
95376fae4e5dSmrg# serial 5 lt~obsolete.m4
95381f0ac6a5Smrg
95396fae4e5dSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
95406fae4e5dSmrg#
95416fae4e5dSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
95426fae4e5dSmrg# which have later been changed to m4_define as they aren't part of the
95436fae4e5dSmrg# exported API, or moved to Autoconf or Automake where they belong.
95446fae4e5dSmrg#
95456fae4e5dSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
95466fae4e5dSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
95476fae4e5dSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
95486fae4e5dSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
95496fae4e5dSmrg# and doesn't know about Autoconf macros at all.)
95506fae4e5dSmrg#
95516fae4e5dSmrg# So we provide this file, which has a silly filename so it's always
95526fae4e5dSmrg# included after everything else.  This provides aclocal with the
95536fae4e5dSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
95546fae4e5dSmrg# because those macros already exist, or will be overwritten later.
95556fae4e5dSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
95566fae4e5dSmrg#
95576fae4e5dSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
95586fae4e5dSmrg# Yes, that means every name once taken will need to remain here until
95596fae4e5dSmrg# we give up compatibility with versions before 1.7, at which point
95606fae4e5dSmrg# we need to keep only those names which we still refer to.
95611f0ac6a5Smrg
95626fae4e5dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
95636fae4e5dSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
95641f0ac6a5Smrg
95656fae4e5dSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
95666fae4e5dSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
95676fae4e5dSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
95686fae4e5dSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
95696fae4e5dSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
95706fae4e5dSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
95716fae4e5dSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
95726fae4e5dSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
95736fae4e5dSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
95746fae4e5dSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
95756fae4e5dSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
95766fae4e5dSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
95776fae4e5dSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
95786fae4e5dSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
95796fae4e5dSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
95806fae4e5dSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
95816fae4e5dSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
95826fae4e5dSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
95836fae4e5dSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
95846fae4e5dSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
95856fae4e5dSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
95866fae4e5dSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
95876fae4e5dSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
95886fae4e5dSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
95896fae4e5dSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
95906fae4e5dSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
95916fae4e5dSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
95926fae4e5dSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
95936fae4e5dSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
95946fae4e5dSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
95956fae4e5dSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
95966fae4e5dSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
95976fae4e5dSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
95986fae4e5dSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
95996fae4e5dSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
96006fae4e5dSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
96016fae4e5dSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
96026fae4e5dSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
96036fae4e5dSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
96046fae4e5dSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
96056fae4e5dSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
96066fae4e5dSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
96076fae4e5dSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
96086fae4e5dSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
96096fae4e5dSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
96106fae4e5dSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
96116fae4e5dSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
96126fae4e5dSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
96136fae4e5dSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
96146fae4e5dSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
96156fae4e5dSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
96166fae4e5dSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
96176fae4e5dSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
96186fae4e5dSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
96196fae4e5dSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
96206fae4e5dSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
96216fae4e5dSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
96226fae4e5dSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
96236fae4e5dSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
96246fae4e5dSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
96256fae4e5dSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
96266fae4e5dSmrg
962789c04b6cSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
962889c04b6cSmrg# 
962989c04b6cSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
963089c04b6cSmrg#
963189c04b6cSmrg# This program is free software; you can redistribute it and/or modify
963289c04b6cSmrg# it under the terms of the GNU General Public License as published by
963389c04b6cSmrg# the Free Software Foundation; either version 2 of the License, or
963489c04b6cSmrg# (at your option) any later version.
963589c04b6cSmrg#
963689c04b6cSmrg# This program is distributed in the hope that it will be useful, but
963789c04b6cSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
963889c04b6cSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
963989c04b6cSmrg# General Public License for more details.
964089c04b6cSmrg#
964189c04b6cSmrg# You should have received a copy of the GNU General Public License
964289c04b6cSmrg# along with this program; if not, write to the Free Software
964389c04b6cSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
964489c04b6cSmrg#
964589c04b6cSmrg# As a special exception to the GNU General Public License, if you
964689c04b6cSmrg# distribute this file as part of a program that contains a
964789c04b6cSmrg# configuration script generated by Autoconf, you may include it under
964889c04b6cSmrg# the same distribution terms that you use for the rest of that program.
964989c04b6cSmrg
965089c04b6cSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
965189c04b6cSmrg# ----------------------------------
965289c04b6cSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
965389c04b6cSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
965489c04b6cSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
965589c04b6cSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
965689c04b6cSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
965789c04b6cSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
965889c04b6cSmrgfi
965989c04b6cSmrgif test -n "$PKG_CONFIG"; then
966089c04b6cSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
966189c04b6cSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
966289c04b6cSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
966389c04b6cSmrg		AC_MSG_RESULT([yes])
966489c04b6cSmrg	else
966589c04b6cSmrg		AC_MSG_RESULT([no])
966689c04b6cSmrg		PKG_CONFIG=""
966789c04b6cSmrg	fi
966889c04b6cSmrg		
966989c04b6cSmrgfi[]dnl
967089c04b6cSmrg])# PKG_PROG_PKG_CONFIG
967189c04b6cSmrg
967289c04b6cSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
967389c04b6cSmrg#
967489c04b6cSmrg# Check to see whether a particular set of modules exists.  Similar
967589c04b6cSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
967689c04b6cSmrg#
967789c04b6cSmrg#
967889c04b6cSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
967989c04b6cSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
968089c04b6cSmrg# PKG_CHECK_EXISTS manually
968189c04b6cSmrg# --------------------------------------------------------------
968289c04b6cSmrgAC_DEFUN([PKG_CHECK_EXISTS],
968389c04b6cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
968489c04b6cSmrgif test -n "$PKG_CONFIG" && \
968589c04b6cSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
968689c04b6cSmrg  m4_ifval([$2], [$2], [:])
968789c04b6cSmrgm4_ifvaln([$3], [else
968889c04b6cSmrg  $3])dnl
968989c04b6cSmrgfi])
969089c04b6cSmrg
969189c04b6cSmrg
969289c04b6cSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
969389c04b6cSmrg# ---------------------------------------------
969489c04b6cSmrgm4_define([_PKG_CONFIG],
969589c04b6cSmrg[if test -n "$$1"; then
969689c04b6cSmrg    pkg_cv_[]$1="$$1"
969789c04b6cSmrg elif test -n "$PKG_CONFIG"; then
969889c04b6cSmrg    PKG_CHECK_EXISTS([$3],
969989c04b6cSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
970089c04b6cSmrg		     [pkg_failed=yes])
970189c04b6cSmrg else
970289c04b6cSmrg    pkg_failed=untried
970389c04b6cSmrgfi[]dnl
970489c04b6cSmrg])# _PKG_CONFIG
970589c04b6cSmrg
970689c04b6cSmrg# _PKG_SHORT_ERRORS_SUPPORTED
970789c04b6cSmrg# -----------------------------
970889c04b6cSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
970989c04b6cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
971089c04b6cSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
971189c04b6cSmrg        _pkg_short_errors_supported=yes
971289c04b6cSmrgelse
971389c04b6cSmrg        _pkg_short_errors_supported=no
971489c04b6cSmrgfi[]dnl
971589c04b6cSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
971689c04b6cSmrg
971789c04b6cSmrg
971889c04b6cSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
971989c04b6cSmrg# [ACTION-IF-NOT-FOUND])
972089c04b6cSmrg#
972189c04b6cSmrg#
972289c04b6cSmrg# Note that if there is a possibility the first call to
972389c04b6cSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
972489c04b6cSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
972589c04b6cSmrg#
972689c04b6cSmrg#
972789c04b6cSmrg# --------------------------------------------------------------
972889c04b6cSmrgAC_DEFUN([PKG_CHECK_MODULES],
972989c04b6cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
973089c04b6cSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
973189c04b6cSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
973289c04b6cSmrg
973389c04b6cSmrgpkg_failed=no
973489c04b6cSmrgAC_MSG_CHECKING([for $1])
973589c04b6cSmrg
973689c04b6cSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
973789c04b6cSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
973889c04b6cSmrg
973989c04b6cSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
974089c04b6cSmrgand $1[]_LIBS to avoid the need to call pkg-config.
974189c04b6cSmrgSee the pkg-config man page for more details.])
974289c04b6cSmrg
974389c04b6cSmrgif test $pkg_failed = yes; then
974489c04b6cSmrg        _PKG_SHORT_ERRORS_SUPPORTED
974589c04b6cSmrg        if test $_pkg_short_errors_supported = yes; then
974689c04b6cSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
974789c04b6cSmrg        else 
974889c04b6cSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
974989c04b6cSmrg        fi
975089c04b6cSmrg	# Put the nasty error message in config.log where it belongs
975189c04b6cSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
975289c04b6cSmrg
975389c04b6cSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
975489c04b6cSmrg[Package requirements ($2) were not met:
975589c04b6cSmrg
975689c04b6cSmrg$$1_PKG_ERRORS
975789c04b6cSmrg
975889c04b6cSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
975989c04b6cSmrginstalled software in a non-standard prefix.
976089c04b6cSmrg
976189c04b6cSmrg_PKG_TEXT
976289c04b6cSmrg])],
976389c04b6cSmrg		[AC_MSG_RESULT([no])
976489c04b6cSmrg                $4])
976589c04b6cSmrgelif test $pkg_failed = untried; then
976689c04b6cSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
976789c04b6cSmrg[The pkg-config script could not be found or is too old.  Make sure it
976889c04b6cSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
976989c04b6cSmrgpath to pkg-config.
977089c04b6cSmrg
977189c04b6cSmrg_PKG_TEXT
977289c04b6cSmrg
977389c04b6cSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
977489c04b6cSmrg		[$4])
977589c04b6cSmrgelse
977689c04b6cSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
977789c04b6cSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
977889c04b6cSmrg        AC_MSG_RESULT([yes])
977989c04b6cSmrg	ifelse([$3], , :, [$3])
978089c04b6cSmrgfi[]dnl
978189c04b6cSmrg])# PKG_CHECK_MODULES
978289c04b6cSmrg
97836fae4e5dSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
97846fae4e5dSmrgdnl
97856fae4e5dSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
97866fae4e5dSmrgdnl 
97876fae4e5dSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
97886fae4e5dSmrgdnl copy of this software and associated documentation files (the "Software"),
97896fae4e5dSmrgdnl to deal in the Software without restriction, including without limitation
97906fae4e5dSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
97916fae4e5dSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
97926fae4e5dSmrgdnl Software is furnished to do so, subject to the following conditions:
97936fae4e5dSmrgdnl
97946fae4e5dSmrgdnl The above copyright notice and this permission notice (including the next
97956fae4e5dSmrgdnl paragraph) shall be included in all copies or substantial portions of the
97966fae4e5dSmrgdnl Software.
97976fae4e5dSmrgdnl
97986fae4e5dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
97996fae4e5dSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98006fae4e5dSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
98016fae4e5dSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
98026fae4e5dSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
98036fae4e5dSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
98046fae4e5dSmrgdnl DEALINGS IN THE SOFTWARE.
98051f0ac6a5Smrg
98066fae4e5dSmrg# XORG_MACROS_VERSION(required-version)
98076fae4e5dSmrg# -------------------------------------
98086fae4e5dSmrg# Minimum version: 1.1.0
98096fae4e5dSmrg#
98106fae4e5dSmrg# If you're using a macro added in Version 1.1 or newer, include this in
98116fae4e5dSmrg# your configure.ac with the minimum required version, such as:
98126fae4e5dSmrg# XORG_MACROS_VERSION(1.1)
98136fae4e5dSmrg#
98146fae4e5dSmrg# To ensure that this macro is defined, also add:
98156fae4e5dSmrg# m4_ifndef([XORG_MACROS_VERSION],
98166fae4e5dSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
98176fae4e5dSmrg#
98186fae4e5dSmrg#
98196fae4e5dSmrg# See the "minimum version" comment for each macro you use to see what 
98206fae4e5dSmrg# version you require.
98216fae4e5dSmrgm4_defun([XORG_MACROS_VERSION],[
982289c04b6cSmrgm4_define([vers_have], [1.17])
98236fae4e5dSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
98246fae4e5dSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
98256fae4e5dSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
98266fae4e5dSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
98276fae4e5dSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
98286fae4e5dSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
98296fae4e5dSmrgm4_undefine([vers_have])
98306fae4e5dSmrgm4_undefine([maj_have])
98316fae4e5dSmrgm4_undefine([maj_needed])
98326fae4e5dSmrg]) # XORG_MACROS_VERSION
98331f0ac6a5Smrg
98346fae4e5dSmrg# XORG_PROG_RAWCPP()
98356fae4e5dSmrg# ------------------
98366fae4e5dSmrg# Minimum version: 1.0.0
98376fae4e5dSmrg#
98386fae4e5dSmrg# Find cpp program and necessary flags for use in pre-processing text files
98396fae4e5dSmrg# such as man pages and config files
98406fae4e5dSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
98416fae4e5dSmrgAC_REQUIRE([AC_PROG_CPP])
98426fae4e5dSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
98436fae4e5dSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
98441f0ac6a5Smrg
98456fae4e5dSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
98466fae4e5dSmrg# which is not the best choice for supporting other OS'es, but covers most
98476fae4e5dSmrg# of the ones we need for now.
98486fae4e5dSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
98496fae4e5dSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
98506fae4e5dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98516fae4e5dSmrg	AC_MSG_RESULT([no])
98526fae4e5dSmrgelse
98536fae4e5dSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98546fae4e5dSmrg		RAWCPPFLAGS=-undef
98556fae4e5dSmrg		AC_MSG_RESULT([yes])
98566fae4e5dSmrg	# under Cygwin unix is still defined even with -undef
98576fae4e5dSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98586fae4e5dSmrg		RAWCPPFLAGS="-undef -ansi"
98596fae4e5dSmrg		AC_MSG_RESULT([yes, with -ansi])
98606fae4e5dSmrg	else
98616fae4e5dSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
98626fae4e5dSmrg	fi
98636fae4e5dSmrgfi
98646fae4e5dSmrgrm -f conftest.$ac_ext
98651f0ac6a5Smrg
98666fae4e5dSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
98676fae4e5dSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
98686fae4e5dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
98696fae4e5dSmrg	AC_MSG_RESULT([no])
98706fae4e5dSmrgelse
98716fae4e5dSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
98726fae4e5dSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
98736fae4e5dSmrg		AC_MSG_RESULT([yes])
98746fae4e5dSmrg	else
98756fae4e5dSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
98766fae4e5dSmrg	fi
98776fae4e5dSmrgfi
98786fae4e5dSmrgrm -f conftest.$ac_ext
98796fae4e5dSmrgAC_SUBST(RAWCPPFLAGS)
98806fae4e5dSmrg]) # XORG_PROG_RAWCPP
98811f0ac6a5Smrg
98826fae4e5dSmrg# XORG_MANPAGE_SECTIONS()
98836fae4e5dSmrg# -----------------------
98846fae4e5dSmrg# Minimum version: 1.0.0
98859c9ff80cSmrg#
98866fae4e5dSmrg# Determine which sections man pages go in for the different man page types
98876fae4e5dSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
98886fae4e5dSmrg# Not sure if there's any better way than just hardcoding by OS name.
98896fae4e5dSmrg# Override default settings by setting environment variables
98906fae4e5dSmrg# Added MAN_SUBSTS in version 1.8
98916fae4e5dSmrg# Added AC_PROG_SED in version 1.8
98921f0ac6a5Smrg
98936fae4e5dSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
98946fae4e5dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
98956fae4e5dSmrgAC_REQUIRE([AC_PROG_SED])
98969c9ff80cSmrg
98976fae4e5dSmrgif test x$APP_MAN_SUFFIX = x    ; then
98986fae4e5dSmrg    APP_MAN_SUFFIX=1
98996fae4e5dSmrgfi
99006fae4e5dSmrgif test x$APP_MAN_DIR = x    ; then
99016fae4e5dSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
99026fae4e5dSmrgfi
99039c9ff80cSmrg
99046fae4e5dSmrgif test x$LIB_MAN_SUFFIX = x    ; then
99056fae4e5dSmrg    LIB_MAN_SUFFIX=3
99066fae4e5dSmrgfi
99076fae4e5dSmrgif test x$LIB_MAN_DIR = x    ; then
99086fae4e5dSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
99096fae4e5dSmrgfi
99109c9ff80cSmrg
99116fae4e5dSmrgif test x$FILE_MAN_SUFFIX = x    ; then
99126fae4e5dSmrg    case $host_os in
99136fae4e5dSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
99146fae4e5dSmrg	*)		FILE_MAN_SUFFIX=5  ;;
99156fae4e5dSmrg    esac
99166fae4e5dSmrgfi
99176fae4e5dSmrgif test x$FILE_MAN_DIR = x    ; then
99186fae4e5dSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
99196fae4e5dSmrgfi
99209c9ff80cSmrg
99216fae4e5dSmrgif test x$MISC_MAN_SUFFIX = x    ; then
99226fae4e5dSmrg    case $host_os in
99236fae4e5dSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
99246fae4e5dSmrg	*)		MISC_MAN_SUFFIX=7  ;;
99256fae4e5dSmrg    esac
99266fae4e5dSmrgfi
99276fae4e5dSmrgif test x$MISC_MAN_DIR = x    ; then
99286fae4e5dSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
99296fae4e5dSmrgfi
99309c9ff80cSmrg
99316fae4e5dSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
99326fae4e5dSmrg    case $host_os in
99336fae4e5dSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
99346fae4e5dSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
99356fae4e5dSmrg    esac
99366fae4e5dSmrgfi
99376fae4e5dSmrgif test x$DRIVER_MAN_DIR = x    ; then
99386fae4e5dSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
99396fae4e5dSmrgfi
99409c9ff80cSmrg
99416fae4e5dSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
99426fae4e5dSmrg    case $host_os in
99436fae4e5dSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
99446fae4e5dSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
99456fae4e5dSmrg    esac
99466fae4e5dSmrgfi
99476fae4e5dSmrgif test x$ADMIN_MAN_DIR = x    ; then
99486fae4e5dSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
99496fae4e5dSmrgfi
99509c9ff80cSmrg
99519c9ff80cSmrg
99526fae4e5dSmrgAC_SUBST([APP_MAN_SUFFIX])
99536fae4e5dSmrgAC_SUBST([LIB_MAN_SUFFIX])
99546fae4e5dSmrgAC_SUBST([FILE_MAN_SUFFIX])
99556fae4e5dSmrgAC_SUBST([MISC_MAN_SUFFIX])
99566fae4e5dSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
99576fae4e5dSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
99586fae4e5dSmrgAC_SUBST([APP_MAN_DIR])
99596fae4e5dSmrgAC_SUBST([LIB_MAN_DIR])
99606fae4e5dSmrgAC_SUBST([FILE_MAN_DIR])
99616fae4e5dSmrgAC_SUBST([MISC_MAN_DIR])
99626fae4e5dSmrgAC_SUBST([DRIVER_MAN_DIR])
99636fae4e5dSmrgAC_SUBST([ADMIN_MAN_DIR])
99641f0ac6a5Smrg
99656fae4e5dSmrgXORG_MAN_PAGE="X Version 11"
99666fae4e5dSmrgAC_SUBST([XORG_MAN_PAGE])
99676fae4e5dSmrgMAN_SUBSTS="\
99686fae4e5dSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
99696fae4e5dSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
99706fae4e5dSmrg	-e 's|__xservername__|Xorg|g' \
99716fae4e5dSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
99726fae4e5dSmrg	-e 's|__projectroot__|\$(prefix)|g' \
99736fae4e5dSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
99746fae4e5dSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
99756fae4e5dSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
99766fae4e5dSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
99776fae4e5dSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
99786fae4e5dSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
99796fae4e5dSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
99806fae4e5dSmrgAC_SUBST([MAN_SUBSTS])
99811f0ac6a5Smrg
99826fae4e5dSmrg]) # XORG_MANPAGE_SECTIONS
99839c9ff80cSmrg
99846fae4e5dSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
99856fae4e5dSmrg# ------------------------
99866fae4e5dSmrg# Minimum version: 1.7.0
99876fae4e5dSmrg#
99886fae4e5dSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
99896fae4e5dSmrg# provided by xorg-sgml-doctools, if installed.
99906fae4e5dSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
99916fae4e5dSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
99926fae4e5dSmrgXORG_SGML_PATH=
99936fae4e5dSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
99946fae4e5dSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
99956fae4e5dSmrg    [m4_ifval([$1],[:],
99966fae4e5dSmrg        [if test x"$cross_compiling" != x"yes" ; then
99976fae4e5dSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
99986fae4e5dSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
99996fae4e5dSmrg         fi])
100006fae4e5dSmrg    ])
100011f0ac6a5Smrg
100026fae4e5dSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
100036fae4e5dSmrg# the path and the name of the doc stylesheet
100046fae4e5dSmrgif test "x$XORG_SGML_PATH" != "x" ; then
100056fae4e5dSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
100066fae4e5dSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
100076fae4e5dSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
100086fae4e5dSmrgelse
100096fae4e5dSmrg   AC_MSG_RESULT([no])
100106fae4e5dSmrgfi
100111f0ac6a5Smrg
100126fae4e5dSmrgAC_SUBST(XORG_SGML_PATH)
100136fae4e5dSmrgAC_SUBST(STYLESHEET_SRCDIR)
100146fae4e5dSmrgAC_SUBST(XSL_STYLESHEET)
100156fae4e5dSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
100166fae4e5dSmrg]) # XORG_CHECK_SGML_DOCTOOLS
100171f0ac6a5Smrg
100186fae4e5dSmrg# XORG_CHECK_LINUXDOC
100196fae4e5dSmrg# -------------------
100206fae4e5dSmrg# Minimum version: 1.0.0
100216fae4e5dSmrg#
100226fae4e5dSmrg# Defines the variable MAKE_TEXT if the necessary tools and
100236fae4e5dSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
100246fae4e5dSmrg# Whether or not the necessary tools and files are found can be checked
100256fae4e5dSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
100266fae4e5dSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
100276fae4e5dSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
100286fae4e5dSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
100291f0ac6a5Smrg
100306fae4e5dSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
100311f0ac6a5Smrg
100326fae4e5dSmrgAC_MSG_CHECKING([whether to build documentation])
100331f0ac6a5Smrg
100346fae4e5dSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
100356fae4e5dSmrg   BUILDDOC=yes
100366fae4e5dSmrgelse
100376fae4e5dSmrg   BUILDDOC=no
100386fae4e5dSmrgfi
100391f0ac6a5Smrg
100406fae4e5dSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
100411f0ac6a5Smrg
100426fae4e5dSmrgAC_MSG_RESULT([$BUILDDOC])
100431f0ac6a5Smrg
100446fae4e5dSmrgAC_MSG_CHECKING([whether to build pdf documentation])
100451f0ac6a5Smrg
100466fae4e5dSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
100476fae4e5dSmrg   BUILDPDFDOC=yes
100486fae4e5dSmrgelse
100496fae4e5dSmrg   BUILDPDFDOC=no
100506fae4e5dSmrgfi
100511f0ac6a5Smrg
100526fae4e5dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
100531f0ac6a5Smrg
100546fae4e5dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
100551f0ac6a5Smrg
100566fae4e5dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
100576fae4e5dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
100586fae4e5dSmrgMAKE_PDF="$PS2PDF"
100596fae4e5dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
100601f0ac6a5Smrg
100616fae4e5dSmrgAC_SUBST(MAKE_TEXT)
100626fae4e5dSmrgAC_SUBST(MAKE_PS)
100636fae4e5dSmrgAC_SUBST(MAKE_PDF)
100646fae4e5dSmrgAC_SUBST(MAKE_HTML)
100656fae4e5dSmrg]) # XORG_CHECK_LINUXDOC
100661f0ac6a5Smrg
100676fae4e5dSmrg# XORG_CHECK_DOCBOOK
100686fae4e5dSmrg# -------------------
100696fae4e5dSmrg# Minimum version: 1.0.0
100706fae4e5dSmrg#
100716fae4e5dSmrg# Checks for the ability to build output formats from SGML DocBook source.
100726fae4e5dSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
100736fae4e5dSmrg# indicates whether the necessary tools and files are found and, if set,
100746fae4e5dSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
100756fae4e5dSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
100766fae4e5dSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
100771f0ac6a5Smrg
100786fae4e5dSmrgBUILDTXTDOC=no
100796fae4e5dSmrgBUILDPDFDOC=no
100806fae4e5dSmrgBUILDPSDOC=no
100816fae4e5dSmrgBUILDHTMLDOC=no
100821f0ac6a5Smrg
100836fae4e5dSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
100846fae4e5dSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
100856fae4e5dSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
100866fae4e5dSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
100871f0ac6a5Smrg
100886fae4e5dSmrgAC_MSG_CHECKING([whether to build text documentation])
100896fae4e5dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
100906fae4e5dSmrg   test x$BUILD_TXTDOC != xno; then
100916fae4e5dSmrg	BUILDTXTDOC=yes
100926fae4e5dSmrgfi
100936fae4e5dSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
100946fae4e5dSmrgAC_MSG_RESULT([$BUILDTXTDOC])
100951f0ac6a5Smrg
100966fae4e5dSmrgAC_MSG_CHECKING([whether to build PDF documentation])
100976fae4e5dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
100986fae4e5dSmrg   test x$BUILD_PDFDOC != xno; then
100996fae4e5dSmrg	BUILDPDFDOC=yes
101006fae4e5dSmrgfi
101016fae4e5dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
101026fae4e5dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
101031f0ac6a5Smrg
101046fae4e5dSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
101056fae4e5dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
101066fae4e5dSmrg   test x$BUILD_PSDOC != xno; then
101076fae4e5dSmrg	BUILDPSDOC=yes
101086fae4e5dSmrgfi
101096fae4e5dSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
101106fae4e5dSmrgAC_MSG_RESULT([$BUILDPSDOC])
101111f0ac6a5Smrg
101126fae4e5dSmrgAC_MSG_CHECKING([whether to build HTML documentation])
101136fae4e5dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
101146fae4e5dSmrg   test x$BUILD_HTMLDOC != xno; then
101156fae4e5dSmrg	BUILDHTMLDOC=yes
101166fae4e5dSmrgfi
101176fae4e5dSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
101186fae4e5dSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
101191f0ac6a5Smrg
101206fae4e5dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
101216fae4e5dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
101226fae4e5dSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
101236fae4e5dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
101241f0ac6a5Smrg
101256fae4e5dSmrgAC_SUBST(MAKE_TEXT)
101266fae4e5dSmrgAC_SUBST(MAKE_PS)
101276fae4e5dSmrgAC_SUBST(MAKE_PDF)
101286fae4e5dSmrgAC_SUBST(MAKE_HTML)
101296fae4e5dSmrg]) # XORG_CHECK_DOCBOOK
101301f0ac6a5Smrg
101316fae4e5dSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
101326fae4e5dSmrg# ----------------
101336fae4e5dSmrg# Minimum version: 1.5.0
101346fae4e5dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
101356fae4e5dSmrg#
101366fae4e5dSmrg# Documentation tools are not always available on all platforms and sometimes
101376fae4e5dSmrg# not at the appropriate level. This macro enables a module to test for the
101386fae4e5dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
101396fae4e5dSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
101406fae4e5dSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
101416fae4e5dSmrg# --with-xmlto assumes 'auto'.
101426fae4e5dSmrg#
101436fae4e5dSmrg# Interface to module:
101446fae4e5dSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
101456fae4e5dSmrg# XMLTO:	returns the path of the xmlto program found
101466fae4e5dSmrg#		returns the path set by the user in the environment
101476fae4e5dSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
101486fae4e5dSmrg#		'no' user instructs the module not to use xmlto
101496fae4e5dSmrg#
101506fae4e5dSmrg# Added in version 1.10.0
101516fae4e5dSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
101526fae4e5dSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
101536fae4e5dSmrg#
101546fae4e5dSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
101556fae4e5dSmrg#
101566fae4e5dSmrgAC_DEFUN([XORG_WITH_XMLTO],[
101576fae4e5dSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
101586fae4e5dSmrgm4_define([_defopt], m4_default([$2], [auto]))
101596fae4e5dSmrgAC_ARG_WITH(xmlto,
101606fae4e5dSmrg	AS_HELP_STRING([--with-xmlto],
101616fae4e5dSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
101626fae4e5dSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
101636fae4e5dSmrgm4_undefine([_defopt])
101649c9ff80cSmrg
101656fae4e5dSmrgif test "x$use_xmlto" = x"auto"; then
101666fae4e5dSmrg   AC_PATH_PROG([XMLTO], [xmlto])
101676fae4e5dSmrg   if test "x$XMLTO" = "x"; then
101686fae4e5dSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
101696fae4e5dSmrg	have_xmlto=no
101706fae4e5dSmrg   else
101716fae4e5dSmrg        have_xmlto=yes
101726fae4e5dSmrg   fi
101736fae4e5dSmrgelif test "x$use_xmlto" = x"yes" ; then
101746fae4e5dSmrg   AC_PATH_PROG([XMLTO], [xmlto])
101756fae4e5dSmrg   if test "x$XMLTO" = "x"; then
101766fae4e5dSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
101776fae4e5dSmrg   fi
101786fae4e5dSmrg   have_xmlto=yes
101796fae4e5dSmrgelif test "x$use_xmlto" = x"no" ; then
101806fae4e5dSmrg   if test "x$XMLTO" != "x"; then
101816fae4e5dSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
101826fae4e5dSmrg   fi
101836fae4e5dSmrg   have_xmlto=no
101846fae4e5dSmrgelse
101856fae4e5dSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
101866fae4e5dSmrgfi
101876fae4e5dSmrg
101886fae4e5dSmrg# Test for a minimum version of xmlto, if provided.
101896fae4e5dSmrgm4_ifval([$1],
101906fae4e5dSmrg[if test "$have_xmlto" = yes; then
101916fae4e5dSmrg    # scrape the xmlto version
101926fae4e5dSmrg    AC_MSG_CHECKING([the xmlto version])
101936fae4e5dSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
101946fae4e5dSmrg    AC_MSG_RESULT([$xmlto_version])
101956fae4e5dSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
101966fae4e5dSmrg        [if test "x$use_xmlto" = xauto; then
101976fae4e5dSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
101986fae4e5dSmrg            have_xmlto=no
101996fae4e5dSmrg        else
102006fae4e5dSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
102016fae4e5dSmrg        fi])
102026fae4e5dSmrgfi])
102036fae4e5dSmrg
102046fae4e5dSmrg# Test for the ability of xmlto to generate a text target
102056fae4e5dSmrghave_xmlto_text=no
102066fae4e5dSmrgcat > conftest.xml << "EOF"
102076fae4e5dSmrgEOF
102086fae4e5dSmrgAS_IF([test "$have_xmlto" = yes],
102096fae4e5dSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
102106fae4e5dSmrg             [have_xmlto_text=yes],
102116fae4e5dSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
102126fae4e5dSmrgrm -f conftest.xml
102136fae4e5dSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
102146fae4e5dSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
102156fae4e5dSmrg]) # XORG_WITH_XMLTO
102166fae4e5dSmrg
102176fae4e5dSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
102186fae4e5dSmrg# --------------------------------------------
102196fae4e5dSmrg# Minimum version: 1.12.0
102206fae4e5dSmrg# Minimum version for optional DEFAULT argument: 1.12.0
102216fae4e5dSmrg#
102226fae4e5dSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
102236fae4e5dSmrg# XML-based language used for the transformation of XML documents.
102246fae4e5dSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
102256fae4e5dSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
102266fae4e5dSmrg# The XSLT processor is often used as a standalone tool for transformations.
102276fae4e5dSmrg# It should not be assumed that this tool is used only to work with documnetation.
102286fae4e5dSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
102296fae4e5dSmrg#
102306fae4e5dSmrg# Interface to module:
102316fae4e5dSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
102326fae4e5dSmrg# XSLTPROC:	 returns the path of the xsltproc program found
102336fae4e5dSmrg#		 returns the path set by the user in the environment
102346fae4e5dSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
102356fae4e5dSmrg#		  'no' user instructs the module not to use xsltproc
102366fae4e5dSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
102376fae4e5dSmrg#
102386fae4e5dSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
102396fae4e5dSmrg#
102406fae4e5dSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
102416fae4e5dSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
102426fae4e5dSmrg# Preserves the interface, should it be implemented later
102436fae4e5dSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
102446fae4e5dSmrgm4_define([_defopt], m4_default([$2], [auto]))
102456fae4e5dSmrgAC_ARG_WITH(xsltproc,
102466fae4e5dSmrg	AS_HELP_STRING([--with-xsltproc],
102476fae4e5dSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
102486fae4e5dSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
102496fae4e5dSmrgm4_undefine([_defopt])
102506fae4e5dSmrg
102516fae4e5dSmrgif test "x$use_xsltproc" = x"auto"; then
102526fae4e5dSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
102536fae4e5dSmrg   if test "x$XSLTPROC" = "x"; then
102546fae4e5dSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
102556fae4e5dSmrg	have_xsltproc=no
102566fae4e5dSmrg   else
102576fae4e5dSmrg        have_xsltproc=yes
102586fae4e5dSmrg   fi
102596fae4e5dSmrgelif test "x$use_xsltproc" = x"yes" ; then
102606fae4e5dSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
102616fae4e5dSmrg   if test "x$XSLTPROC" = "x"; then
102626fae4e5dSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
102636fae4e5dSmrg   fi
102646fae4e5dSmrg   have_xsltproc=yes
102656fae4e5dSmrgelif test "x$use_xsltproc" = x"no" ; then
102666fae4e5dSmrg   if test "x$XSLTPROC" != "x"; then
102676fae4e5dSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
102686fae4e5dSmrg   fi
102696fae4e5dSmrg   have_xsltproc=no
102706fae4e5dSmrgelse
102716fae4e5dSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
102726fae4e5dSmrgfi
102731f0ac6a5Smrg
102746fae4e5dSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
102756fae4e5dSmrg]) # XORG_WITH_XSLTPROC
102761f0ac6a5Smrg
102776fae4e5dSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
102786fae4e5dSmrg# ----------------------------------------
102796fae4e5dSmrg# Minimum version: 1.15.0
102806fae4e5dSmrg#
102816fae4e5dSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
102826fae4e5dSmrg# scanning arbitrary text files, extracting information from those text files,
102836fae4e5dSmrg# and printing reports based on that information.
102846fae4e5dSmrg#
102856fae4e5dSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
102866fae4e5dSmrg#
102876fae4e5dSmrg# Interface to module:
102886fae4e5dSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
102896fae4e5dSmrg# PERL:	     returns the path of the perl program found
102906fae4e5dSmrg#	     returns the path set by the user in the environment
102916fae4e5dSmrg# --with-perl: 'yes' user instructs the module to use perl
102926fae4e5dSmrg#	       'no' user instructs the module not to use perl
102936fae4e5dSmrg# have_perl: returns yes if perl found in PATH or no
102946fae4e5dSmrg#
102956fae4e5dSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
102966fae4e5dSmrg#
102976fae4e5dSmrgAC_DEFUN([XORG_WITH_PERL],[
102986fae4e5dSmrgAC_ARG_VAR([PERL], [Path to perl command])
102996fae4e5dSmrg# Preserves the interface, should it be implemented later
103006fae4e5dSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
103016fae4e5dSmrgm4_define([_defopt], m4_default([$2], [auto]))
103026fae4e5dSmrgAC_ARG_WITH(perl,
103036fae4e5dSmrg	AS_HELP_STRING([--with-perl],
103046fae4e5dSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
103056fae4e5dSmrg	   [use_perl=$withval], [use_perl=]_defopt)
103066fae4e5dSmrgm4_undefine([_defopt])
103076fae4e5dSmrg
103086fae4e5dSmrgif test "x$use_perl" = x"auto"; then
103096fae4e5dSmrg   AC_PATH_PROG([PERL], [perl])
103106fae4e5dSmrg   if test "x$PERL" = "x"; then
103116fae4e5dSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
103126fae4e5dSmrg	have_perl=no
103136fae4e5dSmrg   else
103146fae4e5dSmrg        have_perl=yes
103156fae4e5dSmrg   fi
103166fae4e5dSmrgelif test "x$use_perl" = x"yes" ; then
103176fae4e5dSmrg   AC_PATH_PROG([PERL], [perl])
103186fae4e5dSmrg   if test "x$PERL" = "x"; then
103196fae4e5dSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
103206fae4e5dSmrg   fi
103216fae4e5dSmrg   have_perl=yes
103226fae4e5dSmrgelif test "x$use_perl" = x"no" ; then
103236fae4e5dSmrg   if test "x$PERL" != "x"; then
103246fae4e5dSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
103256fae4e5dSmrg   fi
103266fae4e5dSmrg   have_perl=no
103276fae4e5dSmrgelse
103286fae4e5dSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
103296fae4e5dSmrgfi
103301f0ac6a5Smrg
103316fae4e5dSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
103326fae4e5dSmrg]) # XORG_WITH_PERL
103331f0ac6a5Smrg
103346fae4e5dSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
103356fae4e5dSmrg# ----------------
103366fae4e5dSmrg# Minimum version: 1.5.0
103376fae4e5dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
103386fae4e5dSmrg#
103396fae4e5dSmrg# Documentation tools are not always available on all platforms and sometimes
103406fae4e5dSmrg# not at the appropriate level. This macro enables a module to test for the
103416fae4e5dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
103426fae4e5dSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
103436fae4e5dSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
103446fae4e5dSmrg# --with-asciidoc assumes 'auto'.
103456fae4e5dSmrg#
103466fae4e5dSmrg# Interface to module:
103476fae4e5dSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
103486fae4e5dSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
103496fae4e5dSmrg#		 returns the path set by the user in the environment
103506fae4e5dSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
103516fae4e5dSmrg#		  'no' user instructs the module not to use asciidoc
103526fae4e5dSmrg#
103536fae4e5dSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
103546fae4e5dSmrg#
103556fae4e5dSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
103566fae4e5dSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
103576fae4e5dSmrgm4_define([_defopt], m4_default([$2], [auto]))
103586fae4e5dSmrgAC_ARG_WITH(asciidoc,
103596fae4e5dSmrg	AS_HELP_STRING([--with-asciidoc],
103606fae4e5dSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
103616fae4e5dSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
103626fae4e5dSmrgm4_undefine([_defopt])
103631f0ac6a5Smrg
103646fae4e5dSmrgif test "x$use_asciidoc" = x"auto"; then
103656fae4e5dSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
103666fae4e5dSmrg   if test "x$ASCIIDOC" = "x"; then
103676fae4e5dSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
103686fae4e5dSmrg	have_asciidoc=no
103696fae4e5dSmrg   else
103706fae4e5dSmrg        have_asciidoc=yes
103716fae4e5dSmrg   fi
103726fae4e5dSmrgelif test "x$use_asciidoc" = x"yes" ; then
103736fae4e5dSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
103746fae4e5dSmrg   if test "x$ASCIIDOC" = "x"; then
103756fae4e5dSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
103766fae4e5dSmrg   fi
103776fae4e5dSmrg   have_asciidoc=yes
103786fae4e5dSmrgelif test "x$use_asciidoc" = x"no" ; then
103796fae4e5dSmrg   if test "x$ASCIIDOC" != "x"; then
103806fae4e5dSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
103816fae4e5dSmrg   fi
103826fae4e5dSmrg   have_asciidoc=no
103836fae4e5dSmrgelse
103846fae4e5dSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
103856fae4e5dSmrgfi
103866fae4e5dSmrgm4_ifval([$1],
103876fae4e5dSmrg[if test "$have_asciidoc" = yes; then
103886fae4e5dSmrg    # scrape the asciidoc version
103896fae4e5dSmrg    AC_MSG_CHECKING([the asciidoc version])
103906fae4e5dSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
103916fae4e5dSmrg    AC_MSG_RESULT([$asciidoc_version])
103926fae4e5dSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
103936fae4e5dSmrg        [if test "x$use_asciidoc" = xauto; then
103946fae4e5dSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
103956fae4e5dSmrg            have_asciidoc=no
103966fae4e5dSmrg        else
103976fae4e5dSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
103986fae4e5dSmrg        fi])
103996fae4e5dSmrgfi])
104006fae4e5dSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
104016fae4e5dSmrg]) # XORG_WITH_ASCIIDOC
104021f0ac6a5Smrg
104036fae4e5dSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
104046fae4e5dSmrg# --------------------------------
104056fae4e5dSmrg# Minimum version: 1.5.0
104066fae4e5dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
104076fae4e5dSmrg#
104086fae4e5dSmrg# Documentation tools are not always available on all platforms and sometimes
104096fae4e5dSmrg# not at the appropriate level. This macro enables a module to test for the
104106fae4e5dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
104116fae4e5dSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
104126fae4e5dSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
104136fae4e5dSmrg# --with-doxygen assumes 'auto'.
104146fae4e5dSmrg#
104156fae4e5dSmrg# Interface to module:
104166fae4e5dSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
104176fae4e5dSmrg# DOXYGEN:	 returns the path of the doxygen program found
104186fae4e5dSmrg#		 returns the path set by the user in the environment
104196fae4e5dSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
104206fae4e5dSmrg#		  'no' user instructs the module not to use doxygen
104216fae4e5dSmrg#
104226fae4e5dSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
104236fae4e5dSmrg#
104246fae4e5dSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
104256fae4e5dSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
104266fae4e5dSmrgm4_define([_defopt], m4_default([$2], [auto]))
104276fae4e5dSmrgAC_ARG_WITH(doxygen,
104286fae4e5dSmrg	AS_HELP_STRING([--with-doxygen],
104296fae4e5dSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
104306fae4e5dSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
104316fae4e5dSmrgm4_undefine([_defopt])
104321f0ac6a5Smrg
104336fae4e5dSmrgif test "x$use_doxygen" = x"auto"; then
104346fae4e5dSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
104356fae4e5dSmrg   if test "x$DOXYGEN" = "x"; then
104366fae4e5dSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
104376fae4e5dSmrg	have_doxygen=no
104386fae4e5dSmrg   else
104396fae4e5dSmrg        have_doxygen=yes
104406fae4e5dSmrg   fi
104416fae4e5dSmrgelif test "x$use_doxygen" = x"yes" ; then
104426fae4e5dSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
104436fae4e5dSmrg   if test "x$DOXYGEN" = "x"; then
104446fae4e5dSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
104456fae4e5dSmrg   fi
104466fae4e5dSmrg   have_doxygen=yes
104476fae4e5dSmrgelif test "x$use_doxygen" = x"no" ; then
104486fae4e5dSmrg   if test "x$DOXYGEN" != "x"; then
104496fae4e5dSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
104506fae4e5dSmrg   fi
104516fae4e5dSmrg   have_doxygen=no
104526fae4e5dSmrgelse
104536fae4e5dSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
104546fae4e5dSmrgfi
104556fae4e5dSmrgm4_ifval([$1],
104566fae4e5dSmrg[if test "$have_doxygen" = yes; then
104576fae4e5dSmrg    # scrape the doxygen version
104586fae4e5dSmrg    AC_MSG_CHECKING([the doxygen version])
104596fae4e5dSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
104606fae4e5dSmrg    AC_MSG_RESULT([$doxygen_version])
104616fae4e5dSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
104626fae4e5dSmrg        [if test "x$use_doxygen" = xauto; then
104636fae4e5dSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
104646fae4e5dSmrg            have_doxygen=no
104656fae4e5dSmrg        else
104666fae4e5dSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
104676fae4e5dSmrg        fi])
104686fae4e5dSmrgfi])
104696fae4e5dSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
104706fae4e5dSmrg]) # XORG_WITH_DOXYGEN
104719c9ff80cSmrg
104726fae4e5dSmrg# XORG_WITH_GROFF([DEFAULT])
104736fae4e5dSmrg# ----------------
104746fae4e5dSmrg# Minimum version: 1.6.0
104756fae4e5dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
104766fae4e5dSmrg#
104776fae4e5dSmrg# Documentation tools are not always available on all platforms and sometimes
104786fae4e5dSmrg# not at the appropriate level. This macro enables a module to test for the
104796fae4e5dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
104806fae4e5dSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
104816fae4e5dSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
104826fae4e5dSmrg# --with-groff assumes 'auto'.
104836fae4e5dSmrg#
104846fae4e5dSmrg# Interface to module:
104856fae4e5dSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
104866fae4e5dSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
104876fae4e5dSmrg# HAVE_GROFF_MS: the -ms macros package
104886fae4e5dSmrg# GROFF:	 returns the path of the groff program found
104896fae4e5dSmrg#		 returns the path set by the user in the environment
104906fae4e5dSmrg# --with-groff:	 'yes' user instructs the module to use groff
104916fae4e5dSmrg#		 'no' user instructs the module not to use groff
104926fae4e5dSmrg#
104936fae4e5dSmrg# Added in version 1.9.0:
104946fae4e5dSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
104956fae4e5dSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
104966fae4e5dSmrg#		   psselect from the psutils package.
104976fae4e5dSmrg#		   the ghostcript package. Refer to the grohtml man pages
104986fae4e5dSmrg#
104996fae4e5dSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
105006fae4e5dSmrg#
105016fae4e5dSmrg# OS and distros often splits groff in a basic and full package, the former
105026fae4e5dSmrg# having the groff program and the later having devices, fonts and macros
105036fae4e5dSmrg# Checking for the groff executable is not enough.
105046fae4e5dSmrg#
105056fae4e5dSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
105066fae4e5dSmrg# unset HAVE_GROFF or GROFF env variables.
105076fae4e5dSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
105086fae4e5dSmrg#
105096fae4e5dSmrgAC_DEFUN([XORG_WITH_GROFF],[
105106fae4e5dSmrgAC_ARG_VAR([GROFF], [Path to groff command])
105116fae4e5dSmrgm4_define([_defopt], m4_default([$1], [auto]))
105126fae4e5dSmrgAC_ARG_WITH(groff,
105136fae4e5dSmrg	AS_HELP_STRING([--with-groff],
105146fae4e5dSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
105156fae4e5dSmrg	   [use_groff=$withval], [use_groff=]_defopt)
105166fae4e5dSmrgm4_undefine([_defopt])
105179c9ff80cSmrg
105186fae4e5dSmrgif test "x$use_groff" = x"auto"; then
105196fae4e5dSmrg   AC_PATH_PROG([GROFF], [groff])
105206fae4e5dSmrg   if test "x$GROFF" = "x"; then
105216fae4e5dSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
105226fae4e5dSmrg	have_groff=no
105236fae4e5dSmrg   else
105246fae4e5dSmrg        have_groff=yes
105256fae4e5dSmrg   fi
105266fae4e5dSmrgelif test "x$use_groff" = x"yes" ; then
105276fae4e5dSmrg   AC_PATH_PROG([GROFF], [groff])
105286fae4e5dSmrg   if test "x$GROFF" = "x"; then
105296fae4e5dSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
105306fae4e5dSmrg   fi
105316fae4e5dSmrg   have_groff=yes
105326fae4e5dSmrgelif test "x$use_groff" = x"no" ; then
105336fae4e5dSmrg   if test "x$GROFF" != "x"; then
105346fae4e5dSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
105356fae4e5dSmrg   fi
105366fae4e5dSmrg   have_groff=no
105376fae4e5dSmrgelse
105386fae4e5dSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
105396fae4e5dSmrgfi
105401f0ac6a5Smrg
105416fae4e5dSmrg# We have groff, test for the presence of the macro packages
105426fae4e5dSmrgif test "x$have_groff" = x"yes"; then
105436fae4e5dSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
105446fae4e5dSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
105456fae4e5dSmrg        groff_ms_works=yes
105466fae4e5dSmrg    else
105476fae4e5dSmrg        groff_ms_works=no
105486fae4e5dSmrg    fi
105496fae4e5dSmrg    AC_MSG_RESULT([$groff_ms_works])
105506fae4e5dSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
105516fae4e5dSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
105526fae4e5dSmrg        groff_mm_works=yes
105536fae4e5dSmrg    else
105546fae4e5dSmrg        groff_mm_works=no
105556fae4e5dSmrg    fi
105566fae4e5dSmrg    AC_MSG_RESULT([$groff_mm_works])
105576fae4e5dSmrgfi
105581f0ac6a5Smrg
105596fae4e5dSmrg# We have groff, test for HTML dependencies, one command per package
105606fae4e5dSmrgif test "x$have_groff" = x"yes"; then
105616fae4e5dSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
105626fae4e5dSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
105636fae4e5dSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
105646fae4e5dSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
105656fae4e5dSmrg      have_groff_html=yes
105666fae4e5dSmrg   else
105676fae4e5dSmrg      have_groff_html=no
105686fae4e5dSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
105696fae4e5dSmrg   fi
105706fae4e5dSmrgfi
105711f0ac6a5Smrg
105726fae4e5dSmrg# Set Automake conditionals for Makefiles
105736fae4e5dSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
105746fae4e5dSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
105756fae4e5dSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
105766fae4e5dSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
105776fae4e5dSmrg]) # XORG_WITH_GROFF
105789c9ff80cSmrg
105796fae4e5dSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
105806fae4e5dSmrg# ---------------------------------------
105816fae4e5dSmrg# Minimum version: 1.6.0
105826fae4e5dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
105836fae4e5dSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
105846fae4e5dSmrg#
105856fae4e5dSmrg# Documentation tools are not always available on all platforms and sometimes
105866fae4e5dSmrg# not at the appropriate level. This macro enables a module to test for the
105876fae4e5dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
105886fae4e5dSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
105896fae4e5dSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
105906fae4e5dSmrg# --with-fop assumes 'auto'.
105916fae4e5dSmrg#
105926fae4e5dSmrg# Interface to module:
105936fae4e5dSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
105946fae4e5dSmrg# FOP:	 	returns the path of the fop program found
105956fae4e5dSmrg#		returns the path set by the user in the environment
105966fae4e5dSmrg# --with-fop: 	'yes' user instructs the module to use fop
105976fae4e5dSmrg#		'no' user instructs the module not to use fop
105986fae4e5dSmrg#
105996fae4e5dSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
106006fae4e5dSmrg#
106016fae4e5dSmrgAC_DEFUN([XORG_WITH_FOP],[
106026fae4e5dSmrgAC_ARG_VAR([FOP], [Path to fop command])
106036fae4e5dSmrgm4_define([_defopt], m4_default([$2], [auto]))
106046fae4e5dSmrgAC_ARG_WITH(fop,
106056fae4e5dSmrg	AS_HELP_STRING([--with-fop],
106066fae4e5dSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
106076fae4e5dSmrg	   [use_fop=$withval], [use_fop=]_defopt)
106086fae4e5dSmrgm4_undefine([_defopt])
106099c9ff80cSmrg
106106fae4e5dSmrgif test "x$use_fop" = x"auto"; then
106116fae4e5dSmrg   AC_PATH_PROG([FOP], [fop])
106126fae4e5dSmrg   if test "x$FOP" = "x"; then
106136fae4e5dSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
106146fae4e5dSmrg	have_fop=no
106156fae4e5dSmrg   else
106166fae4e5dSmrg        have_fop=yes
106176fae4e5dSmrg   fi
106186fae4e5dSmrgelif test "x$use_fop" = x"yes" ; then
106196fae4e5dSmrg   AC_PATH_PROG([FOP], [fop])
106206fae4e5dSmrg   if test "x$FOP" = "x"; then
106216fae4e5dSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
106226fae4e5dSmrg   fi
106236fae4e5dSmrg   have_fop=yes
106246fae4e5dSmrgelif test "x$use_fop" = x"no" ; then
106256fae4e5dSmrg   if test "x$FOP" != "x"; then
106266fae4e5dSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
106276fae4e5dSmrg   fi
106286fae4e5dSmrg   have_fop=no
106296fae4e5dSmrgelse
106306fae4e5dSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
106316fae4e5dSmrgfi
106321f0ac6a5Smrg
106336fae4e5dSmrg# Test for a minimum version of fop, if provided.
106346fae4e5dSmrgm4_ifval([$1],
106356fae4e5dSmrg[if test "$have_fop" = yes; then
106366fae4e5dSmrg    # scrape the fop version
106376fae4e5dSmrg    AC_MSG_CHECKING([for fop minimum version])
106386fae4e5dSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
106396fae4e5dSmrg    AC_MSG_RESULT([$fop_version])
106406fae4e5dSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
106416fae4e5dSmrg        [if test "x$use_fop" = xauto; then
106426fae4e5dSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
106436fae4e5dSmrg            have_fop=no
106446fae4e5dSmrg        else
106456fae4e5dSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
106466fae4e5dSmrg        fi])
106476fae4e5dSmrgfi])
106486fae4e5dSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
106496fae4e5dSmrg]) # XORG_WITH_FOP
106501f0ac6a5Smrg
106516fae4e5dSmrg# XORG_WITH_PS2PDF([DEFAULT])
106526fae4e5dSmrg# ----------------
106536fae4e5dSmrg# Minimum version: 1.6.0
106546fae4e5dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
106556fae4e5dSmrg#
106566fae4e5dSmrg# Documentation tools are not always available on all platforms and sometimes
106576fae4e5dSmrg# not at the appropriate level. This macro enables a module to test for the
106586fae4e5dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
106596fae4e5dSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
106606fae4e5dSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
106616fae4e5dSmrg# --with-ps2pdf assumes 'auto'.
106626fae4e5dSmrg#
106636fae4e5dSmrg# Interface to module:
106646fae4e5dSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
106656fae4e5dSmrg# PS2PDF:	returns the path of the ps2pdf program found
106666fae4e5dSmrg#		returns the path set by the user in the environment
106676fae4e5dSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
106686fae4e5dSmrg#		 'no' user instructs the module not to use ps2pdf
106696fae4e5dSmrg#
106706fae4e5dSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
106716fae4e5dSmrg#
106726fae4e5dSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
106736fae4e5dSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
106746fae4e5dSmrgm4_define([_defopt], m4_default([$1], [auto]))
106756fae4e5dSmrgAC_ARG_WITH(ps2pdf,
106766fae4e5dSmrg	AS_HELP_STRING([--with-ps2pdf],
106776fae4e5dSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
106786fae4e5dSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
106796fae4e5dSmrgm4_undefine([_defopt])
106801f0ac6a5Smrg
106816fae4e5dSmrgif test "x$use_ps2pdf" = x"auto"; then
106826fae4e5dSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
106836fae4e5dSmrg   if test "x$PS2PDF" = "x"; then
106846fae4e5dSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
106856fae4e5dSmrg	have_ps2pdf=no
106866fae4e5dSmrg   else
106876fae4e5dSmrg        have_ps2pdf=yes
106886fae4e5dSmrg   fi
106896fae4e5dSmrgelif test "x$use_ps2pdf" = x"yes" ; then
106906fae4e5dSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
106916fae4e5dSmrg   if test "x$PS2PDF" = "x"; then
106926fae4e5dSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
106936fae4e5dSmrg   fi
106946fae4e5dSmrg   have_ps2pdf=yes
106956fae4e5dSmrgelif test "x$use_ps2pdf" = x"no" ; then
106966fae4e5dSmrg   if test "x$PS2PDF" != "x"; then
106976fae4e5dSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
106986fae4e5dSmrg   fi
106996fae4e5dSmrg   have_ps2pdf=no
107006fae4e5dSmrgelse
107016fae4e5dSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
107026fae4e5dSmrgfi
107036fae4e5dSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
107046fae4e5dSmrg]) # XORG_WITH_PS2PDF
10705e5410a46Smrg
107066fae4e5dSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
107076fae4e5dSmrg# ----------------
107086fae4e5dSmrg# Minimum version: 1.6.0
107096fae4e5dSmrg#
107106fae4e5dSmrg# Documentation tools are not always available on all platforms and sometimes
107116fae4e5dSmrg# not at the appropriate level. This macro enables a builder to skip all
107126fae4e5dSmrg# documentation targets except traditional man pages.
107136fae4e5dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
107146fae4e5dSmrg# maximum flexibilty in controlling documentation building.
107156fae4e5dSmrg# Refer to:
107166fae4e5dSmrg# XORG_WITH_XMLTO         --with-xmlto
107176fae4e5dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
107186fae4e5dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
107196fae4e5dSmrg# XORG_WITH_FOP           --with-fop
107206fae4e5dSmrg# XORG_WITH_GROFF         --with-groff
107216fae4e5dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
107226fae4e5dSmrg#
107236fae4e5dSmrg# Interface to module:
107246fae4e5dSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
107256fae4e5dSmrg# --enable-docs: 'yes' user instructs the module to generate docs
107266fae4e5dSmrg#		 'no' user instructs the module not to generate docs
107276fae4e5dSmrg# parm1:	specify the default value, yes or no.
107286fae4e5dSmrg#
107296fae4e5dSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
107306fae4e5dSmrgm4_define([docs_default], m4_default([$1], [yes]))
107316fae4e5dSmrgAC_ARG_ENABLE(docs,
107326fae4e5dSmrg	AS_HELP_STRING([--enable-docs],
107336fae4e5dSmrg	   [Enable building the documentation (default: ]docs_default[)]),
107346fae4e5dSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
107356fae4e5dSmrgm4_undefine([docs_default])
107366fae4e5dSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
107376fae4e5dSmrgAC_MSG_CHECKING([whether to build documentation])
107386fae4e5dSmrgAC_MSG_RESULT([$build_docs])
107396fae4e5dSmrg]) # XORG_ENABLE_DOCS
10740e5410a46Smrg
107416fae4e5dSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
107426fae4e5dSmrg# ----------------
107436fae4e5dSmrg# Minimum version: 1.6.0
107446fae4e5dSmrg#
107456fae4e5dSmrg# This macro enables a builder to skip all developer documentation.
107466fae4e5dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
107476fae4e5dSmrg# maximum flexibilty in controlling documentation building.
107486fae4e5dSmrg# Refer to:
107496fae4e5dSmrg# XORG_WITH_XMLTO         --with-xmlto
107506fae4e5dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
107516fae4e5dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
107526fae4e5dSmrg# XORG_WITH_FOP           --with-fop
107536fae4e5dSmrg# XORG_WITH_GROFF         --with-groff
107546fae4e5dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
107556fae4e5dSmrg#
107566fae4e5dSmrg# Interface to module:
107576fae4e5dSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
107586fae4e5dSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
107596fae4e5dSmrg#			'no' user instructs the module not to generate developer docs
107606fae4e5dSmrg# parm1:		specify the default value, yes or no.
107616fae4e5dSmrg#
107626fae4e5dSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
107636fae4e5dSmrgm4_define([devel_default], m4_default([$1], [yes]))
107646fae4e5dSmrgAC_ARG_ENABLE(devel-docs,
107656fae4e5dSmrg	AS_HELP_STRING([--enable-devel-docs],
107666fae4e5dSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
107676fae4e5dSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
107686fae4e5dSmrgm4_undefine([devel_default])
107696fae4e5dSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
107706fae4e5dSmrgAC_MSG_CHECKING([whether to build developer documentation])
107716fae4e5dSmrgAC_MSG_RESULT([$build_devel_docs])
107726fae4e5dSmrg]) # XORG_ENABLE_DEVEL_DOCS
10773e5410a46Smrg
107746fae4e5dSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
107756fae4e5dSmrg# ----------------
107766fae4e5dSmrg# Minimum version: 1.6.0
107776fae4e5dSmrg#
107786fae4e5dSmrg# This macro enables a builder to skip all functional specification targets.
107796fae4e5dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
107806fae4e5dSmrg# maximum flexibilty in controlling documentation building.
107816fae4e5dSmrg# Refer to:
107826fae4e5dSmrg# XORG_WITH_XMLTO         --with-xmlto
107836fae4e5dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
107846fae4e5dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
107856fae4e5dSmrg# XORG_WITH_FOP           --with-fop
107866fae4e5dSmrg# XORG_WITH_GROFF         --with-groff
107876fae4e5dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
107886fae4e5dSmrg#
107896fae4e5dSmrg# Interface to module:
107906fae4e5dSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
107916fae4e5dSmrg# --enable-specs:	'yes' user instructs the module to generate specs
107926fae4e5dSmrg#			'no' user instructs the module not to generate specs
107936fae4e5dSmrg# parm1:		specify the default value, yes or no.
107946fae4e5dSmrg#
107956fae4e5dSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
107966fae4e5dSmrgm4_define([spec_default], m4_default([$1], [yes]))
107976fae4e5dSmrgAC_ARG_ENABLE(specs,
107986fae4e5dSmrg	AS_HELP_STRING([--enable-specs],
107996fae4e5dSmrg	   [Enable building the specs (default: ]spec_default[)]),
108006fae4e5dSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
108016fae4e5dSmrgm4_undefine([spec_default])
108026fae4e5dSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
108036fae4e5dSmrgAC_MSG_CHECKING([whether to build functional specifications])
108046fae4e5dSmrgAC_MSG_RESULT([$build_specs])
108056fae4e5dSmrg]) # XORG_ENABLE_SPECS
10806e5410a46Smrg
108076fae4e5dSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
108086fae4e5dSmrg# ----------------------------------------------
108096fae4e5dSmrg# Minimum version: 1.13.0
108106fae4e5dSmrg#
108116fae4e5dSmrg# This macro enables a builder to enable/disable unit testing
108126fae4e5dSmrg# It makes no assumption about the test cases implementation
108136fae4e5dSmrg# Test cases may or may not use Automake "Support for test suites"
108146fae4e5dSmrg# They may or may not use the software utility library GLib
108156fae4e5dSmrg#
108166fae4e5dSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
108176fae4e5dSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
108186fae4e5dSmrg# The variable enable_unit_tests is used by other macros in this file.
108196fae4e5dSmrg#
108206fae4e5dSmrg# Interface to module:
108216fae4e5dSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
108226fae4e5dSmrg# enable_unit_tests:    used in configure.ac for additional configuration
108236fae4e5dSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
108246fae4e5dSmrg#			'no' user instructs the module not to build tests
108256fae4e5dSmrg# parm1:		specify the default value, yes or no.
108266fae4e5dSmrg#
108276fae4e5dSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
108286fae4e5dSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
108296fae4e5dSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
108306fae4e5dSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
108316fae4e5dSmrgm4_define([_defopt], m4_default([$1], [auto]))
108326fae4e5dSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
108336fae4e5dSmrg	[Enable building unit test cases (default: ]_defopt[)]),
108346fae4e5dSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
108356fae4e5dSmrgm4_undefine([_defopt])
108366fae4e5dSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
108376fae4e5dSmrgAC_MSG_CHECKING([whether to build unit test cases])
108386fae4e5dSmrgAC_MSG_RESULT([$enable_unit_tests])
108396fae4e5dSmrg]) # XORG_ENABLE_UNIT_TESTS
108406fae4e5dSmrg
1084189c04b6cSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1084289c04b6cSmrg# ------------------------------------------------------
1084389c04b6cSmrg# Minimum version: 1.17.0
1084489c04b6cSmrg#
1084589c04b6cSmrg# This macro enables a builder to enable/disable integration testing
1084689c04b6cSmrg# It makes no assumption about the test cases' implementation
1084789c04b6cSmrg# Test cases may or may not use Automake "Support for test suites"
1084889c04b6cSmrg#
1084989c04b6cSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1085089c04b6cSmrg# usually requires less dependencies and may be built and run under less
1085189c04b6cSmrg# stringent environments than integration tests.
1085289c04b6cSmrg#
1085389c04b6cSmrg# Interface to module:
1085489c04b6cSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
1085589c04b6cSmrg# enable_integration_tests:   used in configure.ac for additional configuration
1085689c04b6cSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
1085789c04b6cSmrg#                             'no' user instructs the module not to build tests
1085889c04b6cSmrg# parm1:                      specify the default value, yes or no.
1085989c04b6cSmrg#
1086089c04b6cSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1086189c04b6cSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1086289c04b6cSmrgm4_define([_defopt], m4_default([$1], [auto]))
1086389c04b6cSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1086489c04b6cSmrg	[Enable building integration test cases (default: ]_defopt[)]),
1086589c04b6cSmrg	[enable_integration_tests=$enableval],
1086689c04b6cSmrg	[enable_integration_tests=]_defopt)
1086789c04b6cSmrgm4_undefine([_defopt])
1086889c04b6cSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1086989c04b6cSmrg	[test "x$enable_integration_tests" != xno])
1087089c04b6cSmrgAC_MSG_CHECKING([whether to build unit test cases])
1087189c04b6cSmrgAC_MSG_RESULT([$enable_integration_tests])
1087289c04b6cSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
1087389c04b6cSmrg
108746fae4e5dSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
108756fae4e5dSmrg# ----------------------------------------
108766fae4e5dSmrg# Minimum version: 1.13.0
108776fae4e5dSmrg#
108786fae4e5dSmrg# GLib is a library which provides advanced data structures and functions.
108796fae4e5dSmrg# This macro enables a module to test for the presence of Glib.
108806fae4e5dSmrg#
108816fae4e5dSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
108826fae4e5dSmrg# Otherwise the value of $enable_unit_tests is blank.
108836fae4e5dSmrg#
1088489c04b6cSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1088589c04b6cSmrg# test support usually requires less dependencies and may be built and run under
1088689c04b6cSmrg# less stringent environments than integration tests.
1088789c04b6cSmrg#
108886fae4e5dSmrg# Interface to module:
108896fae4e5dSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
108906fae4e5dSmrg# with_glib: used in configure.ac to know if GLib has been found
108916fae4e5dSmrg# --with-glib:	'yes' user instructs the module to use glib
108926fae4e5dSmrg#		'no' user instructs the module not to use glib
108936fae4e5dSmrg#
108946fae4e5dSmrgAC_DEFUN([XORG_WITH_GLIB],[
108956fae4e5dSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
108966fae4e5dSmrgm4_define([_defopt], m4_default([$2], [auto]))
108976fae4e5dSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
108986fae4e5dSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
108996fae4e5dSmrg	[with_glib=$withval], [with_glib=]_defopt)
109006fae4e5dSmrgm4_undefine([_defopt])
109016fae4e5dSmrg
109026fae4e5dSmrghave_glib=no
109036fae4e5dSmrg# Do not probe GLib if user explicitly disabled unit testing
109046fae4e5dSmrgif test "x$enable_unit_tests" != x"no"; then
109056fae4e5dSmrg  # Do not probe GLib if user explicitly disabled it
109066fae4e5dSmrg  if test "x$with_glib" != x"no"; then
109076fae4e5dSmrg    m4_ifval(
109086fae4e5dSmrg      [$1],
109096fae4e5dSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
109106fae4e5dSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
109116fae4e5dSmrg    )
109126fae4e5dSmrg  fi
109136fae4e5dSmrgfi
109149c9ff80cSmrg
109156fae4e5dSmrg# Not having GLib when unit testing has been explicitly requested is an error
109166fae4e5dSmrgif test "x$enable_unit_tests" = x"yes"; then
109176fae4e5dSmrg  if test "x$have_glib" = x"no"; then
109186fae4e5dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
109196fae4e5dSmrg  fi
109206fae4e5dSmrgfi
109219c9ff80cSmrg
109226fae4e5dSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
109236fae4e5dSmrgif test "x$enable_unit_tests" = x"no"; then
109246fae4e5dSmrg  if test "x$with_glib" = x"yes"; then
109256fae4e5dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
109266fae4e5dSmrg  fi
109276fae4e5dSmrgfi
109281f0ac6a5Smrg
109296fae4e5dSmrg# Not having GLib when it has been explicitly requested is an error
109306fae4e5dSmrgif test "x$with_glib" = x"yes"; then
109316fae4e5dSmrg  if test "x$have_glib" = x"no"; then
109326fae4e5dSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
109336fae4e5dSmrg  fi
109346fae4e5dSmrgfi
109351f0ac6a5Smrg
109366fae4e5dSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
109376fae4e5dSmrg]) # XORG_WITH_GLIB
109381f0ac6a5Smrg
109396fae4e5dSmrg# XORG_LD_WRAP([required|optional])
109406fae4e5dSmrg# ---------------------------------
109416fae4e5dSmrg# Minimum version: 1.13.0
109426fae4e5dSmrg#
109436fae4e5dSmrg# Check if linker supports -wrap, passed via compiler flags
109446fae4e5dSmrg#
109456fae4e5dSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
109466fae4e5dSmrg# Otherwise the value of $enable_unit_tests is blank.
109476fae4e5dSmrg#
109486fae4e5dSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
109496fae4e5dSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
109506fae4e5dSmrg# available, an argument of "optional" allows use when some unit tests require
109516fae4e5dSmrg# ld -wrap and others do not.
109526fae4e5dSmrg#
109536fae4e5dSmrgAC_DEFUN([XORG_LD_WRAP],[
109546fae4e5dSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
109556fae4e5dSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
109566fae4e5dSmrg                      void __wrap_exit(int status) { return; }],
109576fae4e5dSmrg                     [exit(0);])])
109586fae4e5dSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
109596fae4e5dSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
109606fae4e5dSmrg  if test "x$have_ld_wrap" = x"no"; then
109616fae4e5dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
109626fae4e5dSmrg  fi
109636fae4e5dSmrgfi
109646fae4e5dSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
109656fae4e5dSmrg#
109666fae4e5dSmrg]) # XORG_LD_WRAP
109679c9ff80cSmrg
109686fae4e5dSmrg# XORG_CHECK_LINKER_FLAGS
109696fae4e5dSmrg# -----------------------
109706fae4e5dSmrg# SYNOPSIS
109716fae4e5dSmrg#
109726fae4e5dSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
109736fae4e5dSmrg#
109746fae4e5dSmrg# DESCRIPTION
109756fae4e5dSmrg#
109766fae4e5dSmrg#   Check whether the given linker FLAGS work with the current language's
109776fae4e5dSmrg#   linker, or whether they give an error.
109786fae4e5dSmrg#
109796fae4e5dSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
109806fae4e5dSmrg#   success/failure.
109816fae4e5dSmrg#
109826fae4e5dSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
109836fae4e5dSmrg#
109846fae4e5dSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
109856fae4e5dSmrg#
109866fae4e5dSmrg# LICENSE
109876fae4e5dSmrg#
109886fae4e5dSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
109896fae4e5dSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
109906fae4e5dSmrg#   Copyright (c) 2009 Matteo Frigo
109916fae4e5dSmrg#
109926fae4e5dSmrg#   This program is free software: you can redistribute it and/or modify it
109936fae4e5dSmrg#   under the terms of the GNU General Public License as published by the
109946fae4e5dSmrg#   Free Software Foundation, either version 3 of the License, or (at your
109956fae4e5dSmrg#   option) any later version.
109966fae4e5dSmrg#
109976fae4e5dSmrg#   This program is distributed in the hope that it will be useful, but
109986fae4e5dSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
109996fae4e5dSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
110006fae4e5dSmrg#   Public License for more details.
110016fae4e5dSmrg#
110026fae4e5dSmrg#   You should have received a copy of the GNU General Public License along
110036fae4e5dSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
110046fae4e5dSmrg#
110056fae4e5dSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
110066fae4e5dSmrg#   gives unlimited permission to copy, distribute and modify the configure
110076fae4e5dSmrg#   scripts that are the output of Autoconf when processing the Macro. You
110086fae4e5dSmrg#   need not follow the terms of the GNU General Public License when using
110096fae4e5dSmrg#   or distributing such scripts, even though portions of the text of the
110106fae4e5dSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
110116fae4e5dSmrg#   all other use of the material that constitutes the Autoconf Macro.
110126fae4e5dSmrg#
110136fae4e5dSmrg#   This special exception to the GPL applies to versions of the Autoconf
110146fae4e5dSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
110156fae4e5dSmrg#   modified version of the Autoconf Macro, you may extend this special
110166fae4e5dSmrg#   exception to the GPL to apply to your modified version as well.#
110176fae4e5dSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
110186fae4e5dSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
110196fae4e5dSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
110206fae4e5dSmrgAS_LITERAL_IF([$1],
110216fae4e5dSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
110226fae4e5dSmrg      ax_save_FLAGS=$LDFLAGS
110236fae4e5dSmrg      LDFLAGS="$1"
110246fae4e5dSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
110256fae4e5dSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
110266fae4e5dSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
110276fae4e5dSmrg      LDFLAGS=$ax_save_FLAGS])],
110286fae4e5dSmrg  [ax_save_FLAGS=$LDFLAGS
110296fae4e5dSmrg   LDFLAGS="$1"
110306fae4e5dSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
110316fae4e5dSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
110326fae4e5dSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
110336fae4e5dSmrg   LDFLAGS=$ax_save_FLAGS])
110346fae4e5dSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
110356fae4e5dSmrgAC_MSG_RESULT($xorg_check_linker_flags)
110366fae4e5dSmrgif test "x$xorg_check_linker_flags" = xyes; then
110376fae4e5dSmrg	m4_default([$2], :)
110386fae4e5dSmrgelse
110396fae4e5dSmrg	m4_default([$3], :)
110406fae4e5dSmrgfi
110416fae4e5dSmrg]) # XORG_CHECK_LINKER_FLAGS
110429c9ff80cSmrg
110436fae4e5dSmrg# XORG_MEMORY_CHECK_FLAGS
110446fae4e5dSmrg# -----------------------
110456fae4e5dSmrg# Minimum version: 1.16.0
11046e5410a46Smrg#
110476fae4e5dSmrg# This macro attempts to find appropriate memory checking functionality
110486fae4e5dSmrg# for various platforms which unit testing code may use to catch various
110496fae4e5dSmrg# forms of memory allocation and access errors in testing.
11050e5410a46Smrg#
110516fae4e5dSmrg# Interface to module:
110526fae4e5dSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
110536fae4e5dSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
110546fae4e5dSmrg#
110556fae4e5dSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
110566fae4e5dSmrg#
110576fae4e5dSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
110581f0ac6a5Smrg
110596fae4e5dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
110606fae4e5dSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
110616fae4e5dSmrg           [Environment variables to enable memory checking in tests])
110621f0ac6a5Smrg
110636fae4e5dSmrg# Check for different types of support on different platforms
110646fae4e5dSmrgcase $host_os in
110656fae4e5dSmrg    solaris*)
110666fae4e5dSmrg        AC_CHECK_LIB([umem], [umem_alloc],
110676fae4e5dSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
110686fae4e5dSmrg        ;;
110696fae4e5dSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
110706fae4e5dSmrg        # both directly and inverted, so should not be 0 or 255.
110716fae4e5dSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
110726fae4e5dSmrg        ;;
110736fae4e5dSmrg    darwin*)
110746fae4e5dSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
110756fae4e5dSmrg        ;;
110766fae4e5dSmrg    *bsd*)
110776fae4e5dSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
110786fae4e5dSmrg        ;;
110796fae4e5dSmrgesac
110801f0ac6a5Smrg
110816fae4e5dSmrg# User supplied flags override default flags
110826fae4e5dSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
110836fae4e5dSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
110846fae4e5dSmrgfi
110859c9ff80cSmrg
110866fae4e5dSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
110876fae4e5dSmrg]) # XORG_WITH_LINT
110889c9ff80cSmrg
110896fae4e5dSmrg# XORG_CHECK_MALLOC_ZERO
110906fae4e5dSmrg# ----------------------
110916fae4e5dSmrg# Minimum version: 1.0.0
110926fae4e5dSmrg#
110936fae4e5dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
110946fae4e5dSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
110956fae4e5dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
110966fae4e5dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
110976fae4e5dSmrgAC_ARG_ENABLE(malloc0returnsnull,
110986fae4e5dSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
110996fae4e5dSmrg		       [malloc(0) returns NULL (default: auto)]),
111006fae4e5dSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
111016fae4e5dSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
111029c9ff80cSmrg
111036fae4e5dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
111046fae4e5dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
111056fae4e5dSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
111066fae4e5dSmrg#include <stdlib.h>
111076fae4e5dSmrg],[
111086fae4e5dSmrg    char *m0, *r0, *c0, *p;
111096fae4e5dSmrg    m0 = malloc(0);
111106fae4e5dSmrg    p = malloc(10);
111116fae4e5dSmrg    r0 = realloc(p,0);
111126fae4e5dSmrg    c0 = calloc(0,10);
111136fae4e5dSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
111146fae4e5dSmrg])],
111156fae4e5dSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
111166fae4e5dSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
111176fae4e5dSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
111186fae4e5dSmrgfi
111196fae4e5dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
111209c9ff80cSmrg
111216fae4e5dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
111226fae4e5dSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
111236fae4e5dSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
111246fae4e5dSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
111256fae4e5dSmrgelse
111266fae4e5dSmrg	MALLOC_ZERO_CFLAGS=""
111276fae4e5dSmrg	XMALLOC_ZERO_CFLAGS=""
111286fae4e5dSmrg	XTMALLOC_ZERO_CFLAGS=""
111296fae4e5dSmrgfi
111309c9ff80cSmrg
111316fae4e5dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
111326fae4e5dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
111336fae4e5dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
111346fae4e5dSmrg]) # XORG_CHECK_MALLOC_ZERO
111356fae4e5dSmrg
111366fae4e5dSmrg# XORG_WITH_LINT()
111376fae4e5dSmrg# ----------------
111386fae4e5dSmrg# Minimum version: 1.1.0
111399c9ff80cSmrg#
111406fae4e5dSmrg# This macro enables the use of a tool that flags some suspicious and
111416fae4e5dSmrg# non-portable constructs (likely to be bugs) in C language source code.
111426fae4e5dSmrg# It will attempt to locate the tool and use appropriate options.
111436fae4e5dSmrg# There are various lint type tools on different platforms.
111446fae4e5dSmrg#
111456fae4e5dSmrg# Interface to module:
111466fae4e5dSmrg# LINT:		returns the path to the tool found on the platform
111476fae4e5dSmrg#		or the value set to LINT on the configure cmd line
111486fae4e5dSmrg#		also an Automake conditional
111496fae4e5dSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
111506fae4e5dSmrg#
111516fae4e5dSmrg# --with-lint:	'yes' user instructs the module to use lint
111526fae4e5dSmrg#		'no' user instructs the module not to use lint (default)
111536fae4e5dSmrg#
111546fae4e5dSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
111556fae4e5dSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
111566fae4e5dSmrg#
111576fae4e5dSmrgAC_DEFUN([XORG_WITH_LINT],[
111589c9ff80cSmrg
111596fae4e5dSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
111606fae4e5dSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
111616fae4e5dSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
111626fae4e5dSmrg		[Use a lint-style source code checker (default: disabled)])],
111636fae4e5dSmrg		[use_lint=$withval], [use_lint=no])
111649c9ff80cSmrg
111656fae4e5dSmrg# Obtain platform specific info like program name and options
111666fae4e5dSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
111676fae4e5dSmrgcase $host_os in
111686fae4e5dSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
111696fae4e5dSmrg	lint_name=splint
111706fae4e5dSmrg	lint_options="-badflag"
111716fae4e5dSmrg	;;
111726fae4e5dSmrg  *freebsd* | *netbsd*)
111736fae4e5dSmrg	lint_name=lint
111746fae4e5dSmrg	lint_options="-u -b"
111756fae4e5dSmrg	;;
111766fae4e5dSmrg  *solaris*)
111776fae4e5dSmrg	lint_name=lint
111786fae4e5dSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
111796fae4e5dSmrg	;;
111806fae4e5dSmrgesac
111819c9ff80cSmrg
111826fae4e5dSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
111836fae4e5dSmrgif test "x$use_lint" = x"yes" ; then
111846fae4e5dSmrg   AC_PATH_PROG([LINT], [$lint_name])
111856fae4e5dSmrg   if test "x$LINT" = "x"; then
111866fae4e5dSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
111876fae4e5dSmrg   fi
111886fae4e5dSmrgelif test "x$use_lint" = x"no" ; then
111896fae4e5dSmrg   if test "x$LINT" != "x"; then
111906fae4e5dSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
111916fae4e5dSmrg   fi
111926fae4e5dSmrgelse
111936fae4e5dSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
111946fae4e5dSmrgfi
111959c9ff80cSmrg
111966fae4e5dSmrg# User supplied flags override default flags
111976fae4e5dSmrgif test "x$LINT_FLAGS" != "x"; then
111986fae4e5dSmrg   lint_options=$LINT_FLAGS
111996fae4e5dSmrgfi
112009c9ff80cSmrg
112016fae4e5dSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
112026fae4e5dSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
112036fae4e5dSmrg
112046fae4e5dSmrg]) # XORG_WITH_LINT
112056fae4e5dSmrg
112066fae4e5dSmrg# XORG_LINT_LIBRARY(LIBNAME)
112076fae4e5dSmrg# --------------------------
112086fae4e5dSmrg# Minimum version: 1.1.0
112096fae4e5dSmrg#
112106fae4e5dSmrg# Sets up flags for building lint libraries for checking programs that call
112116fae4e5dSmrg# functions in the library.
112126fae4e5dSmrg#
112136fae4e5dSmrg# Interface to module:
112146fae4e5dSmrg# LINTLIB		- Automake variable with the name of lint library file to make
112156fae4e5dSmrg# MAKE_LINT_LIB		- Automake conditional
112166fae4e5dSmrg#
112176fae4e5dSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
112186fae4e5dSmrg#			  - 'no' user instructs the module not to create a lint library (default)
112196fae4e5dSmrg
112206fae4e5dSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
112216fae4e5dSmrgAC_REQUIRE([XORG_WITH_LINT])
112226fae4e5dSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
112236fae4e5dSmrg	[Create lint library (default: disabled)])],
112246fae4e5dSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
112256fae4e5dSmrg
112266fae4e5dSmrgif test "x$make_lint_lib" = x"yes" ; then
112276fae4e5dSmrg   LINTLIB=llib-l$1.ln
112286fae4e5dSmrg   if test "x$LINT" = "x"; then
112296fae4e5dSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
112306fae4e5dSmrg   fi
112316fae4e5dSmrgelif test "x$make_lint_lib" != x"no" ; then
112326fae4e5dSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
112336fae4e5dSmrgfi
112349c9ff80cSmrg
112356fae4e5dSmrgAC_SUBST(LINTLIB)
112366fae4e5dSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
112379c9ff80cSmrg
112386fae4e5dSmrg]) # XORG_LINT_LIBRARY
112391f0ac6a5Smrg
112406fae4e5dSmrg# XORG_COMPILER_BRAND
112416fae4e5dSmrg# -------------------
112426fae4e5dSmrg# Minimum version: 1.14.0
112436fae4e5dSmrg#
112446fae4e5dSmrg# Checks for various brands of compilers and sets flags as appropriate:
112456fae4e5dSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
112466fae4e5dSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
112476fae4e5dSmrg#   clang compiler - sets CLANGCC to "yes"
112486fae4e5dSmrg#   Intel compiler - sets INTELCC to "yes"
112496fae4e5dSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
112506fae4e5dSmrg#
112516fae4e5dSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
112526fae4e5dSmrgAC_LANG_CASE(
112536fae4e5dSmrg	[C], [
112546fae4e5dSmrg		AC_REQUIRE([AC_PROG_CC_C99])
112556fae4e5dSmrg	],
112566fae4e5dSmrg	[C++], [
112576fae4e5dSmrg		AC_REQUIRE([AC_PROG_CXX])
112586fae4e5dSmrg	]
112596fae4e5dSmrg)
112606fae4e5dSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
112616fae4e5dSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
112626fae4e5dSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
112636fae4e5dSmrg]) # XORG_COMPILER_BRAND
11264e5410a46Smrg
112656fae4e5dSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
112666fae4e5dSmrg# ---------------
112676fae4e5dSmrg# Minimum version: 1.16.0
112686fae4e5dSmrg#
112696fae4e5dSmrg# Test if the compiler works when passed the given flag as a command line argument.
112706fae4e5dSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
112716fae4e5dSmrg# next flag in the list until there are no more options.
112726fae4e5dSmrg#
112736fae4e5dSmrg# Note that this does not guarantee that the compiler supports the flag as some
112746fae4e5dSmrg# compilers will simply ignore arguments that they do not understand, but we do
112756fae4e5dSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
112766fae4e5dSmrg# -Werror=unused-command-line-argument
112776fae4e5dSmrg#
112786fae4e5dSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
112796fae4e5dSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
112806fae4e5dSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
112816fae4e5dSmrg
112826fae4e5dSmrgAC_LANG_COMPILER_REQUIRE
112836fae4e5dSmrg
112846fae4e5dSmrgAC_LANG_CASE(
112856fae4e5dSmrg	[C], [
112866fae4e5dSmrg		AC_REQUIRE([AC_PROG_CC_C99])
112876fae4e5dSmrg		define([PREFIX], [C])
1128889c04b6cSmrg		define([CACHE_PREFIX], [cc])
1128989c04b6cSmrg		define([COMPILER], [$CC])
112906fae4e5dSmrg	],
112916fae4e5dSmrg	[C++], [
112926fae4e5dSmrg		define([PREFIX], [CXX])
1129389c04b6cSmrg		define([CACHE_PREFIX], [cxx])
1129489c04b6cSmrg		define([COMPILER], [$CXX])
112956fae4e5dSmrg	]
112966fae4e5dSmrg)
112971f0ac6a5Smrg
112986fae4e5dSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
112996fae4e5dSmrg
1130089c04b6cSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
113016fae4e5dSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1130289c04b6cSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1130389c04b6cSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
113046fae4e5dSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1130589c04b6cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1130689c04b6cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1130789c04b6cSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
113086fae4e5dSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
113096fae4e5dSmrgfi
113101f0ac6a5Smrg
1131189c04b6cSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1131289c04b6cSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
113136fae4e5dSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
113146fae4e5dSmrg	fi
113156fae4e5dSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1131689c04b6cSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1131789c04b6cSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
113186fae4e5dSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1131989c04b6cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1132089c04b6cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1132189c04b6cSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
113226fae4e5dSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
113236fae4e5dSmrgfi
113241f0ac6a5Smrg
113256fae4e5dSmrgfound="no"
113266fae4e5dSmrgm4_foreach([flag], m4_cdr($@), [
113276fae4e5dSmrg	if test $found = "no" ; then
113286fae4e5dSmrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
113296fae4e5dSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
113306fae4e5dSmrg		fi
113316fae4e5dSmrg
113326fae4e5dSmrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
113336fae4e5dSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
113346fae4e5dSmrg		fi
113356fae4e5dSmrg
113366fae4e5dSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
113376fae4e5dSmrg
113386fae4e5dSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1133989c04b6cSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1134089c04b6cSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1134189c04b6cSmrg		AC_CACHE_VAL($cacheid,
113426fae4e5dSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1134389c04b6cSmrg					     [eval $cacheid=yes],
1134489c04b6cSmrg					     [eval $cacheid=no])])
113456fae4e5dSmrg
113466fae4e5dSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
113476fae4e5dSmrg
1134889c04b6cSmrg		eval supported=\$$cacheid
113496fae4e5dSmrg		AC_MSG_RESULT([$supported])
113506fae4e5dSmrg		if test "$supported" = "yes" ; then
113516fae4e5dSmrg			$1="$$1 ]flag["
113526fae4e5dSmrg			found="yes"
113536fae4e5dSmrg		fi
113546fae4e5dSmrg	fi
113556fae4e5dSmrg])
113566fae4e5dSmrg]) # XORG_TESTSET_CFLAG
113571f0ac6a5Smrg
113586fae4e5dSmrg# XORG_COMPILER_FLAGS
113596fae4e5dSmrg# ---------------
113606fae4e5dSmrg# Minimum version: 1.16.0
113616fae4e5dSmrg#
113626fae4e5dSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
113636fae4e5dSmrg# arguments supported by the selected compiler which do NOT alter the generated
113646fae4e5dSmrg# code.  These arguments will cause the compiler to print various warnings
113656fae4e5dSmrg# during compilation AND turn a conservative set of warnings into errors.
113666fae4e5dSmrg#
113676fae4e5dSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
113686fae4e5dSmrg# future versions of util-macros as options are added to new compilers.
113696fae4e5dSmrg#
113706fae4e5dSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
113716fae4e5dSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
113726fae4e5dSmrg
113736fae4e5dSmrgAC_ARG_ENABLE(selective-werror,
113746fae4e5dSmrg              AS_HELP_STRING([--disable-selective-werror],
113756fae4e5dSmrg                             [Turn off selective compiler errors. (default: enabled)]),
113766fae4e5dSmrg              [SELECTIVE_WERROR=$enableval],
113776fae4e5dSmrg              [SELECTIVE_WERROR=yes])
113786fae4e5dSmrg
113796fae4e5dSmrgAC_LANG_CASE(
113806fae4e5dSmrg        [C], [
113816fae4e5dSmrg                define([PREFIX], [C])
113826fae4e5dSmrg        ],
113836fae4e5dSmrg        [C++], [
113846fae4e5dSmrg                define([PREFIX], [CXX])
113856fae4e5dSmrg        ]
113866fae4e5dSmrg)
113876fae4e5dSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
113886fae4e5dSmrgif test "x$SUNCC" = "xyes"; then
113896fae4e5dSmrg    [BASE_]PREFIX[FLAGS]="-v"
113906fae4e5dSmrgelse
113916fae4e5dSmrg    [BASE_]PREFIX[FLAGS]=""
113926fae4e5dSmrgfi
113931f0ac6a5Smrg
113946fae4e5dSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
113956fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
113966fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
113976fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
113986fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
113996fae4e5dSmrg
114006fae4e5dSmrgAC_LANG_CASE(
114016fae4e5dSmrg	[C], [
114026fae4e5dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
114036fae4e5dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
114046fae4e5dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
114056fae4e5dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
114066fae4e5dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
114076fae4e5dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
114086fae4e5dSmrg	]
114096fae4e5dSmrg)
114101f0ac6a5Smrg
114116fae4e5dSmrg# This chunk adds additional warnings that could catch undesired effects.
114126fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
114136fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
114146fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
114156fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
114166fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
114176fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
114186fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
114196fae4e5dSmrg
114206fae4e5dSmrg# These are currently disabled because they are noisy.  They will be enabled
114216fae4e5dSmrg# in the future once the codebase is sufficiently modernized to silence
114226fae4e5dSmrg# them.  For now, I don't want them to drown out the other warnings.
114236fae4e5dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
114246fae4e5dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
114256fae4e5dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
114266fae4e5dSmrg
114276fae4e5dSmrg# Turn some warnings into errors, so we don't accidently get successful builds
114286fae4e5dSmrg# when there are problems that should be fixed.
114296fae4e5dSmrg
114306fae4e5dSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
114316fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
114326fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
114336fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
114346fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
114356fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
114366fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
114376fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
114386fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
114396fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
114406fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
114416fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
114426fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
114436fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
114446fae4e5dSmrgelse
114456fae4e5dSmrgAC_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])
114466fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
114476fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
114486fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
114496fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
114506fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
114516fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
114526fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
114536fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
114546fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
114556fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
114566fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
114576fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
114586fae4e5dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
114596fae4e5dSmrgfi
114601f0ac6a5Smrg
114616fae4e5dSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
114626fae4e5dSmrg]) # XORG_COMPILER_FLAGS
114636fae4e5dSmrg
114646fae4e5dSmrg# XORG_CWARNFLAGS
114656fae4e5dSmrg# ---------------
114666fae4e5dSmrg# Minimum version: 1.2.0
114676fae4e5dSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
114689c9ff80cSmrg#
114696fae4e5dSmrg# Defines CWARNFLAGS to enable C compiler warnings.
114709c9ff80cSmrg#
114716fae4e5dSmrg# This function is deprecated because it defines -fno-strict-aliasing
114726fae4e5dSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
114736fae4e5dSmrg# is needed, then it should be added explicitly in the module when
114746fae4e5dSmrg# it is updated to use BASE_CFLAGS.
114756fae4e5dSmrg#
114766fae4e5dSmrgAC_DEFUN([XORG_CWARNFLAGS], [
114776fae4e5dSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
114786fae4e5dSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
114796fae4e5dSmrgAC_LANG_CASE(
114806fae4e5dSmrg	[C], [
114816fae4e5dSmrg		CWARNFLAGS="$BASE_CFLAGS"
114826fae4e5dSmrg		if  test "x$GCC" = xyes ; then
114836fae4e5dSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
114846fae4e5dSmrg		fi
114856fae4e5dSmrg		AC_SUBST(CWARNFLAGS)
114866fae4e5dSmrg	]
114876fae4e5dSmrg)
114886fae4e5dSmrg]) # XORG_CWARNFLAGS
114891f0ac6a5Smrg
114906fae4e5dSmrg# XORG_STRICT_OPTION
114916fae4e5dSmrg# -----------------------
114926fae4e5dSmrg# Minimum version: 1.3.0
114936fae4e5dSmrg#
114946fae4e5dSmrg# Add configure option to enable strict compilation flags, such as treating
114956fae4e5dSmrg# warnings as fatal errors.
114966fae4e5dSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
114976fae4e5dSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
114986fae4e5dSmrg#
114996fae4e5dSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
115006fae4e5dSmrg# when strict compilation is unconditionally desired.
115016fae4e5dSmrgAC_DEFUN([XORG_STRICT_OPTION], [
115026fae4e5dSmrgAC_REQUIRE([XORG_CWARNFLAGS])
115036fae4e5dSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
115041f0ac6a5Smrg
115056fae4e5dSmrgAC_ARG_ENABLE(strict-compilation,
115066fae4e5dSmrg			  AS_HELP_STRING([--enable-strict-compilation],
115076fae4e5dSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
115086fae4e5dSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
115091f0ac6a5Smrg
115106fae4e5dSmrgAC_LANG_CASE(
115116fae4e5dSmrg        [C], [
115126fae4e5dSmrg                define([PREFIX], [C])
115136fae4e5dSmrg        ],
115146fae4e5dSmrg        [C++], [
115156fae4e5dSmrg                define([PREFIX], [CXX])
115166fae4e5dSmrg        ]
115176fae4e5dSmrg)
115189c9ff80cSmrg
115196fae4e5dSmrg[STRICT_]PREFIX[FLAGS]=""
115206fae4e5dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
115216fae4e5dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
115229c9ff80cSmrg
115236fae4e5dSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
115246fae4e5dSmrg# activate it with -Werror, so we add it here explicitly.
115256fae4e5dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
115269c9ff80cSmrg
115276fae4e5dSmrgif test "x$STRICT_COMPILE" = "xyes"; then
115286fae4e5dSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
115296fae4e5dSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
115306fae4e5dSmrgfi
115316fae4e5dSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
115326fae4e5dSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
115336fae4e5dSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
115346fae4e5dSmrg]) # XORG_STRICT_OPTION
115359c9ff80cSmrg
115366fae4e5dSmrg# XORG_DEFAULT_OPTIONS
115376fae4e5dSmrg# --------------------
115386fae4e5dSmrg# Minimum version: 1.3.0
115399c9ff80cSmrg#
115406fae4e5dSmrg# Defines default options for X.Org modules.
115419c9ff80cSmrg#
115426fae4e5dSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
115436fae4e5dSmrgAC_REQUIRE([AC_PROG_INSTALL])
115446fae4e5dSmrgXORG_COMPILER_FLAGS
115456fae4e5dSmrgXORG_CWARNFLAGS
115466fae4e5dSmrgXORG_STRICT_OPTION
115476fae4e5dSmrgXORG_RELEASE_VERSION
115486fae4e5dSmrgXORG_CHANGELOG
115496fae4e5dSmrgXORG_INSTALL
115506fae4e5dSmrgXORG_MANPAGE_SECTIONS
115516fae4e5dSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
115526fae4e5dSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
115536fae4e5dSmrg]) # XORG_DEFAULT_OPTIONS
115546fae4e5dSmrg
115556fae4e5dSmrg# XORG_INSTALL()
115566fae4e5dSmrg# ----------------
115576fae4e5dSmrg# Minimum version: 1.4.0
115589c9ff80cSmrg#
115596fae4e5dSmrg# Defines the variable INSTALL_CMD as the command to copy
115606fae4e5dSmrg# INSTALL from $prefix/share/util-macros.
115619c9ff80cSmrg#
115626fae4e5dSmrgAC_DEFUN([XORG_INSTALL], [
115636fae4e5dSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
115646fae4e5dSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
115656fae4e5dSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
115666fae4e5dSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
115676fae4e5dSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
115686fae4e5dSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
115696fae4e5dSmrgAC_SUBST([INSTALL_CMD])
115706fae4e5dSmrg]) # XORG_INSTALL
115716fae4e5dSmrgdnl Copyright 2005 Red Hat, Inc
115726fae4e5dSmrgdnl
115736fae4e5dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
115746fae4e5dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
115756fae4e5dSmrgdnl the above copyright notice appear in all copies and that both that
115766fae4e5dSmrgdnl copyright notice and this permission notice appear in supporting
115776fae4e5dSmrgdnl documentation.
115786fae4e5dSmrgdnl
115796fae4e5dSmrgdnl The above copyright notice and this permission notice shall be included
115806fae4e5dSmrgdnl in all copies or substantial portions of the Software.
115816fae4e5dSmrgdnl
115826fae4e5dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
115836fae4e5dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
115846fae4e5dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
115856fae4e5dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
115866fae4e5dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
115876fae4e5dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
115886fae4e5dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
115896fae4e5dSmrgdnl
115906fae4e5dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
115916fae4e5dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
115926fae4e5dSmrgdnl other dealings in this Software without prior written authorization
115936fae4e5dSmrgdnl from the copyright holders.
115946fae4e5dSmrgdnl
115959c9ff80cSmrg
115966fae4e5dSmrg# XORG_RELEASE_VERSION
115976fae4e5dSmrg# --------------------
115986fae4e5dSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
115996fae4e5dSmrg 
116006fae4e5dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
116016fae4e5dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
116026fae4e5dSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
116036fae4e5dSmrg		[Major version of this package])
116046fae4e5dSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
116056fae4e5dSmrg	if test "x$PVM" = "x"; then
116066fae4e5dSmrg		PVM="0"
116076fae4e5dSmrg	fi
116086fae4e5dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
116096fae4e5dSmrg		[$PVM],
116106fae4e5dSmrg		[Minor version of this package])
116116fae4e5dSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
116126fae4e5dSmrg	if test "x$PVP" = "x"; then
116136fae4e5dSmrg		PVP="0"
116146fae4e5dSmrg	fi
116156fae4e5dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
116166fae4e5dSmrg		[$PVP],
116176fae4e5dSmrg		[Patch version of this package])
116186fae4e5dSmrg])
116199c9ff80cSmrg
116206fae4e5dSmrg# XORG_CHANGELOG()
116216fae4e5dSmrg# ----------------
116226fae4e5dSmrg# Minimum version: 1.2.0
116236fae4e5dSmrg#
116246fae4e5dSmrg# Defines the variable CHANGELOG_CMD as the command to generate
116256fae4e5dSmrg# ChangeLog from git.
116266fae4e5dSmrg#
116276fae4e5dSmrg#
116286fae4e5dSmrgAC_DEFUN([XORG_CHANGELOG], [
116296fae4e5dSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
116306fae4e5dSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
116316fae4e5dSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
116326fae4e5dSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
116336fae4e5dSmrgAC_SUBST([CHANGELOG_CMD])
116346fae4e5dSmrg]) # XORG_CHANGELOG
116351f0ac6a5Smrg
11636