aclocal.m4 revision e35d4d8e
1e35d4d8eSmrg# generated automatically by aclocal 1.11.2 -*- Autoconf -*-
232b578d3Smrg
332b578d3Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4e35d4d8eSmrg# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5e35d4d8eSmrg# Inc.
632b578d3Smrg# This file is free software; the Free Software Foundation
732b578d3Smrg# gives unlimited permission to copy and/or distribute it,
832b578d3Smrg# with or without modifications, as long as this notice is preserved.
932b578d3Smrg
1032b578d3Smrg# This program is distributed in the hope that it will be useful,
1132b578d3Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1232b578d3Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1332b578d3Smrg# PARTICULAR PURPOSE.
1432b578d3Smrg
152a51b5beSmrgm4_ifndef([AC_AUTOCONF_VERSION],
162a51b5beSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17e35d4d8eSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18e35d4d8eSmrg[m4_warning([this file was generated for autoconf 2.68.
192a51b5beSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
202a51b5beSmrgIf you have problems, you may need to regenerate the build system entirely.
212a51b5beSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2232b578d3Smrg
23e35d4d8eSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
24e35d4d8eSmrg# Foundation, Inc.
251b12faf6Smrg#
26e35d4d8eSmrg# This file is free software; the Free Software Foundation
27e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
28e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
2932b578d3Smrg
30e35d4d8eSmrg# serial 1
3132b578d3Smrg
32e35d4d8eSmrg# AM_AUTOMAKE_VERSION(VERSION)
33e35d4d8eSmrg# ----------------------------
34e35d4d8eSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
35e35d4d8eSmrg# generated from the m4 files accompanying Automake X.Y.
36e35d4d8eSmrg# (This private macro should not be called outside this file.)
37e35d4d8eSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
38e35d4d8eSmrg[am__api_version='1.11'
39e35d4d8eSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
40e35d4d8eSmrgdnl require some minimum version.  Point them to the right macro.
41e35d4d8eSmrgm4_if([$1], [1.11.2], [],
42e35d4d8eSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
43e35d4d8eSmrg])
4432b578d3Smrg
45e35d4d8eSmrg# _AM_AUTOCONF_VERSION(VERSION)
46e35d4d8eSmrg# -----------------------------
47e35d4d8eSmrg# aclocal traces this macro to find the Autoconf version.
48e35d4d8eSmrg# This is a private macro too.  Using m4_define simplifies
49e35d4d8eSmrg# the logic in aclocal, which can simply ignore this definition.
50e35d4d8eSmrgm4_define([_AM_AUTOCONF_VERSION], [])
5132b578d3Smrg
52e35d4d8eSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
53e35d4d8eSmrg# -------------------------------
54e35d4d8eSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
55e35d4d8eSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
56e35d4d8eSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
57e35d4d8eSmrg[AM_AUTOMAKE_VERSION([1.11.2])dnl
58e35d4d8eSmrgm4_ifndef([AC_AUTOCONF_VERSION],
59e35d4d8eSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
60e35d4d8eSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
6132b578d3Smrg
62e35d4d8eSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
631b12faf6Smrg
64e35d4d8eSmrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
65e35d4d8eSmrg#
66e35d4d8eSmrg# This file is free software; the Free Software Foundation
67e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
68e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
691b12faf6Smrg
70e35d4d8eSmrg# serial 1
711b12faf6Smrg
72e35d4d8eSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
73e35d4d8eSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
74e35d4d8eSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
75e35d4d8eSmrg#
76e35d4d8eSmrg# Of course, Automake must honor this variable whenever it calls a
77e35d4d8eSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
78e35d4d8eSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
79e35d4d8eSmrg# depending on how configure is run.  This is pretty annoying, since
80e35d4d8eSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
81e35d4d8eSmrg# source directory, any form will work fine, but in subdirectories a
82e35d4d8eSmrg# relative path needs to be adjusted first.
83e35d4d8eSmrg#
84e35d4d8eSmrg# $ac_aux_dir/missing
85e35d4d8eSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
86e35d4d8eSmrg# $top_srcdir/$ac_aux_dir/missing
87e35d4d8eSmrg#    fails if $ac_aux_dir is absolute,
88e35d4d8eSmrg#    fails when called from a subdirectory in a VPATH build with
89e35d4d8eSmrg#          a relative $ac_aux_dir
90e35d4d8eSmrg#
91e35d4d8eSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
92e35d4d8eSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
93e35d4d8eSmrg# harmless because $srcdir is `.', but things will broke when you
94e35d4d8eSmrg# start a VPATH build or use an absolute $srcdir.
95e35d4d8eSmrg#
96e35d4d8eSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
97e35d4d8eSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
98e35d4d8eSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
99e35d4d8eSmrg# and then we would define $MISSING as
100e35d4d8eSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
101e35d4d8eSmrg# This will work as long as MISSING is not called from configure, because
102e35d4d8eSmrg# unfortunately $(top_srcdir) has no meaning in configure.
103e35d4d8eSmrg# However there are other variables, like CC, which are often used in
104e35d4d8eSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
105e35d4d8eSmrg#
106e35d4d8eSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
107e35d4d8eSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
108e35d4d8eSmrg# configured tree to be moved without reconfiguration.
1091b12faf6Smrg
110e35d4d8eSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
111e35d4d8eSmrg[dnl Rely on autoconf to set up CDPATH properly.
112e35d4d8eSmrgAC_PREREQ([2.50])dnl
113e35d4d8eSmrg# expand $ac_aux_dir to an absolute path
114e35d4d8eSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
115e35d4d8eSmrg])
11632b578d3Smrg
117e35d4d8eSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11832b578d3Smrg
119e35d4d8eSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
120e35d4d8eSmrg# Free Software Foundation, Inc.
121e35d4d8eSmrg#
122e35d4d8eSmrg# This file is free software; the Free Software Foundation
123e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
124e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
12532b578d3Smrg
126e35d4d8eSmrg# serial 9
12732b578d3Smrg
128e35d4d8eSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
129e35d4d8eSmrg# -------------------------------------
130e35d4d8eSmrg# Define a conditional.
131e35d4d8eSmrgAC_DEFUN([AM_CONDITIONAL],
132e35d4d8eSmrg[AC_PREREQ(2.52)dnl
133e35d4d8eSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
134e35d4d8eSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
135e35d4d8eSmrgAC_SUBST([$1_TRUE])dnl
136e35d4d8eSmrgAC_SUBST([$1_FALSE])dnl
137e35d4d8eSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
138e35d4d8eSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
139e35d4d8eSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
140e35d4d8eSmrgif $2; then
141e35d4d8eSmrg  $1_TRUE=
142e35d4d8eSmrg  $1_FALSE='#'
143e35d4d8eSmrgelse
144e35d4d8eSmrg  $1_TRUE='#'
145e35d4d8eSmrg  $1_FALSE=
146e35d4d8eSmrgfi
147e35d4d8eSmrgAC_CONFIG_COMMANDS_PRE(
148e35d4d8eSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
149e35d4d8eSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
150e35d4d8eSmrgUsually this means the macro was only invoked conditionally.]])
151e35d4d8eSmrgfi])])
15232b578d3Smrg
153e35d4d8eSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
154e35d4d8eSmrg# 2010, 2011 Free Software Foundation, Inc.
155e35d4d8eSmrg#
156e35d4d8eSmrg# This file is free software; the Free Software Foundation
157e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
158e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
1591b12faf6Smrg
160e35d4d8eSmrg# serial 12
1611b12faf6Smrg
162e35d4d8eSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
163e35d4d8eSmrg# written in clear, in which case automake, when reading aclocal.m4,
164e35d4d8eSmrg# will think it sees a *use*, and therefore will trigger all it's
165e35d4d8eSmrg# C support machinery.  Also note that it means that autoscan, seeing
166e35d4d8eSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1671b12faf6Smrg
1681b12faf6Smrg
169e35d4d8eSmrg# _AM_DEPENDENCIES(NAME)
1701b12faf6Smrg# ----------------------
171e35d4d8eSmrg# See how the compiler implements dependency checking.
172e35d4d8eSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
173e35d4d8eSmrg# We try a few techniques and use that to set a single cache variable.
174e35d4d8eSmrg#
175e35d4d8eSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
176e35d4d8eSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
177e35d4d8eSmrg# dependency, and given that the user is not expected to run this macro,
178e35d4d8eSmrg# just rely on AC_PROG_CC.
179e35d4d8eSmrgAC_DEFUN([_AM_DEPENDENCIES],
180e35d4d8eSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
181e35d4d8eSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
182e35d4d8eSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
183e35d4d8eSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1841b12faf6Smrg
185e35d4d8eSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
186e35d4d8eSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
187e35d4d8eSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
188e35d4d8eSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
189e35d4d8eSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
190e35d4d8eSmrg                   [depcc="$$1"   am_compiler_list=])
1911b12faf6Smrg
192e35d4d8eSmrgAC_CACHE_CHECK([dependency style of $depcc],
193e35d4d8eSmrg               [am_cv_$1_dependencies_compiler_type],
194e35d4d8eSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
195e35d4d8eSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
196e35d4d8eSmrg  # making bogus files that we don't know about and never remove.  For
197e35d4d8eSmrg  # instance it was reported that on HP-UX the gcc test will end up
198e35d4d8eSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
199e35d4d8eSmrg  # in D'.
200e35d4d8eSmrg  rm -rf conftest.dir
201e35d4d8eSmrg  mkdir conftest.dir
202e35d4d8eSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
203e35d4d8eSmrg  # using a relative directory.
204e35d4d8eSmrg  cp "$am_depcomp" conftest.dir
205e35d4d8eSmrg  cd conftest.dir
206e35d4d8eSmrg  # We will build objects and dependencies in a subdirectory because
207e35d4d8eSmrg  # it helps to detect inapplicable dependency modes.  For instance
208e35d4d8eSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
209e35d4d8eSmrg  # side effect of compilation, but ICC will put the dependencies in
210e35d4d8eSmrg  # the current directory while Tru64 will put them in the object
211e35d4d8eSmrg  # directory.
212e35d4d8eSmrg  mkdir sub
21332b578d3Smrg
214e35d4d8eSmrg  am_cv_$1_dependencies_compiler_type=none
215e35d4d8eSmrg  if test "$am_compiler_list" = ""; then
216e35d4d8eSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2172a51b5beSmrg  fi
218e35d4d8eSmrg  am__universal=false
219e35d4d8eSmrg  m4_case([$1], [CC],
220e35d4d8eSmrg    [case " $depcc " in #(
221e35d4d8eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
222e35d4d8eSmrg     esac],
223e35d4d8eSmrg    [CXX],
224e35d4d8eSmrg    [case " $depcc " in #(
225e35d4d8eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
226e35d4d8eSmrg     esac])
22732b578d3Smrg
228e35d4d8eSmrg  for depmode in $am_compiler_list; do
229e35d4d8eSmrg    # Setup a source with many dependencies, because some compilers
230e35d4d8eSmrg    # like to wrap large dependency lists on column 80 (with \), and
231e35d4d8eSmrg    # we should not choose a depcomp mode which is confused by this.
232e35d4d8eSmrg    #
233e35d4d8eSmrg    # We need to recreate these files for each test, as the compiler may
234e35d4d8eSmrg    # overwrite some of them when testing with obscure command lines.
235e35d4d8eSmrg    # This happens at least with the AIX C compiler.
236e35d4d8eSmrg    : > sub/conftest.c
237e35d4d8eSmrg    for i in 1 2 3 4 5 6; do
238e35d4d8eSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
239e35d4d8eSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
240e35d4d8eSmrg      # Solaris 8's {/usr,}/bin/sh.
241e35d4d8eSmrg      touch sub/conftst$i.h
242e35d4d8eSmrg    done
243e35d4d8eSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
24432b578d3Smrg
245e35d4d8eSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
246e35d4d8eSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
247e35d4d8eSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
248e35d4d8eSmrg    # versions had trouble with output in subdirs
249e35d4d8eSmrg    am__obj=sub/conftest.${OBJEXT-o}
250e35d4d8eSmrg    am__minus_obj="-o $am__obj"
251e35d4d8eSmrg    case $depmode in
252e35d4d8eSmrg    gcc)
253e35d4d8eSmrg      # This depmode causes a compiler race in universal mode.
254e35d4d8eSmrg      test "$am__universal" = false || continue
255e35d4d8eSmrg      ;;
256e35d4d8eSmrg    nosideeffect)
257e35d4d8eSmrg      # after this tag, mechanisms are not by side-effect, so they'll
258e35d4d8eSmrg      # only be used when explicitly requested
259e35d4d8eSmrg      if test "x$enable_dependency_tracking" = xyes; then
260e35d4d8eSmrg	continue
261e35d4d8eSmrg      else
262e35d4d8eSmrg	break
263e35d4d8eSmrg      fi
264e35d4d8eSmrg      ;;
265e35d4d8eSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
266e35d4d8eSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
267e35d4d8eSmrg      # not run yet.  These depmodes are late enough in the game, and
268e35d4d8eSmrg      # so weak that their functioning should not be impacted.
269e35d4d8eSmrg      am__obj=conftest.${OBJEXT-o}
270e35d4d8eSmrg      am__minus_obj=
271e35d4d8eSmrg      ;;
272e35d4d8eSmrg    none) break ;;
273e35d4d8eSmrg    esac
274e35d4d8eSmrg    if depmode=$depmode \
275e35d4d8eSmrg       source=sub/conftest.c object=$am__obj \
276e35d4d8eSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
277e35d4d8eSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
278e35d4d8eSmrg         >/dev/null 2>conftest.err &&
279e35d4d8eSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
280e35d4d8eSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
281e35d4d8eSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
282e35d4d8eSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
283e35d4d8eSmrg      # icc doesn't choke on unknown options, it will just issue warnings
284e35d4d8eSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
285e35d4d8eSmrg      # that says an option was ignored or not supported.
286e35d4d8eSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
287e35d4d8eSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
288e35d4d8eSmrg      # The diagnosis changed in icc 8.0:
289e35d4d8eSmrg      #   icc: Command line remark: option '-MP' not supported
290e35d4d8eSmrg      if (grep 'ignoring option' conftest.err ||
291e35d4d8eSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
292e35d4d8eSmrg        am_cv_$1_dependencies_compiler_type=$depmode
293e35d4d8eSmrg        break
294e35d4d8eSmrg      fi
295e35d4d8eSmrg    fi
296e35d4d8eSmrg  done
29732b578d3Smrg
298e35d4d8eSmrg  cd ..
299e35d4d8eSmrg  rm -rf conftest.dir
300e35d4d8eSmrgelse
301e35d4d8eSmrg  am_cv_$1_dependencies_compiler_type=none
302e35d4d8eSmrgfi
303e35d4d8eSmrg])
304e35d4d8eSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
305e35d4d8eSmrgAM_CONDITIONAL([am__fastdep$1], [
306e35d4d8eSmrg  test "x$enable_dependency_tracking" != xno \
307e35d4d8eSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
308e35d4d8eSmrg])
30932b578d3Smrg
31032b578d3Smrg
311e35d4d8eSmrg# AM_SET_DEPDIR
312e35d4d8eSmrg# -------------
313e35d4d8eSmrg# Choose a directory name for dependency files.
314e35d4d8eSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
315e35d4d8eSmrgAC_DEFUN([AM_SET_DEPDIR],
316e35d4d8eSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
317e35d4d8eSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
318e35d4d8eSmrg])
31932b578d3Smrg
32032b578d3Smrg
321e35d4d8eSmrg# AM_DEP_TRACK
322e35d4d8eSmrg# ------------
323e35d4d8eSmrgAC_DEFUN([AM_DEP_TRACK],
324e35d4d8eSmrg[AC_ARG_ENABLE(dependency-tracking,
325e35d4d8eSmrg[  --disable-dependency-tracking  speeds up one-time build
326e35d4d8eSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
327e35d4d8eSmrgif test "x$enable_dependency_tracking" != xno; then
328e35d4d8eSmrg  am_depcomp="$ac_aux_dir/depcomp"
329e35d4d8eSmrg  AMDEPBACKSLASH='\'
330e35d4d8eSmrg  am__nodep='_no'
331e35d4d8eSmrgfi
332e35d4d8eSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
333e35d4d8eSmrgAC_SUBST([AMDEPBACKSLASH])dnl
334e35d4d8eSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
335e35d4d8eSmrgAC_SUBST([am__nodep])dnl
336e35d4d8eSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
337e35d4d8eSmrg])
33832b578d3Smrg
339e35d4d8eSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3401b12faf6Smrg
341e35d4d8eSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
342e35d4d8eSmrg# Free Software Foundation, Inc.
343e35d4d8eSmrg#
344e35d4d8eSmrg# This file is free software; the Free Software Foundation
345e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
346e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
3471b12faf6Smrg
348e35d4d8eSmrg#serial 5
3491b12faf6Smrg
350e35d4d8eSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3511b12faf6Smrg# ------------------------------
352e35d4d8eSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
353e35d4d8eSmrg[{
354e35d4d8eSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
355e35d4d8eSmrg  # are listed without --file.  Let's play safe and only enable the eval
356e35d4d8eSmrg  # if we detect the quoting.
357e35d4d8eSmrg  case $CONFIG_FILES in
358e35d4d8eSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
359e35d4d8eSmrg  *)   set x $CONFIG_FILES ;;
360e35d4d8eSmrg  esac
361e35d4d8eSmrg  shift
362e35d4d8eSmrg  for mf
363e35d4d8eSmrg  do
364e35d4d8eSmrg    # Strip MF so we end up with the name of the file.
365e35d4d8eSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
366e35d4d8eSmrg    # Check whether this is an Automake generated Makefile or not.
367e35d4d8eSmrg    # We used to match only the files named `Makefile.in', but
368e35d4d8eSmrg    # some people rename them; so instead we look at the file content.
369e35d4d8eSmrg    # Grep'ing the first line is not enough: some people post-process
370e35d4d8eSmrg    # each Makefile.in and add a new line on top of each file to say so.
371e35d4d8eSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
372e35d4d8eSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
373e35d4d8eSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
374e35d4d8eSmrg      dirpart=`AS_DIRNAME("$mf")`
375e35d4d8eSmrg    else
376e35d4d8eSmrg      continue
377e35d4d8eSmrg    fi
378e35d4d8eSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
379e35d4d8eSmrg    # from the Makefile without running `make'.
380e35d4d8eSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
381e35d4d8eSmrg    test -z "$DEPDIR" && continue
382e35d4d8eSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
383e35d4d8eSmrg    test -z "am__include" && continue
384e35d4d8eSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
385e35d4d8eSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
386e35d4d8eSmrg    U=`sed -n 's/^U = //p' < "$mf"`
387e35d4d8eSmrg    # Find all dependency output files, they are included files with
388e35d4d8eSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
389e35d4d8eSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
390e35d4d8eSmrg    # expansion.
391e35d4d8eSmrg    for file in `sed -n "
392e35d4d8eSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
393e35d4d8eSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
394e35d4d8eSmrg      # Make sure the directory exists.
395e35d4d8eSmrg      test -f "$dirpart/$file" && continue
396e35d4d8eSmrg      fdir=`AS_DIRNAME(["$file"])`
397e35d4d8eSmrg      AS_MKDIR_P([$dirpart/$fdir])
398e35d4d8eSmrg      # echo "creating $dirpart/$file"
399e35d4d8eSmrg      echo '# dummy' > "$dirpart/$file"
400e35d4d8eSmrg    done
401e35d4d8eSmrg  done
402e35d4d8eSmrg}
403e35d4d8eSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
4041b12faf6Smrg
4051b12faf6Smrg
406e35d4d8eSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
4071b12faf6Smrg# -----------------------------
408e35d4d8eSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
409e35d4d8eSmrg#
410e35d4d8eSmrg# This code is only required when automatic dependency tracking
411e35d4d8eSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
412e35d4d8eSmrg# need in order to bootstrap the dependency handling code.
413e35d4d8eSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
414e35d4d8eSmrg[AC_CONFIG_COMMANDS([depfiles],
415e35d4d8eSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
416e35d4d8eSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
417e35d4d8eSmrg])
4181b12faf6Smrg
419e35d4d8eSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4201b12faf6Smrg
421e35d4d8eSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
422e35d4d8eSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
423e35d4d8eSmrg#
424e35d4d8eSmrg# This file is free software; the Free Software Foundation
425e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
426e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
4271b12faf6Smrg
428e35d4d8eSmrg# serial 16
4291b12faf6Smrg
430e35d4d8eSmrg# This macro actually does too much.  Some checks are only needed if
431e35d4d8eSmrg# your package does certain things.  But this isn't really a big deal.
4321b12faf6Smrg
433e35d4d8eSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
434e35d4d8eSmrg# AM_INIT_AUTOMAKE([OPTIONS])
435e35d4d8eSmrg# -----------------------------------------------
436e35d4d8eSmrg# The call with PACKAGE and VERSION arguments is the old style
437e35d4d8eSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
438e35d4d8eSmrg# and VERSION should now be passed to AC_INIT and removed from
439e35d4d8eSmrg# the call to AM_INIT_AUTOMAKE.
440e35d4d8eSmrg# We support both call styles for the transition.  After
441e35d4d8eSmrg# the next Automake release, Autoconf can make the AC_INIT
442e35d4d8eSmrg# arguments mandatory, and then we can depend on a new Autoconf
443e35d4d8eSmrg# release and drop the old call support.
444e35d4d8eSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
445e35d4d8eSmrg[AC_PREREQ([2.62])dnl
446e35d4d8eSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
447e35d4d8eSmrgdnl the ones we care about.
448e35d4d8eSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
449e35d4d8eSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
450e35d4d8eSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
451e35d4d8eSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
452e35d4d8eSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
453e35d4d8eSmrg  # is not polluted with repeated "-I."
454e35d4d8eSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
455e35d4d8eSmrg  # test to see if srcdir already configured
456e35d4d8eSmrg  if test -f $srcdir/config.status; then
457e35d4d8eSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
458e35d4d8eSmrg  fi
459e35d4d8eSmrgfi
4601b12faf6Smrg
461e35d4d8eSmrg# test whether we have cygpath
462e35d4d8eSmrgif test -z "$CYGPATH_W"; then
463e35d4d8eSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
464e35d4d8eSmrg    CYGPATH_W='cygpath -w'
465e35d4d8eSmrg  else
466e35d4d8eSmrg    CYGPATH_W=echo
467e35d4d8eSmrg  fi
468e35d4d8eSmrgfi
469e35d4d8eSmrgAC_SUBST([CYGPATH_W])
4701b12faf6Smrg
471e35d4d8eSmrg# Define the identity of the package.
472e35d4d8eSmrgdnl Distinguish between old-style and new-style calls.
473e35d4d8eSmrgm4_ifval([$2],
474e35d4d8eSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
475e35d4d8eSmrg AC_SUBST([PACKAGE], [$1])dnl
476e35d4d8eSmrg AC_SUBST([VERSION], [$2])],
477e35d4d8eSmrg[_AM_SET_OPTIONS([$1])dnl
478e35d4d8eSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
479e35d4d8eSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
480e35d4d8eSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
481e35d4d8eSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
482e35d4d8eSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4831b12faf6Smrg
484e35d4d8eSmrg_AM_IF_OPTION([no-define],,
485e35d4d8eSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
486e35d4d8eSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4871b12faf6Smrg
488e35d4d8eSmrg# Some tools Automake needs.
489e35d4d8eSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
490e35d4d8eSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
491e35d4d8eSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
492e35d4d8eSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
493e35d4d8eSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
494e35d4d8eSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
495e35d4d8eSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
496e35d4d8eSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
497e35d4d8eSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
498e35d4d8eSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
499e35d4d8eSmrg# We need awk for the "check" target.  The system "awk" is bad on
500e35d4d8eSmrg# some platforms.
501e35d4d8eSmrgAC_REQUIRE([AC_PROG_AWK])dnl
502e35d4d8eSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
503e35d4d8eSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
504e35d4d8eSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
505e35d4d8eSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
506e35d4d8eSmrg			     [_AM_PROG_TAR([v7])])])
507e35d4d8eSmrg_AM_IF_OPTION([no-dependencies],,
508e35d4d8eSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
509e35d4d8eSmrg		  [_AM_DEPENDENCIES(CC)],
510e35d4d8eSmrg		  [define([AC_PROG_CC],
511e35d4d8eSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
512e35d4d8eSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
513e35d4d8eSmrg		  [_AM_DEPENDENCIES(CXX)],
514e35d4d8eSmrg		  [define([AC_PROG_CXX],
515e35d4d8eSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
516e35d4d8eSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
517e35d4d8eSmrg		  [_AM_DEPENDENCIES(OBJC)],
518e35d4d8eSmrg		  [define([AC_PROG_OBJC],
519e35d4d8eSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
520e35d4d8eSmrg])
521e35d4d8eSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
522e35d4d8eSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
523e35d4d8eSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
524e35d4d8eSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
525e35d4d8eSmrgAC_CONFIG_COMMANDS_PRE(dnl
526e35d4d8eSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
527e35d4d8eSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5281b12faf6Smrg])
5291b12faf6Smrg
530e35d4d8eSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
531e35d4d8eSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
532e35d4d8eSmrgdnl mangled by Autoconf and run in a shell conditional statement.
533e35d4d8eSmrgm4_define([_AC_COMPILER_EXEEXT],
534e35d4d8eSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5351b12faf6Smrg
5361b12faf6Smrg
537e35d4d8eSmrg# When config.status generates a header, we must update the stamp-h file.
538e35d4d8eSmrg# This file resides in the same directory as the config header
539e35d4d8eSmrg# that is generated.  The stamp files are numbered to have different names.
5401b12faf6Smrg
541e35d4d8eSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
542e35d4d8eSmrg# loop where config.status creates the headers, so we can generate
543e35d4d8eSmrg# our stamp files there.
544e35d4d8eSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
545e35d4d8eSmrg[# Compute $1's index in $config_headers.
546e35d4d8eSmrg_am_arg=$1
547e35d4d8eSmrg_am_stamp_count=1
548e35d4d8eSmrgfor _am_header in $config_headers :; do
549e35d4d8eSmrg  case $_am_header in
550e35d4d8eSmrg    $_am_arg | $_am_arg:* )
551e35d4d8eSmrg      break ;;
552e35d4d8eSmrg    * )
553e35d4d8eSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
554e35d4d8eSmrg  esac
555e35d4d8eSmrgdone
556e35d4d8eSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5571b12faf6Smrg
558e35d4d8eSmrg# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
559e35d4d8eSmrg# Inc.
560e35d4d8eSmrg#
561e35d4d8eSmrg# This file is free software; the Free Software Foundation
562e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
563e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
5641b12faf6Smrg
565e35d4d8eSmrg# serial 1
5661b12faf6Smrg
567e35d4d8eSmrg# AM_PROG_INSTALL_SH
568e35d4d8eSmrg# ------------------
569e35d4d8eSmrg# Define $install_sh.
570e35d4d8eSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
571e35d4d8eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
572e35d4d8eSmrgif test x"${install_sh}" != xset; then
573e35d4d8eSmrg  case $am_aux_dir in
574e35d4d8eSmrg  *\ * | *\	*)
575e35d4d8eSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
576e35d4d8eSmrg  *)
577e35d4d8eSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
578e35d4d8eSmrg  esac
579e35d4d8eSmrgfi
580e35d4d8eSmrgAC_SUBST(install_sh)])
5811b12faf6Smrg
582e35d4d8eSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5831b12faf6Smrg#
584e35d4d8eSmrg# This file is free software; the Free Software Foundation
585e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
586e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
5871b12faf6Smrg
588e35d4d8eSmrg# serial 2
5891b12faf6Smrg
590e35d4d8eSmrg# Check whether the underlying file-system supports filenames
591e35d4d8eSmrg# with a leading dot.  For instance MS-DOS doesn't.
592e35d4d8eSmrgAC_DEFUN([AM_SET_LEADING_DOT],
593e35d4d8eSmrg[rm -rf .tst 2>/dev/null
594e35d4d8eSmrgmkdir .tst 2>/dev/null
595e35d4d8eSmrgif test -d .tst; then
596e35d4d8eSmrg  am__leading_dot=.
597e35d4d8eSmrgelse
598e35d4d8eSmrg  am__leading_dot=_
599e35d4d8eSmrgfi
600e35d4d8eSmrgrmdir .tst 2>/dev/null
601e35d4d8eSmrgAC_SUBST([am__leading_dot])])
6021b12faf6Smrg
603e35d4d8eSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
604e35d4d8eSmrg# From Jim Meyering
6051b12faf6Smrg
606e35d4d8eSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
607e35d4d8eSmrg# 2011 Free Software Foundation, Inc.
6081b12faf6Smrg#
609e35d4d8eSmrg# This file is free software; the Free Software Foundation
610e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
611e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
6121b12faf6Smrg
613e35d4d8eSmrg# serial 5
6141b12faf6Smrg
615e35d4d8eSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
616e35d4d8eSmrg# ----------------------------------
617e35d4d8eSmrg# Control maintainer-specific portions of Makefiles.
618e35d4d8eSmrg# Default is to disable them, unless `enable' is passed literally.
619e35d4d8eSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
620e35d4d8eSmrg# can override the default with the --enable/--disable switch.
621e35d4d8eSmrgAC_DEFUN([AM_MAINTAINER_MODE],
622e35d4d8eSmrg[m4_case(m4_default([$1], [disable]),
623e35d4d8eSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
624e35d4d8eSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
625e35d4d8eSmrg       [m4_define([am_maintainer_other], [enable])
626e35d4d8eSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
627e35d4d8eSmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
628e35d4d8eSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
629e35d4d8eSmrg  AC_ARG_ENABLE([maintainer-mode],
630e35d4d8eSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
631e35d4d8eSmrg			  (and sometimes confusing) to the casual installer],
632e35d4d8eSmrg      [USE_MAINTAINER_MODE=$enableval],
633e35d4d8eSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
634e35d4d8eSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
635e35d4d8eSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
636e35d4d8eSmrg  MAINT=$MAINTAINER_MODE_TRUE
637e35d4d8eSmrg  AC_SUBST([MAINT])dnl
638e35d4d8eSmrg]
639e35d4d8eSmrg)
6401b12faf6Smrg
641e35d4d8eSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6421b12faf6Smrg
643e35d4d8eSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
64432b578d3Smrg
645e35d4d8eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
646e35d4d8eSmrg#
647e35d4d8eSmrg# This file is free software; the Free Software Foundation
648e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
649e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
65032b578d3Smrg
651e35d4d8eSmrg# serial 4
6521b12faf6Smrg
653e35d4d8eSmrg# AM_MAKE_INCLUDE()
654e35d4d8eSmrg# -----------------
655e35d4d8eSmrg# Check to see how make treats includes.
656e35d4d8eSmrgAC_DEFUN([AM_MAKE_INCLUDE],
657e35d4d8eSmrg[am_make=${MAKE-make}
658e35d4d8eSmrgcat > confinc << 'END'
659e35d4d8eSmrgam__doit:
660e35d4d8eSmrg	@echo this is the am__doit target
661e35d4d8eSmrg.PHONY: am__doit
662e35d4d8eSmrgEND
663e35d4d8eSmrg# If we don't find an include directive, just comment out the code.
664e35d4d8eSmrgAC_MSG_CHECKING([for style of include used by $am_make])
665e35d4d8eSmrgam__include="#"
666e35d4d8eSmrgam__quote=
667e35d4d8eSmrg_am_result=none
668e35d4d8eSmrg# First try GNU make style include.
669e35d4d8eSmrgecho "include confinc" > confmf
670e35d4d8eSmrg# Ignore all kinds of additional output from `make'.
671e35d4d8eSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
672e35d4d8eSmrg*the\ am__doit\ target*)
673e35d4d8eSmrg  am__include=include
674e35d4d8eSmrg  am__quote=
675e35d4d8eSmrg  _am_result=GNU
676e35d4d8eSmrg  ;;
677e35d4d8eSmrgesac
678e35d4d8eSmrg# Now try BSD make style include.
679e35d4d8eSmrgif test "$am__include" = "#"; then
680e35d4d8eSmrg   echo '.include "confinc"' > confmf
681e35d4d8eSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
682e35d4d8eSmrg   *the\ am__doit\ target*)
683e35d4d8eSmrg     am__include=.include
684e35d4d8eSmrg     am__quote="\""
685e35d4d8eSmrg     _am_result=BSD
686e35d4d8eSmrg     ;;
687e35d4d8eSmrg   esac
688e35d4d8eSmrgfi
689e35d4d8eSmrgAC_SUBST([am__include])
690e35d4d8eSmrgAC_SUBST([am__quote])
691e35d4d8eSmrgAC_MSG_RESULT([$_am_result])
692e35d4d8eSmrgrm -f confinc confmf
693e35d4d8eSmrg])
6941b12faf6Smrg
695e35d4d8eSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6961b12faf6Smrg
697e35d4d8eSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
698e35d4d8eSmrg# Free Software Foundation, Inc.
699e35d4d8eSmrg#
700e35d4d8eSmrg# This file is free software; the Free Software Foundation
701e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
702e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
7031b12faf6Smrg
704e35d4d8eSmrg# serial 6
7051b12faf6Smrg
706e35d4d8eSmrg# AM_MISSING_PROG(NAME, PROGRAM)
707e35d4d8eSmrg# ------------------------------
708e35d4d8eSmrgAC_DEFUN([AM_MISSING_PROG],
709e35d4d8eSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
710e35d4d8eSmrg$1=${$1-"${am_missing_run}$2"}
711e35d4d8eSmrgAC_SUBST($1)])
7121b12faf6Smrg
7131b12faf6Smrg
714e35d4d8eSmrg# AM_MISSING_HAS_RUN
715e35d4d8eSmrg# ------------------
716e35d4d8eSmrg# Define MISSING if not defined so far and test if it supports --run.
717e35d4d8eSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
718e35d4d8eSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
719e35d4d8eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
720e35d4d8eSmrgAC_REQUIRE_AUX_FILE([missing])dnl
721e35d4d8eSmrgif test x"${MISSING+set}" != xset; then
722e35d4d8eSmrg  case $am_aux_dir in
723e35d4d8eSmrg  *\ * | *\	*)
724e35d4d8eSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
725e35d4d8eSmrg  *)
726e35d4d8eSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
727e35d4d8eSmrg  esac
728e35d4d8eSmrgfi
729e35d4d8eSmrg# Use eval to expand $SHELL
730e35d4d8eSmrgif eval "$MISSING --run true"; then
731e35d4d8eSmrg  am_missing_run="$MISSING --run "
732e35d4d8eSmrgelse
733e35d4d8eSmrg  am_missing_run=
734e35d4d8eSmrg  AC_MSG_WARN([`missing' script is too old or missing])
735e35d4d8eSmrgfi
736e35d4d8eSmrg])
7371b12faf6Smrg
738e35d4d8eSmrg# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
739e35d4d8eSmrg# Inc.
740e35d4d8eSmrg#
741e35d4d8eSmrg# This file is free software; the Free Software Foundation
742e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
743e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
7441b12faf6Smrg
745e35d4d8eSmrg# serial 1
7461b12faf6Smrg
747e35d4d8eSmrg# AM_PROG_MKDIR_P
748e35d4d8eSmrg# ---------------
749e35d4d8eSmrg# Check for `mkdir -p'.
750e35d4d8eSmrgAC_DEFUN([AM_PROG_MKDIR_P],
751e35d4d8eSmrg[AC_PREREQ([2.60])dnl
752e35d4d8eSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
753e35d4d8eSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
754e35d4d8eSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
755e35d4d8eSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
756e35d4d8eSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
757e35d4d8eSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
758e35d4d8eSmrgdnl adjustment using top_builddir (which is defined more often than
759e35d4d8eSmrgdnl MKDIR_P).
760e35d4d8eSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
761e35d4d8eSmrgcase $mkdir_p in
762e35d4d8eSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
763e35d4d8eSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
764e35d4d8eSmrgesac
7651b12faf6Smrg])
7661b12faf6Smrg
767e35d4d8eSmrg# Helper functions for option handling.                     -*- Autoconf -*-
7681b12faf6Smrg
769e35d4d8eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
770e35d4d8eSmrg# Foundation, Inc.
771e35d4d8eSmrg#
772e35d4d8eSmrg# This file is free software; the Free Software Foundation
773e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
774e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
7751b12faf6Smrg
776e35d4d8eSmrg# serial 5
7771b12faf6Smrg
778e35d4d8eSmrg# _AM_MANGLE_OPTION(NAME)
779e35d4d8eSmrg# -----------------------
780e35d4d8eSmrgAC_DEFUN([_AM_MANGLE_OPTION],
781e35d4d8eSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7821b12faf6Smrg
783e35d4d8eSmrg# _AM_SET_OPTION(NAME)
784e35d4d8eSmrg# --------------------
785e35d4d8eSmrg# Set option NAME.  Presently that only means defining a flag for this option.
786e35d4d8eSmrgAC_DEFUN([_AM_SET_OPTION],
787e35d4d8eSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7881b12faf6Smrg
789e35d4d8eSmrg# _AM_SET_OPTIONS(OPTIONS)
790e35d4d8eSmrg# ------------------------
791e35d4d8eSmrg# OPTIONS is a space-separated list of Automake options.
792e35d4d8eSmrgAC_DEFUN([_AM_SET_OPTIONS],
793e35d4d8eSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7941b12faf6Smrg
795e35d4d8eSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
796e35d4d8eSmrg# -------------------------------------------
797e35d4d8eSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
798e35d4d8eSmrgAC_DEFUN([_AM_IF_OPTION],
799e35d4d8eSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
8001b12faf6Smrg
801e35d4d8eSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8021b12faf6Smrg
803e35d4d8eSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
804e35d4d8eSmrg# Free Software Foundation, Inc.
805e35d4d8eSmrg#
806e35d4d8eSmrg# This file is free software; the Free Software Foundation
807e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
808e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
8091b12faf6Smrg
810e35d4d8eSmrg# serial 5
8111b12faf6Smrg
812e35d4d8eSmrg# AM_SANITY_CHECK
813e35d4d8eSmrg# ---------------
814e35d4d8eSmrgAC_DEFUN([AM_SANITY_CHECK],
815e35d4d8eSmrg[AC_MSG_CHECKING([whether build environment is sane])
816e35d4d8eSmrg# Just in case
817e35d4d8eSmrgsleep 1
818e35d4d8eSmrgecho timestamp > conftest.file
819e35d4d8eSmrg# Reject unsafe characters in $srcdir or the absolute working directory
820e35d4d8eSmrg# name.  Accept space and tab only in the latter.
821e35d4d8eSmrgam_lf='
822e35d4d8eSmrg'
823e35d4d8eSmrgcase `pwd` in
824e35d4d8eSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
825e35d4d8eSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
826e35d4d8eSmrgesac
827e35d4d8eSmrgcase $srcdir in
828e35d4d8eSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
829e35d4d8eSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
830e35d4d8eSmrgesac
8311b12faf6Smrg
832e35d4d8eSmrg# Do `set' in a subshell so we don't clobber the current shell's
833e35d4d8eSmrg# arguments.  Must try -L first in case configure is actually a
834e35d4d8eSmrg# symlink; some systems play weird games with the mod time of symlinks
835e35d4d8eSmrg# (eg FreeBSD returns the mod time of the symlink's containing
836e35d4d8eSmrg# directory).
837e35d4d8eSmrgif (
838e35d4d8eSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
839e35d4d8eSmrg   if test "$[*]" = "X"; then
840e35d4d8eSmrg      # -L didn't work.
841e35d4d8eSmrg      set X `ls -t "$srcdir/configure" conftest.file`
842e35d4d8eSmrg   fi
843e35d4d8eSmrg   rm -f conftest.file
844e35d4d8eSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
845e35d4d8eSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8461b12faf6Smrg
847e35d4d8eSmrg      # If neither matched, then we have a broken ls.  This can happen
848e35d4d8eSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
849e35d4d8eSmrg      # broken ls alias from the environment.  This has actually
850e35d4d8eSmrg      # happened.  Such a system could not be considered "sane".
851e35d4d8eSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
852e35d4d8eSmrgalias in your environment])
853e35d4d8eSmrg   fi
8541b12faf6Smrg
855e35d4d8eSmrg   test "$[2]" = conftest.file
856e35d4d8eSmrg   )
857e35d4d8eSmrgthen
858e35d4d8eSmrg   # Ok.
859e35d4d8eSmrg   :
860e35d4d8eSmrgelse
861e35d4d8eSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
862e35d4d8eSmrgCheck your system clock])
8631b12faf6Smrgfi
864e35d4d8eSmrgAC_MSG_RESULT(yes)])
8651b12faf6Smrg
866e35d4d8eSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
867e35d4d8eSmrg#
868e35d4d8eSmrg# This file is free software; the Free Software Foundation
869e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
870e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
8711b12faf6Smrg
872e35d4d8eSmrg# serial 1
8731b12faf6Smrg
874e35d4d8eSmrg# AM_SILENT_RULES([DEFAULT])
875e35d4d8eSmrg# --------------------------
876e35d4d8eSmrg# Enable less verbose build rules; with the default set to DEFAULT
877e35d4d8eSmrg# (`yes' being less verbose, `no' or empty being verbose).
878e35d4d8eSmrgAC_DEFUN([AM_SILENT_RULES],
879e35d4d8eSmrg[AC_ARG_ENABLE([silent-rules],
880e35d4d8eSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
881e35d4d8eSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
882e35d4d8eSmrgcase $enable_silent_rules in
883e35d4d8eSmrgyes) AM_DEFAULT_VERBOSITY=0;;
884e35d4d8eSmrgno)  AM_DEFAULT_VERBOSITY=1;;
885e35d4d8eSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
886e35d4d8eSmrgesac
887e35d4d8eSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
888e35d4d8eSmrgAM_BACKSLASH='\'
889e35d4d8eSmrgAC_SUBST([AM_BACKSLASH])dnl
890e35d4d8eSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
891e35d4d8eSmrg])
8921b12faf6Smrg
893e35d4d8eSmrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
894e35d4d8eSmrg#
895e35d4d8eSmrg# This file is free software; the Free Software Foundation
896e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
897e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
8981b12faf6Smrg
899e35d4d8eSmrg# serial 1
9001b12faf6Smrg
901e35d4d8eSmrg# AM_PROG_INSTALL_STRIP
902e35d4d8eSmrg# ---------------------
903e35d4d8eSmrg# One issue with vendor `install' (even GNU) is that you can't
904e35d4d8eSmrg# specify the program used to strip binaries.  This is especially
905e35d4d8eSmrg# annoying in cross-compiling environments, where the build's strip
906e35d4d8eSmrg# is unlikely to handle the host's binaries.
907e35d4d8eSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
908e35d4d8eSmrg# always use install-sh in `make install-strip', and initialize
909e35d4d8eSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
910e35d4d8eSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
911e35d4d8eSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
912e35d4d8eSmrg# Installed binaries are usually stripped using `strip' when the user
913e35d4d8eSmrg# run `make install-strip'.  However `strip' might not be the right
914e35d4d8eSmrg# tool to use in cross-compilation environments, therefore Automake
915e35d4d8eSmrg# will honor the `STRIP' environment variable to overrule this program.
916e35d4d8eSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
917e35d4d8eSmrgif test "$cross_compiling" != no; then
918e35d4d8eSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
919e35d4d8eSmrgfi
920e35d4d8eSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
921e35d4d8eSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9221b12faf6Smrg
923e35d4d8eSmrg# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
9241b12faf6Smrg#
925e35d4d8eSmrg# This file is free software; the Free Software Foundation
926e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
927e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
9281b12faf6Smrg
929e35d4d8eSmrg# serial 3
9301b12faf6Smrg
931e35d4d8eSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
932e35d4d8eSmrg# ---------------------------
933e35d4d8eSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
934e35d4d8eSmrg# This macro is traced by Automake.
935e35d4d8eSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9361b12faf6Smrg
937e35d4d8eSmrg# AM_SUBST_NOTMAKE(VARIABLE)
938e35d4d8eSmrg# --------------------------
939e35d4d8eSmrg# Public sister of _AM_SUBST_NOTMAKE.
940e35d4d8eSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
941e35d4d8eSmrg
942e35d4d8eSmrg# Check how to create a tarball.                            -*- Autoconf -*-
943e35d4d8eSmrg
944e35d4d8eSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
945e35d4d8eSmrg#
946e35d4d8eSmrg# This file is free software; the Free Software Foundation
947e35d4d8eSmrg# gives unlimited permission to copy and/or distribute it,
948e35d4d8eSmrg# with or without modifications, as long as this notice is preserved.
949e35d4d8eSmrg
950e35d4d8eSmrg# serial 2
951e35d4d8eSmrg
952e35d4d8eSmrg# _AM_PROG_TAR(FORMAT)
953e35d4d8eSmrg# --------------------
954e35d4d8eSmrg# Check how to create a tarball in format FORMAT.
955e35d4d8eSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
956e35d4d8eSmrg#
957e35d4d8eSmrg# Substitute a variable $(am__tar) that is a command
958e35d4d8eSmrg# writing to stdout a FORMAT-tarball containing the directory
959e35d4d8eSmrg# $tardir.
960e35d4d8eSmrg#     tardir=directory && $(am__tar) > result.tar
961e35d4d8eSmrg#
962e35d4d8eSmrg# Substitute a variable $(am__untar) that extract such
963e35d4d8eSmrg# a tarball read from stdin.
964e35d4d8eSmrg#     $(am__untar) < result.tar
965e35d4d8eSmrgAC_DEFUN([_AM_PROG_TAR],
966e35d4d8eSmrg[# Always define AMTAR for backward compatibility.
967e35d4d8eSmrgAM_MISSING_PROG([AMTAR], [tar])
968e35d4d8eSmrgm4_if([$1], [v7],
969e35d4d8eSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
970e35d4d8eSmrg     [m4_case([$1], [ustar],, [pax],,
971e35d4d8eSmrg              [m4_fatal([Unknown tar format])])
972e35d4d8eSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
973e35d4d8eSmrg# Loop over all known methods to create a tar archive until one works.
974e35d4d8eSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
975e35d4d8eSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
976e35d4d8eSmrg# Do not fold the above two line into one, because Tru64 sh and
977e35d4d8eSmrg# Solaris sh will not grok spaces in the rhs of `-'.
978e35d4d8eSmrgfor _am_tool in $_am_tools
979e35d4d8eSmrgdo
980e35d4d8eSmrg  case $_am_tool in
981e35d4d8eSmrg  gnutar)
982e35d4d8eSmrg    for _am_tar in tar gnutar gtar;
983e35d4d8eSmrg    do
984e35d4d8eSmrg      AM_RUN_LOG([$_am_tar --version]) && break
985e35d4d8eSmrg    done
986e35d4d8eSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
987e35d4d8eSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
988e35d4d8eSmrg    am__untar="$_am_tar -xf -"
989e35d4d8eSmrg    ;;
990e35d4d8eSmrg  plaintar)
991e35d4d8eSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
992e35d4d8eSmrg    # ustar tarball either.
993e35d4d8eSmrg    (tar --version) >/dev/null 2>&1 && continue
994e35d4d8eSmrg    am__tar='tar chf - "$$tardir"'
995e35d4d8eSmrg    am__tar_='tar chf - "$tardir"'
996e35d4d8eSmrg    am__untar='tar xf -'
997e35d4d8eSmrg    ;;
998e35d4d8eSmrg  pax)
999e35d4d8eSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
1000e35d4d8eSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
1001e35d4d8eSmrg    am__untar='pax -r'
1002e35d4d8eSmrg    ;;
1003e35d4d8eSmrg  cpio)
1004e35d4d8eSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1005e35d4d8eSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1006e35d4d8eSmrg    am__untar='cpio -i -H $1 -d'
1007e35d4d8eSmrg    ;;
1008e35d4d8eSmrg  none)
1009e35d4d8eSmrg    am__tar=false
1010e35d4d8eSmrg    am__tar_=false
1011e35d4d8eSmrg    am__untar=false
10121b12faf6Smrg    ;;
10131b12faf6Smrg  esac
10141b12faf6Smrg
1015e35d4d8eSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
1016e35d4d8eSmrg  # and am__untar set.
1017e35d4d8eSmrg  test -n "${am_cv_prog_tar_$1}" && break
10181b12faf6Smrg
1019e35d4d8eSmrg  # tar/untar a dummy directory, and stop if the command works
1020e35d4d8eSmrg  rm -rf conftest.dir
1021e35d4d8eSmrg  mkdir conftest.dir
1022e35d4d8eSmrg  echo GrepMe > conftest.dir/file
1023e35d4d8eSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1024e35d4d8eSmrg  rm -rf conftest.dir
1025e35d4d8eSmrg  if test -s conftest.tar; then
1026e35d4d8eSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1027e35d4d8eSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1028e35d4d8eSmrg  fi
1029e35d4d8eSmrgdone
1030e35d4d8eSmrgrm -rf conftest.dir
10311b12faf6Smrg
1032e35d4d8eSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1033e35d4d8eSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1034e35d4d8eSmrgAC_SUBST([am__tar])
1035e35d4d8eSmrgAC_SUBST([am__untar])
1036e35d4d8eSmrg]) # _AM_PROG_TAR
10371b12faf6Smrg
1038e35d4d8eSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1039e35d4d8eSmrg#
1040e35d4d8eSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1041e35d4d8eSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1042e35d4d8eSmrg#                 Foundation, Inc.
1043e35d4d8eSmrg#   Written by Gordon Matzigkeit, 1996
1044e35d4d8eSmrg#
1045e35d4d8eSmrg# This file is free software; the Free Software Foundation gives
1046e35d4d8eSmrg# unlimited permission to copy and/or distribute it, with or without
1047e35d4d8eSmrg# modifications, as long as this notice is preserved.
10481b12faf6Smrg
1049e35d4d8eSmrgm4_define([_LT_COPYING], [dnl
1050e35d4d8eSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1051e35d4d8eSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1052e35d4d8eSmrg#                 Foundation, Inc.
1053e35d4d8eSmrg#   Written by Gordon Matzigkeit, 1996
1054e35d4d8eSmrg#
1055e35d4d8eSmrg#   This file is part of GNU Libtool.
1056e35d4d8eSmrg#
1057e35d4d8eSmrg# GNU Libtool is free software; you can redistribute it and/or
1058e35d4d8eSmrg# modify it under the terms of the GNU General Public License as
1059e35d4d8eSmrg# published by the Free Software Foundation; either version 2 of
1060e35d4d8eSmrg# the License, or (at your option) any later version.
1061e35d4d8eSmrg#
1062e35d4d8eSmrg# As a special exception to the GNU General Public License,
1063e35d4d8eSmrg# if you distribute this file as part of a program or library that
1064e35d4d8eSmrg# is built using GNU Libtool, you may include this file under the
1065e35d4d8eSmrg# same distribution terms that you use for the rest of that program.
1066e35d4d8eSmrg#
1067e35d4d8eSmrg# GNU Libtool is distributed in the hope that it will be useful,
1068e35d4d8eSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
1069e35d4d8eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1070e35d4d8eSmrg# GNU General Public License for more details.
1071e35d4d8eSmrg#
1072e35d4d8eSmrg# You should have received a copy of the GNU General Public License
1073e35d4d8eSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
1074e35d4d8eSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1075e35d4d8eSmrg# obtained by writing to the Free Software Foundation, Inc.,
1076e35d4d8eSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1077e35d4d8eSmrg])
10781b12faf6Smrg
1079e35d4d8eSmrg# serial 57 LT_INIT
10801b12faf6Smrg
10811b12faf6Smrg
1082e35d4d8eSmrg# LT_PREREQ(VERSION)
1083e35d4d8eSmrg# ------------------
1084e35d4d8eSmrg# Complain and exit if this libtool version is less that VERSION.
1085e35d4d8eSmrgm4_defun([LT_PREREQ],
1086e35d4d8eSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1087e35d4d8eSmrg       [m4_default([$3],
1088e35d4d8eSmrg		   [m4_fatal([Libtool version $1 or higher is required],
1089e35d4d8eSmrg		             63)])],
1090e35d4d8eSmrg       [$2])])
10911b12faf6Smrg
10921b12faf6Smrg
1093e35d4d8eSmrg# _LT_CHECK_BUILDDIR
1094e35d4d8eSmrg# ------------------
1095e35d4d8eSmrg# Complain if the absolute build directory name contains unusual characters
1096e35d4d8eSmrgm4_defun([_LT_CHECK_BUILDDIR],
1097e35d4d8eSmrg[case `pwd` in
1098e35d4d8eSmrg  *\ * | *\	*)
1099e35d4d8eSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1100e35d4d8eSmrgesac
1101e35d4d8eSmrg])
11021b12faf6Smrg
11031b12faf6Smrg
1104e35d4d8eSmrg# LT_INIT([OPTIONS])
11051b12faf6Smrg# ------------------
1106e35d4d8eSmrgAC_DEFUN([LT_INIT],
1107e35d4d8eSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1108e35d4d8eSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1109e35d4d8eSmrgAC_BEFORE([$0], [LT_LANG])dnl
1110e35d4d8eSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
1111e35d4d8eSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
1112e35d4d8eSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
11131b12faf6Smrg
1114e35d4d8eSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
1115e35d4d8eSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1116e35d4d8eSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1117e35d4d8eSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1118e35d4d8eSmrgdnl unless we require an AC_DEFUNed macro:
1119e35d4d8eSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
1120e35d4d8eSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
1121e35d4d8eSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
1122e35d4d8eSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1123e35d4d8eSmrgm4_require([_LT_PROG_LTMAIN])dnl
11241b12faf6Smrg
1125e35d4d8eSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
11261b12faf6Smrg
1127e35d4d8eSmrgdnl Parse OPTIONS
1128e35d4d8eSmrg_LT_SET_OPTIONS([$0], [$1])
11291b12faf6Smrg
1130e35d4d8eSmrg# This can be used to rebuild libtool when needed
1131e35d4d8eSmrgLIBTOOL_DEPS="$ltmain"
11321b12faf6Smrg
1133e35d4d8eSmrg# Always use our own libtool.
1134e35d4d8eSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1135e35d4d8eSmrgAC_SUBST(LIBTOOL)dnl
11361b12faf6Smrg
1137e35d4d8eSmrg_LT_SETUP
11381b12faf6Smrg
1139e35d4d8eSmrg# Only expand once:
1140e35d4d8eSmrgm4_define([LT_INIT])
1141e35d4d8eSmrg])# LT_INIT
1142e35d4d8eSmrg
1143e35d4d8eSmrg# Old names:
1144e35d4d8eSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1145e35d4d8eSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
11461b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
1147e35d4d8eSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1148e35d4d8eSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
11491b12faf6Smrg
11501b12faf6Smrg
1151e35d4d8eSmrg# _LT_CC_BASENAME(CC)
1152e35d4d8eSmrg# -------------------
1153e35d4d8eSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1154e35d4d8eSmrgm4_defun([_LT_CC_BASENAME],
1155e35d4d8eSmrg[for cc_temp in $1""; do
1156e35d4d8eSmrg  case $cc_temp in
1157e35d4d8eSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1158e35d4d8eSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1159e35d4d8eSmrg    \-*) ;;
1160e35d4d8eSmrg    *) break;;
1161e35d4d8eSmrg  esac
1162e35d4d8eSmrgdone
1163e35d4d8eSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1164e35d4d8eSmrg])
116532b578d3Smrg
11661b12faf6Smrg
1167e35d4d8eSmrg# _LT_FILEUTILS_DEFAULTS
1168e35d4d8eSmrg# ----------------------
1169e35d4d8eSmrg# It is okay to use these file commands and assume they have been set
1170e35d4d8eSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1171e35d4d8eSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1172e35d4d8eSmrg[: ${CP="cp -f"}
1173e35d4d8eSmrg: ${MV="mv -f"}
1174e35d4d8eSmrg: ${RM="rm -f"}
1175e35d4d8eSmrg])# _LT_FILEUTILS_DEFAULTS
117632b578d3Smrg
117732b578d3Smrg
1178e35d4d8eSmrg# _LT_SETUP
1179e35d4d8eSmrg# ---------
1180e35d4d8eSmrgm4_defun([_LT_SETUP],
1181e35d4d8eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1182e35d4d8eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1183e35d4d8eSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1184e35d4d8eSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
118532b578d3Smrg
1186e35d4d8eSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1187e35d4d8eSmrgdnl
1188e35d4d8eSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1189e35d4d8eSmrg_LT_DECL([], [host], [0])dnl
1190e35d4d8eSmrg_LT_DECL([], [host_os], [0])dnl
1191e35d4d8eSmrgdnl
1192e35d4d8eSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1193e35d4d8eSmrg_LT_DECL([], [build], [0])dnl
1194e35d4d8eSmrg_LT_DECL([], [build_os], [0])dnl
1195e35d4d8eSmrgdnl
1196e35d4d8eSmrgAC_REQUIRE([AC_PROG_CC])dnl
1197e35d4d8eSmrgAC_REQUIRE([LT_PATH_LD])dnl
1198e35d4d8eSmrgAC_REQUIRE([LT_PATH_NM])dnl
1199e35d4d8eSmrgdnl
1200e35d4d8eSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1201e35d4d8eSmrgtest -z "$LN_S" && LN_S="ln -s"
1202e35d4d8eSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1203e35d4d8eSmrgdnl
1204e35d4d8eSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1205e35d4d8eSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1206e35d4d8eSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1207e35d4d8eSmrgdnl
1208e35d4d8eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1209e35d4d8eSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
1210e35d4d8eSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1211e35d4d8eSmrgm4_require([_LT_CMD_RELOAD])dnl
1212e35d4d8eSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
1213e35d4d8eSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1214e35d4d8eSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
1215e35d4d8eSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1216e35d4d8eSmrgm4_require([_LT_WITH_SYSROOT])dnl
121732b578d3Smrg
1218e35d4d8eSmrg_LT_CONFIG_LIBTOOL_INIT([
1219e35d4d8eSmrg# See if we are running on zsh, and set the options which allow our
1220e35d4d8eSmrg# commands through without removal of \ escapes INIT.
1221e35d4d8eSmrgif test -n "\${ZSH_VERSION+set}" ; then
1222e35d4d8eSmrg   setopt NO_GLOB_SUBST
1223e35d4d8eSmrgfi
1224e35d4d8eSmrg])
1225e35d4d8eSmrgif test -n "${ZSH_VERSION+set}" ; then
1226e35d4d8eSmrg   setopt NO_GLOB_SUBST
1227e35d4d8eSmrgfi
122832b578d3Smrg
1229e35d4d8eSmrg_LT_CHECK_OBJDIR
123032b578d3Smrg
1231e35d4d8eSmrgm4_require([_LT_TAG_COMPILER])dnl
123232b578d3Smrg
1233e35d4d8eSmrgcase $host_os in
1234e35d4d8eSmrgaix3*)
1235e35d4d8eSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
1236e35d4d8eSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
1237e35d4d8eSmrg  # vanish in a puff of smoke.
1238e35d4d8eSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
1239e35d4d8eSmrg    COLLECT_NAMES=
1240e35d4d8eSmrg    export COLLECT_NAMES
1241e35d4d8eSmrg  fi
1242e35d4d8eSmrg  ;;
1243e35d4d8eSmrgesac
124432b578d3Smrg
1245e35d4d8eSmrg# Global variables:
1246e35d4d8eSmrgofile=libtool
1247e35d4d8eSmrgcan_build_shared=yes
12481b12faf6Smrg
1249e35d4d8eSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
1250e35d4d8eSmrg# which needs '.lib').
1251e35d4d8eSmrglibext=a
12521b12faf6Smrg
1253e35d4d8eSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
125432b578d3Smrg
1255e35d4d8eSmrgold_CC="$CC"
1256e35d4d8eSmrgold_CFLAGS="$CFLAGS"
125732b578d3Smrg
1258e35d4d8eSmrg# Set sane defaults for various variables
1259e35d4d8eSmrgtest -z "$CC" && CC=cc
1260e35d4d8eSmrgtest -z "$LTCC" && LTCC=$CC
1261e35d4d8eSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1262e35d4d8eSmrgtest -z "$LD" && LD=ld
1263e35d4d8eSmrgtest -z "$ac_objext" && ac_objext=o
126432b578d3Smrg
1265e35d4d8eSmrg_LT_CC_BASENAME([$compiler])
126632b578d3Smrg
1267e35d4d8eSmrg# Only perform the check for file, if the check method requires it
1268e35d4d8eSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
1269e35d4d8eSmrgcase $deplibs_check_method in
1270e35d4d8eSmrgfile_magic*)
1271e35d4d8eSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1272e35d4d8eSmrg    _LT_PATH_MAGIC
1273e35d4d8eSmrg  fi
12742a51b5beSmrg  ;;
12752a51b5beSmrgesac
1276d31dbc53Smrg
1277e35d4d8eSmrg# Use C for the default configuration in the libtool script
1278e35d4d8eSmrgLT_SUPPORTED_TAG([CC])
1279e35d4d8eSmrg_LT_LANG_C_CONFIG
1280e35d4d8eSmrg_LT_LANG_DEFAULT_CONFIG
1281e35d4d8eSmrg_LT_CONFIG_COMMANDS
1282e35d4d8eSmrg])# _LT_SETUP
128332b578d3Smrg
128432b578d3Smrg
1285e35d4d8eSmrg# _LT_PREPARE_SED_QUOTE_VARS
1286e35d4d8eSmrg# --------------------------
1287e35d4d8eSmrg# Define a few sed substitution that help us do robust quoting.
1288e35d4d8eSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1289e35d4d8eSmrg[# Backslashify metacharacters that are still active within
1290e35d4d8eSmrg# double-quoted strings.
1291e35d4d8eSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
129232b578d3Smrg
1293e35d4d8eSmrg# Same as above, but do not quote variable references.
1294e35d4d8eSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
129532b578d3Smrg
1296e35d4d8eSmrg# Sed substitution to delay expansion of an escaped shell variable in a
1297e35d4d8eSmrg# double_quote_subst'ed string.
1298e35d4d8eSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
129932b578d3Smrg
1300e35d4d8eSmrg# Sed substitution to delay expansion of an escaped single quote.
1301e35d4d8eSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
130232b578d3Smrg
1303e35d4d8eSmrg# Sed substitution to avoid accidental globbing in evaled expressions
1304e35d4d8eSmrgno_glob_subst='s/\*/\\\*/g'
1305e35d4d8eSmrg])
130632b578d3Smrg
1307e35d4d8eSmrg# _LT_PROG_LTMAIN
1308e35d4d8eSmrg# ---------------
1309e35d4d8eSmrg# Note that this code is called both from `configure', and `config.status'
1310e35d4d8eSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1311e35d4d8eSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
1312e35d4d8eSmrg# so we pass a copy along to make sure it has a sensible value anyway.
1313e35d4d8eSmrgm4_defun([_LT_PROG_LTMAIN],
1314e35d4d8eSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1315e35d4d8eSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1316e35d4d8eSmrgltmain="$ac_aux_dir/ltmain.sh"
1317e35d4d8eSmrg])# _LT_PROG_LTMAIN
131832b578d3Smrg
131932b578d3Smrg
132032b578d3Smrg
1321e35d4d8eSmrg# So that we can recreate a full libtool script including additional
1322e35d4d8eSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1323e35d4d8eSmrg# in macros and then make a single call at the end using the `libtool'
1324e35d4d8eSmrg# label.
132532b578d3Smrg
132632b578d3Smrg
1327e35d4d8eSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1328e35d4d8eSmrg# ----------------------------------------
1329e35d4d8eSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1330e35d4d8eSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
1331e35d4d8eSmrg[m4_ifval([$1],
1332e35d4d8eSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1333e35d4d8eSmrg                     [$1
1334e35d4d8eSmrg])])])
1335d31dbc53Smrg
1336e35d4d8eSmrg# Initialize.
1337e35d4d8eSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
133832b578d3Smrg
133932b578d3Smrg
1340e35d4d8eSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
1341e35d4d8eSmrg# ------------------------------
1342e35d4d8eSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1343e35d4d8eSmrgm4_define([_LT_CONFIG_LIBTOOL],
1344e35d4d8eSmrg[m4_ifval([$1],
1345e35d4d8eSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1346e35d4d8eSmrg                     [$1
1347e35d4d8eSmrg])])])
134832b578d3Smrg
1349e35d4d8eSmrg# Initialize.
1350e35d4d8eSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
13511b12faf6Smrg
13521b12faf6Smrg
1353e35d4d8eSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1354e35d4d8eSmrg# -----------------------------------------------------
1355e35d4d8eSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
1356e35d4d8eSmrg[_LT_CONFIG_LIBTOOL([$1])
1357e35d4d8eSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
1358e35d4d8eSmrg])
13591b12faf6Smrg
13601b12faf6Smrg
1361e35d4d8eSmrg# _LT_FORMAT_COMMENT([COMMENT])
1362e35d4d8eSmrg# -----------------------------
1363e35d4d8eSmrg# Add leading comment marks to the start of each line, and a trailing
1364e35d4d8eSmrg# full-stop to the whole comment if one is not present already.
1365e35d4d8eSmrgm4_define([_LT_FORMAT_COMMENT],
1366e35d4d8eSmrg[m4_ifval([$1], [
1367e35d4d8eSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1368e35d4d8eSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1369e35d4d8eSmrg)])
13701b12faf6Smrg
137132b578d3Smrg
137232b578d3Smrg
137332b578d3Smrg
1374e35d4d8eSmrg
1375e35d4d8eSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1376e35d4d8eSmrg# -------------------------------------------------------------------
1377e35d4d8eSmrg# CONFIGNAME is the name given to the value in the libtool script.
1378e35d4d8eSmrg# VARNAME is the (base) name used in the configure script.
1379e35d4d8eSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1380e35d4d8eSmrg# VARNAME.  Any other value will be used directly.
1381e35d4d8eSmrgm4_define([_LT_DECL],
1382e35d4d8eSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1383e35d4d8eSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1384e35d4d8eSmrg	[m4_ifval([$1], [$1], [$2])])
1385e35d4d8eSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1386e35d4d8eSmrg    m4_ifval([$4],
1387e35d4d8eSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1388e35d4d8eSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
1389e35d4d8eSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
1390d31dbc53Smrg])
139132b578d3Smrg
139232b578d3Smrg
1393e35d4d8eSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1394e35d4d8eSmrg# --------------------------------------------------------
1395e35d4d8eSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
139632b578d3Smrg
13971b12faf6Smrg
1398e35d4d8eSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1399e35d4d8eSmrg# ------------------------------------------------
1400e35d4d8eSmrgm4_define([lt_decl_tag_varnames],
1401e35d4d8eSmrg[_lt_decl_filter([tagged?], [yes], $@)])
1402e35d4d8eSmrg
1403e35d4d8eSmrg
1404e35d4d8eSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1405e35d4d8eSmrg# ---------------------------------------------------------
1406e35d4d8eSmrgm4_define([_lt_decl_filter],
1407e35d4d8eSmrg[m4_case([$#],
1408e35d4d8eSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
1409e35d4d8eSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1410e35d4d8eSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1411e35d4d8eSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1412e35d4d8eSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
14132a51b5beSmrg])
141432b578d3Smrg
141532b578d3Smrg
1416e35d4d8eSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1417e35d4d8eSmrg# --------------------------------------------------
1418e35d4d8eSmrgm4_define([lt_decl_quote_varnames],
1419e35d4d8eSmrg[_lt_decl_filter([value], [1], $@)])
142032b578d3Smrg
14211b12faf6Smrg
1422e35d4d8eSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1423e35d4d8eSmrg# ---------------------------------------------------
1424e35d4d8eSmrgm4_define([lt_decl_dquote_varnames],
1425e35d4d8eSmrg[_lt_decl_filter([value], [2], $@)])
142632b578d3Smrg
142732b578d3Smrg
1428e35d4d8eSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1429e35d4d8eSmrg# ---------------------------------------------------
1430e35d4d8eSmrgm4_define([lt_decl_varnames_tagged],
1431e35d4d8eSmrg[m4_assert([$# <= 2])dnl
1432e35d4d8eSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
1433e35d4d8eSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1434e35d4d8eSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1435e35d4d8eSmrgm4_define([_lt_decl_varnames_tagged],
1436e35d4d8eSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
143732b578d3Smrg
143832b578d3Smrg
1439e35d4d8eSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1440e35d4d8eSmrg# ------------------------------------------------
1441e35d4d8eSmrgm4_define([lt_decl_all_varnames],
1442e35d4d8eSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
1443e35d4d8eSmrg     m4_if([$2], [],
1444e35d4d8eSmrg	   m4_quote(lt_decl_varnames),
1445e35d4d8eSmrg	m4_quote(m4_shift($@))))[]dnl
1446e35d4d8eSmrg])
1447e35d4d8eSmrgm4_define([_lt_decl_all_varnames],
1448e35d4d8eSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
1449e35d4d8eSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1450e35d4d8eSmrg])
145132b578d3Smrg
145232b578d3Smrg
1453e35d4d8eSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1454e35d4d8eSmrg# ------------------------------------
1455e35d4d8eSmrg# Quote a variable value, and forward it to `config.status' so that its
1456e35d4d8eSmrg# declaration there will have the same value as in `configure'.  VARNAME
1457e35d4d8eSmrg# must have a single quote delimited value for this to work.
1458e35d4d8eSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
1459e35d4d8eSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1460d31dbc53Smrg
146132b578d3Smrg
1462e35d4d8eSmrg# _LT_CONFIG_STATUS_DECLARATIONS
1463e35d4d8eSmrg# ------------------------------
1464e35d4d8eSmrg# We delimit libtool config variables with single quotes, so when
1465e35d4d8eSmrg# we write them to config.status, we have to be sure to quote all
1466e35d4d8eSmrg# embedded single quotes properly.  In configure, this macro expands
1467e35d4d8eSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1468e35d4d8eSmrg#
1469e35d4d8eSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1470e35d4d8eSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1471e35d4d8eSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1472e35d4d8eSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
147332b578d3Smrg
14741b12faf6Smrg
1475e35d4d8eSmrg# _LT_LIBTOOL_TAGS
14761b12faf6Smrg# ----------------
1477e35d4d8eSmrg# Output comment and list of tags supported by the script
1478e35d4d8eSmrgm4_defun([_LT_LIBTOOL_TAGS],
1479e35d4d8eSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1480e35d4d8eSmrgavailable_tags="_LT_TAGS"dnl
1481e35d4d8eSmrg])
148232b578d3Smrg
148332b578d3Smrg
1484e35d4d8eSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1485e35d4d8eSmrg# -----------------------------------
1486e35d4d8eSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
1487e35d4d8eSmrg# expand to a commented shell variable setting:
1488e35d4d8eSmrg#
1489e35d4d8eSmrg#    # Some comment about what VAR is for.
1490e35d4d8eSmrg#    visible_name=$lt_internal_name
1491e35d4d8eSmrgm4_define([_LT_LIBTOOL_DECLARE],
1492e35d4d8eSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1493e35d4d8eSmrg					   [description])))[]dnl
1494e35d4d8eSmrgm4_pushdef([_libtool_name],
1495e35d4d8eSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1496e35d4d8eSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1497e35d4d8eSmrg    [0], [_libtool_name=[$]$1],
1498e35d4d8eSmrg    [1], [_libtool_name=$lt_[]$1],
1499e35d4d8eSmrg    [2], [_libtool_name=$lt_[]$1],
1500e35d4d8eSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1501e35d4d8eSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1502e35d4d8eSmrg])
150332b578d3Smrg
1504d31dbc53Smrg
1505e35d4d8eSmrg# _LT_LIBTOOL_CONFIG_VARS
1506e35d4d8eSmrg# -----------------------
1507e35d4d8eSmrg# Produce commented declarations of non-tagged libtool config variables
1508e35d4d8eSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1509e35d4d8eSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1510e35d4d8eSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
1511e35d4d8eSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
1512e35d4d8eSmrg[m4_foreach([_lt_var],
1513e35d4d8eSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1514e35d4d8eSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
151532b578d3Smrg
151632b578d3Smrg
1517e35d4d8eSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
1518e35d4d8eSmrg# -------------------------
1519e35d4d8eSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
1520e35d4d8eSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1521e35d4d8eSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
152232b578d3Smrg
152332b578d3Smrg
1524e35d4d8eSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
1525e35d4d8eSmrg# ------------------------------
1526e35d4d8eSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
152732b578d3Smrg
152832b578d3Smrg
1529e35d4d8eSmrg# _LT_CONFIG_COMMANDS
1530e35d4d8eSmrg# -------------------
1531e35d4d8eSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1532e35d4d8eSmrg# variables for single and double quote escaping we saved from calls
1533e35d4d8eSmrg# to _LT_DECL, we can put quote escaped variables declarations
1534e35d4d8eSmrg# into `config.status', and then the shell code to quote escape them in
1535e35d4d8eSmrg# for loops in `config.status'.  Finally, any additional code accumulated
1536e35d4d8eSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1537e35d4d8eSmrgm4_defun([_LT_CONFIG_COMMANDS],
1538e35d4d8eSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
1539e35d4d8eSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
1540e35d4d8eSmrg	dnl instead of duplicating it all over again into config.status,
1541e35d4d8eSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
1542e35d4d8eSmrg	dnl needs to know what name is stored there:
1543e35d4d8eSmrg        [AC_CONFIG_COMMANDS([libtool],
1544e35d4d8eSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1545e35d4d8eSmrg    dnl If the libtool generation code is destined for config.status,
1546e35d4d8eSmrg    dnl expand the accumulated commands and init code now:
1547e35d4d8eSmrg    [AC_CONFIG_COMMANDS([libtool],
1548e35d4d8eSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1549e35d4d8eSmrg])#_LT_CONFIG_COMMANDS
155032b578d3Smrg
155132b578d3Smrg
1552e35d4d8eSmrg# Initialize.
1553e35d4d8eSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1554e35d4d8eSmrg[
155532b578d3Smrg
1556e35d4d8eSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
1557e35d4d8eSmrg# if CDPATH is set.
1558e35d4d8eSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
155932b578d3Smrg
1560e35d4d8eSmrgsed_quote_subst='$sed_quote_subst'
1561e35d4d8eSmrgdouble_quote_subst='$double_quote_subst'
1562e35d4d8eSmrgdelay_variable_subst='$delay_variable_subst'
1563e35d4d8eSmrg_LT_CONFIG_STATUS_DECLARATIONS
1564e35d4d8eSmrgLTCC='$LTCC'
1565e35d4d8eSmrgLTCFLAGS='$LTCFLAGS'
1566e35d4d8eSmrgcompiler='$compiler_DEFAULT'
156732b578d3Smrg
1568e35d4d8eSmrg# A function that is used when there is no print builtin or printf.
1569e35d4d8eSmrgfunc_fallback_echo ()
1570e35d4d8eSmrg{
1571e35d4d8eSmrg  eval 'cat <<_LTECHO_EOF
1572e35d4d8eSmrg\$[]1
1573e35d4d8eSmrg_LTECHO_EOF'
1574e35d4d8eSmrg}
157532b578d3Smrg
1576e35d4d8eSmrg# Quote evaled strings.
1577e35d4d8eSmrgfor var in lt_decl_all_varnames([[ \
1578e35d4d8eSmrg]], lt_decl_quote_varnames); do
1579e35d4d8eSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1580e35d4d8eSmrg    *[[\\\\\\\`\\"\\\$]]*)
1581e35d4d8eSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1582e35d4d8eSmrg      ;;
1583e35d4d8eSmrg    *)
1584e35d4d8eSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1585e35d4d8eSmrg      ;;
1586e35d4d8eSmrg    esac
1587e35d4d8eSmrgdone
158832b578d3Smrg
1589e35d4d8eSmrg# Double-quote double-evaled strings.
1590e35d4d8eSmrgfor var in lt_decl_all_varnames([[ \
1591e35d4d8eSmrg]], lt_decl_dquote_varnames); do
1592e35d4d8eSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1593e35d4d8eSmrg    *[[\\\\\\\`\\"\\\$]]*)
1594e35d4d8eSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1595e35d4d8eSmrg      ;;
1596e35d4d8eSmrg    *)
1597e35d4d8eSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1598e35d4d8eSmrg      ;;
1599e35d4d8eSmrg    esac
1600e35d4d8eSmrgdone
160132b578d3Smrg
1602e35d4d8eSmrg_LT_OUTPUT_LIBTOOL_INIT
1603e35d4d8eSmrg])
160432b578d3Smrg
1605e35d4d8eSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1606e35d4d8eSmrg# ------------------------------------
1607e35d4d8eSmrg# Generate a child script FILE with all initialization necessary to
1608e35d4d8eSmrg# reuse the environment learned by the parent script, and make the
1609e35d4d8eSmrg# file executable.  If COMMENT is supplied, it is inserted after the
1610e35d4d8eSmrg# `#!' sequence but before initialization text begins.  After this
1611e35d4d8eSmrg# macro, additional text can be appended to FILE to form the body of
1612e35d4d8eSmrg# the child script.  The macro ends with non-zero status if the
1613e35d4d8eSmrg# file could not be fully written (such as if the disk is full).
1614e35d4d8eSmrgm4_ifdef([AS_INIT_GENERATED],
1615e35d4d8eSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1616e35d4d8eSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
1617e35d4d8eSmrg[m4_require([AS_PREPARE])]dnl
1618e35d4d8eSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1619e35d4d8eSmrg[lt_write_fail=0
1620e35d4d8eSmrgcat >$1 <<_ASEOF || lt_write_fail=1
1621e35d4d8eSmrg#! $SHELL
1622e35d4d8eSmrg# Generated by $as_me.
1623e35d4d8eSmrg$2
1624e35d4d8eSmrgSHELL=\${CONFIG_SHELL-$SHELL}
1625e35d4d8eSmrgexport SHELL
1626e35d4d8eSmrg_ASEOF
1627e35d4d8eSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
1628e35d4d8eSmrgAS_SHELL_SANITIZE
1629e35d4d8eSmrg_AS_PREPARE
1630e35d4d8eSmrgexec AS_MESSAGE_FD>&1
1631e35d4d8eSmrg_ASEOF
1632e35d4d8eSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
1633e35d4d8eSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
163432b578d3Smrg
1635e35d4d8eSmrg# LT_OUTPUT
1636e35d4d8eSmrg# ---------
1637e35d4d8eSmrg# This macro allows early generation of the libtool script (before
1638e35d4d8eSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
1639e35d4d8eSmrg# tests.
1640e35d4d8eSmrgAC_DEFUN([LT_OUTPUT],
1641e35d4d8eSmrg[: ${CONFIG_LT=./config.lt}
1642e35d4d8eSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
1643e35d4d8eSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1644e35d4d8eSmrg[# Run this file to recreate a libtool stub with the current configuration.])
164532b578d3Smrg
1646e35d4d8eSmrgcat >>"$CONFIG_LT" <<\_LTEOF
1647e35d4d8eSmrglt_cl_silent=false
1648e35d4d8eSmrgexec AS_MESSAGE_LOG_FD>>config.log
1649e35d4d8eSmrg{
1650e35d4d8eSmrg  echo
1651e35d4d8eSmrg  AS_BOX([Running $as_me.])
1652e35d4d8eSmrg} >&AS_MESSAGE_LOG_FD
165332b578d3Smrg
1654e35d4d8eSmrglt_cl_help="\
1655e35d4d8eSmrg\`$as_me' creates a local libtool stub from the current configuration,
1656e35d4d8eSmrgfor use in further configure time tests before the real libtool is
1657e35d4d8eSmrggenerated.
165832b578d3Smrg
1659e35d4d8eSmrgUsage: $[0] [[OPTIONS]]
166032b578d3Smrg
1661e35d4d8eSmrg  -h, --help      print this help, then exit
1662e35d4d8eSmrg  -V, --version   print version number, then exit
1663e35d4d8eSmrg  -q, --quiet     do not print progress messages
1664e35d4d8eSmrg  -d, --debug     don't remove temporary files
166532b578d3Smrg
1666e35d4d8eSmrgReport bugs to <bug-libtool@gnu.org>."
166732b578d3Smrg
1668e35d4d8eSmrglt_cl_version="\
1669e35d4d8eSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1670e35d4d8eSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1671e35d4d8eSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
167232b578d3Smrg
1673e35d4d8eSmrgCopyright (C) 2011 Free Software Foundation, Inc.
1674e35d4d8eSmrgThis config.lt script is free software; the Free Software Foundation
1675e35d4d8eSmrggives unlimited permision to copy, distribute and modify it."
16761b12faf6Smrg
1677e35d4d8eSmrgwhile test $[#] != 0
1678e35d4d8eSmrgdo
1679e35d4d8eSmrg  case $[1] in
1680e35d4d8eSmrg    --version | --v* | -V )
1681e35d4d8eSmrg      echo "$lt_cl_version"; exit 0 ;;
1682e35d4d8eSmrg    --help | --h* | -h )
1683e35d4d8eSmrg      echo "$lt_cl_help"; exit 0 ;;
1684e35d4d8eSmrg    --debug | --d* | -d )
1685e35d4d8eSmrg      debug=: ;;
1686e35d4d8eSmrg    --quiet | --q* | --silent | --s* | -q )
1687e35d4d8eSmrg      lt_cl_silent=: ;;
168832b578d3Smrg
1689e35d4d8eSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
1690e35d4d8eSmrgTry \`$[0] --help' for more information.]) ;;
169132b578d3Smrg
1692e35d4d8eSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
1693e35d4d8eSmrgTry \`$[0] --help' for more information.]) ;;
1694e35d4d8eSmrg  esac
1695e35d4d8eSmrg  shift
1696e35d4d8eSmrgdone
169732b578d3Smrg
1698e35d4d8eSmrgif $lt_cl_silent; then
1699e35d4d8eSmrg  exec AS_MESSAGE_FD>/dev/null
17002a51b5beSmrgfi
1701e35d4d8eSmrg_LTEOF
1702d31dbc53Smrg
1703e35d4d8eSmrgcat >>"$CONFIG_LT" <<_LTEOF
1704e35d4d8eSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1705e35d4d8eSmrg_LTEOF
1706d31dbc53Smrg
1707e35d4d8eSmrgcat >>"$CONFIG_LT" <<\_LTEOF
1708e35d4d8eSmrgAC_MSG_NOTICE([creating $ofile])
1709e35d4d8eSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
1710e35d4d8eSmrgAS_EXIT(0)
1711e35d4d8eSmrg_LTEOF
1712e35d4d8eSmrgchmod +x "$CONFIG_LT"
171332b578d3Smrg
1714e35d4d8eSmrg# configure is writing to config.log, but config.lt does its own redirection,
1715e35d4d8eSmrg# appending to config.log, which fails on DOS, as config.log is still kept
1716e35d4d8eSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
1717e35d4d8eSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
1718e35d4d8eSmrglt_cl_success=:
1719e35d4d8eSmrgtest "$silent" = yes &&
1720e35d4d8eSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
1721e35d4d8eSmrgexec AS_MESSAGE_LOG_FD>/dev/null
1722e35d4d8eSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1723e35d4d8eSmrgexec AS_MESSAGE_LOG_FD>>config.log
1724e35d4d8eSmrg$lt_cl_success || AS_EXIT(1)
1725e35d4d8eSmrg])# LT_OUTPUT
172632b578d3Smrg
172732b578d3Smrg
1728e35d4d8eSmrg# _LT_CONFIG(TAG)
1729e35d4d8eSmrg# ---------------
1730e35d4d8eSmrg# If TAG is the built-in tag, create an initial libtool script with a
1731e35d4d8eSmrg# default configuration from the untagged config vars.  Otherwise add code
1732e35d4d8eSmrg# to config.status for appending the configuration named by TAG from the
1733e35d4d8eSmrg# matching tagged config vars.
1734e35d4d8eSmrgm4_defun([_LT_CONFIG],
1735e35d4d8eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1736e35d4d8eSmrg_LT_CONFIG_SAVE_COMMANDS([
1737e35d4d8eSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1738e35d4d8eSmrg  m4_if(_LT_TAG, [C], [
1739e35d4d8eSmrg    # See if we are running on zsh, and set the options which allow our
1740e35d4d8eSmrg    # commands through without removal of \ escapes.
1741e35d4d8eSmrg    if test -n "${ZSH_VERSION+set}" ; then
1742e35d4d8eSmrg      setopt NO_GLOB_SUBST
1743e35d4d8eSmrg    fi
174432b578d3Smrg
1745e35d4d8eSmrg    cfgfile="${ofile}T"
1746e35d4d8eSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1747e35d4d8eSmrg    $RM "$cfgfile"
174832b578d3Smrg
1749e35d4d8eSmrg    cat <<_LT_EOF >> "$cfgfile"
1750e35d4d8eSmrg#! $SHELL
1751e35d4d8eSmrg
1752e35d4d8eSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1753e35d4d8eSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1754e35d4d8eSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1755e35d4d8eSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1756e35d4d8eSmrg#
1757e35d4d8eSmrg_LT_COPYING
1758e35d4d8eSmrg_LT_LIBTOOL_TAGS
1759e35d4d8eSmrg
1760e35d4d8eSmrg# ### BEGIN LIBTOOL CONFIG
1761e35d4d8eSmrg_LT_LIBTOOL_CONFIG_VARS
1762e35d4d8eSmrg_LT_LIBTOOL_TAG_VARS
1763e35d4d8eSmrg# ### END LIBTOOL CONFIG
1764e35d4d8eSmrg
1765e35d4d8eSmrg_LT_EOF
176632b578d3Smrg
17672a51b5beSmrg  case $host_os in
1768e35d4d8eSmrg  aix3*)
1769e35d4d8eSmrg    cat <<\_LT_EOF >> "$cfgfile"
1770e35d4d8eSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
1771e35d4d8eSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
1772e35d4d8eSmrg# vanish in a puff of smoke.
1773e35d4d8eSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
1774e35d4d8eSmrg  COLLECT_NAMES=
1775e35d4d8eSmrg  export COLLECT_NAMES
1776e35d4d8eSmrgfi
1777e35d4d8eSmrg_LT_EOF
17782a51b5beSmrg    ;;
17792a51b5beSmrg  esac
178032b578d3Smrg
1781e35d4d8eSmrg  _LT_PROG_LTMAIN
178232b578d3Smrg
1783e35d4d8eSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
1784e35d4d8eSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1785e35d4d8eSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
1786e35d4d8eSmrg  # is reportedly fixed, but why not run on old versions too?
1787e35d4d8eSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
1788e35d4d8eSmrg     || (rm -f "$cfgfile"; exit 1)
178932b578d3Smrg
1790e35d4d8eSmrg  _LT_PROG_REPLACE_SHELLFNS
179132b578d3Smrg
1792e35d4d8eSmrg   mv -f "$cfgfile" "$ofile" ||
1793e35d4d8eSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1794e35d4d8eSmrg  chmod +x "$ofile"
1795e35d4d8eSmrg],
1796e35d4d8eSmrg[cat <<_LT_EOF >> "$ofile"
179732b578d3Smrg
1798e35d4d8eSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1799e35d4d8eSmrgdnl in a comment (ie after a #).
1800e35d4d8eSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
1801e35d4d8eSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1802e35d4d8eSmrg# ### END LIBTOOL TAG CONFIG: $1
1803e35d4d8eSmrg_LT_EOF
1804e35d4d8eSmrg])dnl /m4_if
1805e35d4d8eSmrg],
1806e35d4d8eSmrg[m4_if([$1], [], [
1807e35d4d8eSmrg    PACKAGE='$PACKAGE'
1808e35d4d8eSmrg    VERSION='$VERSION'
1809e35d4d8eSmrg    TIMESTAMP='$TIMESTAMP'
1810e35d4d8eSmrg    RM='$RM'
1811e35d4d8eSmrg    ofile='$ofile'], [])
1812e35d4d8eSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
1813e35d4d8eSmrg])# _LT_CONFIG
18142a51b5beSmrg
181532b578d3Smrg
1816e35d4d8eSmrg# LT_SUPPORTED_TAG(TAG)
1817e35d4d8eSmrg# ---------------------
1818e35d4d8eSmrg# Trace this macro to discover what tags are supported by the libtool
1819e35d4d8eSmrg# --tag option, using:
1820e35d4d8eSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1821e35d4d8eSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
182232b578d3Smrg
182332b578d3Smrg
1824e35d4d8eSmrg# C support is built-in for now
1825e35d4d8eSmrgm4_define([_LT_LANG_C_enabled], [])
1826e35d4d8eSmrgm4_define([_LT_TAGS], [])
182732b578d3Smrg
182832b578d3Smrg
1829e35d4d8eSmrg# LT_LANG(LANG)
1830e35d4d8eSmrg# -------------
1831e35d4d8eSmrg# Enable libtool support for the given language if not already enabled.
1832e35d4d8eSmrgAC_DEFUN([LT_LANG],
1833e35d4d8eSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
1834e35d4d8eSmrgm4_case([$1],
1835e35d4d8eSmrg  [C],			[_LT_LANG(C)],
1836e35d4d8eSmrg  [C++],		[_LT_LANG(CXX)],
1837e35d4d8eSmrg  [Go],			[_LT_LANG(GO)],
1838e35d4d8eSmrg  [Java],		[_LT_LANG(GCJ)],
1839e35d4d8eSmrg  [Fortran 77],		[_LT_LANG(F77)],
1840e35d4d8eSmrg  [Fortran],		[_LT_LANG(FC)],
1841e35d4d8eSmrg  [Windows Resource],	[_LT_LANG(RC)],
1842e35d4d8eSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1843e35d4d8eSmrg    [_LT_LANG($1)],
1844e35d4d8eSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1845e35d4d8eSmrg])# LT_LANG
184632b578d3Smrg
184732b578d3Smrg
1848e35d4d8eSmrg# _LT_LANG(LANGNAME)
1849e35d4d8eSmrg# ------------------
1850e35d4d8eSmrgm4_defun([_LT_LANG],
1851e35d4d8eSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1852e35d4d8eSmrg  [LT_SUPPORTED_TAG([$1])dnl
1853e35d4d8eSmrg  m4_append([_LT_TAGS], [$1 ])dnl
1854e35d4d8eSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1855e35d4d8eSmrg  _LT_LANG_$1_CONFIG($1)])dnl
1856e35d4d8eSmrg])# _LT_LANG
185732b578d3Smrg
185832b578d3Smrg
1859e35d4d8eSmrgm4_ifndef([AC_PROG_GO], [
1860e35d4d8eSmrg# NOTE: This macro has been submitted for inclusion into   #
1861e35d4d8eSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1862e35d4d8eSmrg#  a released version of Autoconf we should remove this    #
1863e35d4d8eSmrg#  macro and use it instead.                               #
1864e35d4d8eSmrgm4_defun([AC_PROG_GO],
1865e35d4d8eSmrg[AC_LANG_PUSH(Go)dnl
1866e35d4d8eSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
1867e35d4d8eSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1868e35d4d8eSmrg_AC_ARG_VAR_LDFLAGS()dnl
1869e35d4d8eSmrgAC_CHECK_TOOL(GOC, gccgo)
1870e35d4d8eSmrgif test -z "$GOC"; then
1871e35d4d8eSmrg  if test -n "$ac_tool_prefix"; then
1872e35d4d8eSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1873e35d4d8eSmrg  fi
1874e35d4d8eSmrgfi
1875e35d4d8eSmrgif test -z "$GOC"; then
1876e35d4d8eSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1877e35d4d8eSmrgfi
1878e35d4d8eSmrg])#m4_defun
1879e35d4d8eSmrg])#m4_ifndef
188032b578d3Smrg
1881d31dbc53Smrg
1882e35d4d8eSmrg# _LT_LANG_DEFAULT_CONFIG
1883e35d4d8eSmrg# -----------------------
1884e35d4d8eSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
1885e35d4d8eSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1886e35d4d8eSmrg  [LT_LANG(CXX)],
1887e35d4d8eSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
188832b578d3Smrg
1889e35d4d8eSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
1890e35d4d8eSmrg  [LT_LANG(F77)],
1891e35d4d8eSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
189232b578d3Smrg
1893e35d4d8eSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
1894e35d4d8eSmrg  [LT_LANG(FC)],
1895e35d4d8eSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
189632b578d3Smrg
1897e35d4d8eSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
1898e35d4d8eSmrgdnl pulling things in needlessly.
1899e35d4d8eSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
1900e35d4d8eSmrg  [LT_LANG(GCJ)],
1901e35d4d8eSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1902e35d4d8eSmrg    [LT_LANG(GCJ)],
1903e35d4d8eSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
1904e35d4d8eSmrg      [LT_LANG(GCJ)],
1905e35d4d8eSmrg      [m4_ifdef([AC_PROG_GCJ],
1906e35d4d8eSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
1907e35d4d8eSmrg       m4_ifdef([A][M_PROG_GCJ],
1908e35d4d8eSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
1909e35d4d8eSmrg       m4_ifdef([LT_PROG_GCJ],
1910e35d4d8eSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
191132b578d3Smrg
1912e35d4d8eSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
1913e35d4d8eSmrg  [LT_LANG(GO)],
1914e35d4d8eSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
191532b578d3Smrg
1916e35d4d8eSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
1917e35d4d8eSmrg  [LT_LANG(RC)],
1918e35d4d8eSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
1919e35d4d8eSmrg])# _LT_LANG_DEFAULT_CONFIG
192032b578d3Smrg
1921e35d4d8eSmrg# Obsolete macros:
1922e35d4d8eSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
1923e35d4d8eSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
1924e35d4d8eSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
1925e35d4d8eSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
1926e35d4d8eSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
1927e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
1928e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
1929e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
1930e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
1931e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
1932e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
19331b12faf6Smrg
193432b578d3Smrg
1935e35d4d8eSmrg# _LT_TAG_COMPILER
1936e35d4d8eSmrg# ----------------
1937e35d4d8eSmrgm4_defun([_LT_TAG_COMPILER],
1938e35d4d8eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
193932b578d3Smrg
1940e35d4d8eSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
1941e35d4d8eSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
1942e35d4d8eSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
1943e35d4d8eSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
194432b578d3Smrg
1945e35d4d8eSmrg# If no C compiler was specified, use CC.
1946e35d4d8eSmrgLTCC=${LTCC-"$CC"}
19471b12faf6Smrg
1948e35d4d8eSmrg# If no C compiler flags were specified, use CFLAGS.
1949e35d4d8eSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
195032b578d3Smrg
1951e35d4d8eSmrg# Allow CC to be a program name with arguments.
1952e35d4d8eSmrgcompiler=$CC
1953e35d4d8eSmrg])# _LT_TAG_COMPILER
195432b578d3Smrg
195532b578d3Smrg
1956e35d4d8eSmrg# _LT_COMPILER_BOILERPLATE
1957e35d4d8eSmrg# ------------------------
1958e35d4d8eSmrg# Check for compiler boilerplate output or warnings with
1959e35d4d8eSmrg# the simple compiler test code.
1960e35d4d8eSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
1961e35d4d8eSmrg[m4_require([_LT_DECL_SED])dnl
1962e35d4d8eSmrgac_outfile=conftest.$ac_objext
1963e35d4d8eSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
1964e35d4d8eSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1965e35d4d8eSmrg_lt_compiler_boilerplate=`cat conftest.err`
1966e35d4d8eSmrg$RM conftest*
1967e35d4d8eSmrg])# _LT_COMPILER_BOILERPLATE
196832b578d3Smrg
196932b578d3Smrg
1970e35d4d8eSmrg# _LT_LINKER_BOILERPLATE
1971e35d4d8eSmrg# ----------------------
1972e35d4d8eSmrg# Check for linker boilerplate output or warnings with
1973e35d4d8eSmrg# the simple link test code.
1974e35d4d8eSmrgm4_defun([_LT_LINKER_BOILERPLATE],
1975e35d4d8eSmrg[m4_require([_LT_DECL_SED])dnl
1976e35d4d8eSmrgac_outfile=conftest.$ac_objext
1977e35d4d8eSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
1978e35d4d8eSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1979e35d4d8eSmrg_lt_linker_boilerplate=`cat conftest.err`
1980e35d4d8eSmrg$RM -r conftest*
1981e35d4d8eSmrg])# _LT_LINKER_BOILERPLATE
198232b578d3Smrg
1983e35d4d8eSmrg# _LT_REQUIRED_DARWIN_CHECKS
1984e35d4d8eSmrg# -------------------------
1985e35d4d8eSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
1986e35d4d8eSmrg  case $host_os in
1987e35d4d8eSmrg    rhapsody* | darwin*)
1988e35d4d8eSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
1989e35d4d8eSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
1990e35d4d8eSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
1991e35d4d8eSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
1992e35d4d8eSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1993e35d4d8eSmrg    _LT_DECL([], [DSYMUTIL], [1],
1994e35d4d8eSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1995e35d4d8eSmrg    _LT_DECL([], [NMEDIT], [1],
1996e35d4d8eSmrg      [Tool to change global to local symbols on Mac OS X])
1997e35d4d8eSmrg    _LT_DECL([], [LIPO], [1],
1998e35d4d8eSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
1999e35d4d8eSmrg    _LT_DECL([], [OTOOL], [1],
2000e35d4d8eSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2001e35d4d8eSmrg    _LT_DECL([], [OTOOL64], [1],
2002e35d4d8eSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
200332b578d3Smrg
2004e35d4d8eSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2005e35d4d8eSmrg      [lt_cv_apple_cc_single_mod=no
2006e35d4d8eSmrg      if test -z "${LT_MULTI_MODULE}"; then
2007e35d4d8eSmrg	# By default we will add the -single_module flag. You can override
2008e35d4d8eSmrg	# by either setting the environment variable LT_MULTI_MODULE
2009e35d4d8eSmrg	# non-empty at configure time, or by adding -multi_module to the
2010e35d4d8eSmrg	# link flags.
2011e35d4d8eSmrg	rm -rf libconftest.dylib*
2012e35d4d8eSmrg	echo "int foo(void){return 1;}" > conftest.c
2013e35d4d8eSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2014e35d4d8eSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2015e35d4d8eSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2016e35d4d8eSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2017e35d4d8eSmrg        _lt_result=$?
2018e35d4d8eSmrg	# If there is a non-empty error log, and "single_module"
2019e35d4d8eSmrg	# appears in it, assume the flag caused a linker warning
2020e35d4d8eSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
2021e35d4d8eSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
2022e35d4d8eSmrg	# Otherwise, if the output was created with a 0 exit code from
2023e35d4d8eSmrg	# the compiler, it worked.
2024e35d4d8eSmrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2025e35d4d8eSmrg	  lt_cv_apple_cc_single_mod=yes
2026e35d4d8eSmrg	else
2027e35d4d8eSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
2028e35d4d8eSmrg	fi
2029e35d4d8eSmrg	rm -rf libconftest.dylib*
2030e35d4d8eSmrg	rm -f conftest.*
2031e35d4d8eSmrg      fi])
203232b578d3Smrg
2033e35d4d8eSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2034e35d4d8eSmrg      [lt_cv_ld_exported_symbols_list],
2035e35d4d8eSmrg      [lt_cv_ld_exported_symbols_list=no
2036e35d4d8eSmrg      save_LDFLAGS=$LDFLAGS
2037e35d4d8eSmrg      echo "_main" > conftest.sym
2038e35d4d8eSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2039e35d4d8eSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2040e35d4d8eSmrg	[lt_cv_ld_exported_symbols_list=yes],
2041e35d4d8eSmrg	[lt_cv_ld_exported_symbols_list=no])
2042e35d4d8eSmrg	LDFLAGS="$save_LDFLAGS"
2043e35d4d8eSmrg    ])
204432b578d3Smrg
2045e35d4d8eSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2046e35d4d8eSmrg      [lt_cv_ld_force_load=no
2047e35d4d8eSmrg      cat > conftest.c << _LT_EOF
2048e35d4d8eSmrgint forced_loaded() { return 2;}
2049e35d4d8eSmrg_LT_EOF
2050e35d4d8eSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2051e35d4d8eSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2052e35d4d8eSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2053e35d4d8eSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2054e35d4d8eSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2055e35d4d8eSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2056e35d4d8eSmrg      cat > conftest.c << _LT_EOF
2057e35d4d8eSmrgint main() { return 0;}
2058e35d4d8eSmrg_LT_EOF
2059e35d4d8eSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2060e35d4d8eSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2061e35d4d8eSmrg      _lt_result=$?
2062e35d4d8eSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
2063e35d4d8eSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
2064e35d4d8eSmrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2065e35d4d8eSmrg	lt_cv_ld_force_load=yes
2066e35d4d8eSmrg      else
2067e35d4d8eSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
2068e35d4d8eSmrg      fi
2069e35d4d8eSmrg        rm -f conftest.err libconftest.a conftest conftest.c
2070e35d4d8eSmrg        rm -rf conftest.dSYM
2071e35d4d8eSmrg    ])
2072e35d4d8eSmrg    case $host_os in
2073e35d4d8eSmrg    rhapsody* | darwin1.[[012]])
2074e35d4d8eSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2075e35d4d8eSmrg    darwin1.*)
2076e35d4d8eSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2077e35d4d8eSmrg    darwin*) # darwin 5.x on
2078e35d4d8eSmrg      # if running on 10.5 or later, the deployment target defaults
2079e35d4d8eSmrg      # to the OS version, if on x86, and 10.4, the deployment
2080e35d4d8eSmrg      # target defaults to 10.4. Don't you love it?
2081e35d4d8eSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2082e35d4d8eSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2083e35d4d8eSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2084e35d4d8eSmrg	10.[[012]]*)
2085e35d4d8eSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2086e35d4d8eSmrg	10.*)
2087e35d4d8eSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2088e35d4d8eSmrg      esac
2089e35d4d8eSmrg    ;;
20902a51b5beSmrg  esac
2091e35d4d8eSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2092e35d4d8eSmrg      _lt_dar_single_mod='$single_module'
2093e35d4d8eSmrg    fi
2094e35d4d8eSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2095e35d4d8eSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2096e35d4d8eSmrg    else
2097e35d4d8eSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2098e35d4d8eSmrg    fi
2099e35d4d8eSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2100e35d4d8eSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
2101e35d4d8eSmrg    else
2102e35d4d8eSmrg      _lt_dsymutil=
2103e35d4d8eSmrg    fi
2104e35d4d8eSmrg    ;;
2105e35d4d8eSmrg  esac
2106e35d4d8eSmrg])
210732b578d3Smrg
210832b578d3Smrg
2109e35d4d8eSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
2110e35d4d8eSmrg# ---------------------------------
2111e35d4d8eSmrg# Checks for linker and compiler features on darwin
2112e35d4d8eSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
2113e35d4d8eSmrg[
2114e35d4d8eSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2115e35d4d8eSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2116e35d4d8eSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
2117e35d4d8eSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
2118e35d4d8eSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2119e35d4d8eSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
2120e35d4d8eSmrg    _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\"`'
2121e35d4d8eSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2122e35d4d8eSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
21232a51b5beSmrg  else
2124e35d4d8eSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
21252a51b5beSmrg  fi
2126e35d4d8eSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
2127e35d4d8eSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2128e35d4d8eSmrg  case $cc_basename in
2129e35d4d8eSmrg     ifort*) _lt_dar_can_shared=yes ;;
2130e35d4d8eSmrg     *) _lt_dar_can_shared=$GCC ;;
2131e35d4d8eSmrg  esac
2132e35d4d8eSmrg  if test "$_lt_dar_can_shared" = "yes"; then
2133e35d4d8eSmrg    output_verbose_link_cmd=func_echo_all
2134e35d4d8eSmrg    _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}"
2135e35d4d8eSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2136e35d4d8eSmrg    _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}"
2137e35d4d8eSmrg    _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}"
2138e35d4d8eSmrg    m4_if([$1], [CXX],
2139e35d4d8eSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2140e35d4d8eSmrg      _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}"
2141e35d4d8eSmrg      _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}"
2142e35d4d8eSmrg    fi
2143e35d4d8eSmrg],[])
2144e35d4d8eSmrg  else
2145e35d4d8eSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
2146e35d4d8eSmrg  fi
2147e35d4d8eSmrg])
214832b578d3Smrg
2149e35d4d8eSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2150e35d4d8eSmrg# ----------------------------------
2151e35d4d8eSmrg# Links a minimal program and checks the executable
2152e35d4d8eSmrg# for the system default hardcoded library path. In most cases,
2153e35d4d8eSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
2154e35d4d8eSmrg# the location of the communication and MPI libs are included too.
2155e35d4d8eSmrg# If we don't find anything, use the default library path according
2156e35d4d8eSmrg# to the aix ld manual.
2157e35d4d8eSmrg# Store the results from the different compilers for each TAGNAME.
2158e35d4d8eSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
2159e35d4d8eSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
2160e35d4d8eSmrg[m4_require([_LT_DECL_SED])dnl
2161e35d4d8eSmrgif test "${lt_cv_aix_libpath+set}" = set; then
2162e35d4d8eSmrg  aix_libpath=$lt_cv_aix_libpath
2163e35d4d8eSmrgelse
2164e35d4d8eSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2165e35d4d8eSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2166e35d4d8eSmrg  lt_aix_libpath_sed='[
2167e35d4d8eSmrg      /Import File Strings/,/^$/ {
2168e35d4d8eSmrg	  /^0/ {
2169e35d4d8eSmrg	      s/^0  *\([^ ]*\) *$/\1/
2170e35d4d8eSmrg	      p
2171e35d4d8eSmrg	  }
2172e35d4d8eSmrg      }]'
2173e35d4d8eSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2174e35d4d8eSmrg  # Check for a 64-bit object if we didn't find anything.
2175e35d4d8eSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2176e35d4d8eSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2177e35d4d8eSmrg  fi],[])
2178e35d4d8eSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2179e35d4d8eSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2180e35d4d8eSmrg  fi
2181e35d4d8eSmrg  ])
2182e35d4d8eSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
21832a51b5beSmrgfi
2184e35d4d8eSmrg])# _LT_SYS_MODULE_PATH_AIX
2185d31dbc53Smrg
21861b12faf6Smrg
2187e35d4d8eSmrg# _LT_SHELL_INIT(ARG)
2188e35d4d8eSmrg# -------------------
2189e35d4d8eSmrgm4_define([_LT_SHELL_INIT],
2190e35d4d8eSmrg[m4_divert_text([M4SH-INIT], [$1
2191e35d4d8eSmrg])])# _LT_SHELL_INIT
21921b12faf6Smrg
219332b578d3Smrg
219432b578d3Smrg
2195e35d4d8eSmrg# _LT_PROG_ECHO_BACKSLASH
2196e35d4d8eSmrg# -----------------------
2197e35d4d8eSmrg# Find how we can fake an echo command that does not interpret backslash.
2198e35d4d8eSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
2199e35d4d8eSmrg# of the generated configure script which will find a shell with a builtin
2200e35d4d8eSmrg# printf (which we can use as an echo command).
2201e35d4d8eSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
2202e35d4d8eSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2203e35d4d8eSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2204e35d4d8eSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2205e35d4d8eSmrg
2206e35d4d8eSmrgAC_MSG_CHECKING([how to print strings])
2207e35d4d8eSmrg# Test print first, because it will be a builtin if present.
2208e35d4d8eSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2209e35d4d8eSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2210e35d4d8eSmrg  ECHO='print -r --'
2211e35d4d8eSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2212e35d4d8eSmrg  ECHO='printf %s\n'
22132a51b5beSmrgelse
2214e35d4d8eSmrg  # Use this function as a fallback that always works.
2215e35d4d8eSmrg  func_fallback_echo ()
2216e35d4d8eSmrg  {
2217e35d4d8eSmrg    eval 'cat <<_LTECHO_EOF
2218e35d4d8eSmrg$[]1
2219e35d4d8eSmrg_LTECHO_EOF'
2220e35d4d8eSmrg  }
2221e35d4d8eSmrg  ECHO='func_fallback_echo'
2222d31dbc53Smrgfi
222332b578d3Smrg
2224e35d4d8eSmrg# func_echo_all arg...
2225e35d4d8eSmrg# Invoke $ECHO with all args, space-separated.
2226e35d4d8eSmrgfunc_echo_all ()
2227e35d4d8eSmrg{
2228e35d4d8eSmrg    $ECHO "$*" 
2229e35d4d8eSmrg}
223032b578d3Smrg
2231e35d4d8eSmrgcase "$ECHO" in
2232e35d4d8eSmrg  printf*) AC_MSG_RESULT([printf]) ;;
2233e35d4d8eSmrg  print*) AC_MSG_RESULT([print -r]) ;;
2234e35d4d8eSmrg  *) AC_MSG_RESULT([cat]) ;;
2235e35d4d8eSmrgesac
22361b12faf6Smrg
2237e35d4d8eSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
2238e35d4d8eSmrg[_AS_DETECT_SUGGESTED([
2239e35d4d8eSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2240e35d4d8eSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2241e35d4d8eSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2242e35d4d8eSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2243e35d4d8eSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
2244e35d4d8eSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
2245e35d4d8eSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
22462a51b5beSmrg
2247e35d4d8eSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2248e35d4d8eSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2249e35d4d8eSmrg])# _LT_PROG_ECHO_BACKSLASH
22502a51b5beSmrg
22511b12faf6Smrg
2252e35d4d8eSmrg# _LT_WITH_SYSROOT
2253e35d4d8eSmrg# ----------------
2254e35d4d8eSmrgAC_DEFUN([_LT_WITH_SYSROOT],
2255e35d4d8eSmrg[AC_MSG_CHECKING([for sysroot])
2256e35d4d8eSmrgAC_ARG_WITH([sysroot],
2257e35d4d8eSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2258e35d4d8eSmrg                        (or the compiler's sysroot if not specified).],
2259e35d4d8eSmrg[], [with_sysroot=no])
2260e35d4d8eSmrg
2261e35d4d8eSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
2262e35d4d8eSmrgdnl in case the user passed a directory name.
2263e35d4d8eSmrglt_sysroot=
2264e35d4d8eSmrgcase ${with_sysroot} in #(
2265e35d4d8eSmrg yes)
2266e35d4d8eSmrg   if test "$GCC" = yes; then
2267e35d4d8eSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2268e35d4d8eSmrg   fi
2269e35d4d8eSmrg   ;; #(
2270e35d4d8eSmrg /*)
2271e35d4d8eSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2272e35d4d8eSmrg   ;; #(
2273e35d4d8eSmrg no|'')
2274e35d4d8eSmrg   ;; #(
2275e35d4d8eSmrg *)
2276e35d4d8eSmrg   AC_MSG_RESULT([${with_sysroot}])
2277e35d4d8eSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
2278e35d4d8eSmrg   ;;
2279e35d4d8eSmrgesac
22801b12faf6Smrg
2281e35d4d8eSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
2282e35d4d8eSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2283e35d4d8eSmrg[dependent libraries, and in which our libraries should be installed.])])
22841b12faf6Smrg
2285e35d4d8eSmrg# _LT_ENABLE_LOCK
2286e35d4d8eSmrg# ---------------
2287e35d4d8eSmrgm4_defun([_LT_ENABLE_LOCK],
2288e35d4d8eSmrg[AC_ARG_ENABLE([libtool-lock],
2289e35d4d8eSmrg  [AS_HELP_STRING([--disable-libtool-lock],
2290e35d4d8eSmrg    [avoid locking (might break parallel builds)])])
2291e35d4d8eSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
22921b12faf6Smrg
2293e35d4d8eSmrg# Some flags need to be propagated to the compiler or linker for good
2294e35d4d8eSmrg# libtool support.
2295e35d4d8eSmrgcase $host in
2296e35d4d8eSmrgia64-*-hpux*)
2297e35d4d8eSmrg  # Find out which ABI we are using.
2298e35d4d8eSmrg  echo 'int i;' > conftest.$ac_ext
2299e35d4d8eSmrg  if AC_TRY_EVAL(ac_compile); then
2300e35d4d8eSmrg    case `/usr/bin/file conftest.$ac_objext` in
2301e35d4d8eSmrg      *ELF-32*)
2302e35d4d8eSmrg	HPUX_IA64_MODE="32"
2303e35d4d8eSmrg	;;
2304e35d4d8eSmrg      *ELF-64*)
2305e35d4d8eSmrg	HPUX_IA64_MODE="64"
2306e35d4d8eSmrg	;;
2307e35d4d8eSmrg    esac
2308e35d4d8eSmrg  fi
2309e35d4d8eSmrg  rm -rf conftest*
23102a51b5beSmrg  ;;
2311e35d4d8eSmrg*-*-irix6*)
2312e35d4d8eSmrg  # Find out which ABI we are using.
2313e35d4d8eSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2314e35d4d8eSmrg  if AC_TRY_EVAL(ac_compile); then
2315e35d4d8eSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
2316e35d4d8eSmrg      case `/usr/bin/file conftest.$ac_objext` in
2317e35d4d8eSmrg	*32-bit*)
2318e35d4d8eSmrg	  LD="${LD-ld} -melf32bsmip"
2319e35d4d8eSmrg	  ;;
2320e35d4d8eSmrg	*N32*)
2321e35d4d8eSmrg	  LD="${LD-ld} -melf32bmipn32"
2322e35d4d8eSmrg	  ;;
2323e35d4d8eSmrg	*64-bit*)
2324e35d4d8eSmrg	  LD="${LD-ld} -melf64bmip"
2325e35d4d8eSmrg	;;
2326e35d4d8eSmrg      esac
23272a51b5beSmrg    else
2328e35d4d8eSmrg      case `/usr/bin/file conftest.$ac_objext` in
2329e35d4d8eSmrg	*32-bit*)
2330e35d4d8eSmrg	  LD="${LD-ld} -32"
2331e35d4d8eSmrg	  ;;
2332e35d4d8eSmrg	*N32*)
2333e35d4d8eSmrg	  LD="${LD-ld} -n32"
2334e35d4d8eSmrg	  ;;
2335e35d4d8eSmrg	*64-bit*)
2336e35d4d8eSmrg	  LD="${LD-ld} -64"
2337e35d4d8eSmrg	  ;;
2338e35d4d8eSmrg      esac
23392a51b5beSmrg    fi
2340d31dbc53Smrg  fi
2341e35d4d8eSmrg  rm -rf conftest*
2342d31dbc53Smrg  ;;
23432a51b5beSmrg
2344e35d4d8eSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2345e35d4d8eSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2346e35d4d8eSmrg  # Find out which ABI we are using.
2347e35d4d8eSmrg  echo 'int i;' > conftest.$ac_ext
2348e35d4d8eSmrg  if AC_TRY_EVAL(ac_compile); then
2349e35d4d8eSmrg    case `/usr/bin/file conftest.o` in
2350e35d4d8eSmrg      *32-bit*)
2351e35d4d8eSmrg	case $host in
2352e35d4d8eSmrg	  x86_64-*kfreebsd*-gnu)
2353e35d4d8eSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
2354e35d4d8eSmrg	    ;;
2355e35d4d8eSmrg	  x86_64-*linux*)
2356e35d4d8eSmrg	    LD="${LD-ld} -m elf_i386"
2357e35d4d8eSmrg	    ;;
2358e35d4d8eSmrg	  ppc64-*linux*|powerpc64-*linux*)
2359e35d4d8eSmrg	    LD="${LD-ld} -m elf32ppclinux"
2360e35d4d8eSmrg	    ;;
2361e35d4d8eSmrg	  s390x-*linux*)
2362e35d4d8eSmrg	    LD="${LD-ld} -m elf_s390"
2363e35d4d8eSmrg	    ;;
2364e35d4d8eSmrg	  sparc64-*linux*)
2365e35d4d8eSmrg	    LD="${LD-ld} -m elf32_sparc"
2366e35d4d8eSmrg	    ;;
2367e35d4d8eSmrg	esac
2368e35d4d8eSmrg	;;
2369e35d4d8eSmrg      *64-bit*)
2370e35d4d8eSmrg	case $host in
2371e35d4d8eSmrg	  x86_64-*kfreebsd*-gnu)
2372e35d4d8eSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
2373e35d4d8eSmrg	    ;;
2374e35d4d8eSmrg	  x86_64-*linux*)
2375e35d4d8eSmrg	    LD="${LD-ld} -m elf_x86_64"
2376e35d4d8eSmrg	    ;;
2377e35d4d8eSmrg	  ppc*-*linux*|powerpc*-*linux*)
2378e35d4d8eSmrg	    LD="${LD-ld} -m elf64ppc"
2379e35d4d8eSmrg	    ;;
2380e35d4d8eSmrg	  s390*-*linux*|s390*-*tpf*)
2381e35d4d8eSmrg	    LD="${LD-ld} -m elf64_s390"
2382e35d4d8eSmrg	    ;;
2383e35d4d8eSmrg	  sparc*-*linux*)
2384e35d4d8eSmrg	    LD="${LD-ld} -m elf64_sparc"
2385e35d4d8eSmrg	    ;;
2386e35d4d8eSmrg	esac
2387e35d4d8eSmrg	;;
2388e35d4d8eSmrg    esac
2389e35d4d8eSmrg  fi
2390e35d4d8eSmrg  rm -rf conftest*
23911b12faf6Smrg  ;;
23921b12faf6Smrg
2393e35d4d8eSmrg*-*-sco3.2v5*)
2394e35d4d8eSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2395e35d4d8eSmrg  SAVE_CFLAGS="$CFLAGS"
2396e35d4d8eSmrg  CFLAGS="$CFLAGS -belf"
2397e35d4d8eSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2398e35d4d8eSmrg    [AC_LANG_PUSH(C)
2399e35d4d8eSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2400e35d4d8eSmrg     AC_LANG_POP])
2401e35d4d8eSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2402e35d4d8eSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2403e35d4d8eSmrg    CFLAGS="$SAVE_CFLAGS"
2404e35d4d8eSmrg  fi
24052a51b5beSmrg  ;;
2406e35d4d8eSmrg*-*solaris*)
2407e35d4d8eSmrg  # Find out which ABI we are using.
2408e35d4d8eSmrg  echo 'int i;' > conftest.$ac_ext
2409e35d4d8eSmrg  if AC_TRY_EVAL(ac_compile); then
2410e35d4d8eSmrg    case `/usr/bin/file conftest.o` in
2411e35d4d8eSmrg    *64-bit*)
2412e35d4d8eSmrg      case $lt_cv_prog_gnu_ld in
2413e35d4d8eSmrg      yes*)
2414e35d4d8eSmrg        case $host in
2415e35d4d8eSmrg        i?86-*-solaris*)
2416e35d4d8eSmrg          LD="${LD-ld} -m elf_x86_64"
2417e35d4d8eSmrg          ;;
2418e35d4d8eSmrg        sparc*-*-solaris*)
2419e35d4d8eSmrg          LD="${LD-ld} -m elf64_sparc"
2420e35d4d8eSmrg          ;;
2421e35d4d8eSmrg        esac
2422e35d4d8eSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2423e35d4d8eSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2424e35d4d8eSmrg          LD="${LD-ld}_sol2"
2425e35d4d8eSmrg        fi
2426e35d4d8eSmrg        ;;
2427e35d4d8eSmrg      *)
2428e35d4d8eSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2429e35d4d8eSmrg	  LD="${LD-ld} -64"
2430e35d4d8eSmrg	fi
2431e35d4d8eSmrg	;;
2432e35d4d8eSmrg      esac
2433d31dbc53Smrg      ;;
2434d31dbc53Smrg    esac
2435d31dbc53Smrg  fi
2436e35d4d8eSmrg  rm -rf conftest*
2437d31dbc53Smrg  ;;
2438e35d4d8eSmrgesac
243932b578d3Smrg
2440e35d4d8eSmrgneed_locks="$enable_libtool_lock"
2441e35d4d8eSmrg])# _LT_ENABLE_LOCK
244232b578d3Smrg
244332b578d3Smrg
2444e35d4d8eSmrg# _LT_PROG_AR
2445e35d4d8eSmrg# -----------
2446e35d4d8eSmrgm4_defun([_LT_PROG_AR],
2447e35d4d8eSmrg[AC_CHECK_TOOLS(AR, [ar], false)
2448e35d4d8eSmrg: ${AR=ar}
2449e35d4d8eSmrg: ${AR_FLAGS=cru}
2450e35d4d8eSmrg_LT_DECL([], [AR], [1], [The archiver])
2451e35d4d8eSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2452e35d4d8eSmrg
2453e35d4d8eSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2454e35d4d8eSmrg  [lt_cv_ar_at_file=no
2455e35d4d8eSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2456e35d4d8eSmrg     [echo conftest.$ac_objext > conftest.lst
2457e35d4d8eSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2458e35d4d8eSmrg      AC_TRY_EVAL([lt_ar_try])
2459e35d4d8eSmrg      if test "$ac_status" -eq 0; then
2460e35d4d8eSmrg	# Ensure the archiver fails upon bogus file names.
2461e35d4d8eSmrg	rm -f conftest.$ac_objext libconftest.a
2462e35d4d8eSmrg	AC_TRY_EVAL([lt_ar_try])
2463e35d4d8eSmrg	if test "$ac_status" -ne 0; then
2464e35d4d8eSmrg          lt_cv_ar_at_file=@
2465e35d4d8eSmrg        fi
2466e35d4d8eSmrg      fi
2467e35d4d8eSmrg      rm -f conftest.* libconftest.a
2468e35d4d8eSmrg     ])
2469e35d4d8eSmrg  ])
247032b578d3Smrg
2471e35d4d8eSmrgif test "x$lt_cv_ar_at_file" = xno; then
2472e35d4d8eSmrg  archiver_list_spec=
2473e35d4d8eSmrgelse
2474e35d4d8eSmrg  archiver_list_spec=$lt_cv_ar_at_file
2475e35d4d8eSmrgfi
2476e35d4d8eSmrg_LT_DECL([], [archiver_list_spec], [1],
2477e35d4d8eSmrg  [How to feed a file listing to the archiver])
2478e35d4d8eSmrg])# _LT_PROG_AR
247932b578d3Smrg
248032b578d3Smrg
2481e35d4d8eSmrg# _LT_CMD_OLD_ARCHIVE
2482e35d4d8eSmrg# -------------------
2483e35d4d8eSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
2484e35d4d8eSmrg[_LT_PROG_AR
248532b578d3Smrg
2486e35d4d8eSmrgAC_CHECK_TOOL(STRIP, strip, :)
2487e35d4d8eSmrgtest -z "$STRIP" && STRIP=:
2488e35d4d8eSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2489d31dbc53Smrg
2490e35d4d8eSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
2491e35d4d8eSmrgtest -z "$RANLIB" && RANLIB=:
2492e35d4d8eSmrg_LT_DECL([], [RANLIB], [1],
2493e35d4d8eSmrg    [Commands used to install an old-style archive])
2494d31dbc53Smrg
2495e35d4d8eSmrg# Determine commands to create old-style static archives.
2496e35d4d8eSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2497e35d4d8eSmrgold_postinstall_cmds='chmod 644 $oldlib'
2498e35d4d8eSmrgold_postuninstall_cmds=
24991b12faf6Smrg
2500e35d4d8eSmrgif test -n "$RANLIB"; then
2501e35d4d8eSmrg  case $host_os in
2502e35d4d8eSmrg  openbsd*)
2503e35d4d8eSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
250432b578d3Smrg    ;;
2505e35d4d8eSmrg  *)
2506e35d4d8eSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2507d31dbc53Smrg    ;;
2508d31dbc53Smrg  esac
2509e35d4d8eSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2510e35d4d8eSmrgfi
25112a51b5beSmrg
2512e35d4d8eSmrgcase $host_os in
2513e35d4d8eSmrg  darwin*)
2514e35d4d8eSmrg    lock_old_archive_extraction=yes ;;
2515e35d4d8eSmrg  *)
2516e35d4d8eSmrg    lock_old_archive_extraction=no ;;
25172a51b5beSmrgesac
2518e35d4d8eSmrg_LT_DECL([], [old_postinstall_cmds], [2])
2519e35d4d8eSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
2520e35d4d8eSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
2521e35d4d8eSmrg    [Commands used to build an old-style archive])
2522e35d4d8eSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
2523e35d4d8eSmrg    [Whether to use a lock for old archive extraction])
2524e35d4d8eSmrg])# _LT_CMD_OLD_ARCHIVE
25251b12faf6Smrg
252632b578d3Smrg
2527e35d4d8eSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2528e35d4d8eSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2529e35d4d8eSmrg# ----------------------------------------------------------------
2530e35d4d8eSmrg# Check whether the given compiler option works
2531e35d4d8eSmrgAC_DEFUN([_LT_COMPILER_OPTION],
2532e35d4d8eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2533e35d4d8eSmrgm4_require([_LT_DECL_SED])dnl
2534e35d4d8eSmrgAC_CACHE_CHECK([$1], [$2],
2535e35d4d8eSmrg  [$2=no
2536e35d4d8eSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2537e35d4d8eSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2538e35d4d8eSmrg   lt_compiler_flag="$3"
2539e35d4d8eSmrg   # Insert the option either (1) after the last *FLAGS variable, or
2540e35d4d8eSmrg   # (2) before a word containing "conftest.", or (3) at the end.
2541e35d4d8eSmrg   # Note that $ac_compile itself does not contain backslashes and begins
2542e35d4d8eSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2543e35d4d8eSmrg   # The option is referenced via a variable to avoid confusing sed.
2544e35d4d8eSmrg   lt_compile=`echo "$ac_compile" | $SED \
2545e35d4d8eSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2546e35d4d8eSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2547e35d4d8eSmrg   -e 's:$: $lt_compiler_flag:'`
2548e35d4d8eSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2549e35d4d8eSmrg   (eval "$lt_compile" 2>conftest.err)
2550e35d4d8eSmrg   ac_status=$?
2551e35d4d8eSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
2552e35d4d8eSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2553e35d4d8eSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
2554e35d4d8eSmrg     # The compiler can only warn and ignore the option if not recognized
2555e35d4d8eSmrg     # So say no if there are warnings other than the usual output.
2556e35d4d8eSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2557e35d4d8eSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2558e35d4d8eSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2559e35d4d8eSmrg       $2=yes
2560e35d4d8eSmrg     fi
2561e35d4d8eSmrg   fi
2562e35d4d8eSmrg   $RM conftest*
2563e35d4d8eSmrg])
256432b578d3Smrg
2565e35d4d8eSmrgif test x"[$]$2" = xyes; then
2566e35d4d8eSmrg    m4_if([$5], , :, [$5])
25671b12faf6Smrgelse
2568e35d4d8eSmrg    m4_if([$6], , :, [$6])
25691b12faf6Smrgfi
2570e35d4d8eSmrg])# _LT_COMPILER_OPTION
257132b578d3Smrg
2572e35d4d8eSmrg# Old name:
2573e35d4d8eSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
25741b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
2575e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
257632b578d3Smrg
25771b12faf6Smrg
2578e35d4d8eSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2579e35d4d8eSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2580e35d4d8eSmrg# ----------------------------------------------------
2581e35d4d8eSmrg# Check whether the given linker option works
2582e35d4d8eSmrgAC_DEFUN([_LT_LINKER_OPTION],
2583e35d4d8eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2584e35d4d8eSmrgm4_require([_LT_DECL_SED])dnl
2585e35d4d8eSmrgAC_CACHE_CHECK([$1], [$2],
2586e35d4d8eSmrg  [$2=no
2587e35d4d8eSmrg   save_LDFLAGS="$LDFLAGS"
2588e35d4d8eSmrg   LDFLAGS="$LDFLAGS $3"
2589e35d4d8eSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2590e35d4d8eSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2591e35d4d8eSmrg     # The linker can only warn and ignore the option if not recognized
2592e35d4d8eSmrg     # So say no if there are warnings
2593e35d4d8eSmrg     if test -s conftest.err; then
2594e35d4d8eSmrg       # Append any errors to the config.log.
2595e35d4d8eSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2596e35d4d8eSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2597e35d4d8eSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2598e35d4d8eSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
2599e35d4d8eSmrg         $2=yes
2600e35d4d8eSmrg       fi
2601e35d4d8eSmrg     else
2602e35d4d8eSmrg       $2=yes
2603e35d4d8eSmrg     fi
2604e35d4d8eSmrg   fi
2605e35d4d8eSmrg   $RM -r conftest*
2606e35d4d8eSmrg   LDFLAGS="$save_LDFLAGS"
2607e35d4d8eSmrg])
2608e35d4d8eSmrg
2609e35d4d8eSmrgif test x"[$]$2" = xyes; then
2610e35d4d8eSmrg    m4_if([$4], , :, [$4])
2611e35d4d8eSmrgelse
2612e35d4d8eSmrg    m4_if([$5], , :, [$5])
2613e35d4d8eSmrgfi
2614e35d4d8eSmrg])# _LT_LINKER_OPTION
261532b578d3Smrg
26161b12faf6Smrg# Old name:
2617e35d4d8eSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
26181b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
2619e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
262032b578d3Smrg
262132b578d3Smrg
2622e35d4d8eSmrg# LT_CMD_MAX_LEN
2623e35d4d8eSmrg#---------------
2624e35d4d8eSmrgAC_DEFUN([LT_CMD_MAX_LEN],
26251b12faf6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2626e35d4d8eSmrg# find the maximum length of command line arguments
2627e35d4d8eSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
2628e35d4d8eSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2629e35d4d8eSmrg  i=0
2630e35d4d8eSmrg  teststring="ABCD"
263132b578d3Smrg
2632e35d4d8eSmrg  case $build_os in
2633e35d4d8eSmrg  msdosdjgpp*)
2634e35d4d8eSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
2635e35d4d8eSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
2636e35d4d8eSmrg    # during glob expansion).  Even if it were fixed, the result of this
2637e35d4d8eSmrg    # check would be larger than it should be.
2638e35d4d8eSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2639e35d4d8eSmrg    ;;
2640d31dbc53Smrg
2641e35d4d8eSmrg  gnu*)
2642e35d4d8eSmrg    # Under GNU Hurd, this test is not required because there is
2643e35d4d8eSmrg    # no limit to the length of command line arguments.
2644e35d4d8eSmrg    # Libtool will interpret -1 as no limit whatsoever
2645e35d4d8eSmrg    lt_cv_sys_max_cmd_len=-1;
2646e35d4d8eSmrg    ;;
26472a51b5beSmrg
2648e35d4d8eSmrg  cygwin* | mingw* | cegcc*)
2649e35d4d8eSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
2650e35d4d8eSmrg    # about 5 minutes as the teststring grows exponentially.
2651e35d4d8eSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
2652e35d4d8eSmrg    # you end up with a "frozen" computer, even though with patience
2653e35d4d8eSmrg    # the test eventually succeeds (with a max line length of 256k).
2654e35d4d8eSmrg    # Instead, let's just punt: use the minimum linelength reported by
2655e35d4d8eSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
2656e35d4d8eSmrg    lt_cv_sys_max_cmd_len=8192;
2657e35d4d8eSmrg    ;;
26582a51b5beSmrg
2659e35d4d8eSmrg  mint*)
2660e35d4d8eSmrg    # On MiNT this can take a long time and run out of memory.
2661e35d4d8eSmrg    lt_cv_sys_max_cmd_len=8192;
2662e35d4d8eSmrg    ;;
26632a51b5beSmrg
2664e35d4d8eSmrg  amigaos*)
2665e35d4d8eSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
2666e35d4d8eSmrg    # So we just punt and use a minimum line length of 8192.
2667e35d4d8eSmrg    lt_cv_sys_max_cmd_len=8192;
2668e35d4d8eSmrg    ;;
26692a51b5beSmrg
2670e35d4d8eSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2671e35d4d8eSmrg    # This has been around since 386BSD, at least.  Likely further.
2672e35d4d8eSmrg    if test -x /sbin/sysctl; then
2673e35d4d8eSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2674e35d4d8eSmrg    elif test -x /usr/sbin/sysctl; then
2675e35d4d8eSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2676e35d4d8eSmrg    else
2677e35d4d8eSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2678e35d4d8eSmrg    fi
2679e35d4d8eSmrg    # And add a safety zone
2680e35d4d8eSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2681e35d4d8eSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2682e35d4d8eSmrg    ;;
26832a51b5beSmrg
2684e35d4d8eSmrg  interix*)
2685e35d4d8eSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2686e35d4d8eSmrg    lt_cv_sys_max_cmd_len=196608
2687e35d4d8eSmrg    ;;
26882a51b5beSmrg
2689e35d4d8eSmrg  os2*)
2690e35d4d8eSmrg    # The test takes a long time on OS/2.
2691e35d4d8eSmrg    lt_cv_sys_max_cmd_len=8192
2692e35d4d8eSmrg    ;;
269332b578d3Smrg
2694e35d4d8eSmrg  osf*)
2695e35d4d8eSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2696e35d4d8eSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2697e35d4d8eSmrg    # nice to cause kernel panics so lets avoid the loop below.
2698e35d4d8eSmrg    # First set a reasonable default.
2699e35d4d8eSmrg    lt_cv_sys_max_cmd_len=16384
2700e35d4d8eSmrg    #
2701e35d4d8eSmrg    if test -x /sbin/sysconfig; then
2702e35d4d8eSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2703e35d4d8eSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2704e35d4d8eSmrg      esac
2705e35d4d8eSmrg    fi
2706e35d4d8eSmrg    ;;
2707e35d4d8eSmrg  sco3.2v5*)
2708e35d4d8eSmrg    lt_cv_sys_max_cmd_len=102400
2709e35d4d8eSmrg    ;;
2710e35d4d8eSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
2711e35d4d8eSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2712e35d4d8eSmrg    if test -n "$kargmax"; then
2713e35d4d8eSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2714e35d4d8eSmrg    else
2715e35d4d8eSmrg      lt_cv_sys_max_cmd_len=32768
2716e35d4d8eSmrg    fi
2717e35d4d8eSmrg    ;;
2718e35d4d8eSmrg  *)
2719e35d4d8eSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2720e35d4d8eSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
2721e35d4d8eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2722e35d4d8eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2723e35d4d8eSmrg    else
2724e35d4d8eSmrg      # Make teststring a little bigger before we do anything with it.
2725e35d4d8eSmrg      # a 1K string should be a reasonable start.
2726e35d4d8eSmrg      for i in 1 2 3 4 5 6 7 8 ; do
2727e35d4d8eSmrg        teststring=$teststring$teststring
2728e35d4d8eSmrg      done
2729e35d4d8eSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2730e35d4d8eSmrg      # If test is not a shell built-in, we'll probably end up computing a
2731e35d4d8eSmrg      # maximum length that is only half of the actual maximum length, but
2732e35d4d8eSmrg      # we can't tell.
2733e35d4d8eSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2734e35d4d8eSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2735e35d4d8eSmrg	      test $i != 17 # 1/2 MB should be enough
2736e35d4d8eSmrg      do
2737e35d4d8eSmrg        i=`expr $i + 1`
2738e35d4d8eSmrg        teststring=$teststring$teststring
2739e35d4d8eSmrg      done
2740e35d4d8eSmrg      # Only check the string length outside the loop.
2741e35d4d8eSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2742e35d4d8eSmrg      teststring=
2743e35d4d8eSmrg      # Add a significant safety factor because C++ compilers can tack on
2744e35d4d8eSmrg      # massive amounts of additional arguments before passing them to the
2745e35d4d8eSmrg      # linker.  It appears as though 1/2 is a usable value.
2746e35d4d8eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2747e35d4d8eSmrg    fi
2748e35d4d8eSmrg    ;;
2749e35d4d8eSmrg  esac
2750e35d4d8eSmrg])
2751e35d4d8eSmrgif test -n $lt_cv_sys_max_cmd_len ; then
2752e35d4d8eSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2753e35d4d8eSmrgelse
2754e35d4d8eSmrg  AC_MSG_RESULT(none)
2755e35d4d8eSmrgfi
2756e35d4d8eSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
2757e35d4d8eSmrg_LT_DECL([], [max_cmd_len], [0],
2758e35d4d8eSmrg    [What is the maximum length of a command?])
2759e35d4d8eSmrg])# LT_CMD_MAX_LEN
276032b578d3Smrg
2761e35d4d8eSmrg# Old name:
2762e35d4d8eSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2763e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
2764e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
276532b578d3Smrg
2766d31dbc53Smrg
2767e35d4d8eSmrg# _LT_HEADER_DLFCN
2768e35d4d8eSmrg# ----------------
2769e35d4d8eSmrgm4_defun([_LT_HEADER_DLFCN],
2770e35d4d8eSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2771e35d4d8eSmrg])# _LT_HEADER_DLFCN
2772d31dbc53Smrg
27732a51b5beSmrg
2774e35d4d8eSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2775e35d4d8eSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2776e35d4d8eSmrg# ----------------------------------------------------------------
2777e35d4d8eSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
2778e35d4d8eSmrg[m4_require([_LT_HEADER_DLFCN])dnl
2779e35d4d8eSmrgif test "$cross_compiling" = yes; then :
2780e35d4d8eSmrg  [$4]
2781e35d4d8eSmrgelse
2782e35d4d8eSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2783e35d4d8eSmrg  lt_status=$lt_dlunknown
2784e35d4d8eSmrg  cat > conftest.$ac_ext <<_LT_EOF
2785e35d4d8eSmrg[#line $LINENO "configure"
2786e35d4d8eSmrg#include "confdefs.h"
2787e35d4d8eSmrg
2788e35d4d8eSmrg#if HAVE_DLFCN_H
2789e35d4d8eSmrg#include <dlfcn.h>
27901b12faf6Smrg#endif
27912a51b5beSmrg
2792e35d4d8eSmrg#include <stdio.h>
2793e35d4d8eSmrg
2794e35d4d8eSmrg#ifdef RTLD_GLOBAL
2795e35d4d8eSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
2796e35d4d8eSmrg#else
2797e35d4d8eSmrg#  ifdef DL_GLOBAL
2798e35d4d8eSmrg#    define LT_DLGLOBAL		DL_GLOBAL
2799e35d4d8eSmrg#  else
2800e35d4d8eSmrg#    define LT_DLGLOBAL		0
2801e35d4d8eSmrg#  endif
28021b12faf6Smrg#endif
2803e35d4d8eSmrg
2804e35d4d8eSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2805e35d4d8eSmrg   find out it does not work in some platform. */
2806e35d4d8eSmrg#ifndef LT_DLLAZY_OR_NOW
2807e35d4d8eSmrg#  ifdef RTLD_LAZY
2808e35d4d8eSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2809e35d4d8eSmrg#  else
2810e35d4d8eSmrg#    ifdef DL_LAZY
2811e35d4d8eSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
2812e35d4d8eSmrg#    else
2813e35d4d8eSmrg#      ifdef RTLD_NOW
2814e35d4d8eSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2815e35d4d8eSmrg#      else
2816e35d4d8eSmrg#        ifdef DL_NOW
2817e35d4d8eSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
2818e35d4d8eSmrg#        else
2819e35d4d8eSmrg#          define LT_DLLAZY_OR_NOW	0
2820e35d4d8eSmrg#        endif
2821e35d4d8eSmrg#      endif
2822e35d4d8eSmrg#    endif
2823e35d4d8eSmrg#  endif
2824e35d4d8eSmrg#endif
2825e35d4d8eSmrg
2826e35d4d8eSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
2827e35d4d8eSmrg   correspondingly for the symbols needed.  */
2828e35d4d8eSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2829e35d4d8eSmrgint fnord () __attribute__((visibility("default")));
2830e35d4d8eSmrg#endif
2831e35d4d8eSmrg
2832e35d4d8eSmrgint fnord () { return 42; }
2833e35d4d8eSmrgint main ()
2834e35d4d8eSmrg{
2835e35d4d8eSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2836e35d4d8eSmrg  int status = $lt_dlunknown;
2837e35d4d8eSmrg
2838e35d4d8eSmrg  if (self)
2839e35d4d8eSmrg    {
2840e35d4d8eSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
28411b12faf6Smrg      else
2842e35d4d8eSmrg        {
2843e35d4d8eSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2844e35d4d8eSmrg          else puts (dlerror ());
2845e35d4d8eSmrg	}
2846e35d4d8eSmrg      /* dlclose (self); */
2847e35d4d8eSmrg    }
28482a51b5beSmrg  else
2849e35d4d8eSmrg    puts (dlerror ());
285032b578d3Smrg
2851e35d4d8eSmrg  return status;
2852e35d4d8eSmrg}]
2853e35d4d8eSmrg_LT_EOF
2854e35d4d8eSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2855e35d4d8eSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2856e35d4d8eSmrg    lt_status=$?
2857e35d4d8eSmrg    case x$lt_status in
2858e35d4d8eSmrg      x$lt_dlno_uscore) $1 ;;
2859e35d4d8eSmrg      x$lt_dlneed_uscore) $2 ;;
2860e35d4d8eSmrg      x$lt_dlunknown|x*) $3 ;;
2861e35d4d8eSmrg    esac
2862e35d4d8eSmrg  else :
2863e35d4d8eSmrg    # compilation failed
2864e35d4d8eSmrg    $3
28651b12faf6Smrg  fi
28662a51b5beSmrgfi
2867e35d4d8eSmrgrm -fr conftest*
2868e35d4d8eSmrg])# _LT_TRY_DLOPEN_SELF
286932b578d3Smrg
287032b578d3Smrg
2871e35d4d8eSmrg# LT_SYS_DLOPEN_SELF
2872e35d4d8eSmrg# ------------------
2873e35d4d8eSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
2874e35d4d8eSmrg[m4_require([_LT_HEADER_DLFCN])dnl
2875e35d4d8eSmrgif test "x$enable_dlopen" != xyes; then
2876e35d4d8eSmrg  enable_dlopen=unknown
2877e35d4d8eSmrg  enable_dlopen_self=unknown
2878e35d4d8eSmrg  enable_dlopen_self_static=unknown
2879e35d4d8eSmrgelse
2880e35d4d8eSmrg  lt_cv_dlopen=no
2881e35d4d8eSmrg  lt_cv_dlopen_libs=
288232b578d3Smrg
2883e35d4d8eSmrg  case $host_os in
2884e35d4d8eSmrg  beos*)
2885e35d4d8eSmrg    lt_cv_dlopen="load_add_on"
2886e35d4d8eSmrg    lt_cv_dlopen_libs=
2887e35d4d8eSmrg    lt_cv_dlopen_self=yes
2888e35d4d8eSmrg    ;;
288932b578d3Smrg
2890e35d4d8eSmrg  mingw* | pw32* | cegcc*)
2891e35d4d8eSmrg    lt_cv_dlopen="LoadLibrary"
2892e35d4d8eSmrg    lt_cv_dlopen_libs=
2893e35d4d8eSmrg    ;;
2894e35d4d8eSmrg
2895e35d4d8eSmrg  cygwin*)
2896e35d4d8eSmrg    lt_cv_dlopen="dlopen"
2897e35d4d8eSmrg    lt_cv_dlopen_libs=
2898e35d4d8eSmrg    ;;
2899e35d4d8eSmrg
2900e35d4d8eSmrg  darwin*)
2901e35d4d8eSmrg  # if libdl is installed we need to link against it
2902e35d4d8eSmrg    AC_CHECK_LIB([dl], [dlopen],
2903e35d4d8eSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2904e35d4d8eSmrg    lt_cv_dlopen="dyld"
2905e35d4d8eSmrg    lt_cv_dlopen_libs=
2906e35d4d8eSmrg    lt_cv_dlopen_self=yes
2907e35d4d8eSmrg    ])
2908e35d4d8eSmrg    ;;
2909e35d4d8eSmrg
2910e35d4d8eSmrg  *)
2911e35d4d8eSmrg    AC_CHECK_FUNC([shl_load],
2912e35d4d8eSmrg	  [lt_cv_dlopen="shl_load"],
2913e35d4d8eSmrg      [AC_CHECK_LIB([dld], [shl_load],
2914e35d4d8eSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2915e35d4d8eSmrg	[AC_CHECK_FUNC([dlopen],
2916e35d4d8eSmrg	      [lt_cv_dlopen="dlopen"],
2917e35d4d8eSmrg	  [AC_CHECK_LIB([dl], [dlopen],
2918e35d4d8eSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2919e35d4d8eSmrg	    [AC_CHECK_LIB([svld], [dlopen],
2920e35d4d8eSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2921e35d4d8eSmrg	      [AC_CHECK_LIB([dld], [dld_link],
2922e35d4d8eSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
2923e35d4d8eSmrg	      ])
2924e35d4d8eSmrg	    ])
2925e35d4d8eSmrg	  ])
2926e35d4d8eSmrg	])
2927e35d4d8eSmrg      ])
2928e35d4d8eSmrg    ;;
2929e35d4d8eSmrg  esac
2930e35d4d8eSmrg
2931e35d4d8eSmrg  if test "x$lt_cv_dlopen" != xno; then
2932e35d4d8eSmrg    enable_dlopen=yes
2933e35d4d8eSmrg  else
2934e35d4d8eSmrg    enable_dlopen=no
2935e35d4d8eSmrg  fi
2936e35d4d8eSmrg
2937e35d4d8eSmrg  case $lt_cv_dlopen in
2938e35d4d8eSmrg  dlopen)
2939e35d4d8eSmrg    save_CPPFLAGS="$CPPFLAGS"
2940e35d4d8eSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2941e35d4d8eSmrg
2942e35d4d8eSmrg    save_LDFLAGS="$LDFLAGS"
2943e35d4d8eSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2944e35d4d8eSmrg
2945e35d4d8eSmrg    save_LIBS="$LIBS"
2946e35d4d8eSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2947e35d4d8eSmrg
2948e35d4d8eSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2949e35d4d8eSmrg	  lt_cv_dlopen_self, [dnl
2950e35d4d8eSmrg	  _LT_TRY_DLOPEN_SELF(
2951e35d4d8eSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2952e35d4d8eSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2953e35d4d8eSmrg    ])
2954e35d4d8eSmrg
2955e35d4d8eSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
2956e35d4d8eSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2957e35d4d8eSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2958e35d4d8eSmrg	  lt_cv_dlopen_self_static, [dnl
2959e35d4d8eSmrg	  _LT_TRY_DLOPEN_SELF(
2960e35d4d8eSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2961e35d4d8eSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2962e35d4d8eSmrg      ])
2963e35d4d8eSmrg    fi
2964e35d4d8eSmrg
2965e35d4d8eSmrg    CPPFLAGS="$save_CPPFLAGS"
2966e35d4d8eSmrg    LDFLAGS="$save_LDFLAGS"
2967e35d4d8eSmrg    LIBS="$save_LIBS"
2968e35d4d8eSmrg    ;;
2969e35d4d8eSmrg  esac
2970e35d4d8eSmrg
2971e35d4d8eSmrg  case $lt_cv_dlopen_self in
2972e35d4d8eSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2973e35d4d8eSmrg  *) enable_dlopen_self=unknown ;;
2974e35d4d8eSmrg  esac
2975e35d4d8eSmrg
2976e35d4d8eSmrg  case $lt_cv_dlopen_self_static in
2977e35d4d8eSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2978e35d4d8eSmrg  *) enable_dlopen_self_static=unknown ;;
2979e35d4d8eSmrg  esac
2980e35d4d8eSmrgfi
2981e35d4d8eSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2982e35d4d8eSmrg	 [Whether dlopen is supported])
2983e35d4d8eSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2984e35d4d8eSmrg	 [Whether dlopen of programs is supported])
2985e35d4d8eSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2986e35d4d8eSmrg	 [Whether dlopen of statically linked programs is supported])
2987e35d4d8eSmrg])# LT_SYS_DLOPEN_SELF
2988e35d4d8eSmrg
2989e35d4d8eSmrg# Old name:
2990e35d4d8eSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2991e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
2992e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2993e35d4d8eSmrg
2994e35d4d8eSmrg
2995e35d4d8eSmrg# _LT_COMPILER_C_O([TAGNAME])
2996e35d4d8eSmrg# ---------------------------
2997e35d4d8eSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
2998e35d4d8eSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2999e35d4d8eSmrgm4_defun([_LT_COMPILER_C_O],
3000e35d4d8eSmrg[m4_require([_LT_DECL_SED])dnl
3001e35d4d8eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3002e35d4d8eSmrgm4_require([_LT_TAG_COMPILER])dnl
3003e35d4d8eSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3004e35d4d8eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3005e35d4d8eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3006e35d4d8eSmrg   $RM -r conftest 2>/dev/null
3007e35d4d8eSmrg   mkdir conftest
3008e35d4d8eSmrg   cd conftest
3009e35d4d8eSmrg   mkdir out
3010e35d4d8eSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3011e35d4d8eSmrg
3012e35d4d8eSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
3013e35d4d8eSmrg   # Insert the option either (1) after the last *FLAGS variable, or
3014e35d4d8eSmrg   # (2) before a word containing "conftest.", or (3) at the end.
3015e35d4d8eSmrg   # Note that $ac_compile itself does not contain backslashes and begins
3016e35d4d8eSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
3017e35d4d8eSmrg   lt_compile=`echo "$ac_compile" | $SED \
3018e35d4d8eSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3019e35d4d8eSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3020e35d4d8eSmrg   -e 's:$: $lt_compiler_flag:'`
3021e35d4d8eSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3022e35d4d8eSmrg   (eval "$lt_compile" 2>out/conftest.err)
3023e35d4d8eSmrg   ac_status=$?
3024e35d4d8eSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3025e35d4d8eSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3026e35d4d8eSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3027e35d4d8eSmrg   then
3028e35d4d8eSmrg     # The compiler can only warn and ignore the option if not recognized
3029e35d4d8eSmrg     # So say no if there are warnings
3030e35d4d8eSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3031e35d4d8eSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3032e35d4d8eSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3033e35d4d8eSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3034e35d4d8eSmrg     fi
3035e35d4d8eSmrg   fi
3036e35d4d8eSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3037e35d4d8eSmrg   $RM conftest*
3038e35d4d8eSmrg   # SGI C++ compiler will create directory out/ii_files/ for
3039e35d4d8eSmrg   # template instantiation
3040e35d4d8eSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3041e35d4d8eSmrg   $RM out/* && rmdir out
3042e35d4d8eSmrg   cd ..
3043e35d4d8eSmrg   $RM -r conftest
3044e35d4d8eSmrg   $RM conftest*
3045e35d4d8eSmrg])
3046e35d4d8eSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3047e35d4d8eSmrg	[Does compiler simultaneously support -c and -o options?])
3048e35d4d8eSmrg])# _LT_COMPILER_C_O
3049e35d4d8eSmrg
3050e35d4d8eSmrg
3051e35d4d8eSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3052e35d4d8eSmrg# ----------------------------------
3053e35d4d8eSmrg# Check to see if we can do hard links to lock some files if needed
3054e35d4d8eSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
3055e35d4d8eSmrg[m4_require([_LT_ENABLE_LOCK])dnl
3056e35d4d8eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3057e35d4d8eSmrg_LT_COMPILER_C_O([$1])
3058e35d4d8eSmrg
3059e35d4d8eSmrghard_links="nottested"
3060e35d4d8eSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3061e35d4d8eSmrg  # do not overwrite the value of need_locks provided by the user
3062e35d4d8eSmrg  AC_MSG_CHECKING([if we can lock with hard links])
3063e35d4d8eSmrg  hard_links=yes
3064e35d4d8eSmrg  $RM conftest*
3065e35d4d8eSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3066e35d4d8eSmrg  touch conftest.a
3067e35d4d8eSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
3068e35d4d8eSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3069e35d4d8eSmrg  AC_MSG_RESULT([$hard_links])
3070e35d4d8eSmrg  if test "$hard_links" = no; then
3071e35d4d8eSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3072e35d4d8eSmrg    need_locks=warn
3073e35d4d8eSmrg  fi
3074e35d4d8eSmrgelse
3075e35d4d8eSmrg  need_locks=no
3076e35d4d8eSmrgfi
3077e35d4d8eSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3078e35d4d8eSmrg])# _LT_COMPILER_FILE_LOCKS
3079e35d4d8eSmrg
3080e35d4d8eSmrg
3081e35d4d8eSmrg# _LT_CHECK_OBJDIR
3082e35d4d8eSmrg# ----------------
3083e35d4d8eSmrgm4_defun([_LT_CHECK_OBJDIR],
3084e35d4d8eSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3085e35d4d8eSmrg[rm -f .libs 2>/dev/null
3086e35d4d8eSmrgmkdir .libs 2>/dev/null
3087e35d4d8eSmrgif test -d .libs; then
3088e35d4d8eSmrg  lt_cv_objdir=.libs
3089e35d4d8eSmrgelse
3090e35d4d8eSmrg  # MS-DOS does not allow filenames that begin with a dot.
3091e35d4d8eSmrg  lt_cv_objdir=_libs
3092e35d4d8eSmrgfi
3093e35d4d8eSmrgrmdir .libs 2>/dev/null])
3094e35d4d8eSmrgobjdir=$lt_cv_objdir
3095e35d4d8eSmrg_LT_DECL([], [objdir], [0],
3096e35d4d8eSmrg         [The name of the directory that contains temporary libtool files])dnl
3097e35d4d8eSmrgm4_pattern_allow([LT_OBJDIR])dnl
3098e35d4d8eSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3099e35d4d8eSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3100e35d4d8eSmrg])# _LT_CHECK_OBJDIR
3101e35d4d8eSmrg
3102e35d4d8eSmrg
3103e35d4d8eSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3104e35d4d8eSmrg# --------------------------------------
3105e35d4d8eSmrg# Check hardcoding attributes.
3106e35d4d8eSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3107e35d4d8eSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
3108e35d4d8eSmrg_LT_TAGVAR(hardcode_action, $1)=
3109e35d4d8eSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3110e35d4d8eSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3111e35d4d8eSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3112e35d4d8eSmrg
3113e35d4d8eSmrg  # We can hardcode non-existent directories.
3114e35d4d8eSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3115e35d4d8eSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3116e35d4d8eSmrg     # have to relink, otherwise we might link with an installed library
3117e35d4d8eSmrg     # when we should be linking with a yet-to-be-installed one
3118e35d4d8eSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3119e35d4d8eSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3120e35d4d8eSmrg    # Linking always hardcodes the temporary library directory.
3121e35d4d8eSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
3122e35d4d8eSmrg  else
3123e35d4d8eSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3124e35d4d8eSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
3125e35d4d8eSmrg  fi
3126e35d4d8eSmrgelse
3127e35d4d8eSmrg  # We cannot hardcode anything, or else we can only hardcode existing
3128e35d4d8eSmrg  # directories.
3129e35d4d8eSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
3130e35d4d8eSmrgfi
3131e35d4d8eSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3132e35d4d8eSmrg
3133e35d4d8eSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3134e35d4d8eSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3135e35d4d8eSmrg  # Fast installation is not supported
3136e35d4d8eSmrg  enable_fast_install=no
3137e35d4d8eSmrgelif test "$shlibpath_overrides_runpath" = yes ||
3138e35d4d8eSmrg     test "$enable_shared" = no; then
3139e35d4d8eSmrg  # Fast installation is not necessary
3140e35d4d8eSmrg  enable_fast_install=needless
3141e35d4d8eSmrgfi
3142e35d4d8eSmrg_LT_TAGDECL([], [hardcode_action], [0],
3143e35d4d8eSmrg    [How to hardcode a shared library path into an executable])
3144e35d4d8eSmrg])# _LT_LINKER_HARDCODE_LIBPATH
3145e35d4d8eSmrg
3146e35d4d8eSmrg
3147e35d4d8eSmrg# _LT_CMD_STRIPLIB
3148e35d4d8eSmrg# ----------------
3149e35d4d8eSmrgm4_defun([_LT_CMD_STRIPLIB],
3150e35d4d8eSmrg[m4_require([_LT_DECL_EGREP])
3151e35d4d8eSmrgstriplib=
3152e35d4d8eSmrgold_striplib=
3153e35d4d8eSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
3154e35d4d8eSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3155e35d4d8eSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3156e35d4d8eSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3157e35d4d8eSmrg  AC_MSG_RESULT([yes])
3158e35d4d8eSmrgelse
3159e35d4d8eSmrg# FIXME - insert some real tests, host_os isn't really good enough
3160e35d4d8eSmrg  case $host_os in
3161e35d4d8eSmrg  darwin*)
3162e35d4d8eSmrg    if test -n "$STRIP" ; then
3163e35d4d8eSmrg      striplib="$STRIP -x"
3164e35d4d8eSmrg      old_striplib="$STRIP -S"
3165e35d4d8eSmrg      AC_MSG_RESULT([yes])
3166e35d4d8eSmrg    else
3167e35d4d8eSmrg      AC_MSG_RESULT([no])
3168e35d4d8eSmrg    fi
3169e35d4d8eSmrg    ;;
3170e35d4d8eSmrg  *)
3171e35d4d8eSmrg    AC_MSG_RESULT([no])
3172e35d4d8eSmrg    ;;
3173e35d4d8eSmrg  esac
3174e35d4d8eSmrgfi
3175e35d4d8eSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3176e35d4d8eSmrg_LT_DECL([], [striplib], [1])
3177e35d4d8eSmrg])# _LT_CMD_STRIPLIB
3178e35d4d8eSmrg
3179e35d4d8eSmrg
3180e35d4d8eSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
3181e35d4d8eSmrg# -----------------------------
3182e35d4d8eSmrg# PORTME Fill in your ld.so characteristics
3183e35d4d8eSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
3184e35d4d8eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3185e35d4d8eSmrgm4_require([_LT_DECL_EGREP])dnl
3186e35d4d8eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3187e35d4d8eSmrgm4_require([_LT_DECL_OBJDUMP])dnl
3188e35d4d8eSmrgm4_require([_LT_DECL_SED])dnl
3189e35d4d8eSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
3190e35d4d8eSmrgAC_MSG_CHECKING([dynamic linker characteristics])
3191e35d4d8eSmrgm4_if([$1],
3192e35d4d8eSmrg	[], [
3193e35d4d8eSmrgif test "$GCC" = yes; then
3194e35d4d8eSmrg  case $host_os in
3195e35d4d8eSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3196e35d4d8eSmrg    *) lt_awk_arg="/^libraries:/" ;;
3197e35d4d8eSmrg  esac
3198e35d4d8eSmrg  case $host_os in
3199e35d4d8eSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3200e35d4d8eSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
3201e35d4d8eSmrg  esac
3202e35d4d8eSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3203e35d4d8eSmrg  case $lt_search_path_spec in
3204e35d4d8eSmrg  *\;*)
3205e35d4d8eSmrg    # if the path contains ";" then we assume it to be the separator
3206e35d4d8eSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
3207e35d4d8eSmrg    # assumed that no part of a normal pathname contains ";" but that should
3208e35d4d8eSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
3209e35d4d8eSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3210e35d4d8eSmrg    ;;
3211e35d4d8eSmrg  *)
3212e35d4d8eSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3213e35d4d8eSmrg    ;;
3214e35d4d8eSmrg  esac
3215e35d4d8eSmrg  # Ok, now we have the path, separated by spaces, we can step through it
3216e35d4d8eSmrg  # and add multilib dir if necessary.
3217e35d4d8eSmrg  lt_tmp_lt_search_path_spec=
3218e35d4d8eSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3219e35d4d8eSmrg  for lt_sys_path in $lt_search_path_spec; do
3220e35d4d8eSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3221e35d4d8eSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3222e35d4d8eSmrg    else
3223e35d4d8eSmrg      test -d "$lt_sys_path" && \
3224e35d4d8eSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3225e35d4d8eSmrg    fi
3226e35d4d8eSmrg  done
3227e35d4d8eSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3228e35d4d8eSmrgBEGIN {RS=" "; FS="/|\n";} {
3229e35d4d8eSmrg  lt_foo="";
3230e35d4d8eSmrg  lt_count=0;
3231e35d4d8eSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
3232e35d4d8eSmrg    if ($lt_i != "" && $lt_i != ".") {
3233e35d4d8eSmrg      if ($lt_i == "..") {
3234e35d4d8eSmrg        lt_count++;
3235e35d4d8eSmrg      } else {
3236e35d4d8eSmrg        if (lt_count == 0) {
3237e35d4d8eSmrg          lt_foo="/" $lt_i lt_foo;
3238e35d4d8eSmrg        } else {
3239e35d4d8eSmrg          lt_count--;
3240e35d4d8eSmrg        }
3241e35d4d8eSmrg      }
3242e35d4d8eSmrg    }
3243e35d4d8eSmrg  }
3244e35d4d8eSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3245e35d4d8eSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3246e35d4d8eSmrg}'`
3247e35d4d8eSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
3248e35d4d8eSmrg  # for these hosts.
3249e35d4d8eSmrg  case $host_os in
3250e35d4d8eSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3251e35d4d8eSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3252e35d4d8eSmrg  esac
3253e35d4d8eSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3254e35d4d8eSmrgelse
3255e35d4d8eSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3256e35d4d8eSmrgfi])
3257e35d4d8eSmrglibrary_names_spec=
3258e35d4d8eSmrglibname_spec='lib$name'
3259e35d4d8eSmrgsoname_spec=
3260e35d4d8eSmrgshrext_cmds=".so"
3261e35d4d8eSmrgpostinstall_cmds=
3262e35d4d8eSmrgpostuninstall_cmds=
3263e35d4d8eSmrgfinish_cmds=
3264e35d4d8eSmrgfinish_eval=
3265e35d4d8eSmrgshlibpath_var=
3266e35d4d8eSmrgshlibpath_overrides_runpath=unknown
3267e35d4d8eSmrgversion_type=none
3268e35d4d8eSmrgdynamic_linker="$host_os ld.so"
3269e35d4d8eSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
3270e35d4d8eSmrgneed_lib_prefix=unknown
3271e35d4d8eSmrghardcode_into_libs=no
3272e35d4d8eSmrg
3273e35d4d8eSmrg# when you set need_version to no, make sure it does not cause -set_version
3274e35d4d8eSmrg# flags to be left without arguments
3275e35d4d8eSmrgneed_version=unknown
3276e35d4d8eSmrg
3277e35d4d8eSmrgcase $host_os in
3278e35d4d8eSmrgaix3*)
3279e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3280e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3281e35d4d8eSmrg  shlibpath_var=LIBPATH
3282e35d4d8eSmrg
3283e35d4d8eSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
3284e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3285e35d4d8eSmrg  ;;
3286e35d4d8eSmrg
3287e35d4d8eSmrgaix[[4-9]]*)
3288e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3289e35d4d8eSmrg  need_lib_prefix=no
3290e35d4d8eSmrg  need_version=no
3291e35d4d8eSmrg  hardcode_into_libs=yes
3292e35d4d8eSmrg  if test "$host_cpu" = ia64; then
3293e35d4d8eSmrg    # AIX 5 supports IA64
3294e35d4d8eSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3295e35d4d8eSmrg    shlibpath_var=LD_LIBRARY_PATH
3296e35d4d8eSmrg  else
3297e35d4d8eSmrg    # With GCC up to 2.95.x, collect2 would create an import file
3298e35d4d8eSmrg    # for dependence libraries.  The import file would start with
3299e35d4d8eSmrg    # the line `#! .'.  This would cause the generated library to
3300e35d4d8eSmrg    # depend on `.', always an invalid library.  This was fixed in
3301e35d4d8eSmrg    # development snapshots of GCC prior to 3.0.
3302e35d4d8eSmrg    case $host_os in
3303e35d4d8eSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
3304e35d4d8eSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3305e35d4d8eSmrg	   echo ' yes '
3306e35d4d8eSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3307e35d4d8eSmrg	:
3308e35d4d8eSmrg      else
3309e35d4d8eSmrg	can_build_shared=no
3310e35d4d8eSmrg      fi
3311e35d4d8eSmrg      ;;
3312e35d4d8eSmrg    esac
3313e35d4d8eSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3314e35d4d8eSmrg    # soname into executable. Probably we can add versioning support to
3315e35d4d8eSmrg    # collect2, so additional links can be useful in future.
3316e35d4d8eSmrg    if test "$aix_use_runtimelinking" = yes; then
3317e35d4d8eSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3318e35d4d8eSmrg      # instead of lib<name>.a to let people know that these are not
3319e35d4d8eSmrg      # typical AIX shared libraries.
3320e35d4d8eSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3321e35d4d8eSmrg    else
3322e35d4d8eSmrg      # We preserve .a as extension for shared libraries through AIX4.2
3323e35d4d8eSmrg      # and later when we are not doing run time linking.
3324e35d4d8eSmrg      library_names_spec='${libname}${release}.a $libname.a'
3325e35d4d8eSmrg      soname_spec='${libname}${release}${shared_ext}$major'
3326e35d4d8eSmrg    fi
3327e35d4d8eSmrg    shlibpath_var=LIBPATH
3328e35d4d8eSmrg  fi
3329e35d4d8eSmrg  ;;
3330e35d4d8eSmrg
3331e35d4d8eSmrgamigaos*)
3332e35d4d8eSmrg  case $host_cpu in
3333e35d4d8eSmrg  powerpc)
3334e35d4d8eSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
3335e35d4d8eSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3336e35d4d8eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3337e35d4d8eSmrg    ;;
3338e35d4d8eSmrg  m68k)
3339e35d4d8eSmrg    library_names_spec='$libname.ixlibrary $libname.a'
3340e35d4d8eSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3341e35d4d8eSmrg    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'
3342e35d4d8eSmrg    ;;
3343e35d4d8eSmrg  esac
3344e35d4d8eSmrg  ;;
3345e35d4d8eSmrg
3346e35d4d8eSmrgbeos*)
3347e35d4d8eSmrg  library_names_spec='${libname}${shared_ext}'
3348e35d4d8eSmrg  dynamic_linker="$host_os ld.so"
3349e35d4d8eSmrg  shlibpath_var=LIBRARY_PATH
3350e35d4d8eSmrg  ;;
3351e35d4d8eSmrg
3352e35d4d8eSmrgbsdi[[45]]*)
3353e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3354e35d4d8eSmrg  need_version=no
3355e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3356e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3357e35d4d8eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3358e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3359e35d4d8eSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3360e35d4d8eSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3361e35d4d8eSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
3362e35d4d8eSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3363e35d4d8eSmrg  # libtool to hard-code these into programs
3364e35d4d8eSmrg  ;;
3365e35d4d8eSmrg
3366e35d4d8eSmrgcygwin* | mingw* | pw32* | cegcc*)
3367e35d4d8eSmrg  version_type=windows
3368e35d4d8eSmrg  shrext_cmds=".dll"
3369e35d4d8eSmrg  need_version=no
3370e35d4d8eSmrg  need_lib_prefix=no
3371e35d4d8eSmrg
3372e35d4d8eSmrg  case $GCC,$cc_basename in
3373e35d4d8eSmrg  yes,*)
3374e35d4d8eSmrg    # gcc
3375e35d4d8eSmrg    library_names_spec='$libname.dll.a'
3376e35d4d8eSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3377e35d4d8eSmrg    postinstall_cmds='base_file=`basename \${file}`~
3378e35d4d8eSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3379e35d4d8eSmrg      dldir=$destdir/`dirname \$dlpath`~
3380e35d4d8eSmrg      test -d \$dldir || mkdir -p \$dldir~
3381e35d4d8eSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
3382e35d4d8eSmrg      chmod a+x \$dldir/$dlname~
3383e35d4d8eSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3384e35d4d8eSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3385e35d4d8eSmrg      fi'
3386e35d4d8eSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3387e35d4d8eSmrg      dlpath=$dir/\$dldll~
3388e35d4d8eSmrg       $RM \$dlpath'
3389e35d4d8eSmrg    shlibpath_overrides_runpath=yes
3390e35d4d8eSmrg
3391e35d4d8eSmrg    case $host_os in
3392e35d4d8eSmrg    cygwin*)
3393e35d4d8eSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3394e35d4d8eSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3395e35d4d8eSmrgm4_if([$1], [],[
3396e35d4d8eSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3397e35d4d8eSmrg      ;;
3398e35d4d8eSmrg    mingw* | cegcc*)
3399e35d4d8eSmrg      # MinGW DLLs use traditional 'lib' prefix
3400e35d4d8eSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3401e35d4d8eSmrg      ;;
3402e35d4d8eSmrg    pw32*)
3403e35d4d8eSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
3404e35d4d8eSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3405e35d4d8eSmrg      ;;
3406e35d4d8eSmrg    esac
3407e35d4d8eSmrg    dynamic_linker='Win32 ld.exe'
3408e35d4d8eSmrg    ;;
3409e35d4d8eSmrg
3410e35d4d8eSmrg  *,cl*)
3411e35d4d8eSmrg    # Native MSVC
3412e35d4d8eSmrg    libname_spec='$name'
3413e35d4d8eSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3414e35d4d8eSmrg    library_names_spec='${libname}.dll.lib'
3415e35d4d8eSmrg
3416e35d4d8eSmrg    case $build_os in
3417e35d4d8eSmrg    mingw*)
3418e35d4d8eSmrg      sys_lib_search_path_spec=
3419e35d4d8eSmrg      lt_save_ifs=$IFS
3420e35d4d8eSmrg      IFS=';'
3421e35d4d8eSmrg      for lt_path in $LIB
3422e35d4d8eSmrg      do
3423e35d4d8eSmrg        IFS=$lt_save_ifs
3424e35d4d8eSmrg        # Let DOS variable expansion print the short 8.3 style file name.
3425e35d4d8eSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3426e35d4d8eSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3427e35d4d8eSmrg      done
3428e35d4d8eSmrg      IFS=$lt_save_ifs
3429e35d4d8eSmrg      # Convert to MSYS style.
3430e35d4d8eSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3431e35d4d8eSmrg      ;;
3432e35d4d8eSmrg    cygwin*)
3433e35d4d8eSmrg      # Convert to unix form, then to dos form, then back to unix form
3434e35d4d8eSmrg      # but this time dos style (no spaces!) so that the unix form looks
3435e35d4d8eSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
3436e35d4d8eSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3437e35d4d8eSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3438e35d4d8eSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3439e35d4d8eSmrg      ;;
3440e35d4d8eSmrg    *)
3441e35d4d8eSmrg      sys_lib_search_path_spec="$LIB"
3442e35d4d8eSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3443e35d4d8eSmrg        # It is most probably a Windows format PATH.
3444e35d4d8eSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3445e35d4d8eSmrg      else
3446e35d4d8eSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3447e35d4d8eSmrg      fi
3448e35d4d8eSmrg      # FIXME: find the short name or the path components, as spaces are
3449e35d4d8eSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
3450e35d4d8eSmrg      ;;
3451e35d4d8eSmrg    esac
3452e35d4d8eSmrg
3453e35d4d8eSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3454e35d4d8eSmrg    postinstall_cmds='base_file=`basename \${file}`~
3455e35d4d8eSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3456e35d4d8eSmrg      dldir=$destdir/`dirname \$dlpath`~
3457e35d4d8eSmrg      test -d \$dldir || mkdir -p \$dldir~
3458e35d4d8eSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
3459e35d4d8eSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3460e35d4d8eSmrg      dlpath=$dir/\$dldll~
3461e35d4d8eSmrg       $RM \$dlpath'
3462e35d4d8eSmrg    shlibpath_overrides_runpath=yes
3463e35d4d8eSmrg    dynamic_linker='Win32 link.exe'
3464e35d4d8eSmrg    ;;
3465e35d4d8eSmrg
3466e35d4d8eSmrg  *)
3467e35d4d8eSmrg    # Assume MSVC wrapper
3468e35d4d8eSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3469e35d4d8eSmrg    dynamic_linker='Win32 ld.exe'
3470e35d4d8eSmrg    ;;
3471e35d4d8eSmrg  esac
3472e35d4d8eSmrg  # FIXME: first we should search . and the directory the executable is in
3473e35d4d8eSmrg  shlibpath_var=PATH
3474e35d4d8eSmrg  ;;
3475e35d4d8eSmrg
3476e35d4d8eSmrgdarwin* | rhapsody*)
3477e35d4d8eSmrg  dynamic_linker="$host_os dyld"
3478e35d4d8eSmrg  version_type=darwin
3479e35d4d8eSmrg  need_lib_prefix=no
3480e35d4d8eSmrg  need_version=no
3481e35d4d8eSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3482e35d4d8eSmrg  soname_spec='${libname}${release}${major}$shared_ext'
3483e35d4d8eSmrg  shlibpath_overrides_runpath=yes
3484e35d4d8eSmrg  shlibpath_var=DYLD_LIBRARY_PATH
3485e35d4d8eSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3486e35d4d8eSmrgm4_if([$1], [],[
3487e35d4d8eSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3488e35d4d8eSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3489e35d4d8eSmrg  ;;
3490e35d4d8eSmrg
3491e35d4d8eSmrgdgux*)
3492e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3493e35d4d8eSmrg  need_lib_prefix=no
3494e35d4d8eSmrg  need_version=no
3495e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3496e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3497e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3498e35d4d8eSmrg  ;;
3499e35d4d8eSmrg
3500e35d4d8eSmrgfreebsd* | dragonfly*)
3501e35d4d8eSmrg  # DragonFly does not have aout.  When/if they implement a new
3502e35d4d8eSmrg  # versioning mechanism, adjust this.
3503e35d4d8eSmrg  if test -x /usr/bin/objformat; then
3504e35d4d8eSmrg    objformat=`/usr/bin/objformat`
3505e35d4d8eSmrg  else
3506e35d4d8eSmrg    case $host_os in
3507e35d4d8eSmrg    freebsd[[23]].*) objformat=aout ;;
3508e35d4d8eSmrg    *) objformat=elf ;;
3509e35d4d8eSmrg    esac
3510e35d4d8eSmrg  fi
3511e35d4d8eSmrg  version_type=freebsd-$objformat
3512e35d4d8eSmrg  case $version_type in
3513e35d4d8eSmrg    freebsd-elf*)
3514e35d4d8eSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3515e35d4d8eSmrg      need_version=no
3516e35d4d8eSmrg      need_lib_prefix=no
3517e35d4d8eSmrg      ;;
3518e35d4d8eSmrg    freebsd-*)
3519e35d4d8eSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3520e35d4d8eSmrg      need_version=yes
3521e35d4d8eSmrg      ;;
3522e35d4d8eSmrg  esac
3523e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3524e35d4d8eSmrg  case $host_os in
3525e35d4d8eSmrg  freebsd2.*)
3526e35d4d8eSmrg    shlibpath_overrides_runpath=yes
3527e35d4d8eSmrg    ;;
3528e35d4d8eSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3529e35d4d8eSmrg    shlibpath_overrides_runpath=yes
3530e35d4d8eSmrg    hardcode_into_libs=yes
3531e35d4d8eSmrg    ;;
3532e35d4d8eSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3533e35d4d8eSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3534e35d4d8eSmrg    shlibpath_overrides_runpath=no
3535e35d4d8eSmrg    hardcode_into_libs=yes
3536e35d4d8eSmrg    ;;
3537e35d4d8eSmrg  *) # from 4.6 on, and DragonFly
3538e35d4d8eSmrg    shlibpath_overrides_runpath=yes
3539e35d4d8eSmrg    hardcode_into_libs=yes
3540e35d4d8eSmrg    ;;
3541e35d4d8eSmrg  esac
3542e35d4d8eSmrg  ;;
3543e35d4d8eSmrg
3544e35d4d8eSmrggnu*)
3545e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3546e35d4d8eSmrg  need_lib_prefix=no
3547e35d4d8eSmrg  need_version=no
3548e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3549e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3550e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3551e35d4d8eSmrg  shlibpath_overrides_runpath=no
3552e35d4d8eSmrg  hardcode_into_libs=yes
3553e35d4d8eSmrg  ;;
3554e35d4d8eSmrg
3555e35d4d8eSmrghaiku*)
3556e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3557e35d4d8eSmrg  need_lib_prefix=no
3558e35d4d8eSmrg  need_version=no
3559e35d4d8eSmrg  dynamic_linker="$host_os runtime_loader"
3560e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3561e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3562e35d4d8eSmrg  shlibpath_var=LIBRARY_PATH
3563e35d4d8eSmrg  shlibpath_overrides_runpath=yes
3564e35d4d8eSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3565e35d4d8eSmrg  hardcode_into_libs=yes
3566e35d4d8eSmrg  ;;
3567e35d4d8eSmrg
3568e35d4d8eSmrghpux9* | hpux10* | hpux11*)
3569e35d4d8eSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
3570e35d4d8eSmrg  # link against other versions.
3571e35d4d8eSmrg  version_type=sunos
3572e35d4d8eSmrg  need_lib_prefix=no
3573e35d4d8eSmrg  need_version=no
3574e35d4d8eSmrg  case $host_cpu in
3575e35d4d8eSmrg  ia64*)
3576e35d4d8eSmrg    shrext_cmds='.so'
3577e35d4d8eSmrg    hardcode_into_libs=yes
3578e35d4d8eSmrg    dynamic_linker="$host_os dld.so"
3579e35d4d8eSmrg    shlibpath_var=LD_LIBRARY_PATH
3580e35d4d8eSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3581e35d4d8eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3582e35d4d8eSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3583e35d4d8eSmrg    if test "X$HPUX_IA64_MODE" = X32; then
3584e35d4d8eSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3585e35d4d8eSmrg    else
3586e35d4d8eSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3587e35d4d8eSmrg    fi
3588e35d4d8eSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3589e35d4d8eSmrg    ;;
3590e35d4d8eSmrg  hppa*64*)
3591e35d4d8eSmrg    shrext_cmds='.sl'
3592e35d4d8eSmrg    hardcode_into_libs=yes
3593e35d4d8eSmrg    dynamic_linker="$host_os dld.sl"
3594e35d4d8eSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3595e35d4d8eSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3596e35d4d8eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3597e35d4d8eSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3598e35d4d8eSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3599e35d4d8eSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3600e35d4d8eSmrg    ;;
3601e35d4d8eSmrg  *)
3602e35d4d8eSmrg    shrext_cmds='.sl'
3603e35d4d8eSmrg    dynamic_linker="$host_os dld.sl"
3604e35d4d8eSmrg    shlibpath_var=SHLIB_PATH
3605e35d4d8eSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3606e35d4d8eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3607e35d4d8eSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3608e35d4d8eSmrg    ;;
3609e35d4d8eSmrg  esac
3610e35d4d8eSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3611e35d4d8eSmrg  postinstall_cmds='chmod 555 $lib'
3612e35d4d8eSmrg  # or fails outright, so override atomically:
3613e35d4d8eSmrg  install_override_mode=555
3614e35d4d8eSmrg  ;;
3615e35d4d8eSmrg
3616e35d4d8eSmrginterix[[3-9]]*)
3617e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3618e35d4d8eSmrg  need_lib_prefix=no
3619e35d4d8eSmrg  need_version=no
3620e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3621e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3622e35d4d8eSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3623e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3624e35d4d8eSmrg  shlibpath_overrides_runpath=no
3625e35d4d8eSmrg  hardcode_into_libs=yes
3626e35d4d8eSmrg  ;;
3627e35d4d8eSmrg
3628e35d4d8eSmrgirix5* | irix6* | nonstopux*)
3629e35d4d8eSmrg  case $host_os in
3630e35d4d8eSmrg    nonstopux*) version_type=nonstopux ;;
3631e35d4d8eSmrg    *)
3632e35d4d8eSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
3633e35d4d8eSmrg		version_type=linux # correct to gnu/linux during the next big refactor
3634e35d4d8eSmrg	else
3635e35d4d8eSmrg		version_type=irix
3636e35d4d8eSmrg	fi ;;
3637e35d4d8eSmrg  esac
3638e35d4d8eSmrg  need_lib_prefix=no
3639e35d4d8eSmrg  need_version=no
3640e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3641e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3642e35d4d8eSmrg  case $host_os in
3643e35d4d8eSmrg  irix5* | nonstopux*)
3644e35d4d8eSmrg    libsuff= shlibsuff=
3645e35d4d8eSmrg    ;;
3646e35d4d8eSmrg  *)
3647e35d4d8eSmrg    case $LD in # libtool.m4 will add one of these switches to LD
3648e35d4d8eSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3649e35d4d8eSmrg      libsuff= shlibsuff= libmagic=32-bit;;
3650e35d4d8eSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3651e35d4d8eSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
3652e35d4d8eSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3653e35d4d8eSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3654e35d4d8eSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
3655e35d4d8eSmrg    esac
3656e35d4d8eSmrg    ;;
3657e35d4d8eSmrg  esac
3658e35d4d8eSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3659e35d4d8eSmrg  shlibpath_overrides_runpath=no
3660e35d4d8eSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3661e35d4d8eSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3662e35d4d8eSmrg  hardcode_into_libs=yes
3663e35d4d8eSmrg  ;;
3664e35d4d8eSmrg
3665e35d4d8eSmrg# No shared lib support for Linux oldld, aout, or coff.
3666e35d4d8eSmrglinux*oldld* | linux*aout* | linux*coff*)
3667e35d4d8eSmrg  dynamic_linker=no
3668e35d4d8eSmrg  ;;
3669e35d4d8eSmrg
3670e35d4d8eSmrg# This must be glibc/ELF.
3671e35d4d8eSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
3672e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3673e35d4d8eSmrg  need_lib_prefix=no
3674e35d4d8eSmrg  need_version=no
3675e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3676e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3677e35d4d8eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3678e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3679e35d4d8eSmrg  shlibpath_overrides_runpath=no
3680e35d4d8eSmrg
3681e35d4d8eSmrg  # Some binutils ld are patched to set DT_RUNPATH
3682e35d4d8eSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3683e35d4d8eSmrg    [lt_cv_shlibpath_overrides_runpath=no
3684e35d4d8eSmrg    save_LDFLAGS=$LDFLAGS
3685e35d4d8eSmrg    save_libdir=$libdir
3686e35d4d8eSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3687e35d4d8eSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3688e35d4d8eSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3689e35d4d8eSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3690e35d4d8eSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
3691e35d4d8eSmrg    LDFLAGS=$save_LDFLAGS
3692e35d4d8eSmrg    libdir=$save_libdir
3693e35d4d8eSmrg    ])
3694e35d4d8eSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3695e35d4d8eSmrg
3696e35d4d8eSmrg  # This implies no fast_install, which is unacceptable.
3697e35d4d8eSmrg  # Some rework will be needed to allow for fast_install
3698e35d4d8eSmrg  # before this can be enabled.
3699e35d4d8eSmrg  hardcode_into_libs=yes
3700e35d4d8eSmrg
3701e35d4d8eSmrg  # Append ld.so.conf contents to the search path
3702e35d4d8eSmrg  if test -f /etc/ld.so.conf; then
3703e35d4d8eSmrg    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' ' '`
3704e35d4d8eSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3705e35d4d8eSmrg  fi
3706e35d4d8eSmrg
3707e35d4d8eSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
3708e35d4d8eSmrg  # powerpc, because MkLinux only supported shared libraries with the
3709e35d4d8eSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
3710e35d4d8eSmrg  # most powerpc-linux boxes support dynamic linking these days and
3711e35d4d8eSmrg  # people can always --disable-shared, the test was removed, and we
3712e35d4d8eSmrg  # assume the GNU/Linux dynamic linker is in use.
3713e35d4d8eSmrg  dynamic_linker='GNU/Linux ld.so'
3714e35d4d8eSmrg  ;;
3715e35d4d8eSmrg
3716e35d4d8eSmrgnetbsd*)
3717e35d4d8eSmrg  version_type=sunos
3718e35d4d8eSmrg  need_lib_prefix=no
3719e35d4d8eSmrg  need_version=no
3720e35d4d8eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3721e35d4d8eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3722e35d4d8eSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3723e35d4d8eSmrg    dynamic_linker='NetBSD (a.out) ld.so'
3724e35d4d8eSmrg  else
3725e35d4d8eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3726e35d4d8eSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3727e35d4d8eSmrg    dynamic_linker='NetBSD ld.elf_so'
3728e35d4d8eSmrg  fi
3729e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3730e35d4d8eSmrg  shlibpath_overrides_runpath=yes
3731e35d4d8eSmrg  hardcode_into_libs=yes
3732e35d4d8eSmrg  ;;
3733e35d4d8eSmrg
3734e35d4d8eSmrgnewsos6)
3735e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3736e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3737e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3738e35d4d8eSmrg  shlibpath_overrides_runpath=yes
3739e35d4d8eSmrg  ;;
3740e35d4d8eSmrg
3741e35d4d8eSmrg*nto* | *qnx*)
3742e35d4d8eSmrg  version_type=qnx
3743e35d4d8eSmrg  need_lib_prefix=no
3744e35d4d8eSmrg  need_version=no
3745e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3746e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3747e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3748e35d4d8eSmrg  shlibpath_overrides_runpath=no
3749e35d4d8eSmrg  hardcode_into_libs=yes
3750e35d4d8eSmrg  dynamic_linker='ldqnx.so'
3751e35d4d8eSmrg  ;;
3752e35d4d8eSmrg
3753e35d4d8eSmrgopenbsd*)
3754e35d4d8eSmrg  version_type=sunos
3755e35d4d8eSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
3756e35d4d8eSmrg  need_lib_prefix=no
3757e35d4d8eSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3758e35d4d8eSmrg  case $host_os in
3759e35d4d8eSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3760e35d4d8eSmrg    *)				need_version=no  ;;
3761e35d4d8eSmrg  esac
3762e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3763e35d4d8eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3764e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3765e35d4d8eSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3766e35d4d8eSmrg    case $host_os in
3767e35d4d8eSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
3768e35d4d8eSmrg	shlibpath_overrides_runpath=no
3769e35d4d8eSmrg	;;
3770e35d4d8eSmrg      *)
3771e35d4d8eSmrg	shlibpath_overrides_runpath=yes
3772e35d4d8eSmrg	;;
3773e35d4d8eSmrg      esac
3774e35d4d8eSmrg  else
3775e35d4d8eSmrg    shlibpath_overrides_runpath=yes
3776e35d4d8eSmrg  fi
3777e35d4d8eSmrg  ;;
3778e35d4d8eSmrg
3779e35d4d8eSmrgos2*)
3780e35d4d8eSmrg  libname_spec='$name'
3781e35d4d8eSmrg  shrext_cmds=".dll"
3782e35d4d8eSmrg  need_lib_prefix=no
3783e35d4d8eSmrg  library_names_spec='$libname${shared_ext} $libname.a'
3784e35d4d8eSmrg  dynamic_linker='OS/2 ld.exe'
3785e35d4d8eSmrg  shlibpath_var=LIBPATH
3786e35d4d8eSmrg  ;;
3787e35d4d8eSmrg
3788e35d4d8eSmrgosf3* | osf4* | osf5*)
3789e35d4d8eSmrg  version_type=osf
3790e35d4d8eSmrg  need_lib_prefix=no
3791e35d4d8eSmrg  need_version=no
3792e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3793e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3794e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3795e35d4d8eSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3796e35d4d8eSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3797e35d4d8eSmrg  ;;
3798e35d4d8eSmrg
3799e35d4d8eSmrgrdos*)
3800e35d4d8eSmrg  dynamic_linker=no
3801e35d4d8eSmrg  ;;
3802e35d4d8eSmrg
3803e35d4d8eSmrgsolaris*)
3804e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3805e35d4d8eSmrg  need_lib_prefix=no
3806e35d4d8eSmrg  need_version=no
3807e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3808e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3809e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3810e35d4d8eSmrg  shlibpath_overrides_runpath=yes
3811e35d4d8eSmrg  hardcode_into_libs=yes
3812e35d4d8eSmrg  # ldd complains unless libraries are executable
3813e35d4d8eSmrg  postinstall_cmds='chmod +x $lib'
3814e35d4d8eSmrg  ;;
3815e35d4d8eSmrg
3816e35d4d8eSmrgsunos4*)
3817e35d4d8eSmrg  version_type=sunos
3818e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3819e35d4d8eSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3820e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3821e35d4d8eSmrg  shlibpath_overrides_runpath=yes
3822e35d4d8eSmrg  if test "$with_gnu_ld" = yes; then
3823e35d4d8eSmrg    need_lib_prefix=no
3824e35d4d8eSmrg  fi
3825e35d4d8eSmrg  need_version=yes
3826e35d4d8eSmrg  ;;
3827e35d4d8eSmrg
3828e35d4d8eSmrgsysv4 | sysv4.3*)
3829e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3830e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3831e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3832e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3833e35d4d8eSmrg  case $host_vendor in
3834e35d4d8eSmrg    sni)
3835e35d4d8eSmrg      shlibpath_overrides_runpath=no
3836e35d4d8eSmrg      need_lib_prefix=no
3837e35d4d8eSmrg      runpath_var=LD_RUN_PATH
3838e35d4d8eSmrg      ;;
3839e35d4d8eSmrg    siemens)
3840e35d4d8eSmrg      need_lib_prefix=no
3841e35d4d8eSmrg      ;;
3842e35d4d8eSmrg    motorola)
3843e35d4d8eSmrg      need_lib_prefix=no
3844e35d4d8eSmrg      need_version=no
3845e35d4d8eSmrg      shlibpath_overrides_runpath=no
3846e35d4d8eSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3847e35d4d8eSmrg      ;;
3848e35d4d8eSmrg  esac
3849e35d4d8eSmrg  ;;
3850e35d4d8eSmrg
3851e35d4d8eSmrgsysv4*MP*)
3852e35d4d8eSmrg  if test -d /usr/nec ;then
3853e35d4d8eSmrg    version_type=linux # correct to gnu/linux during the next big refactor
3854e35d4d8eSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3855e35d4d8eSmrg    soname_spec='$libname${shared_ext}.$major'
3856e35d4d8eSmrg    shlibpath_var=LD_LIBRARY_PATH
3857e35d4d8eSmrg  fi
3858e35d4d8eSmrg  ;;
3859e35d4d8eSmrg
3860e35d4d8eSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3861e35d4d8eSmrg  version_type=freebsd-elf
3862e35d4d8eSmrg  need_lib_prefix=no
3863e35d4d8eSmrg  need_version=no
3864e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3865e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3866e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3867e35d4d8eSmrg  shlibpath_overrides_runpath=yes
3868e35d4d8eSmrg  hardcode_into_libs=yes
3869e35d4d8eSmrg  if test "$with_gnu_ld" = yes; then
3870e35d4d8eSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3871e35d4d8eSmrg  else
3872e35d4d8eSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3873e35d4d8eSmrg    case $host_os in
3874e35d4d8eSmrg      sco3.2v5*)
3875e35d4d8eSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3876e35d4d8eSmrg	;;
3877e35d4d8eSmrg    esac
3878e35d4d8eSmrg  fi
3879e35d4d8eSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
3880e35d4d8eSmrg  ;;
3881e35d4d8eSmrg
3882e35d4d8eSmrgtpf*)
3883e35d4d8eSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3884e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3885e35d4d8eSmrg  need_lib_prefix=no
3886e35d4d8eSmrg  need_version=no
3887e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3888e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3889e35d4d8eSmrg  shlibpath_overrides_runpath=no
3890e35d4d8eSmrg  hardcode_into_libs=yes
3891e35d4d8eSmrg  ;;
3892e35d4d8eSmrg
3893e35d4d8eSmrguts4*)
3894e35d4d8eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3895e35d4d8eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3896e35d4d8eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3897e35d4d8eSmrg  shlibpath_var=LD_LIBRARY_PATH
3898e35d4d8eSmrg  ;;
3899e35d4d8eSmrg
3900e35d4d8eSmrg*)
3901e35d4d8eSmrg  dynamic_linker=no
3902e35d4d8eSmrg  ;;
3903e35d4d8eSmrgesac
3904e35d4d8eSmrgAC_MSG_RESULT([$dynamic_linker])
3905e35d4d8eSmrgtest "$dynamic_linker" = no && can_build_shared=no
3906e35d4d8eSmrg
3907e35d4d8eSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3908e35d4d8eSmrgif test "$GCC" = yes; then
3909e35d4d8eSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3910e35d4d8eSmrgfi
3911e35d4d8eSmrg
3912e35d4d8eSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3913e35d4d8eSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3914e35d4d8eSmrgfi
3915e35d4d8eSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3916e35d4d8eSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3917e35d4d8eSmrgfi
3918e35d4d8eSmrg
3919e35d4d8eSmrg_LT_DECL([], [variables_saved_for_relink], [1],
3920e35d4d8eSmrg    [Variables whose values should be saved in libtool wrapper scripts and
3921e35d4d8eSmrg    restored at link time])
3922e35d4d8eSmrg_LT_DECL([], [need_lib_prefix], [0],
3923e35d4d8eSmrg    [Do we need the "lib" prefix for modules?])
3924e35d4d8eSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3925e35d4d8eSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
3926e35d4d8eSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3927e35d4d8eSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3928e35d4d8eSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3929e35d4d8eSmrg    [Is shlibpath searched before the hard-coded library search path?])
3930e35d4d8eSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3931e35d4d8eSmrg_LT_DECL([], [library_names_spec], [1],
3932e35d4d8eSmrg    [[List of archive names.  First name is the real one, the rest are links.
3933e35d4d8eSmrg    The last name is the one that the linker finds with -lNAME]])
3934e35d4d8eSmrg_LT_DECL([], [soname_spec], [1],
3935e35d4d8eSmrg    [[The coded name of the library, if different from the real name]])
3936e35d4d8eSmrg_LT_DECL([], [install_override_mode], [1],
3937e35d4d8eSmrg    [Permission mode override for installation of shared libraries])
3938e35d4d8eSmrg_LT_DECL([], [postinstall_cmds], [2],
3939e35d4d8eSmrg    [Command to use after installation of a shared archive])
3940e35d4d8eSmrg_LT_DECL([], [postuninstall_cmds], [2],
3941e35d4d8eSmrg    [Command to use after uninstallation of a shared archive])
3942e35d4d8eSmrg_LT_DECL([], [finish_cmds], [2],
3943e35d4d8eSmrg    [Commands used to finish a libtool library installation in a directory])
3944e35d4d8eSmrg_LT_DECL([], [finish_eval], [1],
3945e35d4d8eSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
3946e35d4d8eSmrg    not shown]])
3947e35d4d8eSmrg_LT_DECL([], [hardcode_into_libs], [0],
3948e35d4d8eSmrg    [Whether we should hardcode library paths into libraries])
3949e35d4d8eSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3950e35d4d8eSmrg    [Compile-time system search path for libraries])
3951e35d4d8eSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3952e35d4d8eSmrg    [Run-time system search path for libraries])
3953e35d4d8eSmrg])# _LT_SYS_DYNAMIC_LINKER
3954e35d4d8eSmrg
3955e35d4d8eSmrg
3956e35d4d8eSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
3957e35d4d8eSmrg# --------------------------
3958e35d4d8eSmrg# find a file program which can recognize shared library
3959e35d4d8eSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3960e35d4d8eSmrg[m4_require([_LT_DECL_EGREP])dnl
3961e35d4d8eSmrgAC_MSG_CHECKING([for $1])
3962e35d4d8eSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3963e35d4d8eSmrg[case $MAGIC_CMD in
3964e35d4d8eSmrg[[\\/*] |  ?:[\\/]*])
3965e35d4d8eSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3966e35d4d8eSmrg  ;;
3967e35d4d8eSmrg*)
3968e35d4d8eSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
3969e35d4d8eSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3970e35d4d8eSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3971e35d4d8eSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3972e35d4d8eSmrgdnl not every word.  This closes a longstanding sh security hole.
3973e35d4d8eSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3974e35d4d8eSmrg  for ac_dir in $ac_dummy; do
3975e35d4d8eSmrg    IFS="$lt_save_ifs"
3976e35d4d8eSmrg    test -z "$ac_dir" && ac_dir=.
3977e35d4d8eSmrg    if test -f $ac_dir/$1; then
3978e35d4d8eSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3979e35d4d8eSmrg      if test -n "$file_magic_test_file"; then
3980e35d4d8eSmrg	case $deplibs_check_method in
3981e35d4d8eSmrg	"file_magic "*)
3982e35d4d8eSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3983e35d4d8eSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3984e35d4d8eSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3985e35d4d8eSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
3986e35d4d8eSmrg	    :
3987e35d4d8eSmrg	  else
3988e35d4d8eSmrg	    cat <<_LT_EOF 1>&2
3989e35d4d8eSmrg
3990e35d4d8eSmrg*** Warning: the command libtool uses to detect shared libraries,
3991e35d4d8eSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3992e35d4d8eSmrg*** The result is that libtool may fail to recognize shared libraries
3993e35d4d8eSmrg*** as such.  This will affect the creation of libtool libraries that
3994e35d4d8eSmrg*** depend on shared libraries, but programs linked with such libtool
3995e35d4d8eSmrg*** libraries will work regardless of this problem.  Nevertheless, you
3996e35d4d8eSmrg*** may want to report the problem to your system manager and/or to
3997e35d4d8eSmrg*** bug-libtool@gnu.org
3998e35d4d8eSmrg
3999e35d4d8eSmrg_LT_EOF
4000e35d4d8eSmrg	  fi ;;
4001e35d4d8eSmrg	esac
4002e35d4d8eSmrg      fi
4003e35d4d8eSmrg      break
4004e35d4d8eSmrg    fi
4005e35d4d8eSmrg  done
4006e35d4d8eSmrg  IFS="$lt_save_ifs"
4007e35d4d8eSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
4008e35d4d8eSmrg  ;;
4009e35d4d8eSmrgesac])
4010e35d4d8eSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4011e35d4d8eSmrgif test -n "$MAGIC_CMD"; then
4012e35d4d8eSmrg  AC_MSG_RESULT($MAGIC_CMD)
4013e35d4d8eSmrgelse
4014e35d4d8eSmrg  AC_MSG_RESULT(no)
4015e35d4d8eSmrgfi
4016e35d4d8eSmrg_LT_DECL([], [MAGIC_CMD], [0],
4017e35d4d8eSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4018e35d4d8eSmrg])# _LT_PATH_TOOL_PREFIX
4019e35d4d8eSmrg
4020e35d4d8eSmrg# Old name:
4021e35d4d8eSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4022e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
4023e35d4d8eSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4024e35d4d8eSmrg
4025e35d4d8eSmrg
4026e35d4d8eSmrg# _LT_PATH_MAGIC
4027e35d4d8eSmrg# --------------
4028e35d4d8eSmrg# find a file program which can recognize a shared library
4029e35d4d8eSmrgm4_defun([_LT_PATH_MAGIC],
4030e35d4d8eSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4031e35d4d8eSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
4032e35d4d8eSmrg  if test -n "$ac_tool_prefix"; then
4033e35d4d8eSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4034e35d4d8eSmrg  else
4035e35d4d8eSmrg    MAGIC_CMD=:
4036e35d4d8eSmrg  fi
4037e35d4d8eSmrgfi
4038e35d4d8eSmrg])# _LT_PATH_MAGIC
4039e35d4d8eSmrg
4040e35d4d8eSmrg
4041e35d4d8eSmrg# LT_PATH_LD
4042e35d4d8eSmrg# ----------
4043e35d4d8eSmrg# find the pathname to the GNU or non-GNU linker
4044e35d4d8eSmrgAC_DEFUN([LT_PATH_LD],
4045e35d4d8eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
4046e35d4d8eSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
4047e35d4d8eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
4048e35d4d8eSmrgm4_require([_LT_DECL_SED])dnl
4049e35d4d8eSmrgm4_require([_LT_DECL_EGREP])dnl
4050e35d4d8eSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4051e35d4d8eSmrg
4052e35d4d8eSmrgAC_ARG_WITH([gnu-ld],
4053e35d4d8eSmrg    [AS_HELP_STRING([--with-gnu-ld],
4054e35d4d8eSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4055e35d4d8eSmrg    [test "$withval" = no || with_gnu_ld=yes],
4056e35d4d8eSmrg    [with_gnu_ld=no])dnl
4057e35d4d8eSmrg
4058e35d4d8eSmrgac_prog=ld
4059e35d4d8eSmrgif test "$GCC" = yes; then
4060e35d4d8eSmrg  # Check if gcc -print-prog-name=ld gives a path.
4061e35d4d8eSmrg  AC_MSG_CHECKING([for ld used by $CC])
4062e35d4d8eSmrg  case $host in
4063e35d4d8eSmrg  *-*-mingw*)
4064e35d4d8eSmrg    # gcc leaves a trailing carriage return which upsets mingw
4065e35d4d8eSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4066e35d4d8eSmrg  *)
4067e35d4d8eSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4068e35d4d8eSmrg  esac
4069e35d4d8eSmrg  case $ac_prog in
4070e35d4d8eSmrg    # Accept absolute paths.
4071e35d4d8eSmrg    [[\\/]]* | ?:[[\\/]]*)
4072e35d4d8eSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
4073e35d4d8eSmrg      # Canonicalize the pathname of ld
4074e35d4d8eSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4075e35d4d8eSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4076e35d4d8eSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4077e35d4d8eSmrg      done
4078e35d4d8eSmrg      test -z "$LD" && LD="$ac_prog"
4079e35d4d8eSmrg      ;;
4080e35d4d8eSmrg  "")
4081e35d4d8eSmrg    # If it fails, then pretend we aren't using GCC.
4082e35d4d8eSmrg    ac_prog=ld
4083e35d4d8eSmrg    ;;
4084e35d4d8eSmrg  *)
4085e35d4d8eSmrg    # If it is relative, then search for the first ld in PATH.
4086e35d4d8eSmrg    with_gnu_ld=unknown
4087e35d4d8eSmrg    ;;
4088e35d4d8eSmrg  esac
4089e35d4d8eSmrgelif test "$with_gnu_ld" = yes; then
4090e35d4d8eSmrg  AC_MSG_CHECKING([for GNU ld])
4091e35d4d8eSmrgelse
4092e35d4d8eSmrg  AC_MSG_CHECKING([for non-GNU ld])
4093e35d4d8eSmrgfi
4094e35d4d8eSmrgAC_CACHE_VAL(lt_cv_path_LD,
4095e35d4d8eSmrg[if test -z "$LD"; then
4096e35d4d8eSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4097e35d4d8eSmrg  for ac_dir in $PATH; do
4098e35d4d8eSmrg    IFS="$lt_save_ifs"
4099e35d4d8eSmrg    test -z "$ac_dir" && ac_dir=.
4100e35d4d8eSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4101e35d4d8eSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
4102e35d4d8eSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
4103e35d4d8eSmrg      # but apparently some variants of GNU ld only accept -v.
4104e35d4d8eSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
4105e35d4d8eSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4106e35d4d8eSmrg      *GNU* | *'with BFD'*)
4107e35d4d8eSmrg	test "$with_gnu_ld" != no && break
4108e35d4d8eSmrg	;;
4109e35d4d8eSmrg      *)
4110e35d4d8eSmrg	test "$with_gnu_ld" != yes && break
4111e35d4d8eSmrg	;;
4112e35d4d8eSmrg      esac
4113e35d4d8eSmrg    fi
4114e35d4d8eSmrg  done
4115e35d4d8eSmrg  IFS="$lt_save_ifs"
4116e35d4d8eSmrgelse
4117e35d4d8eSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4118e35d4d8eSmrgfi])
4119e35d4d8eSmrgLD="$lt_cv_path_LD"
4120e35d4d8eSmrgif test -n "$LD"; then
4121e35d4d8eSmrg  AC_MSG_RESULT($LD)
4122e35d4d8eSmrgelse
4123e35d4d8eSmrg  AC_MSG_RESULT(no)
4124e35d4d8eSmrgfi
4125e35d4d8eSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4126e35d4d8eSmrg_LT_PATH_LD_GNU
4127e35d4d8eSmrgAC_SUBST([LD])
4128e35d4d8eSmrg
4129e35d4d8eSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4130e35d4d8eSmrg])# LT_PATH_LD
4131e35d4d8eSmrg
4132e35d4d8eSmrg# Old names:
4133e35d4d8eSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4134e35d4d8eSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4135e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
4136e35d4d8eSmrgdnl AC_DEFUN([AM_PROG_LD], [])
4137e35d4d8eSmrgdnl AC_DEFUN([AC_PROG_LD], [])
4138e35d4d8eSmrg
4139e35d4d8eSmrg
4140e35d4d8eSmrg# _LT_PATH_LD_GNU
4141e35d4d8eSmrg#- --------------
4142e35d4d8eSmrgm4_defun([_LT_PATH_LD_GNU],
4143e35d4d8eSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4144e35d4d8eSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4145e35d4d8eSmrgcase `$LD -v 2>&1 </dev/null` in
4146e35d4d8eSmrg*GNU* | *'with BFD'*)
4147e35d4d8eSmrg  lt_cv_prog_gnu_ld=yes
4148e35d4d8eSmrg  ;;
4149e35d4d8eSmrg*)
4150e35d4d8eSmrg  lt_cv_prog_gnu_ld=no
4151e35d4d8eSmrg  ;;
4152e35d4d8eSmrgesac])
4153e35d4d8eSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
4154e35d4d8eSmrg])# _LT_PATH_LD_GNU
4155e35d4d8eSmrg
4156e35d4d8eSmrg
4157e35d4d8eSmrg# _LT_CMD_RELOAD
4158e35d4d8eSmrg# --------------
4159e35d4d8eSmrg# find reload flag for linker
4160e35d4d8eSmrg#   -- PORTME Some linkers may need a different reload flag.
4161e35d4d8eSmrgm4_defun([_LT_CMD_RELOAD],
4162e35d4d8eSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
4163e35d4d8eSmrg  lt_cv_ld_reload_flag,
4164e35d4d8eSmrg  [lt_cv_ld_reload_flag='-r'])
4165e35d4d8eSmrgreload_flag=$lt_cv_ld_reload_flag
4166e35d4d8eSmrgcase $reload_flag in
4167e35d4d8eSmrg"" | " "*) ;;
4168e35d4d8eSmrg*) reload_flag=" $reload_flag" ;;
4169e35d4d8eSmrgesac
4170e35d4d8eSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
4171e35d4d8eSmrgcase $host_os in
4172e35d4d8eSmrg  cygwin* | mingw* | pw32* | cegcc*)
4173e35d4d8eSmrg    if test "$GCC" != yes; then
4174e35d4d8eSmrg      reload_cmds=false
4175e35d4d8eSmrg    fi
4176e35d4d8eSmrg    ;;
4177e35d4d8eSmrg  darwin*)
4178e35d4d8eSmrg    if test "$GCC" = yes; then
4179e35d4d8eSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4180e35d4d8eSmrg    else
4181e35d4d8eSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4182e35d4d8eSmrg    fi
4183e35d4d8eSmrg    ;;
4184e35d4d8eSmrgesac
4185e35d4d8eSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4186e35d4d8eSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
4187e35d4d8eSmrg])# _LT_CMD_RELOAD
4188e35d4d8eSmrg
4189e35d4d8eSmrg
4190e35d4d8eSmrg# _LT_CHECK_MAGIC_METHOD
4191e35d4d8eSmrg# ----------------------
4192e35d4d8eSmrg# how to check for library dependencies
4193e35d4d8eSmrg#  -- PORTME fill in with the dynamic library characteristics
4194e35d4d8eSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
4195e35d4d8eSmrg[m4_require([_LT_DECL_EGREP])
4196e35d4d8eSmrgm4_require([_LT_DECL_OBJDUMP])
4197e35d4d8eSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
4198e35d4d8eSmrglt_cv_deplibs_check_method,
4199e35d4d8eSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
4200e35d4d8eSmrglt_cv_file_magic_test_file=
4201e35d4d8eSmrglt_cv_deplibs_check_method='unknown'
4202e35d4d8eSmrg# Need to set the preceding variable on all platforms that support
4203e35d4d8eSmrg# interlibrary dependencies.
4204e35d4d8eSmrg# 'none' -- dependencies not supported.
4205e35d4d8eSmrg# `unknown' -- same as none, but documents that we really don't know.
4206e35d4d8eSmrg# 'pass_all' -- all dependencies passed with no checks.
4207e35d4d8eSmrg# 'test_compile' -- check by making test program.
4208e35d4d8eSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
4209e35d4d8eSmrg# which responds to the $file_magic_cmd with a given extended regex.
4210e35d4d8eSmrg# If you have `file' or equivalent on your system and you're not sure
4211e35d4d8eSmrg# whether `pass_all' will *always* work, you probably want this one.
4212e35d4d8eSmrg
4213e35d4d8eSmrgcase $host_os in
4214e35d4d8eSmrgaix[[4-9]]*)
4215e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4216e35d4d8eSmrg  ;;
4217e35d4d8eSmrg
4218e35d4d8eSmrgbeos*)
4219e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4220e35d4d8eSmrg  ;;
4221e35d4d8eSmrg
4222e35d4d8eSmrgbsdi[[45]]*)
4223e35d4d8eSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4224e35d4d8eSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
4225e35d4d8eSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
4226e35d4d8eSmrg  ;;
4227e35d4d8eSmrg
4228e35d4d8eSmrgcygwin*)
4229e35d4d8eSmrg  # func_win32_libid is a shell function defined in ltmain.sh
4230e35d4d8eSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4231e35d4d8eSmrg  lt_cv_file_magic_cmd='func_win32_libid'
4232e35d4d8eSmrg  ;;
4233e35d4d8eSmrg
4234e35d4d8eSmrgmingw* | pw32*)
4235e35d4d8eSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
4236e35d4d8eSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4237e35d4d8eSmrg  # unless we find 'file', for example because we are cross-compiling.
4238e35d4d8eSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4239e35d4d8eSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4240e35d4d8eSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4241e35d4d8eSmrg    lt_cv_file_magic_cmd='func_win32_libid'
4242e35d4d8eSmrg  else
4243e35d4d8eSmrg    # Keep this pattern in sync with the one in func_win32_libid.
4244e35d4d8eSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4245e35d4d8eSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
4246e35d4d8eSmrg  fi
4247e35d4d8eSmrg  ;;
4248e35d4d8eSmrg
4249e35d4d8eSmrgcegcc*)
4250e35d4d8eSmrg  # use the weaker test based on 'objdump'. See mingw*.
4251e35d4d8eSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4252e35d4d8eSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
4253e35d4d8eSmrg  ;;
4254e35d4d8eSmrg
4255e35d4d8eSmrgdarwin* | rhapsody*)
4256e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4257e35d4d8eSmrg  ;;
4258e35d4d8eSmrg
4259e35d4d8eSmrgfreebsd* | dragonfly*)
4260e35d4d8eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4261e35d4d8eSmrg    case $host_cpu in
4262e35d4d8eSmrg    i*86 )
4263e35d4d8eSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
4264e35d4d8eSmrg      # Let's accept both of them until this is cleared up.
4265e35d4d8eSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4266e35d4d8eSmrg      lt_cv_file_magic_cmd=/usr/bin/file
4267e35d4d8eSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4268e35d4d8eSmrg      ;;
4269e35d4d8eSmrg    esac
4270e35d4d8eSmrg  else
4271e35d4d8eSmrg    lt_cv_deplibs_check_method=pass_all
4272e35d4d8eSmrg  fi
4273e35d4d8eSmrg  ;;
4274e35d4d8eSmrg
4275e35d4d8eSmrggnu*)
4276e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4277e35d4d8eSmrg  ;;
4278e35d4d8eSmrg
4279e35d4d8eSmrghaiku*)
4280e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4281e35d4d8eSmrg  ;;
4282e35d4d8eSmrg
4283e35d4d8eSmrghpux10.20* | hpux11*)
4284e35d4d8eSmrg  lt_cv_file_magic_cmd=/usr/bin/file
4285e35d4d8eSmrg  case $host_cpu in
4286e35d4d8eSmrg  ia64*)
4287e35d4d8eSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4288e35d4d8eSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4289e35d4d8eSmrg    ;;
4290e35d4d8eSmrg  hppa*64*)
4291e35d4d8eSmrg    [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]']
4292e35d4d8eSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4293e35d4d8eSmrg    ;;
4294e35d4d8eSmrg  *)
4295e35d4d8eSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4296e35d4d8eSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4297e35d4d8eSmrg    ;;
4298e35d4d8eSmrg  esac
4299e35d4d8eSmrg  ;;
4300e35d4d8eSmrg
4301e35d4d8eSmrginterix[[3-9]]*)
4302e35d4d8eSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4303e35d4d8eSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4304e35d4d8eSmrg  ;;
4305e35d4d8eSmrg
4306e35d4d8eSmrgirix5* | irix6* | nonstopux*)
4307e35d4d8eSmrg  case $LD in
4308e35d4d8eSmrg  *-32|*"-32 ") libmagic=32-bit;;
4309e35d4d8eSmrg  *-n32|*"-n32 ") libmagic=N32;;
4310e35d4d8eSmrg  *-64|*"-64 ") libmagic=64-bit;;
4311e35d4d8eSmrg  *) libmagic=never-match;;
4312e35d4d8eSmrg  esac
4313e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4314e35d4d8eSmrg  ;;
4315e35d4d8eSmrg
4316e35d4d8eSmrg# This must be glibc/ELF.
4317e35d4d8eSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
4318e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4319e35d4d8eSmrg  ;;
4320e35d4d8eSmrg
4321e35d4d8eSmrgnetbsd*)
4322e35d4d8eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4323e35d4d8eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4324e35d4d8eSmrg  else
4325e35d4d8eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4326e35d4d8eSmrg  fi
4327e35d4d8eSmrg  ;;
4328e35d4d8eSmrg
4329e35d4d8eSmrgnewos6*)
4330e35d4d8eSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4331e35d4d8eSmrg  lt_cv_file_magic_cmd=/usr/bin/file
4332e35d4d8eSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4333e35d4d8eSmrg  ;;
4334e35d4d8eSmrg
4335e35d4d8eSmrg*nto* | *qnx*)
4336e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4337e35d4d8eSmrg  ;;
4338e35d4d8eSmrg
4339e35d4d8eSmrgopenbsd*)
4340e35d4d8eSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4341e35d4d8eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4342e35d4d8eSmrg  else
4343e35d4d8eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4344e35d4d8eSmrg  fi
4345e35d4d8eSmrg  ;;
4346e35d4d8eSmrg
4347e35d4d8eSmrgosf3* | osf4* | osf5*)
4348e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4349e35d4d8eSmrg  ;;
4350e35d4d8eSmrg
4351e35d4d8eSmrgrdos*)
4352e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4353e35d4d8eSmrg  ;;
4354e35d4d8eSmrg
4355e35d4d8eSmrgsolaris*)
4356e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4357e35d4d8eSmrg  ;;
4358e35d4d8eSmrg
4359e35d4d8eSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4360e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4361e35d4d8eSmrg  ;;
4362e35d4d8eSmrg
4363e35d4d8eSmrgsysv4 | sysv4.3*)
4364e35d4d8eSmrg  case $host_vendor in
4365e35d4d8eSmrg  motorola)
4366e35d4d8eSmrg    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]]'
4367e35d4d8eSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4368e35d4d8eSmrg    ;;
4369e35d4d8eSmrg  ncr)
4370e35d4d8eSmrg    lt_cv_deplibs_check_method=pass_all
4371e35d4d8eSmrg    ;;
4372e35d4d8eSmrg  sequent)
4373e35d4d8eSmrg    lt_cv_file_magic_cmd='/bin/file'
4374e35d4d8eSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4375e35d4d8eSmrg    ;;
4376e35d4d8eSmrg  sni)
4377e35d4d8eSmrg    lt_cv_file_magic_cmd='/bin/file'
4378e35d4d8eSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4379e35d4d8eSmrg    lt_cv_file_magic_test_file=/lib/libc.so
4380e35d4d8eSmrg    ;;
4381e35d4d8eSmrg  siemens)
4382e35d4d8eSmrg    lt_cv_deplibs_check_method=pass_all
4383e35d4d8eSmrg    ;;
4384e35d4d8eSmrg  pc)
4385e35d4d8eSmrg    lt_cv_deplibs_check_method=pass_all
4386e35d4d8eSmrg    ;;
4387e35d4d8eSmrg  esac
4388e35d4d8eSmrg  ;;
4389e35d4d8eSmrg
4390e35d4d8eSmrgtpf*)
4391e35d4d8eSmrg  lt_cv_deplibs_check_method=pass_all
4392e35d4d8eSmrg  ;;
4393e35d4d8eSmrgesac
4394e35d4d8eSmrg])
4395e35d4d8eSmrg
4396e35d4d8eSmrgfile_magic_glob=
4397e35d4d8eSmrgwant_nocaseglob=no
4398e35d4d8eSmrgif test "$build" = "$host"; then
4399e35d4d8eSmrg  case $host_os in
4400e35d4d8eSmrg  mingw* | pw32*)
4401e35d4d8eSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4402e35d4d8eSmrg      want_nocaseglob=yes
4403e35d4d8eSmrg    else
4404e35d4d8eSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4405e35d4d8eSmrg    fi
4406e35d4d8eSmrg    ;;
4407e35d4d8eSmrg  esac
4408e35d4d8eSmrgfi
4409e35d4d8eSmrg
4410e35d4d8eSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
4411e35d4d8eSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
4412e35d4d8eSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
4413e35d4d8eSmrg
4414e35d4d8eSmrg_LT_DECL([], [deplibs_check_method], [1],
4415e35d4d8eSmrg    [Method to check whether dependent libraries are shared objects])
4416e35d4d8eSmrg_LT_DECL([], [file_magic_cmd], [1],
4417e35d4d8eSmrg    [Command to use when deplibs_check_method = "file_magic"])
4418e35d4d8eSmrg_LT_DECL([], [file_magic_glob], [1],
4419e35d4d8eSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
4420e35d4d8eSmrg_LT_DECL([], [want_nocaseglob], [1],
4421e35d4d8eSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4422e35d4d8eSmrg])# _LT_CHECK_MAGIC_METHOD
4423e35d4d8eSmrg
4424e35d4d8eSmrg
4425e35d4d8eSmrg# LT_PATH_NM
4426e35d4d8eSmrg# ----------
4427e35d4d8eSmrg# find the pathname to a BSD- or MS-compatible name lister
4428e35d4d8eSmrgAC_DEFUN([LT_PATH_NM],
4429e35d4d8eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
4430e35d4d8eSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4431e35d4d8eSmrg[if test -n "$NM"; then
4432e35d4d8eSmrg  # Let the user override the test.
4433e35d4d8eSmrg  lt_cv_path_NM="$NM"
4434e35d4d8eSmrgelse
4435e35d4d8eSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
4436e35d4d8eSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4437e35d4d8eSmrg    lt_nm_to_check="$lt_nm_to_check nm"
4438e35d4d8eSmrg  fi
4439e35d4d8eSmrg  for lt_tmp_nm in $lt_nm_to_check; do
4440e35d4d8eSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4441e35d4d8eSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4442e35d4d8eSmrg      IFS="$lt_save_ifs"
4443e35d4d8eSmrg      test -z "$ac_dir" && ac_dir=.
4444e35d4d8eSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
4445e35d4d8eSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4446e35d4d8eSmrg	# Check to see if the nm accepts a BSD-compat flag.
4447e35d4d8eSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4448e35d4d8eSmrg	#   nm: unknown option "B" ignored
4449e35d4d8eSmrg	# Tru64's nm complains that /dev/null is an invalid object file
4450e35d4d8eSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4451e35d4d8eSmrg	*/dev/null* | *'Invalid file or object type'*)
4452e35d4d8eSmrg	  lt_cv_path_NM="$tmp_nm -B"
4453e35d4d8eSmrg	  break
4454e35d4d8eSmrg	  ;;
4455e35d4d8eSmrg	*)
4456e35d4d8eSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4457e35d4d8eSmrg	  */dev/null*)
4458e35d4d8eSmrg	    lt_cv_path_NM="$tmp_nm -p"
4459e35d4d8eSmrg	    break
4460e35d4d8eSmrg	    ;;
4461e35d4d8eSmrg	  *)
4462e35d4d8eSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4463e35d4d8eSmrg	    continue # so that we can try to find one that supports BSD flags
4464e35d4d8eSmrg	    ;;
4465e35d4d8eSmrg	  esac
4466e35d4d8eSmrg	  ;;
4467e35d4d8eSmrg	esac
4468e35d4d8eSmrg      fi
4469e35d4d8eSmrg    done
4470e35d4d8eSmrg    IFS="$lt_save_ifs"
4471e35d4d8eSmrg  done
4472e35d4d8eSmrg  : ${lt_cv_path_NM=no}
4473e35d4d8eSmrgfi])
4474e35d4d8eSmrgif test "$lt_cv_path_NM" != "no"; then
4475e35d4d8eSmrg  NM="$lt_cv_path_NM"
4476e35d4d8eSmrgelse
4477e35d4d8eSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
4478e35d4d8eSmrg  if test -n "$DUMPBIN"; then :
4479e35d4d8eSmrg    # Let the user override the test.
4480e35d4d8eSmrg  else
4481e35d4d8eSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4482e35d4d8eSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4483e35d4d8eSmrg    *COFF*)
4484e35d4d8eSmrg      DUMPBIN="$DUMPBIN -symbols"
4485e35d4d8eSmrg      ;;
4486e35d4d8eSmrg    *)
4487e35d4d8eSmrg      DUMPBIN=:
4488e35d4d8eSmrg      ;;
4489e35d4d8eSmrg    esac
4490e35d4d8eSmrg  fi
4491e35d4d8eSmrg  AC_SUBST([DUMPBIN])
4492e35d4d8eSmrg  if test "$DUMPBIN" != ":"; then
4493e35d4d8eSmrg    NM="$DUMPBIN"
4494e35d4d8eSmrg  fi
4495e35d4d8eSmrgfi
4496e35d4d8eSmrgtest -z "$NM" && NM=nm
4497e35d4d8eSmrgAC_SUBST([NM])
4498e35d4d8eSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4499e35d4d8eSmrg
4500e35d4d8eSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4501e35d4d8eSmrg  [lt_cv_nm_interface="BSD nm"
4502e35d4d8eSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
4503e35d4d8eSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4504e35d4d8eSmrg  (eval "$ac_compile" 2>conftest.err)
4505e35d4d8eSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
4506e35d4d8eSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4507e35d4d8eSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4508e35d4d8eSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
4509e35d4d8eSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4510e35d4d8eSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
4511e35d4d8eSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4512e35d4d8eSmrg    lt_cv_nm_interface="MS dumpbin"
4513e35d4d8eSmrg  fi
4514e35d4d8eSmrg  rm -f conftest*])
4515e35d4d8eSmrg])# LT_PATH_NM
4516e35d4d8eSmrg
4517e35d4d8eSmrg# Old names:
4518e35d4d8eSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4519e35d4d8eSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4520e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
4521e35d4d8eSmrgdnl AC_DEFUN([AM_PROG_NM], [])
4522e35d4d8eSmrgdnl AC_DEFUN([AC_PROG_NM], [])
4523e35d4d8eSmrg
4524e35d4d8eSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4525e35d4d8eSmrg# --------------------------------
4526e35d4d8eSmrg# how to determine the name of the shared library
4527e35d4d8eSmrg# associated with a specific link library.
4528e35d4d8eSmrg#  -- PORTME fill in with the dynamic library characteristics
4529e35d4d8eSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4530e35d4d8eSmrg[m4_require([_LT_DECL_EGREP])
4531e35d4d8eSmrgm4_require([_LT_DECL_OBJDUMP])
4532e35d4d8eSmrgm4_require([_LT_DECL_DLLTOOL])
4533e35d4d8eSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
4534e35d4d8eSmrglt_cv_sharedlib_from_linklib_cmd,
4535e35d4d8eSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
4536e35d4d8eSmrg
4537e35d4d8eSmrgcase $host_os in
4538e35d4d8eSmrgcygwin* | mingw* | pw32* | cegcc*)
4539e35d4d8eSmrg  # two different shell functions defined in ltmain.sh
4540e35d4d8eSmrg  # decide which to use based on capabilities of $DLLTOOL
4541e35d4d8eSmrg  case `$DLLTOOL --help 2>&1` in
4542e35d4d8eSmrg  *--identify-strict*)
4543e35d4d8eSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4544e35d4d8eSmrg    ;;
4545e35d4d8eSmrg  *)
4546e35d4d8eSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4547e35d4d8eSmrg    ;;
4548e35d4d8eSmrg  esac
4549e35d4d8eSmrg  ;;
4550e35d4d8eSmrg*)
4551e35d4d8eSmrg  # fallback: assume linklib IS sharedlib
4552e35d4d8eSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4553e35d4d8eSmrg  ;;
4554e35d4d8eSmrgesac
4555e35d4d8eSmrg])
4556e35d4d8eSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4557e35d4d8eSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4558e35d4d8eSmrg
4559e35d4d8eSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4560e35d4d8eSmrg    [Command to associate shared and link libraries])
4561e35d4d8eSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4562e35d4d8eSmrg
4563e35d4d8eSmrg
4564e35d4d8eSmrg# _LT_PATH_MANIFEST_TOOL
4565e35d4d8eSmrg# ----------------------
4566e35d4d8eSmrg# locate the manifest tool
4567e35d4d8eSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
4568e35d4d8eSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4569e35d4d8eSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4570e35d4d8eSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4571e35d4d8eSmrg  [lt_cv_path_mainfest_tool=no
4572e35d4d8eSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4573e35d4d8eSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4574e35d4d8eSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
4575e35d4d8eSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4576e35d4d8eSmrg    lt_cv_path_mainfest_tool=yes
4577e35d4d8eSmrg  fi
4578e35d4d8eSmrg  rm -f conftest*])
4579e35d4d8eSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
4580e35d4d8eSmrg  MANIFEST_TOOL=:
4581e35d4d8eSmrgfi
4582e35d4d8eSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4583e35d4d8eSmrg])# _LT_PATH_MANIFEST_TOOL
4584e35d4d8eSmrg
4585e35d4d8eSmrg
4586e35d4d8eSmrg# LT_LIB_M
4587e35d4d8eSmrg# --------
4588e35d4d8eSmrg# check for math library
4589e35d4d8eSmrgAC_DEFUN([LT_LIB_M],
4590e35d4d8eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4591e35d4d8eSmrgLIBM=
4592e35d4d8eSmrgcase $host in
4593e35d4d8eSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4594e35d4d8eSmrg  # These system don't have libm, or don't need it
4595e35d4d8eSmrg  ;;
4596e35d4d8eSmrg*-ncr-sysv4.3*)
4597e35d4d8eSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4598e35d4d8eSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4599e35d4d8eSmrg  ;;
4600e35d4d8eSmrg*)
4601e35d4d8eSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
4602e35d4d8eSmrg  ;;
4603e35d4d8eSmrgesac
4604e35d4d8eSmrgAC_SUBST([LIBM])
4605e35d4d8eSmrg])# LT_LIB_M
4606e35d4d8eSmrg
4607e35d4d8eSmrg# Old name:
4608e35d4d8eSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4609e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
4610e35d4d8eSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
4611e35d4d8eSmrg
4612e35d4d8eSmrg
4613e35d4d8eSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
4614e35d4d8eSmrg# -------------------------------
4615e35d4d8eSmrgm4_defun([_LT_COMPILER_NO_RTTI],
4616e35d4d8eSmrg[m4_require([_LT_TAG_COMPILER])dnl
4617e35d4d8eSmrg
4618e35d4d8eSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4619e35d4d8eSmrg
4620e35d4d8eSmrgif test "$GCC" = yes; then
4621e35d4d8eSmrg  case $cc_basename in
4622e35d4d8eSmrg  nvcc*)
4623e35d4d8eSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4624e35d4d8eSmrg  *)
4625e35d4d8eSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4626e35d4d8eSmrg  esac
4627e35d4d8eSmrg
4628e35d4d8eSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4629e35d4d8eSmrg    lt_cv_prog_compiler_rtti_exceptions,
4630e35d4d8eSmrg    [-fno-rtti -fno-exceptions], [],
4631e35d4d8eSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4632e35d4d8eSmrgfi
4633e35d4d8eSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4634e35d4d8eSmrg	[Compiler flag to turn off builtin functions])
4635e35d4d8eSmrg])# _LT_COMPILER_NO_RTTI
4636e35d4d8eSmrg
4637e35d4d8eSmrg
4638e35d4d8eSmrg# _LT_CMD_GLOBAL_SYMBOLS
4639e35d4d8eSmrg# ----------------------
4640e35d4d8eSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4641e35d4d8eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4642e35d4d8eSmrgAC_REQUIRE([AC_PROG_CC])dnl
4643e35d4d8eSmrgAC_REQUIRE([AC_PROG_AWK])dnl
4644e35d4d8eSmrgAC_REQUIRE([LT_PATH_NM])dnl
4645e35d4d8eSmrgAC_REQUIRE([LT_PATH_LD])dnl
4646e35d4d8eSmrgm4_require([_LT_DECL_SED])dnl
4647e35d4d8eSmrgm4_require([_LT_DECL_EGREP])dnl
4648e35d4d8eSmrgm4_require([_LT_TAG_COMPILER])dnl
4649e35d4d8eSmrg
4650e35d4d8eSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
4651e35d4d8eSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4652e35d4d8eSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4653e35d4d8eSmrg[
4654e35d4d8eSmrg# These are sane defaults that work on at least a few old systems.
4655e35d4d8eSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4656e35d4d8eSmrg
4657e35d4d8eSmrg# Character class describing NM global symbol codes.
4658e35d4d8eSmrgsymcode='[[BCDEGRST]]'
4659e35d4d8eSmrg
4660e35d4d8eSmrg# Regexp to match symbols that can be accessed directly from C.
4661e35d4d8eSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4662e35d4d8eSmrg
4663e35d4d8eSmrg# Define system-specific variables.
4664e35d4d8eSmrgcase $host_os in
4665e35d4d8eSmrgaix*)
4666e35d4d8eSmrg  symcode='[[BCDT]]'
4667e35d4d8eSmrg  ;;
4668e35d4d8eSmrgcygwin* | mingw* | pw32* | cegcc*)
4669e35d4d8eSmrg  symcode='[[ABCDGISTW]]'
4670e35d4d8eSmrg  ;;
4671e35d4d8eSmrghpux*)
4672e35d4d8eSmrg  if test "$host_cpu" = ia64; then
4673e35d4d8eSmrg    symcode='[[ABCDEGRST]]'
4674e35d4d8eSmrg  fi
4675e35d4d8eSmrg  ;;
4676e35d4d8eSmrgirix* | nonstopux*)
4677e35d4d8eSmrg  symcode='[[BCDEGRST]]'
4678e35d4d8eSmrg  ;;
4679e35d4d8eSmrgosf*)
4680e35d4d8eSmrg  symcode='[[BCDEGQRST]]'
4681e35d4d8eSmrg  ;;
4682e35d4d8eSmrgsolaris*)
4683e35d4d8eSmrg  symcode='[[BDRT]]'
4684e35d4d8eSmrg  ;;
4685e35d4d8eSmrgsco3.2v5*)
4686e35d4d8eSmrg  symcode='[[DT]]'
4687e35d4d8eSmrg  ;;
4688e35d4d8eSmrgsysv4.2uw2*)
4689e35d4d8eSmrg  symcode='[[DT]]'
4690e35d4d8eSmrg  ;;
4691e35d4d8eSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
4692e35d4d8eSmrg  symcode='[[ABDT]]'
4693e35d4d8eSmrg  ;;
4694e35d4d8eSmrgsysv4)
4695e35d4d8eSmrg  symcode='[[DFNSTU]]'
4696e35d4d8eSmrg  ;;
4697e35d4d8eSmrgesac
4698e35d4d8eSmrg
4699e35d4d8eSmrg# If we're using GNU nm, then use its standard symbol codes.
4700e35d4d8eSmrgcase `$NM -V 2>&1` in
4701e35d4d8eSmrg*GNU* | *'with BFD'*)
4702e35d4d8eSmrg  symcode='[[ABCDGIRSTW]]' ;;
4703e35d4d8eSmrgesac
4704e35d4d8eSmrg
4705e35d4d8eSmrg# Transform an extracted symbol line into a proper C declaration.
4706e35d4d8eSmrg# Some systems (esp. on ia64) link data and code symbols differently,
4707e35d4d8eSmrg# so use this general approach.
4708e35d4d8eSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4709e35d4d8eSmrg
4710e35d4d8eSmrg# Transform an extracted symbol line into symbol name and symbol address
4711e35d4d8eSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4712e35d4d8eSmrglt_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'"
4713e35d4d8eSmrg
4714e35d4d8eSmrg# Handle CRLF in mingw tool chain
4715e35d4d8eSmrgopt_cr=
4716e35d4d8eSmrgcase $build_os in
4717e35d4d8eSmrgmingw*)
4718e35d4d8eSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4719e35d4d8eSmrg  ;;
4720e35d4d8eSmrgesac
4721e35d4d8eSmrg
4722e35d4d8eSmrg# Try without a prefix underscore, then with it.
4723e35d4d8eSmrgfor ac_symprfx in "" "_"; do
4724e35d4d8eSmrg
4725e35d4d8eSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4726e35d4d8eSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4727e35d4d8eSmrg
4728e35d4d8eSmrg  # Write the raw and C identifiers.
4729e35d4d8eSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4730e35d4d8eSmrg    # Fake it for dumpbin and say T for any non-static function
4731e35d4d8eSmrg    # and D for any global variable.
4732e35d4d8eSmrg    # Also find C++ and __fastcall symbols from MSVC++,
4733e35d4d8eSmrg    # which start with @ or ?.
4734e35d4d8eSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4735e35d4d8eSmrg"     {last_section=section; section=\$ 3};"\
4736e35d4d8eSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4737e35d4d8eSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4738e35d4d8eSmrg"     \$ 0!~/External *\|/{next};"\
4739e35d4d8eSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4740e35d4d8eSmrg"     {if(hide[section]) next};"\
4741e35d4d8eSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4742e35d4d8eSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4743e35d4d8eSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4744e35d4d8eSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4745e35d4d8eSmrg"     ' prfx=^$ac_symprfx]"
4746e35d4d8eSmrg  else
4747e35d4d8eSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4748e35d4d8eSmrg  fi
4749e35d4d8eSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4750e35d4d8eSmrg
4751e35d4d8eSmrg  # Check to see that the pipe works correctly.
4752e35d4d8eSmrg  pipe_works=no
4753e35d4d8eSmrg
4754e35d4d8eSmrg  rm -f conftest*
4755e35d4d8eSmrg  cat > conftest.$ac_ext <<_LT_EOF
4756e35d4d8eSmrg#ifdef __cplusplus
4757e35d4d8eSmrgextern "C" {
4758e35d4d8eSmrg#endif
4759e35d4d8eSmrgchar nm_test_var;
4760e35d4d8eSmrgvoid nm_test_func(void);
4761e35d4d8eSmrgvoid nm_test_func(void){}
4762e35d4d8eSmrg#ifdef __cplusplus
4763e35d4d8eSmrg}
4764e35d4d8eSmrg#endif
4765e35d4d8eSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
4766e35d4d8eSmrg_LT_EOF
4767e35d4d8eSmrg
4768e35d4d8eSmrg  if AC_TRY_EVAL(ac_compile); then
4769e35d4d8eSmrg    # Now try to grab the symbols.
4770e35d4d8eSmrg    nlist=conftest.nm
4771e35d4d8eSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4772e35d4d8eSmrg      # Try sorting and uniquifying the output.
4773e35d4d8eSmrg      if sort "$nlist" | uniq > "$nlist"T; then
4774e35d4d8eSmrg	mv -f "$nlist"T "$nlist"
4775e35d4d8eSmrg      else
4776e35d4d8eSmrg	rm -f "$nlist"T
4777e35d4d8eSmrg      fi
4778e35d4d8eSmrg
4779e35d4d8eSmrg      # Make sure that we snagged all the symbols we need.
4780e35d4d8eSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4781e35d4d8eSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4782e35d4d8eSmrg	  cat <<_LT_EOF > conftest.$ac_ext
4783e35d4d8eSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4784e35d4d8eSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4785e35d4d8eSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
4786e35d4d8eSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4787e35d4d8eSmrg# define LT@&t@_DLSYM_CONST
4788e35d4d8eSmrg#elif defined(__osf__)
4789e35d4d8eSmrg/* This system does not cope well with relocations in const data.  */
4790e35d4d8eSmrg# define LT@&t@_DLSYM_CONST
4791e35d4d8eSmrg#else
4792e35d4d8eSmrg# define LT@&t@_DLSYM_CONST const
4793e35d4d8eSmrg#endif
4794e35d4d8eSmrg
4795e35d4d8eSmrg#ifdef __cplusplus
4796e35d4d8eSmrgextern "C" {
4797e35d4d8eSmrg#endif
4798e35d4d8eSmrg
4799e35d4d8eSmrg_LT_EOF
4800e35d4d8eSmrg	  # Now generate the symbol file.
4801e35d4d8eSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4802e35d4d8eSmrg
4803e35d4d8eSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4804e35d4d8eSmrg
4805e35d4d8eSmrg/* The mapping between symbol names and symbols.  */
4806e35d4d8eSmrgLT@&t@_DLSYM_CONST struct {
4807e35d4d8eSmrg  const char *name;
4808e35d4d8eSmrg  void       *address;
4809e35d4d8eSmrg}
4810e35d4d8eSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4811e35d4d8eSmrg{
4812e35d4d8eSmrg  { "@PROGRAM@", (void *) 0 },
4813e35d4d8eSmrg_LT_EOF
4814e35d4d8eSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4815e35d4d8eSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4816e35d4d8eSmrg  {0, (void *) 0}
4817e35d4d8eSmrg};
4818e35d4d8eSmrg
4819e35d4d8eSmrg/* This works around a problem in FreeBSD linker */
4820e35d4d8eSmrg#ifdef FREEBSD_WORKAROUND
4821e35d4d8eSmrgstatic const void *lt_preloaded_setup() {
4822e35d4d8eSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4823e35d4d8eSmrg}
4824e35d4d8eSmrg#endif
4825e35d4d8eSmrg
4826e35d4d8eSmrg#ifdef __cplusplus
4827e35d4d8eSmrg}
4828e35d4d8eSmrg#endif
4829e35d4d8eSmrg_LT_EOF
4830e35d4d8eSmrg	  # Now try linking the two files.
4831e35d4d8eSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
4832e35d4d8eSmrg	  lt_globsym_save_LIBS=$LIBS
4833e35d4d8eSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
4834e35d4d8eSmrg	  LIBS="conftstm.$ac_objext"
4835e35d4d8eSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4836e35d4d8eSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4837e35d4d8eSmrg	    pipe_works=yes
4838e35d4d8eSmrg	  fi
4839e35d4d8eSmrg	  LIBS=$lt_globsym_save_LIBS
4840e35d4d8eSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
4841e35d4d8eSmrg	else
4842e35d4d8eSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4843e35d4d8eSmrg	fi
4844e35d4d8eSmrg      else
4845e35d4d8eSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4846e35d4d8eSmrg      fi
4847e35d4d8eSmrg    else
4848e35d4d8eSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4849e35d4d8eSmrg    fi
4850e35d4d8eSmrg  else
4851e35d4d8eSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4852e35d4d8eSmrg    cat conftest.$ac_ext >&5
4853e35d4d8eSmrg  fi
4854e35d4d8eSmrg  rm -rf conftest* conftst*
4855e35d4d8eSmrg
4856e35d4d8eSmrg  # Do not use the global_symbol_pipe unless it works.
4857e35d4d8eSmrg  if test "$pipe_works" = yes; then
4858e35d4d8eSmrg    break
4859e35d4d8eSmrg  else
4860e35d4d8eSmrg    lt_cv_sys_global_symbol_pipe=
4861e35d4d8eSmrg  fi
4862e35d4d8eSmrgdone
4863e35d4d8eSmrg])
4864e35d4d8eSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4865e35d4d8eSmrg  lt_cv_sys_global_symbol_to_cdecl=
4866e35d4d8eSmrgfi
4867e35d4d8eSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4868e35d4d8eSmrg  AC_MSG_RESULT(failed)
4869e35d4d8eSmrgelse
4870e35d4d8eSmrg  AC_MSG_RESULT(ok)
4871e35d4d8eSmrgfi
4872e35d4d8eSmrg
4873e35d4d8eSmrg# Response file support.
4874e35d4d8eSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4875e35d4d8eSmrg  nm_file_list_spec='@'
4876e35d4d8eSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4877e35d4d8eSmrg  nm_file_list_spec='@'
4878e35d4d8eSmrgfi
4879e35d4d8eSmrg
4880e35d4d8eSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4881e35d4d8eSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4882e35d4d8eSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4883e35d4d8eSmrg    [Transform the output of nm in a proper C declaration])
4884e35d4d8eSmrg_LT_DECL([global_symbol_to_c_name_address],
4885e35d4d8eSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4886e35d4d8eSmrg    [Transform the output of nm in a C name address pair])
4887e35d4d8eSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4888e35d4d8eSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4889e35d4d8eSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4890e35d4d8eSmrg_LT_DECL([], [nm_file_list_spec], [1],
4891e35d4d8eSmrg    [Specify filename containing input files for $NM])
4892e35d4d8eSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
4893e35d4d8eSmrg
4894e35d4d8eSmrg
4895e35d4d8eSmrg# _LT_COMPILER_PIC([TAGNAME])
4896e35d4d8eSmrg# ---------------------------
4897e35d4d8eSmrgm4_defun([_LT_COMPILER_PIC],
4898e35d4d8eSmrg[m4_require([_LT_TAG_COMPILER])dnl
4899e35d4d8eSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4900e35d4d8eSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4901e35d4d8eSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4902e35d4d8eSmrg
4903e35d4d8eSmrgm4_if([$1], [CXX], [
4904e35d4d8eSmrg  # C++ specific cases for pic, static, wl, etc.
4905e35d4d8eSmrg  if test "$GXX" = yes; then
49061b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
49071b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
490832b578d3Smrg
49091b12faf6Smrg    case $host_os in
49101b12faf6Smrg    aix*)
49111b12faf6Smrg      # All AIX code is PIC.
49122a51b5beSmrg      if test "$host_cpu" = ia64; then
49131b12faf6Smrg	# AIX 5 now supports IA64 processor
49141b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
49152a51b5beSmrg      fi
491632b578d3Smrg      ;;
491732b578d3Smrg
49181b12faf6Smrg    amigaos*)
49192a51b5beSmrg      case $host_cpu in
49201b12faf6Smrg      powerpc)
49211b12faf6Smrg            # see comment about AmigaOS4 .so support
49221b12faf6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49231b12faf6Smrg        ;;
49241b12faf6Smrg      m68k)
49251b12faf6Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
49261b12faf6Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
49271b12faf6Smrg            # like `-m68040'.
49281b12faf6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
49292a51b5beSmrg        ;;
49302a51b5beSmrg      esac
49312a51b5beSmrg      ;;
49321b12faf6Smrg
49331b12faf6Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
49341b12faf6Smrg      # PIC is the default for these OSes.
49351b12faf6Smrg      ;;
49361b12faf6Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
49371b12faf6Smrg      # This hack is so that the source file can tell whether it is being
49381b12faf6Smrg      # built for inclusion in a dll (and should export symbols for example).
49391b12faf6Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
49401b12faf6Smrg      # (--disable-auto-import) libraries
49411b12faf6Smrg      m4_if([$1], [GCJ], [],
49421b12faf6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
49431b12faf6Smrg      ;;
49441b12faf6Smrg    darwin* | rhapsody*)
49451b12faf6Smrg      # PIC is the default on this platform
49461b12faf6Smrg      # Common symbols not allowed in MH_DYLIB files
49471b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
49481b12faf6Smrg      ;;
49491b12faf6Smrg    *djgpp*)
49501b12faf6Smrg      # DJGPP does not support shared libraries at all
49511b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
49521b12faf6Smrg      ;;
4953e35d4d8eSmrg    haiku*)
4954e35d4d8eSmrg      # PIC is the default for Haiku.
4955e35d4d8eSmrg      # The "-static" flag exists, but is broken.
4956e35d4d8eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4957e35d4d8eSmrg      ;;
49581b12faf6Smrg    interix[[3-9]]*)
49591b12faf6Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
49601b12faf6Smrg      # Instead, we relocate shared libraries at runtime.
49611b12faf6Smrg      ;;
49621b12faf6Smrg    sysv4*MP*)
49631b12faf6Smrg      if test -d /usr/nec; then
49641b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
49651b12faf6Smrg      fi
49661b12faf6Smrg      ;;
49671b12faf6Smrg    hpux*)
49681b12faf6Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
49691b12faf6Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
49701b12faf6Smrg      # sets the default TLS model and affects inlining.
49711b12faf6Smrg      case $host_cpu in
49721b12faf6Smrg      hppa*64*)
49731b12faf6Smrg	;;
49741b12faf6Smrg      *)
49751b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49761b12faf6Smrg	;;
49771b12faf6Smrg      esac
49781b12faf6Smrg      ;;
49791b12faf6Smrg    *qnx* | *nto*)
49801b12faf6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
49811b12faf6Smrg      # it will coredump.
49821b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
49831b12faf6Smrg      ;;
49841b12faf6Smrg    *)
49851b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49862a51b5beSmrg      ;;
4987d31dbc53Smrg    esac
49881b12faf6Smrg  else
49891b12faf6Smrg    case $host_os in
49901b12faf6Smrg      aix[[4-9]]*)
49911b12faf6Smrg	# All AIX code is PIC.
49921b12faf6Smrg	if test "$host_cpu" = ia64; then
49931b12faf6Smrg	  # AIX 5 now supports IA64 processor
49941b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
49951b12faf6Smrg	else
49961b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
49971b12faf6Smrg	fi
4998d31dbc53Smrg	;;
49991b12faf6Smrg      chorus*)
50001b12faf6Smrg	case $cc_basename in
50011b12faf6Smrg	cxch68*)
50021b12faf6Smrg	  # Green Hills C++ Compiler
50031b12faf6Smrg	  # _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"
50042a51b5beSmrg	  ;;
50052a51b5beSmrg	esac
5006d31dbc53Smrg	;;
5007e35d4d8eSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
5008e35d4d8eSmrg	# This hack is so that the source file can tell whether it is being
5009e35d4d8eSmrg	# built for inclusion in a dll (and should export symbols for example).
5010e35d4d8eSmrg	m4_if([$1], [GCJ], [],
5011e35d4d8eSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5012e35d4d8eSmrg	;;
50131b12faf6Smrg      dgux*)
50141b12faf6Smrg	case $cc_basename in
50151b12faf6Smrg	  ec++*)
50161b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50171b12faf6Smrg	    ;;
50181b12faf6Smrg	  ghcx*)
50191b12faf6Smrg	    # Green Hills C++ Compiler
50201b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
50211b12faf6Smrg	    ;;
50221b12faf6Smrg	  *)
50231b12faf6Smrg	    ;;
50241b12faf6Smrg	esac
50251b12faf6Smrg	;;
50261b12faf6Smrg      freebsd* | dragonfly*)
50271b12faf6Smrg	# FreeBSD uses GNU C++
50281b12faf6Smrg	;;
50291b12faf6Smrg      hpux9* | hpux10* | hpux11*)
50301b12faf6Smrg	case $cc_basename in
50311b12faf6Smrg	  CC*)
50321b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50331b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
50341b12faf6Smrg	    if test "$host_cpu" != ia64; then
50351b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
50361b12faf6Smrg	    fi
50371b12faf6Smrg	    ;;
50381b12faf6Smrg	  aCC*)
50391b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50401b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
50412a51b5beSmrg	    case $host_cpu in
50421b12faf6Smrg	    hppa*64*|ia64*)
50431b12faf6Smrg	      # +Z the default
50442a51b5beSmrg	      ;;
50452a51b5beSmrg	    *)
50461b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
50472a51b5beSmrg	      ;;
50482a51b5beSmrg	    esac
50491b12faf6Smrg	    ;;
50501b12faf6Smrg	  *)
50511b12faf6Smrg	    ;;
50522a51b5beSmrg	esac
50532a51b5beSmrg	;;
50541b12faf6Smrg      interix*)
50551b12faf6Smrg	# This is c89, which is MS Visual C++ (no shared libs)
50561b12faf6Smrg	# Anyone wants to do a port?
50572a51b5beSmrg	;;
50581b12faf6Smrg      irix5* | irix6* | nonstopux*)
50591b12faf6Smrg	case $cc_basename in
50601b12faf6Smrg	  CC*)
50611b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50621b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
50631b12faf6Smrg	    # CC pic flag -KPIC is the default.
50641b12faf6Smrg	    ;;
50651b12faf6Smrg	  *)
50661b12faf6Smrg	    ;;
50672a51b5beSmrg	esac
50682a51b5beSmrg	;;
50691b12faf6Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
50701b12faf6Smrg	case $cc_basename in
50711b12faf6Smrg	  KCC*)
50721b12faf6Smrg	    # KAI C++ Compiler
50731b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
50741b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
50751b12faf6Smrg	    ;;
50761b12faf6Smrg	  ecpc* )
50771b12faf6Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
50781b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50791b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50801b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
50811b12faf6Smrg	    ;;
50821b12faf6Smrg	  icpc* )
50831b12faf6Smrg	    # Intel C++, used to be incompatible with GCC.
50841b12faf6Smrg	    # ICC 10 doesn't accept -KPIC any more.
50851b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50861b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
50871b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
50881b12faf6Smrg	    ;;
50891b12faf6Smrg	  pgCC* | pgcpp*)
50901b12faf6Smrg	    # Portland Group C++ compiler
50911b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50921b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
50931b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
50941b12faf6Smrg	    ;;
50951b12faf6Smrg	  cxx*)
50961b12faf6Smrg	    # Compaq C++
50971b12faf6Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
50981b12faf6Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
50991b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
51001b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
51011b12faf6Smrg	    ;;
5102e35d4d8eSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5103e35d4d8eSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
51041b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51051b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
51061b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
51071b12faf6Smrg	    ;;
51081b12faf6Smrg	  *)
51091b12faf6Smrg	    case `$CC -V 2>&1 | sed 5q` in
51101b12faf6Smrg	    *Sun\ C*)
51111b12faf6Smrg	      # Sun C++ 5.9
51121b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
51131b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51141b12faf6Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
51151b12faf6Smrg	      ;;
51161b12faf6Smrg	    esac
51171b12faf6Smrg	    ;;
51181b12faf6Smrg	esac
51192a51b5beSmrg	;;
51201b12faf6Smrg      lynxos*)
51212a51b5beSmrg	;;
51221b12faf6Smrg      m88k*)
51232a51b5beSmrg	;;
51241b12faf6Smrg      mvs*)
51251b12faf6Smrg	case $cc_basename in
51261b12faf6Smrg	  cxx*)
51271b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
51281b12faf6Smrg	    ;;
51291b12faf6Smrg	  *)
51301b12faf6Smrg	    ;;
51311b12faf6Smrg	esac
51322a51b5beSmrg	;;
5133e35d4d8eSmrg      netbsd*)
51342a51b5beSmrg	;;
51351b12faf6Smrg      *qnx* | *nto*)
51361b12faf6Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
51371b12faf6Smrg        # it will coredump.
51381b12faf6Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
51391b12faf6Smrg        ;;
51401b12faf6Smrg      osf3* | osf4* | osf5*)
51411b12faf6Smrg	case $cc_basename in
51421b12faf6Smrg	  KCC*)
51431b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
51441b12faf6Smrg	    ;;
51451b12faf6Smrg	  RCC*)
51461b12faf6Smrg	    # Rational C++ 2.4.1
51471b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51481b12faf6Smrg	    ;;
51491b12faf6Smrg	  cxx*)
51501b12faf6Smrg	    # Digital/Compaq C++
51511b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51521b12faf6Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
51531b12faf6Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
51541b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
51551b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
51561b12faf6Smrg	    ;;
51571b12faf6Smrg	  *)
51581b12faf6Smrg	    ;;
51591b12faf6Smrg	esac
51602a51b5beSmrg	;;
51611b12faf6Smrg      psos*)
51622a51b5beSmrg	;;
51631b12faf6Smrg      solaris*)
51641b12faf6Smrg	case $cc_basename in
5165e35d4d8eSmrg	  CC* | sunCC*)
51661b12faf6Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
51671b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
51681b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51691b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
51701b12faf6Smrg	    ;;
51711b12faf6Smrg	  gcx*)
51721b12faf6Smrg	    # Green Hills C++ Compiler
51731b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
51741b12faf6Smrg	    ;;
51751b12faf6Smrg	  *)
51761b12faf6Smrg	    ;;
51771b12faf6Smrg	esac
51782a51b5beSmrg	;;
51791b12faf6Smrg      sunos4*)
51801b12faf6Smrg	case $cc_basename in
51811b12faf6Smrg	  CC*)
51821b12faf6Smrg	    # Sun C++ 4.x
51831b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51841b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51851b12faf6Smrg	    ;;
51861b12faf6Smrg	  lcc*)
51871b12faf6Smrg	    # Lucid
51881b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51891b12faf6Smrg	    ;;
51901b12faf6Smrg	  *)
51911b12faf6Smrg	    ;;
51921b12faf6Smrg	esac
51932a51b5beSmrg	;;
51941b12faf6Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
51951b12faf6Smrg	case $cc_basename in
51961b12faf6Smrg	  CC*)
51971b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51981b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
51991b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52001b12faf6Smrg	    ;;
52011b12faf6Smrg	esac
52022a51b5beSmrg	;;
52031b12faf6Smrg      tandem*)
52041b12faf6Smrg	case $cc_basename in
52051b12faf6Smrg	  NCC*)
52061b12faf6Smrg	    # NonStop-UX NCC 3.20
52071b12faf6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52081b12faf6Smrg	    ;;
52092a51b5beSmrg	  *)
52102a51b5beSmrg	    ;;
5211d31dbc53Smrg	esac
52122a51b5beSmrg	;;
52131b12faf6Smrg      vxworks*)
52142a51b5beSmrg	;;
52152a51b5beSmrg      *)
52161b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
52171b12faf6Smrg	;;
52181b12faf6Smrg    esac
52191b12faf6Smrg  fi
52201b12faf6Smrg],
52211b12faf6Smrg[
52221b12faf6Smrg  if test "$GCC" = yes; then
52231b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52241b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
522532b578d3Smrg
52261b12faf6Smrg    case $host_os in
52271b12faf6Smrg      aix*)
52281b12faf6Smrg      # All AIX code is PIC.
52291b12faf6Smrg      if test "$host_cpu" = ia64; then
52301b12faf6Smrg	# AIX 5 now supports IA64 processor
52311b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52321b12faf6Smrg      fi
52331b12faf6Smrg      ;;
52342a51b5beSmrg
52351b12faf6Smrg    amigaos*)
52361b12faf6Smrg      case $host_cpu in
52371b12faf6Smrg      powerpc)
52381b12faf6Smrg            # see comment about AmigaOS4 .so support
52391b12faf6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
52401b12faf6Smrg        ;;
52411b12faf6Smrg      m68k)
52421b12faf6Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
52431b12faf6Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
52441b12faf6Smrg            # like `-m68040'.
52451b12faf6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
52461b12faf6Smrg        ;;
52471b12faf6Smrg      esac
52481b12faf6Smrg      ;;
52492a51b5beSmrg
52501b12faf6Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
52511b12faf6Smrg      # PIC is the default for these OSes.
52521b12faf6Smrg      ;;
52531b12faf6Smrg
52541b12faf6Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
52551b12faf6Smrg      # This hack is so that the source file can tell whether it is being
52561b12faf6Smrg      # built for inclusion in a dll (and should export symbols for example).
52571b12faf6Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
52581b12faf6Smrg      # (--disable-auto-import) libraries
52591b12faf6Smrg      m4_if([$1], [GCJ], [],
52601b12faf6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
52611b12faf6Smrg      ;;
52621b12faf6Smrg
52631b12faf6Smrg    darwin* | rhapsody*)
52641b12faf6Smrg      # PIC is the default on this platform
52651b12faf6Smrg      # Common symbols not allowed in MH_DYLIB files
52661b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
52671b12faf6Smrg      ;;
52681b12faf6Smrg
5269e35d4d8eSmrg    haiku*)
5270e35d4d8eSmrg      # PIC is the default for Haiku.
5271e35d4d8eSmrg      # The "-static" flag exists, but is broken.
5272e35d4d8eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5273e35d4d8eSmrg      ;;
5274e35d4d8eSmrg
52751b12faf6Smrg    hpux*)
52761b12faf6Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
52771b12faf6Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
52781b12faf6Smrg      # sets the default TLS model and affects inlining.
52791b12faf6Smrg      case $host_cpu in
52801b12faf6Smrg      hppa*64*)
52811b12faf6Smrg	# +Z the default
5282d31dbc53Smrg	;;
5283d31dbc53Smrg      *)
52841b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5285d31dbc53Smrg	;;
52861b12faf6Smrg      esac
52871b12faf6Smrg      ;;
52881b12faf6Smrg
52891b12faf6Smrg    interix[[3-9]]*)
52901b12faf6Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
52911b12faf6Smrg      # Instead, we relocate shared libraries at runtime.
52921b12faf6Smrg      ;;
52931b12faf6Smrg
52941b12faf6Smrg    msdosdjgpp*)
52951b12faf6Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
52961b12faf6Smrg      # on systems that don't support them.
52971b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
52981b12faf6Smrg      enable_shared=no
52991b12faf6Smrg      ;;
53001b12faf6Smrg
53011b12faf6Smrg    *nto* | *qnx*)
53021b12faf6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
53031b12faf6Smrg      # it will coredump.
53041b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
53051b12faf6Smrg      ;;
53061b12faf6Smrg
53071b12faf6Smrg    sysv4*MP*)
53081b12faf6Smrg      if test -d /usr/nec; then
53091b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
53101b12faf6Smrg      fi
53111b12faf6Smrg      ;;
53121b12faf6Smrg
53131b12faf6Smrg    *)
53141b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
53151b12faf6Smrg      ;;
53162a51b5beSmrg    esac
5317e35d4d8eSmrg
5318e35d4d8eSmrg    case $cc_basename in
5319e35d4d8eSmrg    nvcc*) # Cuda Compiler Driver 2.2
5320e35d4d8eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5321e35d4d8eSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5322e35d4d8eSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5323e35d4d8eSmrg      fi
5324e35d4d8eSmrg      ;;
5325e35d4d8eSmrg    esac
53261b12faf6Smrg  else
53271b12faf6Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
53281b12faf6Smrg    case $host_os in
53291b12faf6Smrg    aix*)
53301b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53311b12faf6Smrg      if test "$host_cpu" = ia64; then
53321b12faf6Smrg	# AIX 5 now supports IA64 processor
53331b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
53341b12faf6Smrg      else
53351b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
53361b12faf6Smrg      fi
53371b12faf6Smrg      ;;
53381b12faf6Smrg
53391b12faf6Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
53401b12faf6Smrg      # This hack is so that the source file can tell whether it is being
53411b12faf6Smrg      # built for inclusion in a dll (and should export symbols for example).
53421b12faf6Smrg      m4_if([$1], [GCJ], [],
53431b12faf6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
53441b12faf6Smrg      ;;
53451b12faf6Smrg
53461b12faf6Smrg    hpux9* | hpux10* | hpux11*)
53471b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53481b12faf6Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
53491b12faf6Smrg      # not for PA HP-UX.
53501b12faf6Smrg      case $host_cpu in
53511b12faf6Smrg      hppa*64*|ia64*)
53521b12faf6Smrg	# +Z the default
53532a51b5beSmrg	;;
53542a51b5beSmrg      *)
53551b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
53562a51b5beSmrg	;;
53571b12faf6Smrg      esac
53581b12faf6Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
53591b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
53601b12faf6Smrg      ;;
53611b12faf6Smrg
53621b12faf6Smrg    irix5* | irix6* | nonstopux*)
53631b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53641b12faf6Smrg      # PIC (with -KPIC) is the default.
53651b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
53661b12faf6Smrg      ;;
53671b12faf6Smrg
53681b12faf6Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
53691b12faf6Smrg      case $cc_basename in
53701b12faf6Smrg      # old Intel for x86_64 which still supported -KPIC.
53711b12faf6Smrg      ecc*)
53721b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53731b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
53741b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
53751b12faf6Smrg        ;;
53761b12faf6Smrg      # icc used to be incompatible with GCC.
53771b12faf6Smrg      # ICC 10 doesn't accept -KPIC any more.
53781b12faf6Smrg      icc* | ifort*)
53791b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53801b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
53811b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
53821b12faf6Smrg        ;;
53831b12faf6Smrg      # Lahey Fortran 8.1.
53841b12faf6Smrg      lf95*)
53851b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53861b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
53871b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
53881b12faf6Smrg	;;
5389e35d4d8eSmrg      nagfor*)
5390e35d4d8eSmrg	# NAG Fortran compiler
5391e35d4d8eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5392e35d4d8eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5393e35d4d8eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5394e35d4d8eSmrg	;;
5395e35d4d8eSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
53961b12faf6Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
53971b12faf6Smrg	# which looks to be a dead project)
53981b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53991b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
54001b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54011b12faf6Smrg        ;;
54021b12faf6Smrg      ccc*)
54031b12faf6Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54041b12faf6Smrg        # All Alpha code is PIC.
54051b12faf6Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54061b12faf6Smrg        ;;
5407e35d4d8eSmrg      xl* | bgxl* | bgf* | mpixl*)
5408e35d4d8eSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
54091b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54101b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
54111b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
54122a51b5beSmrg	;;
54132a51b5beSmrg      *)
54141b12faf6Smrg	case `$CC -V 2>&1 | sed 5q` in
5415e35d4d8eSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5416e35d4d8eSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5417e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5418e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5419e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5420e35d4d8eSmrg	  ;;
5421e35d4d8eSmrg	*Sun\ F* | *Sun*Fortran*)
5422e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5423e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5424e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5425e35d4d8eSmrg	  ;;
54261b12faf6Smrg	*Sun\ C*)
54271b12faf6Smrg	  # Sun C 5.9
54281b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54291b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54301b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54311b12faf6Smrg	  ;;
5432e35d4d8eSmrg        *Intel*\ [[CF]]*Compiler*)
5433e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5434e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5435e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5436e35d4d8eSmrg	  ;;
5437e35d4d8eSmrg	*Portland\ Group*)
5438e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5439e35d4d8eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
54401b12faf6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54411b12faf6Smrg	  ;;
54421b12faf6Smrg	esac
54432a51b5beSmrg	;;
54441b12faf6Smrg      esac
54451b12faf6Smrg      ;;
544632b578d3Smrg
54471b12faf6Smrg    newsos6)
54481b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54491b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54501b12faf6Smrg      ;;
545132b578d3Smrg
54521b12faf6Smrg    *nto* | *qnx*)
54531b12faf6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
54541b12faf6Smrg      # it will coredump.
54551b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
54561b12faf6Smrg      ;;
545732b578d3Smrg
54581b12faf6Smrg    osf3* | osf4* | osf5*)
54591b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54601b12faf6Smrg      # All OSF/1 code is PIC.
54611b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54621b12faf6Smrg      ;;
546332b578d3Smrg
54641b12faf6Smrg    rdos*)
54651b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54661b12faf6Smrg      ;;
546732b578d3Smrg
54681b12faf6Smrg    solaris*)
54691b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54701b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54711b12faf6Smrg      case $cc_basename in
5472e35d4d8eSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
54731b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
54741b12faf6Smrg      *)
54751b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
54761b12faf6Smrg      esac
54771b12faf6Smrg      ;;
547832b578d3Smrg
54791b12faf6Smrg    sunos4*)
54801b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
54811b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
54821b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54831b12faf6Smrg      ;;
548432b578d3Smrg
54851b12faf6Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
54861b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54871b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54881b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54891b12faf6Smrg      ;;
549032b578d3Smrg
54911b12faf6Smrg    sysv4*MP*)
54921b12faf6Smrg      if test -d /usr/nec ;then
54931b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
54941b12faf6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54951b12faf6Smrg      fi
54961b12faf6Smrg      ;;
549732b578d3Smrg
54981b12faf6Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
54991b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55001b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
55011b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55021b12faf6Smrg      ;;
550332b578d3Smrg
55041b12faf6Smrg    unicos*)
55051b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55061b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
55071b12faf6Smrg      ;;
550832b578d3Smrg
55091b12faf6Smrg    uts4*)
55101b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
55111b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55121b12faf6Smrg      ;;
551332b578d3Smrg
55141b12faf6Smrg    *)
55151b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
55161b12faf6Smrg      ;;
55172a51b5beSmrg    esac
55181b12faf6Smrg  fi
55191b12faf6Smrg])
55201b12faf6Smrgcase $host_os in
55211b12faf6Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
55221b12faf6Smrg  *djgpp*)
55231b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
55241b12faf6Smrg    ;;
55251b12faf6Smrg  *)
55261b12faf6Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
55271b12faf6Smrg    ;;
55281b12faf6Smrgesac
5529e35d4d8eSmrg
5530e35d4d8eSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
5531e35d4d8eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5532e35d4d8eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5533e35d4d8eSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
55342a51b5beSmrg
55351b12faf6Smrg#
55361b12faf6Smrg# Check to make sure the PIC flag actually works.
55371b12faf6Smrg#
55381b12faf6Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
55391b12faf6Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
55401b12faf6Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
55411b12faf6Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
55421b12faf6Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
55431b12faf6Smrg     "" | " "*) ;;
55441b12faf6Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
55451b12faf6Smrg     esac],
55461b12faf6Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
55471b12faf6Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
55482a51b5beSmrgfi
55491b12faf6Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
55501b12faf6Smrg	[Additional compiler flags for building library objects])
55512a51b5beSmrg
5552e35d4d8eSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5553e35d4d8eSmrg	[How to pass a linker flag through the compiler])
55541b12faf6Smrg#
55551b12faf6Smrg# Check to make sure the static flag actually works.
55561b12faf6Smrg#
55571b12faf6Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
55581b12faf6Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
55591b12faf6Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
55601b12faf6Smrg  $lt_tmp_static_flag,
55611b12faf6Smrg  [],
55621b12faf6Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
55631b12faf6Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
55641b12faf6Smrg	[Compiler flag to prevent dynamic linking])
55651b12faf6Smrg])# _LT_COMPILER_PIC
556632b578d3Smrg
55671b12faf6Smrg
55681b12faf6Smrg# _LT_LINKER_SHLIBS([TAGNAME])
55691b12faf6Smrg# ----------------------------
55701b12faf6Smrg# See if the linker supports building shared libraries.
55711b12faf6Smrgm4_defun([_LT_LINKER_SHLIBS],
55721b12faf6Smrg[AC_REQUIRE([LT_PATH_LD])dnl
55731b12faf6SmrgAC_REQUIRE([LT_PATH_NM])dnl
5574e35d4d8eSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
55751b12faf6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
55761b12faf6Smrgm4_require([_LT_DECL_EGREP])dnl
55771b12faf6Smrgm4_require([_LT_DECL_SED])dnl
55781b12faf6Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
55791b12faf6Smrgm4_require([_LT_TAG_COMPILER])dnl
55801b12faf6SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
55811b12faf6Smrgm4_if([$1], [CXX], [
55821b12faf6Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5583e35d4d8eSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
55841b12faf6Smrg  case $host_os in
55851b12faf6Smrg  aix[[4-9]]*)
55861b12faf6Smrg    # If we're using GNU nm, then we don't want the "-C" option.
55871b12faf6Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5588e35d4d8eSmrg    # Also, AIX nm treats weak defined symbols like other global defined
5589e35d4d8eSmrg    # symbols, whereas GNU nm marks them as "W".
55901b12faf6Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5591e35d4d8eSmrg      _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'
55921b12faf6Smrg    else
55931b12faf6Smrg      _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'
55942a51b5beSmrg    fi
5595d31dbc53Smrg    ;;
55961b12faf6Smrg  pw32*)
55971b12faf6Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5598e35d4d8eSmrg    ;;
55991b12faf6Smrg  cygwin* | mingw* | cegcc*)
5600e35d4d8eSmrg    case $cc_basename in
5601e35d4d8eSmrg    cl*)
5602e35d4d8eSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5603e35d4d8eSmrg      ;;
5604e35d4d8eSmrg    *)
5605e35d4d8eSmrg      _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'
5606e35d4d8eSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5607e35d4d8eSmrg      ;;
5608e35d4d8eSmrg    esac
5609e35d4d8eSmrg    ;;
56101b12faf6Smrg  *)
56111b12faf6Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5612e35d4d8eSmrg    ;;
56131b12faf6Smrg  esac
56141b12faf6Smrg], [
56151b12faf6Smrg  runpath_var=
56161b12faf6Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
56171b12faf6Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
56181b12faf6Smrg  _LT_TAGVAR(archive_cmds, $1)=
56191b12faf6Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
56201b12faf6Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
56211b12faf6Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
56221b12faf6Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
56231b12faf6Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
56241b12faf6Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
56251b12faf6Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
56261b12faf6Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
56271b12faf6Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
56281b12faf6Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
56291b12faf6Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
56301b12faf6Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
56311b12faf6Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
56321b12faf6Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
56331b12faf6Smrg  _LT_TAGVAR(module_cmds, $1)=
56341b12faf6Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
56351b12faf6Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
56361b12faf6Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
56371b12faf6Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
56381b12faf6Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
56391b12faf6Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
56401b12faf6Smrg  # included in the symbol list
56411b12faf6Smrg  _LT_TAGVAR(include_expsyms, $1)=
56421b12faf6Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
56431b12faf6Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
56441b12faf6Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
56451b12faf6Smrg  # as well as any symbol that contains `d'.
56461b12faf6Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
56471b12faf6Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
56481b12faf6Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
56491b12faf6Smrg  # the symbol is explicitly referenced.  Since portable code cannot
56501b12faf6Smrg  # rely on this symbol name, it's probably fine to never include it in
56511b12faf6Smrg  # preloaded symbol tables.
56521b12faf6Smrg  # Exclude shared library initialization/finalization symbols.
56531b12faf6Smrgdnl Note also adjust exclude_expsyms for C++ above.
56541b12faf6Smrg  extract_expsyms_cmds=
565532b578d3Smrg
56561b12faf6Smrg  case $host_os in
56571b12faf6Smrg  cygwin* | mingw* | pw32* | cegcc*)
56581b12faf6Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
56591b12faf6Smrg    # When not using gcc, we currently assume that we are using
56601b12faf6Smrg    # Microsoft Visual C++.
56611b12faf6Smrg    if test "$GCC" != yes; then
56621b12faf6Smrg      with_gnu_ld=no
56632a51b5beSmrg    fi
56642a51b5beSmrg    ;;
56651b12faf6Smrg  interix*)
56661b12faf6Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
56671b12faf6Smrg    with_gnu_ld=yes
56681b12faf6Smrg    ;;
56691b12faf6Smrg  openbsd*)
56701b12faf6Smrg    with_gnu_ld=no
56711b12faf6Smrg    ;;
56722a51b5beSmrg  esac
567332b578d3Smrg
56741b12faf6Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5675e35d4d8eSmrg
5676e35d4d8eSmrg  # On some targets, GNU ld is compatible enough with the native linker
5677e35d4d8eSmrg  # that we're better off using the native interface for both.
5678e35d4d8eSmrg  lt_use_gnu_ld_interface=no
56791b12faf6Smrg  if test "$with_gnu_ld" = yes; then
5680e35d4d8eSmrg    case $host_os in
5681e35d4d8eSmrg      aix*)
5682e35d4d8eSmrg	# The AIX port of GNU ld has always aspired to compatibility
5683e35d4d8eSmrg	# with the native linker.  However, as the warning in the GNU ld
5684e35d4d8eSmrg	# block says, versions before 2.19.5* couldn't really create working
5685e35d4d8eSmrg	# shared libraries, regardless of the interface used.
5686e35d4d8eSmrg	case `$LD -v 2>&1` in
5687e35d4d8eSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5688e35d4d8eSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5689e35d4d8eSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5690e35d4d8eSmrg	  *)
5691e35d4d8eSmrg	    lt_use_gnu_ld_interface=yes
5692e35d4d8eSmrg	    ;;
5693e35d4d8eSmrg	esac
5694e35d4d8eSmrg	;;
5695e35d4d8eSmrg      *)
5696e35d4d8eSmrg	lt_use_gnu_ld_interface=yes
5697e35d4d8eSmrg	;;
5698e35d4d8eSmrg    esac
5699e35d4d8eSmrg  fi
5700e35d4d8eSmrg
5701e35d4d8eSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
57021b12faf6Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
57031b12faf6Smrg    wlarc='${wl}'
570432b578d3Smrg
57051b12faf6Smrg    # Set some defaults for GNU ld with shared library support. These
57061b12faf6Smrg    # are reset later if shared libraries are not supported. Putting them
57071b12faf6Smrg    # here allows them to be overridden if necessary.
57081b12faf6Smrg    runpath_var=LD_RUN_PATH
57091b12faf6Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
57101b12faf6Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
57111b12faf6Smrg    # ancient GNU ld didn't support --whole-archive et. al.
57121b12faf6Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
57131b12faf6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
57141b12faf6Smrg    else
57151b12faf6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
57161b12faf6Smrg    fi
57171b12faf6Smrg    supports_anon_versioning=no
57181b12faf6Smrg    case `$LD -v 2>&1` in
57191b12faf6Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
57201b12faf6Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
57211b12faf6Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
57221b12faf6Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
57231b12faf6Smrg      *\ 2.11.*) ;; # other 2.11 versions
57241b12faf6Smrg      *) supports_anon_versioning=yes ;;
57251b12faf6Smrg    esac
572632b578d3Smrg
57271b12faf6Smrg    # See if GNU ld supports shared libraries.
57281b12faf6Smrg    case $host_os in
57291b12faf6Smrg    aix[[3-9]]*)
57301b12faf6Smrg      # On AIX/PPC, the GNU linker is very broken
57311b12faf6Smrg      if test "$host_cpu" != ia64; then
57321b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
57331b12faf6Smrg	cat <<_LT_EOF 1>&2
573432b578d3Smrg
5735e35d4d8eSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
57361b12faf6Smrg*** to be unable to reliably create shared libraries on AIX.
57371b12faf6Smrg*** Therefore, libtool is disabling shared libraries support.  If you
5738e35d4d8eSmrg*** really care for shared libraries, you may want to install binutils
5739e35d4d8eSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5740e35d4d8eSmrg*** You will then need to restart the configuration process.
574132b578d3Smrg
57421b12faf6Smrg_LT_EOF
57431b12faf6Smrg      fi
57441b12faf6Smrg      ;;
574532b578d3Smrg
57461b12faf6Smrg    amigaos*)
57471b12faf6Smrg      case $host_cpu in
57481b12faf6Smrg      powerpc)
57491b12faf6Smrg            # see comment about AmigaOS4 .so support
57501b12faf6Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
57511b12faf6Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
57521b12faf6Smrg        ;;
57531b12faf6Smrg      m68k)
57541b12faf6Smrg            _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)'
57551b12faf6Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
57561b12faf6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
57571b12faf6Smrg        ;;
57581b12faf6Smrg      esac
57591b12faf6Smrg      ;;
576032b578d3Smrg
57611b12faf6Smrg    beos*)
57621b12faf6Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
57631b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
57641b12faf6Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
57651b12faf6Smrg	# support --undefined.  This deserves some investigation.  FIXME
57661b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
57671b12faf6Smrg      else
57681b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
57691b12faf6Smrg      fi
57701b12faf6Smrg      ;;
577132b578d3Smrg
57721b12faf6Smrg    cygwin* | mingw* | pw32* | cegcc*)
57731b12faf6Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
57741b12faf6Smrg      # as there is no search path for DLLs.
57751b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5776e35d4d8eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
57771b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
57781b12faf6Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
57791b12faf6Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5780e35d4d8eSmrg      _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'
5781e35d4d8eSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
57821b12faf6Smrg
57831b12faf6Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
57841b12faf6Smrg        _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'
57851b12faf6Smrg	# If the export-symbols file already is a .def file (1st line
57861b12faf6Smrg	# is EXPORTS), use it as is; otherwise, prepend...
57871b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
57881b12faf6Smrg	  cp $export_symbols $output_objdir/$soname.def;
57891b12faf6Smrg	else
57901b12faf6Smrg	  echo EXPORTS > $output_objdir/$soname.def;
57911b12faf6Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
57921b12faf6Smrg	fi~
57931b12faf6Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
57941b12faf6Smrg      else
57951b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
57961b12faf6Smrg      fi
57971b12faf6Smrg      ;;
579832b578d3Smrg
5799e35d4d8eSmrg    haiku*)
5800e35d4d8eSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5801e35d4d8eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5802e35d4d8eSmrg      ;;
5803e35d4d8eSmrg
58041b12faf6Smrg    interix[[3-9]]*)
58051b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
58061b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58071b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
58081b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
58091b12faf6Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
58101b12faf6Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
58111b12faf6Smrg      # default) and relocated if they conflict, which is a slow very memory
58121b12faf6Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
58131b12faf6Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
58141b12faf6Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
58151b12faf6Smrg      _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'
58161b12faf6Smrg      _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'
58171b12faf6Smrg      ;;
581832b578d3Smrg
58191b12faf6Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
58201b12faf6Smrg      tmp_diet=no
58211b12faf6Smrg      if test "$host_os" = linux-dietlibc; then
58221b12faf6Smrg	case $cc_basename in
58231b12faf6Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
58241b12faf6Smrg	esac
58251b12faf6Smrg      fi
58261b12faf6Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
58271b12faf6Smrg	 && test "$tmp_diet" = no
58281b12faf6Smrg      then
5829e35d4d8eSmrg	tmp_addflag=' $pic_flag'
58301b12faf6Smrg	tmp_sharedflag='-shared'
58311b12faf6Smrg	case $cc_basename,$host_cpu in
58321b12faf6Smrg        pgcc*)				# Portland Group C compiler
5833e35d4d8eSmrg	  _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'
58341b12faf6Smrg	  tmp_addflag=' $pic_flag'
58351b12faf6Smrg	  ;;
5836e35d4d8eSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5837e35d4d8eSmrg					# Portland Group f77 and f90 compilers
5838e35d4d8eSmrg	  _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'
58391b12faf6Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
58401b12faf6Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
58411b12faf6Smrg	  tmp_addflag=' -i_dynamic' ;;
58421b12faf6Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
58431b12faf6Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
58441b12faf6Smrg	ifc* | ifort*)			# Intel Fortran compiler
58451b12faf6Smrg	  tmp_addflag=' -nofor_main' ;;
58461b12faf6Smrg	lf95*)				# Lahey Fortran 8.1
58471b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
58481b12faf6Smrg	  tmp_sharedflag='--shared' ;;
5849e35d4d8eSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
58501b12faf6Smrg	  tmp_sharedflag='-qmkshrobj'
58511b12faf6Smrg	  tmp_addflag= ;;
5852e35d4d8eSmrg	nvcc*)	# Cuda Compiler Driver 2.2
5853e35d4d8eSmrg	  _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'
5854e35d4d8eSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5855e35d4d8eSmrg	  ;;
58561b12faf6Smrg	esac
58571b12faf6Smrg	case `$CC -V 2>&1 | sed 5q` in
58581b12faf6Smrg	*Sun\ C*)			# Sun C 5.9
5859e35d4d8eSmrg	  _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'
58601b12faf6Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
58611b12faf6Smrg	  tmp_sharedflag='-G' ;;
58621b12faf6Smrg	*Sun\ F*)			# Sun Fortran 8.3
58631b12faf6Smrg	  tmp_sharedflag='-G' ;;
58641b12faf6Smrg	esac
58651b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
586632b578d3Smrg
58671b12faf6Smrg        if test "x$supports_anon_versioning" = xyes; then
58681b12faf6Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
58691b12faf6Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
58701b12faf6Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
58711b12faf6Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
58721b12faf6Smrg        fi
587332b578d3Smrg
58741b12faf6Smrg	case $cc_basename in
5875e35d4d8eSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
58761b12faf6Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
58771b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5878e35d4d8eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5879e35d4d8eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
58801b12faf6Smrg	  if test "x$supports_anon_versioning" = xyes; then
58811b12faf6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
58821b12faf6Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
58831b12faf6Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
5884e35d4d8eSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
58851b12faf6Smrg	  fi
58861b12faf6Smrg	  ;;
58871b12faf6Smrg	esac
58881b12faf6Smrg      else
58891b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
58901b12faf6Smrg      fi
58911b12faf6Smrg      ;;
589232b578d3Smrg
5893e35d4d8eSmrg    netbsd*)
58941b12faf6Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58951b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
58961b12faf6Smrg	wlarc=
58971b12faf6Smrg      else
5898e35d4d8eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5899e35d4d8eSmrg	_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'
59001b12faf6Smrg      fi
59011b12faf6Smrg      ;;
590232b578d3Smrg
59031b12faf6Smrg    solaris*)
59041b12faf6Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
59051b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
59061b12faf6Smrg	cat <<_LT_EOF 1>&2
590732b578d3Smrg
59081b12faf6Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
59091b12faf6Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
59101b12faf6Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
59111b12faf6Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
59121b12faf6Smrg*** your PATH or compiler configuration so that the native linker is
59131b12faf6Smrg*** used, and then restart.
591432b578d3Smrg
59151b12faf6Smrg_LT_EOF
59161b12faf6Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5917e35d4d8eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5918e35d4d8eSmrg	_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'
59191b12faf6Smrg      else
59201b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
59211b12faf6Smrg      fi
59221b12faf6Smrg      ;;
592332b578d3Smrg
59241b12faf6Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
59251b12faf6Smrg      case `$LD -v 2>&1` in
59261b12faf6Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
59271b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
59281b12faf6Smrg	cat <<_LT_EOF 1>&2
592932b578d3Smrg
59301b12faf6Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
59311b12faf6Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
59321b12faf6Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
59331b12faf6Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
59341b12faf6Smrg*** your PATH or compiler configuration so that the native linker is
59351b12faf6Smrg*** used, and then restart.
593632b578d3Smrg
59371b12faf6Smrg_LT_EOF
59381b12faf6Smrg	;;
59391b12faf6Smrg	*)
59401b12faf6Smrg	  # For security reasons, it is highly recommended that you always
59411b12faf6Smrg	  # use absolute paths for naming shared libraries, and exclude the
59421b12faf6Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
59431b12faf6Smrg	  # requires that you compile everything twice, which is a pain.
59441b12faf6Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
59451b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59461b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59471b12faf6Smrg	    _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'
59481b12faf6Smrg	  else
59491b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
59501b12faf6Smrg	  fi
59511b12faf6Smrg	;;
59521b12faf6Smrg      esac
59531b12faf6Smrg      ;;
595432b578d3Smrg
59551b12faf6Smrg    sunos4*)
59561b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
59571b12faf6Smrg      wlarc=
59581b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
59591b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59601b12faf6Smrg      ;;
596132b578d3Smrg
59621b12faf6Smrg    *)
59631b12faf6Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5964e35d4d8eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5965e35d4d8eSmrg	_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'
59661b12faf6Smrg      else
59671b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
59681b12faf6Smrg      fi
59691b12faf6Smrg      ;;
59701b12faf6Smrg    esac
597132b578d3Smrg
59721b12faf6Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
59731b12faf6Smrg      runpath_var=
59741b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
59751b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
59761b12faf6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
59771b12faf6Smrg    fi
59781b12faf6Smrg  else
59791b12faf6Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
59801b12faf6Smrg    case $host_os in
59811b12faf6Smrg    aix3*)
59821b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
59831b12faf6Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
59841b12faf6Smrg      _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'
59851b12faf6Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
59861b12faf6Smrg      # are no directories specified by -L.
59871b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
59881b12faf6Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
59891b12faf6Smrg	# Neither direct hardcoding nor static linking is supported with a
59901b12faf6Smrg	# broken collect2.
59911b12faf6Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
59921b12faf6Smrg      fi
59931b12faf6Smrg      ;;
599432b578d3Smrg
59951b12faf6Smrg    aix[[4-9]]*)
59961b12faf6Smrg      if test "$host_cpu" = ia64; then
59971b12faf6Smrg	# On IA64, the linker does run time linking by default, so we don't
59981b12faf6Smrg	# have to do anything special.
59991b12faf6Smrg	aix_use_runtimelinking=no
60001b12faf6Smrg	exp_sym_flag='-Bexport'
60011b12faf6Smrg	no_entry_flag=""
60021b12faf6Smrg      else
60031b12faf6Smrg	# If we're using GNU nm, then we don't want the "-C" option.
60041b12faf6Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6005e35d4d8eSmrg	# Also, AIX nm treats weak defined symbols like other global
6006e35d4d8eSmrg	# defined symbols, whereas GNU nm marks them as "W".
60071b12faf6Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6008e35d4d8eSmrg	  _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'
60091b12faf6Smrg	else
60101b12faf6Smrg	  _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'
60111b12faf6Smrg	fi
60121b12faf6Smrg	aix_use_runtimelinking=no
601332b578d3Smrg
60141b12faf6Smrg	# Test if we are trying to use run time linking or normal
60151b12faf6Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
60161b12faf6Smrg	# need to do runtime linking.
60171b12faf6Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
60181b12faf6Smrg	  for ld_flag in $LDFLAGS; do
60191b12faf6Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
60201b12faf6Smrg	    aix_use_runtimelinking=yes
60211b12faf6Smrg	    break
60221b12faf6Smrg	  fi
60231b12faf6Smrg	  done
60241b12faf6Smrg	  ;;
60251b12faf6Smrg	esac
602632b578d3Smrg
60271b12faf6Smrg	exp_sym_flag='-bexport'
60281b12faf6Smrg	no_entry_flag='-bnoentry'
60291b12faf6Smrg      fi
60302a51b5beSmrg
60311b12faf6Smrg      # When large executables or shared objects are built, AIX ld can
60321b12faf6Smrg      # have problems creating the table of contents.  If linking a library
60331b12faf6Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
60341b12faf6Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
60351b12faf6Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
60361b12faf6Smrg
60371b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)=''
60381b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
60391b12faf6Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60401b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60411b12faf6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
60421b12faf6Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
60432a51b5beSmrg
60441b12faf6Smrg      if test "$GCC" = yes; then
60451b12faf6Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
60461b12faf6Smrg	# We only want to do this on AIX 4.2 and lower, the check
60471b12faf6Smrg	# below for broken collect2 doesn't work under 4.3+
60481b12faf6Smrg	  collect2name=`${CC} -print-prog-name=collect2`
60491b12faf6Smrg	  if test -f "$collect2name" &&
60501b12faf6Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60511b12faf6Smrg	  then
60521b12faf6Smrg	  # We have reworked collect2
60531b12faf6Smrg	  :
60541b12faf6Smrg	  else
60551b12faf6Smrg	  # We have old collect2
60561b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
60571b12faf6Smrg	  # It fails to find uninstalled libraries when the uninstalled
60581b12faf6Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
60591b12faf6Smrg	  # to unsupported forces relinking
60601b12faf6Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
60611b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60621b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
60631b12faf6Smrg	  fi
60641b12faf6Smrg	  ;;
60651b12faf6Smrg	esac
60661b12faf6Smrg	shared_flag='-shared'
60671b12faf6Smrg	if test "$aix_use_runtimelinking" = yes; then
60681b12faf6Smrg	  shared_flag="$shared_flag "'${wl}-G'
60691b12faf6Smrg	fi
60701b12faf6Smrg      else
60711b12faf6Smrg	# not using gcc
60721b12faf6Smrg	if test "$host_cpu" = ia64; then
60731b12faf6Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60741b12faf6Smrg	# chokes on -Wl,-G. The following line is correct:
60751b12faf6Smrg	  shared_flag='-G'
60761b12faf6Smrg	else
60771b12faf6Smrg	  if test "$aix_use_runtimelinking" = yes; then
60781b12faf6Smrg	    shared_flag='${wl}-G'
60791b12faf6Smrg	  else
60801b12faf6Smrg	    shared_flag='${wl}-bM:SRE'
60811b12faf6Smrg	  fi
60821b12faf6Smrg	fi
60831b12faf6Smrg      fi
60842a51b5beSmrg
60851b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
60861b12faf6Smrg      # It seems that -bexpall does not export symbols beginning with
60871b12faf6Smrg      # underscore (_), so it is better to generate a list of symbols to export.
60881b12faf6Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
60891b12faf6Smrg      if test "$aix_use_runtimelinking" = yes; then
60901b12faf6Smrg	# Warning - without using the other runtime loading flags (-brtl),
60911b12faf6Smrg	# -berok will link without error, but may produce a broken library.
60921b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
60931b12faf6Smrg        # Determine the default libpath from the value encoded in an
60941b12faf6Smrg        # empty executable.
6095e35d4d8eSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
60961b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6097e35d4d8eSmrg        _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"
60981b12faf6Smrg      else
60991b12faf6Smrg	if test "$host_cpu" = ia64; then
61001b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
61011b12faf6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
61021b12faf6Smrg	  _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"
61031b12faf6Smrg	else
61041b12faf6Smrg	 # Determine the default libpath from the value encoded in an
61051b12faf6Smrg	 # empty executable.
6106e35d4d8eSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
61071b12faf6Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
61081b12faf6Smrg	  # Warning - without using the other run time loading flags,
61091b12faf6Smrg	  # -berok will link without error, but may produce a broken library.
61101b12faf6Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
61111b12faf6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6112e35d4d8eSmrg	  if test "$with_gnu_ld" = yes; then
6113e35d4d8eSmrg	    # We only use this code for GNU lds that support --whole-archive.
6114e35d4d8eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6115e35d4d8eSmrg	  else
6116e35d4d8eSmrg	    # Exported symbols can be pulled into shared objects from archives
6117e35d4d8eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6118e35d4d8eSmrg	  fi
61191b12faf6Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61201b12faf6Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
61211b12faf6Smrg	  _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'
61221b12faf6Smrg	fi
61231b12faf6Smrg      fi
61241b12faf6Smrg      ;;
6125d31dbc53Smrg
61261b12faf6Smrg    amigaos*)
61271b12faf6Smrg      case $host_cpu in
61281b12faf6Smrg      powerpc)
61291b12faf6Smrg            # see comment about AmigaOS4 .so support
61301b12faf6Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61311b12faf6Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
61321b12faf6Smrg        ;;
61331b12faf6Smrg      m68k)
61341b12faf6Smrg            _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)'
61351b12faf6Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61361b12faf6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
61371b12faf6Smrg        ;;
61381b12faf6Smrg      esac
61391b12faf6Smrg      ;;
6140d31dbc53Smrg
61411b12faf6Smrg    bsdi[[45]]*)
61421b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
61431b12faf6Smrg      ;;
6144d31dbc53Smrg
61451b12faf6Smrg    cygwin* | mingw* | pw32* | cegcc*)
61461b12faf6Smrg      # When not using gcc, we currently assume that we are using
61471b12faf6Smrg      # Microsoft Visual C++.
61481b12faf6Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
61491b12faf6Smrg      # no search path for DLLs.
6150e35d4d8eSmrg      case $cc_basename in
6151e35d4d8eSmrg      cl*)
6152e35d4d8eSmrg	# Native MSVC
6153e35d4d8eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6154e35d4d8eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6155e35d4d8eSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
6156e35d4d8eSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
6157e35d4d8eSmrg	# Tell ltmain to make .lib files, not .a files.
6158e35d4d8eSmrg	libext=lib
6159e35d4d8eSmrg	# Tell ltmain to make .dll files, not .so files.
6160e35d4d8eSmrg	shrext_cmds=".dll"
6161e35d4d8eSmrg	# FIXME: Setting linknames here is a bad hack.
6162e35d4d8eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6163e35d4d8eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6164e35d4d8eSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6165e35d4d8eSmrg	  else
6166e35d4d8eSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6167e35d4d8eSmrg	  fi~
6168e35d4d8eSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6169e35d4d8eSmrg	  linknames='
6170e35d4d8eSmrg	# The linker will not automatically build a static lib if we build a DLL.
6171e35d4d8eSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6172e35d4d8eSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6173e35d4d8eSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6174e35d4d8eSmrg	_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'
6175e35d4d8eSmrg	# Don't use ranlib
6176e35d4d8eSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6177e35d4d8eSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6178e35d4d8eSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6179e35d4d8eSmrg	  case $lt_outputfile in
6180e35d4d8eSmrg	    *.exe|*.EXE) ;;
6181e35d4d8eSmrg	    *)
6182e35d4d8eSmrg	      lt_outputfile="$lt_outputfile.exe"
6183e35d4d8eSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6184e35d4d8eSmrg	      ;;
6185e35d4d8eSmrg	  esac~
6186e35d4d8eSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6187e35d4d8eSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6188e35d4d8eSmrg	    $RM "$lt_outputfile.manifest";
6189e35d4d8eSmrg	  fi'
6190e35d4d8eSmrg	;;
6191e35d4d8eSmrg      *)
6192e35d4d8eSmrg	# Assume MSVC wrapper
6193e35d4d8eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6194e35d4d8eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6195e35d4d8eSmrg	# Tell ltmain to make .lib files, not .a files.
6196e35d4d8eSmrg	libext=lib
6197e35d4d8eSmrg	# Tell ltmain to make .dll files, not .so files.
6198e35d4d8eSmrg	shrext_cmds=".dll"
6199e35d4d8eSmrg	# FIXME: Setting linknames here is a bad hack.
6200e35d4d8eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6201e35d4d8eSmrg	# The linker will automatically build a .lib file if we build a DLL.
6202e35d4d8eSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6203e35d4d8eSmrg	# FIXME: Should let the user specify the lib program.
6204e35d4d8eSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6205e35d4d8eSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6206e35d4d8eSmrg	;;
6207e35d4d8eSmrg      esac
62081b12faf6Smrg      ;;
6209d31dbc53Smrg
62101b12faf6Smrg    darwin* | rhapsody*)
62111b12faf6Smrg      _LT_DARWIN_LINKER_FEATURES($1)
62121b12faf6Smrg      ;;
6213d31dbc53Smrg
62141b12faf6Smrg    dgux*)
62151b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
62161b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
62171b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62181b12faf6Smrg      ;;
6219d31dbc53Smrg
62201b12faf6Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
62211b12faf6Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
62221b12faf6Smrg    # does not break anything, and helps significantly (at the cost of a little
62231b12faf6Smrg    # extra space).
62241b12faf6Smrg    freebsd2.2*)
62251b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
62261b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
62271b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62281b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62291b12faf6Smrg      ;;
6230d31dbc53Smrg
62311b12faf6Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6232e35d4d8eSmrg    freebsd2.*)
62331b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
62341b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62351b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
62361b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62371b12faf6Smrg      ;;
6238d31dbc53Smrg
62391b12faf6Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
62401b12faf6Smrg    freebsd* | dragonfly*)
6241e35d4d8eSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
62421b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
62431b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62441b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62451b12faf6Smrg      ;;
6246d31dbc53Smrg
62471b12faf6Smrg    hpux9*)
62481b12faf6Smrg      if test "$GCC" = yes; then
6249e35d4d8eSmrg	_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'
62501b12faf6Smrg      else
62511b12faf6Smrg	_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'
62521b12faf6Smrg      fi
62531b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62541b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62551b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6256d31dbc53Smrg
62571b12faf6Smrg      # hardcode_minus_L: Not really in the search PATH,
62581b12faf6Smrg      # but as the default location of the library.
62591b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
62601b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62611b12faf6Smrg      ;;
626232b578d3Smrg
62631b12faf6Smrg    hpux10*)
6264e35d4d8eSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6265e35d4d8eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
62661b12faf6Smrg      else
62671b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
62681b12faf6Smrg      fi
62691b12faf6Smrg      if test "$with_gnu_ld" = no; then
62701b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62711b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
62721b12faf6Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
62731b12faf6Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
62741b12faf6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62751b12faf6Smrg	# hardcode_minus_L: Not really in the search PATH,
62761b12faf6Smrg	# but as the default location of the library.
62771b12faf6Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
62781b12faf6Smrg      fi
62791b12faf6Smrg      ;;
628032b578d3Smrg
62811b12faf6Smrg    hpux11*)
6282e35d4d8eSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
62831b12faf6Smrg	case $host_cpu in
62841b12faf6Smrg	hppa*64*)
62851b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
62861b12faf6Smrg	  ;;
62871b12faf6Smrg	ia64*)
6288e35d4d8eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
62891b12faf6Smrg	  ;;
62901b12faf6Smrg	*)
6291e35d4d8eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
62921b12faf6Smrg	  ;;
62931b12faf6Smrg	esac
62941b12faf6Smrg      else
62951b12faf6Smrg	case $host_cpu in
62961b12faf6Smrg	hppa*64*)
62971b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
62981b12faf6Smrg	  ;;
62991b12faf6Smrg	ia64*)
63001b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
63011b12faf6Smrg	  ;;
63021b12faf6Smrg	*)
6303e35d4d8eSmrg	m4_if($1, [], [
6304e35d4d8eSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
6305e35d4d8eSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6306e35d4d8eSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
6307e35d4d8eSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6308e35d4d8eSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6309e35d4d8eSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6310e35d4d8eSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
63111b12faf6Smrg	  ;;
63121b12faf6Smrg	esac
63131b12faf6Smrg      fi
63141b12faf6Smrg      if test "$with_gnu_ld" = no; then
63151b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
63161b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
631732b578d3Smrg
63181b12faf6Smrg	case $host_cpu in
63191b12faf6Smrg	hppa*64*|ia64*)
63201b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
63211b12faf6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63221b12faf6Smrg	  ;;
63231b12faf6Smrg	*)
63241b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
63251b12faf6Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63261b12faf6Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
632732b578d3Smrg
63281b12faf6Smrg	  # hardcode_minus_L: Not really in the search PATH,
63291b12faf6Smrg	  # but as the default location of the library.
63301b12faf6Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
63311b12faf6Smrg	  ;;
63321b12faf6Smrg	esac
63331b12faf6Smrg      fi
63342a51b5beSmrg      ;;
63351b12faf6Smrg
63361b12faf6Smrg    irix5* | irix6* | nonstopux*)
63371b12faf6Smrg      if test "$GCC" = yes; then
6338e35d4d8eSmrg	_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'
63391b12faf6Smrg	# Try to use the -exported_symbol ld option, if it does not
63401b12faf6Smrg	# work, assume that -exports_file does not work either and
63411b12faf6Smrg	# implicitly export all symbols.
6342e35d4d8eSmrg	# This should be the same for all languages, so no per-tag cache variable.
6343e35d4d8eSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6344e35d4d8eSmrg	  [lt_cv_irix_exported_symbol],
6345e35d4d8eSmrg	  [save_LDFLAGS="$LDFLAGS"
6346e35d4d8eSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6347e35d4d8eSmrg	   AC_LINK_IFELSE(
6348e35d4d8eSmrg	     [AC_LANG_SOURCE(
6349e35d4d8eSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6350e35d4d8eSmrg			      [C++], [[int foo (void) { return 0; }]],
6351e35d4d8eSmrg			      [Fortran 77], [[
6352e35d4d8eSmrg      subroutine foo
6353e35d4d8eSmrg      end]],
6354e35d4d8eSmrg			      [Fortran], [[
6355e35d4d8eSmrg      subroutine foo
6356e35d4d8eSmrg      end]])])],
6357e35d4d8eSmrg	      [lt_cv_irix_exported_symbol=yes],
6358e35d4d8eSmrg	      [lt_cv_irix_exported_symbol=no])
6359e35d4d8eSmrg           LDFLAGS="$save_LDFLAGS"])
6360e35d4d8eSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
6361e35d4d8eSmrg          _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'
6362e35d4d8eSmrg	fi
63631b12faf6Smrg      else
6364e35d4d8eSmrg	_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'
6365e35d4d8eSmrg	_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'
63661b12faf6Smrg      fi
63671b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
63681b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
63691b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63701b12faf6Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
63711b12faf6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
63722a51b5beSmrg      ;;
6373d31dbc53Smrg
6374e35d4d8eSmrg    netbsd*)
63751b12faf6Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
63761b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
63771b12faf6Smrg      else
63781b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
63791b12faf6Smrg      fi
63801b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
63811b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63821b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63831b12faf6Smrg      ;;
6384d31dbc53Smrg
63851b12faf6Smrg    newsos6)
63861b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
63871b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63881b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
63891b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63901b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63911b12faf6Smrg      ;;
639232b578d3Smrg
63931b12faf6Smrg    *nto* | *qnx*)
63941b12faf6Smrg      ;;
639532b578d3Smrg
63961b12faf6Smrg    openbsd*)
63971b12faf6Smrg      if test -f /usr/libexec/ld.so; then
63981b12faf6Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
63991b12faf6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64001b12faf6Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
64011b12faf6Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
64021b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
64031b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
64041b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64051b12faf6Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
64061b12faf6Smrg	else
64071b12faf6Smrg	  case $host_os in
64081b12faf6Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
64091b12faf6Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
64101b12faf6Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64111b12faf6Smrg	     ;;
64121b12faf6Smrg	   *)
64131b12faf6Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
64141b12faf6Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64151b12faf6Smrg	     ;;
64161b12faf6Smrg	  esac
64171b12faf6Smrg	fi
64181b12faf6Smrg      else
64191b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
64201b12faf6Smrg      fi
64211b12faf6Smrg      ;;
642232b578d3Smrg
64231b12faf6Smrg    os2*)
64241b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
64251b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
64261b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6427e35d4d8eSmrg      _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'
64281b12faf6Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
64291b12faf6Smrg      ;;
643032b578d3Smrg
64311b12faf6Smrg    osf3*)
64321b12faf6Smrg      if test "$GCC" = yes; then
64331b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6434e35d4d8eSmrg	_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'
64351b12faf6Smrg      else
64361b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6437e35d4d8eSmrg	_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'
64381b12faf6Smrg      fi
64391b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
64401b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64411b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64421b12faf6Smrg      ;;
644332b578d3Smrg
64441b12faf6Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
64451b12faf6Smrg      if test "$GCC" = yes; then
64461b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6447e35d4d8eSmrg	_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'
64481b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64491b12faf6Smrg      else
64501b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6451e35d4d8eSmrg	_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'
64521b12faf6Smrg	_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~
6453e35d4d8eSmrg	$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'
645432b578d3Smrg
64551b12faf6Smrg	# Both c and cxx compiler support -rpath directly
64561b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
64571b12faf6Smrg      fi
64581b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
64591b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64601b12faf6Smrg      ;;
646132b578d3Smrg
64621b12faf6Smrg    solaris*)
64631b12faf6Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
64641b12faf6Smrg      if test "$GCC" = yes; then
64651b12faf6Smrg	wlarc='${wl}'
6466e35d4d8eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
64671b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6468e35d4d8eSmrg	  $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'
64691b12faf6Smrg      else
64701b12faf6Smrg	case `$CC -V 2>&1` in
64711b12faf6Smrg	*"Compilers 5.0"*)
64721b12faf6Smrg	  wlarc=''
64731b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
64741b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
64751b12faf6Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
64761b12faf6Smrg	  ;;
64771b12faf6Smrg	*)
64781b12faf6Smrg	  wlarc='${wl}'
64791b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
64801b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
64811b12faf6Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
64821b12faf6Smrg	  ;;
64831b12faf6Smrg	esac
64841b12faf6Smrg      fi
64851b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64861b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64871b12faf6Smrg      case $host_os in
64881b12faf6Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
64891b12faf6Smrg      *)
64901b12faf6Smrg	# The compiler driver will combine and reorder linker options,
64911b12faf6Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
64921b12faf6Smrg	# but is careful enough not to reorder.
64931b12faf6Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
64941b12faf6Smrg	if test "$GCC" = yes; then
64951b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
64961b12faf6Smrg	else
64971b12faf6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
64981b12faf6Smrg	fi
64991b12faf6Smrg	;;
65001b12faf6Smrg      esac
65011b12faf6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
65021b12faf6Smrg      ;;
650332b578d3Smrg
65041b12faf6Smrg    sunos4*)
65051b12faf6Smrg      if test "x$host_vendor" = xsequent; then
65061b12faf6Smrg	# Use $CC to link under sequent, because it throws in some extra .o
65071b12faf6Smrg	# files that make .init and .fini sections work.
65081b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
65091b12faf6Smrg      else
65101b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
65111b12faf6Smrg      fi
65121b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65131b12faf6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
65141b12faf6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
65151b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65161b12faf6Smrg      ;;
651732b578d3Smrg
65181b12faf6Smrg    sysv4)
65191b12faf6Smrg      case $host_vendor in
65201b12faf6Smrg	sni)
65211b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65221b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
65231b12faf6Smrg	;;
65241b12faf6Smrg	siemens)
65251b12faf6Smrg	  ## LD is ld it makes a PLAMLIB
65261b12faf6Smrg	  ## CC just makes a GrossModule.
65271b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
65281b12faf6Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
65291b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
65301b12faf6Smrg        ;;
65311b12faf6Smrg	motorola)
65321b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65331b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
65341b12faf6Smrg	;;
65351b12faf6Smrg      esac
65361b12faf6Smrg      runpath_var='LD_RUN_PATH'
65371b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65381b12faf6Smrg      ;;
6539d31dbc53Smrg
65401b12faf6Smrg    sysv4.3*)
65411b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65421b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65431b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
65441b12faf6Smrg      ;;
654532b578d3Smrg
65461b12faf6Smrg    sysv4*MP*)
65471b12faf6Smrg      if test -d /usr/nec; then
65481b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65491b12faf6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65501b12faf6Smrg	runpath_var=LD_RUN_PATH
65511b12faf6Smrg	hardcode_runpath_var=yes
65521b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
65531b12faf6Smrg      fi
65541b12faf6Smrg      ;;
655532b578d3Smrg
65561b12faf6Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
65571b12faf6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
65581b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
65591b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65601b12faf6Smrg      runpath_var='LD_RUN_PATH'
656132b578d3Smrg
65621b12faf6Smrg      if test "$GCC" = yes; then
65631b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65641b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65651b12faf6Smrg      else
65661b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65671b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65681b12faf6Smrg      fi
65691b12faf6Smrg      ;;
657032b578d3Smrg
65711b12faf6Smrg    sysv5* | sco3.2v5* | sco5v6*)
65721b12faf6Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
65731b12faf6Smrg      # link with -lc, and that would cause any symbols used from libc to
65741b12faf6Smrg      # always be unresolved, which means just about no library would
65751b12faf6Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
65761b12faf6Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
65771b12faf6Smrg      # as -z defs.
65781b12faf6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
65791b12faf6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
65801b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
65811b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65821b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
65831b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
65841b12faf6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
65851b12faf6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
65861b12faf6Smrg      runpath_var='LD_RUN_PATH'
658732b578d3Smrg
65881b12faf6Smrg      if test "$GCC" = yes; then
65891b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65901b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65911b12faf6Smrg      else
65921b12faf6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65931b12faf6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65941b12faf6Smrg      fi
65951b12faf6Smrg      ;;
659632b578d3Smrg
65971b12faf6Smrg    uts4*)
65981b12faf6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65991b12faf6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
66001b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66011b12faf6Smrg      ;;
660232b578d3Smrg
66031b12faf6Smrg    *)
66041b12faf6Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
66051b12faf6Smrg      ;;
66061b12faf6Smrg    esac
660732b578d3Smrg
66081b12faf6Smrg    if test x$host_vendor = xsni; then
66091b12faf6Smrg      case $host in
66101b12faf6Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
66111b12faf6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
66121b12faf6Smrg	;;
66131b12faf6Smrg      esac
66141b12faf6Smrg    fi
66151b12faf6Smrg  fi
66161b12faf6Smrg])
66171b12faf6SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
66181b12faf6Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
661932b578d3Smrg
66201b12faf6Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
662132b578d3Smrg
66221b12faf6Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
66231b12faf6Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
66241b12faf6Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
66251b12faf6Smrg    [The commands to extract the exported symbol list from a shared archive])
6626d31dbc53Smrg
66271b12faf6Smrg#
66281b12faf6Smrg# Do we need to explicitly link libc?
66291b12faf6Smrg#
66301b12faf6Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
66311b12faf6Smrgx|xyes)
66321b12faf6Smrg  # Assume -lc should be added
66331b12faf6Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6634d31dbc53Smrg
66351b12faf6Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
66361b12faf6Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
66371b12faf6Smrg    *'~'*)
66381b12faf6Smrg      # FIXME: we may have to deal with multi-command sequences.
66391b12faf6Smrg      ;;
66401b12faf6Smrg    '$CC '*)
66411b12faf6Smrg      # Test whether the compiler implicitly links with -lc since on some
66421b12faf6Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
66431b12faf6Smrg      # to ld, don't add -lc before -lgcc.
6644e35d4d8eSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6645e35d4d8eSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6646e35d4d8eSmrg	[$RM conftest*
6647e35d4d8eSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6648e35d4d8eSmrg
6649e35d4d8eSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6650e35d4d8eSmrg	  soname=conftest
6651e35d4d8eSmrg	  lib=conftest
6652e35d4d8eSmrg	  libobjs=conftest.$ac_objext
6653e35d4d8eSmrg	  deplibs=
6654e35d4d8eSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6655e35d4d8eSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6656e35d4d8eSmrg	  compiler_flags=-v
6657e35d4d8eSmrg	  linker_flags=-v
6658e35d4d8eSmrg	  verstring=
6659e35d4d8eSmrg	  output_objdir=.
6660e35d4d8eSmrg	  libname=conftest
6661e35d4d8eSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6662e35d4d8eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
6663e35d4d8eSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6664e35d4d8eSmrg	  then
6665e35d4d8eSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6666e35d4d8eSmrg	  else
6667e35d4d8eSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6668e35d4d8eSmrg	  fi
6669e35d4d8eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6670e35d4d8eSmrg	else
6671e35d4d8eSmrg	  cat conftest.err 1>&5
6672e35d4d8eSmrg	fi
6673e35d4d8eSmrg	$RM conftest*
6674e35d4d8eSmrg	])
6675e35d4d8eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
66761b12faf6Smrg      ;;
66771b12faf6Smrg    esac
66781b12faf6Smrg  fi
66791b12faf6Smrg  ;;
66801b12faf6Smrgesac
6681d31dbc53Smrg
66821b12faf6Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
66831b12faf6Smrg    [Whether or not to add -lc for building shared libraries])
66841b12faf6Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
66851b12faf6Smrg    [enable_shared_with_static_runtimes], [0],
66861b12faf6Smrg    [Whether or not to disallow shared libs when runtime libs are static])
66871b12faf6Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
66881b12faf6Smrg    [Compiler flag to allow reflexive dlopens])
66891b12faf6Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
66901b12faf6Smrg    [Compiler flag to generate shared objects directly from archives])
66911b12faf6Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
66921b12faf6Smrg    [Whether the compiler copes with passing no objects directly])
66931b12faf6Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
66941b12faf6Smrg    [Create an old-style archive from a shared archive])
66951b12faf6Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
66961b12faf6Smrg    [Create a temporary old-style archive to link instead of a shared archive])
66971b12faf6Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
66981b12faf6Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
66991b12faf6Smrg_LT_TAGDECL([], [module_cmds], [2],
67001b12faf6Smrg    [Commands used to build a loadable module if different from building
67011b12faf6Smrg    a shared archive.])
67021b12faf6Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
67031b12faf6Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
67041b12faf6Smrg    [Whether we are building with GNU ld or not])
67051b12faf6Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
67061b12faf6Smrg    [Flag that allows shared libraries with undefined symbols to be built])
67071b12faf6Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
67081b12faf6Smrg    [Flag that enforces no undefined symbols])
67091b12faf6Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
67101b12faf6Smrg    [Flag to hardcode $libdir into a binary during linking.
67111b12faf6Smrg    This must work even if $libdir does not exist])
67121b12faf6Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
67131b12faf6Smrg    [Whether we need a single "-rpath" flag with a separated argument])
67141b12faf6Smrg_LT_TAGDECL([], [hardcode_direct], [0],
67151b12faf6Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
67161b12faf6Smrg    DIR into the resulting binary])
67171b12faf6Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
67181b12faf6Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
67191b12faf6Smrg    DIR into the resulting binary and the resulting library dependency is
67201b12faf6Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
67211b12faf6Smrg    library is relocated])
67221b12faf6Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
67231b12faf6Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
67241b12faf6Smrg    into the resulting binary])
67251b12faf6Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
67261b12faf6Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
67271b12faf6Smrg    into the resulting binary])
67281b12faf6Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
67291b12faf6Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
67301b12faf6Smrg    into the library and all subsequent libraries and executables linked
67311b12faf6Smrg    against it])
67321b12faf6Smrg_LT_TAGDECL([], [inherit_rpath], [0],
67331b12faf6Smrg    [Set to yes if linker adds runtime paths of dependent libraries
67341b12faf6Smrg    to runtime path list])
67351b12faf6Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
67361b12faf6Smrg    [Whether libtool must link a program against all its dependency libraries])
67371b12faf6Smrg_LT_TAGDECL([], [always_export_symbols], [0],
67381b12faf6Smrg    [Set to "yes" if exported symbols are required])
67391b12faf6Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
67401b12faf6Smrg    [The commands to list exported symbols])
67411b12faf6Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
67421b12faf6Smrg    [Symbols that should not be listed in the preloaded symbols])
67431b12faf6Smrg_LT_TAGDECL([], [include_expsyms], [1],
67441b12faf6Smrg    [Symbols that must always be exported])
67451b12faf6Smrg_LT_TAGDECL([], [prelink_cmds], [2],
67461b12faf6Smrg    [Commands necessary for linking programs (against libraries) with templates])
6747e35d4d8eSmrg_LT_TAGDECL([], [postlink_cmds], [2],
6748e35d4d8eSmrg    [Commands necessary for finishing linking programs])
67491b12faf6Smrg_LT_TAGDECL([], [file_list_spec], [1],
67501b12faf6Smrg    [Specify filename containing input files])
67511b12faf6Smrgdnl FIXME: Not yet implemented
67521b12faf6Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
67531b12faf6Smrgdnl    [Compiler flag to generate thread safe objects])
67541b12faf6Smrg])# _LT_LINKER_SHLIBS
67551b12faf6Smrg
67561b12faf6Smrg
67571b12faf6Smrg# _LT_LANG_C_CONFIG([TAG])
67581b12faf6Smrg# ------------------------
67591b12faf6Smrg# Ensure that the configuration variables for a C compiler are suitably
67601b12faf6Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
67611b12faf6Smrg# the compiler configuration to `libtool'.
67621b12faf6Smrgm4_defun([_LT_LANG_C_CONFIG],
67631b12faf6Smrg[m4_require([_LT_DECL_EGREP])dnl
67641b12faf6Smrglt_save_CC="$CC"
67651b12faf6SmrgAC_LANG_PUSH(C)
6766d31dbc53Smrg
67671b12faf6Smrg# Source file extension for C test sources.
67681b12faf6Smrgac_ext=c
6769d31dbc53Smrg
67701b12faf6Smrg# Object file extension for compiled C test sources.
67711b12faf6Smrgobjext=o
67721b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
677332b578d3Smrg
67741b12faf6Smrg# Code to be used in simple compile tests
67751b12faf6Smrglt_simple_compile_test_code="int some_variable = 0;"
677632b578d3Smrg
67771b12faf6Smrg# Code to be used in simple link tests
67781b12faf6Smrglt_simple_link_test_code='int main(){return(0);}'
677932b578d3Smrg
67801b12faf6Smrg_LT_TAG_COMPILER
67811b12faf6Smrg# Save the default compiler, since it gets overwritten when the other
67821b12faf6Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
67831b12faf6Smrgcompiler_DEFAULT=$CC
678432b578d3Smrg
67851b12faf6Smrg# save warnings/boilerplate of simple test code
67861b12faf6Smrg_LT_COMPILER_BOILERPLATE
67871b12faf6Smrg_LT_LINKER_BOILERPLATE
678832b578d3Smrg
67891b12faf6Smrgif test -n "$compiler"; then
67901b12faf6Smrg  _LT_COMPILER_NO_RTTI($1)
67911b12faf6Smrg  _LT_COMPILER_PIC($1)
67921b12faf6Smrg  _LT_COMPILER_C_O($1)
67931b12faf6Smrg  _LT_COMPILER_FILE_LOCKS($1)
67941b12faf6Smrg  _LT_LINKER_SHLIBS($1)
67951b12faf6Smrg  _LT_SYS_DYNAMIC_LINKER($1)
67961b12faf6Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
67971b12faf6Smrg  LT_SYS_DLOPEN_SELF
67981b12faf6Smrg  _LT_CMD_STRIPLIB
67991b12faf6Smrg
68001b12faf6Smrg  # Report which library types will actually be built
68011b12faf6Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
68021b12faf6Smrg  AC_MSG_RESULT([$can_build_shared])
68031b12faf6Smrg
68041b12faf6Smrg  AC_MSG_CHECKING([whether to build shared libraries])
68051b12faf6Smrg  test "$can_build_shared" = "no" && enable_shared=no
68061b12faf6Smrg
68071b12faf6Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
68081b12faf6Smrg  # are all built from PIC.
68091b12faf6Smrg  case $host_os in
68101b12faf6Smrg  aix3*)
68111b12faf6Smrg    test "$enable_shared" = yes && enable_static=no
68121b12faf6Smrg    if test -n "$RANLIB"; then
68131b12faf6Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
68141b12faf6Smrg      postinstall_cmds='$RANLIB $lib'
68151b12faf6Smrg    fi
68161b12faf6Smrg    ;;
681732b578d3Smrg
68181b12faf6Smrg  aix[[4-9]]*)
68191b12faf6Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
68201b12faf6Smrg      test "$enable_shared" = yes && enable_static=no
68211b12faf6Smrg    fi
68221b12faf6Smrg    ;;
68231b12faf6Smrg  esac
68241b12faf6Smrg  AC_MSG_RESULT([$enable_shared])
682532b578d3Smrg
68261b12faf6Smrg  AC_MSG_CHECKING([whether to build static libraries])
68271b12faf6Smrg  # Make sure either enable_shared or enable_static is yes.
68281b12faf6Smrg  test "$enable_shared" = yes || enable_static=yes
68291b12faf6Smrg  AC_MSG_RESULT([$enable_static])
683032b578d3Smrg
68311b12faf6Smrg  _LT_CONFIG($1)
68321b12faf6Smrgfi
68331b12faf6SmrgAC_LANG_POP
68341b12faf6SmrgCC="$lt_save_CC"
68351b12faf6Smrg])# _LT_LANG_C_CONFIG
683632b578d3Smrg
683732b578d3Smrg
68381b12faf6Smrg# _LT_LANG_CXX_CONFIG([TAG])
68391b12faf6Smrg# --------------------------
68401b12faf6Smrg# Ensure that the configuration variables for a C++ compiler are suitably
68411b12faf6Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
68421b12faf6Smrg# the compiler configuration to `libtool'.
68431b12faf6Smrgm4_defun([_LT_LANG_CXX_CONFIG],
6844e35d4d8eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
68451b12faf6Smrgm4_require([_LT_DECL_EGREP])dnl
6846e35d4d8eSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6847e35d4d8eSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6848e35d4d8eSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6849e35d4d8eSmrg    (test "X$CXX" != "Xg++"))) ; then
6850e35d4d8eSmrg  AC_PROG_CXXCPP
6851e35d4d8eSmrgelse
6852e35d4d8eSmrg  _lt_caught_CXX_error=yes
6853e35d4d8eSmrgfi
68541b12faf6Smrg
68551b12faf6SmrgAC_LANG_PUSH(C++)
68561b12faf6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
68571b12faf6Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
68581b12faf6Smrg_LT_TAGVAR(always_export_symbols, $1)=no
68591b12faf6Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
68601b12faf6Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
68611b12faf6Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
68621b12faf6Smrg_LT_TAGVAR(hardcode_direct, $1)=no
68631b12faf6Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
68641b12faf6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
68651b12faf6Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
68661b12faf6Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
68671b12faf6Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
68681b12faf6Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
68691b12faf6Smrg_LT_TAGVAR(inherit_rpath, $1)=no
68701b12faf6Smrg_LT_TAGVAR(module_cmds, $1)=
68711b12faf6Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
68721b12faf6Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
68731b12faf6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6874e35d4d8eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6875e35d4d8eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
68761b12faf6Smrg_LT_TAGVAR(no_undefined_flag, $1)=
68771b12faf6Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
68781b12faf6Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
687932b578d3Smrg
68801b12faf6Smrg# Source file extension for C++ test sources.
68811b12faf6Smrgac_ext=cpp
688232b578d3Smrg
68831b12faf6Smrg# Object file extension for compiled C++ test sources.
68841b12faf6Smrgobjext=o
68851b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
68861b12faf6Smrg
68871b12faf6Smrg# No sense in running all these tests if we already determined that
68881b12faf6Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
68891b12faf6Smrg# are currently assumed to apply to all compilers on this platform,
68901b12faf6Smrg# and will be corrupted by setting them based on a non-working compiler.
68911b12faf6Smrgif test "$_lt_caught_CXX_error" != yes; then
68921b12faf6Smrg  # Code to be used in simple compile tests
68931b12faf6Smrg  lt_simple_compile_test_code="int some_variable = 0;"
68941b12faf6Smrg
68951b12faf6Smrg  # Code to be used in simple link tests
68961b12faf6Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
68971b12faf6Smrg
68981b12faf6Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
68991b12faf6Smrg  _LT_TAG_COMPILER
69001b12faf6Smrg
69011b12faf6Smrg  # save warnings/boilerplate of simple test code
69021b12faf6Smrg  _LT_COMPILER_BOILERPLATE
69031b12faf6Smrg  _LT_LINKER_BOILERPLATE
69041b12faf6Smrg
69051b12faf6Smrg  # Allow CC to be a program name with arguments.
69061b12faf6Smrg  lt_save_CC=$CC
6907e35d4d8eSmrg  lt_save_CFLAGS=$CFLAGS
69081b12faf6Smrg  lt_save_LD=$LD
69091b12faf6Smrg  lt_save_GCC=$GCC
69101b12faf6Smrg  GCC=$GXX
69111b12faf6Smrg  lt_save_with_gnu_ld=$with_gnu_ld
69121b12faf6Smrg  lt_save_path_LD=$lt_cv_path_LD
69131b12faf6Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
69141b12faf6Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
69151b12faf6Smrg  else
69161b12faf6Smrg    $as_unset lt_cv_prog_gnu_ld
69171b12faf6Smrg  fi
69181b12faf6Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
69191b12faf6Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
69201b12faf6Smrg  else
69211b12faf6Smrg    $as_unset lt_cv_path_LD
69221b12faf6Smrg  fi
69231b12faf6Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
69241b12faf6Smrg  CC=${CXX-"c++"}
6925e35d4d8eSmrg  CFLAGS=$CXXFLAGS
69261b12faf6Smrg  compiler=$CC
69271b12faf6Smrg  _LT_TAGVAR(compiler, $1)=$CC
69281b12faf6Smrg  _LT_CC_BASENAME([$compiler])
692932b578d3Smrg
69301b12faf6Smrg  if test -n "$compiler"; then
69311b12faf6Smrg    # We don't want -fno-exception when compiling C++ code, so set the
69321b12faf6Smrg    # no_builtin_flag separately
69331b12faf6Smrg    if test "$GXX" = yes; then
69341b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
69351b12faf6Smrg    else
69361b12faf6Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
69371b12faf6Smrg    fi
693832b578d3Smrg
69391b12faf6Smrg    if test "$GXX" = yes; then
69401b12faf6Smrg      # Set up default GNU C++ configuration
694132b578d3Smrg
69421b12faf6Smrg      LT_PATH_LD
694332b578d3Smrg
69441b12faf6Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
69451b12faf6Smrg      # archiving commands below assume that GNU ld is being used.
69461b12faf6Smrg      if test "$with_gnu_ld" = yes; then
6947e35d4d8eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6948e35d4d8eSmrg        _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'
694932b578d3Smrg
69501b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
69511b12faf6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
695232b578d3Smrg
69531b12faf6Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
69541b12faf6Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
69551b12faf6Smrg        #     investigate it a little bit more. (MM)
69561b12faf6Smrg        wlarc='${wl}'
6957d31dbc53Smrg
69581b12faf6Smrg        # ancient GNU ld didn't support --whole-archive et. al.
69591b12faf6Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
69601b12faf6Smrg	  $GREP 'no-whole-archive' > /dev/null; then
69611b12faf6Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
69621b12faf6Smrg        else
69631b12faf6Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
69641b12faf6Smrg        fi
69651b12faf6Smrg      else
69661b12faf6Smrg        with_gnu_ld=no
69671b12faf6Smrg        wlarc=
69681b12faf6Smrg
69691b12faf6Smrg        # A generic and very simple default shared library creation
69701b12faf6Smrg        # command for GNU C++ for the case where it uses the native
69711b12faf6Smrg        # linker, instead of GNU ld.  If possible, this setting should
69721b12faf6Smrg        # overridden to take advantage of the native linker features on
69731b12faf6Smrg        # the platform it is being used on.
69741b12faf6Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
69751b12faf6Smrg      fi
697632b578d3Smrg
69771b12faf6Smrg      # Commands to make compiler produce verbose output that lists
69781b12faf6Smrg      # what "hidden" libraries, object files and flags are used when
69791b12faf6Smrg      # linking a shared library.
6980e35d4d8eSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
698132b578d3Smrg
69821b12faf6Smrg    else
69831b12faf6Smrg      GXX=no
69841b12faf6Smrg      with_gnu_ld=no
69851b12faf6Smrg      wlarc=
69861b12faf6Smrg    fi
698732b578d3Smrg
69881b12faf6Smrg    # PORTME: fill in a description of your system's C++ link characteristics
69891b12faf6Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
69901b12faf6Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
69911b12faf6Smrg    case $host_os in
69921b12faf6Smrg      aix3*)
69931b12faf6Smrg        # FIXME: insert proper C++ library support
69941b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
69951b12faf6Smrg        ;;
69961b12faf6Smrg      aix[[4-9]]*)
69971b12faf6Smrg        if test "$host_cpu" = ia64; then
69981b12faf6Smrg          # On IA64, the linker does run time linking by default, so we don't
69991b12faf6Smrg          # have to do anything special.
70001b12faf6Smrg          aix_use_runtimelinking=no
70011b12faf6Smrg          exp_sym_flag='-Bexport'
70021b12faf6Smrg          no_entry_flag=""
70031b12faf6Smrg        else
70041b12faf6Smrg          aix_use_runtimelinking=no
70051b12faf6Smrg
70061b12faf6Smrg          # Test if we are trying to use run time linking or normal
70071b12faf6Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
70081b12faf6Smrg          # need to do runtime linking.
70091b12faf6Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
70101b12faf6Smrg	    for ld_flag in $LDFLAGS; do
70111b12faf6Smrg	      case $ld_flag in
70121b12faf6Smrg	      *-brtl*)
70131b12faf6Smrg	        aix_use_runtimelinking=yes
70141b12faf6Smrg	        break
70151b12faf6Smrg	        ;;
70161b12faf6Smrg	      esac
70171b12faf6Smrg	    done
70181b12faf6Smrg	    ;;
70191b12faf6Smrg          esac
702032b578d3Smrg
70211b12faf6Smrg          exp_sym_flag='-bexport'
70221b12faf6Smrg          no_entry_flag='-bnoentry'
70231b12faf6Smrg        fi
702432b578d3Smrg
70251b12faf6Smrg        # When large executables or shared objects are built, AIX ld can
70261b12faf6Smrg        # have problems creating the table of contents.  If linking a library
70271b12faf6Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
70281b12faf6Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
70291b12faf6Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
70301b12faf6Smrg
70311b12faf6Smrg        _LT_TAGVAR(archive_cmds, $1)=''
70321b12faf6Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
70331b12faf6Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
70341b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
70351b12faf6Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
70361b12faf6Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
70371b12faf6Smrg
70381b12faf6Smrg        if test "$GXX" = yes; then
70391b12faf6Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
70401b12faf6Smrg          # We only want to do this on AIX 4.2 and lower, the check
70411b12faf6Smrg          # below for broken collect2 doesn't work under 4.3+
70421b12faf6Smrg	  collect2name=`${CC} -print-prog-name=collect2`
70431b12faf6Smrg	  if test -f "$collect2name" &&
70441b12faf6Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
70451b12faf6Smrg	  then
70461b12faf6Smrg	    # We have reworked collect2
70471b12faf6Smrg	    :
70481b12faf6Smrg	  else
70491b12faf6Smrg	    # We have old collect2
70501b12faf6Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
70511b12faf6Smrg	    # It fails to find uninstalled libraries when the uninstalled
70521b12faf6Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
70531b12faf6Smrg	    # to unsupported forces relinking
70541b12faf6Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
70551b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
70561b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
70571b12faf6Smrg	  fi
70581b12faf6Smrg          esac
70591b12faf6Smrg          shared_flag='-shared'
70601b12faf6Smrg	  if test "$aix_use_runtimelinking" = yes; then
70611b12faf6Smrg	    shared_flag="$shared_flag "'${wl}-G'
70621b12faf6Smrg	  fi
70631b12faf6Smrg        else
70641b12faf6Smrg          # not using gcc
70651b12faf6Smrg          if test "$host_cpu" = ia64; then
70661b12faf6Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
70671b12faf6Smrg	  # chokes on -Wl,-G. The following line is correct:
70681b12faf6Smrg	  shared_flag='-G'
70691b12faf6Smrg          else
70701b12faf6Smrg	    if test "$aix_use_runtimelinking" = yes; then
70711b12faf6Smrg	      shared_flag='${wl}-G'
70721b12faf6Smrg	    else
70731b12faf6Smrg	      shared_flag='${wl}-bM:SRE'
70741b12faf6Smrg	    fi
70751b12faf6Smrg          fi
70761b12faf6Smrg        fi
707732b578d3Smrg
70781b12faf6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
70791b12faf6Smrg        # It seems that -bexpall does not export symbols beginning with
70801b12faf6Smrg        # underscore (_), so it is better to generate a list of symbols to
70811b12faf6Smrg	# export.
70821b12faf6Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
70831b12faf6Smrg        if test "$aix_use_runtimelinking" = yes; then
70841b12faf6Smrg          # Warning - without using the other runtime loading flags (-brtl),
70851b12faf6Smrg          # -berok will link without error, but may produce a broken library.
70861b12faf6Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
70871b12faf6Smrg          # Determine the default libpath from the value encoded in an empty
70881b12faf6Smrg          # executable.
7089e35d4d8eSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
70901b12faf6Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
70911b12faf6Smrg
7092e35d4d8eSmrg          _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"
70931b12faf6Smrg        else
70941b12faf6Smrg          if test "$host_cpu" = ia64; then
70951b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
70961b12faf6Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
70971b12faf6Smrg	    _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"
70981b12faf6Smrg          else
70991b12faf6Smrg	    # Determine the default libpath from the value encoded in an
71001b12faf6Smrg	    # empty executable.
7101e35d4d8eSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
71021b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
71031b12faf6Smrg	    # Warning - without using the other run time loading flags,
71041b12faf6Smrg	    # -berok will link without error, but may produce a broken library.
71051b12faf6Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
71061b12faf6Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7107e35d4d8eSmrg	    if test "$with_gnu_ld" = yes; then
7108e35d4d8eSmrg	      # We only use this code for GNU lds that support --whole-archive.
7109e35d4d8eSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7110e35d4d8eSmrg	    else
7111e35d4d8eSmrg	      # Exported symbols can be pulled into shared objects from archives
7112e35d4d8eSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7113e35d4d8eSmrg	    fi
71141b12faf6Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
71151b12faf6Smrg	    # This is similar to how AIX traditionally builds its shared
71161b12faf6Smrg	    # libraries.
71171b12faf6Smrg	    _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'
71181b12faf6Smrg          fi
71191b12faf6Smrg        fi
71201b12faf6Smrg        ;;
712132b578d3Smrg
71221b12faf6Smrg      beos*)
71231b12faf6Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
71241b12faf6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
71251b12faf6Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
71261b12faf6Smrg	  # support --undefined.  This deserves some investigation.  FIXME
71271b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
71281b12faf6Smrg	else
71291b12faf6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71301b12faf6Smrg	fi
71311b12faf6Smrg	;;
713232b578d3Smrg
71331b12faf6Smrg      chorus*)
71341b12faf6Smrg        case $cc_basename in
71351b12faf6Smrg          *)
71361b12faf6Smrg	  # FIXME: insert proper C++ library support
71371b12faf6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71381b12faf6Smrg	  ;;
71391b12faf6Smrg        esac
71401b12faf6Smrg        ;;
714132b578d3Smrg
71421b12faf6Smrg      cygwin* | mingw* | pw32* | cegcc*)
7143e35d4d8eSmrg	case $GXX,$cc_basename in
7144e35d4d8eSmrg	,cl* | no,cl*)
7145e35d4d8eSmrg	  # Native MSVC
7146e35d4d8eSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7147e35d4d8eSmrg	  # no search path for DLLs.
7148e35d4d8eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7149e35d4d8eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7150e35d4d8eSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
7151e35d4d8eSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
7152e35d4d8eSmrg	  # Tell ltmain to make .lib files, not .a files.
7153e35d4d8eSmrg	  libext=lib
7154e35d4d8eSmrg	  # Tell ltmain to make .dll files, not .so files.
7155e35d4d8eSmrg	  shrext_cmds=".dll"
7156e35d4d8eSmrg	  # FIXME: Setting linknames here is a bad hack.
7157e35d4d8eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7158e35d4d8eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7159e35d4d8eSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7160e35d4d8eSmrg	    else
7161e35d4d8eSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7162e35d4d8eSmrg	    fi~
7163e35d4d8eSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7164e35d4d8eSmrg	    linknames='
7165e35d4d8eSmrg	  # The linker will not automatically build a static lib if we build a DLL.
7166e35d4d8eSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7167e35d4d8eSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7168e35d4d8eSmrg	  # Don't use ranlib
7169e35d4d8eSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7170e35d4d8eSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7171e35d4d8eSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7172e35d4d8eSmrg	    case $lt_outputfile in
7173e35d4d8eSmrg	      *.exe|*.EXE) ;;
7174e35d4d8eSmrg	      *)
7175e35d4d8eSmrg		lt_outputfile="$lt_outputfile.exe"
7176e35d4d8eSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
7177e35d4d8eSmrg		;;
7178e35d4d8eSmrg	    esac~
7179e35d4d8eSmrg	    func_to_tool_file "$lt_outputfile"~
7180e35d4d8eSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7181e35d4d8eSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7182e35d4d8eSmrg	      $RM "$lt_outputfile.manifest";
7183e35d4d8eSmrg	    fi'
7184e35d4d8eSmrg	  ;;
7185e35d4d8eSmrg	*)
7186e35d4d8eSmrg	  # g++
7187e35d4d8eSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7188e35d4d8eSmrg	  # as there is no search path for DLLs.
7189e35d4d8eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7190e35d4d8eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7191e35d4d8eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7192e35d4d8eSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
7193e35d4d8eSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7194e35d4d8eSmrg
7195e35d4d8eSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7196e35d4d8eSmrg	    _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'
7197e35d4d8eSmrg	    # If the export-symbols file already is a .def file (1st line
7198e35d4d8eSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
7199e35d4d8eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7200e35d4d8eSmrg	      cp $export_symbols $output_objdir/$soname.def;
7201e35d4d8eSmrg	    else
7202e35d4d8eSmrg	      echo EXPORTS > $output_objdir/$soname.def;
7203e35d4d8eSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
7204e35d4d8eSmrg	    fi~
7205e35d4d8eSmrg	    $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'
7206e35d4d8eSmrg	  else
7207e35d4d8eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7208e35d4d8eSmrg	  fi
7209e35d4d8eSmrg	  ;;
7210e35d4d8eSmrg	esac
7211e35d4d8eSmrg	;;
72121b12faf6Smrg      darwin* | rhapsody*)
72131b12faf6Smrg        _LT_DARWIN_LINKER_FEATURES($1)
72141b12faf6Smrg	;;
721532b578d3Smrg
72161b12faf6Smrg      dgux*)
72171b12faf6Smrg        case $cc_basename in
72181b12faf6Smrg          ec++*)
72191b12faf6Smrg	    # FIXME: insert proper C++ library support
72201b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72211b12faf6Smrg	    ;;
72221b12faf6Smrg          ghcx*)
72231b12faf6Smrg	    # Green Hills C++ Compiler
72241b12faf6Smrg	    # FIXME: insert proper C++ library support
72251b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72261b12faf6Smrg	    ;;
72271b12faf6Smrg          *)
72281b12faf6Smrg	    # FIXME: insert proper C++ library support
72291b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72301b12faf6Smrg	    ;;
72311b12faf6Smrg        esac
72321b12faf6Smrg        ;;
723332b578d3Smrg
7234e35d4d8eSmrg      freebsd2.*)
72351b12faf6Smrg        # C++ shared libraries reported to be fairly broken before
72361b12faf6Smrg	# switch to ELF
72371b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
72381b12faf6Smrg        ;;
723932b578d3Smrg
72401b12faf6Smrg      freebsd-elf*)
72411b12faf6Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
72421b12faf6Smrg        ;;
724332b578d3Smrg
72441b12faf6Smrg      freebsd* | dragonfly*)
72451b12faf6Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
72461b12faf6Smrg        # conventions
72471b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
72481b12faf6Smrg        ;;
724932b578d3Smrg
72501b12faf6Smrg      gnu*)
72511b12faf6Smrg        ;;
725232b578d3Smrg
7253e35d4d8eSmrg      haiku*)
7254e35d4d8eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7255e35d4d8eSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
7256e35d4d8eSmrg        ;;
7257e35d4d8eSmrg
72581b12faf6Smrg      hpux9*)
72591b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
72601b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72611b12faf6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
72621b12faf6Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
72631b12faf6Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
72641b12faf6Smrg				             # but as the default
72651b12faf6Smrg				             # location of the library.
72661b12faf6Smrg
72671b12faf6Smrg        case $cc_basename in
72681b12faf6Smrg          CC*)
72691b12faf6Smrg            # FIXME: insert proper C++ library support
72701b12faf6Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
72711b12faf6Smrg            ;;
72721b12faf6Smrg          aCC*)
72731b12faf6Smrg            _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'
72741b12faf6Smrg            # Commands to make compiler produce verbose output that lists
72751b12faf6Smrg            # what "hidden" libraries, object files and flags are used when
72761b12faf6Smrg            # linking a shared library.
72771b12faf6Smrg            #
72781b12faf6Smrg            # There doesn't appear to be a way to prevent this compiler from
72791b12faf6Smrg            # explicitly linking system object files so we need to strip them
72801b12faf6Smrg            # from the output so that they don't get included in the library
72811b12faf6Smrg            # dependencies.
7282e35d4d8eSmrg            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"'
72831b12faf6Smrg            ;;
72841b12faf6Smrg          *)
72851b12faf6Smrg            if test "$GXX" = yes; then
7286e35d4d8eSmrg              _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'
72871b12faf6Smrg            else
72881b12faf6Smrg              # FIXME: insert proper C++ library support
72891b12faf6Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
72901b12faf6Smrg            fi
72911b12faf6Smrg            ;;
72921b12faf6Smrg        esac
72931b12faf6Smrg        ;;
729432b578d3Smrg
72951b12faf6Smrg      hpux10*|hpux11*)
72961b12faf6Smrg        if test $with_gnu_ld = no; then
72971b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
72981b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72991b12faf6Smrg
73001b12faf6Smrg          case $host_cpu in
73011b12faf6Smrg            hppa*64*|ia64*)
73021b12faf6Smrg              ;;
73031b12faf6Smrg            *)
73041b12faf6Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73051b12faf6Smrg              ;;
73061b12faf6Smrg          esac
73071b12faf6Smrg        fi
73081b12faf6Smrg        case $host_cpu in
73091b12faf6Smrg          hppa*64*|ia64*)
73101b12faf6Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
73111b12faf6Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73121b12faf6Smrg            ;;
73131b12faf6Smrg          *)
73141b12faf6Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
73151b12faf6Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
73161b12faf6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
73171b12faf6Smrg					         # but as the default
73181b12faf6Smrg					         # location of the library.
73191b12faf6Smrg            ;;
73201b12faf6Smrg        esac
73211b12faf6Smrg
73221b12faf6Smrg        case $cc_basename in
73231b12faf6Smrg          CC*)
73241b12faf6Smrg	    # FIXME: insert proper C++ library support
73251b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73261b12faf6Smrg	    ;;
73271b12faf6Smrg          aCC*)
73281b12faf6Smrg	    case $host_cpu in
73291b12faf6Smrg	      hppa*64*)
73301b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73311b12faf6Smrg	        ;;
73321b12faf6Smrg	      ia64*)
73331b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73341b12faf6Smrg	        ;;
73351b12faf6Smrg	      *)
73361b12faf6Smrg	        _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'
73371b12faf6Smrg	        ;;
73381b12faf6Smrg	    esac
73391b12faf6Smrg	    # Commands to make compiler produce verbose output that lists
73401b12faf6Smrg	    # what "hidden" libraries, object files and flags are used when
73411b12faf6Smrg	    # linking a shared library.
73421b12faf6Smrg	    #
73431b12faf6Smrg	    # There doesn't appear to be a way to prevent this compiler from
73441b12faf6Smrg	    # explicitly linking system object files so we need to strip them
73451b12faf6Smrg	    # from the output so that they don't get included in the library
73461b12faf6Smrg	    # dependencies.
7347e35d4d8eSmrg	    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"'
73481b12faf6Smrg	    ;;
73491b12faf6Smrg          *)
73501b12faf6Smrg	    if test "$GXX" = yes; then
73511b12faf6Smrg	      if test $with_gnu_ld = no; then
73521b12faf6Smrg	        case $host_cpu in
73531b12faf6Smrg	          hppa*64*)
73541b12faf6Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73551b12faf6Smrg	            ;;
73561b12faf6Smrg	          ia64*)
7357e35d4d8eSmrg	            _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'
73581b12faf6Smrg	            ;;
73591b12faf6Smrg	          *)
7360e35d4d8eSmrg	            _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'
73611b12faf6Smrg	            ;;
73621b12faf6Smrg	        esac
73631b12faf6Smrg	      fi
73641b12faf6Smrg	    else
73651b12faf6Smrg	      # FIXME: insert proper C++ library support
73661b12faf6Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
73671b12faf6Smrg	    fi
73681b12faf6Smrg	    ;;
73691b12faf6Smrg        esac
73701b12faf6Smrg        ;;
737132b578d3Smrg
73721b12faf6Smrg      interix[[3-9]]*)
73731b12faf6Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
73741b12faf6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73751b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
73761b12faf6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73771b12faf6Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
73781b12faf6Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
73791b12faf6Smrg	# default) and relocated if they conflict, which is a slow very memory
73801b12faf6Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
73811b12faf6Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
73821b12faf6Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
73831b12faf6Smrg	_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'
73841b12faf6Smrg	_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'
73851b12faf6Smrg	;;
73861b12faf6Smrg      irix5* | irix6*)
73871b12faf6Smrg        case $cc_basename in
73881b12faf6Smrg          CC*)
73891b12faf6Smrg	    # SGI C++
7390e35d4d8eSmrg	    _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'
73911b12faf6Smrg
73921b12faf6Smrg	    # Archives containing C++ object files must be created using
73931b12faf6Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
73941b12faf6Smrg	    # necessary to make sure instantiated templates are included
73951b12faf6Smrg	    # in the archive.
73961b12faf6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
73971b12faf6Smrg	    ;;
73981b12faf6Smrg          *)
73991b12faf6Smrg	    if test "$GXX" = yes; then
74001b12faf6Smrg	      if test "$with_gnu_ld" = no; then
7401e35d4d8eSmrg	        _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'
74021b12faf6Smrg	      else
7403e35d4d8eSmrg	        _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'
74041b12faf6Smrg	      fi
74051b12faf6Smrg	    fi
74061b12faf6Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
74071b12faf6Smrg	    ;;
74081b12faf6Smrg        esac
74091b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
74101b12faf6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
74111b12faf6Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
74121b12faf6Smrg        ;;
741332b578d3Smrg
74141b12faf6Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
74151b12faf6Smrg        case $cc_basename in
74161b12faf6Smrg          KCC*)
74171b12faf6Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
741832b578d3Smrg
74191b12faf6Smrg	    # KCC will only create a shared library if the output file
74201b12faf6Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
74211b12faf6Smrg	    # to its proper name (with version) after linking.
74221b12faf6Smrg	    _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'
74231b12faf6Smrg	    _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'
74241b12faf6Smrg	    # Commands to make compiler produce verbose output that lists
74251b12faf6Smrg	    # what "hidden" libraries, object files and flags are used when
74261b12faf6Smrg	    # linking a shared library.
74271b12faf6Smrg	    #
74281b12faf6Smrg	    # There doesn't appear to be a way to prevent this compiler from
74291b12faf6Smrg	    # explicitly linking system object files so we need to strip them
74301b12faf6Smrg	    # from the output so that they don't get included in the library
74311b12faf6Smrg	    # dependencies.
7432e35d4d8eSmrg	    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"'
74331b12faf6Smrg
74341b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
74351b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
74361b12faf6Smrg
74371b12faf6Smrg	    # Archives containing C++ object files must be created using
74381b12faf6Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
74391b12faf6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
74401b12faf6Smrg	    ;;
74411b12faf6Smrg	  icpc* | ecpc* )
74421b12faf6Smrg	    # Intel C++
74431b12faf6Smrg	    with_gnu_ld=yes
74441b12faf6Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
74451b12faf6Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
74461b12faf6Smrg	    # earlier do not add the objects themselves.
74471b12faf6Smrg	    case `$CC -V 2>&1` in
74481b12faf6Smrg	      *"Version 7."*)
74491b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
74501b12faf6Smrg		_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'
74511b12faf6Smrg		;;
74521b12faf6Smrg	      *)  # Version 8.0 or newer
74531b12faf6Smrg	        tmp_idyn=
74541b12faf6Smrg	        case $host_cpu in
74551b12faf6Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
74561b12faf6Smrg		esac
74571b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
74581b12faf6Smrg		_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'
74591b12faf6Smrg		;;
74601b12faf6Smrg	    esac
74611b12faf6Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
74621b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
74631b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
74641b12faf6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
74651b12faf6Smrg	    ;;
74661b12faf6Smrg          pgCC* | pgcpp*)
74671b12faf6Smrg            # Portland Group C++ compiler
74681b12faf6Smrg	    case `$CC -V` in
7469e35d4d8eSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
74701b12faf6Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
74711b12faf6Smrg		rm -rf $tpldir~
74721b12faf6Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7473e35d4d8eSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
74741b12faf6Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
74751b12faf6Smrg		rm -rf $tpldir~
74761b12faf6Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7477e35d4d8eSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
74781b12faf6Smrg		$RANLIB $oldlib'
74791b12faf6Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
74801b12faf6Smrg		rm -rf $tpldir~
74811b12faf6Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7482e35d4d8eSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
74831b12faf6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
74841b12faf6Smrg		rm -rf $tpldir~
74851b12faf6Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7486e35d4d8eSmrg		$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'
74871b12faf6Smrg	      ;;
7488e35d4d8eSmrg	    *) # Version 6 and above use weak symbols
74891b12faf6Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
74901b12faf6Smrg	      _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'
74911b12faf6Smrg	      ;;
74921b12faf6Smrg	    esac
749332b578d3Smrg
74941b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
74951b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7496e35d4d8eSmrg	    _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'
74971b12faf6Smrg            ;;
74981b12faf6Smrg	  cxx*)
74991b12faf6Smrg	    # Compaq C++
75001b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
75011b12faf6Smrg	    _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'
750232b578d3Smrg
75031b12faf6Smrg	    runpath_var=LD_RUN_PATH
75041b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
75051b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
750632b578d3Smrg
75071b12faf6Smrg	    # Commands to make compiler produce verbose output that lists
75081b12faf6Smrg	    # what "hidden" libraries, object files and flags are used when
75091b12faf6Smrg	    # linking a shared library.
75101b12faf6Smrg	    #
75111b12faf6Smrg	    # There doesn't appear to be a way to prevent this compiler from
75121b12faf6Smrg	    # explicitly linking system object files so we need to strip them
75131b12faf6Smrg	    # from the output so that they don't get included in the library
75141b12faf6Smrg	    # dependencies.
7515e35d4d8eSmrg	    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'
75161b12faf6Smrg	    ;;
7517e35d4d8eSmrg	  xl* | mpixl* | bgxl*)
75181b12faf6Smrg	    # IBM XL 8.0 on PPC, with GNU ld
75191b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
75201b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75211b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
75221b12faf6Smrg	    if test "x$supports_anon_versioning" = xyes; then
75231b12faf6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
75241b12faf6Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
75251b12faf6Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
75261b12faf6Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
75271b12faf6Smrg	    fi
75281b12faf6Smrg	    ;;
75291b12faf6Smrg	  *)
75301b12faf6Smrg	    case `$CC -V 2>&1 | sed 5q` in
75311b12faf6Smrg	    *Sun\ C*)
75321b12faf6Smrg	      # Sun C++ 5.9
75331b12faf6Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
75341b12faf6Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
75351b12faf6Smrg	      _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'
75361b12faf6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7537e35d4d8eSmrg	      _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'
75381b12faf6Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
75391b12faf6Smrg
75401b12faf6Smrg	      # Not sure whether something based on
75411b12faf6Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
75421b12faf6Smrg	      # would be better.
7543e35d4d8eSmrg	      output_verbose_link_cmd='func_echo_all'
75441b12faf6Smrg
75451b12faf6Smrg	      # Archives containing C++ object files must be created using
75461b12faf6Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
75471b12faf6Smrg	      # necessary to make sure instantiated templates are included
75481b12faf6Smrg	      # in the archive.
75491b12faf6Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
75501b12faf6Smrg	      ;;
75511b12faf6Smrg	    esac
75521b12faf6Smrg	    ;;
75531b12faf6Smrg	esac
75541b12faf6Smrg	;;
755532b578d3Smrg
75561b12faf6Smrg      lynxos*)
75571b12faf6Smrg        # FIXME: insert proper C++ library support
75581b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
75591b12faf6Smrg	;;
756032b578d3Smrg
75611b12faf6Smrg      m88k*)
75621b12faf6Smrg        # FIXME: insert proper C++ library support
75631b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
75641b12faf6Smrg	;;
756532b578d3Smrg
75661b12faf6Smrg      mvs*)
75671b12faf6Smrg        case $cc_basename in
75681b12faf6Smrg          cxx*)
75691b12faf6Smrg	    # FIXME: insert proper C++ library support
75701b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
75711b12faf6Smrg	    ;;
75721b12faf6Smrg	  *)
75731b12faf6Smrg	    # FIXME: insert proper C++ library support
75741b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
75751b12faf6Smrg	    ;;
75761b12faf6Smrg	esac
75771b12faf6Smrg	;;
757832b578d3Smrg
75791b12faf6Smrg      netbsd*)
75801b12faf6Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
75811b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
75821b12faf6Smrg	  wlarc=
75831b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
75841b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
75851b12faf6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
75861b12faf6Smrg	fi
75871b12faf6Smrg	# Workaround some broken pre-1.5 toolchains
75881b12faf6Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
75891b12faf6Smrg	;;
759032b578d3Smrg
75911b12faf6Smrg      *nto* | *qnx*)
75921b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
75931b12faf6Smrg	;;
759432b578d3Smrg
75951b12faf6Smrg      openbsd2*)
75961b12faf6Smrg        # C++ shared libraries are fairly broken
75971b12faf6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
75981b12faf6Smrg	;;
759932b578d3Smrg
76001b12faf6Smrg      openbsd*)
76011b12faf6Smrg	if test -f /usr/libexec/ld.so; then
76021b12faf6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
76031b12faf6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
76041b12faf6Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
76051b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
76061b12faf6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
76071b12faf6Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
76081b12faf6Smrg	    _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'
76091b12faf6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
76101b12faf6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
76111b12faf6Smrg	  fi
7612e35d4d8eSmrg	  output_verbose_link_cmd=func_echo_all
76131b12faf6Smrg	else
76141b12faf6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
76151b12faf6Smrg	fi
76161b12faf6Smrg	;;
761732b578d3Smrg
76181b12faf6Smrg      osf3* | osf4* | osf5*)
76191b12faf6Smrg        case $cc_basename in
76201b12faf6Smrg          KCC*)
76211b12faf6Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
76221b12faf6Smrg
76231b12faf6Smrg	    # KCC will only create a shared library if the output file
76241b12faf6Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
76251b12faf6Smrg	    # to its proper name (with version) after linking.
76261b12faf6Smrg	    _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'
76271b12faf6Smrg
76281b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
76291b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
76301b12faf6Smrg
76311b12faf6Smrg	    # Archives containing C++ object files must be created using
76321b12faf6Smrg	    # the KAI C++ compiler.
76331b12faf6Smrg	    case $host in
76341b12faf6Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
76351b12faf6Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
76361b12faf6Smrg	    esac
76371b12faf6Smrg	    ;;
76381b12faf6Smrg          RCC*)
76391b12faf6Smrg	    # Rational C++ 2.4.1
76401b12faf6Smrg	    # FIXME: insert proper C++ library support
76411b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
76421b12faf6Smrg	    ;;
76431b12faf6Smrg          cxx*)
76441b12faf6Smrg	    case $host in
76451b12faf6Smrg	      osf3*)
76461b12faf6Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7647e35d4d8eSmrg	        _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'
76481b12faf6Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
76491b12faf6Smrg		;;
76501b12faf6Smrg	      *)
76511b12faf6Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7652e35d4d8eSmrg	        _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'
76531b12faf6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
76541b12faf6Smrg	          echo "-hidden">> $lib.exp~
7655e35d4d8eSmrg	          $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~
76561b12faf6Smrg	          $RM $lib.exp'
76571b12faf6Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
76581b12faf6Smrg		;;
76591b12faf6Smrg	    esac
766032b578d3Smrg
76611b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
766232b578d3Smrg
76631b12faf6Smrg	    # Commands to make compiler produce verbose output that lists
76641b12faf6Smrg	    # what "hidden" libraries, object files and flags are used when
76651b12faf6Smrg	    # linking a shared library.
76661b12faf6Smrg	    #
76671b12faf6Smrg	    # There doesn't appear to be a way to prevent this compiler from
76681b12faf6Smrg	    # explicitly linking system object files so we need to strip them
76691b12faf6Smrg	    # from the output so that they don't get included in the library
76701b12faf6Smrg	    # dependencies.
7671e35d4d8eSmrg	    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"'
76721b12faf6Smrg	    ;;
76731b12faf6Smrg	  *)
76741b12faf6Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
76751b12faf6Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
76761b12faf6Smrg	      case $host in
76771b12faf6Smrg	        osf3*)
7678e35d4d8eSmrg	          _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'
76791b12faf6Smrg		  ;;
76801b12faf6Smrg	        *)
7681e35d4d8eSmrg	          _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'
76821b12faf6Smrg		  ;;
76831b12faf6Smrg	      esac
76841b12faf6Smrg
76851b12faf6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
76861b12faf6Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
76871b12faf6Smrg
76881b12faf6Smrg	      # Commands to make compiler produce verbose output that lists
76891b12faf6Smrg	      # what "hidden" libraries, object files and flags are used when
76901b12faf6Smrg	      # linking a shared library.
7691e35d4d8eSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
76921b12faf6Smrg
76931b12faf6Smrg	    else
76941b12faf6Smrg	      # FIXME: insert proper C++ library support
76951b12faf6Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
76961b12faf6Smrg	    fi
76971b12faf6Smrg	    ;;
76981b12faf6Smrg        esac
76991b12faf6Smrg        ;;
770032b578d3Smrg
77011b12faf6Smrg      psos*)
77021b12faf6Smrg        # FIXME: insert proper C++ library support
77031b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
77041b12faf6Smrg        ;;
770532b578d3Smrg
77061b12faf6Smrg      sunos4*)
77071b12faf6Smrg        case $cc_basename in
77081b12faf6Smrg          CC*)
77091b12faf6Smrg	    # Sun C++ 4.x
77101b12faf6Smrg	    # FIXME: insert proper C++ library support
77111b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77121b12faf6Smrg	    ;;
77131b12faf6Smrg          lcc*)
77141b12faf6Smrg	    # Lucid
77151b12faf6Smrg	    # FIXME: insert proper C++ library support
77161b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77171b12faf6Smrg	    ;;
77181b12faf6Smrg          *)
77191b12faf6Smrg	    # FIXME: insert proper C++ library support
77201b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77211b12faf6Smrg	    ;;
77221b12faf6Smrg        esac
77231b12faf6Smrg        ;;
772432b578d3Smrg
77251b12faf6Smrg      solaris*)
77261b12faf6Smrg        case $cc_basename in
7727e35d4d8eSmrg          CC* | sunCC*)
77281b12faf6Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
77291b12faf6Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
77301b12faf6Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
77311b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
77321b12faf6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
77331b12faf6Smrg	      $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'
77341b12faf6Smrg
77351b12faf6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
77361b12faf6Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
77371b12faf6Smrg	    case $host_os in
77381b12faf6Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
77391b12faf6Smrg	      *)
77401b12faf6Smrg		# The compiler driver will combine and reorder linker options,
77411b12faf6Smrg		# but understands `-z linker_flag'.
77421b12faf6Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
77431b12faf6Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
77441b12faf6Smrg	        ;;
77451b12faf6Smrg	    esac
77461b12faf6Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
774732b578d3Smrg
7748e35d4d8eSmrg	    output_verbose_link_cmd='func_echo_all'
774932b578d3Smrg
77501b12faf6Smrg	    # Archives containing C++ object files must be created using
77511b12faf6Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
77521b12faf6Smrg	    # necessary to make sure instantiated templates are included
77531b12faf6Smrg	    # in the archive.
77541b12faf6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
77551b12faf6Smrg	    ;;
77561b12faf6Smrg          gcx*)
77571b12faf6Smrg	    # Green Hills C++ Compiler
77581b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
775932b578d3Smrg
77601b12faf6Smrg	    # The C++ compiler must be used to create the archive.
77611b12faf6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
77621b12faf6Smrg	    ;;
77631b12faf6Smrg          *)
77641b12faf6Smrg	    # GNU C++ compiler with Solaris linker
77651b12faf6Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
77661b12faf6Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
77671b12faf6Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7768e35d4d8eSmrg	        _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'
77691b12faf6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7770e35d4d8eSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
77711b12faf6Smrg
77721b12faf6Smrg	        # Commands to make compiler produce verbose output that lists
77731b12faf6Smrg	        # what "hidden" libraries, object files and flags are used when
77741b12faf6Smrg	        # linking a shared library.
7775e35d4d8eSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
77761b12faf6Smrg	      else
77771b12faf6Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
77781b12faf6Smrg	        # platform.
77791b12faf6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
77801b12faf6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
77811b12faf6Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
77821b12faf6Smrg
77831b12faf6Smrg	        # Commands to make compiler produce verbose output that lists
77841b12faf6Smrg	        # what "hidden" libraries, object files and flags are used when
77851b12faf6Smrg	        # linking a shared library.
7786e35d4d8eSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
77871b12faf6Smrg	      fi
77881b12faf6Smrg
77891b12faf6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
77901b12faf6Smrg	      case $host_os in
77911b12faf6Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
77921b12faf6Smrg		*)
77931b12faf6Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
77941b12faf6Smrg		  ;;
77951b12faf6Smrg	      esac
77961b12faf6Smrg	    fi
77971b12faf6Smrg	    ;;
77981b12faf6Smrg        esac
77991b12faf6Smrg        ;;
780032b578d3Smrg
78011b12faf6Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
78021b12faf6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
78031b12faf6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
78041b12faf6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
78051b12faf6Smrg      runpath_var='LD_RUN_PATH'
7806d31dbc53Smrg
78071b12faf6Smrg      case $cc_basename in
78081b12faf6Smrg        CC*)
78091b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78101b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78111b12faf6Smrg	  ;;
78121b12faf6Smrg	*)
78131b12faf6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78141b12faf6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78151b12faf6Smrg	  ;;
78161b12faf6Smrg      esac
78171b12faf6Smrg      ;;
7818d31dbc53Smrg
78191b12faf6Smrg      sysv5* | sco3.2v5* | sco5v6*)
78201b12faf6Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
78211b12faf6Smrg	# link with -lc, and that would cause any symbols used from libc to
78221b12faf6Smrg	# always be unresolved, which means just about no library would
78231b12faf6Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
78241b12faf6Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
78251b12faf6Smrg	# as -z defs.
78261b12faf6Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
78271b12faf6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
78281b12faf6Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78291b12faf6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
78301b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
78311b12faf6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
78321b12faf6Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
78331b12faf6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
78341b12faf6Smrg	runpath_var='LD_RUN_PATH'
7835d31dbc53Smrg
78361b12faf6Smrg	case $cc_basename in
78371b12faf6Smrg          CC*)
78381b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78391b12faf6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7840e35d4d8eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7841e35d4d8eSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7842e35d4d8eSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7843e35d4d8eSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
78441b12faf6Smrg	    ;;
78451b12faf6Smrg	  *)
78461b12faf6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78471b12faf6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78481b12faf6Smrg	    ;;
78491b12faf6Smrg	esac
78501b12faf6Smrg      ;;
7851d31dbc53Smrg
78521b12faf6Smrg      tandem*)
78531b12faf6Smrg        case $cc_basename in
78541b12faf6Smrg          NCC*)
78551b12faf6Smrg	    # NonStop-UX NCC 3.20
78561b12faf6Smrg	    # FIXME: insert proper C++ library support
78571b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78581b12faf6Smrg	    ;;
78591b12faf6Smrg          *)
78601b12faf6Smrg	    # FIXME: insert proper C++ library support
78611b12faf6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78621b12faf6Smrg	    ;;
78631b12faf6Smrg        esac
78641b12faf6Smrg        ;;
7865d31dbc53Smrg
78661b12faf6Smrg      vxworks*)
78671b12faf6Smrg        # FIXME: insert proper C++ library support
78681b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
78691b12faf6Smrg        ;;
7870d31dbc53Smrg
78711b12faf6Smrg      *)
78721b12faf6Smrg        # FIXME: insert proper C++ library support
78731b12faf6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
78741b12faf6Smrg        ;;
78751b12faf6Smrg    esac
7876d31dbc53Smrg
78771b12faf6Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
78781b12faf6Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
78791b12faf6Smrg
78801b12faf6Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
78811b12faf6Smrg    _LT_TAGVAR(LD, $1)="$LD"
78821b12faf6Smrg
78831b12faf6Smrg    ## CAVEAT EMPTOR:
78841b12faf6Smrg    ## There is no encapsulation within the following macros, do not change
78851b12faf6Smrg    ## the running order or otherwise move them around unless you know exactly
78861b12faf6Smrg    ## what you are doing...
78871b12faf6Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
78881b12faf6Smrg    _LT_COMPILER_PIC($1)
78891b12faf6Smrg    _LT_COMPILER_C_O($1)
78901b12faf6Smrg    _LT_COMPILER_FILE_LOCKS($1)
78911b12faf6Smrg    _LT_LINKER_SHLIBS($1)
78921b12faf6Smrg    _LT_SYS_DYNAMIC_LINKER($1)
78931b12faf6Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
78941b12faf6Smrg
78951b12faf6Smrg    _LT_CONFIG($1)
78961b12faf6Smrg  fi # test -n "$compiler"
78971b12faf6Smrg
78981b12faf6Smrg  CC=$lt_save_CC
7899e35d4d8eSmrg  CFLAGS=$lt_save_CFLAGS
79001b12faf6Smrg  LDCXX=$LD
79011b12faf6Smrg  LD=$lt_save_LD
79021b12faf6Smrg  GCC=$lt_save_GCC
79031b12faf6Smrg  with_gnu_ld=$lt_save_with_gnu_ld
79041b12faf6Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
79051b12faf6Smrg  lt_cv_path_LD=$lt_save_path_LD
79061b12faf6Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
79071b12faf6Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
79081b12faf6Smrgfi # test "$_lt_caught_CXX_error" != yes
7909d31dbc53Smrg
79101b12faf6SmrgAC_LANG_POP
79111b12faf6Smrg])# _LT_LANG_CXX_CONFIG
7912d31dbc53Smrg
7913d31dbc53Smrg
7914e35d4d8eSmrg# _LT_FUNC_STRIPNAME_CNF
7915e35d4d8eSmrg# ----------------------
7916e35d4d8eSmrg# func_stripname_cnf prefix suffix name
7917e35d4d8eSmrg# strip PREFIX and SUFFIX off of NAME.
7918e35d4d8eSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7919e35d4d8eSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7920e35d4d8eSmrg# dot (in which case that matches only a dot).
7921e35d4d8eSmrg#
7922e35d4d8eSmrg# This function is identical to the (non-XSI) version of func_stripname,
7923e35d4d8eSmrg# except this one can be used by m4 code that may be executed by configure,
7924e35d4d8eSmrg# rather than the libtool script.
7925e35d4d8eSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7926e35d4d8eSmrgAC_REQUIRE([_LT_DECL_SED])
7927e35d4d8eSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7928e35d4d8eSmrgfunc_stripname_cnf ()
7929e35d4d8eSmrg{
7930e35d4d8eSmrg  case ${2} in
7931e35d4d8eSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7932e35d4d8eSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7933e35d4d8eSmrg  esac
7934e35d4d8eSmrg} # func_stripname_cnf
7935e35d4d8eSmrg])# _LT_FUNC_STRIPNAME_CNF
7936e35d4d8eSmrg
79371b12faf6Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
79381b12faf6Smrg# ---------------------------------
79391b12faf6Smrg# Figure out "hidden" library dependencies from verbose
79401b12faf6Smrg# compiler output when linking a shared library.
79411b12faf6Smrg# Parse the compiler output and extract the necessary
79421b12faf6Smrg# objects, libraries and library flags.
79431b12faf6Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
79441b12faf6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7945e35d4d8eSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
79461b12faf6Smrg# Dependencies to place before and after the object being linked:
79471b12faf6Smrg_LT_TAGVAR(predep_objects, $1)=
79481b12faf6Smrg_LT_TAGVAR(postdep_objects, $1)=
79491b12faf6Smrg_LT_TAGVAR(predeps, $1)=
79501b12faf6Smrg_LT_TAGVAR(postdeps, $1)=
79511b12faf6Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7952d31dbc53Smrg
79531b12faf6Smrgdnl we can't use the lt_simple_compile_test_code here,
79541b12faf6Smrgdnl because it contains code intended for an executable,
79551b12faf6Smrgdnl not a library.  It's possible we should let each
79561b12faf6Smrgdnl tag define a new lt_????_link_test_code variable,
79571b12faf6Smrgdnl but it's only used here...
79581b12faf6Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
79591b12faf6Smrgint a;
79601b12faf6Smrgvoid foo (void) { a = 0; }
79611b12faf6Smrg_LT_EOF
79621b12faf6Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
79631b12faf6Smrgclass Foo
79641b12faf6Smrg{
79651b12faf6Smrgpublic:
79661b12faf6Smrg  Foo (void) { a = 0; }
79671b12faf6Smrgprivate:
79681b12faf6Smrg  int a;
79691b12faf6Smrg};
79701b12faf6Smrg_LT_EOF
79711b12faf6Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
79721b12faf6Smrg      subroutine foo
79731b12faf6Smrg      implicit none
79741b12faf6Smrg      integer*4 a
79751b12faf6Smrg      a=0
79761b12faf6Smrg      return
79771b12faf6Smrg      end
79781b12faf6Smrg_LT_EOF
79791b12faf6Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
79801b12faf6Smrg      subroutine foo
79811b12faf6Smrg      implicit none
79821b12faf6Smrg      integer a
79831b12faf6Smrg      a=0
79841b12faf6Smrg      return
79851b12faf6Smrg      end
79861b12faf6Smrg_LT_EOF
79871b12faf6Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
79881b12faf6Smrgpublic class foo {
79891b12faf6Smrg  private int a;
79901b12faf6Smrg  public void bar (void) {
79911b12faf6Smrg    a = 0;
79921b12faf6Smrg  }
79931b12faf6Smrg};
79941b12faf6Smrg_LT_EOF
7995e35d4d8eSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7996e35d4d8eSmrgpackage foo
7997e35d4d8eSmrgfunc foo() {
7998e35d4d8eSmrg}
7999e35d4d8eSmrg_LT_EOF
80002a51b5beSmrg])
8001e35d4d8eSmrg
8002e35d4d8eSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
8003e35d4d8eSmrgcase "$CC $CFLAGS " in #(
8004e35d4d8eSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8005e35d4d8eSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8006e35d4d8eSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8007e35d4d8eSmrgesac
8008e35d4d8eSmrg
80091b12faf6Smrgdnl Parse the compiler output and extract the necessary
80101b12faf6Smrgdnl objects, libraries and library flags.
80111b12faf6Smrgif AC_TRY_EVAL(ac_compile); then
80121b12faf6Smrg  # Parse the compiler output and extract the necessary
80131b12faf6Smrg  # objects, libraries and library flags.
8014d31dbc53Smrg
80151b12faf6Smrg  # Sentinel used to keep track of whether or not we are before
80161b12faf6Smrg  # the conftest object file.
80171b12faf6Smrg  pre_test_object_deps_done=no
8018d31dbc53Smrg
80191b12faf6Smrg  for p in `eval "$output_verbose_link_cmd"`; do
8020e35d4d8eSmrg    case ${prev}${p} in
8021d31dbc53Smrg
80221b12faf6Smrg    -L* | -R* | -l*)
80231b12faf6Smrg       # Some compilers place space between "-{L,R}" and the path.
80241b12faf6Smrg       # Remove the space.
80251b12faf6Smrg       if test $p = "-L" ||
80261b12faf6Smrg          test $p = "-R"; then
80271b12faf6Smrg	 prev=$p
80281b12faf6Smrg	 continue
80291b12faf6Smrg       fi
8030d31dbc53Smrg
8031e35d4d8eSmrg       # Expand the sysroot to ease extracting the directories later.
8032e35d4d8eSmrg       if test -z "$prev"; then
8033e35d4d8eSmrg         case $p in
8034e35d4d8eSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8035e35d4d8eSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8036e35d4d8eSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8037e35d4d8eSmrg         esac
8038e35d4d8eSmrg       fi
8039e35d4d8eSmrg       case $p in
8040e35d4d8eSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8041e35d4d8eSmrg       esac
80421b12faf6Smrg       if test "$pre_test_object_deps_done" = no; then
8043e35d4d8eSmrg	 case ${prev} in
8044e35d4d8eSmrg	 -L | -R)
80451b12faf6Smrg	   # Internal compiler library paths should come after those
80461b12faf6Smrg	   # provided the user.  The postdeps already come after the
80471b12faf6Smrg	   # user supplied libs so there is no need to process them.
80481b12faf6Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
80491b12faf6Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
80501b12faf6Smrg	   else
80511b12faf6Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
80521b12faf6Smrg	   fi
80531b12faf6Smrg	   ;;
80541b12faf6Smrg	 # The "-l" case would never come before the object being
80551b12faf6Smrg	 # linked, so don't bother handling this case.
80561b12faf6Smrg	 esac
80571b12faf6Smrg       else
80581b12faf6Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
80591b12faf6Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
80601b12faf6Smrg	 else
80611b12faf6Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
80621b12faf6Smrg	 fi
80631b12faf6Smrg       fi
8064e35d4d8eSmrg       prev=
80651b12faf6Smrg       ;;
8066d31dbc53Smrg
8067e35d4d8eSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
80681b12faf6Smrg    *.$objext)
80691b12faf6Smrg       # This assumes that the test object file only shows up
80701b12faf6Smrg       # once in the compiler output.
80711b12faf6Smrg       if test "$p" = "conftest.$objext"; then
80721b12faf6Smrg	 pre_test_object_deps_done=yes
80731b12faf6Smrg	 continue
80741b12faf6Smrg       fi
8075d31dbc53Smrg
80761b12faf6Smrg       if test "$pre_test_object_deps_done" = no; then
80771b12faf6Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
80781b12faf6Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
80791b12faf6Smrg	 else
80801b12faf6Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
80811b12faf6Smrg	 fi
80821b12faf6Smrg       else
80831b12faf6Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
80841b12faf6Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
80851b12faf6Smrg	 else
80861b12faf6Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
80871b12faf6Smrg	 fi
80881b12faf6Smrg       fi
80891b12faf6Smrg       ;;
809032b578d3Smrg
80911b12faf6Smrg    *) ;; # Ignore the rest.
8092d31dbc53Smrg
80931b12faf6Smrg    esac
80941b12faf6Smrg  done
8095d31dbc53Smrg
80961b12faf6Smrg  # Clean up.
80971b12faf6Smrg  rm -f a.out a.exe
80981b12faf6Smrgelse
80991b12faf6Smrg  echo "libtool.m4: error: problem compiling $1 test program"
81001b12faf6Smrgfi
8101d31dbc53Smrg
81021b12faf6Smrg$RM -f confest.$objext
8103e35d4d8eSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
81041b12faf6Smrg
81051b12faf6Smrg# PORTME: override above test on systems where it is broken
81061b12faf6Smrgm4_if([$1], [CXX],
81071b12faf6Smrg[case $host_os in
81081b12faf6Smrginterix[[3-9]]*)
81091b12faf6Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
81101b12faf6Smrg  # hack all around it, let's just trust "g++" to DTRT.
81111b12faf6Smrg  _LT_TAGVAR(predep_objects,$1)=
81121b12faf6Smrg  _LT_TAGVAR(postdep_objects,$1)=
81131b12faf6Smrg  _LT_TAGVAR(postdeps,$1)=
81142a51b5beSmrg  ;;
81151b12faf6Smrg
81161b12faf6Smrglinux*)
81171b12faf6Smrg  case `$CC -V 2>&1 | sed 5q` in
81181b12faf6Smrg  *Sun\ C*)
81191b12faf6Smrg    # Sun C++ 5.9
81201b12faf6Smrg
81211b12faf6Smrg    # The more standards-conforming stlport4 library is
81221b12faf6Smrg    # incompatible with the Cstd library. Avoid specifying
81231b12faf6Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
81241b12faf6Smrg    # -library=stlport4 depends on it.
81251b12faf6Smrg    case " $CXX $CXXFLAGS " in
81261b12faf6Smrg    *" -library=stlport4 "*)
81271b12faf6Smrg      solaris_use_stlport4=yes
81281b12faf6Smrg      ;;
81291b12faf6Smrg    esac
81301b12faf6Smrg
81311b12faf6Smrg    if test "$solaris_use_stlport4" != yes; then
81321b12faf6Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
81331b12faf6Smrg    fi
81341b12faf6Smrg    ;;
81351b12faf6Smrg  esac
81362a51b5beSmrg  ;;
81371b12faf6Smrg
81382a51b5beSmrgsolaris*)
81391b12faf6Smrg  case $cc_basename in
8140e35d4d8eSmrg  CC* | sunCC*)
81411b12faf6Smrg    # The more standards-conforming stlport4 library is
81421b12faf6Smrg    # incompatible with the Cstd library. Avoid specifying
81431b12faf6Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
81441b12faf6Smrg    # -library=stlport4 depends on it.
81451b12faf6Smrg    case " $CXX $CXXFLAGS " in
81461b12faf6Smrg    *" -library=stlport4 "*)
81471b12faf6Smrg      solaris_use_stlport4=yes
81481b12faf6Smrg      ;;
81491b12faf6Smrg    esac
815032b578d3Smrg
8151e35d4d8eSmrg    # Adding this requires a known-good setup of shared libraries for
8152e35d4d8eSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
8153e35d4d8eSmrg    # archive will be linked into the output, leading to subtle bugs.
8154e35d4d8eSmrg    if test "$solaris_use_stlport4" != yes; then
8155e35d4d8eSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8156e35d4d8eSmrg    fi
8157e35d4d8eSmrg    ;;
8158e35d4d8eSmrg  esac
8159e35d4d8eSmrg  ;;
8160e35d4d8eSmrgesac
8161e35d4d8eSmrg])
81621b12faf6Smrg
8163e35d4d8eSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
8164e35d4d8eSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8165e35d4d8eSmrgesac
8166e35d4d8eSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8167e35d4d8eSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8168e35d4d8eSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
81692a51b5beSmrgfi
8170e35d4d8eSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8171e35d4d8eSmrg    [The directories searched by this compiler when creating a shared library])
8172e35d4d8eSmrg_LT_TAGDECL([], [predep_objects], [1],
8173e35d4d8eSmrg    [Dependencies to place before and after the objects being linked to
8174e35d4d8eSmrg    create a shared library])
8175e35d4d8eSmrg_LT_TAGDECL([], [postdep_objects], [1])
8176e35d4d8eSmrg_LT_TAGDECL([], [predeps], [1])
8177e35d4d8eSmrg_LT_TAGDECL([], [postdeps], [1])
8178e35d4d8eSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
8179e35d4d8eSmrg    [The library search path used internally by the compiler when linking
8180e35d4d8eSmrg    a shared library])
8181e35d4d8eSmrg])# _LT_SYS_HIDDEN_LIBDEPS
818232b578d3Smrg
818332b578d3Smrg
8184e35d4d8eSmrg# _LT_LANG_F77_CONFIG([TAG])
8185e35d4d8eSmrg# --------------------------
8186e35d4d8eSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
81871b12faf6Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
81881b12faf6Smrg# to write the compiler configuration to `libtool'.
8189e35d4d8eSmrgm4_defun([_LT_LANG_F77_CONFIG],
8190e35d4d8eSmrg[AC_LANG_PUSH(Fortran 77)
8191e35d4d8eSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
8192e35d4d8eSmrg  _lt_disable_F77=yes
8193e35d4d8eSmrgfi
81941b12faf6Smrg
81951b12faf6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
81961b12faf6Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
81971b12faf6Smrg_LT_TAGVAR(always_export_symbols, $1)=no
81981b12faf6Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
81991b12faf6Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
82001b12faf6Smrg_LT_TAGVAR(hardcode_direct, $1)=no
82011b12faf6Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
82021b12faf6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
82031b12faf6Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
82041b12faf6Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
82051b12faf6Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
82061b12faf6Smrg_LT_TAGVAR(inherit_rpath, $1)=no
82071b12faf6Smrg_LT_TAGVAR(module_cmds, $1)=
82081b12faf6Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
82091b12faf6Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
82101b12faf6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8211e35d4d8eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8212e35d4d8eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
82131b12faf6Smrg_LT_TAGVAR(no_undefined_flag, $1)=
82141b12faf6Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
82151b12faf6Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
82161b12faf6Smrg
8217e35d4d8eSmrg# Source file extension for f77 test sources.
8218e35d4d8eSmrgac_ext=f
82191b12faf6Smrg
8220e35d4d8eSmrg# Object file extension for compiled f77 test sources.
82211b12faf6Smrgobjext=o
82221b12faf6Smrg_LT_TAGVAR(objext, $1)=$objext
82231b12faf6Smrg
82241b12faf6Smrg# No sense in running all these tests if we already determined that
8225e35d4d8eSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
82261b12faf6Smrg# are currently assumed to apply to all compilers on this platform,
82271b12faf6Smrg# and will be corrupted by setting them based on a non-working compiler.
8228e35d4d8eSmrgif test "$_lt_disable_F77" != yes; then
82291b12faf6Smrg  # Code to be used in simple compile tests
82301b12faf6Smrg  lt_simple_compile_test_code="\
82311b12faf6Smrg      subroutine t
82321b12faf6Smrg      return
82331b12faf6Smrg      end
82341b12faf6Smrg"
82351b12faf6Smrg
82361b12faf6Smrg  # Code to be used in simple link tests
82371b12faf6Smrg  lt_simple_link_test_code="\
82381b12faf6Smrg      program t
82391b12faf6Smrg      end
82401b12faf6Smrg"
824132b578d3Smrg
82421b12faf6Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
82431b12faf6Smrg  _LT_TAG_COMPILER
82441b12faf6Smrg
82451b12faf6Smrg  # save warnings/boilerplate of simple test code
82461b12faf6Smrg  _LT_COMPILER_BOILERPLATE
82471b12faf6Smrg  _LT_LINKER_BOILERPLATE
82481b12faf6Smrg
82491b12faf6Smrg  # Allow CC to be a program name with arguments.
82501b12faf6Smrg  lt_save_CC="$CC"
82511b12faf6Smrg  lt_save_GCC=$GCC
8252e35d4d8eSmrg  lt_save_CFLAGS=$CFLAGS
8253e35d4d8eSmrg  CC=${F77-"f77"}
8254e35d4d8eSmrg  CFLAGS=$FFLAGS
82551b12faf6Smrg  compiler=$CC
82561b12faf6Smrg  _LT_TAGVAR(compiler, $1)=$CC
82571b12faf6Smrg  _LT_CC_BASENAME([$compiler])
8258e35d4d8eSmrg  GCC=$G77
82591b12faf6Smrg  if test -n "$compiler"; then
82601b12faf6Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
82611b12faf6Smrg    AC_MSG_RESULT([$can_build_shared])
82621b12faf6Smrg
82631b12faf6Smrg    AC_MSG_CHECKING([whether to build shared libraries])
82641b12faf6Smrg    test "$can_build_shared" = "no" && enable_shared=no
82651b12faf6Smrg
82661b12faf6Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
82671b12faf6Smrg    # are all built from PIC.
82682a51b5beSmrg    case $host_os in
82691b12faf6Smrg      aix3*)
82701b12faf6Smrg        test "$enable_shared" = yes && enable_static=no
82711b12faf6Smrg        if test -n "$RANLIB"; then
82721b12faf6Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
82731b12faf6Smrg          postinstall_cmds='$RANLIB $lib'
82741b12faf6Smrg        fi
82751b12faf6Smrg        ;;
82762a51b5beSmrg      aix[[4-9]]*)
82771b12faf6Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
82781b12faf6Smrg	  test "$enable_shared" = yes && enable_static=no
82792a51b5beSmrg	fi
82801b12faf6Smrg        ;;
82812a51b5beSmrg    esac
82821b12faf6Smrg    AC_MSG_RESULT([$enable_shared])
82831b12faf6Smrg
82841b12faf6Smrg    AC_MSG_CHECKING([whether to build static libraries])
82851b12faf6Smrg    # Make sure either enable_shared or enable_static is yes.
82861b12faf6Smrg    test "$enable_shared" = yes || enable_static=yes
82871b12faf6Smrg    AC_MSG_RESULT([$enable_static])
82881b12faf6Smrg
8289e35d4d8eSmrg    _LT_TAGVAR(GCC, $1)="$G77"
8290e35d4d8eSmrg    _LT_TAGVAR(LD, $1)="$LD"
829132b578d3Smrg
8292e35d4d8eSmrg    ## CAVEAT EMPTOR:
8293e35d4d8eSmrg    ## There is no encapsulation within the following macros, do not change
8294e35d4d8eSmrg    ## the running order or otherwise move them around unless you know exactly
8295e35d4d8eSmrg    ## what you are doing...
8296e35d4d8eSmrg    _LT_COMPILER_PIC($1)
8297e35d4d8eSmrg    _LT_COMPILER_C_O($1)
8298e35d4d8eSmrg    _LT_COMPILER_FILE_LOCKS($1)
8299e35d4d8eSmrg    _LT_LINKER_SHLIBS($1)
8300e35d4d8eSmrg    _LT_SYS_DYNAMIC_LINKER($1)
8301e35d4d8eSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
830232b578d3Smrg
8303e35d4d8eSmrg    _LT_CONFIG($1)
8304e35d4d8eSmrg  fi # test -n "$compiler"
830532b578d3Smrg
8306e35d4d8eSmrg  GCC=$lt_save_GCC
8307e35d4d8eSmrg  CC="$lt_save_CC"
8308e35d4d8eSmrg  CFLAGS="$lt_save_CFLAGS"
8309e35d4d8eSmrgfi # test "$_lt_disable_F77" != yes
831032b578d3Smrg
8311e35d4d8eSmrgAC_LANG_POP
8312e35d4d8eSmrg])# _LT_LANG_F77_CONFIG
831332b578d3Smrg
83141b12faf6Smrg
8315e35d4d8eSmrg# _LT_LANG_FC_CONFIG([TAG])
8316e35d4d8eSmrg# -------------------------
8317e35d4d8eSmrg# Ensure that the configuration variables for a Fortran compiler are
8318e35d4d8eSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
8319e35d4d8eSmrg# to write the compiler configuration to `libtool'.
8320e35d4d8eSmrgm4_defun([_LT_LANG_FC_CONFIG],
8321e35d4d8eSmrg[AC_LANG_PUSH(Fortran)
83221b12faf6Smrg
8323e35d4d8eSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
8324e35d4d8eSmrg  _lt_disable_FC=yes
83251b12faf6Smrgfi
83261b12faf6Smrg
8327e35d4d8eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8328e35d4d8eSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
8329e35d4d8eSmrg_LT_TAGVAR(always_export_symbols, $1)=no
8330e35d4d8eSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8331e35d4d8eSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8332e35d4d8eSmrg_LT_TAGVAR(hardcode_direct, $1)=no
8333e35d4d8eSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8334e35d4d8eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8335e35d4d8eSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8336e35d4d8eSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8337e35d4d8eSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
8338e35d4d8eSmrg_LT_TAGVAR(inherit_rpath, $1)=no
8339e35d4d8eSmrg_LT_TAGVAR(module_cmds, $1)=
8340e35d4d8eSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
8341e35d4d8eSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8342e35d4d8eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8343e35d4d8eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8344e35d4d8eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8345e35d4d8eSmrg_LT_TAGVAR(no_undefined_flag, $1)=
8346e35d4d8eSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8347e35d4d8eSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
834832b578d3Smrg
8349e35d4d8eSmrg# Source file extension for fc test sources.
8350e35d4d8eSmrgac_ext=${ac_fc_srcext-f}
835132b578d3Smrg
8352e35d4d8eSmrg# Object file extension for compiled fc test sources.
8353e35d4d8eSmrgobjext=o
8354e35d4d8eSmrg_LT_TAGVAR(objext, $1)=$objext
835532b578d3Smrg
8356e35d4d8eSmrg# No sense in running all these tests if we already determined that
8357e35d4d8eSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
8358e35d4d8eSmrg# are currently assumed to apply to all compilers on this platform,
8359e35d4d8eSmrg# and will be corrupted by setting them based on a non-working compiler.
8360e35d4d8eSmrgif test "$_lt_disable_FC" != yes; then
8361e35d4d8eSmrg  # Code to be used in simple compile tests
8362e35d4d8eSmrg  lt_simple_compile_test_code="\
8363e35d4d8eSmrg      subroutine t
8364e35d4d8eSmrg      return
8365e35d4d8eSmrg      end
8366e35d4d8eSmrg"
836732b578d3Smrg
8368e35d4d8eSmrg  # Code to be used in simple link tests
8369e35d4d8eSmrg  lt_simple_link_test_code="\
8370e35d4d8eSmrg      program t
8371e35d4d8eSmrg      end
8372e35d4d8eSmrg"
8373d31dbc53Smrg
8374e35d4d8eSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8375e35d4d8eSmrg  _LT_TAG_COMPILER
8376d31dbc53Smrg
8377e35d4d8eSmrg  # save warnings/boilerplate of simple test code
8378e35d4d8eSmrg  _LT_COMPILER_BOILERPLATE
8379e35d4d8eSmrg  _LT_LINKER_BOILERPLATE
8380d31dbc53Smrg
8381e35d4d8eSmrg  # Allow CC to be a program name with arguments.
8382e35d4d8eSmrg  lt_save_CC="$CC"
8383e35d4d8eSmrg  lt_save_GCC=$GCC
8384e35d4d8eSmrg  lt_save_CFLAGS=$CFLAGS
8385e35d4d8eSmrg  CC=${FC-"f95"}
8386e35d4d8eSmrg  CFLAGS=$FCFLAGS
8387e35d4d8eSmrg  compiler=$CC
8388e35d4d8eSmrg  GCC=$ac_cv_fc_compiler_gnu
8389d31dbc53Smrg
8390e35d4d8eSmrg  _LT_TAGVAR(compiler, $1)=$CC
8391e35d4d8eSmrg  _LT_CC_BASENAME([$compiler])
83922a51b5beSmrg
8393e35d4d8eSmrg  if test -n "$compiler"; then
8394e35d4d8eSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8395e35d4d8eSmrg    AC_MSG_RESULT([$can_build_shared])
83962a51b5beSmrg
8397e35d4d8eSmrg    AC_MSG_CHECKING([whether to build shared libraries])
8398e35d4d8eSmrg    test "$can_build_shared" = "no" && enable_shared=no
83992a51b5beSmrg
8400e35d4d8eSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
8401e35d4d8eSmrg    # are all built from PIC.
8402e35d4d8eSmrg    case $host_os in
8403e35d4d8eSmrg      aix3*)
8404e35d4d8eSmrg        test "$enable_shared" = yes && enable_static=no
8405e35d4d8eSmrg        if test -n "$RANLIB"; then
8406e35d4d8eSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8407e35d4d8eSmrg          postinstall_cmds='$RANLIB $lib'
8408e35d4d8eSmrg        fi
8409e35d4d8eSmrg        ;;
8410e35d4d8eSmrg      aix[[4-9]]*)
8411e35d4d8eSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8412e35d4d8eSmrg	  test "$enable_shared" = yes && enable_static=no
8413e35d4d8eSmrg	fi
8414e35d4d8eSmrg        ;;
8415e35d4d8eSmrg    esac
8416e35d4d8eSmrg    AC_MSG_RESULT([$enable_shared])
8417e35d4d8eSmrg
8418e35d4d8eSmrg    AC_MSG_CHECKING([whether to build static libraries])
8419e35d4d8eSmrg    # Make sure either enable_shared or enable_static is yes.
8420e35d4d8eSmrg    test "$enable_shared" = yes || enable_static=yes
8421e35d4d8eSmrg    AC_MSG_RESULT([$enable_static])
8422e35d4d8eSmrg
8423e35d4d8eSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8424e35d4d8eSmrg    _LT_TAGVAR(LD, $1)="$LD"
8425e35d4d8eSmrg
8426e35d4d8eSmrg    ## CAVEAT EMPTOR:
8427e35d4d8eSmrg    ## There is no encapsulation within the following macros, do not change
8428e35d4d8eSmrg    ## the running order or otherwise move them around unless you know exactly
8429e35d4d8eSmrg    ## what you are doing...
8430e35d4d8eSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
8431e35d4d8eSmrg    _LT_COMPILER_PIC($1)
8432e35d4d8eSmrg    _LT_COMPILER_C_O($1)
8433e35d4d8eSmrg    _LT_COMPILER_FILE_LOCKS($1)
8434e35d4d8eSmrg    _LT_LINKER_SHLIBS($1)
8435e35d4d8eSmrg    _LT_SYS_DYNAMIC_LINKER($1)
8436e35d4d8eSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
84371b12faf6Smrg
8438e35d4d8eSmrg    _LT_CONFIG($1)
8439e35d4d8eSmrg  fi # test -n "$compiler"
84402a51b5beSmrg
8441e35d4d8eSmrg  GCC=$lt_save_GCC
8442e35d4d8eSmrg  CC=$lt_save_CC
8443e35d4d8eSmrg  CFLAGS=$lt_save_CFLAGS
8444e35d4d8eSmrgfi # test "$_lt_disable_FC" != yes
8445d31dbc53Smrg
8446e35d4d8eSmrgAC_LANG_POP
8447e35d4d8eSmrg])# _LT_LANG_FC_CONFIG
84481b12faf6Smrg
8449d31dbc53Smrg
8450e35d4d8eSmrg# _LT_LANG_GCJ_CONFIG([TAG])
8451e35d4d8eSmrg# --------------------------
8452e35d4d8eSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
8453e35d4d8eSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8454e35d4d8eSmrg# to write the compiler configuration to `libtool'.
8455e35d4d8eSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
8456e35d4d8eSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
8457e35d4d8eSmrgAC_LANG_SAVE
8458d31dbc53Smrg
8459e35d4d8eSmrg# Source file extension for Java test sources.
8460e35d4d8eSmrgac_ext=java
8461d31dbc53Smrg
8462e35d4d8eSmrg# Object file extension for compiled Java test sources.
8463e35d4d8eSmrgobjext=o
8464e35d4d8eSmrg_LT_TAGVAR(objext, $1)=$objext
8465d31dbc53Smrg
8466e35d4d8eSmrg# Code to be used in simple compile tests
8467e35d4d8eSmrglt_simple_compile_test_code="class foo {}"
8468d31dbc53Smrg
8469e35d4d8eSmrg# Code to be used in simple link tests
8470e35d4d8eSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8471d31dbc53Smrg
8472e35d4d8eSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8473e35d4d8eSmrg_LT_TAG_COMPILER
8474d31dbc53Smrg
8475e35d4d8eSmrg# save warnings/boilerplate of simple test code
8476e35d4d8eSmrg_LT_COMPILER_BOILERPLATE
8477e35d4d8eSmrg_LT_LINKER_BOILERPLATE
8478d31dbc53Smrg
8479e35d4d8eSmrg# Allow CC to be a program name with arguments.
8480e35d4d8eSmrglt_save_CC=$CC
8481e35d4d8eSmrglt_save_CFLAGS=$CFLAGS
8482e35d4d8eSmrglt_save_GCC=$GCC
8483e35d4d8eSmrgGCC=yes
8484e35d4d8eSmrgCC=${GCJ-"gcj"}
8485e35d4d8eSmrgCFLAGS=$GCJFLAGS
8486e35d4d8eSmrgcompiler=$CC
8487e35d4d8eSmrg_LT_TAGVAR(compiler, $1)=$CC
8488e35d4d8eSmrg_LT_TAGVAR(LD, $1)="$LD"
8489e35d4d8eSmrg_LT_CC_BASENAME([$compiler])
8490d31dbc53Smrg
8491e35d4d8eSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
8492e35d4d8eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8493d31dbc53Smrg
8494e35d4d8eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8495e35d4d8eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8496e35d4d8eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8497d31dbc53Smrg
8498e35d4d8eSmrgif test -n "$compiler"; then
8499e35d4d8eSmrg  _LT_COMPILER_NO_RTTI($1)
8500e35d4d8eSmrg  _LT_COMPILER_PIC($1)
8501e35d4d8eSmrg  _LT_COMPILER_C_O($1)
8502e35d4d8eSmrg  _LT_COMPILER_FILE_LOCKS($1)
8503e35d4d8eSmrg  _LT_LINKER_SHLIBS($1)
8504e35d4d8eSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8505d31dbc53Smrg
8506e35d4d8eSmrg  _LT_CONFIG($1)
8507e35d4d8eSmrgfi
8508d31dbc53Smrg
8509e35d4d8eSmrgAC_LANG_RESTORE
8510d31dbc53Smrg
8511e35d4d8eSmrgGCC=$lt_save_GCC
8512e35d4d8eSmrgCC=$lt_save_CC
8513e35d4d8eSmrgCFLAGS=$lt_save_CFLAGS
8514e35d4d8eSmrg])# _LT_LANG_GCJ_CONFIG
8515d31dbc53Smrg
8516d31dbc53Smrg
8517e35d4d8eSmrg# _LT_LANG_GO_CONFIG([TAG])
8518e35d4d8eSmrg# --------------------------
8519e35d4d8eSmrg# Ensure that the configuration variables for the GNU Go compiler
8520e35d4d8eSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8521e35d4d8eSmrg# to write the compiler configuration to `libtool'.
8522e35d4d8eSmrgm4_defun([_LT_LANG_GO_CONFIG],
8523e35d4d8eSmrg[AC_REQUIRE([LT_PROG_GO])dnl
8524e35d4d8eSmrgAC_LANG_SAVE
8525d31dbc53Smrg
8526e35d4d8eSmrg# Source file extension for Go test sources.
8527e35d4d8eSmrgac_ext=go
8528d31dbc53Smrg
8529e35d4d8eSmrg# Object file extension for compiled Go test sources.
8530e35d4d8eSmrgobjext=o
8531e35d4d8eSmrg_LT_TAGVAR(objext, $1)=$objext
85321b12faf6Smrg
8533e35d4d8eSmrg# Code to be used in simple compile tests
8534e35d4d8eSmrglt_simple_compile_test_code="package main; func main() { }"
85351b12faf6Smrg
8536e35d4d8eSmrg# Code to be used in simple link tests
8537e35d4d8eSmrglt_simple_link_test_code='package main; func main() { }'
85381b12faf6Smrg
8539e35d4d8eSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8540e35d4d8eSmrg_LT_TAG_COMPILER
85411b12faf6Smrg
8542e35d4d8eSmrg# save warnings/boilerplate of simple test code
8543e35d4d8eSmrg_LT_COMPILER_BOILERPLATE
8544e35d4d8eSmrg_LT_LINKER_BOILERPLATE
85451b12faf6Smrg
8546e35d4d8eSmrg# Allow CC to be a program name with arguments.
8547e35d4d8eSmrglt_save_CC=$CC
8548e35d4d8eSmrglt_save_CFLAGS=$CFLAGS
8549e35d4d8eSmrglt_save_GCC=$GCC
8550e35d4d8eSmrgGCC=yes
8551e35d4d8eSmrgCC=${GOC-"gccgo"}
8552e35d4d8eSmrgCFLAGS=$GOFLAGS
8553e35d4d8eSmrgcompiler=$CC
8554e35d4d8eSmrg_LT_TAGVAR(compiler, $1)=$CC
8555e35d4d8eSmrg_LT_TAGVAR(LD, $1)="$LD"
8556e35d4d8eSmrg_LT_CC_BASENAME([$compiler])
85571b12faf6Smrg
8558e35d4d8eSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
8559e35d4d8eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
85601b12faf6Smrg
8561e35d4d8eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8562e35d4d8eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8563e35d4d8eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
85641b12faf6Smrg
8565e35d4d8eSmrgif test -n "$compiler"; then
8566e35d4d8eSmrg  _LT_COMPILER_NO_RTTI($1)
8567e35d4d8eSmrg  _LT_COMPILER_PIC($1)
8568e35d4d8eSmrg  _LT_COMPILER_C_O($1)
8569e35d4d8eSmrg  _LT_COMPILER_FILE_LOCKS($1)
8570e35d4d8eSmrg  _LT_LINKER_SHLIBS($1)
8571e35d4d8eSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
85721b12faf6Smrg
8573e35d4d8eSmrg  _LT_CONFIG($1)
8574e35d4d8eSmrgfi
85751b12faf6Smrg
8576e35d4d8eSmrgAC_LANG_RESTORE
85771b12faf6Smrg
8578e35d4d8eSmrgGCC=$lt_save_GCC
8579e35d4d8eSmrgCC=$lt_save_CC
8580e35d4d8eSmrgCFLAGS=$lt_save_CFLAGS
8581e35d4d8eSmrg])# _LT_LANG_GO_CONFIG
8582d31dbc53Smrg
8583d31dbc53Smrg
8584e35d4d8eSmrg# _LT_LANG_RC_CONFIG([TAG])
8585e35d4d8eSmrg# -------------------------
8586e35d4d8eSmrg# Ensure that the configuration variables for the Windows resource compiler
8587e35d4d8eSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8588e35d4d8eSmrg# to write the compiler configuration to `libtool'.
8589e35d4d8eSmrgm4_defun([_LT_LANG_RC_CONFIG],
8590e35d4d8eSmrg[AC_REQUIRE([LT_PROG_RC])dnl
8591e35d4d8eSmrgAC_LANG_SAVE
8592d31dbc53Smrg
8593e35d4d8eSmrg# Source file extension for RC test sources.
8594e35d4d8eSmrgac_ext=rc
8595d31dbc53Smrg
8596e35d4d8eSmrg# Object file extension for compiled RC test sources.
8597e35d4d8eSmrgobjext=o
8598e35d4d8eSmrg_LT_TAGVAR(objext, $1)=$objext
8599d31dbc53Smrg
8600e35d4d8eSmrg# Code to be used in simple compile tests
8601e35d4d8eSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8602d31dbc53Smrg
8603e35d4d8eSmrg# Code to be used in simple link tests
8604e35d4d8eSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
8605d31dbc53Smrg
8606e35d4d8eSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8607e35d4d8eSmrg_LT_TAG_COMPILER
8608d31dbc53Smrg
8609e35d4d8eSmrg# save warnings/boilerplate of simple test code
8610e35d4d8eSmrg_LT_COMPILER_BOILERPLATE
8611e35d4d8eSmrg_LT_LINKER_BOILERPLATE
8612d31dbc53Smrg
8613e35d4d8eSmrg# Allow CC to be a program name with arguments.
8614e35d4d8eSmrglt_save_CC="$CC"
8615e35d4d8eSmrglt_save_CFLAGS=$CFLAGS
8616e35d4d8eSmrglt_save_GCC=$GCC
8617e35d4d8eSmrgGCC=
8618e35d4d8eSmrgCC=${RC-"windres"}
8619e35d4d8eSmrgCFLAGS=
8620e35d4d8eSmrgcompiler=$CC
8621e35d4d8eSmrg_LT_TAGVAR(compiler, $1)=$CC
8622e35d4d8eSmrg_LT_CC_BASENAME([$compiler])
8623e35d4d8eSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8624d31dbc53Smrg
8625e35d4d8eSmrgif test -n "$compiler"; then
8626e35d4d8eSmrg  :
8627e35d4d8eSmrg  _LT_CONFIG($1)
8628e35d4d8eSmrgfi
8629d31dbc53Smrg
8630e35d4d8eSmrgGCC=$lt_save_GCC
8631e35d4d8eSmrgAC_LANG_RESTORE
8632e35d4d8eSmrgCC=$lt_save_CC
8633e35d4d8eSmrgCFLAGS=$lt_save_CFLAGS
8634e35d4d8eSmrg])# _LT_LANG_RC_CONFIG
8635d31dbc53Smrg
8636e35d4d8eSmrg
8637e35d4d8eSmrg# LT_PROG_GCJ
8638e35d4d8eSmrg# -----------
8639e35d4d8eSmrgAC_DEFUN([LT_PROG_GCJ],
8640e35d4d8eSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8641e35d4d8eSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8642e35d4d8eSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
8643e35d4d8eSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8644e35d4d8eSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
86451b12faf6Smrg])
8646d31dbc53Smrg
8647e35d4d8eSmrg# Old name:
8648e35d4d8eSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
86491b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
8650e35d4d8eSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8651d31dbc53Smrg
8652d31dbc53Smrg
8653e35d4d8eSmrg# LT_PROG_GO
8654e35d4d8eSmrg# ----------
8655e35d4d8eSmrgAC_DEFUN([LT_PROG_GO],
8656e35d4d8eSmrg[AC_CHECK_TOOL(GOC, gccgo,)
86571b12faf6Smrg])
8658d31dbc53Smrg
8659d31dbc53Smrg
8660e35d4d8eSmrg# LT_PROG_RC
8661e35d4d8eSmrg# ----------
8662e35d4d8eSmrgAC_DEFUN([LT_PROG_RC],
8663e35d4d8eSmrg[AC_CHECK_TOOL(RC, windres,)
8664e35d4d8eSmrg])
86651b12faf6Smrg
8666e35d4d8eSmrg# Old name:
8667e35d4d8eSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
86681b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
8669e35d4d8eSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8670d31dbc53Smrg
86711b12faf6Smrg
8672e35d4d8eSmrg# _LT_DECL_EGREP
8673e35d4d8eSmrg# --------------
8674e35d4d8eSmrg# If we don't have a new enough Autoconf to choose the best grep
8675e35d4d8eSmrg# available, choose the one first in the user's PATH.
8676e35d4d8eSmrgm4_defun([_LT_DECL_EGREP],
8677e35d4d8eSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8678e35d4d8eSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8679e35d4d8eSmrgtest -z "$GREP" && GREP=grep
8680e35d4d8eSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8681e35d4d8eSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8682e35d4d8eSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8683e35d4d8eSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8684e35d4d8eSmrgAC_SUBST([GREP])
8685e35d4d8eSmrg])
86861b12faf6Smrg
86871b12faf6Smrg
8688e35d4d8eSmrg# _LT_DECL_OBJDUMP
8689e35d4d8eSmrg# --------------
8690e35d4d8eSmrg# If we don't have a new enough Autoconf to choose the best objdump
8691e35d4d8eSmrg# available, choose the one first in the user's PATH.
8692e35d4d8eSmrgm4_defun([_LT_DECL_OBJDUMP],
8693e35d4d8eSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8694e35d4d8eSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8695e35d4d8eSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8696e35d4d8eSmrgAC_SUBST([OBJDUMP])
86972a51b5beSmrg])
8698d31dbc53Smrg
8699e35d4d8eSmrg# _LT_DECL_DLLTOOL
8700e35d4d8eSmrg# ----------------
8701e35d4d8eSmrg# Ensure DLLTOOL variable is set.
8702e35d4d8eSmrgm4_defun([_LT_DECL_DLLTOOL],
8703e35d4d8eSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8704e35d4d8eSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8705e35d4d8eSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8706e35d4d8eSmrgAC_SUBST([DLLTOOL])
87071b12faf6Smrg])
8708d31dbc53Smrg
8709e35d4d8eSmrg# _LT_DECL_SED
8710e35d4d8eSmrg# ------------
8711e35d4d8eSmrg# Check for a fully-functional sed program, that truncates
8712e35d4d8eSmrg# as few characters as possible.  Prefer GNU sed if found.
8713e35d4d8eSmrgm4_defun([_LT_DECL_SED],
8714e35d4d8eSmrg[AC_PROG_SED
8715e35d4d8eSmrgtest -z "$SED" && SED=sed
8716e35d4d8eSmrgXsed="$SED -e 1s/^X//"
8717e35d4d8eSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8718e35d4d8eSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8719e35d4d8eSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8720e35d4d8eSmrg])# _LT_DECL_SED
8721e35d4d8eSmrg
8722e35d4d8eSmrgm4_ifndef([AC_PROG_SED], [
8723e35d4d8eSmrg# NOTE: This macro has been submitted for inclusion into   #
8724e35d4d8eSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8725e35d4d8eSmrg#  a released version of Autoconf we should remove this    #
8726e35d4d8eSmrg#  macro and use it instead.                               #
8727e35d4d8eSmrg
8728e35d4d8eSmrgm4_defun([AC_PROG_SED],
8729e35d4d8eSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8730e35d4d8eSmrgAC_CACHE_VAL(lt_cv_path_SED,
8731e35d4d8eSmrg[# Loop through the user's path and test for sed and gsed.
8732e35d4d8eSmrg# Then use that list of sed's as ones to test for truncation.
8733e35d4d8eSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8734e35d4d8eSmrgfor as_dir in $PATH
8735e35d4d8eSmrgdo
8736e35d4d8eSmrg  IFS=$as_save_IFS
8737e35d4d8eSmrg  test -z "$as_dir" && as_dir=.
8738e35d4d8eSmrg  for lt_ac_prog in sed gsed; do
8739e35d4d8eSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
8740e35d4d8eSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8741e35d4d8eSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8742e35d4d8eSmrg      fi
8743e35d4d8eSmrg    done
8744e35d4d8eSmrg  done
8745e35d4d8eSmrgdone
8746e35d4d8eSmrgIFS=$as_save_IFS
8747e35d4d8eSmrglt_ac_max=0
8748e35d4d8eSmrglt_ac_count=0
8749e35d4d8eSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8750e35d4d8eSmrg# along with /bin/sed that truncates output.
8751e35d4d8eSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8752e35d4d8eSmrg  test ! -f $lt_ac_sed && continue
8753e35d4d8eSmrg  cat /dev/null > conftest.in
8754e35d4d8eSmrg  lt_ac_count=0
8755e35d4d8eSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8756e35d4d8eSmrg  # Check for GNU sed and select it if it is found.
8757e35d4d8eSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8758e35d4d8eSmrg    lt_cv_path_SED=$lt_ac_sed
8759e35d4d8eSmrg    break
8760e35d4d8eSmrg  fi
8761e35d4d8eSmrg  while true; do
8762e35d4d8eSmrg    cat conftest.in conftest.in >conftest.tmp
8763e35d4d8eSmrg    mv conftest.tmp conftest.in
8764e35d4d8eSmrg    cp conftest.in conftest.nl
8765e35d4d8eSmrg    echo >>conftest.nl
8766e35d4d8eSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8767e35d4d8eSmrg    cmp -s conftest.out conftest.nl || break
8768e35d4d8eSmrg    # 10000 chars as input seems more than enough
8769e35d4d8eSmrg    test $lt_ac_count -gt 10 && break
8770e35d4d8eSmrg    lt_ac_count=`expr $lt_ac_count + 1`
8771e35d4d8eSmrg    if test $lt_ac_count -gt $lt_ac_max; then
8772e35d4d8eSmrg      lt_ac_max=$lt_ac_count
8773e35d4d8eSmrg      lt_cv_path_SED=$lt_ac_sed
8774e35d4d8eSmrg    fi
8775e35d4d8eSmrg  done
8776e35d4d8eSmrgdone
8777e35d4d8eSmrg])
8778e35d4d8eSmrgSED=$lt_cv_path_SED
8779e35d4d8eSmrgAC_SUBST([SED])
8780e35d4d8eSmrgAC_MSG_RESULT([$SED])
8781e35d4d8eSmrg])#AC_PROG_SED
8782e35d4d8eSmrg])#m4_ifndef
8783d31dbc53Smrg
8784e35d4d8eSmrg# Old name:
8785e35d4d8eSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
87861b12faf6Smrgdnl aclocal-1.4 backwards compatibility:
8787e35d4d8eSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8788e35d4d8eSmrg
87891b12faf6Smrg
8790e35d4d8eSmrg# _LT_CHECK_SHELL_FEATURES
8791e35d4d8eSmrg# ------------------------
8792e35d4d8eSmrg# Find out whether the shell is Bourne or XSI compatible,
8793e35d4d8eSmrg# or has some other useful features.
8794e35d4d8eSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8795e35d4d8eSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8796e35d4d8eSmrg# Try some XSI features
8797e35d4d8eSmrgxsi_shell=no
8798e35d4d8eSmrg( _lt_dummy="a/b/c"
8799e35d4d8eSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8800e35d4d8eSmrg      = c,a/b,b/c, \
8801e35d4d8eSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
8802e35d4d8eSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8803e35d4d8eSmrg  && xsi_shell=yes
8804e35d4d8eSmrgAC_MSG_RESULT([$xsi_shell])
8805e35d4d8eSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
88061b12faf6Smrg
8807e35d4d8eSmrgAC_MSG_CHECKING([whether the shell understands "+="])
8808e35d4d8eSmrglt_shell_append=no
8809e35d4d8eSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8810e35d4d8eSmrg    >/dev/null 2>&1 \
8811e35d4d8eSmrg  && lt_shell_append=yes
8812e35d4d8eSmrgAC_MSG_RESULT([$lt_shell_append])
8813e35d4d8eSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
88141b12faf6Smrg
8815e35d4d8eSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8816e35d4d8eSmrg  lt_unset=unset
8817e35d4d8eSmrgelse
8818e35d4d8eSmrg  lt_unset=false
8819e35d4d8eSmrgfi
8820e35d4d8eSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8821d31dbc53Smrg
8822e35d4d8eSmrg# test EBCDIC or ASCII
8823e35d4d8eSmrgcase `echo X|tr X '\101'` in
8824e35d4d8eSmrg A) # ASCII based system
8825e35d4d8eSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8826e35d4d8eSmrg  lt_SP2NL='tr \040 \012'
8827e35d4d8eSmrg  lt_NL2SP='tr \015\012 \040\040'
8828e35d4d8eSmrg  ;;
8829e35d4d8eSmrg *) # EBCDIC based system
8830e35d4d8eSmrg  lt_SP2NL='tr \100 \n'
8831e35d4d8eSmrg  lt_NL2SP='tr \r\n \100\100'
8832e35d4d8eSmrg  ;;
8833e35d4d8eSmrgesac
8834e35d4d8eSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8835e35d4d8eSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8836e35d4d8eSmrg])# _LT_CHECK_SHELL_FEATURES
8837d31dbc53Smrg
88381b12faf6Smrg
8839e35d4d8eSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8840e35d4d8eSmrg# ------------------------------------------------------
8841e35d4d8eSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8842e35d4d8eSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8843e35d4d8eSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
8844e35d4d8eSmrg[dnl {
8845e35d4d8eSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
8846e35d4d8eSmrg$1 ()\
8847e35d4d8eSmrg{\
8848e35d4d8eSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8849e35d4d8eSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8850e35d4d8eSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
8851e35d4d8eSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8852e35d4d8eSmrgtest 0 -eq $? || _lt_function_replace_fail=:
88531b12faf6Smrg])
8854d31dbc53Smrg
8855d31dbc53Smrg
8856e35d4d8eSmrg# _LT_PROG_REPLACE_SHELLFNS
8857e35d4d8eSmrg# -------------------------
8858e35d4d8eSmrg# Replace existing portable implementations of several shell functions with
8859e35d4d8eSmrg# equivalent extended shell implementations where those features are available..
8860e35d4d8eSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
8861e35d4d8eSmrg[if test x"$xsi_shell" = xyes; then
8862e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8863e35d4d8eSmrg    case ${1} in
8864e35d4d8eSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
8865e35d4d8eSmrg      *  ) func_dirname_result="${3}" ;;
8866e35d4d8eSmrg    esac])
8867e35d4d8eSmrg
8868e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8869e35d4d8eSmrg    func_basename_result="${1##*/}"])
8870e35d4d8eSmrg
8871e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8872e35d4d8eSmrg    case ${1} in
8873e35d4d8eSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
8874e35d4d8eSmrg      *  ) func_dirname_result="${3}" ;;
8875e35d4d8eSmrg    esac
8876e35d4d8eSmrg    func_basename_result="${1##*/}"])
8877d31dbc53Smrg
8878e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8879e35d4d8eSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8880e35d4d8eSmrg    # positional parameters, so assign one to ordinary parameter first.
8881e35d4d8eSmrg    func_stripname_result=${3}
8882e35d4d8eSmrg    func_stripname_result=${func_stripname_result#"${1}"}
8883e35d4d8eSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
8884d31dbc53Smrg
8885e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8886e35d4d8eSmrg    func_split_long_opt_name=${1%%=*}
8887e35d4d8eSmrg    func_split_long_opt_arg=${1#*=}])
8888d31dbc53Smrg
8889e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8890e35d4d8eSmrg    func_split_short_opt_arg=${1#??}
8891e35d4d8eSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
88921b12faf6Smrg
8893e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8894e35d4d8eSmrg    case ${1} in
8895e35d4d8eSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8896e35d4d8eSmrg      *)    func_lo2o_result=${1} ;;
8897e35d4d8eSmrg    esac])
88981b12faf6Smrg
8899e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
89001b12faf6Smrg
8901e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8902d31dbc53Smrg
8903e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8904e35d4d8eSmrgfi
8905d31dbc53Smrg
8906e35d4d8eSmrgif test x"$lt_shell_append" = xyes; then
8907e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8908d31dbc53Smrg
8909e35d4d8eSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8910e35d4d8eSmrg    func_quote_for_eval "${2}"
8911e35d4d8eSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8912e35d4d8eSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8913d31dbc53Smrg
8914e35d4d8eSmrg  # Save a `func_append' function call where possible by direct use of '+='
8915e35d4d8eSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8916e35d4d8eSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
8917e35d4d8eSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8918e35d4d8eSmrg  test 0 -eq $? || _lt_function_replace_fail=:
8919e35d4d8eSmrgelse
8920e35d4d8eSmrg  # Save a `func_append' function call even when '+=' is not available
8921e35d4d8eSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8922e35d4d8eSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
8923e35d4d8eSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8924e35d4d8eSmrg  test 0 -eq $? || _lt_function_replace_fail=:
8925e35d4d8eSmrgfi
8926d31dbc53Smrg
8927e35d4d8eSmrgif test x"$_lt_function_replace_fail" = x":"; then
8928e35d4d8eSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8929e35d4d8eSmrgfi
8930e35d4d8eSmrg])
8931e35d4d8eSmrg
8932e35d4d8eSmrg# _LT_PATH_CONVERSION_FUNCTIONS
8933e35d4d8eSmrg# -----------------------------
8934e35d4d8eSmrg# Determine which file name conversion functions should be used by
8935e35d4d8eSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8936e35d4d8eSmrg# for certain cross-compile configurations and native mingw.
8937e35d4d8eSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8938e35d4d8eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8939e35d4d8eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8940e35d4d8eSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8941e35d4d8eSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8942e35d4d8eSmrg[case $host in
8943e35d4d8eSmrg  *-*-mingw* )
8944e35d4d8eSmrg    case $build in
8945e35d4d8eSmrg      *-*-mingw* ) # actually msys
8946e35d4d8eSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8947e35d4d8eSmrg        ;;
8948e35d4d8eSmrg      *-*-cygwin* )
8949e35d4d8eSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8950e35d4d8eSmrg        ;;
8951e35d4d8eSmrg      * ) # otherwise, assume *nix
8952e35d4d8eSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8953e35d4d8eSmrg        ;;
8954e35d4d8eSmrg    esac
8955e35d4d8eSmrg    ;;
8956e35d4d8eSmrg  *-*-cygwin* )
8957e35d4d8eSmrg    case $build in
8958e35d4d8eSmrg      *-*-mingw* ) # actually msys
8959e35d4d8eSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8960e35d4d8eSmrg        ;;
8961e35d4d8eSmrg      *-*-cygwin* )
8962e35d4d8eSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8963e35d4d8eSmrg        ;;
8964e35d4d8eSmrg      * ) # otherwise, assume *nix
8965e35d4d8eSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8966e35d4d8eSmrg        ;;
8967e35d4d8eSmrg    esac
8968e35d4d8eSmrg    ;;
8969e35d4d8eSmrg  * ) # unhandled hosts (and "normal" native builds)
8970e35d4d8eSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8971e35d4d8eSmrg    ;;
8972e35d4d8eSmrgesac
8973e35d4d8eSmrg])
8974e35d4d8eSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8975e35d4d8eSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8976e35d4d8eSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8977e35d4d8eSmrg         [0], [convert $build file names to $host format])dnl
8978e35d4d8eSmrg
8979e35d4d8eSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8980e35d4d8eSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8981e35d4d8eSmrg[#assume ordinary cross tools, or native build.
8982e35d4d8eSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
8983e35d4d8eSmrgcase $host in
8984e35d4d8eSmrg  *-*-mingw* )
8985e35d4d8eSmrg    case $build in
8986e35d4d8eSmrg      *-*-mingw* ) # actually msys
8987e35d4d8eSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8988e35d4d8eSmrg        ;;
8989e35d4d8eSmrg    esac
8990e35d4d8eSmrg    ;;
8991e35d4d8eSmrgesac
8992e35d4d8eSmrg])
8993e35d4d8eSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8994e35d4d8eSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8995e35d4d8eSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8996e35d4d8eSmrg         [0], [convert $build files to toolchain format])dnl
8997e35d4d8eSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
8998e35d4d8eSmrg
8999e35d4d8eSmrg# Helper functions for option handling.                    -*- Autoconf -*-
90001b12faf6Smrg#
9001e35d4d8eSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9002e35d4d8eSmrg#   Inc.
9003e35d4d8eSmrg#   Written by Gary V. Vaughan, 2004
90041b12faf6Smrg#
90051b12faf6Smrg# This file is free software; the Free Software Foundation gives
90061b12faf6Smrg# unlimited permission to copy and/or distribute it, with or without
90071b12faf6Smrg# modifications, as long as this notice is preserved.
90081b12faf6Smrg
9009e35d4d8eSmrg# serial 7 ltoptions.m4
90101b12faf6Smrg
90111b12faf6Smrg# This is to help aclocal find these macros, as it can't see m4_define.
9012e35d4d8eSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
90131b12faf6Smrg
90141b12faf6Smrg
9015e35d4d8eSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
90161b12faf6Smrg# ------------------------------------------
9017e35d4d8eSmrgm4_define([_LT_MANGLE_OPTION],
9018e35d4d8eSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
90191b12faf6Smrg
90201b12faf6Smrg
9021e35d4d8eSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9022e35d4d8eSmrg# ---------------------------------------
9023e35d4d8eSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9024e35d4d8eSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9025e35d4d8eSmrg# saved as a flag.
9026e35d4d8eSmrgm4_define([_LT_SET_OPTION],
9027e35d4d8eSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9028e35d4d8eSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9029e35d4d8eSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
9030e35d4d8eSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
9031e35d4d8eSmrg])
90321b12faf6Smrg
90331b12faf6Smrg
9034e35d4d8eSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9035e35d4d8eSmrg# ------------------------------------------------------------
9036e35d4d8eSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9037e35d4d8eSmrgm4_define([_LT_IF_OPTION],
9038e35d4d8eSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
90391b12faf6Smrg
90401b12faf6Smrg
9041e35d4d8eSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9042e35d4d8eSmrg# -------------------------------------------------------
9043e35d4d8eSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9044e35d4d8eSmrg# are set.
9045e35d4d8eSmrgm4_define([_LT_UNLESS_OPTIONS],
9046e35d4d8eSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9047e35d4d8eSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9048e35d4d8eSmrg		      [m4_define([$0_found])])])[]dnl
9049e35d4d8eSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9050e35d4d8eSmrg])[]dnl
9051e35d4d8eSmrg])
90521b12faf6Smrg
90531b12faf6Smrg
9054e35d4d8eSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9055e35d4d8eSmrg# ----------------------------------------
9056e35d4d8eSmrg# OPTION-LIST is a space-separated list of Libtool options associated
9057e35d4d8eSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
9058e35d4d8eSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9059e35d4d8eSmrg# the unknown option and exit.
9060e35d4d8eSmrgm4_defun([_LT_SET_OPTIONS],
9061e35d4d8eSmrg[# Set options
9062e35d4d8eSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9063e35d4d8eSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
90641b12faf6Smrg
9065e35d4d8eSmrgm4_if([$1],[LT_INIT],[
9066e35d4d8eSmrg  dnl
9067e35d4d8eSmrg  dnl Simply set some default values (i.e off) if boolean options were not
9068e35d4d8eSmrg  dnl specified:
9069e35d4d8eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9070e35d4d8eSmrg  ])
9071e35d4d8eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9072e35d4d8eSmrg  ])
9073e35d4d8eSmrg  dnl
9074e35d4d8eSmrg  dnl If no reference was made to various pairs of opposing options, then
9075e35d4d8eSmrg  dnl we run the default mode handler for the pair.  For example, if neither
9076e35d4d8eSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9077e35d4d8eSmrg  dnl archives by default:
9078e35d4d8eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9079e35d4d8eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9080e35d4d8eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9081e35d4d8eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9082e35d4d8eSmrg  		   [_LT_ENABLE_FAST_INSTALL])
9083e35d4d8eSmrg  ])
9084e35d4d8eSmrg])# _LT_SET_OPTIONS
9085d31dbc53Smrg
90861b12faf6Smrg
90871b12faf6Smrg
9088e35d4d8eSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9089e35d4d8eSmrg# -----------------------------------------
9090e35d4d8eSmrgm4_define([_LT_MANGLE_DEFUN],
9091e35d4d8eSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
90921b12faf6Smrg
90931b12faf6Smrg
9094e35d4d8eSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9095e35d4d8eSmrg# -----------------------------------------------
9096e35d4d8eSmrgm4_define([LT_OPTION_DEFINE],
9097e35d4d8eSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9098e35d4d8eSmrg])# LT_OPTION_DEFINE
90991b12faf6Smrg
9100d31dbc53Smrg
9101e35d4d8eSmrg# dlopen
9102e35d4d8eSmrg# ------
9103e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9104e35d4d8eSmrg])
91051b12faf6Smrg
9106e35d4d8eSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
9107e35d4d8eSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
9108e35d4d8eSmrgAC_DIAGNOSE([obsolete],
9109e35d4d8eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9110e35d4d8eSmrgput the `dlopen' option into LT_INIT's first parameter.])
9111e35d4d8eSmrg])
9112d31dbc53Smrg
9113e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
9114e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9115d31dbc53Smrg
9116d31dbc53Smrg
9117e35d4d8eSmrg# win32-dll
9118e35d4d8eSmrg# ---------
9119e35d4d8eSmrg# Declare package support for building win32 dll's.
9120e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
9121e35d4d8eSmrg[enable_win32_dll=yes
9122d31dbc53Smrg
9123e35d4d8eSmrgcase $host in
9124e35d4d8eSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9125e35d4d8eSmrg  AC_CHECK_TOOL(AS, as, false)
9126e35d4d8eSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9127e35d4d8eSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9128e35d4d8eSmrg  ;;
9129e35d4d8eSmrgesac
9130d31dbc53Smrg
9131e35d4d8eSmrgtest -z "$AS" && AS=as
9132e35d4d8eSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
9133d31dbc53Smrg
9134e35d4d8eSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
9135e35d4d8eSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9136d31dbc53Smrg
9137e35d4d8eSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
9138e35d4d8eSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9139e35d4d8eSmrg])# win32-dll
9140d31dbc53Smrg
9141e35d4d8eSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9142e35d4d8eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9143e35d4d8eSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
9144e35d4d8eSmrgAC_DIAGNOSE([obsolete],
9145e35d4d8eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9146e35d4d8eSmrgput the `win32-dll' option into LT_INIT's first parameter.])
9147e35d4d8eSmrg])
9148d31dbc53Smrg
9149e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
9150e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9151d31dbc53Smrg
9152d31dbc53Smrg
9153e35d4d8eSmrg# _LT_ENABLE_SHARED([DEFAULT])
9154e35d4d8eSmrg# ----------------------------
9155e35d4d8eSmrg# implement the --enable-shared flag, and supports the `shared' and
9156e35d4d8eSmrg# `disable-shared' LT_INIT options.
9157e35d4d8eSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9158e35d4d8eSmrgm4_define([_LT_ENABLE_SHARED],
9159e35d4d8eSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9160e35d4d8eSmrgAC_ARG_ENABLE([shared],
9161e35d4d8eSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9162e35d4d8eSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9163e35d4d8eSmrg    [p=${PACKAGE-default}
9164e35d4d8eSmrg    case $enableval in
9165e35d4d8eSmrg    yes) enable_shared=yes ;;
9166e35d4d8eSmrg    no) enable_shared=no ;;
9167e35d4d8eSmrg    *)
9168e35d4d8eSmrg      enable_shared=no
9169e35d4d8eSmrg      # Look at the argument we got.  We use all the common list separators.
9170e35d4d8eSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9171e35d4d8eSmrg      for pkg in $enableval; do
9172e35d4d8eSmrg	IFS="$lt_save_ifs"
9173e35d4d8eSmrg	if test "X$pkg" = "X$p"; then
9174e35d4d8eSmrg	  enable_shared=yes
9175e35d4d8eSmrg	fi
9176e35d4d8eSmrg      done
9177e35d4d8eSmrg      IFS="$lt_save_ifs"
9178e35d4d8eSmrg      ;;
9179e35d4d8eSmrg    esac],
9180e35d4d8eSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9181d31dbc53Smrg
9182e35d4d8eSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9183e35d4d8eSmrg	[Whether or not to build shared libraries])
9184e35d4d8eSmrg])# _LT_ENABLE_SHARED
9185d31dbc53Smrg
9186e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9187e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9188d31dbc53Smrg
9189e35d4d8eSmrg# Old names:
9190e35d4d8eSmrgAC_DEFUN([AC_ENABLE_SHARED],
9191e35d4d8eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9192e35d4d8eSmrg])
9193d31dbc53Smrg
9194e35d4d8eSmrgAC_DEFUN([AC_DISABLE_SHARED],
9195e35d4d8eSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
9196e35d4d8eSmrg])
9197d31dbc53Smrg
9198e35d4d8eSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9199e35d4d8eSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9200d31dbc53Smrg
9201e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
9202e35d4d8eSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
9203e35d4d8eSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
9204d31dbc53Smrg
92052a51b5beSmrg
92062a51b5beSmrg
9207e35d4d8eSmrg# _LT_ENABLE_STATIC([DEFAULT])
9208e35d4d8eSmrg# ----------------------------
9209e35d4d8eSmrg# implement the --enable-static flag, and support the `static' and
9210e35d4d8eSmrg# `disable-static' LT_INIT options.
9211e35d4d8eSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9212e35d4d8eSmrgm4_define([_LT_ENABLE_STATIC],
9213e35d4d8eSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9214e35d4d8eSmrgAC_ARG_ENABLE([static],
9215e35d4d8eSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9216e35d4d8eSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9217e35d4d8eSmrg    [p=${PACKAGE-default}
9218e35d4d8eSmrg    case $enableval in
9219e35d4d8eSmrg    yes) enable_static=yes ;;
9220e35d4d8eSmrg    no) enable_static=no ;;
9221e35d4d8eSmrg    *)
9222e35d4d8eSmrg     enable_static=no
9223e35d4d8eSmrg      # Look at the argument we got.  We use all the common list separators.
9224e35d4d8eSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9225e35d4d8eSmrg      for pkg in $enableval; do
9226e35d4d8eSmrg	IFS="$lt_save_ifs"
9227e35d4d8eSmrg	if test "X$pkg" = "X$p"; then
9228e35d4d8eSmrg	  enable_static=yes
92292a51b5beSmrg	fi
9230e35d4d8eSmrg      done
9231e35d4d8eSmrg      IFS="$lt_save_ifs"
9232e35d4d8eSmrg      ;;
9233e35d4d8eSmrg    esac],
9234e35d4d8eSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9235d31dbc53Smrg
9236e35d4d8eSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
9237e35d4d8eSmrg	[Whether or not to build static libraries])
9238e35d4d8eSmrg])# _LT_ENABLE_STATIC
9239d31dbc53Smrg
9240e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9241e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9242d31dbc53Smrg
9243e35d4d8eSmrg# Old names:
9244e35d4d8eSmrgAC_DEFUN([AC_ENABLE_STATIC],
9245e35d4d8eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9246e35d4d8eSmrg])
9247e35d4d8eSmrg
9248e35d4d8eSmrgAC_DEFUN([AC_DISABLE_STATIC],
9249e35d4d8eSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
9250e35d4d8eSmrg])
9251d31dbc53Smrg
9252e35d4d8eSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9253e35d4d8eSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
92542a51b5beSmrg
9255e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
9256e35d4d8eSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
9257e35d4d8eSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
92582a51b5beSmrg
9259d31dbc53Smrg
926032b578d3Smrg
9261e35d4d8eSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9262e35d4d8eSmrg# ----------------------------------
9263e35d4d8eSmrg# implement the --enable-fast-install flag, and support the `fast-install'
9264e35d4d8eSmrg# and `disable-fast-install' LT_INIT options.
9265e35d4d8eSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9266e35d4d8eSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
9267e35d4d8eSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9268e35d4d8eSmrgAC_ARG_ENABLE([fast-install],
9269e35d4d8eSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9270e35d4d8eSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9271e35d4d8eSmrg    [p=${PACKAGE-default}
9272e35d4d8eSmrg    case $enableval in
9273e35d4d8eSmrg    yes) enable_fast_install=yes ;;
9274e35d4d8eSmrg    no) enable_fast_install=no ;;
9275e35d4d8eSmrg    *)
9276e35d4d8eSmrg      enable_fast_install=no
9277e35d4d8eSmrg      # Look at the argument we got.  We use all the common list separators.
9278e35d4d8eSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9279e35d4d8eSmrg      for pkg in $enableval; do
9280e35d4d8eSmrg	IFS="$lt_save_ifs"
9281e35d4d8eSmrg	if test "X$pkg" = "X$p"; then
9282e35d4d8eSmrg	  enable_fast_install=yes
9283e35d4d8eSmrg	fi
9284e35d4d8eSmrg      done
9285e35d4d8eSmrg      IFS="$lt_save_ifs"
9286e35d4d8eSmrg      ;;
9287e35d4d8eSmrg    esac],
9288e35d4d8eSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
928932b578d3Smrg
9290e35d4d8eSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
9291e35d4d8eSmrg	 [Whether or not to optimize for fast installation])dnl
9292e35d4d8eSmrg])# _LT_ENABLE_FAST_INSTALL
929332b578d3Smrg
9294e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9295e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
92961b12faf6Smrg
9297e35d4d8eSmrg# Old names:
9298e35d4d8eSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
9299e35d4d8eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9300e35d4d8eSmrgAC_DIAGNOSE([obsolete],
9301e35d4d8eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9302e35d4d8eSmrgthe `fast-install' option into LT_INIT's first parameter.])
9303e35d4d8eSmrg])
93041b12faf6Smrg
9305e35d4d8eSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
9306e35d4d8eSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9307e35d4d8eSmrgAC_DIAGNOSE([obsolete],
9308e35d4d8eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9309e35d4d8eSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
9310e35d4d8eSmrg])
931132b578d3Smrg
9312e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
9313e35d4d8eSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9314e35d4d8eSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
93151b12faf6Smrg
93161b12faf6Smrg
9317e35d4d8eSmrg# _LT_WITH_PIC([MODE])
9318e35d4d8eSmrg# --------------------
9319e35d4d8eSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9320e35d4d8eSmrg# LT_INIT options.
9321e35d4d8eSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9322e35d4d8eSmrgm4_define([_LT_WITH_PIC],
9323e35d4d8eSmrg[AC_ARG_WITH([pic],
9324e35d4d8eSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9325e35d4d8eSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9326e35d4d8eSmrg    [lt_p=${PACKAGE-default}
9327e35d4d8eSmrg    case $withval in
9328e35d4d8eSmrg    yes|no) pic_mode=$withval ;;
9329e35d4d8eSmrg    *)
9330e35d4d8eSmrg      pic_mode=default
9331e35d4d8eSmrg      # Look at the argument we got.  We use all the common list separators.
9332e35d4d8eSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9333e35d4d8eSmrg      for lt_pkg in $withval; do
9334e35d4d8eSmrg	IFS="$lt_save_ifs"
9335e35d4d8eSmrg	if test "X$lt_pkg" = "X$lt_p"; then
9336e35d4d8eSmrg	  pic_mode=yes
9337e35d4d8eSmrg	fi
9338e35d4d8eSmrg      done
9339e35d4d8eSmrg      IFS="$lt_save_ifs"
9340e35d4d8eSmrg      ;;
9341e35d4d8eSmrg    esac],
9342e35d4d8eSmrg    [pic_mode=default])
93431b12faf6Smrg
9344e35d4d8eSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
934532b578d3Smrg
9346e35d4d8eSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9347e35d4d8eSmrg])# _LT_WITH_PIC
934832b578d3Smrg
9349e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9350e35d4d8eSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
935132b578d3Smrg
9352e35d4d8eSmrg# Old name:
9353e35d4d8eSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
9354e35d4d8eSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
9355e35d4d8eSmrgAC_DIAGNOSE([obsolete],
9356e35d4d8eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9357e35d4d8eSmrgput the `pic-only' option into LT_INIT's first parameter.])
9358e35d4d8eSmrg])
935932b578d3Smrg
9360e35d4d8eSmrgdnl aclocal-1.4 backwards compatibility:
9361e35d4d8eSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
936232b578d3Smrg
936332b578d3Smrg
9364e35d4d8eSmrgm4_define([_LTDL_MODE], [])
9365e35d4d8eSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9366e35d4d8eSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
9367e35d4d8eSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
9368e35d4d8eSmrg		 [m4_define([_LTDL_MODE], [recursive])])
9369e35d4d8eSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
9370e35d4d8eSmrg		 [m4_define([_LTDL_MODE], [subproject])])
937132b578d3Smrg
9372e35d4d8eSmrgm4_define([_LTDL_TYPE], [])
9373e35d4d8eSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
9374e35d4d8eSmrg		 [m4_define([_LTDL_TYPE], [installable])])
9375e35d4d8eSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
9376e35d4d8eSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
93771b12faf6Smrg
9378e35d4d8eSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9379e35d4d8eSmrg#
9380e35d4d8eSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9381e35d4d8eSmrg# Written by Gary V. Vaughan, 2004
9382e35d4d8eSmrg#
9383e35d4d8eSmrg# This file is free software; the Free Software Foundation gives
9384e35d4d8eSmrg# unlimited permission to copy and/or distribute it, with or without
9385e35d4d8eSmrg# modifications, as long as this notice is preserved.
93861b12faf6Smrg
9387e35d4d8eSmrg# serial 6 ltsugar.m4
93881b12faf6Smrg
9389e35d4d8eSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9390e35d4d8eSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
93911b12faf6Smrg
93921b12faf6Smrg
9393e35d4d8eSmrg# lt_join(SEP, ARG1, [ARG2...])
9394e35d4d8eSmrg# -----------------------------
9395e35d4d8eSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9396e35d4d8eSmrg# associated separator.
9397e35d4d8eSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9398e35d4d8eSmrg# versions in m4sugar had bugs.
9399e35d4d8eSmrgm4_define([lt_join],
9400e35d4d8eSmrg[m4_if([$#], [1], [],
9401e35d4d8eSmrg       [$#], [2], [[$2]],
9402e35d4d8eSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9403e35d4d8eSmrgm4_define([_lt_join],
9404e35d4d8eSmrg[m4_if([$#$2], [2], [],
9405e35d4d8eSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9406e35d4d8eSmrg
94071b12faf6Smrg
9408e35d4d8eSmrg# lt_car(LIST)
9409e35d4d8eSmrg# lt_cdr(LIST)
9410e35d4d8eSmrg# ------------
9411e35d4d8eSmrg# Manipulate m4 lists.
9412e35d4d8eSmrg# These macros are necessary as long as will still need to support
9413e35d4d8eSmrg# Autoconf-2.59 which quotes differently.
9414e35d4d8eSmrgm4_define([lt_car], [[$1]])
9415e35d4d8eSmrgm4_define([lt_cdr],
9416e35d4d8eSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9417e35d4d8eSmrg       [$#], 1, [],
9418e35d4d8eSmrg       [m4_dquote(m4_shift($@))])])
9419e35d4d8eSmrgm4_define([lt_unquote], $1)
94201b12faf6Smrg
94211b12faf6Smrg
9422e35d4d8eSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9423e35d4d8eSmrg# ------------------------------------------
9424e35d4d8eSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9425e35d4d8eSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
9426e35d4d8eSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9427e35d4d8eSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9428e35d4d8eSmrg# than defined and empty).
9429e35d4d8eSmrg#
9430e35d4d8eSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
9431e35d4d8eSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9432e35d4d8eSmrgm4_define([lt_append],
9433e35d4d8eSmrg[m4_define([$1],
9434e35d4d8eSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
94351b12faf6Smrg
94361b12faf6Smrg
94371b12faf6Smrg
9438e35d4d8eSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9439e35d4d8eSmrg# ----------------------------------------------------------
9440e35d4d8eSmrg# Produce a SEP delimited list of all paired combinations of elements of
9441e35d4d8eSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9442e35d4d8eSmrg# has the form PREFIXmINFIXSUFFIXn.
9443e35d4d8eSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
9444e35d4d8eSmrgm4_define([lt_combine],
9445e35d4d8eSmrg[m4_if(m4_eval([$# > 3]), [1],
9446e35d4d8eSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9447e35d4d8eSmrg[[m4_foreach([_Lt_prefix], [$2],
9448e35d4d8eSmrg	     [m4_foreach([_Lt_suffix],
9449e35d4d8eSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9450e35d4d8eSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
94511b12faf6Smrg
94521b12faf6Smrg
9453e35d4d8eSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9454e35d4d8eSmrg# -----------------------------------------------------------------------
9455e35d4d8eSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9456e35d4d8eSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9457e35d4d8eSmrgm4_define([lt_if_append_uniq],
9458e35d4d8eSmrg[m4_ifdef([$1],
9459e35d4d8eSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9460e35d4d8eSmrg		 [lt_append([$1], [$2], [$3])$4],
9461e35d4d8eSmrg		 [$5])],
9462e35d4d8eSmrg	  [lt_append([$1], [$2], [$3])$4])])
94631b12faf6Smrg
94641b12faf6Smrg
9465e35d4d8eSmrg# lt_dict_add(DICT, KEY, VALUE)
9466e35d4d8eSmrg# -----------------------------
9467e35d4d8eSmrgm4_define([lt_dict_add],
9468e35d4d8eSmrg[m4_define([$1($2)], [$3])])
94691b12faf6Smrg
94701b12faf6Smrg
9471e35d4d8eSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9472e35d4d8eSmrg# --------------------------------------------
9473e35d4d8eSmrgm4_define([lt_dict_add_subkey],
9474e35d4d8eSmrg[m4_define([$1($2:$3)], [$4])])
94751b12faf6Smrg
94761b12faf6Smrg
9477e35d4d8eSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
9478e35d4d8eSmrg# ----------------------------------
9479e35d4d8eSmrgm4_define([lt_dict_fetch],
9480e35d4d8eSmrg[m4_ifval([$3],
9481e35d4d8eSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9482e35d4d8eSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
94831b12faf6Smrg
9484e35d4d8eSmrg
9485e35d4d8eSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9486e35d4d8eSmrg# -----------------------------------------------------------------
9487e35d4d8eSmrgm4_define([lt_if_dict_fetch],
9488e35d4d8eSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9489e35d4d8eSmrg	[$5],
9490e35d4d8eSmrg    [$6])])
9491e35d4d8eSmrg
9492e35d4d8eSmrg
9493e35d4d8eSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9494e35d4d8eSmrg# --------------------------------------------------------------
9495e35d4d8eSmrgm4_define([lt_dict_filter],
9496e35d4d8eSmrg[m4_if([$5], [], [],
9497e35d4d8eSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9498e35d4d8eSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9499e35d4d8eSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9500e35d4d8eSmrg])
9501e35d4d8eSmrg
9502e35d4d8eSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
95031b12faf6Smrg#
9504e35d4d8eSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
9505e35d4d8eSmrg#   Written by Scott James Remnant, 2004
95061b12faf6Smrg#
9507e35d4d8eSmrg# This file is free software; the Free Software Foundation gives
9508e35d4d8eSmrg# unlimited permission to copy and/or distribute it, with or without
9509e35d4d8eSmrg# modifications, as long as this notice is preserved.
95101b12faf6Smrg
9511e35d4d8eSmrg# @configure_input@
95121b12faf6Smrg
9513e35d4d8eSmrg# serial 3337 ltversion.m4
9514e35d4d8eSmrg# This file is part of GNU Libtool
9515e35d4d8eSmrg
9516e35d4d8eSmrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
9517e35d4d8eSmrgm4_define([LT_PACKAGE_REVISION], [1.3337])
9518e35d4d8eSmrg
9519e35d4d8eSmrgAC_DEFUN([LTVERSION_VERSION],
9520e35d4d8eSmrg[macro_version='2.4.2'
9521e35d4d8eSmrgmacro_revision='1.3337'
9522e35d4d8eSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9523e35d4d8eSmrg_LT_DECL(, macro_revision, 0)
9524e35d4d8eSmrg])
9525e35d4d8eSmrg
9526e35d4d8eSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
95271b12faf6Smrg#
9528e35d4d8eSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9529e35d4d8eSmrg#   Written by Scott James Remnant, 2004.
95301b12faf6Smrg#
9531e35d4d8eSmrg# This file is free software; the Free Software Foundation gives
9532e35d4d8eSmrg# unlimited permission to copy and/or distribute it, with or without
9533e35d4d8eSmrg# modifications, as long as this notice is preserved.
9534e35d4d8eSmrg
9535e35d4d8eSmrg# serial 5 lt~obsolete.m4
9536e35d4d8eSmrg
9537e35d4d8eSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
95381b12faf6Smrg#
9539e35d4d8eSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9540e35d4d8eSmrg# which have later been changed to m4_define as they aren't part of the
9541e35d4d8eSmrg# exported API, or moved to Autoconf or Automake where they belong.
95421b12faf6Smrg#
9543e35d4d8eSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9544e35d4d8eSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9545e35d4d8eSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
9546e35d4d8eSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9547e35d4d8eSmrg# and doesn't know about Autoconf macros at all.)
95481b12faf6Smrg#
9549e35d4d8eSmrg# So we provide this file, which has a silly filename so it's always
9550e35d4d8eSmrg# included after everything else.  This provides aclocal with the
9551e35d4d8eSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9552e35d4d8eSmrg# because those macros already exist, or will be overwritten later.
9553e35d4d8eSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
95541b12faf6Smrg#
9555e35d4d8eSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9556e35d4d8eSmrg# Yes, that means every name once taken will need to remain here until
9557e35d4d8eSmrg# we give up compatibility with versions before 1.7, at which point
9558e35d4d8eSmrg# we need to keep only those names which we still refer to.
955932b578d3Smrg
9560e35d4d8eSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9561e35d4d8eSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
956232b578d3Smrg
9563e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9564e35d4d8eSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9565e35d4d8eSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9566e35d4d8eSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9567e35d4d8eSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9568e35d4d8eSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9569e35d4d8eSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9570e35d4d8eSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9571e35d4d8eSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9572e35d4d8eSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9573e35d4d8eSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9574e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9575e35d4d8eSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9576e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9577e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9578e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9579e35d4d8eSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9580e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9581e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9582e35d4d8eSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9583e35d4d8eSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9584e35d4d8eSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9585e35d4d8eSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9586e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9587e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9588e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9589e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9590e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9591e35d4d8eSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9592e35d4d8eSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9593e35d4d8eSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9594e35d4d8eSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9595e35d4d8eSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9596e35d4d8eSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9597e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9598e35d4d8eSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9599e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9600e35d4d8eSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9601e35d4d8eSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9602e35d4d8eSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9603e35d4d8eSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9604e35d4d8eSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9605e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9606e35d4d8eSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9607e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9608e35d4d8eSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9609e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9610e35d4d8eSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9611e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9612e35d4d8eSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9613e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9614e35d4d8eSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9615e35d4d8eSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9616e35d4d8eSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9617e35d4d8eSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9618e35d4d8eSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9619e35d4d8eSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9620e35d4d8eSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9621e35d4d8eSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9622e35d4d8eSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9623e35d4d8eSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
962432b578d3Smrg
9625e35d4d8eSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9626e35d4d8eSmrg# 
9627e35d4d8eSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
96282a51b5beSmrg#
9629e35d4d8eSmrg# This program is free software; you can redistribute it and/or modify
9630e35d4d8eSmrg# it under the terms of the GNU General Public License as published by
9631e35d4d8eSmrg# the Free Software Foundation; either version 2 of the License, or
9632e35d4d8eSmrg# (at your option) any later version.
96331b12faf6Smrg#
9634e35d4d8eSmrg# This program is distributed in the hope that it will be useful, but
9635e35d4d8eSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
9636e35d4d8eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9637e35d4d8eSmrg# General Public License for more details.
96381b12faf6Smrg#
9639e35d4d8eSmrg# You should have received a copy of the GNU General Public License
9640e35d4d8eSmrg# along with this program; if not, write to the Free Software
9641e35d4d8eSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
96421b12faf6Smrg#
9643e35d4d8eSmrg# As a special exception to the GNU General Public License, if you
9644e35d4d8eSmrg# distribute this file as part of a program that contains a
9645e35d4d8eSmrg# configuration script generated by Autoconf, you may include it under
9646e35d4d8eSmrg# the same distribution terms that you use for the rest of that program.
96471b12faf6Smrg
9648e35d4d8eSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9649e35d4d8eSmrg# ----------------------------------
9650e35d4d8eSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9651e35d4d8eSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9652e35d4d8eSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9653e35d4d8eSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9654e35d4d8eSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9655e35d4d8eSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
96562a51b5beSmrgfi
9657e35d4d8eSmrgif test -n "$PKG_CONFIG"; then
9658e35d4d8eSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
9659e35d4d8eSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9660e35d4d8eSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9661e35d4d8eSmrg		AC_MSG_RESULT([yes])
9662e35d4d8eSmrg	else
9663e35d4d8eSmrg		AC_MSG_RESULT([no])
9664e35d4d8eSmrg		PKG_CONFIG=""
9665e35d4d8eSmrg	fi
9666e35d4d8eSmrg		
9667e35d4d8eSmrgfi[]dnl
9668e35d4d8eSmrg])# PKG_PROG_PKG_CONFIG
966932b578d3Smrg
9670e35d4d8eSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
96711b12faf6Smrg#
9672e35d4d8eSmrg# Check to see whether a particular set of modules exists.  Similar
9673e35d4d8eSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
96741b12faf6Smrg#
96751b12faf6Smrg#
9676e35d4d8eSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
9677e35d4d8eSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
9678e35d4d8eSmrg# PKG_CHECK_EXISTS manually
9679e35d4d8eSmrg# --------------------------------------------------------------
9680e35d4d8eSmrgAC_DEFUN([PKG_CHECK_EXISTS],
9681e35d4d8eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9682e35d4d8eSmrgif test -n "$PKG_CONFIG" && \
9683e35d4d8eSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9684e35d4d8eSmrg  m4_ifval([$2], [$2], [:])
9685e35d4d8eSmrgm4_ifvaln([$3], [else
9686e35d4d8eSmrg  $3])dnl
9687e35d4d8eSmrgfi])
96881b12faf6Smrg
9689e35d4d8eSmrg
9690e35d4d8eSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9691e35d4d8eSmrg# ---------------------------------------------
9692e35d4d8eSmrgm4_define([_PKG_CONFIG],
9693e35d4d8eSmrg[if test -n "$$1"; then
9694e35d4d8eSmrg    pkg_cv_[]$1="$$1"
9695e35d4d8eSmrg elif test -n "$PKG_CONFIG"; then
9696e35d4d8eSmrg    PKG_CHECK_EXISTS([$3],
9697e35d4d8eSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9698e35d4d8eSmrg		     [pkg_failed=yes])
9699e35d4d8eSmrg else
9700e35d4d8eSmrg    pkg_failed=untried
9701e35d4d8eSmrgfi[]dnl
9702e35d4d8eSmrg])# _PKG_CONFIG
9703e35d4d8eSmrg
9704e35d4d8eSmrg# _PKG_SHORT_ERRORS_SUPPORTED
9705e35d4d8eSmrg# -----------------------------
9706e35d4d8eSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9707e35d4d8eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9708e35d4d8eSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9709e35d4d8eSmrg        _pkg_short_errors_supported=yes
97101b12faf6Smrgelse
9711e35d4d8eSmrg        _pkg_short_errors_supported=no
9712e35d4d8eSmrgfi[]dnl
9713e35d4d8eSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
971432b578d3Smrg
97151b12faf6Smrg
9716e35d4d8eSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9717e35d4d8eSmrg# [ACTION-IF-NOT-FOUND])
97181b12faf6Smrg#
97191b12faf6Smrg#
9720e35d4d8eSmrg# Note that if there is a possibility the first call to
9721e35d4d8eSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
9722e35d4d8eSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
97231b12faf6Smrg#
97241b12faf6Smrg#
9725e35d4d8eSmrg# --------------------------------------------------------------
9726e35d4d8eSmrgAC_DEFUN([PKG_CHECK_MODULES],
9727e35d4d8eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9728e35d4d8eSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9729e35d4d8eSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9730e35d4d8eSmrg
9731e35d4d8eSmrgpkg_failed=no
9732e35d4d8eSmrgAC_MSG_CHECKING([for $1])
973332b578d3Smrg
9734e35d4d8eSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9735e35d4d8eSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
97362a51b5beSmrg
9737e35d4d8eSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9738e35d4d8eSmrgand $1[]_LIBS to avoid the need to call pkg-config.
9739e35d4d8eSmrgSee the pkg-config man page for more details.])
97402a51b5beSmrg
9741e35d4d8eSmrgif test $pkg_failed = yes; then
9742e35d4d8eSmrg        _PKG_SHORT_ERRORS_SUPPORTED
9743e35d4d8eSmrg        if test $_pkg_short_errors_supported = yes; then
9744e35d4d8eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9745e35d4d8eSmrg        else 
9746e35d4d8eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9747e35d4d8eSmrg        fi
9748e35d4d8eSmrg	# Put the nasty error message in config.log where it belongs
9749e35d4d8eSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9750e35d4d8eSmrg
9751e35d4d8eSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
9752e35d4d8eSmrg[Package requirements ($2) were not met:
9753e35d4d8eSmrg
9754e35d4d8eSmrg$$1_PKG_ERRORS
9755e35d4d8eSmrg
9756e35d4d8eSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9757e35d4d8eSmrginstalled software in a non-standard prefix.
9758e35d4d8eSmrg
9759e35d4d8eSmrg_PKG_TEXT
9760e35d4d8eSmrg])],
9761e35d4d8eSmrg		[AC_MSG_RESULT([no])
9762e35d4d8eSmrg                $4])
9763e35d4d8eSmrgelif test $pkg_failed = untried; then
9764e35d4d8eSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
9765e35d4d8eSmrg[The pkg-config script could not be found or is too old.  Make sure it
9766e35d4d8eSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
9767e35d4d8eSmrgpath to pkg-config.
9768e35d4d8eSmrg
9769e35d4d8eSmrg_PKG_TEXT
9770e35d4d8eSmrg
9771e35d4d8eSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9772e35d4d8eSmrg		[$4])
97732a51b5beSmrgelse
9774e35d4d8eSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9775e35d4d8eSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9776e35d4d8eSmrg        AC_MSG_RESULT([yes])
9777e35d4d8eSmrg	ifelse([$3], , :, [$3])
9778e35d4d8eSmrgfi[]dnl
9779e35d4d8eSmrg])# PKG_CHECK_MODULES
97802a51b5beSmrg
9781e35d4d8eSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9782e35d4d8eSmrgdnl
9783e35d4d8eSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9784e35d4d8eSmrgdnl 
9785e35d4d8eSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9786e35d4d8eSmrgdnl copy of this software and associated documentation files (the "Software"),
9787e35d4d8eSmrgdnl to deal in the Software without restriction, including without limitation
9788e35d4d8eSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9789e35d4d8eSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
9790e35d4d8eSmrgdnl Software is furnished to do so, subject to the following conditions:
9791e35d4d8eSmrgdnl
9792e35d4d8eSmrgdnl The above copyright notice and this permission notice (including the next
9793e35d4d8eSmrgdnl paragraph) shall be included in all copies or substantial portions of the
9794e35d4d8eSmrgdnl Software.
9795e35d4d8eSmrgdnl
9796e35d4d8eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9797e35d4d8eSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9798e35d4d8eSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9799e35d4d8eSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9800e35d4d8eSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9801e35d4d8eSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9802e35d4d8eSmrgdnl DEALINGS IN THE SOFTWARE.
980332b578d3Smrg
9804e35d4d8eSmrg# XORG_MACROS_VERSION(required-version)
9805e35d4d8eSmrg# -------------------------------------
98062a51b5beSmrg# Minimum version: 1.1.0
9807d31dbc53Smrg#
9808e35d4d8eSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9809e35d4d8eSmrg# your configure.ac with the minimum required version, such as:
9810e35d4d8eSmrg# XORG_MACROS_VERSION(1.1)
98111b12faf6Smrg#
9812e35d4d8eSmrg# To ensure that this macro is defined, also add:
9813e35d4d8eSmrg# m4_ifndef([XORG_MACROS_VERSION],
9814e35d4d8eSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
98151b12faf6Smrg#
9816d31dbc53Smrg#
9817e35d4d8eSmrg# See the "minimum version" comment for each macro you use to see what 
9818e35d4d8eSmrg# version you require.
9819e35d4d8eSmrgm4_defun([XORG_MACROS_VERSION],[
9820e35d4d8eSmrgm4_define([vers_have], [1.17])
9821e35d4d8eSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9822e35d4d8eSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9823e35d4d8eSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9824e35d4d8eSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9825e35d4d8eSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9826e35d4d8eSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9827e35d4d8eSmrgm4_undefine([vers_have])
9828e35d4d8eSmrgm4_undefine([maj_have])
9829e35d4d8eSmrgm4_undefine([maj_needed])
9830e35d4d8eSmrg]) # XORG_MACROS_VERSION
98311b12faf6Smrg
9832e35d4d8eSmrg# XORG_PROG_RAWCPP()
9833e35d4d8eSmrg# ------------------
9834e35d4d8eSmrg# Minimum version: 1.0.0
9835e35d4d8eSmrg#
9836e35d4d8eSmrg# Find cpp program and necessary flags for use in pre-processing text files
9837e35d4d8eSmrg# such as man pages and config files
9838e35d4d8eSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9839e35d4d8eSmrgAC_REQUIRE([AC_PROG_CPP])
9840e35d4d8eSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9841e35d4d8eSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
98421b12faf6Smrg
9843e35d4d8eSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9844e35d4d8eSmrg# which is not the best choice for supporting other OS'es, but covers most
9845e35d4d8eSmrg# of the ones we need for now.
9846e35d4d8eSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9847e35d4d8eSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9848e35d4d8eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9849e35d4d8eSmrg	AC_MSG_RESULT([no])
98502a51b5beSmrgelse
9851e35d4d8eSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9852e35d4d8eSmrg		RAWCPPFLAGS=-undef
9853e35d4d8eSmrg		AC_MSG_RESULT([yes])
9854e35d4d8eSmrg	# under Cygwin unix is still defined even with -undef
9855e35d4d8eSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9856e35d4d8eSmrg		RAWCPPFLAGS="-undef -ansi"
9857e35d4d8eSmrg		AC_MSG_RESULT([yes, with -ansi])
9858e35d4d8eSmrg	else
9859e35d4d8eSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9860e35d4d8eSmrg	fi
98612a51b5beSmrgfi
9862e35d4d8eSmrgrm -f conftest.$ac_ext
98631b12faf6Smrg
9864e35d4d8eSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9865e35d4d8eSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9866e35d4d8eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9867e35d4d8eSmrg	AC_MSG_RESULT([no])
9868e35d4d8eSmrgelse
9869e35d4d8eSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9870e35d4d8eSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9871e35d4d8eSmrg		AC_MSG_RESULT([yes])
9872e35d4d8eSmrg	else
9873e35d4d8eSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9874e35d4d8eSmrg	fi
98752a51b5beSmrgfi
9876e35d4d8eSmrgrm -f conftest.$ac_ext
9877e35d4d8eSmrgAC_SUBST(RAWCPPFLAGS)
9878e35d4d8eSmrg]) # XORG_PROG_RAWCPP
987932b578d3Smrg
9880e35d4d8eSmrg# XORG_MANPAGE_SECTIONS()
9881e35d4d8eSmrg# -----------------------
9882e35d4d8eSmrg# Minimum version: 1.0.0
98831b12faf6Smrg#
9884e35d4d8eSmrg# Determine which sections man pages go in for the different man page types
9885e35d4d8eSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9886e35d4d8eSmrg# Not sure if there's any better way than just hardcoding by OS name.
9887e35d4d8eSmrg# Override default settings by setting environment variables
9888e35d4d8eSmrg# Added MAN_SUBSTS in version 1.8
9889e35d4d8eSmrg# Added AC_PROG_SED in version 1.8
98902a51b5beSmrg
9891e35d4d8eSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9892e35d4d8eSmrgAC_REQUIRE([AC_CANONICAL_HOST])
9893e35d4d8eSmrgAC_REQUIRE([AC_PROG_SED])
98941b12faf6Smrg
9895e35d4d8eSmrgif test x$APP_MAN_SUFFIX = x    ; then
9896e35d4d8eSmrg    APP_MAN_SUFFIX=1
9897e35d4d8eSmrgfi
9898e35d4d8eSmrgif test x$APP_MAN_DIR = x    ; then
9899e35d4d8eSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9900e35d4d8eSmrgfi
9901e35d4d8eSmrg
9902e35d4d8eSmrgif test x$LIB_MAN_SUFFIX = x    ; then
9903e35d4d8eSmrg    LIB_MAN_SUFFIX=3
9904e35d4d8eSmrgfi
9905e35d4d8eSmrgif test x$LIB_MAN_DIR = x    ; then
9906e35d4d8eSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
99072a51b5beSmrgfi
99081b12faf6Smrg
9909e35d4d8eSmrgif test x$FILE_MAN_SUFFIX = x    ; then
9910e35d4d8eSmrg    case $host_os in
9911e35d4d8eSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9912e35d4d8eSmrg	*)		FILE_MAN_SUFFIX=5  ;;
9913e35d4d8eSmrg    esac
9914e35d4d8eSmrgfi
9915e35d4d8eSmrgif test x$FILE_MAN_DIR = x    ; then
9916e35d4d8eSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9917e35d4d8eSmrgfi
991832b578d3Smrg
9919e35d4d8eSmrgif test x$MISC_MAN_SUFFIX = x    ; then
9920e35d4d8eSmrg    case $host_os in
9921e35d4d8eSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9922e35d4d8eSmrg	*)		MISC_MAN_SUFFIX=7  ;;
99232a51b5beSmrg    esac
99242a51b5beSmrgfi
9925e35d4d8eSmrgif test x$MISC_MAN_DIR = x    ; then
9926e35d4d8eSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9927e35d4d8eSmrgfi
99281b12faf6Smrg
9929e35d4d8eSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9930e35d4d8eSmrg    case $host_os in
9931e35d4d8eSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9932e35d4d8eSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9933e35d4d8eSmrg    esac
9934e35d4d8eSmrgfi
9935e35d4d8eSmrgif test x$DRIVER_MAN_DIR = x    ; then
9936e35d4d8eSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9937e35d4d8eSmrgfi
99381b12faf6Smrg
9939e35d4d8eSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9940e35d4d8eSmrg    case $host_os in
9941e35d4d8eSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9942e35d4d8eSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9943e35d4d8eSmrg    esac
9944e35d4d8eSmrgfi
9945e35d4d8eSmrgif test x$ADMIN_MAN_DIR = x    ; then
9946e35d4d8eSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
99471b12faf6Smrgfi
99481b12faf6Smrg
99491b12faf6Smrg
9950e35d4d8eSmrgAC_SUBST([APP_MAN_SUFFIX])
9951e35d4d8eSmrgAC_SUBST([LIB_MAN_SUFFIX])
9952e35d4d8eSmrgAC_SUBST([FILE_MAN_SUFFIX])
9953e35d4d8eSmrgAC_SUBST([MISC_MAN_SUFFIX])
9954e35d4d8eSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9955e35d4d8eSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9956e35d4d8eSmrgAC_SUBST([APP_MAN_DIR])
9957e35d4d8eSmrgAC_SUBST([LIB_MAN_DIR])
9958e35d4d8eSmrgAC_SUBST([FILE_MAN_DIR])
9959e35d4d8eSmrgAC_SUBST([MISC_MAN_DIR])
9960e35d4d8eSmrgAC_SUBST([DRIVER_MAN_DIR])
9961e35d4d8eSmrgAC_SUBST([ADMIN_MAN_DIR])
996232b578d3Smrg
9963e35d4d8eSmrgXORG_MAN_PAGE="X Version 11"
9964e35d4d8eSmrgAC_SUBST([XORG_MAN_PAGE])
9965e35d4d8eSmrgMAN_SUBSTS="\
9966e35d4d8eSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9967e35d4d8eSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9968e35d4d8eSmrg	-e 's|__xservername__|Xorg|g' \
9969e35d4d8eSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
9970e35d4d8eSmrg	-e 's|__projectroot__|\$(prefix)|g' \
9971e35d4d8eSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9972e35d4d8eSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9973e35d4d8eSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9974e35d4d8eSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9975e35d4d8eSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9976e35d4d8eSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9977e35d4d8eSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9978e35d4d8eSmrgAC_SUBST([MAN_SUBSTS])
997932b578d3Smrg
9980e35d4d8eSmrg]) # XORG_MANPAGE_SECTIONS
9981e35d4d8eSmrg
9982e35d4d8eSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9983e35d4d8eSmrg# ------------------------
9984e35d4d8eSmrg# Minimum version: 1.7.0
99852a51b5beSmrg#
9986e35d4d8eSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9987e35d4d8eSmrg# provided by xorg-sgml-doctools, if installed.
9988e35d4d8eSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9989e35d4d8eSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9990e35d4d8eSmrgXORG_SGML_PATH=
9991e35d4d8eSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9992e35d4d8eSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9993e35d4d8eSmrg    [m4_ifval([$1],[:],
9994e35d4d8eSmrg        [if test x"$cross_compiling" != x"yes" ; then
9995e35d4d8eSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9996e35d4d8eSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9997e35d4d8eSmrg         fi])
9998e35d4d8eSmrg    ])
9999e35d4d8eSmrg
10000e35d4d8eSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10001e35d4d8eSmrg# the path and the name of the doc stylesheet
10002e35d4d8eSmrgif test "x$XORG_SGML_PATH" != "x" ; then
10003e35d4d8eSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
10004e35d4d8eSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10005e35d4d8eSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10006e35d4d8eSmrgelse
10007e35d4d8eSmrg   AC_MSG_RESULT([no])
10008e35d4d8eSmrgfi
10009e35d4d8eSmrg
10010e35d4d8eSmrgAC_SUBST(XORG_SGML_PATH)
10011e35d4d8eSmrgAC_SUBST(STYLESHEET_SRCDIR)
10012e35d4d8eSmrgAC_SUBST(XSL_STYLESHEET)
10013e35d4d8eSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10014e35d4d8eSmrg]) # XORG_CHECK_SGML_DOCTOOLS
10015e35d4d8eSmrg
10016e35d4d8eSmrg# XORG_CHECK_LINUXDOC
10017e35d4d8eSmrg# -------------------
10018e35d4d8eSmrg# Minimum version: 1.0.0
100192a51b5beSmrg#
10020e35d4d8eSmrg# Defines the variable MAKE_TEXT if the necessary tools and
10021e35d4d8eSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10022e35d4d8eSmrg# Whether or not the necessary tools and files are found can be checked
10023e35d4d8eSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10024e35d4d8eSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
10025e35d4d8eSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10026e35d4d8eSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1002732b578d3Smrg
10028e35d4d8eSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
10029e35d4d8eSmrg
10030e35d4d8eSmrgAC_MSG_CHECKING([whether to build documentation])
100311b12faf6Smrg
10032e35d4d8eSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10033e35d4d8eSmrg   BUILDDOC=yes
10034e35d4d8eSmrgelse
10035e35d4d8eSmrg   BUILDDOC=no
10036e35d4d8eSmrgfi
100371b12faf6Smrg
10038e35d4d8eSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
100391b12faf6Smrg
10040e35d4d8eSmrgAC_MSG_RESULT([$BUILDDOC])
1004132b578d3Smrg
10042e35d4d8eSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1004332b578d3Smrg
10044e35d4d8eSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10045e35d4d8eSmrg   BUILDPDFDOC=yes
10046e35d4d8eSmrgelse
10047e35d4d8eSmrg   BUILDPDFDOC=no
10048e35d4d8eSmrgfi
1004932b578d3Smrg
10050e35d4d8eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1005132b578d3Smrg
10052e35d4d8eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10053e35d4d8eSmrg
10054e35d4d8eSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10055e35d4d8eSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10056e35d4d8eSmrgMAKE_PDF="$PS2PDF"
10057e35d4d8eSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10058e35d4d8eSmrg
10059e35d4d8eSmrgAC_SUBST(MAKE_TEXT)
10060e35d4d8eSmrgAC_SUBST(MAKE_PS)
10061e35d4d8eSmrgAC_SUBST(MAKE_PDF)
10062e35d4d8eSmrgAC_SUBST(MAKE_HTML)
10063e35d4d8eSmrg]) # XORG_CHECK_LINUXDOC
1006432b578d3Smrg
10065e35d4d8eSmrg# XORG_CHECK_DOCBOOK
10066e35d4d8eSmrg# -------------------
10067e35d4d8eSmrg# Minimum version: 1.0.0
100682a51b5beSmrg#
10069e35d4d8eSmrg# Checks for the ability to build output formats from SGML DocBook source.
10070e35d4d8eSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10071e35d4d8eSmrg# indicates whether the necessary tools and files are found and, if set,
10072e35d4d8eSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10073e35d4d8eSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
10074e35d4d8eSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
100752a51b5beSmrg
10076e35d4d8eSmrgBUILDTXTDOC=no
10077e35d4d8eSmrgBUILDPDFDOC=no
10078e35d4d8eSmrgBUILDPSDOC=no
10079e35d4d8eSmrgBUILDHTMLDOC=no
10080e35d4d8eSmrg
10081e35d4d8eSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
10082e35d4d8eSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10083e35d4d8eSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
10084e35d4d8eSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10085e35d4d8eSmrg
10086e35d4d8eSmrgAC_MSG_CHECKING([whether to build text documentation])
10087e35d4d8eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10088e35d4d8eSmrg   test x$BUILD_TXTDOC != xno; then
10089e35d4d8eSmrg	BUILDTXTDOC=yes
10090e35d4d8eSmrgfi
10091e35d4d8eSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10092e35d4d8eSmrgAC_MSG_RESULT([$BUILDTXTDOC])
10093e35d4d8eSmrg
10094e35d4d8eSmrgAC_MSG_CHECKING([whether to build PDF documentation])
10095e35d4d8eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10096e35d4d8eSmrg   test x$BUILD_PDFDOC != xno; then
10097e35d4d8eSmrg	BUILDPDFDOC=yes
10098e35d4d8eSmrgfi
10099e35d4d8eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10100e35d4d8eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10101e35d4d8eSmrg
10102e35d4d8eSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
10103e35d4d8eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10104e35d4d8eSmrg   test x$BUILD_PSDOC != xno; then
10105e35d4d8eSmrg	BUILDPSDOC=yes
10106e35d4d8eSmrgfi
10107e35d4d8eSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10108e35d4d8eSmrgAC_MSG_RESULT([$BUILDPSDOC])
10109e35d4d8eSmrg
10110e35d4d8eSmrgAC_MSG_CHECKING([whether to build HTML documentation])
10111e35d4d8eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10112e35d4d8eSmrg   test x$BUILD_HTMLDOC != xno; then
10113e35d4d8eSmrg	BUILDHTMLDOC=yes
10114e35d4d8eSmrgfi
10115e35d4d8eSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10116e35d4d8eSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10117e35d4d8eSmrg
10118e35d4d8eSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10119e35d4d8eSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10120e35d4d8eSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10121e35d4d8eSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10122e35d4d8eSmrg
10123e35d4d8eSmrgAC_SUBST(MAKE_TEXT)
10124e35d4d8eSmrgAC_SUBST(MAKE_PS)
10125e35d4d8eSmrgAC_SUBST(MAKE_PDF)
10126e35d4d8eSmrgAC_SUBST(MAKE_HTML)
10127e35d4d8eSmrg]) # XORG_CHECK_DOCBOOK
10128e35d4d8eSmrg
10129e35d4d8eSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10130e35d4d8eSmrg# ----------------
10131e35d4d8eSmrg# Minimum version: 1.5.0
10132e35d4d8eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
101332a51b5beSmrg#
10134e35d4d8eSmrg# Documentation tools are not always available on all platforms and sometimes
10135e35d4d8eSmrg# not at the appropriate level. This macro enables a module to test for the
10136e35d4d8eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10137e35d4d8eSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
10138e35d4d8eSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
10139e35d4d8eSmrg# --with-xmlto assumes 'auto'.
101402a51b5beSmrg#
10141e35d4d8eSmrg# Interface to module:
10142e35d4d8eSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10143e35d4d8eSmrg# XMLTO:	returns the path of the xmlto program found
10144e35d4d8eSmrg#		returns the path set by the user in the environment
10145e35d4d8eSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
10146e35d4d8eSmrg#		'no' user instructs the module not to use xmlto
101472a51b5beSmrg#
10148e35d4d8eSmrg# Added in version 1.10.0
10149e35d4d8eSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10150e35d4d8eSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
101512a51b5beSmrg#
10152e35d4d8eSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
101532a51b5beSmrg#
10154e35d4d8eSmrgAC_DEFUN([XORG_WITH_XMLTO],[
10155e35d4d8eSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
10156e35d4d8eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10157e35d4d8eSmrgAC_ARG_WITH(xmlto,
10158e35d4d8eSmrg	AS_HELP_STRING([--with-xmlto],
10159e35d4d8eSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10160e35d4d8eSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10161e35d4d8eSmrgm4_undefine([_defopt])
1016232b578d3Smrg
10163e35d4d8eSmrgif test "x$use_xmlto" = x"auto"; then
10164e35d4d8eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
10165e35d4d8eSmrg   if test "x$XMLTO" = "x"; then
10166e35d4d8eSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10167e35d4d8eSmrg	have_xmlto=no
10168e35d4d8eSmrg   else
10169e35d4d8eSmrg        have_xmlto=yes
10170e35d4d8eSmrg   fi
10171e35d4d8eSmrgelif test "x$use_xmlto" = x"yes" ; then
10172e35d4d8eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
10173e35d4d8eSmrg   if test "x$XMLTO" = "x"; then
10174e35d4d8eSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10175e35d4d8eSmrg   fi
10176e35d4d8eSmrg   have_xmlto=yes
10177e35d4d8eSmrgelif test "x$use_xmlto" = x"no" ; then
10178e35d4d8eSmrg   if test "x$XMLTO" != "x"; then
10179e35d4d8eSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10180e35d4d8eSmrg   fi
10181e35d4d8eSmrg   have_xmlto=no
10182e35d4d8eSmrgelse
10183e35d4d8eSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10184e35d4d8eSmrgfi
1018532b578d3Smrg
10186e35d4d8eSmrg# Test for a minimum version of xmlto, if provided.
10187e35d4d8eSmrgm4_ifval([$1],
10188e35d4d8eSmrg[if test "$have_xmlto" = yes; then
10189e35d4d8eSmrg    # scrape the xmlto version
10190e35d4d8eSmrg    AC_MSG_CHECKING([the xmlto version])
10191e35d4d8eSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10192e35d4d8eSmrg    AC_MSG_RESULT([$xmlto_version])
10193e35d4d8eSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
10194e35d4d8eSmrg        [if test "x$use_xmlto" = xauto; then
10195e35d4d8eSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10196e35d4d8eSmrg            have_xmlto=no
10197e35d4d8eSmrg        else
10198e35d4d8eSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10199e35d4d8eSmrg        fi])
10200e35d4d8eSmrgfi])
1020132b578d3Smrg
10202e35d4d8eSmrg# Test for the ability of xmlto to generate a text target
10203e35d4d8eSmrghave_xmlto_text=no
10204e35d4d8eSmrgcat > conftest.xml << "EOF"
10205e35d4d8eSmrgEOF
10206e35d4d8eSmrgAS_IF([test "$have_xmlto" = yes],
10207e35d4d8eSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10208e35d4d8eSmrg             [have_xmlto_text=yes],
10209e35d4d8eSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10210e35d4d8eSmrgrm -f conftest.xml
10211e35d4d8eSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10212e35d4d8eSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10213e35d4d8eSmrg]) # XORG_WITH_XMLTO
1021432b578d3Smrg
10215e35d4d8eSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10216e35d4d8eSmrg# --------------------------------------------
10217e35d4d8eSmrg# Minimum version: 1.12.0
10218e35d4d8eSmrg# Minimum version for optional DEFAULT argument: 1.12.0
10219e35d4d8eSmrg#
10220e35d4d8eSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10221e35d4d8eSmrg# XML-based language used for the transformation of XML documents.
10222e35d4d8eSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10223e35d4d8eSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
10224e35d4d8eSmrg# The XSLT processor is often used as a standalone tool for transformations.
10225e35d4d8eSmrg# It should not be assumed that this tool is used only to work with documnetation.
10226e35d4d8eSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10227e35d4d8eSmrg#
10228e35d4d8eSmrg# Interface to module:
10229e35d4d8eSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10230e35d4d8eSmrg# XSLTPROC:	 returns the path of the xsltproc program found
10231e35d4d8eSmrg#		 returns the path set by the user in the environment
10232e35d4d8eSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10233e35d4d8eSmrg#		  'no' user instructs the module not to use xsltproc
10234e35d4d8eSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
10235e35d4d8eSmrg#
10236e35d4d8eSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10237e35d4d8eSmrg#
10238e35d4d8eSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
10239e35d4d8eSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10240e35d4d8eSmrg# Preserves the interface, should it be implemented later
10241e35d4d8eSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10242e35d4d8eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10243e35d4d8eSmrgAC_ARG_WITH(xsltproc,
10244e35d4d8eSmrg	AS_HELP_STRING([--with-xsltproc],
10245e35d4d8eSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10246e35d4d8eSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10247e35d4d8eSmrgm4_undefine([_defopt])
10248e35d4d8eSmrg
10249e35d4d8eSmrgif test "x$use_xsltproc" = x"auto"; then
10250e35d4d8eSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10251e35d4d8eSmrg   if test "x$XSLTPROC" = "x"; then
10252e35d4d8eSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10253e35d4d8eSmrg	have_xsltproc=no
10254e35d4d8eSmrg   else
10255e35d4d8eSmrg        have_xsltproc=yes
10256e35d4d8eSmrg   fi
10257e35d4d8eSmrgelif test "x$use_xsltproc" = x"yes" ; then
10258e35d4d8eSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10259e35d4d8eSmrg   if test "x$XSLTPROC" = "x"; then
10260e35d4d8eSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10261e35d4d8eSmrg   fi
10262e35d4d8eSmrg   have_xsltproc=yes
10263e35d4d8eSmrgelif test "x$use_xsltproc" = x"no" ; then
10264e35d4d8eSmrg   if test "x$XSLTPROC" != "x"; then
10265e35d4d8eSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10266e35d4d8eSmrg   fi
10267e35d4d8eSmrg   have_xsltproc=no
102682a51b5beSmrgelse
10269e35d4d8eSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
102702a51b5beSmrgfi
1027132b578d3Smrg
10272e35d4d8eSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10273e35d4d8eSmrg]) # XORG_WITH_XSLTPROC
1027432b578d3Smrg
10275e35d4d8eSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10276e35d4d8eSmrg# ----------------------------------------
10277e35d4d8eSmrg# Minimum version: 1.15.0
102782a51b5beSmrg#
10279e35d4d8eSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
10280e35d4d8eSmrg# scanning arbitrary text files, extracting information from those text files,
10281e35d4d8eSmrg# and printing reports based on that information.
10282e35d4d8eSmrg#
10283e35d4d8eSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
10284e35d4d8eSmrg#
10285e35d4d8eSmrg# Interface to module:
10286e35d4d8eSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
10287e35d4d8eSmrg# PERL:	     returns the path of the perl program found
10288e35d4d8eSmrg#	     returns the path set by the user in the environment
10289e35d4d8eSmrg# --with-perl: 'yes' user instructs the module to use perl
10290e35d4d8eSmrg#	       'no' user instructs the module not to use perl
10291e35d4d8eSmrg# have_perl: returns yes if perl found in PATH or no
10292e35d4d8eSmrg#
10293e35d4d8eSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10294e35d4d8eSmrg#
10295e35d4d8eSmrgAC_DEFUN([XORG_WITH_PERL],[
10296e35d4d8eSmrgAC_ARG_VAR([PERL], [Path to perl command])
10297e35d4d8eSmrg# Preserves the interface, should it be implemented later
10298e35d4d8eSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10299e35d4d8eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10300e35d4d8eSmrgAC_ARG_WITH(perl,
10301e35d4d8eSmrg	AS_HELP_STRING([--with-perl],
10302e35d4d8eSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
10303e35d4d8eSmrg	   [use_perl=$withval], [use_perl=]_defopt)
10304e35d4d8eSmrgm4_undefine([_defopt])
10305e35d4d8eSmrg
10306e35d4d8eSmrgif test "x$use_perl" = x"auto"; then
10307e35d4d8eSmrg   AC_PATH_PROG([PERL], [perl])
10308e35d4d8eSmrg   if test "x$PERL" = "x"; then
10309e35d4d8eSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
10310e35d4d8eSmrg	have_perl=no
10311e35d4d8eSmrg   else
10312e35d4d8eSmrg        have_perl=yes
10313e35d4d8eSmrg   fi
10314e35d4d8eSmrgelif test "x$use_perl" = x"yes" ; then
10315e35d4d8eSmrg   AC_PATH_PROG([PERL], [perl])
10316e35d4d8eSmrg   if test "x$PERL" = "x"; then
10317e35d4d8eSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10318e35d4d8eSmrg   fi
10319e35d4d8eSmrg   have_perl=yes
10320e35d4d8eSmrgelif test "x$use_perl" = x"no" ; then
10321e35d4d8eSmrg   if test "x$PERL" != "x"; then
10322e35d4d8eSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10323e35d4d8eSmrg   fi
10324e35d4d8eSmrg   have_perl=no
10325e35d4d8eSmrgelse
10326e35d4d8eSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10327e35d4d8eSmrgfi
1032832b578d3Smrg
10329e35d4d8eSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10330e35d4d8eSmrg]) # XORG_WITH_PERL
1033132b578d3Smrg
10332e35d4d8eSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10333e35d4d8eSmrg# ----------------
10334e35d4d8eSmrg# Minimum version: 1.5.0
10335e35d4d8eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10336e35d4d8eSmrg#
10337e35d4d8eSmrg# Documentation tools are not always available on all platforms and sometimes
10338e35d4d8eSmrg# not at the appropriate level. This macro enables a module to test for the
10339e35d4d8eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10340e35d4d8eSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10341e35d4d8eSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10342e35d4d8eSmrg# --with-asciidoc assumes 'auto'.
10343e35d4d8eSmrg#
10344e35d4d8eSmrg# Interface to module:
10345e35d4d8eSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10346e35d4d8eSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
10347e35d4d8eSmrg#		 returns the path set by the user in the environment
10348e35d4d8eSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10349e35d4d8eSmrg#		  'no' user instructs the module not to use asciidoc
10350e35d4d8eSmrg#
10351e35d4d8eSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10352e35d4d8eSmrg#
10353e35d4d8eSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
10354e35d4d8eSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10355e35d4d8eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10356e35d4d8eSmrgAC_ARG_WITH(asciidoc,
10357e35d4d8eSmrg	AS_HELP_STRING([--with-asciidoc],
10358e35d4d8eSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10359e35d4d8eSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10360e35d4d8eSmrgm4_undefine([_defopt])
1036132b578d3Smrg
10362e35d4d8eSmrgif test "x$use_asciidoc" = x"auto"; then
10363e35d4d8eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10364e35d4d8eSmrg   if test "x$ASCIIDOC" = "x"; then
10365e35d4d8eSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10366e35d4d8eSmrg	have_asciidoc=no
10367e35d4d8eSmrg   else
10368e35d4d8eSmrg        have_asciidoc=yes
10369e35d4d8eSmrg   fi
10370e35d4d8eSmrgelif test "x$use_asciidoc" = x"yes" ; then
10371e35d4d8eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10372e35d4d8eSmrg   if test "x$ASCIIDOC" = "x"; then
10373e35d4d8eSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10374e35d4d8eSmrg   fi
10375e35d4d8eSmrg   have_asciidoc=yes
10376e35d4d8eSmrgelif test "x$use_asciidoc" = x"no" ; then
10377e35d4d8eSmrg   if test "x$ASCIIDOC" != "x"; then
10378e35d4d8eSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10379e35d4d8eSmrg   fi
10380e35d4d8eSmrg   have_asciidoc=no
10381e35d4d8eSmrgelse
10382e35d4d8eSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10383e35d4d8eSmrgfi
10384e35d4d8eSmrgm4_ifval([$1],
10385e35d4d8eSmrg[if test "$have_asciidoc" = yes; then
10386e35d4d8eSmrg    # scrape the asciidoc version
10387e35d4d8eSmrg    AC_MSG_CHECKING([the asciidoc version])
10388e35d4d8eSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10389e35d4d8eSmrg    AC_MSG_RESULT([$asciidoc_version])
10390e35d4d8eSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10391e35d4d8eSmrg        [if test "x$use_asciidoc" = xauto; then
10392e35d4d8eSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10393e35d4d8eSmrg            have_asciidoc=no
10394e35d4d8eSmrg        else
10395e35d4d8eSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10396e35d4d8eSmrg        fi])
10397e35d4d8eSmrgfi])
10398e35d4d8eSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10399e35d4d8eSmrg]) # XORG_WITH_ASCIIDOC
104002a51b5beSmrg
10401e35d4d8eSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10402e35d4d8eSmrg# --------------------------------
10403e35d4d8eSmrg# Minimum version: 1.5.0
10404e35d4d8eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10405e35d4d8eSmrg#
10406e35d4d8eSmrg# Documentation tools are not always available on all platforms and sometimes
10407e35d4d8eSmrg# not at the appropriate level. This macro enables a module to test for the
10408e35d4d8eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10409e35d4d8eSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
10410e35d4d8eSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
10411e35d4d8eSmrg# --with-doxygen assumes 'auto'.
10412e35d4d8eSmrg#
10413e35d4d8eSmrg# Interface to module:
10414e35d4d8eSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10415e35d4d8eSmrg# DOXYGEN:	 returns the path of the doxygen program found
10416e35d4d8eSmrg#		 returns the path set by the user in the environment
10417e35d4d8eSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
10418e35d4d8eSmrg#		  'no' user instructs the module not to use doxygen
10419e35d4d8eSmrg#
10420e35d4d8eSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10421e35d4d8eSmrg#
10422e35d4d8eSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
10423e35d4d8eSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10424e35d4d8eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10425e35d4d8eSmrgAC_ARG_WITH(doxygen,
10426e35d4d8eSmrg	AS_HELP_STRING([--with-doxygen],
10427e35d4d8eSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10428e35d4d8eSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10429e35d4d8eSmrgm4_undefine([_defopt])
1043032b578d3Smrg
10431e35d4d8eSmrgif test "x$use_doxygen" = x"auto"; then
10432e35d4d8eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10433e35d4d8eSmrg   if test "x$DOXYGEN" = "x"; then
10434e35d4d8eSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10435e35d4d8eSmrg	have_doxygen=no
10436e35d4d8eSmrg   else
10437e35d4d8eSmrg        have_doxygen=yes
10438e35d4d8eSmrg   fi
10439e35d4d8eSmrgelif test "x$use_doxygen" = x"yes" ; then
10440e35d4d8eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10441e35d4d8eSmrg   if test "x$DOXYGEN" = "x"; then
10442e35d4d8eSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10443e35d4d8eSmrg   fi
10444e35d4d8eSmrg   have_doxygen=yes
10445e35d4d8eSmrgelif test "x$use_doxygen" = x"no" ; then
10446e35d4d8eSmrg   if test "x$DOXYGEN" != "x"; then
10447e35d4d8eSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10448e35d4d8eSmrg   fi
10449e35d4d8eSmrg   have_doxygen=no
104502a51b5beSmrgelse
10451e35d4d8eSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
104522a51b5beSmrgfi
10453e35d4d8eSmrgm4_ifval([$1],
10454e35d4d8eSmrg[if test "$have_doxygen" = yes; then
10455e35d4d8eSmrg    # scrape the doxygen version
10456e35d4d8eSmrg    AC_MSG_CHECKING([the doxygen version])
10457e35d4d8eSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10458e35d4d8eSmrg    AC_MSG_RESULT([$doxygen_version])
10459e35d4d8eSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
10460e35d4d8eSmrg        [if test "x$use_doxygen" = xauto; then
10461e35d4d8eSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10462e35d4d8eSmrg            have_doxygen=no
10463e35d4d8eSmrg        else
10464e35d4d8eSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10465e35d4d8eSmrg        fi])
10466e35d4d8eSmrgfi])
10467e35d4d8eSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10468e35d4d8eSmrg]) # XORG_WITH_DOXYGEN
1046932b578d3Smrg
10470e35d4d8eSmrg# XORG_WITH_GROFF([DEFAULT])
10471e35d4d8eSmrg# ----------------
10472e35d4d8eSmrg# Minimum version: 1.6.0
10473e35d4d8eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10474e35d4d8eSmrg#
10475e35d4d8eSmrg# Documentation tools are not always available on all platforms and sometimes
10476e35d4d8eSmrg# not at the appropriate level. This macro enables a module to test for the
10477e35d4d8eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10478e35d4d8eSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
10479e35d4d8eSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
10480e35d4d8eSmrg# --with-groff assumes 'auto'.
10481e35d4d8eSmrg#
10482e35d4d8eSmrg# Interface to module:
10483e35d4d8eSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10484e35d4d8eSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10485e35d4d8eSmrg# HAVE_GROFF_MS: the -ms macros package
10486e35d4d8eSmrg# GROFF:	 returns the path of the groff program found
10487e35d4d8eSmrg#		 returns the path set by the user in the environment
10488e35d4d8eSmrg# --with-groff:	 'yes' user instructs the module to use groff
10489e35d4d8eSmrg#		 'no' user instructs the module not to use groff
10490e35d4d8eSmrg#
10491e35d4d8eSmrg# Added in version 1.9.0:
10492e35d4d8eSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10493e35d4d8eSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10494e35d4d8eSmrg#		   psselect from the psutils package.
10495e35d4d8eSmrg#		   the ghostcript package. Refer to the grohtml man pages
10496e35d4d8eSmrg#
10497e35d4d8eSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10498e35d4d8eSmrg#
10499e35d4d8eSmrg# OS and distros often splits groff in a basic and full package, the former
10500e35d4d8eSmrg# having the groff program and the later having devices, fonts and macros
10501e35d4d8eSmrg# Checking for the groff executable is not enough.
10502e35d4d8eSmrg#
10503e35d4d8eSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
10504e35d4d8eSmrg# unset HAVE_GROFF or GROFF env variables.
10505e35d4d8eSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10506e35d4d8eSmrg#
10507e35d4d8eSmrgAC_DEFUN([XORG_WITH_GROFF],[
10508e35d4d8eSmrgAC_ARG_VAR([GROFF], [Path to groff command])
10509e35d4d8eSmrgm4_define([_defopt], m4_default([$1], [auto]))
10510e35d4d8eSmrgAC_ARG_WITH(groff,
10511e35d4d8eSmrg	AS_HELP_STRING([--with-groff],
10512e35d4d8eSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10513e35d4d8eSmrg	   [use_groff=$withval], [use_groff=]_defopt)
10514e35d4d8eSmrgm4_undefine([_defopt])
1051532b578d3Smrg
10516e35d4d8eSmrgif test "x$use_groff" = x"auto"; then
10517e35d4d8eSmrg   AC_PATH_PROG([GROFF], [groff])
10518e35d4d8eSmrg   if test "x$GROFF" = "x"; then
10519e35d4d8eSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10520e35d4d8eSmrg	have_groff=no
10521e35d4d8eSmrg   else
10522e35d4d8eSmrg        have_groff=yes
10523e35d4d8eSmrg   fi
10524e35d4d8eSmrgelif test "x$use_groff" = x"yes" ; then
10525e35d4d8eSmrg   AC_PATH_PROG([GROFF], [groff])
10526e35d4d8eSmrg   if test "x$GROFF" = "x"; then
10527e35d4d8eSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10528e35d4d8eSmrg   fi
10529e35d4d8eSmrg   have_groff=yes
10530e35d4d8eSmrgelif test "x$use_groff" = x"no" ; then
10531e35d4d8eSmrg   if test "x$GROFF" != "x"; then
10532e35d4d8eSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10533e35d4d8eSmrg   fi
10534e35d4d8eSmrg   have_groff=no
10535e35d4d8eSmrgelse
10536e35d4d8eSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10537e35d4d8eSmrgfi
1053832b578d3Smrg
10539e35d4d8eSmrg# We have groff, test for the presence of the macro packages
10540e35d4d8eSmrgif test "x$have_groff" = x"yes"; then
10541e35d4d8eSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10542e35d4d8eSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10543e35d4d8eSmrg        groff_ms_works=yes
10544e35d4d8eSmrg    else
10545e35d4d8eSmrg        groff_ms_works=no
10546e35d4d8eSmrg    fi
10547e35d4d8eSmrg    AC_MSG_RESULT([$groff_ms_works])
10548e35d4d8eSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10549e35d4d8eSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10550e35d4d8eSmrg        groff_mm_works=yes
10551e35d4d8eSmrg    else
10552e35d4d8eSmrg        groff_mm_works=no
10553e35d4d8eSmrg    fi
10554e35d4d8eSmrg    AC_MSG_RESULT([$groff_mm_works])
10555e35d4d8eSmrgfi
1055632b578d3Smrg
10557e35d4d8eSmrg# We have groff, test for HTML dependencies, one command per package
10558e35d4d8eSmrgif test "x$have_groff" = x"yes"; then
10559e35d4d8eSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10560e35d4d8eSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10561e35d4d8eSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10562e35d4d8eSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10563e35d4d8eSmrg      have_groff_html=yes
10564e35d4d8eSmrg   else
10565e35d4d8eSmrg      have_groff_html=no
10566e35d4d8eSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10567e35d4d8eSmrg   fi
105682a51b5beSmrgfi
1056932b578d3Smrg
10570e35d4d8eSmrg# Set Automake conditionals for Makefiles
10571e35d4d8eSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10572e35d4d8eSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10573e35d4d8eSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10574e35d4d8eSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10575e35d4d8eSmrg]) # XORG_WITH_GROFF
1057632b578d3Smrg
10577e35d4d8eSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10578e35d4d8eSmrg# ---------------------------------------
10579e35d4d8eSmrg# Minimum version: 1.6.0
10580e35d4d8eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10581e35d4d8eSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
105822a51b5beSmrg#
10583e35d4d8eSmrg# Documentation tools are not always available on all platforms and sometimes
10584e35d4d8eSmrg# not at the appropriate level. This macro enables a module to test for the
10585e35d4d8eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10586e35d4d8eSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
10587e35d4d8eSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
10588e35d4d8eSmrg# --with-fop assumes 'auto'.
10589e35d4d8eSmrg#
10590e35d4d8eSmrg# Interface to module:
10591e35d4d8eSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10592e35d4d8eSmrg# FOP:	 	returns the path of the fop program found
10593e35d4d8eSmrg#		returns the path set by the user in the environment
10594e35d4d8eSmrg# --with-fop: 	'yes' user instructs the module to use fop
10595e35d4d8eSmrg#		'no' user instructs the module not to use fop
10596e35d4d8eSmrg#
10597e35d4d8eSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10598e35d4d8eSmrg#
10599e35d4d8eSmrgAC_DEFUN([XORG_WITH_FOP],[
10600e35d4d8eSmrgAC_ARG_VAR([FOP], [Path to fop command])
10601e35d4d8eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10602e35d4d8eSmrgAC_ARG_WITH(fop,
10603e35d4d8eSmrg	AS_HELP_STRING([--with-fop],
10604e35d4d8eSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10605e35d4d8eSmrg	   [use_fop=$withval], [use_fop=]_defopt)
10606e35d4d8eSmrgm4_undefine([_defopt])
106072a51b5beSmrg
10608e35d4d8eSmrgif test "x$use_fop" = x"auto"; then
10609e35d4d8eSmrg   AC_PATH_PROG([FOP], [fop])
10610e35d4d8eSmrg   if test "x$FOP" = "x"; then
10611e35d4d8eSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10612e35d4d8eSmrg	have_fop=no
10613e35d4d8eSmrg   else
10614e35d4d8eSmrg        have_fop=yes
10615e35d4d8eSmrg   fi
10616e35d4d8eSmrgelif test "x$use_fop" = x"yes" ; then
10617e35d4d8eSmrg   AC_PATH_PROG([FOP], [fop])
10618e35d4d8eSmrg   if test "x$FOP" = "x"; then
10619e35d4d8eSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10620e35d4d8eSmrg   fi
10621e35d4d8eSmrg   have_fop=yes
10622e35d4d8eSmrgelif test "x$use_fop" = x"no" ; then
10623e35d4d8eSmrg   if test "x$FOP" != "x"; then
10624e35d4d8eSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10625e35d4d8eSmrg   fi
10626e35d4d8eSmrg   have_fop=no
10627e35d4d8eSmrgelse
10628e35d4d8eSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10629e35d4d8eSmrgfi
1063032b578d3Smrg
10631e35d4d8eSmrg# Test for a minimum version of fop, if provided.
10632e35d4d8eSmrgm4_ifval([$1],
10633e35d4d8eSmrg[if test "$have_fop" = yes; then
10634e35d4d8eSmrg    # scrape the fop version
10635e35d4d8eSmrg    AC_MSG_CHECKING([for fop minimum version])
10636e35d4d8eSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10637e35d4d8eSmrg    AC_MSG_RESULT([$fop_version])
10638e35d4d8eSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
10639e35d4d8eSmrg        [if test "x$use_fop" = xauto; then
10640e35d4d8eSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10641e35d4d8eSmrg            have_fop=no
10642e35d4d8eSmrg        else
10643e35d4d8eSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10644e35d4d8eSmrg        fi])
10645e35d4d8eSmrgfi])
10646e35d4d8eSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10647e35d4d8eSmrg]) # XORG_WITH_FOP
1064832b578d3Smrg
10649e35d4d8eSmrg# XORG_WITH_PS2PDF([DEFAULT])
10650e35d4d8eSmrg# ----------------
10651e35d4d8eSmrg# Minimum version: 1.6.0
10652e35d4d8eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
106532a51b5beSmrg#
10654e35d4d8eSmrg# Documentation tools are not always available on all platforms and sometimes
10655e35d4d8eSmrg# not at the appropriate level. This macro enables a module to test for the
10656e35d4d8eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10657e35d4d8eSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10658e35d4d8eSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10659e35d4d8eSmrg# --with-ps2pdf assumes 'auto'.
106602a51b5beSmrg#
10661e35d4d8eSmrg# Interface to module:
10662e35d4d8eSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10663e35d4d8eSmrg# PS2PDF:	returns the path of the ps2pdf program found
10664e35d4d8eSmrg#		returns the path set by the user in the environment
10665e35d4d8eSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10666e35d4d8eSmrg#		 'no' user instructs the module not to use ps2pdf
10667e35d4d8eSmrg#
10668e35d4d8eSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10669e35d4d8eSmrg#
10670e35d4d8eSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10671e35d4d8eSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10672e35d4d8eSmrgm4_define([_defopt], m4_default([$1], [auto]))
10673e35d4d8eSmrgAC_ARG_WITH(ps2pdf,
10674e35d4d8eSmrg	AS_HELP_STRING([--with-ps2pdf],
10675e35d4d8eSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10676e35d4d8eSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10677e35d4d8eSmrgm4_undefine([_defopt])
1067832b578d3Smrg
10679e35d4d8eSmrgif test "x$use_ps2pdf" = x"auto"; then
10680e35d4d8eSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10681e35d4d8eSmrg   if test "x$PS2PDF" = "x"; then
10682e35d4d8eSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10683e35d4d8eSmrg	have_ps2pdf=no
10684e35d4d8eSmrg   else
10685e35d4d8eSmrg        have_ps2pdf=yes
10686e35d4d8eSmrg   fi
10687e35d4d8eSmrgelif test "x$use_ps2pdf" = x"yes" ; then
10688e35d4d8eSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10689e35d4d8eSmrg   if test "x$PS2PDF" = "x"; then
10690e35d4d8eSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10691e35d4d8eSmrg   fi
10692e35d4d8eSmrg   have_ps2pdf=yes
10693e35d4d8eSmrgelif test "x$use_ps2pdf" = x"no" ; then
10694e35d4d8eSmrg   if test "x$PS2PDF" != "x"; then
10695e35d4d8eSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10696e35d4d8eSmrg   fi
10697e35d4d8eSmrg   have_ps2pdf=no
10698e35d4d8eSmrgelse
10699e35d4d8eSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
107002a51b5beSmrgfi
10701e35d4d8eSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10702e35d4d8eSmrg]) # XORG_WITH_PS2PDF
1070332b578d3Smrg
10704e35d4d8eSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
10705e35d4d8eSmrg# ----------------
10706e35d4d8eSmrg# Minimum version: 1.6.0
10707e35d4d8eSmrg#
10708e35d4d8eSmrg# Documentation tools are not always available on all platforms and sometimes
10709e35d4d8eSmrg# not at the appropriate level. This macro enables a builder to skip all
10710e35d4d8eSmrg# documentation targets except traditional man pages.
10711e35d4d8eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10712e35d4d8eSmrg# maximum flexibilty in controlling documentation building.
10713e35d4d8eSmrg# Refer to:
10714e35d4d8eSmrg# XORG_WITH_XMLTO         --with-xmlto
10715e35d4d8eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10716e35d4d8eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10717e35d4d8eSmrg# XORG_WITH_FOP           --with-fop
10718e35d4d8eSmrg# XORG_WITH_GROFF         --with-groff
10719e35d4d8eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10720e35d4d8eSmrg#
10721e35d4d8eSmrg# Interface to module:
10722e35d4d8eSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10723e35d4d8eSmrg# --enable-docs: 'yes' user instructs the module to generate docs
10724e35d4d8eSmrg#		 'no' user instructs the module not to generate docs
10725e35d4d8eSmrg# parm1:	specify the default value, yes or no.
10726e35d4d8eSmrg#
10727e35d4d8eSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10728e35d4d8eSmrgm4_define([docs_default], m4_default([$1], [yes]))
10729e35d4d8eSmrgAC_ARG_ENABLE(docs,
10730e35d4d8eSmrg	AS_HELP_STRING([--enable-docs],
10731e35d4d8eSmrg	   [Enable building the documentation (default: ]docs_default[)]),
10732e35d4d8eSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
10733e35d4d8eSmrgm4_undefine([docs_default])
10734e35d4d8eSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10735e35d4d8eSmrgAC_MSG_CHECKING([whether to build documentation])
10736e35d4d8eSmrgAC_MSG_RESULT([$build_docs])
10737e35d4d8eSmrg]) # XORG_ENABLE_DOCS
1073832b578d3Smrg
10739e35d4d8eSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10740e35d4d8eSmrg# ----------------
10741e35d4d8eSmrg# Minimum version: 1.6.0
10742e35d4d8eSmrg#
10743e35d4d8eSmrg# This macro enables a builder to skip all developer documentation.
10744e35d4d8eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10745e35d4d8eSmrg# maximum flexibilty in controlling documentation building.
10746e35d4d8eSmrg# Refer to:
10747e35d4d8eSmrg# XORG_WITH_XMLTO         --with-xmlto
10748e35d4d8eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10749e35d4d8eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10750e35d4d8eSmrg# XORG_WITH_FOP           --with-fop
10751e35d4d8eSmrg# XORG_WITH_GROFF         --with-groff
10752e35d4d8eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10753e35d4d8eSmrg#
10754e35d4d8eSmrg# Interface to module:
10755e35d4d8eSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10756e35d4d8eSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10757e35d4d8eSmrg#			'no' user instructs the module not to generate developer docs
10758e35d4d8eSmrg# parm1:		specify the default value, yes or no.
10759e35d4d8eSmrg#
10760e35d4d8eSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10761e35d4d8eSmrgm4_define([devel_default], m4_default([$1], [yes]))
10762e35d4d8eSmrgAC_ARG_ENABLE(devel-docs,
10763e35d4d8eSmrg	AS_HELP_STRING([--enable-devel-docs],
10764e35d4d8eSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10765e35d4d8eSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10766e35d4d8eSmrgm4_undefine([devel_default])
10767e35d4d8eSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10768e35d4d8eSmrgAC_MSG_CHECKING([whether to build developer documentation])
10769e35d4d8eSmrgAC_MSG_RESULT([$build_devel_docs])
10770e35d4d8eSmrg]) # XORG_ENABLE_DEVEL_DOCS
1077132b578d3Smrg
10772e35d4d8eSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
10773e35d4d8eSmrg# ----------------
10774e35d4d8eSmrg# Minimum version: 1.6.0
10775e35d4d8eSmrg#
10776e35d4d8eSmrg# This macro enables a builder to skip all functional specification targets.
10777e35d4d8eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10778e35d4d8eSmrg# maximum flexibilty in controlling documentation building.
10779e35d4d8eSmrg# Refer to:
10780e35d4d8eSmrg# XORG_WITH_XMLTO         --with-xmlto
10781e35d4d8eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10782e35d4d8eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10783e35d4d8eSmrg# XORG_WITH_FOP           --with-fop
10784e35d4d8eSmrg# XORG_WITH_GROFF         --with-groff
10785e35d4d8eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10786e35d4d8eSmrg#
10787e35d4d8eSmrg# Interface to module:
10788e35d4d8eSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10789e35d4d8eSmrg# --enable-specs:	'yes' user instructs the module to generate specs
10790e35d4d8eSmrg#			'no' user instructs the module not to generate specs
10791e35d4d8eSmrg# parm1:		specify the default value, yes or no.
10792e35d4d8eSmrg#
10793e35d4d8eSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10794e35d4d8eSmrgm4_define([spec_default], m4_default([$1], [yes]))
10795e35d4d8eSmrgAC_ARG_ENABLE(specs,
10796e35d4d8eSmrg	AS_HELP_STRING([--enable-specs],
10797e35d4d8eSmrg	   [Enable building the specs (default: ]spec_default[)]),
10798e35d4d8eSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
10799e35d4d8eSmrgm4_undefine([spec_default])
10800e35d4d8eSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10801e35d4d8eSmrgAC_MSG_CHECKING([whether to build functional specifications])
10802e35d4d8eSmrgAC_MSG_RESULT([$build_specs])
10803e35d4d8eSmrg]) # XORG_ENABLE_SPECS
1080432b578d3Smrg
10805e35d4d8eSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10806e35d4d8eSmrg# ----------------------------------------------
10807e35d4d8eSmrg# Minimum version: 1.13.0
10808e35d4d8eSmrg#
10809e35d4d8eSmrg# This macro enables a builder to enable/disable unit testing
10810e35d4d8eSmrg# It makes no assumption about the test cases implementation
10811e35d4d8eSmrg# Test cases may or may not use Automake "Support for test suites"
10812e35d4d8eSmrg# They may or may not use the software utility library GLib
10813e35d4d8eSmrg#
10814e35d4d8eSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10815e35d4d8eSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10816e35d4d8eSmrg# The variable enable_unit_tests is used by other macros in this file.
10817e35d4d8eSmrg#
10818e35d4d8eSmrg# Interface to module:
10819e35d4d8eSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10820e35d4d8eSmrg# enable_unit_tests:    used in configure.ac for additional configuration
10821e35d4d8eSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10822e35d4d8eSmrg#			'no' user instructs the module not to build tests
10823e35d4d8eSmrg# parm1:		specify the default value, yes or no.
10824e35d4d8eSmrg#
10825e35d4d8eSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10826e35d4d8eSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10827e35d4d8eSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10828e35d4d8eSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10829e35d4d8eSmrgm4_define([_defopt], m4_default([$1], [auto]))
10830e35d4d8eSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10831e35d4d8eSmrg	[Enable building unit test cases (default: ]_defopt[)]),
10832e35d4d8eSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10833e35d4d8eSmrgm4_undefine([_defopt])
10834e35d4d8eSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10835e35d4d8eSmrgAC_MSG_CHECKING([whether to build unit test cases])
10836e35d4d8eSmrgAC_MSG_RESULT([$enable_unit_tests])
10837e35d4d8eSmrg]) # XORG_ENABLE_UNIT_TESTS
10838e35d4d8eSmrg
10839e35d4d8eSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10840e35d4d8eSmrg# ------------------------------------------------------
10841e35d4d8eSmrg# Minimum version: 1.17.0
10842e35d4d8eSmrg#
10843e35d4d8eSmrg# This macro enables a builder to enable/disable integration testing
10844e35d4d8eSmrg# It makes no assumption about the test cases' implementation
10845e35d4d8eSmrg# Test cases may or may not use Automake "Support for test suites"
10846e35d4d8eSmrg#
10847e35d4d8eSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10848e35d4d8eSmrg# usually requires less dependencies and may be built and run under less
10849e35d4d8eSmrg# stringent environments than integration tests.
10850e35d4d8eSmrg#
10851e35d4d8eSmrg# Interface to module:
10852e35d4d8eSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10853e35d4d8eSmrg# enable_integration_tests:   used in configure.ac for additional configuration
10854e35d4d8eSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10855e35d4d8eSmrg#                             'no' user instructs the module not to build tests
10856e35d4d8eSmrg# parm1:                      specify the default value, yes or no.
10857e35d4d8eSmrg#
10858e35d4d8eSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10859e35d4d8eSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10860e35d4d8eSmrgm4_define([_defopt], m4_default([$1], [auto]))
10861e35d4d8eSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10862e35d4d8eSmrg	[Enable building integration test cases (default: ]_defopt[)]),
10863e35d4d8eSmrg	[enable_integration_tests=$enableval],
10864e35d4d8eSmrg	[enable_integration_tests=]_defopt)
10865e35d4d8eSmrgm4_undefine([_defopt])
10866e35d4d8eSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10867e35d4d8eSmrg	[test "x$enable_integration_tests" != xno])
10868e35d4d8eSmrgAC_MSG_CHECKING([whether to build unit test cases])
10869e35d4d8eSmrgAC_MSG_RESULT([$enable_integration_tests])
10870e35d4d8eSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
10871e35d4d8eSmrg
10872e35d4d8eSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10873e35d4d8eSmrg# ----------------------------------------
10874e35d4d8eSmrg# Minimum version: 1.13.0
10875e35d4d8eSmrg#
10876e35d4d8eSmrg# GLib is a library which provides advanced data structures and functions.
10877e35d4d8eSmrg# This macro enables a module to test for the presence of Glib.
10878e35d4d8eSmrg#
10879e35d4d8eSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10880e35d4d8eSmrg# Otherwise the value of $enable_unit_tests is blank.
10881e35d4d8eSmrg#
10882e35d4d8eSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10883e35d4d8eSmrg# test support usually requires less dependencies and may be built and run under
10884e35d4d8eSmrg# less stringent environments than integration tests.
10885e35d4d8eSmrg#
10886e35d4d8eSmrg# Interface to module:
10887e35d4d8eSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
10888e35d4d8eSmrg# with_glib: used in configure.ac to know if GLib has been found
10889e35d4d8eSmrg# --with-glib:	'yes' user instructs the module to use glib
10890e35d4d8eSmrg#		'no' user instructs the module not to use glib
10891e35d4d8eSmrg#
10892e35d4d8eSmrgAC_DEFUN([XORG_WITH_GLIB],[
10893e35d4d8eSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10894e35d4d8eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10895e35d4d8eSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10896e35d4d8eSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10897e35d4d8eSmrg	[with_glib=$withval], [with_glib=]_defopt)
10898e35d4d8eSmrgm4_undefine([_defopt])
10899e35d4d8eSmrg
10900e35d4d8eSmrghave_glib=no
10901e35d4d8eSmrg# Do not probe GLib if user explicitly disabled unit testing
10902e35d4d8eSmrgif test "x$enable_unit_tests" != x"no"; then
10903e35d4d8eSmrg  # Do not probe GLib if user explicitly disabled it
10904e35d4d8eSmrg  if test "x$with_glib" != x"no"; then
10905e35d4d8eSmrg    m4_ifval(
10906e35d4d8eSmrg      [$1],
10907e35d4d8eSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10908e35d4d8eSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10909e35d4d8eSmrg    )
10910e35d4d8eSmrg  fi
10911e35d4d8eSmrgfi
1091232b578d3Smrg
10913e35d4d8eSmrg# Not having GLib when unit testing has been explicitly requested is an error
10914e35d4d8eSmrgif test "x$enable_unit_tests" = x"yes"; then
10915e35d4d8eSmrg  if test "x$have_glib" = x"no"; then
10916e35d4d8eSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10917e35d4d8eSmrg  fi
10918e35d4d8eSmrgfi
1091932b578d3Smrg
10920e35d4d8eSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
10921e35d4d8eSmrgif test "x$enable_unit_tests" = x"no"; then
10922e35d4d8eSmrg  if test "x$with_glib" = x"yes"; then
10923e35d4d8eSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10924e35d4d8eSmrg  fi
10925e35d4d8eSmrgfi
1092632b578d3Smrg
10927e35d4d8eSmrg# Not having GLib when it has been explicitly requested is an error
10928e35d4d8eSmrgif test "x$with_glib" = x"yes"; then
10929e35d4d8eSmrg  if test "x$have_glib" = x"no"; then
10930e35d4d8eSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10931e35d4d8eSmrg  fi
10932e35d4d8eSmrgfi
1093332b578d3Smrg
10934e35d4d8eSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10935e35d4d8eSmrg]) # XORG_WITH_GLIB
1093632b578d3Smrg
10937e35d4d8eSmrg# XORG_LD_WRAP([required|optional])
10938e35d4d8eSmrg# ---------------------------------
10939e35d4d8eSmrg# Minimum version: 1.13.0
10940e35d4d8eSmrg#
10941e35d4d8eSmrg# Check if linker supports -wrap, passed via compiler flags
10942e35d4d8eSmrg#
10943e35d4d8eSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10944e35d4d8eSmrg# Otherwise the value of $enable_unit_tests is blank.
10945e35d4d8eSmrg#
10946e35d4d8eSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
10947e35d4d8eSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10948e35d4d8eSmrg# available, an argument of "optional" allows use when some unit tests require
10949e35d4d8eSmrg# ld -wrap and others do not.
10950e35d4d8eSmrg#
10951e35d4d8eSmrgAC_DEFUN([XORG_LD_WRAP],[
10952e35d4d8eSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10953e35d4d8eSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
10954e35d4d8eSmrg                      void __wrap_exit(int status) { return; }],
10955e35d4d8eSmrg                     [exit(0);])])
10956e35d4d8eSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
10957e35d4d8eSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10958e35d4d8eSmrg  if test "x$have_ld_wrap" = x"no"; then
10959e35d4d8eSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10960e35d4d8eSmrg  fi
109612a51b5beSmrgfi
10962e35d4d8eSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
109632a51b5beSmrg#
10964e35d4d8eSmrg]) # XORG_LD_WRAP
1096532b578d3Smrg
10966e35d4d8eSmrg# XORG_CHECK_LINKER_FLAGS
10967e35d4d8eSmrg# -----------------------
10968e35d4d8eSmrg# SYNOPSIS
10969e35d4d8eSmrg#
10970e35d4d8eSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10971e35d4d8eSmrg#
10972e35d4d8eSmrg# DESCRIPTION
10973e35d4d8eSmrg#
10974e35d4d8eSmrg#   Check whether the given linker FLAGS work with the current language's
10975e35d4d8eSmrg#   linker, or whether they give an error.
10976e35d4d8eSmrg#
10977e35d4d8eSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10978e35d4d8eSmrg#   success/failure.
10979e35d4d8eSmrg#
10980e35d4d8eSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
10981e35d4d8eSmrg#
10982e35d4d8eSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10983e35d4d8eSmrg#
10984e35d4d8eSmrg# LICENSE
10985e35d4d8eSmrg#
10986e35d4d8eSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10987e35d4d8eSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10988e35d4d8eSmrg#   Copyright (c) 2009 Matteo Frigo
10989e35d4d8eSmrg#
10990e35d4d8eSmrg#   This program is free software: you can redistribute it and/or modify it
10991e35d4d8eSmrg#   under the terms of the GNU General Public License as published by the
10992e35d4d8eSmrg#   Free Software Foundation, either version 3 of the License, or (at your
10993e35d4d8eSmrg#   option) any later version.
10994e35d4d8eSmrg#
10995e35d4d8eSmrg#   This program is distributed in the hope that it will be useful, but
10996e35d4d8eSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
10997e35d4d8eSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10998e35d4d8eSmrg#   Public License for more details.
10999e35d4d8eSmrg#
11000e35d4d8eSmrg#   You should have received a copy of the GNU General Public License along
11001e35d4d8eSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
11002e35d4d8eSmrg#
11003e35d4d8eSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
11004e35d4d8eSmrg#   gives unlimited permission to copy, distribute and modify the configure
11005e35d4d8eSmrg#   scripts that are the output of Autoconf when processing the Macro. You
11006e35d4d8eSmrg#   need not follow the terms of the GNU General Public License when using
11007e35d4d8eSmrg#   or distributing such scripts, even though portions of the text of the
11008e35d4d8eSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
11009e35d4d8eSmrg#   all other use of the material that constitutes the Autoconf Macro.
11010e35d4d8eSmrg#
11011e35d4d8eSmrg#   This special exception to the GPL applies to versions of the Autoconf
11012e35d4d8eSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
11013e35d4d8eSmrg#   modified version of the Autoconf Macro, you may extend this special
11014e35d4d8eSmrg#   exception to the GPL to apply to your modified version as well.#
11015e35d4d8eSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11016e35d4d8eSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
11017e35d4d8eSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11018e35d4d8eSmrgAS_LITERAL_IF([$1],
11019e35d4d8eSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11020e35d4d8eSmrg      ax_save_FLAGS=$LDFLAGS
11021e35d4d8eSmrg      LDFLAGS="$1"
11022e35d4d8eSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11023e35d4d8eSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11024e35d4d8eSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11025e35d4d8eSmrg      LDFLAGS=$ax_save_FLAGS])],
11026e35d4d8eSmrg  [ax_save_FLAGS=$LDFLAGS
11027e35d4d8eSmrg   LDFLAGS="$1"
11028e35d4d8eSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11029e35d4d8eSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11030e35d4d8eSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11031e35d4d8eSmrg   LDFLAGS=$ax_save_FLAGS])
11032e35d4d8eSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11033e35d4d8eSmrgAC_MSG_RESULT($xorg_check_linker_flags)
11034e35d4d8eSmrgif test "x$xorg_check_linker_flags" = xyes; then
11035e35d4d8eSmrg	m4_default([$2], :)
110362a51b5beSmrgelse
11037e35d4d8eSmrg	m4_default([$3], :)
110382a51b5beSmrgfi
11039e35d4d8eSmrg]) # XORG_CHECK_LINKER_FLAGS
1104032b578d3Smrg
11041e35d4d8eSmrg# XORG_MEMORY_CHECK_FLAGS
11042e35d4d8eSmrg# -----------------------
11043e35d4d8eSmrg# Minimum version: 1.16.0
110442a51b5beSmrg#
11045e35d4d8eSmrg# This macro attempts to find appropriate memory checking functionality
11046e35d4d8eSmrg# for various platforms which unit testing code may use to catch various
11047e35d4d8eSmrg# forms of memory allocation and access errors in testing.
11048e35d4d8eSmrg#
11049e35d4d8eSmrg# Interface to module:
11050e35d4d8eSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11051e35d4d8eSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11052e35d4d8eSmrg#
11053e35d4d8eSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11054e35d4d8eSmrg#
11055e35d4d8eSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
1105632b578d3Smrg
11057e35d4d8eSmrgAC_REQUIRE([AC_CANONICAL_HOST])
11058e35d4d8eSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11059e35d4d8eSmrg           [Environment variables to enable memory checking in tests])
1106032b578d3Smrg
11061e35d4d8eSmrg# Check for different types of support on different platforms
11062e35d4d8eSmrgcase $host_os in
11063e35d4d8eSmrg    solaris*)
11064e35d4d8eSmrg        AC_CHECK_LIB([umem], [umem_alloc],
11065e35d4d8eSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11066e35d4d8eSmrg        ;;
11067e35d4d8eSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11068e35d4d8eSmrg        # both directly and inverted, so should not be 0 or 255.
11069e35d4d8eSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
11070e35d4d8eSmrg        ;;
11071e35d4d8eSmrg    darwin*)
11072e35d4d8eSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11073e35d4d8eSmrg        ;;
11074e35d4d8eSmrg    *bsd*)
11075e35d4d8eSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11076e35d4d8eSmrg        ;;
11077e35d4d8eSmrgesac
1107832b578d3Smrg
11079e35d4d8eSmrg# User supplied flags override default flags
11080e35d4d8eSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11081e35d4d8eSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11082e35d4d8eSmrgfi
1108332b578d3Smrg
11084e35d4d8eSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11085e35d4d8eSmrg]) # XORG_WITH_LINT
1108632b578d3Smrg
11087e35d4d8eSmrg# XORG_CHECK_MALLOC_ZERO
11088e35d4d8eSmrg# ----------------------
11089e35d4d8eSmrg# Minimum version: 1.0.0
110902a51b5beSmrg#
11091e35d4d8eSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11092e35d4d8eSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
11093e35d4d8eSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11094e35d4d8eSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11095e35d4d8eSmrgAC_ARG_ENABLE(malloc0returnsnull,
11096e35d4d8eSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
11097e35d4d8eSmrg		       [malloc(0) returns NULL (default: auto)]),
11098e35d4d8eSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11099e35d4d8eSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1110032b578d3Smrg
11101e35d4d8eSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
11102e35d4d8eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11103e35d4d8eSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
11104e35d4d8eSmrg#include <stdlib.h>
11105e35d4d8eSmrg],[
11106e35d4d8eSmrg    char *m0, *r0, *c0, *p;
11107e35d4d8eSmrg    m0 = malloc(0);
11108e35d4d8eSmrg    p = malloc(10);
11109e35d4d8eSmrg    r0 = realloc(p,0);
11110e35d4d8eSmrg    c0 = calloc(0,10);
11111e35d4d8eSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11112e35d4d8eSmrg])],
11113e35d4d8eSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
11114e35d4d8eSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
11115e35d4d8eSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
11116e35d4d8eSmrgfi
11117e35d4d8eSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1111832b578d3Smrg
11119e35d4d8eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11120e35d4d8eSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11121e35d4d8eSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11122e35d4d8eSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11123e35d4d8eSmrgelse
11124e35d4d8eSmrg	MALLOC_ZERO_CFLAGS=""
11125e35d4d8eSmrg	XMALLOC_ZERO_CFLAGS=""
11126e35d4d8eSmrg	XTMALLOC_ZERO_CFLAGS=""
111272a51b5beSmrgfi
1112832b578d3Smrg
11129e35d4d8eSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
11130e35d4d8eSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
11131e35d4d8eSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
11132e35d4d8eSmrg]) # XORG_CHECK_MALLOC_ZERO
1113332b578d3Smrg
11134e35d4d8eSmrg# XORG_WITH_LINT()
11135e35d4d8eSmrg# ----------------
11136e35d4d8eSmrg# Minimum version: 1.1.0
111372a51b5beSmrg#
11138e35d4d8eSmrg# This macro enables the use of a tool that flags some suspicious and
11139e35d4d8eSmrg# non-portable constructs (likely to be bugs) in C language source code.
11140e35d4d8eSmrg# It will attempt to locate the tool and use appropriate options.
11141e35d4d8eSmrg# There are various lint type tools on different platforms.
11142e35d4d8eSmrg#
11143e35d4d8eSmrg# Interface to module:
11144e35d4d8eSmrg# LINT:		returns the path to the tool found on the platform
11145e35d4d8eSmrg#		or the value set to LINT on the configure cmd line
11146e35d4d8eSmrg#		also an Automake conditional
11147e35d4d8eSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
11148e35d4d8eSmrg#
11149e35d4d8eSmrg# --with-lint:	'yes' user instructs the module to use lint
11150e35d4d8eSmrg#		'no' user instructs the module not to use lint (default)
11151e35d4d8eSmrg#
11152e35d4d8eSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11153e35d4d8eSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
11154e35d4d8eSmrg#
11155e35d4d8eSmrgAC_DEFUN([XORG_WITH_LINT],[
1115632b578d3Smrg
11157e35d4d8eSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
11158e35d4d8eSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11159e35d4d8eSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11160e35d4d8eSmrg		[Use a lint-style source code checker (default: disabled)])],
11161e35d4d8eSmrg		[use_lint=$withval], [use_lint=no])
1116232b578d3Smrg
11163e35d4d8eSmrg# Obtain platform specific info like program name and options
11164e35d4d8eSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11165e35d4d8eSmrgcase $host_os in
11166e35d4d8eSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11167e35d4d8eSmrg	lint_name=splint
11168e35d4d8eSmrg	lint_options="-badflag"
11169e35d4d8eSmrg	;;
11170e35d4d8eSmrg  *freebsd* | *netbsd*)
11171e35d4d8eSmrg	lint_name=lint
11172e35d4d8eSmrg	lint_options="-u -b"
11173e35d4d8eSmrg	;;
11174e35d4d8eSmrg  *solaris*)
11175e35d4d8eSmrg	lint_name=lint
11176e35d4d8eSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11177e35d4d8eSmrg	;;
11178e35d4d8eSmrgesac
1117932b578d3Smrg
11180e35d4d8eSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
11181e35d4d8eSmrgif test "x$use_lint" = x"yes" ; then
11182e35d4d8eSmrg   AC_PATH_PROG([LINT], [$lint_name])
11183e35d4d8eSmrg   if test "x$LINT" = "x"; then
11184e35d4d8eSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11185e35d4d8eSmrg   fi
11186e35d4d8eSmrgelif test "x$use_lint" = x"no" ; then
11187e35d4d8eSmrg   if test "x$LINT" != "x"; then
11188e35d4d8eSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11189e35d4d8eSmrg   fi
111902a51b5beSmrgelse
11191e35d4d8eSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
111922a51b5beSmrgfi
111932a51b5beSmrg
11194e35d4d8eSmrg# User supplied flags override default flags
11195e35d4d8eSmrgif test "x$LINT_FLAGS" != "x"; then
11196e35d4d8eSmrg   lint_options=$LINT_FLAGS
11197e35d4d8eSmrgfi
111982a51b5beSmrg
11199e35d4d8eSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
11200e35d4d8eSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1120132b578d3Smrg
11202e35d4d8eSmrg]) # XORG_WITH_LINT
1120332b578d3Smrg
11204e35d4d8eSmrg# XORG_LINT_LIBRARY(LIBNAME)
11205e35d4d8eSmrg# --------------------------
11206e35d4d8eSmrg# Minimum version: 1.1.0
112072a51b5beSmrg#
11208e35d4d8eSmrg# Sets up flags for building lint libraries for checking programs that call
11209e35d4d8eSmrg# functions in the library.
11210e35d4d8eSmrg#
11211e35d4d8eSmrg# Interface to module:
11212e35d4d8eSmrg# LINTLIB		- Automake variable with the name of lint library file to make
11213e35d4d8eSmrg# MAKE_LINT_LIB		- Automake conditional
11214e35d4d8eSmrg#
11215e35d4d8eSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11216e35d4d8eSmrg#			  - 'no' user instructs the module not to create a lint library (default)
1121732b578d3Smrg
11218e35d4d8eSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
11219e35d4d8eSmrgAC_REQUIRE([XORG_WITH_LINT])
11220e35d4d8eSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11221e35d4d8eSmrg	[Create lint library (default: disabled)])],
11222e35d4d8eSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1122332b578d3Smrg
11224e35d4d8eSmrgif test "x$make_lint_lib" = x"yes" ; then
11225e35d4d8eSmrg   LINTLIB=llib-l$1.ln
11226e35d4d8eSmrg   if test "x$LINT" = "x"; then
11227e35d4d8eSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11228e35d4d8eSmrg   fi
11229e35d4d8eSmrgelif test "x$make_lint_lib" != x"no" ; then
11230e35d4d8eSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11231e35d4d8eSmrgfi
1123232b578d3Smrg
11233e35d4d8eSmrgAC_SUBST(LINTLIB)
11234e35d4d8eSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1123532b578d3Smrg
11236e35d4d8eSmrg]) # XORG_LINT_LIBRARY
1123732b578d3Smrg
11238e35d4d8eSmrg# XORG_COMPILER_BRAND
11239e35d4d8eSmrg# -------------------
11240e35d4d8eSmrg# Minimum version: 1.14.0
11241e35d4d8eSmrg#
11242e35d4d8eSmrg# Checks for various brands of compilers and sets flags as appropriate:
11243e35d4d8eSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11244e35d4d8eSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11245e35d4d8eSmrg#   clang compiler - sets CLANGCC to "yes"
11246e35d4d8eSmrg#   Intel compiler - sets INTELCC to "yes"
11247e35d4d8eSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11248e35d4d8eSmrg#
11249e35d4d8eSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
11250e35d4d8eSmrgAC_LANG_CASE(
11251e35d4d8eSmrg	[C], [
11252e35d4d8eSmrg		AC_REQUIRE([AC_PROG_CC_C99])
11253e35d4d8eSmrg	],
11254e35d4d8eSmrg	[C++], [
11255e35d4d8eSmrg		AC_REQUIRE([AC_PROG_CXX])
11256e35d4d8eSmrg	]
11257e35d4d8eSmrg)
11258e35d4d8eSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11259e35d4d8eSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11260e35d4d8eSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11261e35d4d8eSmrg]) # XORG_COMPILER_BRAND
1126232b578d3Smrg
11263e35d4d8eSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
112642a51b5beSmrg# ---------------
11265e35d4d8eSmrg# Minimum version: 1.16.0
11266e35d4d8eSmrg#
11267e35d4d8eSmrg# Test if the compiler works when passed the given flag as a command line argument.
11268e35d4d8eSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11269e35d4d8eSmrg# next flag in the list until there are no more options.
11270e35d4d8eSmrg#
11271e35d4d8eSmrg# Note that this does not guarantee that the compiler supports the flag as some
11272e35d4d8eSmrg# compilers will simply ignore arguments that they do not understand, but we do
11273e35d4d8eSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
11274e35d4d8eSmrg# -Werror=unused-command-line-argument
11275e35d4d8eSmrg#
11276e35d4d8eSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
11277e35d4d8eSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11278e35d4d8eSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11279e35d4d8eSmrg
11280e35d4d8eSmrgAC_LANG_COMPILER_REQUIRE
11281e35d4d8eSmrg
11282e35d4d8eSmrgAC_LANG_CASE(
11283e35d4d8eSmrg	[C], [
11284e35d4d8eSmrg		AC_REQUIRE([AC_PROG_CC_C99])
11285e35d4d8eSmrg		define([PREFIX], [C])
11286e35d4d8eSmrg		define([CACHE_PREFIX], [cc])
11287e35d4d8eSmrg		define([COMPILER], [$CC])
11288e35d4d8eSmrg	],
11289e35d4d8eSmrg	[C++], [
11290e35d4d8eSmrg		define([PREFIX], [CXX])
11291e35d4d8eSmrg		define([CACHE_PREFIX], [cxx])
11292e35d4d8eSmrg		define([COMPILER], [$CXX])
11293e35d4d8eSmrg	]
11294e35d4d8eSmrg)
1129532b578d3Smrg
11296e35d4d8eSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11297e35d4d8eSmrg
11298e35d4d8eSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11299e35d4d8eSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11300e35d4d8eSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11301e35d4d8eSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11302e35d4d8eSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11303e35d4d8eSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11304e35d4d8eSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11305e35d4d8eSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11306e35d4d8eSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11307e35d4d8eSmrgfi
11308d31dbc53Smrg
11309e35d4d8eSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11310e35d4d8eSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11311e35d4d8eSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11312e35d4d8eSmrg	fi
11313e35d4d8eSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11314e35d4d8eSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11315e35d4d8eSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11316e35d4d8eSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11317e35d4d8eSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11318e35d4d8eSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11319e35d4d8eSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11320e35d4d8eSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11321e35d4d8eSmrgfi
11322d31dbc53Smrg
11323e35d4d8eSmrgfound="no"
11324e35d4d8eSmrgm4_foreach([flag], m4_cdr($@), [
11325e35d4d8eSmrg	if test $found = "no" ; then
11326e35d4d8eSmrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11327e35d4d8eSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11328e35d4d8eSmrg		fi
11329e35d4d8eSmrg
11330e35d4d8eSmrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11331e35d4d8eSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11332e35d4d8eSmrg		fi
11333e35d4d8eSmrg
11334e35d4d8eSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11335e35d4d8eSmrg
11336e35d4d8eSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11337e35d4d8eSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11338e35d4d8eSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11339e35d4d8eSmrg		AC_CACHE_VAL($cacheid,
11340e35d4d8eSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11341e35d4d8eSmrg					     [eval $cacheid=yes],
11342e35d4d8eSmrg					     [eval $cacheid=no])])
11343e35d4d8eSmrg
11344e35d4d8eSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11345e35d4d8eSmrg
11346e35d4d8eSmrg		eval supported=\$$cacheid
11347e35d4d8eSmrg		AC_MSG_RESULT([$supported])
11348e35d4d8eSmrg		if test "$supported" = "yes" ; then
11349e35d4d8eSmrg			$1="$$1 ]flag["
11350e35d4d8eSmrg			found="yes"
11351e35d4d8eSmrg		fi
11352e35d4d8eSmrg	fi
11353e35d4d8eSmrg])
11354e35d4d8eSmrg]) # XORG_TESTSET_CFLAG
11355e35d4d8eSmrg
11356e35d4d8eSmrg# XORG_COMPILER_FLAGS
11357e35d4d8eSmrg# ---------------
11358e35d4d8eSmrg# Minimum version: 1.16.0
11359e35d4d8eSmrg#
11360e35d4d8eSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11361e35d4d8eSmrg# arguments supported by the selected compiler which do NOT alter the generated
11362e35d4d8eSmrg# code.  These arguments will cause the compiler to print various warnings
11363e35d4d8eSmrg# during compilation AND turn a conservative set of warnings into errors.
11364e35d4d8eSmrg#
11365e35d4d8eSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11366e35d4d8eSmrg# future versions of util-macros as options are added to new compilers.
11367e35d4d8eSmrg#
11368e35d4d8eSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
11369e35d4d8eSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11370e35d4d8eSmrg
11371e35d4d8eSmrgAC_ARG_ENABLE(selective-werror,
11372e35d4d8eSmrg              AS_HELP_STRING([--disable-selective-werror],
11373e35d4d8eSmrg                             [Turn off selective compiler errors. (default: enabled)]),
11374e35d4d8eSmrg              [SELECTIVE_WERROR=$enableval],
11375e35d4d8eSmrg              [SELECTIVE_WERROR=yes])
11376e35d4d8eSmrg
11377e35d4d8eSmrgAC_LANG_CASE(
11378e35d4d8eSmrg        [C], [
11379e35d4d8eSmrg                define([PREFIX], [C])
11380e35d4d8eSmrg        ],
11381e35d4d8eSmrg        [C++], [
11382e35d4d8eSmrg                define([PREFIX], [CXX])
11383e35d4d8eSmrg        ]
11384e35d4d8eSmrg)
11385e35d4d8eSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
11386e35d4d8eSmrgif test "x$SUNCC" = "xyes"; then
11387e35d4d8eSmrg    [BASE_]PREFIX[FLAGS]="-v"
113882a51b5beSmrgelse
11389e35d4d8eSmrg    [BASE_]PREFIX[FLAGS]=""
113902a51b5beSmrgfi
113912a51b5beSmrg
11392e35d4d8eSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11393e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11394e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11395e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11396e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11397e35d4d8eSmrg
11398e35d4d8eSmrgAC_LANG_CASE(
11399e35d4d8eSmrg	[C], [
11400e35d4d8eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11401e35d4d8eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11402e35d4d8eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11403e35d4d8eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11404e35d4d8eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11405e35d4d8eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11406e35d4d8eSmrg	]
11407e35d4d8eSmrg)
114081b12faf6Smrg
11409e35d4d8eSmrg# This chunk adds additional warnings that could catch undesired effects.
11410e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11411e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11412e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11413e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11414e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11415e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11416e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11417e35d4d8eSmrg
11418e35d4d8eSmrg# These are currently disabled because they are noisy.  They will be enabled
11419e35d4d8eSmrg# in the future once the codebase is sufficiently modernized to silence
11420e35d4d8eSmrg# them.  For now, I don't want them to drown out the other warnings.
11421e35d4d8eSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11422e35d4d8eSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11423e35d4d8eSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11424e35d4d8eSmrg
11425e35d4d8eSmrg# Turn some warnings into errors, so we don't accidently get successful builds
11426e35d4d8eSmrg# when there are problems that should be fixed.
11427e35d4d8eSmrg
11428e35d4d8eSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
11429e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11430e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11431e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11432e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11433e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11434e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11435e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11436e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11437e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11438e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11439e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11440e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11441e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11442e35d4d8eSmrgelse
11443e35d4d8eSmrgAC_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])
11444e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11445e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11446e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11447e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11448e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11449e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11450e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11451e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11452e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11453e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11454e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11455e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11456e35d4d8eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11457e35d4d8eSmrgfi
114581b12faf6Smrg
11459e35d4d8eSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11460e35d4d8eSmrg]) # XORG_COMPILER_FLAGS
1146132b578d3Smrg
11462e35d4d8eSmrg# XORG_CWARNFLAGS
11463e35d4d8eSmrg# ---------------
11464e35d4d8eSmrg# Minimum version: 1.2.0
11465e35d4d8eSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11466e35d4d8eSmrg#
11467e35d4d8eSmrg# Defines CWARNFLAGS to enable C compiler warnings.
11468e35d4d8eSmrg#
11469e35d4d8eSmrg# This function is deprecated because it defines -fno-strict-aliasing
11470e35d4d8eSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11471e35d4d8eSmrg# is needed, then it should be added explicitly in the module when
11472e35d4d8eSmrg# it is updated to use BASE_CFLAGS.
11473e35d4d8eSmrg#
11474e35d4d8eSmrgAC_DEFUN([XORG_CWARNFLAGS], [
11475e35d4d8eSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11476e35d4d8eSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11477e35d4d8eSmrgAC_LANG_CASE(
11478e35d4d8eSmrg	[C], [
11479e35d4d8eSmrg		CWARNFLAGS="$BASE_CFLAGS"
11480e35d4d8eSmrg		if  test "x$GCC" = xyes ; then
11481e35d4d8eSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11482e35d4d8eSmrg		fi
11483e35d4d8eSmrg		AC_SUBST(CWARNFLAGS)
11484e35d4d8eSmrg	]
11485e35d4d8eSmrg)
11486e35d4d8eSmrg]) # XORG_CWARNFLAGS
1148732b578d3Smrg
11488e35d4d8eSmrg# XORG_STRICT_OPTION
11489e35d4d8eSmrg# -----------------------
11490e35d4d8eSmrg# Minimum version: 1.3.0
11491d31dbc53Smrg#
11492e35d4d8eSmrg# Add configure option to enable strict compilation flags, such as treating
11493e35d4d8eSmrg# warnings as fatal errors.
11494e35d4d8eSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11495e35d4d8eSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11496e35d4d8eSmrg#
11497e35d4d8eSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11498e35d4d8eSmrg# when strict compilation is unconditionally desired.
11499e35d4d8eSmrgAC_DEFUN([XORG_STRICT_OPTION], [
11500e35d4d8eSmrgAC_REQUIRE([XORG_CWARNFLAGS])
11501e35d4d8eSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1150232b578d3Smrg
11503e35d4d8eSmrgAC_ARG_ENABLE(strict-compilation,
11504e35d4d8eSmrg			  AS_HELP_STRING([--enable-strict-compilation],
11505e35d4d8eSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11506e35d4d8eSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1150732b578d3Smrg
11508e35d4d8eSmrgAC_LANG_CASE(
11509e35d4d8eSmrg        [C], [
11510e35d4d8eSmrg                define([PREFIX], [C])
11511e35d4d8eSmrg        ],
11512e35d4d8eSmrg        [C++], [
11513e35d4d8eSmrg                define([PREFIX], [CXX])
11514e35d4d8eSmrg        ]
11515e35d4d8eSmrg)
1151632b578d3Smrg
11517e35d4d8eSmrg[STRICT_]PREFIX[FLAGS]=""
11518e35d4d8eSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11519e35d4d8eSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
115202a51b5beSmrg
11521e35d4d8eSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11522e35d4d8eSmrg# activate it with -Werror, so we add it here explicitly.
11523e35d4d8eSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
115242a51b5beSmrg
11525e35d4d8eSmrgif test "x$STRICT_COMPILE" = "xyes"; then
11526e35d4d8eSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11527e35d4d8eSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11528e35d4d8eSmrgfi
11529e35d4d8eSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11530e35d4d8eSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11531e35d4d8eSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11532e35d4d8eSmrg]) # XORG_STRICT_OPTION
11533e35d4d8eSmrg
11534e35d4d8eSmrg# XORG_DEFAULT_OPTIONS
11535e35d4d8eSmrg# --------------------
11536e35d4d8eSmrg# Minimum version: 1.3.0
1153732b578d3Smrg#
11538e35d4d8eSmrg# Defines default options for X.Org modules.
11539e35d4d8eSmrg#
11540e35d4d8eSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11541e35d4d8eSmrgAC_REQUIRE([AC_PROG_INSTALL])
11542e35d4d8eSmrgXORG_COMPILER_FLAGS
11543e35d4d8eSmrgXORG_CWARNFLAGS
11544e35d4d8eSmrgXORG_STRICT_OPTION
11545e35d4d8eSmrgXORG_RELEASE_VERSION
11546e35d4d8eSmrgXORG_CHANGELOG
11547e35d4d8eSmrgXORG_INSTALL
11548e35d4d8eSmrgXORG_MANPAGE_SECTIONS
11549e35d4d8eSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11550e35d4d8eSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11551e35d4d8eSmrg]) # XORG_DEFAULT_OPTIONS
115522a51b5beSmrg
11553e35d4d8eSmrg# XORG_INSTALL()
11554e35d4d8eSmrg# ----------------
11555e35d4d8eSmrg# Minimum version: 1.4.0
11556e35d4d8eSmrg#
11557e35d4d8eSmrg# Defines the variable INSTALL_CMD as the command to copy
11558e35d4d8eSmrg# INSTALL from $prefix/share/util-macros.
11559e35d4d8eSmrg#
11560e35d4d8eSmrgAC_DEFUN([XORG_INSTALL], [
11561e35d4d8eSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11562e35d4d8eSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11563e35d4d8eSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11564e35d4d8eSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11565e35d4d8eSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11566e35d4d8eSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11567e35d4d8eSmrgAC_SUBST([INSTALL_CMD])
11568e35d4d8eSmrg]) # XORG_INSTALL
11569e35d4d8eSmrgdnl Copyright 2005 Red Hat, Inc
11570e35d4d8eSmrgdnl
11571e35d4d8eSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11572e35d4d8eSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11573e35d4d8eSmrgdnl the above copyright notice appear in all copies and that both that
11574e35d4d8eSmrgdnl copyright notice and this permission notice appear in supporting
11575e35d4d8eSmrgdnl documentation.
11576e35d4d8eSmrgdnl
11577e35d4d8eSmrgdnl The above copyright notice and this permission notice shall be included
11578e35d4d8eSmrgdnl in all copies or substantial portions of the Software.
11579e35d4d8eSmrgdnl
11580e35d4d8eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11581e35d4d8eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11582e35d4d8eSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11583e35d4d8eSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11584e35d4d8eSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11585e35d4d8eSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11586e35d4d8eSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11587e35d4d8eSmrgdnl
11588e35d4d8eSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11589e35d4d8eSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11590e35d4d8eSmrgdnl other dealings in this Software without prior written authorization
11591e35d4d8eSmrgdnl from the copyright holders.
11592e35d4d8eSmrgdnl
115932a51b5beSmrg
11594e35d4d8eSmrg# XORG_RELEASE_VERSION
115952a51b5beSmrg# --------------------
11596e35d4d8eSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11597e35d4d8eSmrg 
11598e35d4d8eSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11599e35d4d8eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11600e35d4d8eSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11601e35d4d8eSmrg		[Major version of this package])
11602e35d4d8eSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11603e35d4d8eSmrg	if test "x$PVM" = "x"; then
11604e35d4d8eSmrg		PVM="0"
11605e35d4d8eSmrg	fi
11606e35d4d8eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11607e35d4d8eSmrg		[$PVM],
11608e35d4d8eSmrg		[Minor version of this package])
11609e35d4d8eSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11610e35d4d8eSmrg	if test "x$PVP" = "x"; then
11611e35d4d8eSmrg		PVP="0"
11612e35d4d8eSmrg	fi
11613e35d4d8eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11614e35d4d8eSmrg		[$PVP],
11615e35d4d8eSmrg		[Patch version of this package])
11616e35d4d8eSmrg])
11617e35d4d8eSmrg
11618e35d4d8eSmrg# XORG_CHANGELOG()
11619e35d4d8eSmrg# ----------------
11620e35d4d8eSmrg# Minimum version: 1.2.0
11621d31dbc53Smrg#
11622e35d4d8eSmrg# Defines the variable CHANGELOG_CMD as the command to generate
11623e35d4d8eSmrg# ChangeLog from git.
11624d31dbc53Smrg#
11625e35d4d8eSmrg#
11626e35d4d8eSmrgAC_DEFUN([XORG_CHANGELOG], [
11627e35d4d8eSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11628e35d4d8eSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11629e35d4d8eSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11630e35d4d8eSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11631e35d4d8eSmrgAC_SUBST([CHANGELOG_CMD])
11632e35d4d8eSmrg]) # XORG_CHANGELOG
1163332b578d3Smrg
11634e35d4d8eSmrgdnl Copyright 2005 Red Hat, Inc
11635e35d4d8eSmrgdnl 
11636e35d4d8eSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11637e35d4d8eSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11638e35d4d8eSmrgdnl the above copyright notice appear in all copies and that both that
11639e35d4d8eSmrgdnl copyright notice and this permission notice appear in supporting
11640e35d4d8eSmrgdnl documentation.
11641e35d4d8eSmrgdnl 
11642e35d4d8eSmrgdnl The above copyright notice and this permission notice shall be included
11643e35d4d8eSmrgdnl in all copies or substantial portions of the Software.
11644e35d4d8eSmrgdnl 
11645e35d4d8eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11646e35d4d8eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11647e35d4d8eSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11648e35d4d8eSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11649e35d4d8eSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11650e35d4d8eSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11651e35d4d8eSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11652e35d4d8eSmrgdnl 
11653e35d4d8eSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11654e35d4d8eSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11655e35d4d8eSmrgdnl other dealings in this Software without prior written authorization
11656e35d4d8eSmrgdnl from the copyright holders.
11657e35d4d8eSmrgdnl 
1165832b578d3Smrg
11659e35d4d8eSmrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
11660e35d4d8eSmrg# --------------------------
11661e35d4d8eSmrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
11662e35d4d8eSmrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
1166332b578d3Smrg
11664e35d4d8eSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
11665e35d4d8eSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11666e35d4d8eSmrg	SAVE_CFLAGS="$CFLAGS"
11667e35d4d8eSmrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
11668e35d4d8eSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
11669e35d4d8eSmrg#include "xorg-server.h"
11670e35d4d8eSmrg#if !defined $1
11671e35d4d8eSmrg#error $1 not defined
11672e35d4d8eSmrg#endif
11673e35d4d8eSmrg		]])],
11674e35d4d8eSmrg		[_EXT_CHECK=yes],
11675e35d4d8eSmrg		[_EXT_CHECK=no])
11676e35d4d8eSmrg	CFLAGS="$SAVE_CFLAGS"
11677e35d4d8eSmrg	AC_MSG_CHECKING([if $1 is defined])
11678e35d4d8eSmrg	AC_MSG_RESULT([$_EXT_CHECK])
11679e35d4d8eSmrg	if test "$_EXT_CHECK" != no; then
11680e35d4d8eSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
11681e35d4d8eSmrg	fi
11682e35d4d8eSmrg])
1168332b578d3Smrg
11684