1d87a3195Smrg# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2eca46af7Smrg
3d87a3195Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
495b296d0Smrg
595b296d0Smrg# This file is free software; the Free Software Foundation
695b296d0Smrg# gives unlimited permission to copy and/or distribute it,
795b296d0Smrg# with or without modifications, as long as this notice is preserved.
895b296d0Smrg
995b296d0Smrg# This program is distributed in the hope that it will be useful,
1095b296d0Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1195b296d0Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1295b296d0Smrg# PARTICULAR PURPOSE.
1395b296d0Smrg
14eca46af7Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15ff89ac2bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16ff89ac2bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17d87a3195Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
18d87a3195Smrg[m4_warning([this file was generated for autoconf 2.71.
19ff89ac2bSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20ff89ac2bSmrgIf you have problems, you may need to regenerate the build system entirely.
21eca46af7SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22ff89ac2bSmrg
23d87a3195Smrg# Copyright (C) 2002-2021 Free Software Foundation, Inc.
24eca46af7Smrg#
25d87a3195Smrg# This file is free software; the Free Software Foundation
26d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
27d87a3195Smrg# with or without modifications, as long as this notice is preserved.
2814330f12Smrg
29d87a3195Smrg# AM_AUTOMAKE_VERSION(VERSION)
30d87a3195Smrg# ----------------------------
31d87a3195Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32d87a3195Smrg# generated from the m4 files accompanying Automake X.Y.
33d87a3195Smrg# (This private macro should not be called outside this file.)
34d87a3195SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
35d87a3195Smrg[am__api_version='1.16'
36d87a3195Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37d87a3195Smrgdnl require some minimum version.  Point them to the right macro.
38d87a3195Smrgm4_if([$1], [1.16.5], [],
39d87a3195Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40eca46af7Smrg])
4114330f12Smrg
42d87a3195Smrg# _AM_AUTOCONF_VERSION(VERSION)
43d87a3195Smrg# -----------------------------
44d87a3195Smrg# aclocal traces this macro to find the Autoconf version.
45d87a3195Smrg# This is a private macro too.  Using m4_define simplifies
46d87a3195Smrg# the logic in aclocal, which can simply ignore this definition.
47d87a3195Smrgm4_define([_AM_AUTOCONF_VERSION], [])
4814330f12Smrg
49d87a3195Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50d87a3195Smrg# -------------------------------
51d87a3195Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52d87a3195Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53d87a3195SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54d87a3195Smrg[AM_AUTOMAKE_VERSION([1.16.5])dnl
55d87a3195Smrgm4_ifndef([AC_AUTOCONF_VERSION],
56d87a3195Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57d87a3195Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5814330f12Smrg
59d87a3195Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
602378475aSmrg
61d87a3195Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
62d87a3195Smrg#
63d87a3195Smrg# This file is free software; the Free Software Foundation
64d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
65d87a3195Smrg# with or without modifications, as long as this notice is preserved.
6639713583Smrg
67d87a3195Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68d87a3195Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69d87a3195Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70d87a3195Smrg#
71d87a3195Smrg# Of course, Automake must honor this variable whenever it calls a
72d87a3195Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73d87a3195Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74d87a3195Smrg# depending on how configure is run.  This is pretty annoying, since
75d87a3195Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76d87a3195Smrg# source directory, any form will work fine, but in subdirectories a
77d87a3195Smrg# relative path needs to be adjusted first.
78d87a3195Smrg#
79d87a3195Smrg# $ac_aux_dir/missing
80d87a3195Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81d87a3195Smrg# $top_srcdir/$ac_aux_dir/missing
82d87a3195Smrg#    fails if $ac_aux_dir is absolute,
83d87a3195Smrg#    fails when called from a subdirectory in a VPATH build with
84d87a3195Smrg#          a relative $ac_aux_dir
85d87a3195Smrg#
86d87a3195Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87d87a3195Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
88d87a3195Smrg# harmless because $srcdir is '.', but things will broke when you
89d87a3195Smrg# start a VPATH build or use an absolute $srcdir.
90d87a3195Smrg#
91d87a3195Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92d87a3195Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93d87a3195Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94d87a3195Smrg# and then we would define $MISSING as
95d87a3195Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96d87a3195Smrg# This will work as long as MISSING is not called from configure, because
97d87a3195Smrg# unfortunately $(top_srcdir) has no meaning in configure.
98d87a3195Smrg# However there are other variables, like CC, which are often used in
99d87a3195Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
100d87a3195Smrg#
101d87a3195Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
102d87a3195Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
103d87a3195Smrg# configured tree to be moved without reconfiguration.
104d87a3195Smrg
105d87a3195SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
106d87a3195Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
107d87a3195Smrg# Expand $ac_aux_dir to an absolute path.
108d87a3195Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
1092378475aSmrg])
1102378475aSmrg
111d87a3195Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1122378475aSmrg
113d87a3195Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
114d87a3195Smrg#
115d87a3195Smrg# This file is free software; the Free Software Foundation
116d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
117d87a3195Smrg# with or without modifications, as long as this notice is preserved.
11895b296d0Smrg
119d87a3195Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
120d87a3195Smrg# -------------------------------------
121d87a3195Smrg# Define a conditional.
122d87a3195SmrgAC_DEFUN([AM_CONDITIONAL],
123d87a3195Smrg[AC_PREREQ([2.52])dnl
124d87a3195Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
125d87a3195Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
126d87a3195SmrgAC_SUBST([$1_TRUE])dnl
127d87a3195SmrgAC_SUBST([$1_FALSE])dnl
128d87a3195Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
129d87a3195Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
130d87a3195Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
131d87a3195Smrgif $2; then
132d87a3195Smrg  $1_TRUE=
133d87a3195Smrg  $1_FALSE='#'
134d87a3195Smrgelse
135d87a3195Smrg  $1_TRUE='#'
136d87a3195Smrg  $1_FALSE=
137d87a3195Smrgfi
138d87a3195SmrgAC_CONFIG_COMMANDS_PRE(
139d87a3195Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
140d87a3195Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
141d87a3195SmrgUsually this means the macro was only invoked conditionally.]])
142d87a3195Smrgfi])])
14339713583Smrg
144d87a3195Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
145d87a3195Smrg#
146d87a3195Smrg# This file is free software; the Free Software Foundation
147d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
148d87a3195Smrg# with or without modifications, as long as this notice is preserved.
14939713583Smrg
1502378475aSmrg
151d87a3195Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
152d87a3195Smrg# written in clear, in which case automake, when reading aclocal.m4,
153d87a3195Smrg# will think it sees a *use*, and therefore will trigger all it's
154d87a3195Smrg# C support machinery.  Also note that it means that autoscan, seeing
155d87a3195Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1562378475aSmrg
1572378475aSmrg
158d87a3195Smrg# _AM_DEPENDENCIES(NAME)
159d87a3195Smrg# ----------------------
160d87a3195Smrg# See how the compiler implements dependency checking.
161d87a3195Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
162d87a3195Smrg# We try a few techniques and use that to set a single cache variable.
163d87a3195Smrg#
164d87a3195Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
165d87a3195Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
166d87a3195Smrg# dependency, and given that the user is not expected to run this macro,
167d87a3195Smrg# just rely on AC_PROG_CC.
168d87a3195SmrgAC_DEFUN([_AM_DEPENDENCIES],
169d87a3195Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
170d87a3195SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
171d87a3195SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
172d87a3195SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1732378475aSmrg
174d87a3195Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
175d87a3195Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
176d87a3195Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
177d87a3195Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
178d87a3195Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
179d87a3195Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
180d87a3195Smrg                    [depcc="$$1"   am_compiler_list=])
1812378475aSmrg
182d87a3195SmrgAC_CACHE_CHECK([dependency style of $depcc],
183d87a3195Smrg               [am_cv_$1_dependencies_compiler_type],
184d87a3195Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
185d87a3195Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
186d87a3195Smrg  # making bogus files that we don't know about and never remove.  For
187d87a3195Smrg  # instance it was reported that on HP-UX the gcc test will end up
188d87a3195Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
189d87a3195Smrg  # in D".
190d87a3195Smrg  rm -rf conftest.dir
191d87a3195Smrg  mkdir conftest.dir
192d87a3195Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
193d87a3195Smrg  # using a relative directory.
194d87a3195Smrg  cp "$am_depcomp" conftest.dir
195d87a3195Smrg  cd conftest.dir
196d87a3195Smrg  # We will build objects and dependencies in a subdirectory because
197d87a3195Smrg  # it helps to detect inapplicable dependency modes.  For instance
198d87a3195Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
199d87a3195Smrg  # side effect of compilation, but ICC will put the dependencies in
200d87a3195Smrg  # the current directory while Tru64 will put them in the object
201d87a3195Smrg  # directory.
202d87a3195Smrg  mkdir sub
2032378475aSmrg
204d87a3195Smrg  am_cv_$1_dependencies_compiler_type=none
205d87a3195Smrg  if test "$am_compiler_list" = ""; then
206d87a3195Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
207d87a3195Smrg  fi
208d87a3195Smrg  am__universal=false
209d87a3195Smrg  m4_case([$1], [CC],
210d87a3195Smrg    [case " $depcc " in #(
211d87a3195Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
212d87a3195Smrg     esac],
213d87a3195Smrg    [CXX],
214d87a3195Smrg    [case " $depcc " in #(
215d87a3195Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
216d87a3195Smrg     esac])
21795b296d0Smrg
218d87a3195Smrg  for depmode in $am_compiler_list; do
219d87a3195Smrg    # Setup a source with many dependencies, because some compilers
220d87a3195Smrg    # like to wrap large dependency lists on column 80 (with \), and
221d87a3195Smrg    # we should not choose a depcomp mode which is confused by this.
222d87a3195Smrg    #
223d87a3195Smrg    # We need to recreate these files for each test, as the compiler may
224d87a3195Smrg    # overwrite some of them when testing with obscure command lines.
225d87a3195Smrg    # This happens at least with the AIX C compiler.
226d87a3195Smrg    : > sub/conftest.c
227d87a3195Smrg    for i in 1 2 3 4 5 6; do
228d87a3195Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
229d87a3195Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
230d87a3195Smrg      # Solaris 10 /bin/sh.
231d87a3195Smrg      echo '/* dummy */' > sub/conftst$i.h
23289b0dc75Smrg    done
233d87a3195Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
23489b0dc75Smrg
235d87a3195Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
236d87a3195Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
237d87a3195Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
238d87a3195Smrg    # versions had trouble with output in subdirs.
239d87a3195Smrg    am__obj=sub/conftest.${OBJEXT-o}
240d87a3195Smrg    am__minus_obj="-o $am__obj"
241d87a3195Smrg    case $depmode in
242d87a3195Smrg    gcc)
243d87a3195Smrg      # This depmode causes a compiler race in universal mode.
244d87a3195Smrg      test "$am__universal" = false || continue
245d87a3195Smrg      ;;
246d87a3195Smrg    nosideeffect)
247d87a3195Smrg      # After this tag, mechanisms are not by side-effect, so they'll
248d87a3195Smrg      # only be used when explicitly requested.
249d87a3195Smrg      if test "x$enable_dependency_tracking" = xyes; then
250d87a3195Smrg	continue
251d87a3195Smrg      else
252d87a3195Smrg	break
253d87a3195Smrg      fi
254d87a3195Smrg      ;;
255d87a3195Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
256d87a3195Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
257d87a3195Smrg      # not run yet.  These depmodes are late enough in the game, and
258d87a3195Smrg      # so weak that their functioning should not be impacted.
259d87a3195Smrg      am__obj=conftest.${OBJEXT-o}
260d87a3195Smrg      am__minus_obj=
261d87a3195Smrg      ;;
262d87a3195Smrg    none) break ;;
263d87a3195Smrg    esac
264d87a3195Smrg    if depmode=$depmode \
265d87a3195Smrg       source=sub/conftest.c object=$am__obj \
266d87a3195Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
267d87a3195Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
268d87a3195Smrg         >/dev/null 2>conftest.err &&
269d87a3195Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
270d87a3195Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
271d87a3195Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
272d87a3195Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
273d87a3195Smrg      # icc doesn't choke on unknown options, it will just issue warnings
274d87a3195Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
275d87a3195Smrg      # that says an option was ignored or not supported.
276d87a3195Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
277d87a3195Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
278d87a3195Smrg      # The diagnosis changed in icc 8.0:
279d87a3195Smrg      #   icc: Command line remark: option '-MP' not supported
280d87a3195Smrg      if (grep 'ignoring option' conftest.err ||
281d87a3195Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
282d87a3195Smrg        am_cv_$1_dependencies_compiler_type=$depmode
283d87a3195Smrg        break
284d87a3195Smrg      fi
285d87a3195Smrg    fi
286d87a3195Smrg  done
28789b0dc75Smrg
288d87a3195Smrg  cd ..
289d87a3195Smrg  rm -rf conftest.dir
290d87a3195Smrgelse
291d87a3195Smrg  am_cv_$1_dependencies_compiler_type=none
292d87a3195Smrgfi
293d87a3195Smrg])
294d87a3195SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
295d87a3195SmrgAM_CONDITIONAL([am__fastdep$1], [
296d87a3195Smrg  test "x$enable_dependency_tracking" != xno \
297d87a3195Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
298eca46af7Smrg])
299e6f085baSmrg
30095b296d0Smrg
301d87a3195Smrg# AM_SET_DEPDIR
302d87a3195Smrg# -------------
303d87a3195Smrg# Choose a directory name for dependency files.
304d87a3195Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
305d87a3195SmrgAC_DEFUN([AM_SET_DEPDIR],
306d87a3195Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
307d87a3195SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
308d87a3195Smrg])
30939713583Smrg
31039713583Smrg
311d87a3195Smrg# AM_DEP_TRACK
312d87a3195Smrg# ------------
313d87a3195SmrgAC_DEFUN([AM_DEP_TRACK],
314d87a3195Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
315d87a3195SmrgAS_HELP_STRING(
316d87a3195Smrg  [--enable-dependency-tracking],
317d87a3195Smrg  [do not reject slow dependency extractors])
318d87a3195SmrgAS_HELP_STRING(
319d87a3195Smrg  [--disable-dependency-tracking],
320d87a3195Smrg  [speeds up one-time build])])
321d87a3195Smrgif test "x$enable_dependency_tracking" != xno; then
322d87a3195Smrg  am_depcomp="$ac_aux_dir/depcomp"
323d87a3195Smrg  AMDEPBACKSLASH='\'
324d87a3195Smrg  am__nodep='_no'
32514330f12Smrgfi
326d87a3195SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
327d87a3195SmrgAC_SUBST([AMDEPBACKSLASH])dnl
328d87a3195Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
329d87a3195SmrgAC_SUBST([am__nodep])dnl
330d87a3195Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
33114330f12Smrg])
33239713583Smrg
333d87a3195Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3342378475aSmrg
335d87a3195Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
336d87a3195Smrg#
337d87a3195Smrg# This file is free software; the Free Software Foundation
338d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
339d87a3195Smrg# with or without modifications, as long as this notice is preserved.
3402378475aSmrg
341d87a3195Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
342d87a3195Smrg# ------------------------------
343d87a3195SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
344d87a3195Smrg[{
345d87a3195Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
346d87a3195Smrg  # are listed without --file.  Let's play safe and only enable the eval
347d87a3195Smrg  # if we detect the quoting.
348d87a3195Smrg  # TODO: see whether this extra hack can be removed once we start
349d87a3195Smrg  # requiring Autoconf 2.70 or later.
350d87a3195Smrg  AS_CASE([$CONFIG_FILES],
351d87a3195Smrg          [*\'*], [eval set x "$CONFIG_FILES"],
352d87a3195Smrg          [*], [set x $CONFIG_FILES])
353d87a3195Smrg  shift
354d87a3195Smrg  # Used to flag and report bootstrapping failures.
355d87a3195Smrg  am_rc=0
356d87a3195Smrg  for am_mf
357d87a3195Smrg  do
358d87a3195Smrg    # Strip MF so we end up with the name of the file.
359d87a3195Smrg    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
360d87a3195Smrg    # Check whether this is an Automake generated Makefile which includes
361d87a3195Smrg    # dependency-tracking related rules and includes.
362d87a3195Smrg    # Grep'ing the whole file directly is not great: AIX grep has a line
363d87a3195Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
364d87a3195Smrg    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
365d87a3195Smrg      || continue
366d87a3195Smrg    am_dirpart=`AS_DIRNAME(["$am_mf"])`
367d87a3195Smrg    am_filepart=`AS_BASENAME(["$am_mf"])`
368d87a3195Smrg    AM_RUN_LOG([cd "$am_dirpart" \
369d87a3195Smrg      && sed -e '/# am--include-marker/d' "$am_filepart" \
370d87a3195Smrg        | $MAKE -f - am--depfiles]) || am_rc=$?
371d87a3195Smrg  done
372d87a3195Smrg  if test $am_rc -ne 0; then
373d87a3195Smrg    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
374d87a3195Smrg    for automatic dependency tracking.  If GNU make was not used, consider
375d87a3195Smrg    re-running the configure script with MAKE="gmake" (or whatever is
376d87a3195Smrg    necessary).  You can also try re-running configure with the
377d87a3195Smrg    '--disable-dependency-tracking' option to at least be able to build
378d87a3195Smrg    the package (albeit without support for automatic dependency tracking).])
379eca46af7Smrg  fi
380d87a3195Smrg  AS_UNSET([am_dirpart])
381d87a3195Smrg  AS_UNSET([am_filepart])
382d87a3195Smrg  AS_UNSET([am_mf])
383d87a3195Smrg  AS_UNSET([am_rc])
384d87a3195Smrg  rm -f conftest-deps.mk
385d87a3195Smrg}
386d87a3195Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3872378475aSmrg
3882378475aSmrg
389d87a3195Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
390d87a3195Smrg# -----------------------------
391d87a3195Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
392d87a3195Smrg#
393d87a3195Smrg# This code is only required when automatic dependency tracking is enabled.
394d87a3195Smrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
395d87a3195Smrg# order to bootstrap the dependency handling code.
396d87a3195SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
397d87a3195Smrg[AC_CONFIG_COMMANDS([depfiles],
398d87a3195Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
399d87a3195Smrg     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
4002378475aSmrg
401d87a3195Smrg# Do all the work for Automake.                             -*- Autoconf -*-
4022378475aSmrg
403d87a3195Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
404d87a3195Smrg#
405d87a3195Smrg# This file is free software; the Free Software Foundation
406d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
407d87a3195Smrg# with or without modifications, as long as this notice is preserved.
4082378475aSmrg
409d87a3195Smrg# This macro actually does too much.  Some checks are only needed if
410d87a3195Smrg# your package does certain things.  But this isn't really a big deal.
4112378475aSmrg
412d87a3195Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
413d87a3195Smrgm4_define([AC_PROG_CC],
414d87a3195Smrgm4_defn([AC_PROG_CC])
415d87a3195Smrg[_AM_PROG_CC_C_O
416d87a3195Smrg])
4172378475aSmrg
418d87a3195Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
419d87a3195Smrg# AM_INIT_AUTOMAKE([OPTIONS])
420d87a3195Smrg# -----------------------------------------------
421d87a3195Smrg# The call with PACKAGE and VERSION arguments is the old style
422d87a3195Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
423d87a3195Smrg# and VERSION should now be passed to AC_INIT and removed from
424d87a3195Smrg# the call to AM_INIT_AUTOMAKE.
425d87a3195Smrg# We support both call styles for the transition.  After
426d87a3195Smrg# the next Automake release, Autoconf can make the AC_INIT
427d87a3195Smrg# arguments mandatory, and then we can depend on a new Autoconf
428d87a3195Smrg# release and drop the old call support.
429d87a3195SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
430d87a3195Smrg[AC_PREREQ([2.65])dnl
431d87a3195Smrgm4_ifdef([_$0_ALREADY_INIT],
432d87a3195Smrg  [m4_fatal([$0 expanded multiple times
433d87a3195Smrg]m4_defn([_$0_ALREADY_INIT]))],
434d87a3195Smrg  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
435d87a3195Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
436d87a3195Smrgdnl the ones we care about.
437d87a3195Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
438d87a3195SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
439d87a3195SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
440d87a3195Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
441d87a3195Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
442d87a3195Smrg  # is not polluted with repeated "-I."
443d87a3195Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
444d87a3195Smrg  # test to see if srcdir already configured
445d87a3195Smrg  if test -f $srcdir/config.status; then
446d87a3195Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
447d87a3195Smrg  fi
448d87a3195Smrgfi
4492378475aSmrg
450d87a3195Smrg# test whether we have cygpath
451d87a3195Smrgif test -z "$CYGPATH_W"; then
452d87a3195Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
453d87a3195Smrg    CYGPATH_W='cygpath -w'
454d87a3195Smrg  else
455d87a3195Smrg    CYGPATH_W=echo
456d87a3195Smrg  fi
457d87a3195Smrgfi
458d87a3195SmrgAC_SUBST([CYGPATH_W])
4592378475aSmrg
460d87a3195Smrg# Define the identity of the package.
461d87a3195Smrgdnl Distinguish between old-style and new-style calls.
462d87a3195Smrgm4_ifval([$2],
463d87a3195Smrg[AC_DIAGNOSE([obsolete],
464d87a3195Smrg             [$0: two- and three-arguments forms are deprecated.])
465d87a3195Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
466d87a3195Smrg AC_SUBST([PACKAGE], [$1])dnl
467d87a3195Smrg AC_SUBST([VERSION], [$2])],
468d87a3195Smrg[_AM_SET_OPTIONS([$1])dnl
469d87a3195Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
470d87a3195Smrgm4_if(
471d87a3195Smrg  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
472d87a3195Smrg  [ok:ok],,
473d87a3195Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
474d87a3195Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
475d87a3195Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4762378475aSmrg
477d87a3195Smrg_AM_IF_OPTION([no-define],,
478d87a3195Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
479d87a3195Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4802378475aSmrg
481d87a3195Smrg# Some tools Automake needs.
482d87a3195SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
483d87a3195SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
484d87a3195SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
485d87a3195SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
486d87a3195SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
487d87a3195SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
488d87a3195SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
489d87a3195SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
490d87a3195SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
491d87a3195SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
492d87a3195Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
493d87a3195Smrg# dies out for good.  For more background, see:
494d87a3195Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
495d87a3195Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
496d87a3195SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
497d87a3195Smrg# We need awk for the "check" target (and possibly the TAP driver).  The
498d87a3195Smrg# system "awk" is bad on some platforms.
499d87a3195SmrgAC_REQUIRE([AC_PROG_AWK])dnl
500d87a3195SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
501d87a3195SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
502d87a3195Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
503d87a3195Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
504d87a3195Smrg			     [_AM_PROG_TAR([v7])])])
505d87a3195Smrg_AM_IF_OPTION([no-dependencies],,
506d87a3195Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
507d87a3195Smrg		  [_AM_DEPENDENCIES([CC])],
508d87a3195Smrg		  [m4_define([AC_PROG_CC],
509d87a3195Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
510d87a3195SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
511d87a3195Smrg		  [_AM_DEPENDENCIES([CXX])],
512d87a3195Smrg		  [m4_define([AC_PROG_CXX],
513d87a3195Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
514d87a3195SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
515d87a3195Smrg		  [_AM_DEPENDENCIES([OBJC])],
516d87a3195Smrg		  [m4_define([AC_PROG_OBJC],
517d87a3195Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
518d87a3195SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
519d87a3195Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
520d87a3195Smrg		  [m4_define([AC_PROG_OBJCXX],
521d87a3195Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
522eca46af7Smrg])
523d87a3195Smrg# Variables for tags utilities; see am/tags.am
524d87a3195Smrgif test -z "$CTAGS"; then
525d87a3195Smrg  CTAGS=ctags
526d87a3195Smrgfi
527d87a3195SmrgAC_SUBST([CTAGS])
528d87a3195Smrgif test -z "$ETAGS"; then
529d87a3195Smrg  ETAGS=etags
530d87a3195Smrgfi
531d87a3195SmrgAC_SUBST([ETAGS])
532d87a3195Smrgif test -z "$CSCOPE"; then
533d87a3195Smrg  CSCOPE=cscope
534d87a3195Smrgfi
535d87a3195SmrgAC_SUBST([CSCOPE])
5362378475aSmrg
537d87a3195SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
538d87a3195Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
539d87a3195Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
540d87a3195Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
541d87a3195SmrgAC_CONFIG_COMMANDS_PRE(dnl
542d87a3195Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
543d87a3195Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5442378475aSmrg
545d87a3195Smrg# POSIX will say in a future version that running "rm -f" with no argument
546d87a3195Smrg# is OK; and we want to be able to make that assumption in our Makefile
547d87a3195Smrg# recipes.  So use an aggressive probe to check that the usage we want is
548d87a3195Smrg# actually supported "in the wild" to an acceptable degree.
549d87a3195Smrg# See automake bug#10828.
550d87a3195Smrg# To make any issue more visible, cause the running configure to be aborted
551d87a3195Smrg# by default if the 'rm' program in use doesn't match our expectations; the
552d87a3195Smrg# user can still override this though.
553d87a3195Smrgif rm -f && rm -fr && rm -rf; then : OK; else
554d87a3195Smrg  cat >&2 <<'END'
555d87a3195SmrgOops!
5562378475aSmrg
557d87a3195SmrgYour 'rm' program seems unable to run without file operands specified
558d87a3195Smrgon the command line, even when the '-f' option is present.  This is contrary
559d87a3195Smrgto the behaviour of most rm programs out there, and not conforming with
560d87a3195Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
5612378475aSmrg
562d87a3195SmrgPlease tell bug-automake@gnu.org about your system, including the value
563d87a3195Smrgof your $PATH and any error possibly output before this message.  This
564d87a3195Smrgcan help us improve future automake versions.
5652378475aSmrg
566d87a3195SmrgEND
567d87a3195Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
568d87a3195Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
569d87a3195Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
570d87a3195Smrg    echo >&2
571d87a3195Smrg  else
572d87a3195Smrg    cat >&2 <<'END'
573d87a3195SmrgAborting the configuration process, to ensure you take notice of the issue.
57414330f12Smrg
575d87a3195SmrgYou can download and install GNU coreutils to get an 'rm' implementation
576d87a3195Smrgthat behaves properly: <https://www.gnu.org/software/coreutils/>.
5772378475aSmrg
578d87a3195SmrgIf you want to complete the configuration process using your problematic
579d87a3195Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
580d87a3195Smrgto "yes", and re-run configure.
5812378475aSmrg
582d87a3195SmrgEND
583d87a3195Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
584d87a3195Smrg  fi
585d87a3195Smrgfi
586d87a3195Smrgdnl The trailing newline in this macro's definition is deliberate, for
587d87a3195Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments
588d87a3195Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
58914330f12Smrg])
5902378475aSmrg
591d87a3195Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
592d87a3195Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
593d87a3195Smrgdnl mangled by Autoconf and run in a shell conditional statement.
594d87a3195Smrgm4_define([_AC_COMPILER_EXEEXT],
595d87a3195Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5962378475aSmrg
597d87a3195Smrg# When config.status generates a header, we must update the stamp-h file.
598d87a3195Smrg# This file resides in the same directory as the config header
599d87a3195Smrg# that is generated.  The stamp files are numbered to have different names.
6002378475aSmrg
601d87a3195Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
602d87a3195Smrg# loop where config.status creates the headers, so we can generate
603d87a3195Smrg# our stamp files there.
604d87a3195SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
605d87a3195Smrg[# Compute $1's index in $config_headers.
606d87a3195Smrg_am_arg=$1
607d87a3195Smrg_am_stamp_count=1
608d87a3195Smrgfor _am_header in $config_headers :; do
609d87a3195Smrg  case $_am_header in
610d87a3195Smrg    $_am_arg | $_am_arg:* )
611d87a3195Smrg      break ;;
612d87a3195Smrg    * )
613d87a3195Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
614d87a3195Smrg  esac
615d87a3195Smrgdone
616d87a3195Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
6172378475aSmrg
618d87a3195Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
619d87a3195Smrg#
620d87a3195Smrg# This file is free software; the Free Software Foundation
621d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
622d87a3195Smrg# with or without modifications, as long as this notice is preserved.
6232378475aSmrg
624d87a3195Smrg# AM_PROG_INSTALL_SH
625d87a3195Smrg# ------------------
626d87a3195Smrg# Define $install_sh.
627d87a3195SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
628d87a3195Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
629d87a3195Smrgif test x"${install_sh+set}" != xset; then
630d87a3195Smrg  case $am_aux_dir in
631d87a3195Smrg  *\ * | *\	*)
632d87a3195Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
633d87a3195Smrg  *)
634d87a3195Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
635d87a3195Smrg  esac
636d87a3195Smrgfi
637d87a3195SmrgAC_SUBST([install_sh])])
6382378475aSmrg
639d87a3195Smrg# Copyright (C) 2003-2021 Free Software Foundation, Inc.
640d87a3195Smrg#
641d87a3195Smrg# This file is free software; the Free Software Foundation
642d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
643d87a3195Smrg# with or without modifications, as long as this notice is preserved.
6442378475aSmrg
645d87a3195Smrg# Check whether the underlying file-system supports filenames
646d87a3195Smrg# with a leading dot.  For instance MS-DOS doesn't.
647d87a3195SmrgAC_DEFUN([AM_SET_LEADING_DOT],
648d87a3195Smrg[rm -rf .tst 2>/dev/null
649d87a3195Smrgmkdir .tst 2>/dev/null
650d87a3195Smrgif test -d .tst; then
651d87a3195Smrg  am__leading_dot=.
652d87a3195Smrgelse
653d87a3195Smrg  am__leading_dot=_
654d87a3195Smrgfi
655d87a3195Smrgrmdir .tst 2>/dev/null
656d87a3195SmrgAC_SUBST([am__leading_dot])])
6572378475aSmrg
658d87a3195Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6592378475aSmrg
660d87a3195Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
661d87a3195Smrg#
662d87a3195Smrg# This file is free software; the Free Software Foundation
663d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
664d87a3195Smrg# with or without modifications, as long as this notice is preserved.
6652378475aSmrg
666d87a3195Smrg# AM_MAKE_INCLUDE()
667d87a3195Smrg# -----------------
668d87a3195Smrg# Check whether make has an 'include' directive that can support all
669d87a3195Smrg# the idioms we need for our automatic dependency tracking code.
670d87a3195SmrgAC_DEFUN([AM_MAKE_INCLUDE],
671d87a3195Smrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
672d87a3195Smrgcat > confinc.mk << 'END'
673d87a3195Smrgam__doit:
674d87a3195Smrg	@echo this is the am__doit target >confinc.out
675d87a3195Smrg.PHONY: am__doit
676d87a3195SmrgEND
677d87a3195Smrgam__include="#"
678d87a3195Smrgam__quote=
679d87a3195Smrg# BSD make does it like this.
680d87a3195Smrgecho '.include "confinc.mk" # ignored' > confmf.BSD
681d87a3195Smrg# Other make implementations (GNU, Solaris 10, AIX) do it like this.
682d87a3195Smrgecho 'include confinc.mk # ignored' > confmf.GNU
683d87a3195Smrg_am_result=no
684d87a3195Smrgfor s in GNU BSD; do
685d87a3195Smrg  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
686d87a3195Smrg  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
687d87a3195Smrg      ['0:this is the am__doit target'],
688d87a3195Smrg      [AS_CASE([$s],
689d87a3195Smrg          [BSD], [am__include='.include' am__quote='"'],
690d87a3195Smrg          [am__include='include' am__quote=''])])
691d87a3195Smrg  if test "$am__include" != "#"; then
692d87a3195Smrg    _am_result="yes ($s style)"
693d87a3195Smrg    break
694d87a3195Smrg  fi
695d87a3195Smrgdone
696d87a3195Smrgrm -f confinc.* confmf.*
697d87a3195SmrgAC_MSG_RESULT([${_am_result}])
698d87a3195SmrgAC_SUBST([am__include])])
699d87a3195SmrgAC_SUBST([am__quote])])
7002378475aSmrg
701d87a3195Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
7022378475aSmrg
703d87a3195Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
704d87a3195Smrg#
705d87a3195Smrg# This file is free software; the Free Software Foundation
706d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
707d87a3195Smrg# with or without modifications, as long as this notice is preserved.
7082378475aSmrg
709d87a3195Smrg# AM_MISSING_PROG(NAME, PROGRAM)
710d87a3195Smrg# ------------------------------
711d87a3195SmrgAC_DEFUN([AM_MISSING_PROG],
712d87a3195Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
713d87a3195Smrg$1=${$1-"${am_missing_run}$2"}
714d87a3195SmrgAC_SUBST($1)])
715d87a3195Smrg
716d87a3195Smrg# AM_MISSING_HAS_RUN
717d87a3195Smrg# ------------------
718d87a3195Smrg# Define MISSING if not defined so far and test if it is modern enough.
719d87a3195Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
720d87a3195SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
721d87a3195Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
722d87a3195SmrgAC_REQUIRE_AUX_FILE([missing])dnl
723d87a3195Smrgif test x"${MISSING+set}" != xset; then
724d87a3195Smrg  MISSING="\${SHELL} '$am_aux_dir/missing'"
725d87a3195Smrgfi
726d87a3195Smrg# Use eval to expand $SHELL
727d87a3195Smrgif eval "$MISSING --is-lightweight"; then
728d87a3195Smrg  am_missing_run="$MISSING "
729d87a3195Smrgelse
730d87a3195Smrg  am_missing_run=
731d87a3195Smrg  AC_MSG_WARN(['missing' script is too old or missing])
732d87a3195Smrgfi
733d87a3195Smrg])
7342378475aSmrg
735d87a3195Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7362378475aSmrg
737d87a3195Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
738d87a3195Smrg#
739d87a3195Smrg# This file is free software; the Free Software Foundation
740d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
741d87a3195Smrg# with or without modifications, as long as this notice is preserved.
7422378475aSmrg
743d87a3195Smrg# _AM_MANGLE_OPTION(NAME)
744d87a3195Smrg# -----------------------
745d87a3195SmrgAC_DEFUN([_AM_MANGLE_OPTION],
746d87a3195Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7472378475aSmrg
748d87a3195Smrg# _AM_SET_OPTION(NAME)
749d87a3195Smrg# --------------------
750d87a3195Smrg# Set option NAME.  Presently that only means defining a flag for this option.
751d87a3195SmrgAC_DEFUN([_AM_SET_OPTION],
752d87a3195Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
753eca46af7Smrg
754d87a3195Smrg# _AM_SET_OPTIONS(OPTIONS)
755d87a3195Smrg# ------------------------
756d87a3195Smrg# OPTIONS is a space-separated list of Automake options.
757d87a3195SmrgAC_DEFUN([_AM_SET_OPTIONS],
758d87a3195Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
759eca46af7Smrg
760d87a3195Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
761d87a3195Smrg# -------------------------------------------
762d87a3195Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
763d87a3195SmrgAC_DEFUN([_AM_IF_OPTION],
764d87a3195Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7652378475aSmrg
766d87a3195Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
767d87a3195Smrg#
768d87a3195Smrg# This file is free software; the Free Software Foundation
769d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
770d87a3195Smrg# with or without modifications, as long as this notice is preserved.
7712378475aSmrg
772d87a3195Smrg# _AM_PROG_CC_C_O
773d87a3195Smrg# ---------------
774d87a3195Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
775d87a3195Smrg# to automatically call this.
776d87a3195SmrgAC_DEFUN([_AM_PROG_CC_C_O],
777d87a3195Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
778d87a3195SmrgAC_REQUIRE_AUX_FILE([compile])dnl
779d87a3195SmrgAC_LANG_PUSH([C])dnl
780d87a3195SmrgAC_CACHE_CHECK(
781d87a3195Smrg  [whether $CC understands -c and -o together],
782d87a3195Smrg  [am_cv_prog_cc_c_o],
783d87a3195Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
784d87a3195Smrg  # Make sure it works both with $CC and with simple cc.
785d87a3195Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
786d87a3195Smrg  # compilers refuse to overwrite an existing .o file with -o,
787d87a3195Smrg  # though they will create one.
788d87a3195Smrg  am_cv_prog_cc_c_o=yes
789d87a3195Smrg  for am_i in 1 2; do
790d87a3195Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
791d87a3195Smrg         && test -f conftest2.$ac_objext; then
792d87a3195Smrg      : OK
793d87a3195Smrg    else
794d87a3195Smrg      am_cv_prog_cc_c_o=no
795d87a3195Smrg      break
796d87a3195Smrg    fi
797d87a3195Smrg  done
798d87a3195Smrg  rm -f core conftest*
799d87a3195Smrg  unset am_i])
800d87a3195Smrgif test "$am_cv_prog_cc_c_o" != yes; then
801d87a3195Smrg   # Losing compiler, so override with the script.
802d87a3195Smrg   # FIXME: It is wrong to rewrite CC.
803d87a3195Smrg   # But if we don't then we get into trouble of one sort or another.
804d87a3195Smrg   # A longer-term fix would be to have automake use am__CC in this case,
805d87a3195Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
806d87a3195Smrg   CC="$am_aux_dir/compile $CC"
807d87a3195Smrgfi
808d87a3195SmrgAC_LANG_POP([C])])
809eca46af7Smrg
810d87a3195Smrg# For backward compatibility.
811d87a3195SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
812eca46af7Smrg
813d87a3195Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
81414330f12Smrg#
815d87a3195Smrg# This file is free software; the Free Software Foundation
816d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
817d87a3195Smrg# with or without modifications, as long as this notice is preserved.
8182378475aSmrg
819d87a3195Smrg# AM_RUN_LOG(COMMAND)
820d87a3195Smrg# -------------------
821d87a3195Smrg# Run COMMAND, save the exit status in ac_status, and log it.
822d87a3195Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
823d87a3195SmrgAC_DEFUN([AM_RUN_LOG],
824d87a3195Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
825d87a3195Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
826d87a3195Smrg   ac_status=$?
827d87a3195Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
828d87a3195Smrg   (exit $ac_status); }])
8292378475aSmrg
830d87a3195Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
831eca46af7Smrg
832d87a3195Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
8332378475aSmrg#
834d87a3195Smrg# This file is free software; the Free Software Foundation
835d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
836d87a3195Smrg# with or without modifications, as long as this notice is preserved.
8372378475aSmrg
838d87a3195Smrg# AM_SANITY_CHECK
839d87a3195Smrg# ---------------
840d87a3195SmrgAC_DEFUN([AM_SANITY_CHECK],
841d87a3195Smrg[AC_MSG_CHECKING([whether build environment is sane])
842d87a3195Smrg# Reject unsafe characters in $srcdir or the absolute working directory
843d87a3195Smrg# name.  Accept space and tab only in the latter.
844d87a3195Smrgam_lf='
845d87a3195Smrg'
846d87a3195Smrgcase `pwd` in
847d87a3195Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
848d87a3195Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
849d87a3195Smrgesac
850d87a3195Smrgcase $srcdir in
851d87a3195Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
852d87a3195Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
853d87a3195Smrgesac
8542378475aSmrg
855d87a3195Smrg# Do 'set' in a subshell so we don't clobber the current shell's
856d87a3195Smrg# arguments.  Must try -L first in case configure is actually a
857d87a3195Smrg# symlink; some systems play weird games with the mod time of symlinks
858d87a3195Smrg# (eg FreeBSD returns the mod time of the symlink's containing
859d87a3195Smrg# directory).
860d87a3195Smrgif (
861d87a3195Smrg   am_has_slept=no
862d87a3195Smrg   for am_try in 1 2; do
863d87a3195Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
864d87a3195Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
865d87a3195Smrg     if test "$[*]" = "X"; then
866d87a3195Smrg	# -L didn't work.
867d87a3195Smrg	set X `ls -t "$srcdir/configure" conftest.file`
868d87a3195Smrg     fi
869d87a3195Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
870d87a3195Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
8712378475aSmrg
872d87a3195Smrg	# If neither matched, then we have a broken ls.  This can happen
873d87a3195Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
874d87a3195Smrg	# broken ls alias from the environment.  This has actually
875d87a3195Smrg	# happened.  Such a system could not be considered "sane".
876d87a3195Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
877d87a3195Smrg  alias in your environment])
878d87a3195Smrg     fi
879d87a3195Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
880d87a3195Smrg       break
881d87a3195Smrg     fi
882d87a3195Smrg     # Just in case.
883d87a3195Smrg     sleep 1
884d87a3195Smrg     am_has_slept=yes
885d87a3195Smrg   done
886d87a3195Smrg   test "$[2]" = conftest.file
887d87a3195Smrg   )
888d87a3195Smrgthen
889d87a3195Smrg   # Ok.
890d87a3195Smrg   :
891d87a3195Smrgelse
892d87a3195Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
893d87a3195SmrgCheck your system clock])
894d87a3195Smrgfi
895d87a3195SmrgAC_MSG_RESULT([yes])
896d87a3195Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
897d87a3195Smrg# generated files are strictly newer.
898d87a3195Smrgam_sleep_pid=
899d87a3195Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
900d87a3195Smrg  ( sleep 1 ) &
901d87a3195Smrg  am_sleep_pid=$!
902d87a3195Smrgfi
903d87a3195SmrgAC_CONFIG_COMMANDS_PRE(
904d87a3195Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
905d87a3195Smrg   if test -n "$am_sleep_pid"; then
906d87a3195Smrg     # Hide warnings about reused PIDs.
907d87a3195Smrg     wait $am_sleep_pid 2>/dev/null
908d87a3195Smrg   fi
909d87a3195Smrg   AC_MSG_RESULT([done])])
910d87a3195Smrgrm -f conftest.file
911d87a3195Smrg])
9122378475aSmrg
913d87a3195Smrg# Copyright (C) 2009-2021 Free Software Foundation, Inc.
914d87a3195Smrg#
915d87a3195Smrg# This file is free software; the Free Software Foundation
916d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
917d87a3195Smrg# with or without modifications, as long as this notice is preserved.
9182378475aSmrg
919d87a3195Smrg# AM_SILENT_RULES([DEFAULT])
920d87a3195Smrg# --------------------------
921d87a3195Smrg# Enable less verbose build rules; with the default set to DEFAULT
922d87a3195Smrg# ("yes" being less verbose, "no" or empty being verbose).
923d87a3195SmrgAC_DEFUN([AM_SILENT_RULES],
924d87a3195Smrg[AC_ARG_ENABLE([silent-rules], [dnl
925d87a3195SmrgAS_HELP_STRING(
926d87a3195Smrg  [--enable-silent-rules],
927d87a3195Smrg  [less verbose build output (undo: "make V=1")])
928d87a3195SmrgAS_HELP_STRING(
929d87a3195Smrg  [--disable-silent-rules],
930d87a3195Smrg  [verbose build output (undo: "make V=0")])dnl
931d87a3195Smrg])
932d87a3195Smrgcase $enable_silent_rules in @%:@ (((
933d87a3195Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
934d87a3195Smrg   no) AM_DEFAULT_VERBOSITY=1;;
935d87a3195Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
936d87a3195Smrgesac
937d87a3195Smrgdnl
938d87a3195Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
939d87a3195Smrgdnl do not support nested variable expansions.
940d87a3195Smrgdnl See automake bug#9928 and bug#10237.
941d87a3195Smrgam_make=${MAKE-make}
942d87a3195SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
943d87a3195Smrg   [am_cv_make_support_nested_variables],
944d87a3195Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
945d87a3195SmrgBAR0=false
946d87a3195SmrgBAR1=true
947d87a3195SmrgV=1
948d87a3195Smrgam__doit:
949d87a3195Smrg	@$(TRUE)
950d87a3195Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
951d87a3195Smrg  am_cv_make_support_nested_variables=yes
952d87a3195Smrgelse
953d87a3195Smrg  am_cv_make_support_nested_variables=no
954d87a3195Smrgfi])
955d87a3195Smrgif test $am_cv_make_support_nested_variables = yes; then
956d87a3195Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
957d87a3195Smrg  AM_V='$(V)'
958d87a3195Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
959d87a3195Smrgelse
960d87a3195Smrg  AM_V=$AM_DEFAULT_VERBOSITY
961d87a3195Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
962d87a3195Smrgfi
963d87a3195SmrgAC_SUBST([AM_V])dnl
964d87a3195SmrgAM_SUBST_NOTMAKE([AM_V])dnl
965d87a3195SmrgAC_SUBST([AM_DEFAULT_V])dnl
966d87a3195SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
967d87a3195SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
968d87a3195SmrgAM_BACKSLASH='\'
969d87a3195SmrgAC_SUBST([AM_BACKSLASH])dnl
970d87a3195Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
971d87a3195Smrg])
9722378475aSmrg
973d87a3195Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
974d87a3195Smrg#
975d87a3195Smrg# This file is free software; the Free Software Foundation
976d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
977d87a3195Smrg# with or without modifications, as long as this notice is preserved.
9782378475aSmrg
979d87a3195Smrg# AM_PROG_INSTALL_STRIP
980d87a3195Smrg# ---------------------
981d87a3195Smrg# One issue with vendor 'install' (even GNU) is that you can't
982d87a3195Smrg# specify the program used to strip binaries.  This is especially
983d87a3195Smrg# annoying in cross-compiling environments, where the build's strip
984d87a3195Smrg# is unlikely to handle the host's binaries.
985d87a3195Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
986d87a3195Smrg# always use install-sh in "make install-strip", and initialize
987d87a3195Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
988d87a3195SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
989d87a3195Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
990d87a3195Smrg# Installed binaries are usually stripped using 'strip' when the user
991d87a3195Smrg# run "make install-strip".  However 'strip' might not be the right
992d87a3195Smrg# tool to use in cross-compilation environments, therefore Automake
993d87a3195Smrg# will honor the 'STRIP' environment variable to overrule this program.
994d87a3195Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
995d87a3195Smrgif test "$cross_compiling" != no; then
996d87a3195Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
997d87a3195Smrgfi
998d87a3195SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
999d87a3195SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
10002378475aSmrg
1001d87a3195Smrg# Copyright (C) 2006-2021 Free Software Foundation, Inc.
1002d87a3195Smrg#
1003d87a3195Smrg# This file is free software; the Free Software Foundation
1004d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
1005d87a3195Smrg# with or without modifications, as long as this notice is preserved.
10062378475aSmrg
1007d87a3195Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
1008d87a3195Smrg# ---------------------------
1009d87a3195Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1010d87a3195Smrg# This macro is traced by Automake.
1011d87a3195SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
10122378475aSmrg
1013d87a3195Smrg# AM_SUBST_NOTMAKE(VARIABLE)
1014d87a3195Smrg# --------------------------
1015d87a3195Smrg# Public sister of _AM_SUBST_NOTMAKE.
1016d87a3195SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
10172378475aSmrg
1018d87a3195Smrg# Check how to create a tarball.                            -*- Autoconf -*-
10192378475aSmrg
1020d87a3195Smrg# Copyright (C) 2004-2021 Free Software Foundation, Inc.
1021d87a3195Smrg#
1022d87a3195Smrg# This file is free software; the Free Software Foundation
1023d87a3195Smrg# gives unlimited permission to copy and/or distribute it,
1024d87a3195Smrg# with or without modifications, as long as this notice is preserved.
10252378475aSmrg
1026d87a3195Smrg# _AM_PROG_TAR(FORMAT)
1027d87a3195Smrg# --------------------
1028d87a3195Smrg# Check how to create a tarball in format FORMAT.
1029d87a3195Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1030d87a3195Smrg#
1031d87a3195Smrg# Substitute a variable $(am__tar) that is a command
1032d87a3195Smrg# writing to stdout a FORMAT-tarball containing the directory
1033d87a3195Smrg# $tardir.
1034d87a3195Smrg#     tardir=directory && $(am__tar) > result.tar
1035d87a3195Smrg#
1036d87a3195Smrg# Substitute a variable $(am__untar) that extract such
1037d87a3195Smrg# a tarball read from stdin.
1038d87a3195Smrg#     $(am__untar) < result.tar
1039d87a3195Smrg#
1040d87a3195SmrgAC_DEFUN([_AM_PROG_TAR],
1041d87a3195Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1042d87a3195Smrg# in the wild :-(  We should find a proper way to deprecate it ...
1043d87a3195SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
10442378475aSmrg
1045d87a3195Smrg# We'll loop over all known methods to create a tar archive until one works.
1046d87a3195Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10472378475aSmrg
1048d87a3195Smrgm4_if([$1], [v7],
1049d87a3195Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
10502378475aSmrg
1051d87a3195Smrg  [m4_case([$1],
1052d87a3195Smrg    [ustar],
1053d87a3195Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1054d87a3195Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1055d87a3195Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1056d87a3195Smrg      # and bug#13588).
1057d87a3195Smrg      am_max_uid=2097151 # 2^21 - 1
1058d87a3195Smrg      am_max_gid=$am_max_uid
1059d87a3195Smrg      # The $UID and $GID variables are not portable, so we need to resort
1060d87a3195Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1061d87a3195Smrg      # below are definitely unexpected, so allow the users to see them
1062d87a3195Smrg      # (that is, avoid stderr redirection).
1063d87a3195Smrg      am_uid=`id -u || echo unknown`
1064d87a3195Smrg      am_gid=`id -g || echo unknown`
1065d87a3195Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1066d87a3195Smrg      if test $am_uid -le $am_max_uid; then
1067d87a3195Smrg         AC_MSG_RESULT([yes])
1068d87a3195Smrg      else
1069d87a3195Smrg         AC_MSG_RESULT([no])
1070d87a3195Smrg         _am_tools=none
1071d87a3195Smrg      fi
1072d87a3195Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1073d87a3195Smrg      if test $am_gid -le $am_max_gid; then
1074d87a3195Smrg         AC_MSG_RESULT([yes])
1075d87a3195Smrg      else
1076d87a3195Smrg        AC_MSG_RESULT([no])
1077d87a3195Smrg        _am_tools=none
1078d87a3195Smrg      fi],
10792378475aSmrg
1080d87a3195Smrg  [pax],
1081d87a3195Smrg    [],
10822378475aSmrg
1083d87a3195Smrg  [m4_fatal([Unknown tar format])])
10842378475aSmrg
1085d87a3195Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
108695b296d0Smrg
1087d87a3195Smrg  # Go ahead even if we have the value already cached.  We do so because we
1088d87a3195Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
1089d87a3195Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
10902378475aSmrg
1091d87a3195Smrg  for _am_tool in $_am_tools; do
1092d87a3195Smrg    case $_am_tool in
1093d87a3195Smrg    gnutar)
1094d87a3195Smrg      for _am_tar in tar gnutar gtar; do
1095d87a3195Smrg        AM_RUN_LOG([$_am_tar --version]) && break
1096d87a3195Smrg      done
1097d87a3195Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1098d87a3195Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1099d87a3195Smrg      am__untar="$_am_tar -xf -"
1100d87a3195Smrg      ;;
1101d87a3195Smrg    plaintar)
1102d87a3195Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
1103d87a3195Smrg      # ustar tarball either.
1104d87a3195Smrg      (tar --version) >/dev/null 2>&1 && continue
1105d87a3195Smrg      am__tar='tar chf - "$$tardir"'
1106d87a3195Smrg      am__tar_='tar chf - "$tardir"'
1107d87a3195Smrg      am__untar='tar xf -'
1108d87a3195Smrg      ;;
1109d87a3195Smrg    pax)
1110d87a3195Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
1111d87a3195Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
1112d87a3195Smrg      am__untar='pax -r'
1113d87a3195Smrg      ;;
1114d87a3195Smrg    cpio)
1115d87a3195Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1116d87a3195Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1117d87a3195Smrg      am__untar='cpio -i -H $1 -d'
1118d87a3195Smrg      ;;
1119d87a3195Smrg    none)
1120d87a3195Smrg      am__tar=false
1121d87a3195Smrg      am__tar_=false
1122d87a3195Smrg      am__untar=false
1123d87a3195Smrg      ;;
1124d87a3195Smrg    esac
112595b296d0Smrg
1126d87a3195Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
1127d87a3195Smrg    # and am__untar set.
1128d87a3195Smrg    test -n "${am_cv_prog_tar_$1}" && break
112995b296d0Smrg
1130d87a3195Smrg    # tar/untar a dummy directory, and stop if the command works.
1131d87a3195Smrg    rm -rf conftest.dir
1132d87a3195Smrg    mkdir conftest.dir
1133d87a3195Smrg    echo GrepMe > conftest.dir/file
1134d87a3195Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1135d87a3195Smrg    rm -rf conftest.dir
1136d87a3195Smrg    if test -s conftest.tar; then
1137d87a3195Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
1138d87a3195Smrg      AM_RUN_LOG([cat conftest.dir/file])
1139d87a3195Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1140d87a3195Smrg    fi
1141d87a3195Smrg  done
1142d87a3195Smrg  rm -rf conftest.dir
114395b296d0Smrg
1144d87a3195Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1145d87a3195Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
114695b296d0Smrg
1147d87a3195SmrgAC_SUBST([am__tar])
1148d87a3195SmrgAC_SUBST([am__untar])
1149d87a3195Smrg]) # _AM_PROG_TAR
115095b296d0Smrg
1151d87a3195Smrgdnl Copyright 2005 Red Hat, Inc
1152d87a3195Smrgdnl 
1153d87a3195Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1154d87a3195Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1155d87a3195Smrgdnl the above copyright notice appear in all copies and that both that
1156d87a3195Smrgdnl copyright notice and this permission notice appear in supporting
1157d87a3195Smrgdnl documentation.
1158d87a3195Smrgdnl 
1159d87a3195Smrgdnl The above copyright notice and this permission notice shall be included
1160d87a3195Smrgdnl in all copies or substantial portions of the Software.
1161d87a3195Smrgdnl 
1162d87a3195Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1163d87a3195Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1164d87a3195Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1165d87a3195Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1166d87a3195Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1167d87a3195Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1168d87a3195Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1169d87a3195Smrgdnl 
1170d87a3195Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1171d87a3195Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1172d87a3195Smrgdnl other dealings in this Software without prior written authorization
1173d87a3195Smrgdnl from the copyright holders.
1174d87a3195Smrgdnl 
117595b296d0Smrg
1176d87a3195Smrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
1177d87a3195Smrg# --------------------------
1178d87a3195Smrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
1179d87a3195Smrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
118095b296d0Smrg
1181d87a3195SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
1182d87a3195Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1183d87a3195Smrg	SAVE_CFLAGS="$CFLAGS"
1184d87a3195Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
1185d87a3195Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1186d87a3195Smrg#include "xorg-server.h"
1187d87a3195Smrg#if !defined $1
1188d87a3195Smrg#error $1 not defined
1189d87a3195Smrg#endif
1190d87a3195Smrg		]])],
1191d87a3195Smrg		[_EXT_CHECK=yes],
1192d87a3195Smrg		[_EXT_CHECK=no])
1193d87a3195Smrg	CFLAGS="$SAVE_CFLAGS"
1194d87a3195Smrg	AC_MSG_CHECKING([if $1 is defined])
1195d87a3195Smrg	AC_MSG_RESULT([$_EXT_CHECK])
1196d87a3195Smrg	if test "$_EXT_CHECK" != no; then
1197d87a3195Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
1198d87a3195Smrg	fi
1199d87a3195Smrg])
1200ff89ac2bSmrg
1201d87a3195Smrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
1202d87a3195Smrgdnl serial 11 (pkg-config-0.29)
1203d87a3195Smrgdnl
1204d87a3195Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1205d87a3195Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
1206d87a3195Smrgdnl
1207d87a3195Smrgdnl This program is free software; you can redistribute it and/or modify
1208d87a3195Smrgdnl it under the terms of the GNU General Public License as published by
1209d87a3195Smrgdnl the Free Software Foundation; either version 2 of the License, or
1210d87a3195Smrgdnl (at your option) any later version.
1211d87a3195Smrgdnl
1212d87a3195Smrgdnl This program is distributed in the hope that it will be useful, but
1213d87a3195Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
1214d87a3195Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1215d87a3195Smrgdnl General Public License for more details.
1216d87a3195Smrgdnl
1217d87a3195Smrgdnl You should have received a copy of the GNU General Public License
1218d87a3195Smrgdnl along with this program; if not, write to the Free Software
1219d87a3195Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1220d87a3195Smrgdnl 02111-1307, USA.
1221d87a3195Smrgdnl
1222d87a3195Smrgdnl As a special exception to the GNU General Public License, if you
1223d87a3195Smrgdnl distribute this file as part of a program that contains a
1224d87a3195Smrgdnl configuration script generated by Autoconf, you may include it under
1225d87a3195Smrgdnl the same distribution terms that you use for the rest of that
1226d87a3195Smrgdnl program.
1227d87a3195Smrg
1228d87a3195Smrgdnl PKG_PREREQ(MIN-VERSION)
1229d87a3195Smrgdnl -----------------------
1230d87a3195Smrgdnl Since: 0.29
1231d87a3195Smrgdnl
1232d87a3195Smrgdnl Verify that the version of the pkg-config macros are at least
1233d87a3195Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
1234d87a3195Smrgdnl installed version of pkg-config, this checks the developer's version
1235d87a3195Smrgdnl of pkg.m4 when generating configure.
1236d87a3195Smrgdnl
1237d87a3195Smrgdnl To ensure that this macro is defined, also add:
1238d87a3195Smrgdnl m4_ifndef([PKG_PREREQ],
1239d87a3195Smrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
1240d87a3195Smrgdnl
1241d87a3195Smrgdnl See the "Since" comment for each macro you use to see what version
1242d87a3195Smrgdnl of the macros you require.
1243d87a3195Smrgm4_defun([PKG_PREREQ],
1244d87a3195Smrg[m4_define([PKG_MACROS_VERSION], [0.29])
1245d87a3195Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
1246d87a3195Smrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
1247d87a3195Smrg])dnl PKG_PREREQ
1248d87a3195Smrg
1249d87a3195Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
1250d87a3195Smrgdnl ----------------------------------
1251d87a3195Smrgdnl Since: 0.16
1252d87a3195Smrgdnl
1253d87a3195Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
1254d87a3195Smrgdnl first found in the path. Checks that the version of pkg-config found
1255d87a3195Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
1256d87a3195Smrgdnl used since that's the first version where most current features of
1257d87a3195Smrgdnl pkg-config existed.
1258d87a3195SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1259d87a3195Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1260d87a3195Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1261d87a3195Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1262d87a3195SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1263d87a3195SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1264d87a3195SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
12652378475aSmrg
1266d87a3195Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1267d87a3195Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1268d87a3195Smrgfi
1269d87a3195Smrgif test -n "$PKG_CONFIG"; then
1270d87a3195Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
1271d87a3195Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1272d87a3195Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1273d87a3195Smrg		AC_MSG_RESULT([yes])
1274d87a3195Smrg	else
1275d87a3195Smrg		AC_MSG_RESULT([no])
1276d87a3195Smrg		PKG_CONFIG=""
1277d87a3195Smrg	fi
1278d87a3195Smrgfi[]dnl
1279d87a3195Smrg])dnl PKG_PROG_PKG_CONFIG
128095b296d0Smrg
1281d87a3195Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1282d87a3195Smrgdnl -------------------------------------------------------------------
1283d87a3195Smrgdnl Since: 0.18
1284d87a3195Smrgdnl
1285d87a3195Smrgdnl Check to see whether a particular set of modules exists. Similar to
1286d87a3195Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
1287d87a3195Smrgdnl
1288d87a3195Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1289d87a3195Smrgdnl only at the first occurence in configure.ac, so if the first place
1290d87a3195Smrgdnl it's called might be skipped (such as if it is within an "if", you
1291d87a3195Smrgdnl have to call PKG_CHECK_EXISTS manually
1292d87a3195SmrgAC_DEFUN([PKG_CHECK_EXISTS],
1293d87a3195Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1294d87a3195Smrgif test -n "$PKG_CONFIG" && \
1295d87a3195Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1296d87a3195Smrg  m4_default([$2], [:])
1297d87a3195Smrgm4_ifvaln([$3], [else
1298d87a3195Smrg  $3])dnl
1299d87a3195Smrgfi])
130095b296d0Smrg
1301d87a3195Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1302d87a3195Smrgdnl ---------------------------------------------
1303d87a3195Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
1304d87a3195Smrgdnl pkg_failed based on the result.
1305d87a3195Smrgm4_define([_PKG_CONFIG],
1306d87a3195Smrg[if test -n "$$1"; then
1307d87a3195Smrg    pkg_cv_[]$1="$$1"
1308d87a3195Smrg elif test -n "$PKG_CONFIG"; then
1309d87a3195Smrg    PKG_CHECK_EXISTS([$3],
1310d87a3195Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1311d87a3195Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
1312d87a3195Smrg		     [pkg_failed=yes])
1313d87a3195Smrg else
1314d87a3195Smrg    pkg_failed=untried
1315d87a3195Smrgfi[]dnl
1316d87a3195Smrg])dnl _PKG_CONFIG
131795b296d0Smrg
1318d87a3195Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED
1319d87a3195Smrgdnl ---------------------------
1320d87a3195Smrgdnl Internal check to see if pkg-config supports short errors.
1321d87a3195SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1322d87a3195Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1323d87a3195Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1324d87a3195Smrg        _pkg_short_errors_supported=yes
1325d87a3195Smrgelse
1326d87a3195Smrg        _pkg_short_errors_supported=no
1327d87a3195Smrgfi[]dnl
1328d87a3195Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
132995b296d0Smrg
133095b296d0Smrg
1331d87a3195Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1332d87a3195Smrgdnl   [ACTION-IF-NOT-FOUND])
1333d87a3195Smrgdnl --------------------------------------------------------------
1334d87a3195Smrgdnl Since: 0.4.0
1335d87a3195Smrgdnl
1336d87a3195Smrgdnl Note that if there is a possibility the first call to
1337d87a3195Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
1338d87a3195Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1339d87a3195SmrgAC_DEFUN([PKG_CHECK_MODULES],
1340d87a3195Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1341d87a3195SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1342d87a3195SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
134395b296d0Smrg
1344d87a3195Smrgpkg_failed=no
1345d87a3195SmrgAC_MSG_CHECKING([for $1])
134689b0dc75Smrg
1347d87a3195Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1348d87a3195Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
134995b296d0Smrg
1350d87a3195Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1351d87a3195Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1352d87a3195SmrgSee the pkg-config man page for more details.])
135389b0dc75Smrg
1354d87a3195Smrgif test $pkg_failed = yes; then
1355d87a3195Smrg   	AC_MSG_RESULT([no])
1356d87a3195Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1357d87a3195Smrg        if test $_pkg_short_errors_supported = yes; then
1358d87a3195Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1359d87a3195Smrg        else 
1360d87a3195Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1361d87a3195Smrg        fi
1362d87a3195Smrg	# Put the nasty error message in config.log where it belongs
1363d87a3195Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
136489b0dc75Smrg
1365d87a3195Smrg	m4_default([$4], [AC_MSG_ERROR(
1366d87a3195Smrg[Package requirements ($2) were not met:
136789b0dc75Smrg
1368d87a3195Smrg$$1_PKG_ERRORS
136989b0dc75Smrg
1370d87a3195SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1371d87a3195Smrginstalled software in a non-standard prefix.
137289b0dc75Smrg
1373d87a3195Smrg_PKG_TEXT])[]dnl
1374d87a3195Smrg        ])
1375d87a3195Smrgelif test $pkg_failed = untried; then
1376d87a3195Smrg     	AC_MSG_RESULT([no])
1377d87a3195Smrg	m4_default([$4], [AC_MSG_FAILURE(
1378d87a3195Smrg[The pkg-config script could not be found or is too old.  Make sure it
1379d87a3195Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1380d87a3195Smrgpath to pkg-config.
138195b296d0Smrg
1382d87a3195Smrg_PKG_TEXT
138395b296d0Smrg
1384d87a3195SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1385d87a3195Smrg        ])
1386d87a3195Smrgelse
1387d87a3195Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1388d87a3195Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1389d87a3195Smrg        AC_MSG_RESULT([yes])
1390d87a3195Smrg	$3
1391d87a3195Smrgfi[]dnl
1392d87a3195Smrg])dnl PKG_CHECK_MODULES
139395b296d0Smrg
139495b296d0Smrg
1395d87a3195Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1396d87a3195Smrgdnl   [ACTION-IF-NOT-FOUND])
1397d87a3195Smrgdnl ---------------------------------------------------------------------
1398d87a3195Smrgdnl Since: 0.29
1399d87a3195Smrgdnl
1400d87a3195Smrgdnl Checks for existence of MODULES and gathers its build flags with
1401d87a3195Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
1402d87a3195Smrgdnl and VARIABLE-PREFIX_LIBS from --libs.
1403d87a3195Smrgdnl
1404d87a3195Smrgdnl Note that if there is a possibility the first call to
1405d87a3195Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
1406d87a3195Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
1407d87a3195Smrgdnl configure.ac.
1408d87a3195SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
1409d87a3195Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1410d87a3195Smrg_save_PKG_CONFIG=$PKG_CONFIG
1411d87a3195SmrgPKG_CONFIG="$PKG_CONFIG --static"
1412d87a3195SmrgPKG_CHECK_MODULES($@)
1413d87a3195SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
1414d87a3195Smrg])dnl PKG_CHECK_MODULES_STATIC
141595b296d0Smrg
1416e6f085baSmrg
1417d87a3195Smrgdnl PKG_INSTALLDIR([DIRECTORY])
1418d87a3195Smrgdnl -------------------------
1419d87a3195Smrgdnl Since: 0.27
1420d87a3195Smrgdnl
1421d87a3195Smrgdnl Substitutes the variable pkgconfigdir as the location where a module
1422d87a3195Smrgdnl should install pkg-config .pc files. By default the directory is
1423d87a3195Smrgdnl $libdir/pkgconfig, but the default can be changed by passing
1424d87a3195Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
1425d87a3195Smrgdnl parameter.
1426d87a3195SmrgAC_DEFUN([PKG_INSTALLDIR],
1427d87a3195Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1428d87a3195Smrgm4_pushdef([pkg_description],
1429d87a3195Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
1430d87a3195SmrgAC_ARG_WITH([pkgconfigdir],
1431d87a3195Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1432d87a3195Smrg    [with_pkgconfigdir=]pkg_default)
1433d87a3195SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1434d87a3195Smrgm4_popdef([pkg_default])
1435d87a3195Smrgm4_popdef([pkg_description])
1436d87a3195Smrg])dnl PKG_INSTALLDIR
143714330f12Smrg
143895b296d0Smrg
1439d87a3195Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
1440d87a3195Smrgdnl --------------------------------
1441d87a3195Smrgdnl Since: 0.27
1442d87a3195Smrgdnl
1443d87a3195Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
1444d87a3195Smrgdnl module should install arch-independent pkg-config .pc files. By
1445d87a3195Smrgdnl default the directory is $datadir/pkgconfig, but the default can be
1446d87a3195Smrgdnl changed by passing DIRECTORY. The user can override through the
1447d87a3195Smrgdnl --with-noarch-pkgconfigdir parameter.
1448d87a3195SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
1449d87a3195Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
1450d87a3195Smrgm4_pushdef([pkg_description],
1451d87a3195Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1452d87a3195SmrgAC_ARG_WITH([noarch-pkgconfigdir],
1453d87a3195Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1454d87a3195Smrg    [with_noarch_pkgconfigdir=]pkg_default)
1455d87a3195SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
1456d87a3195Smrgm4_popdef([pkg_default])
1457d87a3195Smrgm4_popdef([pkg_description])
1458d87a3195Smrg])dnl PKG_NOARCH_INSTALLDIR
145995b296d0Smrg
146095b296d0Smrg
1461d87a3195Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1462d87a3195Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1463d87a3195Smrgdnl -------------------------------------------
1464d87a3195Smrgdnl Since: 0.28
1465d87a3195Smrgdnl
1466d87a3195Smrgdnl Retrieves the value of the pkg-config variable for the given module.
1467d87a3195SmrgAC_DEFUN([PKG_CHECK_VAR],
1468d87a3195Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1469d87a3195SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
147095b296d0Smrg
1471d87a3195Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
1472d87a3195SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
147395b296d0Smrg
1474d87a3195SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
1475d87a3195Smrg])dnl PKG_CHECK_VAR
147695b296d0Smrg
1477d87a3195Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1478d87a3195Smrgdnl
1479d87a3195Smrgdnl Copyright (c) 2005, 2023, Oracle and/or its affiliates.
1480d87a3195Smrgdnl
1481d87a3195Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1482d87a3195Smrgdnl copy of this software and associated documentation files (the "Software"),
1483d87a3195Smrgdnl to deal in the Software without restriction, including without limitation
1484d87a3195Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1485d87a3195Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1486d87a3195Smrgdnl Software is furnished to do so, subject to the following conditions:
1487d87a3195Smrgdnl
1488d87a3195Smrgdnl The above copyright notice and this permission notice (including the next
1489d87a3195Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1490d87a3195Smrgdnl Software.
1491d87a3195Smrgdnl
1492d87a3195Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1493d87a3195Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1494d87a3195Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1495d87a3195Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1496d87a3195Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1497d87a3195Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1498d87a3195Smrgdnl DEALINGS IN THE SOFTWARE.
149995b296d0Smrg
1500d87a3195Smrg# XORG_MACROS_VERSION(required-version)
1501d87a3195Smrg# -------------------------------------
1502d87a3195Smrg# Minimum version: 1.1.0
1503d87a3195Smrg#
1504d87a3195Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1505d87a3195Smrg# your configure.ac with the minimum required version, such as:
1506d87a3195Smrg# XORG_MACROS_VERSION(1.1)
1507d87a3195Smrg#
1508d87a3195Smrg# To ensure that this macro is defined, also add:
1509d87a3195Smrg# m4_ifndef([XORG_MACROS_VERSION],
1510d87a3195Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1511d87a3195Smrg#
1512d87a3195Smrg#
1513d87a3195Smrg# See the "minimum version" comment for each macro you use to see what
1514d87a3195Smrg# version you require.
1515d87a3195Smrgm4_defun([XORG_MACROS_VERSION],[
1516d87a3195Smrgm4_define([vers_have], [1.20.0])
1517d87a3195Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1518d87a3195Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1519d87a3195Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1520d87a3195Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1521d87a3195Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1522d87a3195Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1523d87a3195Smrgm4_undefine([vers_have])
1524d87a3195Smrgm4_undefine([maj_have])
1525d87a3195Smrgm4_undefine([maj_needed])
1526d87a3195Smrg]) # XORG_MACROS_VERSION
152714330f12Smrg
1528d87a3195Smrg# XORG_PROG_RAWCPP()
1529d87a3195Smrg# ------------------
1530d87a3195Smrg# Minimum version: 1.0.0
1531d87a3195Smrg#
1532d87a3195Smrg# Find cpp program and necessary flags for use in pre-processing text files
1533d87a3195Smrg# such as man pages and config files
1534d87a3195SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1535d87a3195SmrgAC_REQUIRE([AC_PROG_CPP])
1536d87a3195SmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
1537d87a3195Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1538d87a3195Smrg
1539d87a3195Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1540d87a3195Smrg# which is not the best choice for supporting other OS'es, but covers most
1541d87a3195Smrg# of the ones we need for now.
1542d87a3195SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1543d87a3195SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1544d87a3195Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1545d87a3195Smrg	AC_MSG_RESULT([no])
1546d87a3195Smrgelse
1547d87a3195Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1548d87a3195Smrg		RAWCPPFLAGS=-undef
1549d87a3195Smrg		AC_MSG_RESULT([yes])
1550d87a3195Smrg	# under Cygwin unix is still defined even with -undef
1551d87a3195Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1552d87a3195Smrg		RAWCPPFLAGS="-undef -ansi"
1553d87a3195Smrg		AC_MSG_RESULT([yes, with -ansi])
1554d87a3195Smrg	else
1555d87a3195Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1556d87a3195Smrg	fi
155714330f12Smrgfi
1558d87a3195Smrgrm -f conftest.$ac_ext
155914330f12Smrg
1560d87a3195SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1561d87a3195SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
1562d87a3195Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1563d87a3195Smrg	AC_MSG_RESULT([no])
1564d87a3195Smrgelse
1565d87a3195Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1566d87a3195Smrg		TRADITIONALCPPFLAGS="-traditional"
1567d87a3195Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1568d87a3195Smrg		AC_MSG_RESULT([yes])
1569d87a3195Smrg	else
1570d87a3195Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1571d87a3195Smrg	fi
1572d87a3195Smrgfi
1573d87a3195Smrgrm -f conftest.$ac_ext
1574d87a3195SmrgAC_SUBST(RAWCPPFLAGS)
1575d87a3195SmrgAC_SUBST(TRADITIONALCPPFLAGS)
1576d87a3195Smrg]) # XORG_PROG_RAWCPP
157795b296d0Smrg
1578d87a3195Smrg# XORG_MANPAGE_SECTIONS()
1579eca46af7Smrg# -----------------------
1580d87a3195Smrg# Minimum version: 1.0.0
1581d87a3195Smrg#
1582d87a3195Smrg# Determine which sections man pages go in for the different man page types
1583d87a3195Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1584d87a3195Smrg# Not sure if there's any better way than just hardcoding by OS name.
1585d87a3195Smrg# Override default settings by setting environment variables
1586d87a3195Smrg# Added MAN_SUBSTS in version 1.8
1587d87a3195Smrg# Added AC_PROG_SED in version 1.8
15882378475aSmrg
1589d87a3195SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1590d87a3195SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1591d87a3195SmrgAC_REQUIRE([AC_PROG_SED])
15922378475aSmrg
1593d87a3195Smrgcase $host_os in
1594d87a3195Smrg    solaris*)
1595d87a3195Smrg        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
1596d87a3195Smrg        # check for a man page file found in later versions that use
1597d87a3195Smrg        # traditional section numbers instead
1598d87a3195Smrg        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
1599d87a3195Smrg                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
1600d87a3195Smrg        ;;
1601d87a3195Smrg    *) SYSV_MAN_SECTIONS=false ;;
1602d87a3195Smrgesac
16032378475aSmrg
1604d87a3195Smrgif test x$APP_MAN_SUFFIX = x    ; then
1605d87a3195Smrg    APP_MAN_SUFFIX=1
1606d87a3195Smrgfi
1607d87a3195Smrgif test x$APP_MAN_DIR = x    ; then
1608d87a3195Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1609d87a3195Smrgfi
16102378475aSmrg
1611d87a3195Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1612d87a3195Smrg    LIB_MAN_SUFFIX=3
1613d87a3195Smrgfi
1614d87a3195Smrgif test x$LIB_MAN_DIR = x    ; then
1615d87a3195Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1616d87a3195Smrgfi
16172378475aSmrg
1618d87a3195Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1619d87a3195Smrg    case $SYSV_MAN_SECTIONS in
1620d87a3195Smrg	true)				FILE_MAN_SUFFIX=4  ;;
1621d87a3195Smrg	*)				FILE_MAN_SUFFIX=5  ;;
1622d87a3195Smrg    esac
1623d87a3195Smrgfi
1624d87a3195Smrgif test x$FILE_MAN_DIR = x    ; then
1625d87a3195Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1626d87a3195Smrgfi
162739713583Smrg
1628d87a3195Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1629d87a3195Smrg    case $SYSV_MAN_SECTIONS in
1630d87a3195Smrg	true)				MISC_MAN_SUFFIX=5  ;;
1631d87a3195Smrg	*)				MISC_MAN_SUFFIX=7  ;;
1632d87a3195Smrg    esac
1633d87a3195Smrgfi
1634d87a3195Smrgif test x$MISC_MAN_DIR = x    ; then
1635d87a3195Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1636d87a3195Smrgfi
163795b296d0Smrg
1638d87a3195Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1639d87a3195Smrg    case $SYSV_MAN_SECTIONS in
1640d87a3195Smrg	true)				DRIVER_MAN_SUFFIX=7  ;;
1641d87a3195Smrg	*)				DRIVER_MAN_SUFFIX=4  ;;
1642d87a3195Smrg    esac
1643d87a3195Smrgfi
1644d87a3195Smrgif test x$DRIVER_MAN_DIR = x    ; then
1645d87a3195Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1646d87a3195Smrgfi
164795b296d0Smrg
1648d87a3195Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1649d87a3195Smrg    case $SYSV_MAN_SECTIONS in
1650d87a3195Smrg	true)				ADMIN_MAN_SUFFIX=1m ;;
1651d87a3195Smrg	*)				ADMIN_MAN_SUFFIX=8  ;;
1652d87a3195Smrg    esac
1653d87a3195Smrgfi
1654d87a3195Smrgif test x$ADMIN_MAN_DIR = x    ; then
1655d87a3195Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1656d87a3195Smrgfi
165795b296d0Smrg
165895b296d0Smrg
1659d87a3195SmrgAC_SUBST([APP_MAN_SUFFIX])
1660d87a3195SmrgAC_SUBST([LIB_MAN_SUFFIX])
1661d87a3195SmrgAC_SUBST([FILE_MAN_SUFFIX])
1662d87a3195SmrgAC_SUBST([MISC_MAN_SUFFIX])
1663d87a3195SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1664d87a3195SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1665d87a3195SmrgAC_SUBST([APP_MAN_DIR])
1666d87a3195SmrgAC_SUBST([LIB_MAN_DIR])
1667d87a3195SmrgAC_SUBST([FILE_MAN_DIR])
1668d87a3195SmrgAC_SUBST([MISC_MAN_DIR])
1669d87a3195SmrgAC_SUBST([DRIVER_MAN_DIR])
1670d87a3195SmrgAC_SUBST([ADMIN_MAN_DIR])
167195b296d0Smrg
1672d87a3195SmrgXORG_MAN_PAGE="X Version 11"
1673d87a3195SmrgAC_SUBST([XORG_MAN_PAGE])
1674d87a3195SmrgMAN_SUBSTS="\
1675d87a3195Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1676d87a3195Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1677d87a3195Smrg	-e 's|__xservername__|Xorg|g' \
1678d87a3195Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1679d87a3195Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1680d87a3195Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1681d87a3195Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1682d87a3195Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1683d87a3195Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1684d87a3195Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1685d87a3195Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1686d87a3195Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1687d87a3195SmrgAC_SUBST([MAN_SUBSTS])
16882378475aSmrg
1689d87a3195Smrg]) # XORG_MANPAGE_SECTIONS
169095b296d0Smrg
1691d87a3195Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1692eca46af7Smrg# ------------------------
1693d87a3195Smrg# Minimum version: 1.7.0
1694d87a3195Smrg#
1695d87a3195Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1696d87a3195Smrg# provided by xorg-sgml-doctools, if installed.
1697d87a3195SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1698d87a3195SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1699d87a3195SmrgXORG_SGML_PATH=
1700d87a3195SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1701d87a3195Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1702d87a3195Smrg    [m4_ifval([$1],[:],
1703d87a3195Smrg        [if test x"$cross_compiling" != x"yes" ; then
1704d87a3195Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1705d87a3195Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1706d87a3195Smrg         fi])
1707eca46af7Smrg    ])
170895b296d0Smrg
1709d87a3195Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1710d87a3195Smrg# the path and the name of the doc stylesheet
1711d87a3195Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1712d87a3195Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1713d87a3195Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1714d87a3195Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1715eca46af7Smrgelse
1716d87a3195Smrg   AC_MSG_RESULT([no])
1717eca46af7Smrgfi
171895b296d0Smrg
1719d87a3195SmrgAC_SUBST(XORG_SGML_PATH)
1720d87a3195SmrgAC_SUBST(STYLESHEET_SRCDIR)
1721d87a3195SmrgAC_SUBST(XSL_STYLESHEET)
1722d87a3195SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1723d87a3195Smrg]) # XORG_CHECK_SGML_DOCTOOLS
172495b296d0Smrg
1725d87a3195Smrg# XORG_CHECK_LINUXDOC
1726eca46af7Smrg# -------------------
1727d87a3195Smrg# Minimum version: 1.0.0
1728d87a3195Smrg#
1729d87a3195Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1730d87a3195Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1731d87a3195Smrg# Whether or not the necessary tools and files are found can be checked
1732d87a3195Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1733d87a3195SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1734d87a3195SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1735d87a3195SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
173695b296d0Smrg
1737d87a3195SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
173895b296d0Smrg
1739d87a3195SmrgAC_MSG_CHECKING([whether to build documentation])
174095b296d0Smrg
1741d87a3195Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1742d87a3195Smrg   BUILDDOC=yes
1743d87a3195Smrgelse
1744d87a3195Smrg   BUILDDOC=no
1745d87a3195Smrgfi
174695b296d0Smrg
1747d87a3195SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1748d87a3195Smrg
1749d87a3195SmrgAC_MSG_RESULT([$BUILDDOC])
1750d87a3195Smrg
1751d87a3195SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1752d87a3195Smrg
1753d87a3195Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1754d87a3195Smrg   BUILDPDFDOC=yes
1755eca46af7Smrgelse
1756d87a3195Smrg   BUILDPDFDOC=no
1757eca46af7Smrgfi
175895b296d0Smrg
1759d87a3195SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
176095b296d0Smrg
1761d87a3195SmrgAC_MSG_RESULT([$BUILDPDFDOC])
176295b296d0Smrg
1763d87a3195SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1764d87a3195SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1765d87a3195SmrgMAKE_PDF="$PS2PDF"
1766d87a3195SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
176795b296d0Smrg
1768d87a3195SmrgAC_SUBST(MAKE_TEXT)
1769d87a3195SmrgAC_SUBST(MAKE_PS)
1770d87a3195SmrgAC_SUBST(MAKE_PDF)
1771d87a3195SmrgAC_SUBST(MAKE_HTML)
1772d87a3195Smrg]) # XORG_CHECK_LINUXDOC
177395b296d0Smrg
1774d87a3195Smrg# XORG_CHECK_DOCBOOK
1775d87a3195Smrg# -------------------
1776d87a3195Smrg# Minimum version: 1.0.0
1777d87a3195Smrg#
1778d87a3195Smrg# Checks for the ability to build output formats from SGML DocBook source.
1779d87a3195Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1780d87a3195Smrg# indicates whether the necessary tools and files are found and, if set,
1781d87a3195Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1782d87a3195SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1783d87a3195SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
178495b296d0Smrg
1785d87a3195SmrgBUILDTXTDOC=no
1786d87a3195SmrgBUILDPDFDOC=no
1787d87a3195SmrgBUILDPSDOC=no
1788d87a3195SmrgBUILDHTMLDOC=no
178995b296d0Smrg
1790d87a3195SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1791d87a3195SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1792d87a3195SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1793d87a3195SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
179495b296d0Smrg
1795d87a3195SmrgAC_MSG_CHECKING([whether to build text documentation])
1796d87a3195Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1797d87a3195Smrg   test x$BUILD_TXTDOC != xno; then
1798d87a3195Smrg	BUILDTXTDOC=yes
1799d87a3195Smrgfi
1800d87a3195SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1801d87a3195SmrgAC_MSG_RESULT([$BUILDTXTDOC])
180295b296d0Smrg
1803d87a3195SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1804d87a3195Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1805d87a3195Smrg   test x$BUILD_PDFDOC != xno; then
1806d87a3195Smrg	BUILDPDFDOC=yes
1807d87a3195Smrgfi
1808d87a3195SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1809d87a3195SmrgAC_MSG_RESULT([$BUILDPDFDOC])
181095b296d0Smrg
1811d87a3195SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1812d87a3195Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1813d87a3195Smrg   test x$BUILD_PSDOC != xno; then
1814d87a3195Smrg	BUILDPSDOC=yes
1815d87a3195Smrgfi
1816d87a3195SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1817d87a3195SmrgAC_MSG_RESULT([$BUILDPSDOC])
181895b296d0Smrg
1819d87a3195SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1820d87a3195Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1821d87a3195Smrg   test x$BUILD_HTMLDOC != xno; then
1822d87a3195Smrg	BUILDHTMLDOC=yes
1823d87a3195Smrgfi
1824d87a3195SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1825d87a3195SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
182695b296d0Smrg
1827d87a3195SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1828d87a3195SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1829d87a3195SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1830d87a3195SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
183195b296d0Smrg
1832d87a3195SmrgAC_SUBST(MAKE_TEXT)
1833d87a3195SmrgAC_SUBST(MAKE_PS)
1834d87a3195SmrgAC_SUBST(MAKE_PDF)
1835d87a3195SmrgAC_SUBST(MAKE_HTML)
1836d87a3195Smrg]) # XORG_CHECK_DOCBOOK
183739713583Smrg
1838d87a3195Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1839d87a3195Smrg# ----------------
1840d87a3195Smrg# Minimum version: 1.5.0
1841d87a3195Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1842d87a3195Smrg#
1843d87a3195Smrg# Documentation tools are not always available on all platforms and sometimes
1844d87a3195Smrg# not at the appropriate level. This macro enables a module to test for the
1845d87a3195Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1846d87a3195Smrg# the --with-xmlto option, it allows maximum flexibility in making decisions
1847d87a3195Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1848d87a3195Smrg# --with-xmlto assumes 'auto'.
1849d87a3195Smrg#
1850d87a3195Smrg# Interface to module:
1851d87a3195Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1852d87a3195Smrg# XMLTO:	returns the path of the xmlto program found
1853d87a3195Smrg#		returns the path set by the user in the environment
1854d87a3195Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1855d87a3195Smrg#		'no' user instructs the module not to use xmlto
1856d87a3195Smrg#
1857d87a3195Smrg# Added in version 1.10.0
1858d87a3195Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1859d87a3195Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1860d87a3195Smrg#
1861d87a3195Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1862d87a3195Smrg#
1863d87a3195SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1864d87a3195SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1865d87a3195Smrgm4_define([_defopt], m4_default([$2], [auto]))
1866d87a3195SmrgAC_ARG_WITH(xmlto,
1867d87a3195Smrg	AS_HELP_STRING([--with-xmlto],
1868d87a3195Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1869d87a3195Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1870d87a3195Smrgm4_undefine([_defopt])
18712378475aSmrg
1872d87a3195Smrgif test "x$use_xmlto" = x"auto"; then
1873d87a3195Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1874d87a3195Smrg   if test "x$XMLTO" = "x"; then
1875d87a3195Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1876d87a3195Smrg	have_xmlto=no
1877d87a3195Smrg   else
1878d87a3195Smrg        have_xmlto=yes
1879d87a3195Smrg   fi
1880d87a3195Smrgelif test "x$use_xmlto" = x"yes" ; then
1881d87a3195Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1882d87a3195Smrg   if test "x$XMLTO" = "x"; then
1883d87a3195Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1884d87a3195Smrg   fi
1885d87a3195Smrg   have_xmlto=yes
1886d87a3195Smrgelif test "x$use_xmlto" = x"no" ; then
1887d87a3195Smrg   if test "x$XMLTO" != "x"; then
1888d87a3195Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1889d87a3195Smrg   fi
1890d87a3195Smrg   have_xmlto=no
1891eca46af7Smrgelse
1892d87a3195Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1893eca46af7Smrgfi
189495b296d0Smrg
1895d87a3195Smrg# Test for a minimum version of xmlto, if provided.
1896d87a3195Smrgm4_ifval([$1],
1897d87a3195Smrg[if test "$have_xmlto" = yes; then
1898d87a3195Smrg    # scrape the xmlto version
1899d87a3195Smrg    AC_MSG_CHECKING([the xmlto version])
1900d87a3195Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1901d87a3195Smrg    AC_MSG_RESULT([$xmlto_version])
1902d87a3195Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1903d87a3195Smrg        [if test "x$use_xmlto" = xauto; then
1904d87a3195Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1905d87a3195Smrg            have_xmlto=no
1906d87a3195Smrg        else
1907d87a3195Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1908d87a3195Smrg        fi])
1909d87a3195Smrgfi])
191095b296d0Smrg
1911d87a3195Smrg# Test for the ability of xmlto to generate a text target
1912d87a3195Smrg#
1913d87a3195Smrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
1914d87a3195Smrg# following test for empty XML docbook files.
1915d87a3195Smrg# For compatibility reasons use the following empty XML docbook file and if
1916d87a3195Smrg# it fails try it again with a non-empty XML file.
1917d87a3195Smrghave_xmlto_text=no
1918d87a3195Smrgcat > conftest.xml << "EOF"
1919d87a3195SmrgEOF
1920d87a3195SmrgAS_IF([test "$have_xmlto" = yes],
1921d87a3195Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1922d87a3195Smrg             [have_xmlto_text=yes],
1923d87a3195Smrg             [# Try it again with a non-empty XML file.
1924d87a3195Smrg              cat > conftest.xml << "EOF"
1925d87a3195Smrg<x></x>
1926d87a3195SmrgEOF
1927d87a3195Smrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1928d87a3195Smrg                    [have_xmlto_text=yes],
1929d87a3195Smrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
1930d87a3195Smrgrm -f conftest.xml
1931d87a3195SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1932d87a3195SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1933d87a3195Smrg]) # XORG_WITH_XMLTO
193495b296d0Smrg
1935d87a3195Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1936d87a3195Smrg# --------------------------------------------
1937d87a3195Smrg# Minimum version: 1.12.0
1938d87a3195Smrg# Minimum version for optional DEFAULT argument: 1.12.0
1939d87a3195Smrg#
1940d87a3195Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1941d87a3195Smrg# XML-based language used for the transformation of XML documents.
1942d87a3195Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1943d87a3195Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1944d87a3195Smrg# The XSLT processor is often used as a standalone tool for transformations.
1945d87a3195Smrg# It should not be assumed that this tool is used only to work with documnetation.
1946d87a3195Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1947d87a3195Smrg#
1948d87a3195Smrg# Interface to module:
1949d87a3195Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1950d87a3195Smrg# XSLTPROC:	 returns the path of the xsltproc program found
1951d87a3195Smrg#		 returns the path set by the user in the environment
1952d87a3195Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1953d87a3195Smrg#		  'no' user instructs the module not to use xsltproc
1954d87a3195Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
1955d87a3195Smrg#
1956d87a3195Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1957d87a3195Smrg#
1958d87a3195SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1959d87a3195SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1960d87a3195Smrg# Preserves the interface, should it be implemented later
1961d87a3195Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1962d87a3195Smrgm4_define([_defopt], m4_default([$2], [auto]))
1963d87a3195SmrgAC_ARG_WITH(xsltproc,
1964d87a3195Smrg	AS_HELP_STRING([--with-xsltproc],
1965d87a3195Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1966d87a3195Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1967d87a3195Smrgm4_undefine([_defopt])
196895b296d0Smrg
1969d87a3195Smrgif test "x$use_xsltproc" = x"auto"; then
1970d87a3195Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1971d87a3195Smrg   if test "x$XSLTPROC" = "x"; then
1972d87a3195Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1973d87a3195Smrg	have_xsltproc=no
1974d87a3195Smrg   else
1975d87a3195Smrg        have_xsltproc=yes
1976d87a3195Smrg   fi
1977d87a3195Smrgelif test "x$use_xsltproc" = x"yes" ; then
1978d87a3195Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1979d87a3195Smrg   if test "x$XSLTPROC" = "x"; then
1980d87a3195Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1981d87a3195Smrg   fi
1982d87a3195Smrg   have_xsltproc=yes
1983d87a3195Smrgelif test "x$use_xsltproc" = x"no" ; then
1984d87a3195Smrg   if test "x$XSLTPROC" != "x"; then
1985d87a3195Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1986d87a3195Smrg   fi
1987d87a3195Smrg   have_xsltproc=no
1988d87a3195Smrgelse
1989d87a3195Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1990eca46af7Smrgfi
199195b296d0Smrg
1992d87a3195SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1993d87a3195Smrg]) # XORG_WITH_XSLTPROC
199495b296d0Smrg
1995d87a3195Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1996d87a3195Smrg# ----------------------------------------
1997d87a3195Smrg# Minimum version: 1.15.0
1998d87a3195Smrg#
1999d87a3195Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
2000d87a3195Smrg# scanning arbitrary text files, extracting information from those text files,
2001d87a3195Smrg# and printing reports based on that information.
2002d87a3195Smrg#
2003d87a3195Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
2004d87a3195Smrg#
2005d87a3195Smrg# Interface to module:
2006d87a3195Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
2007d87a3195Smrg# PERL:	     returns the path of the perl program found
2008d87a3195Smrg#	     returns the path set by the user in the environment
2009d87a3195Smrg# --with-perl: 'yes' user instructs the module to use perl
2010d87a3195Smrg#	       'no' user instructs the module not to use perl
2011d87a3195Smrg# have_perl: returns yes if perl found in PATH or no
2012d87a3195Smrg#
2013d87a3195Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
2014d87a3195Smrg#
2015d87a3195SmrgAC_DEFUN([XORG_WITH_PERL],[
2016d87a3195SmrgAC_ARG_VAR([PERL], [Path to perl command])
2017d87a3195Smrg# Preserves the interface, should it be implemented later
2018d87a3195Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
2019d87a3195Smrgm4_define([_defopt], m4_default([$2], [auto]))
2020d87a3195SmrgAC_ARG_WITH(perl,
2021d87a3195Smrg	AS_HELP_STRING([--with-perl],
2022d87a3195Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
2023d87a3195Smrg	   [use_perl=$withval], [use_perl=]_defopt)
2024d87a3195Smrgm4_undefine([_defopt])
202595b296d0Smrg
2026d87a3195Smrgif test "x$use_perl" = x"auto"; then
2027d87a3195Smrg   AC_PATH_PROG([PERL], [perl])
2028d87a3195Smrg   if test "x$PERL" = "x"; then
2029d87a3195Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
2030d87a3195Smrg	have_perl=no
2031d87a3195Smrg   else
2032d87a3195Smrg        have_perl=yes
2033eca46af7Smrg   fi
2034d87a3195Smrgelif test "x$use_perl" = x"yes" ; then
2035d87a3195Smrg   AC_PATH_PROG([PERL], [perl])
2036d87a3195Smrg   if test "x$PERL" = "x"; then
2037d87a3195Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
2038d87a3195Smrg   fi
2039d87a3195Smrg   have_perl=yes
2040d87a3195Smrgelif test "x$use_perl" = x"no" ; then
2041d87a3195Smrg   if test "x$PERL" != "x"; then
2042d87a3195Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
2043d87a3195Smrg   fi
2044d87a3195Smrg   have_perl=no
2045eca46af7Smrgelse
2046d87a3195Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
2047eca46af7Smrgfi
204895b296d0Smrg
2049d87a3195SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
2050d87a3195Smrg]) # XORG_WITH_PERL
205195b296d0Smrg
2052d87a3195Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
2053d87a3195Smrg# ----------------
2054d87a3195Smrg# Minimum version: 1.5.0
2055d87a3195Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2056d87a3195Smrg#
2057d87a3195Smrg# Documentation tools are not always available on all platforms and sometimes
2058d87a3195Smrg# not at the appropriate level. This macro enables a module to test for the
2059d87a3195Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2060d87a3195Smrg# the --with-asciidoc option, it allows maximum flexibility in making decisions
2061d87a3195Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
2062d87a3195Smrg# --with-asciidoc assumes 'auto'.
2063d87a3195Smrg#
2064d87a3195Smrg# Interface to module:
2065d87a3195Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
2066d87a3195Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
2067d87a3195Smrg#		 returns the path set by the user in the environment
2068d87a3195Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
2069d87a3195Smrg#		  'no' user instructs the module not to use asciidoc
2070d87a3195Smrg#
2071d87a3195Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
2072d87a3195Smrg#
2073d87a3195SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
2074d87a3195SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
2075d87a3195Smrgm4_define([_defopt], m4_default([$2], [auto]))
2076d87a3195SmrgAC_ARG_WITH(asciidoc,
2077d87a3195Smrg	AS_HELP_STRING([--with-asciidoc],
2078d87a3195Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
2079d87a3195Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
2080d87a3195Smrgm4_undefine([_defopt])
208195b296d0Smrg
2082d87a3195Smrgif test "x$use_asciidoc" = x"auto"; then
2083d87a3195Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2084d87a3195Smrg   if test "x$ASCIIDOC" = "x"; then
2085d87a3195Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
2086d87a3195Smrg	have_asciidoc=no
2087d87a3195Smrg   else
2088d87a3195Smrg        have_asciidoc=yes
2089eca46af7Smrg   fi
2090d87a3195Smrgelif test "x$use_asciidoc" = x"yes" ; then
2091d87a3195Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2092d87a3195Smrg   if test "x$ASCIIDOC" = "x"; then
2093d87a3195Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
2094d87a3195Smrg   fi
2095d87a3195Smrg   have_asciidoc=yes
2096d87a3195Smrgelif test "x$use_asciidoc" = x"no" ; then
2097d87a3195Smrg   if test "x$ASCIIDOC" != "x"; then
2098d87a3195Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
2099d87a3195Smrg   fi
2100d87a3195Smrg   have_asciidoc=no
2101eca46af7Smrgelse
2102d87a3195Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
2103eca46af7Smrgfi
2104d87a3195Smrgm4_ifval([$1],
2105d87a3195Smrg[if test "$have_asciidoc" = yes; then
2106d87a3195Smrg    # scrape the asciidoc version
2107d87a3195Smrg    AC_MSG_CHECKING([the asciidoc version])
2108d87a3195Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
2109d87a3195Smrg    AC_MSG_RESULT([$asciidoc_version])
2110d87a3195Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
2111d87a3195Smrg        [if test "x$use_asciidoc" = xauto; then
2112d87a3195Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
2113d87a3195Smrg            have_asciidoc=no
2114d87a3195Smrg        else
2115d87a3195Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
2116d87a3195Smrg        fi])
2117d87a3195Smrgfi])
2118d87a3195SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
2119d87a3195Smrg]) # XORG_WITH_ASCIIDOC
212095b296d0Smrg
2121d87a3195Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
2122d87a3195Smrg# -------------------------------------------
2123d87a3195Smrg# Minimum version: 1.5.0
2124d87a3195Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2125d87a3195Smrg# Minimum version for optional DOT checking: 1.18.0
2126d87a3195Smrg#
2127d87a3195Smrg# Documentation tools are not always available on all platforms and sometimes
2128d87a3195Smrg# not at the appropriate level. This macro enables a module to test for the
2129d87a3195Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2130d87a3195Smrg# the --with-doxygen option, it allows maximum flexibility in making decisions
2131d87a3195Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
2132d87a3195Smrg# --with-doxygen assumes 'auto'.
2133d87a3195Smrg#
2134d87a3195Smrg# Interface to module:
2135d87a3195Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
2136d87a3195Smrg# DOXYGEN:	 returns the path of the doxygen program found
2137d87a3195Smrg#		 returns the path set by the user in the environment
2138d87a3195Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
2139d87a3195Smrg#		  'no' user instructs the module not to use doxygen
2140d87a3195Smrg#
2141d87a3195Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
2142d87a3195Smrg#
2143d87a3195SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
2144d87a3195SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
2145d87a3195SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
2146d87a3195Smrgm4_define([_defopt], m4_default([$2], [auto]))
2147d87a3195SmrgAC_ARG_WITH(doxygen,
2148d87a3195Smrg	AS_HELP_STRING([--with-doxygen],
2149d87a3195Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
2150d87a3195Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
2151d87a3195Smrgm4_undefine([_defopt])
215295b296d0Smrg
2153d87a3195Smrgif test "x$use_doxygen" = x"auto"; then
2154d87a3195Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2155d87a3195Smrg   if test "x$DOXYGEN" = "x"; then
2156d87a3195Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
2157d87a3195Smrg	have_doxygen=no
2158d87a3195Smrg   else
2159d87a3195Smrg        have_doxygen=yes
2160d87a3195Smrg   fi
2161d87a3195Smrgelif test "x$use_doxygen" = x"yes" ; then
2162d87a3195Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2163d87a3195Smrg   if test "x$DOXYGEN" = "x"; then
2164d87a3195Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
2165d87a3195Smrg   fi
2166d87a3195Smrg   have_doxygen=yes
2167d87a3195Smrgelif test "x$use_doxygen" = x"no" ; then
2168d87a3195Smrg   if test "x$DOXYGEN" != "x"; then
2169d87a3195Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
2170d87a3195Smrg   fi
2171d87a3195Smrg   have_doxygen=no
2172d87a3195Smrgelse
2173d87a3195Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
2174d87a3195Smrgfi
2175d87a3195Smrgm4_ifval([$1],
2176d87a3195Smrg[if test "$have_doxygen" = yes; then
2177d87a3195Smrg    # scrape the doxygen version
2178d87a3195Smrg    AC_MSG_CHECKING([the doxygen version])
2179d87a3195Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
2180d87a3195Smrg    AC_MSG_RESULT([$doxygen_version])
2181d87a3195Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
2182d87a3195Smrg        [if test "x$use_doxygen" = xauto; then
2183d87a3195Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
2184d87a3195Smrg            have_doxygen=no
2185d87a3195Smrg        else
2186d87a3195Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
2187d87a3195Smrg        fi])
2188d87a3195Smrgfi])
218995b296d0Smrg
2190d87a3195Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
2191d87a3195Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
2192d87a3195Smrgdnl 	HAVE_DOT = @HAVE_DOT@
2193d87a3195SmrgHAVE_DOT=no
2194d87a3195Smrgif test "x$have_doxygen" = "xyes"; then
2195d87a3195Smrg  AC_PATH_PROG([DOT], [dot])
2196d87a3195Smrg    if test "x$DOT" != "x"; then
2197d87a3195Smrg      HAVE_DOT=yes
2198d87a3195Smrg    fi
2199d87a3195Smrgfi
220095b296d0Smrg
2201d87a3195SmrgAC_SUBST([HAVE_DOT])
2202d87a3195SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
2203d87a3195SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
2204d87a3195Smrg]) # XORG_WITH_DOXYGEN
220595b296d0Smrg
2206d87a3195Smrg# XORG_WITH_GROFF([DEFAULT])
2207d87a3195Smrg# ----------------
2208d87a3195Smrg# Minimum version: 1.6.0
2209d87a3195Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2210d87a3195Smrg#
2211d87a3195Smrg# Documentation tools are not always available on all platforms and sometimes
2212d87a3195Smrg# not at the appropriate level. This macro enables a module to test for the
2213d87a3195Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2214d87a3195Smrg# the --with-groff option, it allows maximum flexibility in making decisions
2215d87a3195Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
2216d87a3195Smrg# --with-groff assumes 'auto'.
2217d87a3195Smrg#
2218d87a3195Smrg# Interface to module:
2219d87a3195Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
2220d87a3195Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
2221d87a3195Smrg# HAVE_GROFF_MS: the -ms macros package
2222d87a3195Smrg# GROFF:	 returns the path of the groff program found
2223d87a3195Smrg#		 returns the path set by the user in the environment
2224d87a3195Smrg# --with-groff:	 'yes' user instructs the module to use groff
2225d87a3195Smrg#		 'no' user instructs the module not to use groff
2226d87a3195Smrg#
2227d87a3195Smrg# Added in version 1.9.0:
2228d87a3195Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
2229d87a3195Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
2230d87a3195Smrg#		   psselect from the psutils package.
2231d87a3195Smrg#		   the ghostcript package. Refer to the grohtml man pages
2232d87a3195Smrg#
2233d87a3195Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
2234d87a3195Smrg#
2235d87a3195Smrg# OS and distros often splits groff in a basic and full package, the former
2236d87a3195Smrg# having the groff program and the later having devices, fonts and macros
2237d87a3195Smrg# Checking for the groff executable is not enough.
2238d87a3195Smrg#
2239d87a3195Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
2240d87a3195Smrg# unset HAVE_GROFF or GROFF env variables.
2241d87a3195Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
2242d87a3195Smrg#
2243d87a3195SmrgAC_DEFUN([XORG_WITH_GROFF],[
2244d87a3195SmrgAC_ARG_VAR([GROFF], [Path to groff command])
2245d87a3195Smrgm4_define([_defopt], m4_default([$1], [auto]))
2246d87a3195SmrgAC_ARG_WITH(groff,
2247d87a3195Smrg	AS_HELP_STRING([--with-groff],
2248d87a3195Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
2249d87a3195Smrg	   [use_groff=$withval], [use_groff=]_defopt)
2250d87a3195Smrgm4_undefine([_defopt])
225195b296d0Smrg
2252d87a3195Smrgif test "x$use_groff" = x"auto"; then
2253d87a3195Smrg   AC_PATH_PROG([GROFF], [groff])
2254d87a3195Smrg   if test "x$GROFF" = "x"; then
2255d87a3195Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
2256d87a3195Smrg	have_groff=no
2257d87a3195Smrg   else
2258d87a3195Smrg        have_groff=yes
2259d87a3195Smrg   fi
2260d87a3195Smrgelif test "x$use_groff" = x"yes" ; then
2261d87a3195Smrg   AC_PATH_PROG([GROFF], [groff])
2262d87a3195Smrg   if test "x$GROFF" = "x"; then
2263d87a3195Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2264d87a3195Smrg   fi
2265d87a3195Smrg   have_groff=yes
2266d87a3195Smrgelif test "x$use_groff" = x"no" ; then
2267d87a3195Smrg   if test "x$GROFF" != "x"; then
2268d87a3195Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2269d87a3195Smrg   fi
2270d87a3195Smrg   have_groff=no
2271d87a3195Smrgelse
2272d87a3195Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
2273d87a3195Smrgfi
2274d87a3195Smrg
2275d87a3195Smrg# We have groff, test for the presence of the macro packages
2276d87a3195Smrgif test "x$have_groff" = x"yes"; then
2277d87a3195Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
2278d87a3195Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2279d87a3195Smrg        groff_ms_works=yes
2280eca46af7Smrg    else
2281d87a3195Smrg        groff_ms_works=no
2282eca46af7Smrg    fi
2283d87a3195Smrg    AC_MSG_RESULT([$groff_ms_works])
2284d87a3195Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
2285d87a3195Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2286d87a3195Smrg        groff_mm_works=yes
2287d87a3195Smrg    else
2288d87a3195Smrg        groff_mm_works=no
2289d87a3195Smrg    fi
2290d87a3195Smrg    AC_MSG_RESULT([$groff_mm_works])
2291d87a3195Smrgfi
229295b296d0Smrg
2293d87a3195Smrg# We have groff, test for HTML dependencies, one command per package
2294d87a3195Smrgif test "x$have_groff" = x"yes"; then
2295d87a3195Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2296d87a3195Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2297d87a3195Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
2298d87a3195Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2299d87a3195Smrg      have_groff_html=yes
2300d87a3195Smrg   else
2301d87a3195Smrg      have_groff_html=no
2302d87a3195Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2303d87a3195Smrg   fi
2304d87a3195Smrgfi
230595b296d0Smrg
2306d87a3195Smrg# Set Automake conditionals for Makefiles
2307d87a3195SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2308d87a3195SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2309d87a3195SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2310d87a3195SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2311d87a3195Smrg]) # XORG_WITH_GROFF
231295b296d0Smrg
2313d87a3195Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
2314d87a3195Smrg# ---------------------------------------
2315d87a3195Smrg# Minimum version: 1.6.0
2316d87a3195Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2317d87a3195Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
2318d87a3195Smrg#
2319d87a3195Smrg# Documentation tools are not always available on all platforms and sometimes
2320d87a3195Smrg# not at the appropriate level. This macro enables a module to test for the
2321d87a3195Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2322d87a3195Smrg# the --with-fop option, it allows maximum flexibility in making decisions
2323d87a3195Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
2324d87a3195Smrg# --with-fop assumes 'auto'.
2325d87a3195Smrg#
2326d87a3195Smrg# Interface to module:
2327d87a3195Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
2328d87a3195Smrg# FOP:	 	returns the path of the fop program found
2329d87a3195Smrg#		returns the path set by the user in the environment
2330d87a3195Smrg# --with-fop: 	'yes' user instructs the module to use fop
2331d87a3195Smrg#		'no' user instructs the module not to use fop
2332d87a3195Smrg#
2333d87a3195Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2334d87a3195Smrg#
2335d87a3195SmrgAC_DEFUN([XORG_WITH_FOP],[
2336d87a3195SmrgAC_ARG_VAR([FOP], [Path to fop command])
2337d87a3195Smrgm4_define([_defopt], m4_default([$2], [auto]))
2338d87a3195SmrgAC_ARG_WITH(fop,
2339d87a3195Smrg	AS_HELP_STRING([--with-fop],
2340d87a3195Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
2341d87a3195Smrg	   [use_fop=$withval], [use_fop=]_defopt)
2342d87a3195Smrgm4_undefine([_defopt])
2343d87a3195Smrg
2344d87a3195Smrgif test "x$use_fop" = x"auto"; then
2345d87a3195Smrg   AC_PATH_PROG([FOP], [fop])
2346d87a3195Smrg   if test "x$FOP" = "x"; then
2347d87a3195Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
2348d87a3195Smrg	have_fop=no
2349d87a3195Smrg   else
2350d87a3195Smrg        have_fop=yes
2351d87a3195Smrg   fi
2352d87a3195Smrgelif test "x$use_fop" = x"yes" ; then
2353d87a3195Smrg   AC_PATH_PROG([FOP], [fop])
2354d87a3195Smrg   if test "x$FOP" = "x"; then
2355d87a3195Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2356d87a3195Smrg   fi
2357d87a3195Smrg   have_fop=yes
2358d87a3195Smrgelif test "x$use_fop" = x"no" ; then
2359d87a3195Smrg   if test "x$FOP" != "x"; then
2360d87a3195Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2361d87a3195Smrg   fi
2362d87a3195Smrg   have_fop=no
2363eca46af7Smrgelse
2364d87a3195Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
236514330f12Smrgfi
236695b296d0Smrg
2367d87a3195Smrg# Test for a minimum version of fop, if provided.
2368d87a3195Smrgm4_ifval([$1],
2369d87a3195Smrg[if test "$have_fop" = yes; then
2370d87a3195Smrg    # scrape the fop version
2371d87a3195Smrg    AC_MSG_CHECKING([for fop minimum version])
2372d87a3195Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2373d87a3195Smrg    AC_MSG_RESULT([$fop_version])
2374d87a3195Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
2375d87a3195Smrg        [if test "x$use_fop" = xauto; then
2376d87a3195Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2377d87a3195Smrg            have_fop=no
2378d87a3195Smrg        else
2379d87a3195Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2380d87a3195Smrg        fi])
2381d87a3195Smrgfi])
2382d87a3195SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2383d87a3195Smrg]) # XORG_WITH_FOP
2384d87a3195Smrg
2385d87a3195Smrg# XORG_WITH_M4([MIN-VERSION])
2386d87a3195Smrg# ---------------------------
2387d87a3195Smrg# Minimum version: 1.19.0
2388d87a3195Smrg#
2389d87a3195Smrg# This macro attempts to locate an m4 macro processor which supports
2390d87a3195Smrg# -I option and is only useful for modules relying on M4 in order to
2391d87a3195Smrg# expand macros in source code files.
2392d87a3195Smrg#
2393d87a3195Smrg# Interface to module:
2394d87a3195Smrg# M4:	 	returns the path of the m4 program found
2395d87a3195Smrg#		returns the path set by the user in the environment
2396d87a3195Smrg#
2397d87a3195SmrgAC_DEFUN([XORG_WITH_M4], [
2398d87a3195SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
2399d87a3195Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
2400d87a3195Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
2401d87a3195Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
2402d87a3195Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
2403d87a3195Smrg   [$PATH:/usr/gnu/bin])])
240495b296d0Smrg
2405d87a3195SmrgAC_SUBST([M4], [$ac_cv_path_M4])
2406d87a3195Smrg]) # XORG_WITH_M4
240795b296d0Smrg
2408d87a3195Smrg# XORG_WITH_PS2PDF([DEFAULT])
2409eca46af7Smrg# ----------------
2410d87a3195Smrg# Minimum version: 1.6.0
2411d87a3195Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2412d87a3195Smrg#
2413d87a3195Smrg# Documentation tools are not always available on all platforms and sometimes
2414d87a3195Smrg# not at the appropriate level. This macro enables a module to test for the
2415d87a3195Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2416d87a3195Smrg# the --with-ps2pdf option, it allows maximum flexibility in making decisions
2417d87a3195Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2418d87a3195Smrg# --with-ps2pdf assumes 'auto'.
2419d87a3195Smrg#
2420d87a3195Smrg# Interface to module:
2421d87a3195Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
2422d87a3195Smrg# PS2PDF:	returns the path of the ps2pdf program found
2423d87a3195Smrg#		returns the path set by the user in the environment
2424d87a3195Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2425d87a3195Smrg#		 'no' user instructs the module not to use ps2pdf
2426d87a3195Smrg#
2427d87a3195Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2428d87a3195Smrg#
2429d87a3195SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
2430d87a3195SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2431d87a3195Smrgm4_define([_defopt], m4_default([$1], [auto]))
2432d87a3195SmrgAC_ARG_WITH(ps2pdf,
2433d87a3195Smrg	AS_HELP_STRING([--with-ps2pdf],
2434d87a3195Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2435d87a3195Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2436d87a3195Smrgm4_undefine([_defopt])
243795b296d0Smrg
2438d87a3195Smrgif test "x$use_ps2pdf" = x"auto"; then
2439d87a3195Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2440d87a3195Smrg   if test "x$PS2PDF" = "x"; then
2441d87a3195Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2442d87a3195Smrg	have_ps2pdf=no
2443d87a3195Smrg   else
2444d87a3195Smrg        have_ps2pdf=yes
2445d87a3195Smrg   fi
2446d87a3195Smrgelif test "x$use_ps2pdf" = x"yes" ; then
2447d87a3195Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2448d87a3195Smrg   if test "x$PS2PDF" = "x"; then
2449d87a3195Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2450d87a3195Smrg   fi
2451d87a3195Smrg   have_ps2pdf=yes
2452d87a3195Smrgelif test "x$use_ps2pdf" = x"no" ; then
2453d87a3195Smrg   if test "x$PS2PDF" != "x"; then
2454d87a3195Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2455d87a3195Smrg   fi
2456d87a3195Smrg   have_ps2pdf=no
2457eca46af7Smrgelse
2458d87a3195Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2459d87a3195Smrgfi
2460d87a3195SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2461d87a3195Smrg]) # XORG_WITH_PS2PDF
246214330f12Smrg
2463d87a3195Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
2464d87a3195Smrg# ----------------
2465d87a3195Smrg# Minimum version: 1.6.0
2466d87a3195Smrg#
2467d87a3195Smrg# Documentation tools are not always available on all platforms and sometimes
2468d87a3195Smrg# not at the appropriate level. This macro enables a builder to skip all
2469d87a3195Smrg# documentation targets except traditional man pages.
2470d87a3195Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2471d87a3195Smrg# maximum flexibility in controlling documentation building.
2472d87a3195Smrg# Refer to:
2473d87a3195Smrg# XORG_WITH_XMLTO         --with-xmlto
2474d87a3195Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2475d87a3195Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2476d87a3195Smrg# XORG_WITH_FOP           --with-fop
2477d87a3195Smrg# XORG_WITH_GROFF         --with-groff
2478d87a3195Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2479d87a3195Smrg#
2480d87a3195Smrg# Interface to module:
2481d87a3195Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
2482d87a3195Smrg# --enable-docs: 'yes' user instructs the module to generate docs
2483d87a3195Smrg#		 'no' user instructs the module not to generate docs
2484d87a3195Smrg# parm1:	specify the default value, yes or no.
2485d87a3195Smrg#
2486d87a3195SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
2487d87a3195Smrgm4_define([docs_default], m4_default([$1], [yes]))
2488d87a3195SmrgAC_ARG_ENABLE(docs,
2489d87a3195Smrg	AS_HELP_STRING([--enable-docs],
2490d87a3195Smrg	   [Enable building the documentation (default: ]docs_default[)]),
2491d87a3195Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
2492d87a3195Smrgm4_undefine([docs_default])
2493d87a3195SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2494d87a3195SmrgAC_MSG_CHECKING([whether to build documentation])
2495d87a3195SmrgAC_MSG_RESULT([$build_docs])
2496d87a3195Smrg]) # XORG_ENABLE_DOCS
249714330f12Smrg
2498d87a3195Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2499d87a3195Smrg# ----------------
2500d87a3195Smrg# Minimum version: 1.6.0
2501d87a3195Smrg#
2502d87a3195Smrg# This macro enables a builder to skip all developer documentation.
2503d87a3195Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2504d87a3195Smrg# maximum flexibility in controlling documentation building.
2505d87a3195Smrg# Refer to:
2506d87a3195Smrg# XORG_WITH_XMLTO         --with-xmlto
2507d87a3195Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2508d87a3195Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2509d87a3195Smrg# XORG_WITH_FOP           --with-fop
2510d87a3195Smrg# XORG_WITH_GROFF         --with-groff
2511d87a3195Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2512d87a3195Smrg#
2513d87a3195Smrg# Interface to module:
2514d87a3195Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
2515d87a3195Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
2516d87a3195Smrg#			'no' user instructs the module not to generate developer docs
2517d87a3195Smrg# parm1:		specify the default value, yes or no.
2518d87a3195Smrg#
2519d87a3195SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2520d87a3195Smrgm4_define([devel_default], m4_default([$1], [yes]))
2521d87a3195SmrgAC_ARG_ENABLE(devel-docs,
2522d87a3195Smrg	AS_HELP_STRING([--enable-devel-docs],
2523d87a3195Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
2524d87a3195Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2525d87a3195Smrgm4_undefine([devel_default])
2526d87a3195SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2527d87a3195SmrgAC_MSG_CHECKING([whether to build developer documentation])
2528d87a3195SmrgAC_MSG_RESULT([$build_devel_docs])
2529d87a3195Smrg]) # XORG_ENABLE_DEVEL_DOCS
253014330f12Smrg
2531d87a3195Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
2532d87a3195Smrg# ----------------
2533d87a3195Smrg# Minimum version: 1.6.0
2534d87a3195Smrg#
2535d87a3195Smrg# This macro enables a builder to skip all functional specification targets.
2536d87a3195Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2537d87a3195Smrg# maximum flexibility in controlling documentation building.
2538d87a3195Smrg# Refer to:
2539d87a3195Smrg# XORG_WITH_XMLTO         --with-xmlto
2540d87a3195Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2541d87a3195Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2542d87a3195Smrg# XORG_WITH_FOP           --with-fop
2543d87a3195Smrg# XORG_WITH_GROFF         --with-groff
2544d87a3195Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2545d87a3195Smrg#
2546d87a3195Smrg# Interface to module:
2547d87a3195Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
2548d87a3195Smrg# --enable-specs:	'yes' user instructs the module to generate specs
2549d87a3195Smrg#			'no' user instructs the module not to generate specs
2550d87a3195Smrg# parm1:		specify the default value, yes or no.
2551d87a3195Smrg#
2552d87a3195SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
2553d87a3195Smrgm4_define([spec_default], m4_default([$1], [yes]))
2554d87a3195SmrgAC_ARG_ENABLE(specs,
2555d87a3195Smrg	AS_HELP_STRING([--enable-specs],
2556d87a3195Smrg	   [Enable building the specs (default: ]spec_default[)]),
2557d87a3195Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
2558d87a3195Smrgm4_undefine([spec_default])
2559d87a3195SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2560d87a3195SmrgAC_MSG_CHECKING([whether to build functional specifications])
2561d87a3195SmrgAC_MSG_RESULT([$build_specs])
2562d87a3195Smrg]) # XORG_ENABLE_SPECS
256395b296d0Smrg
2564d87a3195Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2565d87a3195Smrg# ----------------------------------------------
2566d87a3195Smrg# Minimum version: 1.13.0
2567d87a3195Smrg#
2568d87a3195Smrg# This macro enables a builder to enable/disable unit testing
2569d87a3195Smrg# It makes no assumption about the test cases implementation
2570d87a3195Smrg# Test cases may or may not use Automake "Support for test suites"
2571d87a3195Smrg# They may or may not use the software utility library GLib
2572d87a3195Smrg#
2573d87a3195Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2574d87a3195Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2575d87a3195Smrg# The variable enable_unit_tests is used by other macros in this file.
2576d87a3195Smrg#
2577d87a3195Smrg# Interface to module:
2578d87a3195Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2579d87a3195Smrg# enable_unit_tests:    used in configure.ac for additional configuration
2580d87a3195Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
2581d87a3195Smrg#			'no' user instructs the module not to build tests
2582d87a3195Smrg# parm1:		specify the default value, yes or no.
2583d87a3195Smrg#
2584d87a3195SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2585d87a3195SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
2586d87a3195SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
2587d87a3195SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2588d87a3195Smrgm4_define([_defopt], m4_default([$1], [auto]))
2589d87a3195SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2590d87a3195Smrg	[Enable building unit test cases (default: ]_defopt[)]),
2591d87a3195Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2592d87a3195Smrgm4_undefine([_defopt])
2593d87a3195SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2594d87a3195SmrgAC_MSG_CHECKING([whether to build unit test cases])
2595d87a3195SmrgAC_MSG_RESULT([$enable_unit_tests])
2596d87a3195Smrg]) # XORG_ENABLE_UNIT_TESTS
259795b296d0Smrg
2598d87a3195Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2599d87a3195Smrg# ------------------------------------------------------
2600d87a3195Smrg# Minimum version: 1.17.0
2601d87a3195Smrg#
2602d87a3195Smrg# This macro enables a builder to enable/disable integration testing
2603d87a3195Smrg# It makes no assumption about the test cases' implementation
2604d87a3195Smrg# Test cases may or may not use Automake "Support for test suites"
2605d87a3195Smrg#
2606d87a3195Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2607d87a3195Smrg# usually requires less dependencies and may be built and run under less
2608d87a3195Smrg# stringent environments than integration tests.
2609d87a3195Smrg#
2610d87a3195Smrg# Interface to module:
2611d87a3195Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
2612d87a3195Smrg# enable_integration_tests:   used in configure.ac for additional configuration
2613d87a3195Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
2614d87a3195Smrg#                             'no' user instructs the module not to build tests
2615d87a3195Smrg# parm1:                      specify the default value, yes or no.
2616d87a3195Smrg#
2617d87a3195SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2618d87a3195SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2619d87a3195Smrgm4_define([_defopt], m4_default([$1], [auto]))
2620d87a3195SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2621d87a3195Smrg	[Enable building integration test cases (default: ]_defopt[)]),
2622d87a3195Smrg	[enable_integration_tests=$enableval],
2623d87a3195Smrg	[enable_integration_tests=]_defopt)
2624d87a3195Smrgm4_undefine([_defopt])
2625d87a3195SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2626d87a3195Smrg	[test "x$enable_integration_tests" != xno])
2627d87a3195SmrgAC_MSG_CHECKING([whether to build unit test cases])
2628d87a3195SmrgAC_MSG_RESULT([$enable_integration_tests])
2629d87a3195Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
263095b296d0Smrg
2631d87a3195Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2632d87a3195Smrg# ----------------------------------------
2633d87a3195Smrg# Minimum version: 1.13.0
2634d87a3195Smrg#
2635d87a3195Smrg# GLib is a library which provides advanced data structures and functions.
2636d87a3195Smrg# This macro enables a module to test for the presence of Glib.
2637d87a3195Smrg#
2638d87a3195Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2639d87a3195Smrg# Otherwise the value of $enable_unit_tests is blank.
2640d87a3195Smrg#
2641d87a3195Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2642d87a3195Smrg# test support usually requires less dependencies and may be built and run under
2643d87a3195Smrg# less stringent environments than integration tests.
2644d87a3195Smrg#
2645d87a3195Smrg# Interface to module:
2646d87a3195Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
2647d87a3195Smrg# with_glib: used in configure.ac to know if GLib has been found
2648d87a3195Smrg# --with-glib:	'yes' user instructs the module to use glib
2649d87a3195Smrg#		'no' user instructs the module not to use glib
2650d87a3195Smrg#
2651d87a3195SmrgAC_DEFUN([XORG_WITH_GLIB],[
2652d87a3195SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2653d87a3195Smrgm4_define([_defopt], m4_default([$2], [auto]))
2654d87a3195SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2655d87a3195Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
2656d87a3195Smrg	[with_glib=$withval], [with_glib=]_defopt)
2657d87a3195Smrgm4_undefine([_defopt])
2658d87a3195Smrg
2659d87a3195Smrghave_glib=no
2660d87a3195Smrg# Do not probe GLib if user explicitly disabled unit testing
2661d87a3195Smrgif test "x$enable_unit_tests" != x"no"; then
2662d87a3195Smrg  # Do not probe GLib if user explicitly disabled it
2663d87a3195Smrg  if test "x$with_glib" != x"no"; then
2664d87a3195Smrg    m4_ifval(
2665d87a3195Smrg      [$1],
2666d87a3195Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2667d87a3195Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2668d87a3195Smrg    )
2669eca46af7Smrg  fi
2670eca46af7Smrgfi
26712378475aSmrg
2672d87a3195Smrg# Not having GLib when unit testing has been explicitly requested is an error
2673d87a3195Smrgif test "x$enable_unit_tests" = x"yes"; then
2674d87a3195Smrg  if test "x$have_glib" = x"no"; then
2675d87a3195Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2676d87a3195Smrg  fi
2677d87a3195Smrgfi
26782378475aSmrg
2679d87a3195Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
2680d87a3195Smrgif test "x$enable_unit_tests" = x"no"; then
2681d87a3195Smrg  if test "x$with_glib" = x"yes"; then
2682d87a3195Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2683d87a3195Smrg  fi
2684d87a3195Smrgfi
268595b296d0Smrg
2686d87a3195Smrg# Not having GLib when it has been explicitly requested is an error
2687d87a3195Smrgif test "x$with_glib" = x"yes"; then
2688d87a3195Smrg  if test "x$have_glib" = x"no"; then
2689d87a3195Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2690d87a3195Smrg  fi
2691d87a3195Smrgfi
269295b296d0Smrg
2693d87a3195SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2694d87a3195Smrg]) # XORG_WITH_GLIB
269595b296d0Smrg
2696d87a3195Smrg# XORG_LD_WRAP([required|optional])
2697d87a3195Smrg# ---------------------------------
2698d87a3195Smrg# Minimum version: 1.13.0
2699d87a3195Smrg#
2700d87a3195Smrg# Check if linker supports -wrap, passed via compiler flags
2701d87a3195Smrg#
2702d87a3195Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2703d87a3195Smrg# Otherwise the value of $enable_unit_tests is blank.
2704d87a3195Smrg#
2705d87a3195Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
2706d87a3195Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
2707d87a3195Smrg# available, an argument of "optional" allows use when some unit tests require
2708d87a3195Smrg# ld -wrap and others do not.
2709d87a3195Smrg#
2710d87a3195SmrgAC_DEFUN([XORG_LD_WRAP],[
2711d87a3195SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2712d87a3195Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
2713d87a3195Smrg                      void __wrap_exit(int status) { return; }],
2714d87a3195Smrg                     [exit(0);])])
2715d87a3195Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
2716d87a3195Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2717d87a3195Smrg  if test "x$have_ld_wrap" = x"no"; then
2718d87a3195Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2719eca46af7Smrg  fi
2720d87a3195Smrgfi
2721d87a3195SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2722d87a3195Smrg#
2723d87a3195Smrg]) # XORG_LD_WRAP
272495b296d0Smrg
2725d87a3195Smrg# XORG_CHECK_LINKER_FLAGS
2726d87a3195Smrg# -----------------------
2727d87a3195Smrg# SYNOPSIS
2728d87a3195Smrg#
2729d87a3195Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2730d87a3195Smrg#
2731d87a3195Smrg# DESCRIPTION
2732d87a3195Smrg#
2733d87a3195Smrg#   Check whether the given linker FLAGS work with the current language's
2734d87a3195Smrg#   linker, or whether they give an error.
2735d87a3195Smrg#
2736d87a3195Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2737d87a3195Smrg#   success/failure.
2738d87a3195Smrg#
2739d87a3195Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
2740d87a3195Smrg#
2741d87a3195Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2742d87a3195Smrg#
2743d87a3195Smrg# LICENSE
2744d87a3195Smrg#
2745d87a3195Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2746d87a3195Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2747d87a3195Smrg#   Copyright (c) 2009 Matteo Frigo
2748d87a3195Smrg#
2749d87a3195Smrg#   This program is free software: you can redistribute it and/or modify it
2750d87a3195Smrg#   under the terms of the GNU General Public License as published by the
2751d87a3195Smrg#   Free Software Foundation, either version 3 of the License, or (at your
2752d87a3195Smrg#   option) any later version.
2753d87a3195Smrg#
2754d87a3195Smrg#   This program is distributed in the hope that it will be useful, but
2755d87a3195Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
2756d87a3195Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2757d87a3195Smrg#   Public License for more details.
2758d87a3195Smrg#
2759d87a3195Smrg#   You should have received a copy of the GNU General Public License along
2760d87a3195Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
2761d87a3195Smrg#
2762d87a3195Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
2763d87a3195Smrg#   gives unlimited permission to copy, distribute and modify the configure
2764d87a3195Smrg#   scripts that are the output of Autoconf when processing the Macro. You
2765d87a3195Smrg#   need not follow the terms of the GNU General Public License when using
2766d87a3195Smrg#   or distributing such scripts, even though portions of the text of the
2767d87a3195Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
2768d87a3195Smrg#   all other use of the material that constitutes the Autoconf Macro.
2769d87a3195Smrg#
2770d87a3195Smrg#   This special exception to the GPL applies to versions of the Autoconf
2771d87a3195Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
2772d87a3195Smrg#   modified version of the Autoconf Macro, you may extend this special
2773d87a3195Smrg#   exception to the GPL to apply to your modified version as well.#
2774d87a3195SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2775d87a3195Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
2776d87a3195Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2777d87a3195SmrgAS_LITERAL_IF([$1],
2778d87a3195Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2779d87a3195Smrg      ax_save_FLAGS=$LDFLAGS
2780d87a3195Smrg      LDFLAGS="$1"
2781d87a3195Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2782d87a3195Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2783d87a3195Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2784d87a3195Smrg      LDFLAGS=$ax_save_FLAGS])],
2785d87a3195Smrg  [ax_save_FLAGS=$LDFLAGS
2786d87a3195Smrg   LDFLAGS="$1"
2787d87a3195Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2788d87a3195Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2789d87a3195Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2790d87a3195Smrg   LDFLAGS=$ax_save_FLAGS])
2791d87a3195Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2792d87a3195SmrgAC_MSG_RESULT($xorg_check_linker_flags)
2793d87a3195Smrgif test "x$xorg_check_linker_flags" = xyes; then
2794d87a3195Smrg	m4_default([$2], :)
2795d87a3195Smrgelse
2796d87a3195Smrg	m4_default([$3], :)
2797d87a3195Smrgfi
2798d87a3195Smrg]) # XORG_CHECK_LINKER_FLAGS
279995b296d0Smrg
2800d87a3195Smrg# XORG_MEMORY_CHECK_FLAGS
2801d87a3195Smrg# -----------------------
2802d87a3195Smrg# Minimum version: 1.16.0
2803d87a3195Smrg#
2804d87a3195Smrg# This macro attempts to find appropriate memory checking functionality
2805d87a3195Smrg# for various platforms which unit testing code may use to catch various
2806d87a3195Smrg# forms of memory allocation and access errors in testing.
2807d87a3195Smrg#
2808d87a3195Smrg# Interface to module:
2809d87a3195Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2810d87a3195Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
2811d87a3195Smrg#
2812d87a3195Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2813d87a3195Smrg#
2814d87a3195SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
281595b296d0Smrg
2816d87a3195SmrgAC_REQUIRE([AC_CANONICAL_HOST])
2817d87a3195SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2818d87a3195Smrg           [Environment variables to enable memory checking in tests])
281995b296d0Smrg
2820d87a3195Smrg# Check for different types of support on different platforms
2821d87a3195Smrgcase $host_os in
2822d87a3195Smrg    solaris*)
2823d87a3195Smrg        AC_CHECK_LIB([umem], [umem_alloc],
2824d87a3195Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2825d87a3195Smrg        ;;
2826d87a3195Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2827d87a3195Smrg        # both directly and inverted, so should not be 0 or 255.
2828d87a3195Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
2829d87a3195Smrg        ;;
2830d87a3195Smrg    darwin*)
2831d87a3195Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2832d87a3195Smrg        ;;
2833d87a3195Smrg    *bsd*)
2834d87a3195Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2835d87a3195Smrg        ;;
2836d87a3195Smrgesac
283795b296d0Smrg
2838d87a3195Smrg# User supplied flags override default flags
2839d87a3195Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2840d87a3195Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2841eca46af7Smrgfi
284295b296d0Smrg
2843d87a3195SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2844d87a3195Smrg]) # XORG_WITH_LINT
28452378475aSmrg
2846d87a3195Smrg# XORG_CHECK_MALLOC_ZERO
2847d87a3195Smrg# ----------------------
2848d87a3195Smrg# Minimum version: 1.0.0
2849d87a3195Smrg#
2850d87a3195Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2851d87a3195Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
2852d87a3195Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2853d87a3195SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2854d87a3195SmrgAC_ARG_ENABLE(malloc0returnsnull,
2855d87a3195Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
2856d87a3195Smrg		       [malloc(0) returns NULL (default: auto)]),
2857d87a3195Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2858d87a3195Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
285995b296d0Smrg
2860d87a3195SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
2861d87a3195Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2862d87a3195SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
2863d87a3195Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
2864d87a3195Smrg#include <stdlib.h>
2865d87a3195Smrg],[
2866d87a3195Smrg    char *m0, *r0, *c0, *p;
2867d87a3195Smrg    m0 = malloc(0);
2868d87a3195Smrg    p = malloc(10);
2869d87a3195Smrg    r0 = realloc(p,0);
2870d87a3195Smrg    c0 = calloc(0,10);
2871d87a3195Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2872d87a3195Smrg])],
2873d87a3195Smrg		[xorg_cv_malloc0_returns_null=yes],
2874d87a3195Smrg		[xorg_cv_malloc0_returns_null=no])])
2875d87a3195SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2876d87a3195Smrgfi
2877d87a3195SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
28782378475aSmrg
2879d87a3195Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2880d87a3195Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2881d87a3195Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2882d87a3195Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2883eca46af7Smrgelse
2884d87a3195Smrg	MALLOC_ZERO_CFLAGS=""
2885d87a3195Smrg	XMALLOC_ZERO_CFLAGS=""
2886d87a3195Smrg	XTMALLOC_ZERO_CFLAGS=""
2887eca46af7Smrgfi
288895b296d0Smrg
2889d87a3195SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
2890d87a3195SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
2891d87a3195SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
2892d87a3195Smrg]) # XORG_CHECK_MALLOC_ZERO
28932378475aSmrg
2894d87a3195Smrg# XORG_WITH_LINT()
2895eca46af7Smrg# ----------------
2896d87a3195Smrg# Minimum version: 1.1.0
2897d87a3195Smrg#
2898d87a3195Smrg# This macro enables the use of a tool that flags some suspicious and
2899d87a3195Smrg# non-portable constructs (likely to be bugs) in C language source code.
2900d87a3195Smrg# It will attempt to locate the tool and use appropriate options.
2901d87a3195Smrg# There are various lint type tools on different platforms.
2902d87a3195Smrg#
2903d87a3195Smrg# Interface to module:
2904d87a3195Smrg# LINT:		returns the path to the tool found on the platform
2905d87a3195Smrg#		or the value set to LINT on the configure cmd line
2906d87a3195Smrg#		also an Automake conditional
2907d87a3195Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
2908d87a3195Smrg#
2909d87a3195Smrg# --with-lint:	'yes' user instructs the module to use lint
2910d87a3195Smrg#		'no' user instructs the module not to use lint (default)
2911d87a3195Smrg#
2912d87a3195Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2913d87a3195Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
2914d87a3195Smrg#
2915d87a3195SmrgAC_DEFUN([XORG_WITH_LINT],[
29162378475aSmrg
2917d87a3195SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
2918d87a3195SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2919d87a3195SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2920d87a3195Smrg		[Use a lint-style source code checker (default: disabled)])],
2921d87a3195Smrg		[use_lint=$withval], [use_lint=no])
292214330f12Smrg
2923d87a3195Smrg# Obtain platform specific info like program name and options
2924d87a3195Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2925d87a3195Smrgcase $host_os in
2926d87a3195Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2927d87a3195Smrg	lint_name=splint
2928d87a3195Smrg	lint_options="-badflag"
2929d87a3195Smrg	;;
2930d87a3195Smrg  *freebsd* | *netbsd*)
2931d87a3195Smrg	lint_name=lint
2932d87a3195Smrg	lint_options="-u -b"
2933d87a3195Smrg	;;
2934d87a3195Smrg  *solaris*)
2935d87a3195Smrg	lint_name=lint
2936d87a3195Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2937d87a3195Smrg	;;
2938d87a3195Smrgesac
293914330f12Smrg
2940d87a3195Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2941d87a3195Smrgif test "x$use_lint" = x"yes" ; then
2942d87a3195Smrg   AC_PATH_PROG([LINT], [$lint_name])
2943d87a3195Smrg   if test "x$LINT" = "x"; then
2944d87a3195Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2945d87a3195Smrg   fi
2946d87a3195Smrgelif test "x$use_lint" = x"no" ; then
2947d87a3195Smrg   if test "x$LINT" != "x"; then
2948d87a3195Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2949d87a3195Smrg   fi
295095b296d0Smrgelse
2951d87a3195Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
295295b296d0Smrgfi
29532378475aSmrg
2954d87a3195Smrg# User supplied flags override default flags
2955d87a3195Smrgif test "x$LINT_FLAGS" != "x"; then
2956d87a3195Smrg   lint_options=$LINT_FLAGS
2957eca46af7Smrgfi
295814330f12Smrg
2959d87a3195SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2960d87a3195SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
296195b296d0Smrg
2962d87a3195Smrg]) # XORG_WITH_LINT
296395b296d0Smrg
2964d87a3195Smrg# XORG_LINT_LIBRARY(LIBNAME)
2965d87a3195Smrg# --------------------------
2966d87a3195Smrg# Minimum version: 1.1.0
2967d87a3195Smrg#
2968d87a3195Smrg# Sets up flags for building lint libraries for checking programs that call
2969d87a3195Smrg# functions in the library.
2970d87a3195Smrg#
2971d87a3195Smrg# Interface to module:
2972d87a3195Smrg# LINTLIB		- Automake variable with the name of lint library file to make
2973d87a3195Smrg# MAKE_LINT_LIB		- Automake conditional
2974d87a3195Smrg#
2975d87a3195Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2976d87a3195Smrg#			  - 'no' user instructs the module not to create a lint library (default)
297789b0dc75Smrg
2978d87a3195SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2979d87a3195SmrgAC_REQUIRE([XORG_WITH_LINT])
2980d87a3195SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2981d87a3195Smrg	[Create lint library (default: disabled)])],
2982d87a3195Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
298389b0dc75Smrg
2984d87a3195Smrgif test "x$make_lint_lib" = x"yes" ; then
2985d87a3195Smrg   LINTLIB=llib-l$1.ln
2986d87a3195Smrg   if test "x$LINT" = "x"; then
2987d87a3195Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2988d87a3195Smrg   fi
2989d87a3195Smrgelif test "x$make_lint_lib" != x"no" ; then
2990d87a3195Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2991d87a3195Smrgfi
299295b296d0Smrg
2993d87a3195SmrgAC_SUBST(LINTLIB)
2994d87a3195SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
299595b296d0Smrg
2996d87a3195Smrg]) # XORG_LINT_LIBRARY
299789b0dc75Smrg
2998d87a3195Smrg# XORG_COMPILER_BRAND
2999d87a3195Smrg# -------------------
3000d87a3195Smrg# Minimum version: 1.14.0
3001d87a3195Smrg#
3002d87a3195Smrg# Checks for various brands of compilers and sets flags as appropriate:
3003d87a3195Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
3004d87a3195Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
3005d87a3195Smrg#   clang compiler - sets CLANGCC to "yes"
3006d87a3195Smrg#   Intel compiler - sets INTELCC to "yes"
3007d87a3195Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
3008d87a3195Smrg#
3009d87a3195SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
3010d87a3195SmrgAC_LANG_CASE(
3011d87a3195Smrg	[C], [
3012d87a3195Smrg		dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
3013d87a3195Smrg		dnl and complains that AC_PROG_CC_C99 is obsolete
3014d87a3195Smrg		m4_version_prereq([2.70],
3015d87a3195Smrg			[AC_REQUIRE([AC_PROG_CC])],
3016d87a3195Smrg			[AC_REQUIRE([AC_PROG_CC_C99])])
3017d87a3195Smrg	],
3018d87a3195Smrg	[C++], [
3019d87a3195Smrg		AC_REQUIRE([AC_PROG_CXX])
3020d87a3195Smrg	]
3021d87a3195Smrg)
3022d87a3195SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
3023d87a3195SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
3024d87a3195SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
3025d87a3195Smrg]) # XORG_COMPILER_BRAND
302695b296d0Smrg
3027d87a3195Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
3028d87a3195Smrg# ---------------
3029d87a3195Smrg# Minimum version: 1.16.0
3030d87a3195Smrg#
3031d87a3195Smrg# Test if the compiler works when passed the given flag as a command line argument.
3032d87a3195Smrg# If it succeeds, the flag is appended to the given variable.  If not, it tries the
3033d87a3195Smrg# next flag in the list until there are no more options.
3034d87a3195Smrg#
3035d87a3195Smrg# Note that this does not guarantee that the compiler supports the flag as some
3036d87a3195Smrg# compilers will simply ignore arguments that they do not understand, but we do
3037d87a3195Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
3038d87a3195Smrg# -Werror=unused-command-line-argument
3039d87a3195Smrg#
3040d87a3195SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
3041d87a3195Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
3042d87a3195Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
304314330f12Smrg
3044d87a3195SmrgAC_LANG_COMPILER_REQUIRE
3045eca46af7Smrg
3046d87a3195SmrgAC_LANG_CASE(
3047d87a3195Smrg	[C], [
3048d87a3195Smrg		dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
3049d87a3195Smrg		dnl and complains that AC_PROG_CC_C99 is obsolete
3050d87a3195Smrg		m4_version_prereq([2.70],
3051d87a3195Smrg			[AC_REQUIRE([AC_PROG_CC])],
3052d87a3195Smrg			[AC_REQUIRE([AC_PROG_CC_C99])])
3053d87a3195Smrg		define([PREFIX], [C])
3054d87a3195Smrg		define([CACHE_PREFIX], [cc])
3055d87a3195Smrg		define([COMPILER], [$CC])
3056d87a3195Smrg	],
3057d87a3195Smrg	[C++], [
3058d87a3195Smrg		define([PREFIX], [CXX])
3059d87a3195Smrg		define([CACHE_PREFIX], [cxx])
3060d87a3195Smrg		define([COMPILER], [$CXX])
3061d87a3195Smrg	]
3062d87a3195Smrg)
306395b296d0Smrg
3064d87a3195Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
306595b296d0Smrg
3066d87a3195Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
3067d87a3195Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3068d87a3195Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
3069d87a3195Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
3070d87a3195Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3071d87a3195Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
3072d87a3195Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
3073d87a3195Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
3074d87a3195Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3075d87a3195Smrgfi
307695b296d0Smrg
3077d87a3195Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
3078d87a3195Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
3079d87a3195Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3080d87a3195Smrg	fi
3081d87a3195Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3082d87a3195Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
3083d87a3195Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
3084d87a3195Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3085d87a3195Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
3086d87a3195Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
3087d87a3195Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
3088d87a3195Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3089d87a3195Smrgfi
30902378475aSmrg
3091d87a3195Smrgfound="no"
3092d87a3195Smrgm4_foreach([flag], m4_cdr($@), [
3093d87a3195Smrg	if test $found = "no" ; then
3094d87a3195Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
3095d87a3195Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3096d87a3195Smrg		fi
309795b296d0Smrg
3098d87a3195Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
3099d87a3195Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3100d87a3195Smrg		fi
3101eca46af7Smrg
3102d87a3195Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
310395b296d0Smrg
3104d87a3195Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
3105d87a3195Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
3106d87a3195Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
3107d87a3195Smrg		AC_CACHE_VAL($cacheid,
3108d87a3195Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
3109d87a3195Smrg					     [eval $cacheid=yes],
3110d87a3195Smrg					     [eval $cacheid=no])])
311114330f12Smrg
3112d87a3195Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
311395b296d0Smrg
3114d87a3195Smrg		eval supported=\$$cacheid
3115d87a3195Smrg		AC_MSG_RESULT([$supported])
3116d87a3195Smrg		if test "$supported" = "yes" ; then
3117d87a3195Smrg			$1="$$1 ]flag["
3118d87a3195Smrg			found="yes"
3119d87a3195Smrg		fi
3120d87a3195Smrg	fi
3121d87a3195Smrg])
3122d87a3195Smrg]) # XORG_TESTSET_CFLAG
3123eca46af7Smrg
3124d87a3195Smrg# XORG_COMPILER_FLAGS
3125d87a3195Smrg# ---------------
3126d87a3195Smrg# Minimum version: 1.16.0
3127d87a3195Smrg#
3128d87a3195Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
3129d87a3195Smrg# arguments supported by the selected compiler which do NOT alter the generated
3130d87a3195Smrg# code.  These arguments will cause the compiler to print various warnings
3131d87a3195Smrg# during compilation AND turn a conservative set of warnings into errors.
3132d87a3195Smrg#
3133d87a3195Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
3134d87a3195Smrg# future versions of util-macros as options are added to new compilers.
3135d87a3195Smrg#
3136d87a3195SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
3137d87a3195SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
313895b296d0Smrg
3139d87a3195SmrgAC_ARG_ENABLE(selective-werror,
3140d87a3195Smrg              AS_HELP_STRING([--disable-selective-werror],
3141d87a3195Smrg                             [Turn off selective compiler errors. (default: enabled)]),
3142d87a3195Smrg              [SELECTIVE_WERROR=$enableval],
3143d87a3195Smrg              [SELECTIVE_WERROR=yes])
314495b296d0Smrg
3145d87a3195SmrgAC_LANG_CASE(
3146d87a3195Smrg        [C], [
3147d87a3195Smrg                define([PREFIX], [C])
3148d87a3195Smrg        ],
3149d87a3195Smrg        [C++], [
3150d87a3195Smrg                define([PREFIX], [CXX])
3151d87a3195Smrg        ]
3152d87a3195Smrg)
3153d87a3195Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
3154d87a3195Smrgif test "x$SUNCC" = "xyes"; then
3155d87a3195Smrg    [BASE_]PREFIX[FLAGS]="-v"
3156d87a3195Smrgelse
3157d87a3195Smrg    [BASE_]PREFIX[FLAGS]=""
3158d87a3195Smrgfi
315995b296d0Smrg
3160d87a3195Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
3161d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
3162d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
3163d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
3164d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
316595b296d0Smrg
3166d87a3195SmrgAC_LANG_CASE(
3167d87a3195Smrg	[C], [
3168d87a3195Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
3169d87a3195Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
3170d87a3195Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
3171d87a3195Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
3172d87a3195Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
3173d87a3195Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
3174d87a3195Smrg	]
3175d87a3195Smrg)
317695b296d0Smrg
3177d87a3195Smrg# This chunk adds additional warnings that could catch undesired effects.
3178d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
3179d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
3180d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
3181d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
3182d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
3183d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
3184d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
318595b296d0Smrg
3186d87a3195Smrg# These are currently disabled because they are noisy.  They will be enabled
3187d87a3195Smrg# in the future once the codebase is sufficiently modernized to silence
3188d87a3195Smrg# them.  For now, I don't want them to drown out the other warnings.
3189d87a3195Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
3190d87a3195Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
3191d87a3195Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
319295b296d0Smrg
3193d87a3195Smrg# Turn some warnings into errors, so we don't accidentally get successful builds
3194d87a3195Smrg# when there are problems that should be fixed.
319595b296d0Smrg
3196d87a3195Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
3197d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
3198d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
3199d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
3200d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
3201d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
3202d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
3203d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
3204d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
3205d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
3206d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3207d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3208d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3209d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
3210d87a3195Smrgelse
3211d87a3195SmrgAC_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])
3212d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3213d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3214d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3215d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3216d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3217d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3218d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3219d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3220d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3221d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3222d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3223d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3224d87a3195SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
3225d87a3195Smrgfi
322695b296d0Smrg
3227d87a3195SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3228d87a3195Smrg]) # XORG_COMPILER_FLAGS
322995b296d0Smrg
3230d87a3195Smrg# XORG_CWARNFLAGS
3231d87a3195Smrg# ---------------
3232d87a3195Smrg# Minimum version: 1.2.0
3233d87a3195Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3234d87a3195Smrg#
3235d87a3195Smrg# Defines CWARNFLAGS to enable C compiler warnings.
3236d87a3195Smrg#
3237d87a3195Smrg# This function is deprecated because it defines -fno-strict-aliasing
3238d87a3195Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
3239d87a3195Smrg# is needed, then it should be added explicitly in the module when
3240d87a3195Smrg# it is updated to use BASE_CFLAGS.
3241d87a3195Smrg#
3242d87a3195SmrgAC_DEFUN([XORG_CWARNFLAGS], [
3243d87a3195SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3244d87a3195SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3245d87a3195SmrgAC_LANG_CASE(
3246d87a3195Smrg	[C], [
3247d87a3195Smrg		CWARNFLAGS="$BASE_CFLAGS"
3248d87a3195Smrg		if  test "x$GCC" = xyes ; then
3249d87a3195Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3250d87a3195Smrg		fi
3251d87a3195Smrg		AC_SUBST(CWARNFLAGS)
3252d87a3195Smrg	]
3253d87a3195Smrg)
3254d87a3195Smrg]) # XORG_CWARNFLAGS
325595b296d0Smrg
3256d87a3195Smrg# XORG_STRICT_OPTION
3257d87a3195Smrg# -----------------------
3258d87a3195Smrg# Minimum version: 1.3.0
3259d87a3195Smrg#
3260d87a3195Smrg# Add configure option to enable strict compilation flags, such as treating
3261d87a3195Smrg# warnings as fatal errors.
3262d87a3195Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
3263d87a3195Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
3264d87a3195Smrg#
3265d87a3195Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
3266d87a3195Smrg# when strict compilation is unconditionally desired.
3267d87a3195SmrgAC_DEFUN([XORG_STRICT_OPTION], [
3268d87a3195SmrgAC_REQUIRE([XORG_CWARNFLAGS])
3269d87a3195SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3270e6f085baSmrg
3271d87a3195SmrgAC_ARG_ENABLE(strict-compilation,
3272d87a3195Smrg			  AS_HELP_STRING([--enable-strict-compilation],
3273d87a3195Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
3274d87a3195Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
3275e6f085baSmrg
3276d87a3195SmrgAC_LANG_CASE(
3277d87a3195Smrg        [C], [
3278d87a3195Smrg                define([PREFIX], [C])
3279d87a3195Smrg        ],
3280d87a3195Smrg        [C++], [
3281d87a3195Smrg                define([PREFIX], [CXX])
3282d87a3195Smrg        ]
3283d87a3195Smrg)
3284e6f085baSmrg
3285d87a3195Smrg[STRICT_]PREFIX[FLAGS]=""
3286d87a3195SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3287d87a3195SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3288e6f085baSmrg
3289d87a3195Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3290d87a3195Smrg# activate it with -Werror, so we add it here explicitly.
3291d87a3195SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
3292e6f085baSmrg
3293d87a3195Smrgif test "x$STRICT_COMPILE" = "xyes"; then
3294d87a3195Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3295d87a3195Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
3296d87a3195Smrgfi
3297d87a3195SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
3298d87a3195SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3299d87a3195SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
3300d87a3195Smrg]) # XORG_STRICT_OPTION
3301e6f085baSmrg
3302d87a3195Smrg# XORG_DEFAULT_NOCODE_OPTIONS
3303d87a3195Smrg# ---------------------------
3304d87a3195Smrg# Minimum version: 1.20.0
3305d87a3195Smrg#
3306d87a3195Smrg# Defines default options for X.Org modules which don't compile code,
3307d87a3195Smrg# such as fonts, bitmaps, cursors, and docs.
3308d87a3195Smrg#
3309d87a3195SmrgAC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [
3310d87a3195SmrgAC_REQUIRE([AC_PROG_INSTALL])
3311d87a3195SmrgXORG_RELEASE_VERSION
3312d87a3195SmrgXORG_CHANGELOG
3313d87a3195SmrgXORG_INSTALL
3314d87a3195SmrgXORG_MANPAGE_SECTIONS
3315d87a3195Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
3316d87a3195Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
3317d87a3195Smrg]) # XORG_DEFAULT_NOCODE_OPTIONS
331814330f12Smrg
3319d87a3195Smrg# XORG_DEFAULT_OPTIONS
3320d87a3195Smrg# --------------------
3321d87a3195Smrg# Minimum version: 1.3.0
3322d87a3195Smrg#
3323d87a3195Smrg# Defines default options for X.Org modules which compile code.
3324d87a3195Smrg#
3325d87a3195SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
3326d87a3195SmrgAC_REQUIRE([AC_PROG_INSTALL])
3327d87a3195SmrgXORG_COMPILER_FLAGS
3328d87a3195SmrgXORG_CWARNFLAGS
3329d87a3195SmrgXORG_STRICT_OPTION
3330d87a3195SmrgXORG_DEFAULT_NOCODE_OPTIONS
3331d87a3195Smrg]) # XORG_DEFAULT_OPTIONS
333214330f12Smrg
3333d87a3195Smrg# XORG_INSTALL()
3334d87a3195Smrg# ----------------
3335d87a3195Smrg# Minimum version: 1.4.0
3336d87a3195Smrg#
3337d87a3195Smrg# Defines the variable INSTALL_CMD as the command to copy
3338d87a3195Smrg# INSTALL from $prefix/share/util-macros.
3339d87a3195Smrg#
3340d87a3195SmrgAC_DEFUN([XORG_INSTALL], [
3341d87a3195SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
3342d87a3195Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
3343d87a3195SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
3344d87a3195Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
3345d87a3195Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
3346d87a3195Smrgtouch \$(top_srcdir)/INSTALL; \
3347d87a3195Smrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
3348d87a3195SmrgAC_SUBST([INSTALL_CMD])
3349d87a3195Smrg]) # XORG_INSTALL
3350d87a3195Smrgdnl Copyright 2005 Red Hat, Inc
3351d87a3195Smrgdnl
3352d87a3195Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
3353d87a3195Smrgdnl documentation for any purpose is hereby granted without fee, provided that
3354d87a3195Smrgdnl the above copyright notice appear in all copies and that both that
3355d87a3195Smrgdnl copyright notice and this permission notice appear in supporting
3356d87a3195Smrgdnl documentation.
3357d87a3195Smrgdnl
3358d87a3195Smrgdnl The above copyright notice and this permission notice shall be included
3359d87a3195Smrgdnl in all copies or substantial portions of the Software.
3360d87a3195Smrgdnl
3361d87a3195Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3362d87a3195Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3363d87a3195Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3364d87a3195Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3365d87a3195Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3366d87a3195Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3367d87a3195Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
3368d87a3195Smrgdnl
3369d87a3195Smrgdnl Except as contained in this notice, the name of the copyright holders shall
3370d87a3195Smrgdnl not be used in advertising or otherwise to promote the sale, use or
3371d87a3195Smrgdnl other dealings in this Software without prior written authorization
3372d87a3195Smrgdnl from the copyright holders.
3373d87a3195Smrgdnl
337495b296d0Smrg
3375d87a3195Smrg# XORG_RELEASE_VERSION
3376d87a3195Smrg# --------------------
3377d87a3195Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
337895b296d0Smrg
3379d87a3195SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
3380d87a3195Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3381d87a3195Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
3382d87a3195Smrg		[Major version of this package])
3383d87a3195Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3384d87a3195Smrg	if test "x$PVM" = "x"; then
3385d87a3195Smrg		PVM="0"
3386d87a3195Smrg	fi
3387d87a3195Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3388d87a3195Smrg		[$PVM],
3389d87a3195Smrg		[Minor version of this package])
3390d87a3195Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3391d87a3195Smrg	if test "x$PVP" = "x"; then
3392d87a3195Smrg		PVP="0"
3393d87a3195Smrg	fi
3394d87a3195Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3395d87a3195Smrg		[$PVP],
3396d87a3195Smrg		[Patch version of this package])
3397d87a3195Smrg])
339895b296d0Smrg
3399d87a3195Smrg# XORG_CHANGELOG()
3400d87a3195Smrg# ----------------
3401d87a3195Smrg# Minimum version: 1.2.0
3402d87a3195Smrg#
3403d87a3195Smrg# Defines the variable CHANGELOG_CMD as the command to generate
3404d87a3195Smrg# ChangeLog from git.
3405d87a3195Smrg#
3406d87a3195Smrg#
3407d87a3195SmrgAC_DEFUN([XORG_CHANGELOG], [
3408d87a3195SmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
3409d87a3195Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3410d87a3195Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
3411d87a3195Smrgtouch \$(top_srcdir)/ChangeLog; \
3412d87a3195Smrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
3413d87a3195SmrgAC_SUBST([CHANGELOG_CMD])
3414d87a3195Smrg]) # XORG_CHANGELOG
3415e6f085baSmrg
3416d87a3195Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
3417d87a3195Smrg#
3418d87a3195Smrg#   Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
3419d87a3195Smrg#   Foundation, Inc.
3420d87a3195Smrg#   Written by Gordon Matzigkeit, 1996
3421d87a3195Smrg#
3422d87a3195Smrg# This file is free software; the Free Software Foundation gives
3423d87a3195Smrg# unlimited permission to copy and/or distribute it, with or without
3424d87a3195Smrg# modifications, as long as this notice is preserved.
342595b296d0Smrg
3426d87a3195Smrgm4_define([_LT_COPYING], [dnl
3427d87a3195Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
3428d87a3195Smrg# This is free software; see the source for copying conditions.  There is NO
3429d87a3195Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
343095b296d0Smrg
3431d87a3195Smrg# GNU Libtool is free software; you can redistribute it and/or modify
3432d87a3195Smrg# it under the terms of the GNU General Public License as published by
3433d87a3195Smrg# the Free Software Foundation; either version 2 of of the License, or
3434d87a3195Smrg# (at your option) any later version.
3435d87a3195Smrg#
3436d87a3195Smrg# As a special exception to the GNU General Public License, if you
3437d87a3195Smrg# distribute this file as part of a program or library that is built
3438d87a3195Smrg# using GNU Libtool, you may include this file under the  same
3439d87a3195Smrg# distribution terms that you use for the rest of that program.
3440d87a3195Smrg#
3441d87a3195Smrg# GNU Libtool is distributed in the hope that it will be useful, but
3442d87a3195Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
3443d87a3195Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3444d87a3195Smrg# GNU General Public License for more details.
3445d87a3195Smrg#
3446d87a3195Smrg# You should have received a copy of the GNU General Public License
3447d87a3195Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
3448d87a3195Smrg])
344914330f12Smrg
3450d87a3195Smrg# serial 59 LT_INIT
345114330f12Smrg
345214330f12Smrg
3453d87a3195Smrg# LT_PREREQ(VERSION)
3454d87a3195Smrg# ------------------
3455d87a3195Smrg# Complain and exit if this libtool version is less that VERSION.
3456d87a3195Smrgm4_defun([LT_PREREQ],
3457d87a3195Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
3458d87a3195Smrg       [m4_default([$3],
3459d87a3195Smrg		   [m4_fatal([Libtool version $1 or higher is required],
3460d87a3195Smrg		             63)])],
3461d87a3195Smrg       [$2])])
346214330f12Smrg
346314330f12Smrg
3464d87a3195Smrg# _LT_CHECK_BUILDDIR
3465d87a3195Smrg# ------------------
3466d87a3195Smrg# Complain if the absolute build directory name contains unusual characters
3467d87a3195Smrgm4_defun([_LT_CHECK_BUILDDIR],
3468d87a3195Smrg[case `pwd` in
3469d87a3195Smrg  *\ * | *\	*)
3470d87a3195Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
3471eca46af7Smrgesac
3472d87a3195Smrg])
347314330f12Smrg
347414330f12Smrg
3475d87a3195Smrg# LT_INIT([OPTIONS])
3476d87a3195Smrg# ------------------
3477d87a3195SmrgAC_DEFUN([LT_INIT],
3478d87a3195Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
3479d87a3195SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3480d87a3195SmrgAC_BEFORE([$0], [LT_LANG])dnl
3481d87a3195SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
3482d87a3195SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
3483d87a3195Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
348489b0dc75Smrg
3485d87a3195Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
3486d87a3195Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
3487d87a3195Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
3488d87a3195Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
3489d87a3195Smrgdnl unless we require an AC_DEFUNed macro:
3490d87a3195SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
3491d87a3195SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
3492d87a3195SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
3493d87a3195SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
3494d87a3195Smrgm4_require([_LT_PROG_LTMAIN])dnl
349514330f12Smrg
3496d87a3195Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
349789b0dc75Smrg
3498d87a3195Smrgdnl Parse OPTIONS
3499d87a3195Smrg_LT_SET_OPTIONS([$0], [$1])
350089b0dc75Smrg
3501d87a3195Smrg# This can be used to rebuild libtool when needed
3502d87a3195SmrgLIBTOOL_DEPS=$ltmain
350389b0dc75Smrg
3504d87a3195Smrg# Always use our own libtool.
3505d87a3195SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
3506d87a3195SmrgAC_SUBST(LIBTOOL)dnl
350714330f12Smrg
3508d87a3195Smrg_LT_SETUP
350914330f12Smrg
3510d87a3195Smrg# Only expand once:
3511d87a3195Smrgm4_define([LT_INIT])
3512d87a3195Smrg])# LT_INIT
351314330f12Smrg
3514d87a3195Smrg# Old names:
3515d87a3195SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
3516d87a3195SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
3517eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
3518d87a3195Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
3519d87a3195Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
352014330f12Smrg
352114330f12Smrg
3522d87a3195Smrg# _LT_PREPARE_CC_BASENAME
3523d87a3195Smrg# -----------------------
3524d87a3195Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
3525d87a3195Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
3526d87a3195Smrgfunc_cc_basename ()
3527d87a3195Smrg{
3528d87a3195Smrg    for cc_temp in @S|@*""; do
3529d87a3195Smrg      case $cc_temp in
3530d87a3195Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
3531d87a3195Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
3532d87a3195Smrg        \-*) ;;
3533d87a3195Smrg        *) break;;
3534d87a3195Smrg      esac
3535d87a3195Smrg    done
3536d87a3195Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
3537d87a3195Smrg}
3538d87a3195Smrg])# _LT_PREPARE_CC_BASENAME
353914330f12Smrg
354014330f12Smrg
3541d87a3195Smrg# _LT_CC_BASENAME(CC)
3542d87a3195Smrg# -------------------
3543d87a3195Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
3544d87a3195Smrg# but that macro is also expanded into generated libtool script, which
3545d87a3195Smrg# arranges for $SED and $ECHO to be set by different means.
3546d87a3195Smrgm4_defun([_LT_CC_BASENAME],
3547d87a3195Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
3548d87a3195SmrgAC_REQUIRE([_LT_DECL_SED])dnl
3549d87a3195SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
3550d87a3195Smrgfunc_cc_basename $1
3551d87a3195Smrgcc_basename=$func_cc_basename_result
3552d87a3195Smrg])
3553eca46af7Smrg
355414330f12Smrg
3555d87a3195Smrg# _LT_FILEUTILS_DEFAULTS
3556d87a3195Smrg# ----------------------
3557d87a3195Smrg# It is okay to use these file commands and assume they have been set
3558d87a3195Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
3559d87a3195Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
3560d87a3195Smrg[: ${CP="cp -f"}
3561d87a3195Smrg: ${MV="mv -f"}
3562d87a3195Smrg: ${RM="rm -f"}
3563d87a3195Smrg])# _LT_FILEUTILS_DEFAULTS
356414330f12Smrg
3565eca46af7Smrg
3566d87a3195Smrg# _LT_SETUP
3567d87a3195Smrg# ---------
3568d87a3195Smrgm4_defun([_LT_SETUP],
3569d87a3195Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3570d87a3195SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3571d87a3195SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
3572d87a3195SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
3573eca46af7Smrg
3574d87a3195Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
3575d87a3195Smrgdnl
3576d87a3195Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
3577d87a3195Smrg_LT_DECL([], [host], [0])dnl
3578d87a3195Smrg_LT_DECL([], [host_os], [0])dnl
3579d87a3195Smrgdnl
3580d87a3195Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
3581d87a3195Smrg_LT_DECL([], [build], [0])dnl
3582d87a3195Smrg_LT_DECL([], [build_os], [0])dnl
3583d87a3195Smrgdnl
3584d87a3195SmrgAC_REQUIRE([AC_PROG_CC])dnl
3585d87a3195SmrgAC_REQUIRE([LT_PATH_LD])dnl
3586d87a3195SmrgAC_REQUIRE([LT_PATH_NM])dnl
3587d87a3195Smrgdnl
3588d87a3195SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
3589d87a3195Smrgtest -z "$LN_S" && LN_S="ln -s"
3590d87a3195Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
3591d87a3195Smrgdnl
3592d87a3195SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
3593d87a3195Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
3594d87a3195Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
3595d87a3195Smrgdnl
3596d87a3195Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3597d87a3195Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
3598d87a3195Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
3599d87a3195Smrgm4_require([_LT_CMD_RELOAD])dnl
3600d87a3195Smrgm4_require([_LT_DECL_FILECMD])dnl
3601d87a3195Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
3602d87a3195Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
3603d87a3195Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
3604d87a3195Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
3605d87a3195Smrgm4_require([_LT_WITH_SYSROOT])dnl
3606d87a3195Smrgm4_require([_LT_CMD_TRUNCATE])dnl
3607eca46af7Smrg
3608d87a3195Smrg_LT_CONFIG_LIBTOOL_INIT([
3609d87a3195Smrg# See if we are running on zsh, and set the options that allow our
3610d87a3195Smrg# commands through without removal of \ escapes INIT.
3611d87a3195Smrgif test -n "\${ZSH_VERSION+set}"; then
3612d87a3195Smrg   setopt NO_GLOB_SUBST
3613d87a3195Smrgfi
3614d87a3195Smrg])
3615d87a3195Smrgif test -n "${ZSH_VERSION+set}"; then
3616d87a3195Smrg   setopt NO_GLOB_SUBST
3617eca46af7Smrgfi
3618eca46af7Smrg
3619d87a3195Smrg_LT_CHECK_OBJDIR
3620eca46af7Smrg
3621d87a3195Smrgm4_require([_LT_TAG_COMPILER])dnl
362214330f12Smrg
362314330f12Smrgcase $host_os in
3624d87a3195Smrgaix3*)
3625d87a3195Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
3626d87a3195Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
3627d87a3195Smrg  # vanish in a puff of smoke.
3628d87a3195Smrg  if test set != "${COLLECT_NAMES+set}"; then
3629d87a3195Smrg    COLLECT_NAMES=
3630d87a3195Smrg    export COLLECT_NAMES
3631d87a3195Smrg  fi
3632eca46af7Smrg  ;;
3633d87a3195Smrgesac
363414330f12Smrg
3635d87a3195Smrg# Global variables:
3636d87a3195Smrgofile=libtool
3637d87a3195Smrgcan_build_shared=yes
363814330f12Smrg
3639d87a3195Smrg# All known linkers require a '.a' archive for static linking (except MSVC and
3640d87a3195Smrg# ICC, which need '.lib').
3641d87a3195Smrglibext=a
3642eca46af7Smrg
3643d87a3195Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3644eca46af7Smrg
3645d87a3195Smrgold_CC=$CC
3646d87a3195Smrgold_CFLAGS=$CFLAGS
3647eca46af7Smrg
3648d87a3195Smrg# Set sane defaults for various variables
3649d87a3195Smrgtest -z "$CC" && CC=cc
3650d87a3195Smrgtest -z "$LTCC" && LTCC=$CC
3651d87a3195Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
3652d87a3195Smrgtest -z "$LD" && LD=ld
3653d87a3195Smrgtest -z "$ac_objext" && ac_objext=o
3654eca46af7Smrg
3655d87a3195Smrg_LT_CC_BASENAME([$compiler])
3656eca46af7Smrg
3657d87a3195Smrg# Only perform the check for file, if the check method requires it
3658d87a3195Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
3659d87a3195Smrgcase $deplibs_check_method in
3660d87a3195Smrgfile_magic*)
3661d87a3195Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
3662d87a3195Smrg    _LT_PATH_MAGIC
366314330f12Smrg  fi
366414330f12Smrg  ;;
3665d87a3195Smrgesac
366614330f12Smrg
3667d87a3195Smrg# Use C for the default configuration in the libtool script
3668d87a3195SmrgLT_SUPPORTED_TAG([CC])
3669d87a3195Smrg_LT_LANG_C_CONFIG
3670d87a3195Smrg_LT_LANG_DEFAULT_CONFIG
3671d87a3195Smrg_LT_CONFIG_COMMANDS
3672d87a3195Smrg])# _LT_SETUP
3673eca46af7Smrg
367414330f12Smrg
3675d87a3195Smrg# _LT_PREPARE_SED_QUOTE_VARS
3676d87a3195Smrg# --------------------------
3677d87a3195Smrg# Define a few sed substitution that help us do robust quoting.
3678d87a3195Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
3679d87a3195Smrg[# Backslashify metacharacters that are still active within
3680d87a3195Smrg# double-quoted strings.
3681d87a3195Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
368214330f12Smrg
3683d87a3195Smrg# Same as above, but do not quote variable references.
3684d87a3195Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
368514330f12Smrg
3686d87a3195Smrg# Sed substitution to delay expansion of an escaped shell variable in a
3687d87a3195Smrg# double_quote_subst'ed string.
3688d87a3195Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
368914330f12Smrg
3690d87a3195Smrg# Sed substitution to delay expansion of an escaped single quote.
3691d87a3195Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
369214330f12Smrg
3693d87a3195Smrg# Sed substitution to avoid accidental globbing in evaled expressions
3694d87a3195Smrgno_glob_subst='s/\*/\\\*/g'
3695d87a3195Smrg])
369614330f12Smrg
3697d87a3195Smrg# _LT_PROG_LTMAIN
3698d87a3195Smrg# ---------------
3699d87a3195Smrg# Note that this code is called both from 'configure', and 'config.status'
3700d87a3195Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
3701d87a3195Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
3702d87a3195Smrg# so we pass a copy along to make sure it has a sensible value anyway.
3703d87a3195Smrgm4_defun([_LT_PROG_LTMAIN],
3704d87a3195Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3705d87a3195Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3706d87a3195Smrgltmain=$ac_aux_dir/ltmain.sh
3707d87a3195Smrg])# _LT_PROG_LTMAIN
370814330f12Smrg
370914330f12Smrg
371014330f12Smrg
3711d87a3195Smrg# So that we can recreate a full libtool script including additional
3712d87a3195Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3713d87a3195Smrg# in macros and then make a single call at the end using the 'libtool'
3714d87a3195Smrg# label.
371514330f12Smrg
371614330f12Smrg
3717d87a3195Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3718d87a3195Smrg# ----------------------------------------
3719d87a3195Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3720d87a3195Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
3721d87a3195Smrg[m4_ifval([$1],
3722d87a3195Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3723d87a3195Smrg                     [$1
3724d87a3195Smrg])])])
372514330f12Smrg
3726d87a3195Smrg# Initialize.
3727d87a3195Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
372814330f12Smrg
372914330f12Smrg
3730d87a3195Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3731d87a3195Smrg# ------------------------------
3732d87a3195Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3733d87a3195Smrgm4_define([_LT_CONFIG_LIBTOOL],
3734d87a3195Smrg[m4_ifval([$1],
3735d87a3195Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3736d87a3195Smrg                     [$1
3737d87a3195Smrg])])])
373814330f12Smrg
3739d87a3195Smrg# Initialize.
3740d87a3195Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
374114330f12Smrg
3742eca46af7Smrg
3743d87a3195Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3744d87a3195Smrg# -----------------------------------------------------
3745d87a3195Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3746d87a3195Smrg[_LT_CONFIG_LIBTOOL([$1])
3747d87a3195Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3748d87a3195Smrg])
3749eca46af7Smrg
3750eca46af7Smrg
3751d87a3195Smrg# _LT_FORMAT_COMMENT([COMMENT])
3752d87a3195Smrg# -----------------------------
3753d87a3195Smrg# Add leading comment marks to the start of each line, and a trailing
3754d87a3195Smrg# full-stop to the whole comment if one is not present already.
3755d87a3195Smrgm4_define([_LT_FORMAT_COMMENT],
3756d87a3195Smrg[m4_ifval([$1], [
3757d87a3195Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3758d87a3195Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3759d87a3195Smrg)])
3760eca46af7Smrg
3761eca46af7Smrg
3762eca46af7Smrg
3763d87a3195Smrg
3764d87a3195Smrg
3765d87a3195Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3766d87a3195Smrg# -------------------------------------------------------------------
3767d87a3195Smrg# CONFIGNAME is the name given to the value in the libtool script.
3768d87a3195Smrg# VARNAME is the (base) name used in the configure script.
3769d87a3195Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3770d87a3195Smrg# VARNAME.  Any other value will be used directly.
3771d87a3195Smrgm4_define([_LT_DECL],
3772d87a3195Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3773d87a3195Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3774d87a3195Smrg	[m4_ifval([$1], [$1], [$2])])
3775d87a3195Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3776d87a3195Smrg    m4_ifval([$4],
3777d87a3195Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3778d87a3195Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3779d87a3195Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3780eca46af7Smrg])
378114330f12Smrg
378214330f12Smrg
3783d87a3195Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3784d87a3195Smrg# --------------------------------------------------------
3785d87a3195Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
378614330f12Smrg
378714330f12Smrg
3788d87a3195Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3789d87a3195Smrg# ------------------------------------------------
3790d87a3195Smrgm4_define([lt_decl_tag_varnames],
3791d87a3195Smrg[_lt_decl_filter([tagged?], [yes], $@)])
379214330f12Smrg
379314330f12Smrg
3794d87a3195Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3795d87a3195Smrg# ---------------------------------------------------------
3796d87a3195Smrgm4_define([_lt_decl_filter],
3797d87a3195Smrg[m4_case([$#],
3798d87a3195Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
3799d87a3195Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
3800d87a3195Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3801d87a3195Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3802d87a3195Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3803d87a3195Smrg])
380414330f12Smrg
38052378475aSmrg
3806d87a3195Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
3807d87a3195Smrg# --------------------------------------------------
3808d87a3195Smrgm4_define([lt_decl_quote_varnames],
3809d87a3195Smrg[_lt_decl_filter([value], [1], $@)])
381014330f12Smrg
381114330f12Smrg
3812d87a3195Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
3813d87a3195Smrg# ---------------------------------------------------
3814d87a3195Smrgm4_define([lt_decl_dquote_varnames],
3815d87a3195Smrg[_lt_decl_filter([value], [2], $@)])
381614330f12Smrg
381714330f12Smrg
3818d87a3195Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
3819d87a3195Smrg# ---------------------------------------------------
3820d87a3195Smrgm4_define([lt_decl_varnames_tagged],
3821d87a3195Smrg[m4_assert([$# <= 2])dnl
3822d87a3195Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
3823d87a3195Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
3824d87a3195Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
3825d87a3195Smrgm4_define([_lt_decl_varnames_tagged],
3826d87a3195Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
382714330f12Smrg
382814330f12Smrg
3829d87a3195Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
3830d87a3195Smrg# ------------------------------------------------
3831d87a3195Smrgm4_define([lt_decl_all_varnames],
3832d87a3195Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
3833d87a3195Smrg     m4_if([$2], [],
3834d87a3195Smrg	   m4_quote(lt_decl_varnames),
3835d87a3195Smrg	m4_quote(m4_shift($@))))[]dnl
3836d87a3195Smrg])
3837d87a3195Smrgm4_define([_lt_decl_all_varnames],
3838d87a3195Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
3839d87a3195Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
3840d87a3195Smrg])
3841eca46af7Smrg
3842eca46af7Smrg
3843d87a3195Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
3844d87a3195Smrg# ------------------------------------
3845d87a3195Smrg# Quote a variable value, and forward it to 'config.status' so that its
3846d87a3195Smrg# declaration there will have the same value as in 'configure'.  VARNAME
3847d87a3195Smrg# must have a single quote delimited value for this to work.
3848d87a3195Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
3849d87a3195Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
3850eca46af7Smrg
3851eca46af7Smrg
3852d87a3195Smrg# _LT_CONFIG_STATUS_DECLARATIONS
3853d87a3195Smrg# ------------------------------
3854d87a3195Smrg# We delimit libtool config variables with single quotes, so when
3855d87a3195Smrg# we write them to config.status, we have to be sure to quote all
3856d87a3195Smrg# embedded single quotes properly.  In configure, this macro expands
3857d87a3195Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
3858d87a3195Smrg#
3859d87a3195Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
3860d87a3195Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
3861d87a3195Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
3862d87a3195Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
3863eca46af7Smrg
38642378475aSmrg
3865d87a3195Smrg# _LT_LIBTOOL_TAGS
3866d87a3195Smrg# ----------------
3867d87a3195Smrg# Output comment and list of tags supported by the script
3868d87a3195Smrgm4_defun([_LT_LIBTOOL_TAGS],
3869d87a3195Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
3870d87a3195Smrgavailable_tags='_LT_TAGS'dnl
3871d87a3195Smrg])
38722378475aSmrg
38732378475aSmrg
3874d87a3195Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
3875d87a3195Smrg# -----------------------------------
3876d87a3195Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
3877d87a3195Smrg# expand to a commented shell variable setting:
3878d87a3195Smrg#
3879d87a3195Smrg#    # Some comment about what VAR is for.
3880d87a3195Smrg#    visible_name=$lt_internal_name
3881d87a3195Smrgm4_define([_LT_LIBTOOL_DECLARE],
3882d87a3195Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
3883d87a3195Smrg					   [description])))[]dnl
3884d87a3195Smrgm4_pushdef([_libtool_name],
3885d87a3195Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
3886d87a3195Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
3887d87a3195Smrg    [0], [_libtool_name=[$]$1],
3888d87a3195Smrg    [1], [_libtool_name=$lt_[]$1],
3889d87a3195Smrg    [2], [_libtool_name=$lt_[]$1],
3890d87a3195Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
3891d87a3195Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
3892d87a3195Smrg])
3893eca46af7Smrg
38942378475aSmrg
3895d87a3195Smrg# _LT_LIBTOOL_CONFIG_VARS
3896d87a3195Smrg# -----------------------
3897d87a3195Smrg# Produce commented declarations of non-tagged libtool config variables
3898d87a3195Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
3899d87a3195Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
3900d87a3195Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
3901d87a3195Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
3902d87a3195Smrg[m4_foreach([_lt_var],
3903d87a3195Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
3904d87a3195Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
39052378475aSmrg
390614330f12Smrg
3907d87a3195Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
3908d87a3195Smrg# -------------------------
3909d87a3195Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
3910d87a3195Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
3911d87a3195Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
391214330f12Smrg
39132378475aSmrg
3914d87a3195Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
3915d87a3195Smrg# ------------------------------
3916d87a3195Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
39172378475aSmrg
391814330f12Smrg
3919d87a3195Smrg# _LT_CONFIG_COMMANDS
3920d87a3195Smrg# -------------------
3921d87a3195Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
3922d87a3195Smrg# variables for single and double quote escaping we saved from calls
3923d87a3195Smrg# to _LT_DECL, we can put quote escaped variables declarations
3924d87a3195Smrg# into 'config.status', and then the shell code to quote escape them in
3925d87a3195Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
3926d87a3195Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
3927d87a3195Smrgm4_defun([_LT_CONFIG_COMMANDS],
3928d87a3195Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
3929d87a3195Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
3930d87a3195Smrg	dnl instead of duplicating it all over again into config.status,
3931d87a3195Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
3932d87a3195Smrg	dnl needs to know what name is stored there:
3933d87a3195Smrg        [AC_CONFIG_COMMANDS([libtool],
3934d87a3195Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
3935d87a3195Smrg    dnl If the libtool generation code is destined for config.status,
3936d87a3195Smrg    dnl expand the accumulated commands and init code now:
3937d87a3195Smrg    [AC_CONFIG_COMMANDS([libtool],
3938d87a3195Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
3939d87a3195Smrg])#_LT_CONFIG_COMMANDS
394014330f12Smrg
3941ff89ac2bSmrg
3942d87a3195Smrg# Initialize.
3943d87a3195Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
3944d87a3195Smrg[
3945ff89ac2bSmrg
3946d87a3195Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
3947d87a3195Smrg# if CDPATH is set.
3948d87a3195Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
394995b296d0Smrg
3950d87a3195Smrgsed_quote_subst='$sed_quote_subst'
3951d87a3195Smrgdouble_quote_subst='$double_quote_subst'
3952d87a3195Smrgdelay_variable_subst='$delay_variable_subst'
3953d87a3195Smrg_LT_CONFIG_STATUS_DECLARATIONS
3954d87a3195SmrgLTCC='$LTCC'
3955d87a3195SmrgLTCFLAGS='$LTCFLAGS'
3956d87a3195Smrgcompiler='$compiler_DEFAULT'
395795b296d0Smrg
3958d87a3195Smrg# A function that is used when there is no print builtin or printf.
3959d87a3195Smrgfunc_fallback_echo ()
3960eca46af7Smrg{
3961d87a3195Smrg  eval 'cat <<_LTECHO_EOF
3962d87a3195Smrg\$[]1
3963d87a3195Smrg_LTECHO_EOF'
3964eca46af7Smrg}
396514330f12Smrg
3966d87a3195Smrg# Quote evaled strings.
3967d87a3195Smrgfor var in lt_decl_all_varnames([[ \
3968d87a3195Smrg]], lt_decl_quote_varnames); do
3969d87a3195Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
3970d87a3195Smrg    *[[\\\\\\\`\\"\\\$]]*)
3971d87a3195Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
3972d87a3195Smrg      ;;
3973d87a3195Smrg    *)
3974d87a3195Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
3975d87a3195Smrg      ;;
3976d87a3195Smrg    esac
3977d87a3195Smrgdone
397895b296d0Smrg
3979d87a3195Smrg# Double-quote double-evaled strings.
3980d87a3195Smrgfor var in lt_decl_all_varnames([[ \
3981d87a3195Smrg]], lt_decl_dquote_varnames); do
3982d87a3195Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
3983d87a3195Smrg    *[[\\\\\\\`\\"\\\$]]*)
3984d87a3195Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
3985d87a3195Smrg      ;;
3986d87a3195Smrg    *)
3987d87a3195Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
3988d87a3195Smrg      ;;
3989d87a3195Smrg    esac
3990d87a3195Smrgdone
3991d87a3195Smrg
3992d87a3195Smrg_LT_OUTPUT_LIBTOOL_INIT
3993d87a3195Smrg])
3994d87a3195Smrg
3995d87a3195Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
3996d87a3195Smrg# ------------------------------------
3997d87a3195Smrg# Generate a child script FILE with all initialization necessary to
3998d87a3195Smrg# reuse the environment learned by the parent script, and make the
3999d87a3195Smrg# file executable.  If COMMENT is supplied, it is inserted after the
4000d87a3195Smrg# '#!' sequence but before initialization text begins.  After this
4001d87a3195Smrg# macro, additional text can be appended to FILE to form the body of
4002d87a3195Smrg# the child script.  The macro ends with non-zero status if the
4003d87a3195Smrg# file could not be fully written (such as if the disk is full).
4004d87a3195Smrgm4_ifdef([AS_INIT_GENERATED],
4005d87a3195Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
4006d87a3195Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
4007d87a3195Smrg[m4_require([AS_PREPARE])]dnl
4008d87a3195Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
4009d87a3195Smrg[lt_write_fail=0
4010d87a3195Smrgcat >$1 <<_ASEOF || lt_write_fail=1
4011d87a3195Smrg#! $SHELL
4012d87a3195Smrg# Generated by $as_me.
4013d87a3195Smrg$2
4014d87a3195SmrgSHELL=\${CONFIG_SHELL-$SHELL}
4015d87a3195Smrgexport SHELL
4016d87a3195Smrg_ASEOF
4017d87a3195Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
4018d87a3195SmrgAS_SHELL_SANITIZE
4019d87a3195Smrg_AS_PREPARE
4020d87a3195Smrgexec AS_MESSAGE_FD>&1
4021d87a3195Smrg_ASEOF
4022d87a3195Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
4023d87a3195Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
4024d87a3195Smrg
4025d87a3195Smrg# LT_OUTPUT
4026d87a3195Smrg# ---------
4027d87a3195Smrg# This macro allows early generation of the libtool script (before
4028d87a3195Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
4029d87a3195Smrg# tests.
4030d87a3195SmrgAC_DEFUN([LT_OUTPUT],
4031d87a3195Smrg[: ${CONFIG_LT=./config.lt}
4032d87a3195SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
4033d87a3195Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
4034d87a3195Smrg[# Run this file to recreate a libtool stub with the current configuration.])
4035d87a3195Smrg
4036d87a3195Smrgcat >>"$CONFIG_LT" <<\_LTEOF
4037d87a3195Smrglt_cl_silent=false
4038d87a3195Smrgexec AS_MESSAGE_LOG_FD>>config.log
4039d87a3195Smrg{
4040d87a3195Smrg  echo
4041d87a3195Smrg  AS_BOX([Running $as_me.])
4042d87a3195Smrg} >&AS_MESSAGE_LOG_FD
4043d87a3195Smrg
4044d87a3195Smrglt_cl_help="\
4045d87a3195Smrg'$as_me' creates a local libtool stub from the current configuration,
4046d87a3195Smrgfor use in further configure time tests before the real libtool is
4047d87a3195Smrggenerated.
4048d87a3195Smrg
4049d87a3195SmrgUsage: $[0] [[OPTIONS]]
4050d87a3195Smrg
4051d87a3195Smrg  -h, --help      print this help, then exit
4052d87a3195Smrg  -V, --version   print version number, then exit
4053d87a3195Smrg  -q, --quiet     do not print progress messages
4054d87a3195Smrg  -d, --debug     don't remove temporary files
4055d87a3195Smrg
4056d87a3195SmrgReport bugs to <bug-libtool@gnu.org>."
4057d87a3195Smrg
4058d87a3195Smrglt_cl_version="\
4059d87a3195Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
4060d87a3195Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
4061d87a3195Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
4062d87a3195Smrg
4063d87a3195SmrgCopyright (C) 2011 Free Software Foundation, Inc.
4064d87a3195SmrgThis config.lt script is free software; the Free Software Foundation
4065d87a3195Smrggives unlimited permision to copy, distribute and modify it."
4066d87a3195Smrg
4067d87a3195Smrgwhile test 0 != $[#]
4068d87a3195Smrgdo
4069d87a3195Smrg  case $[1] in
4070d87a3195Smrg    --version | --v* | -V )
4071d87a3195Smrg      echo "$lt_cl_version"; exit 0 ;;
4072d87a3195Smrg    --help | --h* | -h )
4073d87a3195Smrg      echo "$lt_cl_help"; exit 0 ;;
4074d87a3195Smrg    --debug | --d* | -d )
4075d87a3195Smrg      debug=: ;;
4076d87a3195Smrg    --quiet | --q* | --silent | --s* | -q )
4077d87a3195Smrg      lt_cl_silent=: ;;
4078d87a3195Smrg
4079d87a3195Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
4080d87a3195SmrgTry '$[0] --help' for more information.]) ;;
4081d87a3195Smrg
4082d87a3195Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
4083d87a3195SmrgTry '$[0] --help' for more information.]) ;;
4084d87a3195Smrg  esac
4085d87a3195Smrg  shift
4086d87a3195Smrgdone
4087d87a3195Smrg
4088d87a3195Smrgif $lt_cl_silent; then
4089d87a3195Smrg  exec AS_MESSAGE_FD>/dev/null
4090eca46af7Smrgfi
4091d87a3195Smrg_LTEOF
409295b296d0Smrg
4093d87a3195Smrgcat >>"$CONFIG_LT" <<_LTEOF
4094d87a3195Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
4095d87a3195Smrg_LTEOF
409695b296d0Smrg
4097d87a3195Smrgcat >>"$CONFIG_LT" <<\_LTEOF
4098d87a3195SmrgAC_MSG_NOTICE([creating $ofile])
4099d87a3195Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
4100d87a3195SmrgAS_EXIT(0)
4101d87a3195Smrg_LTEOF
4102d87a3195Smrgchmod +x "$CONFIG_LT"
410395b296d0Smrg
4104d87a3195Smrg# configure is writing to config.log, but config.lt does its own redirection,
4105d87a3195Smrg# appending to config.log, which fails on DOS, as config.log is still kept
4106d87a3195Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
4107d87a3195Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
4108d87a3195Smrglt_cl_success=:
4109d87a3195Smrgtest yes = "$silent" &&
4110d87a3195Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
4111d87a3195Smrgexec AS_MESSAGE_LOG_FD>/dev/null
4112d87a3195Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
4113d87a3195Smrgexec AS_MESSAGE_LOG_FD>>config.log
4114d87a3195Smrg$lt_cl_success || AS_EXIT(1)
4115d87a3195Smrg])# LT_OUTPUT
411695b296d0Smrg
411795b296d0Smrg
4118d87a3195Smrg# _LT_CONFIG(TAG)
4119d87a3195Smrg# ---------------
4120d87a3195Smrg# If TAG is the built-in tag, create an initial libtool script with a
4121d87a3195Smrg# default configuration from the untagged config vars.  Otherwise add code
4122d87a3195Smrg# to config.status for appending the configuration named by TAG from the
4123d87a3195Smrg# matching tagged config vars.
4124d87a3195Smrgm4_defun([_LT_CONFIG],
4125d87a3195Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4126d87a3195Smrg_LT_CONFIG_SAVE_COMMANDS([
4127d87a3195Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
4128d87a3195Smrg  m4_if(_LT_TAG, [C], [
4129d87a3195Smrg    # See if we are running on zsh, and set the options that allow our
4130d87a3195Smrg    # commands through without removal of \ escapes.
4131d87a3195Smrg    if test -n "${ZSH_VERSION+set}"; then
4132d87a3195Smrg      setopt NO_GLOB_SUBST
4133d87a3195Smrg    fi
413495b296d0Smrg
4135d87a3195Smrg    cfgfile=${ofile}T
4136d87a3195Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
4137d87a3195Smrg    $RM "$cfgfile"
413814330f12Smrg
4139d87a3195Smrg    cat <<_LT_EOF >> "$cfgfile"
4140d87a3195Smrg#! $SHELL
4141d87a3195Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
4142d87a3195Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4143d87a3195Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
414495b296d0Smrg
4145d87a3195Smrg# Provide generalized library-building support services.
4146d87a3195Smrg# Written by Gordon Matzigkeit, 1996
414795b296d0Smrg
4148d87a3195Smrg_LT_COPYING
4149d87a3195Smrg_LT_LIBTOOL_TAGS
4150eca46af7Smrg
4151d87a3195Smrg# Configured defaults for sys_lib_dlsearch_path munging.
4152d87a3195Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
415314330f12Smrg
4154d87a3195Smrg# ### BEGIN LIBTOOL CONFIG
4155d87a3195Smrg_LT_LIBTOOL_CONFIG_VARS
4156d87a3195Smrg_LT_LIBTOOL_TAG_VARS
4157d87a3195Smrg# ### END LIBTOOL CONFIG
415895b296d0Smrg
4159d87a3195Smrg_LT_EOF
416095b296d0Smrg
4161d87a3195Smrg    cat <<'_LT_EOF' >> "$cfgfile"
416295b296d0Smrg
4163d87a3195Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
416495b296d0Smrg
4165d87a3195Smrg_LT_PREPARE_MUNGE_PATH_LIST
4166d87a3195Smrg_LT_PREPARE_CC_BASENAME
416795b296d0Smrg
4168d87a3195Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
41692378475aSmrg
417014330f12Smrg_LT_EOF
41712378475aSmrg
4172d87a3195Smrg  case $host_os in
4173d87a3195Smrg  aix3*)
4174d87a3195Smrg    cat <<\_LT_EOF >> "$cfgfile"
4175d87a3195Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
4176d87a3195Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
4177d87a3195Smrg# vanish in a puff of smoke.
4178d87a3195Smrgif test set != "${COLLECT_NAMES+set}"; then
4179d87a3195Smrg  COLLECT_NAMES=
4180d87a3195Smrg  export COLLECT_NAMES
4181d87a3195Smrgfi
418214330f12Smrg_LT_EOF
4183d87a3195Smrg    ;;
4184d87a3195Smrg  esac
418514330f12Smrg
4186d87a3195Smrg  _LT_PROG_LTMAIN
4187d87a3195Smrg
4188d87a3195Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
4189d87a3195Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4190d87a3195Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
4191d87a3195Smrg  # is reportedly fixed, but why not run on old versions too?
4192d87a3195Smrg  $SED '$q' "$ltmain" >> "$cfgfile" \
4193d87a3195Smrg     || (rm -f "$cfgfile"; exit 1)
419414330f12Smrg
4195d87a3195Smrg   mv -f "$cfgfile" "$ofile" ||
4196d87a3195Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4197d87a3195Smrg  chmod +x "$ofile"
4198d87a3195Smrg],
4199d87a3195Smrg[cat <<_LT_EOF >> "$ofile"
420014330f12Smrg
4201d87a3195Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
4202d87a3195Smrgdnl in a comment (ie after a #).
4203d87a3195Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
4204d87a3195Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
4205d87a3195Smrg# ### END LIBTOOL TAG CONFIG: $1
4206d87a3195Smrg_LT_EOF
4207d87a3195Smrg])dnl /m4_if
4208d87a3195Smrg],
4209d87a3195Smrg[m4_if([$1], [], [
4210d87a3195Smrg    PACKAGE='$PACKAGE'
4211d87a3195Smrg    VERSION='$VERSION'
4212d87a3195Smrg    RM='$RM'
4213d87a3195Smrg    ofile='$ofile'], [])
4214d87a3195Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
4215d87a3195Smrg])# _LT_CONFIG
42162378475aSmrg
421795b296d0Smrg
4218d87a3195Smrg# LT_SUPPORTED_TAG(TAG)
4219d87a3195Smrg# ---------------------
4220d87a3195Smrg# Trace this macro to discover what tags are supported by the libtool
4221d87a3195Smrg# --tag option, using:
4222d87a3195Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
4223d87a3195SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
42242378475aSmrg
42252378475aSmrg
4226d87a3195Smrg# C support is built-in for now
4227d87a3195Smrgm4_define([_LT_LANG_C_enabled], [])
4228d87a3195Smrgm4_define([_LT_TAGS], [])
42292378475aSmrg
423095b296d0Smrg
4231d87a3195Smrg# LT_LANG(LANG)
4232d87a3195Smrg# -------------
4233d87a3195Smrg# Enable libtool support for the given language if not already enabled.
4234d87a3195SmrgAC_DEFUN([LT_LANG],
4235d87a3195Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
4236d87a3195Smrgm4_case([$1],
4237d87a3195Smrg  [C],			[_LT_LANG(C)],
4238d87a3195Smrg  [C++],		[_LT_LANG(CXX)],
4239d87a3195Smrg  [Go],			[_LT_LANG(GO)],
4240d87a3195Smrg  [Java],		[_LT_LANG(GCJ)],
4241d87a3195Smrg  [Fortran 77],		[_LT_LANG(F77)],
4242d87a3195Smrg  [Fortran],		[_LT_LANG(FC)],
4243d87a3195Smrg  [Windows Resource],	[_LT_LANG(RC)],
4244d87a3195Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
4245d87a3195Smrg    [_LT_LANG($1)],
4246d87a3195Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
4247d87a3195Smrg])# LT_LANG
424895b296d0Smrg
424995b296d0Smrg
4250d87a3195Smrg# _LT_LANG(LANGNAME)
4251d87a3195Smrg# ------------------
4252d87a3195Smrgm4_defun([_LT_LANG],
4253d87a3195Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
4254d87a3195Smrg  [LT_SUPPORTED_TAG([$1])dnl
4255d87a3195Smrg  m4_append([_LT_TAGS], [$1 ])dnl
4256d87a3195Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
4257d87a3195Smrg  _LT_LANG_$1_CONFIG($1)])dnl
4258d87a3195Smrg])# _LT_LANG
4259d87a3195Smrg
42602378475aSmrg
4261d87a3195Smrgm4_ifndef([AC_PROG_GO], [
4262d87a3195Smrg# NOTE: This macro has been submitted for inclusion into   #
4263d87a3195Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
4264d87a3195Smrg#  a released version of Autoconf we should remove this    #
4265d87a3195Smrg#  macro and use it instead.                               #
4266d87a3195Smrgm4_defun([AC_PROG_GO],
4267d87a3195Smrg[AC_LANG_PUSH(Go)dnl
4268d87a3195SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
4269d87a3195SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
4270d87a3195Smrg_AC_ARG_VAR_LDFLAGS()dnl
4271d87a3195SmrgAC_CHECK_TOOL(GOC, gccgo)
4272d87a3195Smrgif test -z "$GOC"; then
4273d87a3195Smrg  if test -n "$ac_tool_prefix"; then
4274d87a3195Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
4275d87a3195Smrg  fi
4276d87a3195Smrgfi
4277d87a3195Smrgif test -z "$GOC"; then
4278d87a3195Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
4279d87a3195Smrgfi
4280d87a3195Smrg])#m4_defun
4281d87a3195Smrg])#m4_ifndef
42822378475aSmrg
428395b296d0Smrg
4284d87a3195Smrg# _LT_LANG_DEFAULT_CONFIG
4285d87a3195Smrg# -----------------------
4286d87a3195Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
4287d87a3195Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
4288d87a3195Smrg  [LT_LANG(CXX)],
4289d87a3195Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
429095b296d0Smrg
4291d87a3195SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
4292d87a3195Smrg  [LT_LANG(F77)],
4293d87a3195Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
429495b296d0Smrg
4295d87a3195SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
4296d87a3195Smrg  [LT_LANG(FC)],
4297d87a3195Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
429895b296d0Smrg
4299d87a3195Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
4300d87a3195Smrgdnl pulling things in needlessly.
4301d87a3195SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
4302d87a3195Smrg  [LT_LANG(GCJ)],
4303d87a3195Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
4304d87a3195Smrg    [LT_LANG(GCJ)],
4305d87a3195Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
4306d87a3195Smrg      [LT_LANG(GCJ)],
4307d87a3195Smrg      [m4_ifdef([AC_PROG_GCJ],
4308d87a3195Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
4309d87a3195Smrg       m4_ifdef([A][M_PROG_GCJ],
4310d87a3195Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
4311d87a3195Smrg       m4_ifdef([LT_PROG_GCJ],
4312d87a3195Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
431395b296d0Smrg
4314d87a3195SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
4315d87a3195Smrg  [LT_LANG(GO)],
4316d87a3195Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
43172378475aSmrg
4318d87a3195SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
4319d87a3195Smrg  [LT_LANG(RC)],
4320d87a3195Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
4321d87a3195Smrg])# _LT_LANG_DEFAULT_CONFIG
43222378475aSmrg
4323d87a3195Smrg# Obsolete macros:
4324d87a3195SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
4325d87a3195SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
4326d87a3195SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
4327d87a3195SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
4328d87a3195SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
4329d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
4330d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
4331d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
4332d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
4333d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
4334d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
43352378475aSmrg
433695b296d0Smrg
4337d87a3195Smrg# _LT_TAG_COMPILER
4338d87a3195Smrg# ----------------
4339d87a3195Smrgm4_defun([_LT_TAG_COMPILER],
4340d87a3195Smrg[AC_REQUIRE([AC_PROG_CC])dnl
4341d87a3195Smrg
4342d87a3195Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
4343d87a3195Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
4344d87a3195Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
4345d87a3195Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
434695b296d0Smrg
4347d87a3195Smrg# If no C compiler was specified, use CC.
4348d87a3195SmrgLTCC=${LTCC-"$CC"}
43492378475aSmrg
4350d87a3195Smrg# If no C compiler flags were specified, use CFLAGS.
4351d87a3195SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
43522378475aSmrg
4353d87a3195Smrg# Allow CC to be a program name with arguments.
4354d87a3195Smrgcompiler=$CC
4355d87a3195Smrg])# _LT_TAG_COMPILER
43562378475aSmrg
4357eca46af7Smrg
4358d87a3195Smrg# _LT_COMPILER_BOILERPLATE
4359d87a3195Smrg# ------------------------
4360d87a3195Smrg# Check for compiler boilerplate output or warnings with
4361d87a3195Smrg# the simple compiler test code.
4362d87a3195Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
4363d87a3195Smrg[m4_require([_LT_DECL_SED])dnl
4364d87a3195Smrgac_outfile=conftest.$ac_objext
4365d87a3195Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
4366d87a3195Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
4367d87a3195Smrg_lt_compiler_boilerplate=`cat conftest.err`
4368d87a3195Smrg$RM conftest*
4369d87a3195Smrg])# _LT_COMPILER_BOILERPLATE
437095b296d0Smrg
437195b296d0Smrg
4372d87a3195Smrg# _LT_LINKER_BOILERPLATE
4373d87a3195Smrg# ----------------------
4374d87a3195Smrg# Check for linker boilerplate output or warnings with
4375d87a3195Smrg# the simple link test code.
4376d87a3195Smrgm4_defun([_LT_LINKER_BOILERPLATE],
4377d87a3195Smrg[m4_require([_LT_DECL_SED])dnl
4378d87a3195Smrgac_outfile=conftest.$ac_objext
4379d87a3195Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
4380d87a3195Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
4381d87a3195Smrg_lt_linker_boilerplate=`cat conftest.err`
4382d87a3195Smrg$RM -r conftest*
4383d87a3195Smrg])# _LT_LINKER_BOILERPLATE
438495b296d0Smrg
4385d87a3195Smrg# _LT_REQUIRED_DARWIN_CHECKS
4386d87a3195Smrg# -------------------------
4387d87a3195Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
4388d87a3195Smrg  case $host_os in
4389d87a3195Smrg    rhapsody* | darwin*)
4390d87a3195Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
4391d87a3195Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
4392d87a3195Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
4393d87a3195Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
4394d87a3195Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
4395d87a3195Smrg    _LT_DECL([], [DSYMUTIL], [1],
4396d87a3195Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
4397d87a3195Smrg    _LT_DECL([], [NMEDIT], [1],
4398d87a3195Smrg      [Tool to change global to local symbols on Mac OS X])
4399d87a3195Smrg    _LT_DECL([], [LIPO], [1],
4400d87a3195Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
4401d87a3195Smrg    _LT_DECL([], [OTOOL], [1],
4402d87a3195Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
4403d87a3195Smrg    _LT_DECL([], [OTOOL64], [1],
4404d87a3195Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
4405d87a3195Smrg
4406d87a3195Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
4407d87a3195Smrg      [lt_cv_apple_cc_single_mod=no
4408d87a3195Smrg      if test -z "$LT_MULTI_MODULE"; then
4409d87a3195Smrg	# By default we will add the -single_module flag. You can override
4410d87a3195Smrg	# by either setting the environment variable LT_MULTI_MODULE
4411d87a3195Smrg	# non-empty at configure time, or by adding -multi_module to the
4412d87a3195Smrg	# link flags.
4413d87a3195Smrg	rm -rf libconftest.dylib*
4414d87a3195Smrg	echo "int foo(void){return 1;}" > conftest.c
4415d87a3195Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
4416d87a3195Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
4417d87a3195Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
4418d87a3195Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
4419d87a3195Smrg        _lt_result=$?
4420d87a3195Smrg	# If there is a non-empty error log, and "single_module"
4421d87a3195Smrg	# appears in it, assume the flag caused a linker warning
4422d87a3195Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
4423d87a3195Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
4424d87a3195Smrg	# Otherwise, if the output was created with a 0 exit code from
4425d87a3195Smrg	# the compiler, it worked.
4426d87a3195Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
4427d87a3195Smrg	  lt_cv_apple_cc_single_mod=yes
442814330f12Smrg	else
4429d87a3195Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
443014330f12Smrg	fi
4431d87a3195Smrg	rm -rf libconftest.dylib*
4432d87a3195Smrg	rm -f conftest.*
4433d87a3195Smrg      fi])
4434d87a3195Smrg
4435d87a3195Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
4436d87a3195Smrg      [lt_cv_ld_exported_symbols_list],
4437d87a3195Smrg      [lt_cv_ld_exported_symbols_list=no
4438d87a3195Smrg      save_LDFLAGS=$LDFLAGS
4439d87a3195Smrg      echo "_main" > conftest.sym
4440d87a3195Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
4441d87a3195Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
4442d87a3195Smrg	[lt_cv_ld_exported_symbols_list=yes],
4443d87a3195Smrg	[lt_cv_ld_exported_symbols_list=no])
4444d87a3195Smrg	LDFLAGS=$save_LDFLAGS
4445d87a3195Smrg    ])
4446d87a3195Smrg
4447d87a3195Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
4448d87a3195Smrg      [lt_cv_ld_force_load=no
4449d87a3195Smrg      cat > conftest.c << _LT_EOF
4450d87a3195Smrgint forced_loaded() { return 2;}
4451d87a3195Smrg_LT_EOF
4452d87a3195Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
4453d87a3195Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
4454d87a3195Smrg      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
4455d87a3195Smrg      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
4456d87a3195Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
4457d87a3195Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
4458d87a3195Smrg      cat > conftest.c << _LT_EOF
4459d87a3195Smrgint main() { return 0;}
4460d87a3195Smrg_LT_EOF
4461d87a3195Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
4462d87a3195Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
4463d87a3195Smrg      _lt_result=$?
4464d87a3195Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
4465d87a3195Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
4466d87a3195Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
4467d87a3195Smrg	lt_cv_ld_force_load=yes
446814330f12Smrg      else
4469d87a3195Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
447014330f12Smrg      fi
4471d87a3195Smrg        rm -f conftest.err libconftest.a conftest conftest.c
4472d87a3195Smrg        rm -rf conftest.dSYM
4473d87a3195Smrg    ])
4474d87a3195Smrg    case $host_os in
4475d87a3195Smrg    rhapsody* | darwin1.[[012]])
4476d87a3195Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
4477d87a3195Smrg    darwin1.*)
4478d87a3195Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
4479d87a3195Smrg    darwin*)
4480d87a3195Smrg      case $MACOSX_DEPLOYMENT_TARGET,$host in
4481d87a3195Smrg        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
4482d87a3195Smrg          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
4483d87a3195Smrg        *)
4484d87a3195Smrg          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
4485d87a3195Smrg      esac
4486d87a3195Smrg    ;;
4487d87a3195Smrg  esac
4488d87a3195Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
4489d87a3195Smrg      _lt_dar_single_mod='$single_module'
4490d87a3195Smrg    fi
4491d87a3195Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
4492d87a3195Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
4493d87a3195Smrg    else
4494d87a3195Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
4495d87a3195Smrg    fi
4496d87a3195Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
4497d87a3195Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
4498d87a3195Smrg    else
4499d87a3195Smrg      _lt_dsymutil=
4500d87a3195Smrg    fi
4501d87a3195Smrg    ;;
4502d87a3195Smrg  esac
4503d87a3195Smrg])
4504d87a3195Smrg
4505d87a3195Smrg
4506d87a3195Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
4507d87a3195Smrg# ---------------------------------
4508d87a3195Smrg# Checks for linker and compiler features on darwin
4509d87a3195Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
4510d87a3195Smrg[
4511d87a3195Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
4512d87a3195Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
4513d87a3195Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4514d87a3195Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
4515d87a3195Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4516d87a3195Smrg  if test yes = "$lt_cv_ld_force_load"; then
4517d87a3195Smrg    _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\"`'
4518d87a3195Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
4519d87a3195Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
4520d87a3195Smrg  else
4521d87a3195Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
4522d87a3195Smrg  fi
4523d87a3195Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
4524d87a3195Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
4525d87a3195Smrg  case $cc_basename in
4526d87a3195Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
4527d87a3195Smrg     *) _lt_dar_can_shared=$GCC ;;
4528d87a3195Smrg  esac
4529d87a3195Smrg  if test yes = "$_lt_dar_can_shared"; then
4530d87a3195Smrg    output_verbose_link_cmd=func_echo_all
4531d87a3195Smrg    _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"
4532d87a3195Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
4533d87a3195Smrg    _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"
4534d87a3195Smrg    _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"
4535d87a3195Smrg    m4_if([$1], [CXX],
4536d87a3195Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
4537d87a3195Smrg      _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"
4538d87a3195Smrg      _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"
4539d87a3195Smrg    fi
4540d87a3195Smrg],[])
4541d87a3195Smrg  else
4542d87a3195Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
4543d87a3195Smrg  fi
4544d87a3195Smrg])
45452378475aSmrg
4546d87a3195Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
4547d87a3195Smrg# ----------------------------------
4548d87a3195Smrg# Links a minimal program and checks the executable
4549d87a3195Smrg# for the system default hardcoded library path. In most cases,
4550d87a3195Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
4551d87a3195Smrg# the location of the communication and MPI libs are included too.
4552d87a3195Smrg# If we don't find anything, use the default library path according
4553d87a3195Smrg# to the aix ld manual.
4554d87a3195Smrg# Store the results from the different compilers for each TAGNAME.
4555d87a3195Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
4556d87a3195Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
4557d87a3195Smrg[m4_require([_LT_DECL_SED])dnl
4558d87a3195Smrgif test set = "${lt_cv_aix_libpath+set}"; then
4559d87a3195Smrg  aix_libpath=$lt_cv_aix_libpath
4560d87a3195Smrgelse
4561d87a3195Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
4562d87a3195Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
4563d87a3195Smrg  lt_aix_libpath_sed='[
4564d87a3195Smrg      /Import File Strings/,/^$/ {
4565d87a3195Smrg	  /^0/ {
4566d87a3195Smrg	      s/^0  *\([^ ]*\) *$/\1/
4567d87a3195Smrg	      p
4568d87a3195Smrg	  }
4569d87a3195Smrg      }]'
4570d87a3195Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
4571d87a3195Smrg  # Check for a 64-bit object if we didn't find anything.
4572d87a3195Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
4573d87a3195Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
4574d87a3195Smrg  fi],[])
4575d87a3195Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
4576d87a3195Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
4577d87a3195Smrg  fi
4578d87a3195Smrg  ])
4579d87a3195Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
4580d87a3195Smrgfi
4581d87a3195Smrg])# _LT_SYS_MODULE_PATH_AIX
458295b296d0Smrg
458395b296d0Smrg
4584d87a3195Smrg# _LT_SHELL_INIT(ARG)
4585d87a3195Smrg# -------------------
4586d87a3195Smrgm4_define([_LT_SHELL_INIT],
4587d87a3195Smrg[m4_divert_text([M4SH-INIT], [$1
4588d87a3195Smrg])])# _LT_SHELL_INIT
458995b296d0Smrg
45902378475aSmrg
45912378475aSmrg
4592d87a3195Smrg# _LT_PROG_ECHO_BACKSLASH
4593d87a3195Smrg# -----------------------
4594d87a3195Smrg# Find how we can fake an echo command that does not interpret backslash.
4595d87a3195Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
4596d87a3195Smrg# of the generated configure script that will find a shell with a builtin
4597d87a3195Smrg# printf (that we can use as an echo command).
4598d87a3195Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
4599d87a3195Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4600d87a3195SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4601d87a3195SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
46022378475aSmrg
4603d87a3195SmrgAC_MSG_CHECKING([how to print strings])
4604d87a3195Smrg# Test print first, because it will be a builtin if present.
4605d87a3195Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
4606d87a3195Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
4607d87a3195Smrg  ECHO='print -r --'
4608d87a3195Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
4609d87a3195Smrg  ECHO='printf %s\n'
4610d87a3195Smrgelse
4611d87a3195Smrg  # Use this function as a fallback that always works.
4612d87a3195Smrg  func_fallback_echo ()
4613d87a3195Smrg  {
4614d87a3195Smrg    eval 'cat <<_LTECHO_EOF
4615d87a3195Smrg$[]1
4616d87a3195Smrg_LTECHO_EOF'
4617d87a3195Smrg  }
4618d87a3195Smrg  ECHO='func_fallback_echo'
4619d87a3195Smrgfi
462014330f12Smrg
4621d87a3195Smrg# func_echo_all arg...
4622d87a3195Smrg# Invoke $ECHO with all args, space-separated.
4623d87a3195Smrgfunc_echo_all ()
4624d87a3195Smrg{
4625d87a3195Smrg    $ECHO "$*"
4626d87a3195Smrg}
462714330f12Smrg
4628d87a3195Smrgcase $ECHO in
4629d87a3195Smrg  printf*) AC_MSG_RESULT([printf]) ;;
4630d87a3195Smrg  print*) AC_MSG_RESULT([print -r]) ;;
4631d87a3195Smrg  *) AC_MSG_RESULT([cat]) ;;
4632d87a3195Smrgesac
463395b296d0Smrg
4634d87a3195Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
4635d87a3195Smrg[_AS_DETECT_SUGGESTED([
4636d87a3195Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
4637d87a3195Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4638d87a3195Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4639d87a3195Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4640d87a3195Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
4641d87a3195Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
4642d87a3195Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
4643d87a3195Smrg
4644d87a3195Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
4645d87a3195Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
4646d87a3195Smrg])# _LT_PROG_ECHO_BACKSLASH
464795b296d0Smrg
464895b296d0Smrg
4649d87a3195Smrg# _LT_WITH_SYSROOT
4650d87a3195Smrg# ----------------
4651d87a3195SmrgAC_DEFUN([_LT_WITH_SYSROOT],
4652d87a3195Smrg[m4_require([_LT_DECL_SED])dnl
4653d87a3195SmrgAC_MSG_CHECKING([for sysroot])
4654d87a3195SmrgAC_ARG_WITH([sysroot],
4655d87a3195Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
4656d87a3195Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
4657d87a3195Smrg   if not specified).])],
4658d87a3195Smrg[], [with_sysroot=no])
465995b296d0Smrg
4660d87a3195Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
4661d87a3195Smrgdnl in case the user passed a directory name.
4662d87a3195Smrglt_sysroot=
4663d87a3195Smrgcase $with_sysroot in #(
4664d87a3195Smrg yes)
4665d87a3195Smrg   if test yes = "$GCC"; then
4666d87a3195Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
4667d87a3195Smrg   fi
4668d87a3195Smrg   ;; #(
4669d87a3195Smrg /*)
4670d87a3195Smrg   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
4671d87a3195Smrg   ;; #(
4672d87a3195Smrg no|'')
4673d87a3195Smrg   ;; #(
4674d87a3195Smrg *)
4675d87a3195Smrg   AC_MSG_RESULT([$with_sysroot])
4676d87a3195Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
4677d87a3195Smrg   ;;
4678d87a3195Smrgesac
467995b296d0Smrg
4680d87a3195Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
4681d87a3195Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
4682d87a3195Smrg[dependent libraries, and where our libraries should be installed.])])
468395b296d0Smrg
4684d87a3195Smrg# _LT_ENABLE_LOCK
4685d87a3195Smrg# ---------------
4686d87a3195Smrgm4_defun([_LT_ENABLE_LOCK],
4687d87a3195Smrg[AC_ARG_ENABLE([libtool-lock],
4688d87a3195Smrg  [AS_HELP_STRING([--disable-libtool-lock],
4689d87a3195Smrg    [avoid locking (might break parallel builds)])])
4690d87a3195Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
469195b296d0Smrg
4692d87a3195Smrg# Some flags need to be propagated to the compiler or linker for good
4693d87a3195Smrg# libtool support.
4694d87a3195Smrgcase $host in
4695d87a3195Smrgia64-*-hpux*)
4696d87a3195Smrg  # Find out what ABI is being produced by ac_compile, and set mode
4697d87a3195Smrg  # options accordingly.
4698d87a3195Smrg  echo 'int i;' > conftest.$ac_ext
4699d87a3195Smrg  if AC_TRY_EVAL(ac_compile); then
4700d87a3195Smrg    case `$FILECMD conftest.$ac_objext` in
4701d87a3195Smrg      *ELF-32*)
4702d87a3195Smrg	HPUX_IA64_MODE=32
4703d87a3195Smrg	;;
4704d87a3195Smrg      *ELF-64*)
4705d87a3195Smrg	HPUX_IA64_MODE=64
470614330f12Smrg	;;
4707d87a3195Smrg    esac
4708d87a3195Smrg  fi
4709d87a3195Smrg  rm -rf conftest*
4710d87a3195Smrg  ;;
4711d87a3195Smrg*-*-irix6*)
4712d87a3195Smrg  # Find out what ABI is being produced by ac_compile, and set linker
4713d87a3195Smrg  # options accordingly.
4714d87a3195Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4715d87a3195Smrg  if AC_TRY_EVAL(ac_compile); then
4716d87a3195Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
4717d87a3195Smrg      case `$FILECMD conftest.$ac_objext` in
4718d87a3195Smrg	*32-bit*)
4719d87a3195Smrg	  LD="${LD-ld} -melf32bsmip"
4720d87a3195Smrg	  ;;
4721d87a3195Smrg	*N32*)
4722d87a3195Smrg	  LD="${LD-ld} -melf32bmipn32"
4723d87a3195Smrg	  ;;
4724d87a3195Smrg	*64-bit*)
4725d87a3195Smrg	  LD="${LD-ld} -melf64bmip"
4726d87a3195Smrg	;;
4727d87a3195Smrg      esac
4728d87a3195Smrg    else
4729d87a3195Smrg      case `$FILECMD conftest.$ac_objext` in
4730d87a3195Smrg	*32-bit*)
4731d87a3195Smrg	  LD="${LD-ld} -32"
4732d87a3195Smrg	  ;;
4733d87a3195Smrg	*N32*)
4734d87a3195Smrg	  LD="${LD-ld} -n32"
4735d87a3195Smrg	  ;;
4736d87a3195Smrg	*64-bit*)
4737d87a3195Smrg	  LD="${LD-ld} -64"
4738d87a3195Smrg	  ;;
473914330f12Smrg      esac
474014330f12Smrg    fi
474114330f12Smrg  fi
4742d87a3195Smrg  rm -rf conftest*
4743d87a3195Smrg  ;;
474439713583Smrg
4745d87a3195Smrgmips64*-*linux*)
4746d87a3195Smrg  # Find out what ABI is being produced by ac_compile, and set linker
4747d87a3195Smrg  # options accordingly.
4748d87a3195Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4749d87a3195Smrg  if AC_TRY_EVAL(ac_compile); then
4750d87a3195Smrg    emul=elf
4751d87a3195Smrg    case `$FILECMD conftest.$ac_objext` in
4752d87a3195Smrg      *32-bit*)
4753d87a3195Smrg	emul="${emul}32"
4754d87a3195Smrg	;;
4755d87a3195Smrg      *64-bit*)
4756d87a3195Smrg	emul="${emul}64"
4757d87a3195Smrg	;;
4758d87a3195Smrg    esac
4759d87a3195Smrg    case `$FILECMD conftest.$ac_objext` in
4760d87a3195Smrg      *MSB*)
4761d87a3195Smrg	emul="${emul}btsmip"
4762d87a3195Smrg	;;
4763d87a3195Smrg      *LSB*)
4764d87a3195Smrg	emul="${emul}ltsmip"
4765d87a3195Smrg	;;
4766d87a3195Smrg    esac
4767d87a3195Smrg    case `$FILECMD conftest.$ac_objext` in
4768d87a3195Smrg      *N32*)
4769d87a3195Smrg	emul="${emul}n32"
4770d87a3195Smrg	;;
4771d87a3195Smrg    esac
4772d87a3195Smrg    LD="${LD-ld} -m $emul"
4773d87a3195Smrg  fi
4774d87a3195Smrg  rm -rf conftest*
4775d87a3195Smrg  ;;
477614330f12Smrg
4777d87a3195Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
4778d87a3195Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
4779d87a3195Smrg  # Find out what ABI is being produced by ac_compile, and set linker
4780d87a3195Smrg  # options accordingly.  Note that the listed cases only cover the
4781d87a3195Smrg  # situations where additional linker options are needed (such as when
4782d87a3195Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
4783d87a3195Smrg  # vice versa); the common cases where no linker options are needed do
4784d87a3195Smrg  # not appear in the list.
4785d87a3195Smrg  echo 'int i;' > conftest.$ac_ext
4786d87a3195Smrg  if AC_TRY_EVAL(ac_compile); then
4787d87a3195Smrg    case `$FILECMD conftest.o` in
4788d87a3195Smrg      *32-bit*)
4789d87a3195Smrg	case $host in
4790d87a3195Smrg	  x86_64-*kfreebsd*-gnu)
4791d87a3195Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
4792d87a3195Smrg	    ;;
4793d87a3195Smrg	  x86_64-*linux*)
4794d87a3195Smrg	    case `$FILECMD conftest.o` in
4795d87a3195Smrg	      *x86-64*)
4796d87a3195Smrg		LD="${LD-ld} -m elf32_x86_64"
4797d87a3195Smrg		;;
4798d87a3195Smrg	      *)
4799d87a3195Smrg		LD="${LD-ld} -m elf_i386"
4800d87a3195Smrg		;;
4801d87a3195Smrg	    esac
4802d87a3195Smrg	    ;;
4803d87a3195Smrg	  powerpc64le-*linux*)
4804d87a3195Smrg	    LD="${LD-ld} -m elf32lppclinux"
4805d87a3195Smrg	    ;;
4806d87a3195Smrg	  powerpc64-*linux*)
4807d87a3195Smrg	    LD="${LD-ld} -m elf32ppclinux"
4808d87a3195Smrg	    ;;
4809d87a3195Smrg	  s390x-*linux*)
4810d87a3195Smrg	    LD="${LD-ld} -m elf_s390"
4811d87a3195Smrg	    ;;
4812d87a3195Smrg	  sparc64-*linux*)
4813d87a3195Smrg	    LD="${LD-ld} -m elf32_sparc"
4814d87a3195Smrg	    ;;
4815d87a3195Smrg	esac
4816d87a3195Smrg	;;
4817d87a3195Smrg      *64-bit*)
4818d87a3195Smrg	case $host in
4819d87a3195Smrg	  x86_64-*kfreebsd*-gnu)
4820d87a3195Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
4821d87a3195Smrg	    ;;
4822d87a3195Smrg	  x86_64-*linux*)
4823d87a3195Smrg	    LD="${LD-ld} -m elf_x86_64"
4824d87a3195Smrg	    ;;
4825d87a3195Smrg	  powerpcle-*linux*)
4826d87a3195Smrg	    LD="${LD-ld} -m elf64lppc"
4827d87a3195Smrg	    ;;
4828d87a3195Smrg	  powerpc-*linux*)
4829d87a3195Smrg	    LD="${LD-ld} -m elf64ppc"
4830d87a3195Smrg	    ;;
4831d87a3195Smrg	  s390*-*linux*|s390*-*tpf*)
4832d87a3195Smrg	    LD="${LD-ld} -m elf64_s390"
4833d87a3195Smrg	    ;;
4834d87a3195Smrg	  sparc*-*linux*)
4835d87a3195Smrg	    LD="${LD-ld} -m elf64_sparc"
4836d87a3195Smrg	    ;;
4837d87a3195Smrg	esac
4838d87a3195Smrg	;;
4839d87a3195Smrg    esac
4840d87a3195Smrg  fi
4841d87a3195Smrg  rm -rf conftest*
4842d87a3195Smrg  ;;
4843d87a3195Smrg
4844d87a3195Smrg*-*-sco3.2v5*)
4845d87a3195Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4846d87a3195Smrg  SAVE_CFLAGS=$CFLAGS
4847d87a3195Smrg  CFLAGS="$CFLAGS -belf"
4848d87a3195Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
4849d87a3195Smrg    [AC_LANG_PUSH(C)
4850d87a3195Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
4851d87a3195Smrg     AC_LANG_POP])
4852d87a3195Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
4853d87a3195Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4854d87a3195Smrg    CFLAGS=$SAVE_CFLAGS
4855d87a3195Smrg  fi
4856d87a3195Smrg  ;;
4857d87a3195Smrg*-*solaris*)
4858d87a3195Smrg  # Find out what ABI is being produced by ac_compile, and set linker
4859d87a3195Smrg  # options accordingly.
4860d87a3195Smrg  echo 'int i;' > conftest.$ac_ext
4861d87a3195Smrg  if AC_TRY_EVAL(ac_compile); then
4862d87a3195Smrg    case `$FILECMD conftest.o` in
4863d87a3195Smrg    *64-bit*)
4864d87a3195Smrg      case $lt_cv_prog_gnu_ld in
4865d87a3195Smrg      yes*)
4866d87a3195Smrg        case $host in
4867d87a3195Smrg        i?86-*-solaris*|x86_64-*-solaris*)
4868d87a3195Smrg          LD="${LD-ld} -m elf_x86_64"
4869d87a3195Smrg          ;;
4870d87a3195Smrg        sparc*-*-solaris*)
4871d87a3195Smrg          LD="${LD-ld} -m elf64_sparc"
4872d87a3195Smrg          ;;
4873d87a3195Smrg        esac
4874d87a3195Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
4875d87a3195Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
4876d87a3195Smrg          LD=${LD-ld}_sol2
4877d87a3195Smrg        fi
4878d87a3195Smrg        ;;
4879d87a3195Smrg      *)
4880d87a3195Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
4881d87a3195Smrg	  LD="${LD-ld} -64"
488214330f12Smrg	fi
4883d87a3195Smrg	;;
4884d87a3195Smrg      esac
488514330f12Smrg      ;;
488614330f12Smrg    esac
488714330f12Smrg  fi
4888d87a3195Smrg  rm -rf conftest*
488914330f12Smrg  ;;
489014330f12Smrgesac
489139713583Smrg
4892d87a3195Smrgneed_locks=$enable_libtool_lock
4893d87a3195Smrg])# _LT_ENABLE_LOCK
489439713583Smrg
489539713583Smrg
4896d87a3195Smrg# _LT_PROG_AR
4897d87a3195Smrg# -----------
4898d87a3195Smrgm4_defun([_LT_PROG_AR],
4899d87a3195Smrg[AC_CHECK_TOOLS(AR, [ar], false)
4900d87a3195Smrg: ${AR=ar}
4901d87a3195Smrg_LT_DECL([], [AR], [1], [The archiver])
490239713583Smrg
4903d87a3195Smrg# Use ARFLAGS variable as AR's operation code to sync the variable naming with
4904d87a3195Smrg# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
4905d87a3195Smrg# higher priority because thats what people were doing historically (setting
4906d87a3195Smrg# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
4907d87a3195Smrg# variable obsoleted/removed.
490839713583Smrg
4909d87a3195Smrgtest ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
4910d87a3195Smrglt_ar_flags=$AR_FLAGS
4911d87a3195Smrg_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
491295b296d0Smrg
4913d87a3195Smrg# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
4914d87a3195Smrg# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
4915d87a3195Smrg_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
4916d87a3195Smrg         [Flags to create an archive])
491795b296d0Smrg
4918d87a3195SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
4919d87a3195Smrg  [lt_cv_ar_at_file=no
4920d87a3195Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
4921d87a3195Smrg     [echo conftest.$ac_objext > conftest.lst
4922d87a3195Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
4923d87a3195Smrg      AC_TRY_EVAL([lt_ar_try])
4924d87a3195Smrg      if test 0 -eq "$ac_status"; then
4925d87a3195Smrg	# Ensure the archiver fails upon bogus file names.
4926d87a3195Smrg	rm -f conftest.$ac_objext libconftest.a
4927d87a3195Smrg	AC_TRY_EVAL([lt_ar_try])
4928d87a3195Smrg	if test 0 -ne "$ac_status"; then
4929d87a3195Smrg          lt_cv_ar_at_file=@
4930d87a3195Smrg        fi
4931d87a3195Smrg      fi
4932d87a3195Smrg      rm -f conftest.* libconftest.a
4933d87a3195Smrg     ])
4934d87a3195Smrg  ])
493539713583Smrg
4936d87a3195Smrgif test no = "$lt_cv_ar_at_file"; then
4937d87a3195Smrg  archiver_list_spec=
4938d87a3195Smrgelse
4939d87a3195Smrg  archiver_list_spec=$lt_cv_ar_at_file
4940d87a3195Smrgfi
4941d87a3195Smrg_LT_DECL([], [archiver_list_spec], [1],
4942d87a3195Smrg  [How to feed a file listing to the archiver])
4943d87a3195Smrg])# _LT_PROG_AR
494439713583Smrg
494539713583Smrg
4946d87a3195Smrg# _LT_CMD_OLD_ARCHIVE
4947d87a3195Smrg# -------------------
4948d87a3195Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
4949d87a3195Smrg[_LT_PROG_AR
495039713583Smrg
4951d87a3195SmrgAC_CHECK_TOOL(STRIP, strip, :)
4952d87a3195Smrgtest -z "$STRIP" && STRIP=:
4953d87a3195Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
495439713583Smrg
4955d87a3195SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
4956d87a3195Smrgtest -z "$RANLIB" && RANLIB=:
4957d87a3195Smrg_LT_DECL([], [RANLIB], [1],
4958d87a3195Smrg    [Commands used to install an old-style archive])
495939713583Smrg
4960d87a3195Smrg# Determine commands to create old-style static archives.
4961d87a3195Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
4962d87a3195Smrgold_postinstall_cmds='chmod 644 $oldlib'
4963d87a3195Smrgold_postuninstall_cmds=
496439713583Smrg
4965d87a3195Smrgif test -n "$RANLIB"; then
4966d87a3195Smrg  case $host_os in
4967d87a3195Smrg  bitrig* | openbsd*)
4968d87a3195Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
49692378475aSmrg    ;;
4970d87a3195Smrg  *)
4971d87a3195Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
4972d87a3195Smrg    ;;
4973d87a3195Smrg  esac
4974d87a3195Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
49752378475aSmrgfi
4976d87a3195Smrg
4977d87a3195Smrgcase $host_os in
4978d87a3195Smrg  darwin*)
4979d87a3195Smrg    lock_old_archive_extraction=yes ;;
4980d87a3195Smrg  *)
4981d87a3195Smrg    lock_old_archive_extraction=no ;;
4982d87a3195Smrgesac
4983d87a3195Smrg_LT_DECL([], [old_postinstall_cmds], [2])
4984d87a3195Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
4985d87a3195Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
4986d87a3195Smrg    [Commands used to build an old-style archive])
4987d87a3195Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
4988d87a3195Smrg    [Whether to use a lock for old archive extraction])
4989d87a3195Smrg])# _LT_CMD_OLD_ARCHIVE
499039713583Smrg
499139713583Smrg
4992d87a3195Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
4993d87a3195Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
4994d87a3195Smrg# ----------------------------------------------------------------
4995d87a3195Smrg# Check whether the given compiler option works
4996d87a3195SmrgAC_DEFUN([_LT_COMPILER_OPTION],
499714330f12Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4998d87a3195Smrgm4_require([_LT_DECL_SED])dnl
4999d87a3195SmrgAC_CACHE_CHECK([$1], [$2],
5000d87a3195Smrg  [$2=no
5001d87a3195Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
5002d87a3195Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5003d87a3195Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
5004d87a3195Smrg   # Insert the option either (1) after the last *FLAGS variable, or
5005d87a3195Smrg   # (2) before a word containing "conftest.", or (3) at the end.
5006d87a3195Smrg   # Note that $ac_compile itself does not contain backslashes and begins
5007d87a3195Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
5008d87a3195Smrg   # The option is referenced via a variable to avoid confusing sed.
5009d87a3195Smrg   lt_compile=`echo "$ac_compile" | $SED \
5010d87a3195Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
5011d87a3195Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
5012d87a3195Smrg   -e 's:$: $lt_compiler_flag:'`
5013d87a3195Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
5014d87a3195Smrg   (eval "$lt_compile" 2>conftest.err)
5015d87a3195Smrg   ac_status=$?
5016d87a3195Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
5017d87a3195Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
5018d87a3195Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
5019d87a3195Smrg     # The compiler can only warn and ignore the option if not recognized
5020d87a3195Smrg     # So say no if there are warnings other than the usual output.
5021d87a3195Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
5022d87a3195Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
5023d87a3195Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
5024d87a3195Smrg       $2=yes
5025d87a3195Smrg     fi
5026d87a3195Smrg   fi
5027d87a3195Smrg   $RM conftest*
5028d87a3195Smrg])
5029d87a3195Smrg
5030d87a3195Smrgif test yes = "[$]$2"; then
5031d87a3195Smrg    m4_if([$5], , :, [$5])
503214330f12Smrgelse
5033d87a3195Smrg    m4_if([$6], , :, [$6])
503414330f12Smrgfi
5035d87a3195Smrg])# _LT_COMPILER_OPTION
503695b296d0Smrg
5037d87a3195Smrg# Old name:
5038d87a3195SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
5039d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
5040d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
504139713583Smrg
504239713583Smrg
5043d87a3195Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
5044d87a3195Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
5045d87a3195Smrg# ----------------------------------------------------
5046d87a3195Smrg# Check whether the given linker option works
5047d87a3195SmrgAC_DEFUN([_LT_LINKER_OPTION],
5048d87a3195Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5049d87a3195Smrgm4_require([_LT_DECL_SED])dnl
5050d87a3195SmrgAC_CACHE_CHECK([$1], [$2],
5051d87a3195Smrg  [$2=no
5052d87a3195Smrg   save_LDFLAGS=$LDFLAGS
5053d87a3195Smrg   LDFLAGS="$LDFLAGS $3"
5054d87a3195Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
5055d87a3195Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
5056d87a3195Smrg     # The linker can only warn and ignore the option if not recognized
5057d87a3195Smrg     # So say no if there are warnings
5058d87a3195Smrg     if test -s conftest.err; then
5059d87a3195Smrg       # Append any errors to the config.log.
5060d87a3195Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
5061d87a3195Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
5062d87a3195Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
5063d87a3195Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
5064d87a3195Smrg         $2=yes
5065d87a3195Smrg       fi
5066d87a3195Smrg     else
5067d87a3195Smrg       $2=yes
5068d87a3195Smrg     fi
5069d87a3195Smrg   fi
5070d87a3195Smrg   $RM -r conftest*
5071d87a3195Smrg   LDFLAGS=$save_LDFLAGS
5072d87a3195Smrg])
507339713583Smrg
5074d87a3195Smrgif test yes = "[$]$2"; then
5075d87a3195Smrg    m4_if([$4], , :, [$4])
5076d87a3195Smrgelse
5077d87a3195Smrg    m4_if([$5], , :, [$5])
5078d87a3195Smrgfi
5079d87a3195Smrg])# _LT_LINKER_OPTION
508095b296d0Smrg
5081d87a3195Smrg# Old name:
5082d87a3195SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
5083d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
5084d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
50852378475aSmrg
50862378475aSmrg
5087d87a3195Smrg# LT_CMD_MAX_LEN
5088d87a3195Smrg#---------------
5089d87a3195SmrgAC_DEFUN([LT_CMD_MAX_LEN],
5090d87a3195Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5091d87a3195Smrg# find the maximum length of command line arguments
5092d87a3195SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
5093d87a3195SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
5094d87a3195Smrg  i=0
5095d87a3195Smrg  teststring=ABCD
509695b296d0Smrg
5097d87a3195Smrg  case $build_os in
5098d87a3195Smrg  msdosdjgpp*)
5099d87a3195Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
5100d87a3195Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
5101d87a3195Smrg    # during glob expansion).  Even if it were fixed, the result of this
5102d87a3195Smrg    # check would be larger than it should be.
5103d87a3195Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
5104d87a3195Smrg    ;;
510595b296d0Smrg
5106d87a3195Smrg  gnu*)
5107d87a3195Smrg    # Under GNU Hurd, this test is not required because there is
5108d87a3195Smrg    # no limit to the length of command line arguments.
5109d87a3195Smrg    # Libtool will interpret -1 as no limit whatsoever
5110d87a3195Smrg    lt_cv_sys_max_cmd_len=-1;
5111d87a3195Smrg    ;;
511295b296d0Smrg
5113d87a3195Smrg  cygwin* | mingw* | cegcc*)
5114d87a3195Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
5115d87a3195Smrg    # about 5 minutes as the teststring grows exponentially.
5116d87a3195Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
5117d87a3195Smrg    # you end up with a "frozen" computer, even though with patience
5118d87a3195Smrg    # the test eventually succeeds (with a max line length of 256k).
5119d87a3195Smrg    # Instead, let's just punt: use the minimum linelength reported by
5120d87a3195Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
5121d87a3195Smrg    lt_cv_sys_max_cmd_len=8192;
5122d87a3195Smrg    ;;
51232378475aSmrg
5124d87a3195Smrg  mint*)
5125d87a3195Smrg    # On MiNT this can take a long time and run out of memory.
5126d87a3195Smrg    lt_cv_sys_max_cmd_len=8192;
5127d87a3195Smrg    ;;
51282378475aSmrg
5129d87a3195Smrg  amigaos*)
5130d87a3195Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
5131d87a3195Smrg    # So we just punt and use a minimum line length of 8192.
5132d87a3195Smrg    lt_cv_sys_max_cmd_len=8192;
5133d87a3195Smrg    ;;
51342378475aSmrg
5135d87a3195Smrg  bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
5136d87a3195Smrg    # This has been around since 386BSD, at least.  Likely further.
5137d87a3195Smrg    if test -x /sbin/sysctl; then
5138d87a3195Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
5139d87a3195Smrg    elif test -x /usr/sbin/sysctl; then
5140d87a3195Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
5141d87a3195Smrg    else
5142d87a3195Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
5143d87a3195Smrg    fi
5144d87a3195Smrg    # And add a safety zone
5145d87a3195Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5146d87a3195Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5147d87a3195Smrg    ;;
5148d87a3195Smrg
5149d87a3195Smrg  interix*)
5150d87a3195Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
5151d87a3195Smrg    lt_cv_sys_max_cmd_len=196608
5152d87a3195Smrg    ;;
5153d87a3195Smrg
5154d87a3195Smrg  os2*)
5155d87a3195Smrg    # The test takes a long time on OS/2.
5156d87a3195Smrg    lt_cv_sys_max_cmd_len=8192
5157d87a3195Smrg    ;;
51582378475aSmrg
5159d87a3195Smrg  osf*)
5160d87a3195Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
5161d87a3195Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
5162d87a3195Smrg    # nice to cause kernel panics so lets avoid the loop below.
5163d87a3195Smrg    # First set a reasonable default.
5164d87a3195Smrg    lt_cv_sys_max_cmd_len=16384
5165d87a3195Smrg    #
5166d87a3195Smrg    if test -x /sbin/sysconfig; then
5167d87a3195Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
5168d87a3195Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
5169d87a3195Smrg      esac
5170d87a3195Smrg    fi
5171d87a3195Smrg    ;;
5172d87a3195Smrg  sco3.2v5*)
5173d87a3195Smrg    lt_cv_sys_max_cmd_len=102400
5174d87a3195Smrg    ;;
5175d87a3195Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
5176d87a3195Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
5177d87a3195Smrg    if test -n "$kargmax"; then
5178d87a3195Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
517914330f12Smrg    else
5180d87a3195Smrg      lt_cv_sys_max_cmd_len=32768
5181d87a3195Smrg    fi
5182d87a3195Smrg    ;;
5183d87a3195Smrg  *)
5184d87a3195Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
5185d87a3195Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
5186d87a3195Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
5187d87a3195Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5188d87a3195Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5189d87a3195Smrg    else
5190d87a3195Smrg      # Make teststring a little bigger before we do anything with it.
5191d87a3195Smrg      # a 1K string should be a reasonable start.
5192d87a3195Smrg      for i in 1 2 3 4 5 6 7 8; do
5193d87a3195Smrg        teststring=$teststring$teststring
5194d87a3195Smrg      done
5195d87a3195Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
5196d87a3195Smrg      # If test is not a shell built-in, we'll probably end up computing a
5197d87a3195Smrg      # maximum length that is only half of the actual maximum length, but
5198d87a3195Smrg      # we can't tell.
5199d87a3195Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
5200d87a3195Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
5201d87a3195Smrg	      test 17 != "$i" # 1/2 MB should be enough
5202d87a3195Smrg      do
5203d87a3195Smrg        i=`expr $i + 1`
5204d87a3195Smrg        teststring=$teststring$teststring
5205d87a3195Smrg      done
5206d87a3195Smrg      # Only check the string length outside the loop.
5207d87a3195Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
5208d87a3195Smrg      teststring=
5209d87a3195Smrg      # Add a significant safety factor because C++ compilers can tack on
5210d87a3195Smrg      # massive amounts of additional arguments before passing them to the
5211d87a3195Smrg      # linker.  It appears as though 1/2 is a usable value.
5212d87a3195Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
521314330f12Smrg    fi
5214d87a3195Smrg    ;;
5215d87a3195Smrg  esac
5216d87a3195Smrg])
5217d87a3195Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
5218d87a3195Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
5219d87a3195Smrgelse
5220d87a3195Smrg  AC_MSG_RESULT(none)
5221d87a3195Smrgfi
5222d87a3195Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
5223d87a3195Smrg_LT_DECL([], [max_cmd_len], [0],
5224d87a3195Smrg    [What is the maximum length of a command?])
5225d87a3195Smrg])# LT_CMD_MAX_LEN
52262378475aSmrg
5227d87a3195Smrg# Old name:
5228d87a3195SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
5229d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
5230d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
52312378475aSmrg
523295b296d0Smrg
5233d87a3195Smrg# _LT_HEADER_DLFCN
5234d87a3195Smrg# ----------------
5235d87a3195Smrgm4_defun([_LT_HEADER_DLFCN],
5236d87a3195Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
5237d87a3195Smrg])# _LT_HEADER_DLFCN
52382378475aSmrg
52392378475aSmrg
5240d87a3195Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
5241d87a3195Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
5242d87a3195Smrg# ----------------------------------------------------------------
5243d87a3195Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
5244d87a3195Smrg[m4_require([_LT_HEADER_DLFCN])dnl
5245d87a3195Smrgif test yes = "$cross_compiling"; then :
5246d87a3195Smrg  [$4]
5247d87a3195Smrgelse
5248d87a3195Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
5249d87a3195Smrg  lt_status=$lt_dlunknown
5250d87a3195Smrg  cat > conftest.$ac_ext <<_LT_EOF
5251d87a3195Smrg[#line $LINENO "configure"
5252d87a3195Smrg#include "confdefs.h"
52532378475aSmrg
5254d87a3195Smrg#if HAVE_DLFCN_H
5255d87a3195Smrg#include <dlfcn.h>
5256d87a3195Smrg#endif
5257d87a3195Smrg
5258d87a3195Smrg#include <stdio.h>
5259d87a3195Smrg
5260d87a3195Smrg#ifdef RTLD_GLOBAL
5261d87a3195Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
5262d87a3195Smrg#else
5263d87a3195Smrg#  ifdef DL_GLOBAL
5264d87a3195Smrg#    define LT_DLGLOBAL		DL_GLOBAL
5265d87a3195Smrg#  else
5266d87a3195Smrg#    define LT_DLGLOBAL		0
5267d87a3195Smrg#  endif
5268d87a3195Smrg#endif
52692378475aSmrg
5270d87a3195Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
5271d87a3195Smrg   find out it does not work in some platform. */
5272d87a3195Smrg#ifndef LT_DLLAZY_OR_NOW
5273d87a3195Smrg#  ifdef RTLD_LAZY
5274d87a3195Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
5275d87a3195Smrg#  else
5276d87a3195Smrg#    ifdef DL_LAZY
5277d87a3195Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
5278d87a3195Smrg#    else
5279d87a3195Smrg#      ifdef RTLD_NOW
5280d87a3195Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
5281d87a3195Smrg#      else
5282d87a3195Smrg#        ifdef DL_NOW
5283d87a3195Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
5284d87a3195Smrg#        else
5285d87a3195Smrg#          define LT_DLLAZY_OR_NOW	0
5286d87a3195Smrg#        endif
5287d87a3195Smrg#      endif
5288d87a3195Smrg#    endif
5289d87a3195Smrg#  endif
5290d87a3195Smrg#endif
52912378475aSmrg
5292d87a3195Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
5293d87a3195Smrg   correspondingly for the symbols needed.  */
5294d87a3195Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
5295d87a3195Smrgint fnord () __attribute__((visibility("default")));
5296d87a3195Smrg#endif
52972378475aSmrg
5298d87a3195Smrgint fnord () { return 42; }
5299d87a3195Smrgint main ()
5300d87a3195Smrg{
5301d87a3195Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
5302d87a3195Smrg  int status = $lt_dlunknown;
53032378475aSmrg
5304d87a3195Smrg  if (self)
5305d87a3195Smrg    {
5306d87a3195Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
5307d87a3195Smrg      else
5308d87a3195Smrg        {
5309d87a3195Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
5310d87a3195Smrg          else puts (dlerror ());
5311d87a3195Smrg	}
5312d87a3195Smrg      /* dlclose (self); */
5313d87a3195Smrg    }
5314d87a3195Smrg  else
5315d87a3195Smrg    puts (dlerror ());
53162378475aSmrg
5317d87a3195Smrg  return status;
5318d87a3195Smrg}]
5319d87a3195Smrg_LT_EOF
5320d87a3195Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
5321d87a3195Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
5322d87a3195Smrg    lt_status=$?
5323d87a3195Smrg    case x$lt_status in
5324d87a3195Smrg      x$lt_dlno_uscore) $1 ;;
5325d87a3195Smrg      x$lt_dlneed_uscore) $2 ;;
5326d87a3195Smrg      x$lt_dlunknown|x*) $3 ;;
5327d87a3195Smrg    esac
5328d87a3195Smrg  else :
5329d87a3195Smrg    # compilation failed
5330d87a3195Smrg    $3
5331d87a3195Smrg  fi
5332d87a3195Smrgfi
5333d87a3195Smrgrm -fr conftest*
5334d87a3195Smrg])# _LT_TRY_DLOPEN_SELF
533514330f12Smrg
53362378475aSmrg
5337d87a3195Smrg# LT_SYS_DLOPEN_SELF
5338d87a3195Smrg# ------------------
5339d87a3195SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
5340d87a3195Smrg[m4_require([_LT_HEADER_DLFCN])dnl
5341d87a3195Smrgif test yes != "$enable_dlopen"; then
5342d87a3195Smrg  enable_dlopen=unknown
5343d87a3195Smrg  enable_dlopen_self=unknown
5344d87a3195Smrg  enable_dlopen_self_static=unknown
5345d87a3195Smrgelse
5346d87a3195Smrg  lt_cv_dlopen=no
5347d87a3195Smrg  lt_cv_dlopen_libs=
5348d87a3195Smrg
5349d87a3195Smrg  case $host_os in
5350d87a3195Smrg  beos*)
5351d87a3195Smrg    lt_cv_dlopen=load_add_on
5352d87a3195Smrg    lt_cv_dlopen_libs=
5353d87a3195Smrg    lt_cv_dlopen_self=yes
5354d87a3195Smrg    ;;
5355eca46af7Smrg
5356d87a3195Smrg  mingw* | pw32* | cegcc*)
5357d87a3195Smrg    lt_cv_dlopen=LoadLibrary
5358d87a3195Smrg    lt_cv_dlopen_libs=
5359d87a3195Smrg    ;;
536039713583Smrg
5361d87a3195Smrg  cygwin*)
5362d87a3195Smrg    lt_cv_dlopen=dlopen
5363d87a3195Smrg    lt_cv_dlopen_libs=
5364d87a3195Smrg    ;;
536539713583Smrg
5366d87a3195Smrg  darwin*)
5367d87a3195Smrg    # if libdl is installed we need to link against it
5368d87a3195Smrg    AC_CHECK_LIB([dl], [dlopen],
5369d87a3195Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
5370d87a3195Smrg    lt_cv_dlopen=dyld
5371d87a3195Smrg    lt_cv_dlopen_libs=
5372d87a3195Smrg    lt_cv_dlopen_self=yes
5373d87a3195Smrg    ])
5374d87a3195Smrg    ;;
537539713583Smrg
5376d87a3195Smrg  tpf*)
5377d87a3195Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
5378d87a3195Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
5379d87a3195Smrg    lt_cv_dlopen=dlopen
5380d87a3195Smrg    lt_cv_dlopen_libs=
5381d87a3195Smrg    lt_cv_dlopen_self=no
5382d87a3195Smrg    ;;
538339713583Smrg
5384d87a3195Smrg  *)
5385d87a3195Smrg    AC_CHECK_FUNC([shl_load],
5386d87a3195Smrg	  [lt_cv_dlopen=shl_load],
5387d87a3195Smrg      [AC_CHECK_LIB([dld], [shl_load],
5388d87a3195Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
5389d87a3195Smrg	[AC_CHECK_FUNC([dlopen],
5390d87a3195Smrg	      [lt_cv_dlopen=dlopen],
5391d87a3195Smrg	  [AC_CHECK_LIB([dl], [dlopen],
5392d87a3195Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
5393d87a3195Smrg	    [AC_CHECK_LIB([svld], [dlopen],
5394d87a3195Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
5395d87a3195Smrg	      [AC_CHECK_LIB([dld], [dld_link],
5396d87a3195Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
5397d87a3195Smrg	      ])
5398d87a3195Smrg	    ])
5399d87a3195Smrg	  ])
5400d87a3195Smrg	])
5401d87a3195Smrg      ])
5402d87a3195Smrg    ;;
5403d87a3195Smrg  esac
540439713583Smrg
5405d87a3195Smrg  if test no = "$lt_cv_dlopen"; then
5406d87a3195Smrg    enable_dlopen=no
5407d87a3195Smrg  else
5408d87a3195Smrg    enable_dlopen=yes
5409d87a3195Smrg  fi
541039713583Smrg
5411d87a3195Smrg  case $lt_cv_dlopen in
5412d87a3195Smrg  dlopen)
5413d87a3195Smrg    save_CPPFLAGS=$CPPFLAGS
5414d87a3195Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
541539713583Smrg
5416d87a3195Smrg    save_LDFLAGS=$LDFLAGS
5417d87a3195Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
541839713583Smrg
5419d87a3195Smrg    save_LIBS=$LIBS
5420d87a3195Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
542195b296d0Smrg
5422d87a3195Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
5423d87a3195Smrg	  lt_cv_dlopen_self, [dnl
5424d87a3195Smrg	  _LT_TRY_DLOPEN_SELF(
5425d87a3195Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
5426d87a3195Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
5427d87a3195Smrg    ])
542895b296d0Smrg
5429d87a3195Smrg    if test yes = "$lt_cv_dlopen_self"; then
5430d87a3195Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
5431d87a3195Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
5432d87a3195Smrg	  lt_cv_dlopen_self_static, [dnl
5433d87a3195Smrg	  _LT_TRY_DLOPEN_SELF(
5434d87a3195Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
5435d87a3195Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
5436d87a3195Smrg      ])
5437d87a3195Smrg    fi
543895b296d0Smrg
5439d87a3195Smrg    CPPFLAGS=$save_CPPFLAGS
5440d87a3195Smrg    LDFLAGS=$save_LDFLAGS
5441d87a3195Smrg    LIBS=$save_LIBS
5442d87a3195Smrg    ;;
5443d87a3195Smrg  esac
544495b296d0Smrg
5445d87a3195Smrg  case $lt_cv_dlopen_self in
5446d87a3195Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
5447d87a3195Smrg  *) enable_dlopen_self=unknown ;;
5448d87a3195Smrg  esac
544995b296d0Smrg
5450d87a3195Smrg  case $lt_cv_dlopen_self_static in
5451d87a3195Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
5452d87a3195Smrg  *) enable_dlopen_self_static=unknown ;;
5453d87a3195Smrg  esac
5454d87a3195Smrgfi
5455d87a3195Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
5456d87a3195Smrg	 [Whether dlopen is supported])
5457d87a3195Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
5458d87a3195Smrg	 [Whether dlopen of programs is supported])
5459d87a3195Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
5460d87a3195Smrg	 [Whether dlopen of statically linked programs is supported])
5461d87a3195Smrg])# LT_SYS_DLOPEN_SELF
546295b296d0Smrg
5463d87a3195Smrg# Old name:
5464d87a3195SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
5465d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
5466d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
546795b296d0Smrg
546895b296d0Smrg
5469d87a3195Smrg# _LT_COMPILER_C_O([TAGNAME])
5470d87a3195Smrg# ---------------------------
5471d87a3195Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
5472d87a3195Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
5473d87a3195Smrgm4_defun([_LT_COMPILER_C_O],
5474d87a3195Smrg[m4_require([_LT_DECL_SED])dnl
5475d87a3195Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5476d87a3195Smrgm4_require([_LT_TAG_COMPILER])dnl
5477d87a3195SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
5478d87a3195Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
5479d87a3195Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
5480d87a3195Smrg   $RM -r conftest 2>/dev/null
5481d87a3195Smrg   mkdir conftest
5482d87a3195Smrg   cd conftest
5483d87a3195Smrg   mkdir out
5484d87a3195Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5485ff89ac2bSmrg
5486d87a3195Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
5487d87a3195Smrg   # Insert the option either (1) after the last *FLAGS variable, or
5488d87a3195Smrg   # (2) before a word containing "conftest.", or (3) at the end.
5489d87a3195Smrg   # Note that $ac_compile itself does not contain backslashes and begins
5490d87a3195Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
5491d87a3195Smrg   lt_compile=`echo "$ac_compile" | $SED \
5492d87a3195Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
5493d87a3195Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
5494d87a3195Smrg   -e 's:$: $lt_compiler_flag:'`
5495d87a3195Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
5496d87a3195Smrg   (eval "$lt_compile" 2>out/conftest.err)
5497d87a3195Smrg   ac_status=$?
5498d87a3195Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
5499d87a3195Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
5500d87a3195Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
5501d87a3195Smrg   then
5502d87a3195Smrg     # The compiler can only warn and ignore the option if not recognized
5503d87a3195Smrg     # So say no if there are warnings
5504d87a3195Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
5505d87a3195Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
5506d87a3195Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
5507d87a3195Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
5508d87a3195Smrg     fi
5509d87a3195Smrg   fi
5510d87a3195Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
5511d87a3195Smrg   $RM conftest*
5512d87a3195Smrg   # SGI C++ compiler will create directory out/ii_files/ for
5513d87a3195Smrg   # template instantiation
5514d87a3195Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
5515d87a3195Smrg   $RM out/* && rmdir out
5516d87a3195Smrg   cd ..
5517d87a3195Smrg   $RM -r conftest
5518d87a3195Smrg   $RM conftest*
5519d87a3195Smrg])
5520d87a3195Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
5521d87a3195Smrg	[Does compiler simultaneously support -c and -o options?])
5522d87a3195Smrg])# _LT_COMPILER_C_O
55232378475aSmrg
55242378475aSmrg
5525d87a3195Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
5526d87a3195Smrg# ----------------------------------
5527d87a3195Smrg# Check to see if we can do hard links to lock some files if needed
5528d87a3195Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
5529d87a3195Smrg[m4_require([_LT_ENABLE_LOCK])dnl
5530d87a3195Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5531d87a3195Smrg_LT_COMPILER_C_O([$1])
55322378475aSmrg
5533d87a3195Smrghard_links=nottested
5534d87a3195Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
5535d87a3195Smrg  # do not overwrite the value of need_locks provided by the user
5536d87a3195Smrg  AC_MSG_CHECKING([if we can lock with hard links])
5537d87a3195Smrg  hard_links=yes
5538d87a3195Smrg  $RM conftest*
5539d87a3195Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5540d87a3195Smrg  touch conftest.a
5541d87a3195Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
5542d87a3195Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5543d87a3195Smrg  AC_MSG_RESULT([$hard_links])
5544d87a3195Smrg  if test no = "$hard_links"; then
5545d87a3195Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
5546d87a3195Smrg    need_locks=warn
5547d87a3195Smrg  fi
5548d87a3195Smrgelse
5549d87a3195Smrg  need_locks=no
5550d87a3195Smrgfi
5551d87a3195Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
5552d87a3195Smrg])# _LT_COMPILER_FILE_LOCKS
55532378475aSmrg
55542378475aSmrg
5555d87a3195Smrg# _LT_CHECK_OBJDIR
5556d87a3195Smrg# ----------------
5557d87a3195Smrgm4_defun([_LT_CHECK_OBJDIR],
5558d87a3195Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
5559d87a3195Smrg[rm -f .libs 2>/dev/null
5560d87a3195Smrgmkdir .libs 2>/dev/null
5561d87a3195Smrgif test -d .libs; then
5562d87a3195Smrg  lt_cv_objdir=.libs
5563d87a3195Smrgelse
5564d87a3195Smrg  # MS-DOS does not allow filenames that begin with a dot.
5565d87a3195Smrg  lt_cv_objdir=_libs
5566d87a3195Smrgfi
5567d87a3195Smrgrmdir .libs 2>/dev/null])
5568d87a3195Smrgobjdir=$lt_cv_objdir
5569d87a3195Smrg_LT_DECL([], [objdir], [0],
5570d87a3195Smrg         [The name of the directory that contains temporary libtool files])dnl
5571d87a3195Smrgm4_pattern_allow([LT_OBJDIR])dnl
5572d87a3195SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
5573d87a3195Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
5574d87a3195Smrg])# _LT_CHECK_OBJDIR
5575d87a3195Smrg
55762378475aSmrg
5577d87a3195Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
5578d87a3195Smrg# --------------------------------------
5579d87a3195Smrg# Check hardcoding attributes.
5580d87a3195Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
5581d87a3195Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
5582d87a3195Smrg_LT_TAGVAR(hardcode_action, $1)=
5583d87a3195Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
5584d87a3195Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
5585d87a3195Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
55862378475aSmrg
5587d87a3195Smrg  # We can hardcode non-existent directories.
5588d87a3195Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
5589d87a3195Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
5590d87a3195Smrg     # have to relink, otherwise we might link with an installed library
5591d87a3195Smrg     # when we should be linking with a yet-to-be-installed one
5592d87a3195Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
5593d87a3195Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
5594d87a3195Smrg    # Linking always hardcodes the temporary library directory.
5595d87a3195Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
5596d87a3195Smrg  else
5597d87a3195Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
5598d87a3195Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
5599d87a3195Smrg  fi
5600d87a3195Smrgelse
5601d87a3195Smrg  # We cannot hardcode anything, or else we can only hardcode existing
5602d87a3195Smrg  # directories.
5603d87a3195Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
5604d87a3195Smrgfi
5605d87a3195SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
56062378475aSmrg
5607d87a3195Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
5608d87a3195Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
5609d87a3195Smrg  # Fast installation is not supported
5610d87a3195Smrg  enable_fast_install=no
5611d87a3195Smrgelif test yes = "$shlibpath_overrides_runpath" ||
5612d87a3195Smrg     test no = "$enable_shared"; then
5613d87a3195Smrg  # Fast installation is not necessary
5614d87a3195Smrg  enable_fast_install=needless
5615d87a3195Smrgfi
5616d87a3195Smrg_LT_TAGDECL([], [hardcode_action], [0],
5617d87a3195Smrg    [How to hardcode a shared library path into an executable])
5618d87a3195Smrg])# _LT_LINKER_HARDCODE_LIBPATH
56192378475aSmrg
56202378475aSmrg
5621d87a3195Smrg# _LT_CMD_STRIPLIB
5622d87a3195Smrg# ----------------
5623d87a3195Smrgm4_defun([_LT_CMD_STRIPLIB],
5624d87a3195Smrg[m4_require([_LT_DECL_EGREP])
5625d87a3195Smrgstriplib=
5626d87a3195Smrgold_striplib=
5627d87a3195SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
5628d87a3195Smrgif test -z "$STRIP"; then
5629d87a3195Smrg  AC_MSG_RESULT([no])
5630d87a3195Smrgelse
5631d87a3195Smrg  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
5632d87a3195Smrg    old_striplib="$STRIP --strip-debug"
5633d87a3195Smrg    striplib="$STRIP --strip-unneeded"
5634d87a3195Smrg    AC_MSG_RESULT([yes])
5635d87a3195Smrg  else
5636d87a3195Smrg    case $host_os in
5637d87a3195Smrg    darwin*)
5638d87a3195Smrg      # FIXME - insert some real tests, host_os isn't really good enough
5639d87a3195Smrg      striplib="$STRIP -x"
5640d87a3195Smrg      old_striplib="$STRIP -S"
5641d87a3195Smrg      AC_MSG_RESULT([yes])
5642d87a3195Smrg      ;;
5643d87a3195Smrg    freebsd*)
5644d87a3195Smrg      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
5645d87a3195Smrg        old_striplib="$STRIP --strip-debug"
5646d87a3195Smrg        striplib="$STRIP --strip-unneeded"
5647d87a3195Smrg        AC_MSG_RESULT([yes])
5648d87a3195Smrg      else
5649d87a3195Smrg        AC_MSG_RESULT([no])
5650d87a3195Smrg      fi
5651d87a3195Smrg      ;;
5652d87a3195Smrg    *)
5653d87a3195Smrg      AC_MSG_RESULT([no])
5654d87a3195Smrg      ;;
5655d87a3195Smrg    esac
5656d87a3195Smrg  fi
5657d87a3195Smrgfi
5658d87a3195Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
5659d87a3195Smrg_LT_DECL([], [striplib], [1])
5660d87a3195Smrg])# _LT_CMD_STRIPLIB
56612378475aSmrg
56622378475aSmrg
5663d87a3195Smrg# _LT_PREPARE_MUNGE_PATH_LIST
5664d87a3195Smrg# ---------------------------
5665d87a3195Smrg# Make sure func_munge_path_list() is defined correctly.
5666d87a3195Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
5667d87a3195Smrg[[# func_munge_path_list VARIABLE PATH
5668d87a3195Smrg# -----------------------------------
5669d87a3195Smrg# VARIABLE is name of variable containing _space_ separated list of
5670d87a3195Smrg# directories to be munged by the contents of PATH, which is string
5671d87a3195Smrg# having a format:
5672d87a3195Smrg# "DIR[:DIR]:"
5673d87a3195Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
5674d87a3195Smrg# ":DIR[:DIR]"
5675d87a3195Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
5676d87a3195Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
5677d87a3195Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
5678d87a3195Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
5679d87a3195Smrg# "DIR[:DIR]"
5680d87a3195Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
5681d87a3195Smrgfunc_munge_path_list ()
5682d87a3195Smrg{
5683d87a3195Smrg    case x@S|@2 in
5684d87a3195Smrg    x)
5685d87a3195Smrg        ;;
5686d87a3195Smrg    *:)
5687d87a3195Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
5688d87a3195Smrg        ;;
5689d87a3195Smrg    x:*)
5690d87a3195Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
5691d87a3195Smrg        ;;
5692d87a3195Smrg    *::*)
5693d87a3195Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
5694d87a3195Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
5695d87a3195Smrg        ;;
5696d87a3195Smrg    *)
5697d87a3195Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
5698d87a3195Smrg        ;;
5699d87a3195Smrg    esac
5700d87a3195Smrg}
5701d87a3195Smrg]])# _LT_PREPARE_PATH_LIST
57022378475aSmrg
57032378475aSmrg
5704d87a3195Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
5705d87a3195Smrg# -----------------------------
5706d87a3195Smrg# PORTME Fill in your ld.so characteristics
5707d87a3195Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
5708d87a3195Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5709d87a3195Smrgm4_require([_LT_DECL_EGREP])dnl
5710d87a3195Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5711d87a3195Smrgm4_require([_LT_DECL_OBJDUMP])dnl
5712d87a3195Smrgm4_require([_LT_DECL_SED])dnl
5713d87a3195Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
5714d87a3195Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
5715d87a3195SmrgAC_MSG_CHECKING([dynamic linker characteristics])
5716d87a3195Smrgm4_if([$1],
5717d87a3195Smrg	[], [
5718d87a3195Smrgif test yes = "$GCC"; then
5719d87a3195Smrg  case $host_os in
5720d87a3195Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
5721d87a3195Smrg    *) lt_awk_arg='/^libraries:/' ;;
5722d87a3195Smrg  esac
5723d87a3195Smrg  case $host_os in
5724d87a3195Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
5725d87a3195Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
5726d87a3195Smrg  esac
5727d87a3195Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
5728d87a3195Smrg  case $lt_search_path_spec in
5729d87a3195Smrg  *\;*)
5730d87a3195Smrg    # if the path contains ";" then we assume it to be the separator
5731d87a3195Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
5732d87a3195Smrg    # assumed that no part of a normal pathname contains ";" but that should
5733d87a3195Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
5734d87a3195Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
5735d87a3195Smrg    ;;
5736d87a3195Smrg  *)
5737d87a3195Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
5738d87a3195Smrg    ;;
5739d87a3195Smrg  esac
5740d87a3195Smrg  # Ok, now we have the path, separated by spaces, we can step through it
5741d87a3195Smrg  # and add multilib dir if necessary...
5742d87a3195Smrg  lt_tmp_lt_search_path_spec=
5743d87a3195Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
5744d87a3195Smrg  # ...but if some path component already ends with the multilib dir we assume
5745d87a3195Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
5746d87a3195Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
5747d87a3195Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
5748d87a3195Smrg    lt_multi_os_dir=
5749d87a3195Smrg    ;;
5750d87a3195Smrg  esac
5751d87a3195Smrg  for lt_sys_path in $lt_search_path_spec; do
5752d87a3195Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
5753d87a3195Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
5754d87a3195Smrg    elif test -n "$lt_multi_os_dir"; then
5755d87a3195Smrg      test -d "$lt_sys_path" && \
5756d87a3195Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
5757d87a3195Smrg    fi
5758d87a3195Smrg  done
5759d87a3195Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
5760d87a3195SmrgBEGIN {RS = " "; FS = "/|\n";} {
5761d87a3195Smrg  lt_foo = "";
5762d87a3195Smrg  lt_count = 0;
5763d87a3195Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
5764d87a3195Smrg    if ($lt_i != "" && $lt_i != ".") {
5765d87a3195Smrg      if ($lt_i == "..") {
5766d87a3195Smrg        lt_count++;
5767d87a3195Smrg      } else {
5768d87a3195Smrg        if (lt_count == 0) {
5769d87a3195Smrg          lt_foo = "/" $lt_i lt_foo;
5770d87a3195Smrg        } else {
5771d87a3195Smrg          lt_count--;
5772d87a3195Smrg        }
5773d87a3195Smrg      }
5774d87a3195Smrg    }
5775d87a3195Smrg  }
5776d87a3195Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
5777d87a3195Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
5778d87a3195Smrg}'`
5779d87a3195Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
5780d87a3195Smrg  # for these hosts.
5781d87a3195Smrg  case $host_os in
5782d87a3195Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
5783d87a3195Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
5784d87a3195Smrg  esac
5785d87a3195Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
5786d87a3195Smrgelse
5787d87a3195Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
5788d87a3195Smrgfi])
5789d87a3195Smrglibrary_names_spec=
5790d87a3195Smrglibname_spec='lib$name'
5791d87a3195Smrgsoname_spec=
5792d87a3195Smrgshrext_cmds=.so
5793d87a3195Smrgpostinstall_cmds=
5794d87a3195Smrgpostuninstall_cmds=
5795d87a3195Smrgfinish_cmds=
5796d87a3195Smrgfinish_eval=
5797d87a3195Smrgshlibpath_var=
5798d87a3195Smrgshlibpath_overrides_runpath=unknown
5799d87a3195Smrgversion_type=none
5800d87a3195Smrgdynamic_linker="$host_os ld.so"
5801d87a3195Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
5802d87a3195Smrgneed_lib_prefix=unknown
5803d87a3195Smrghardcode_into_libs=no
5804d87a3195Smrg
5805d87a3195Smrg# when you set need_version to no, make sure it does not cause -set_version
5806d87a3195Smrg# flags to be left without arguments
5807d87a3195Smrgneed_version=unknown
58082378475aSmrg
5809d87a3195SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
5810d87a3195Smrg[User-defined run-time library search path.])
58112378475aSmrg
5812d87a3195Smrgcase $host_os in
5813d87a3195Smrgaix3*)
5814d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
5815d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
5816d87a3195Smrg  shlibpath_var=LIBPATH
58172378475aSmrg
5818d87a3195Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
5819d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
5820d87a3195Smrg  ;;
58212378475aSmrg
5822d87a3195Smrgaix[[4-9]]*)
5823d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
5824d87a3195Smrg  need_lib_prefix=no
5825d87a3195Smrg  need_version=no
5826d87a3195Smrg  hardcode_into_libs=yes
5827d87a3195Smrg  if test ia64 = "$host_cpu"; then
5828d87a3195Smrg    # AIX 5 supports IA64
5829d87a3195Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
5830d87a3195Smrg    shlibpath_var=LD_LIBRARY_PATH
5831d87a3195Smrg  else
5832d87a3195Smrg    # With GCC up to 2.95.x, collect2 would create an import file
5833d87a3195Smrg    # for dependence libraries.  The import file would start with
5834d87a3195Smrg    # the line '#! .'.  This would cause the generated library to
5835d87a3195Smrg    # depend on '.', always an invalid library.  This was fixed in
5836d87a3195Smrg    # development snapshots of GCC prior to 3.0.
5837d87a3195Smrg    case $host_os in
5838d87a3195Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
5839d87a3195Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
5840d87a3195Smrg	   echo ' yes '
5841d87a3195Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
5842d87a3195Smrg	:
5843d87a3195Smrg      else
5844d87a3195Smrg	can_build_shared=no
5845d87a3195Smrg      fi
5846d87a3195Smrg      ;;
5847d87a3195Smrg    esac
5848d87a3195Smrg    # Using Import Files as archive members, it is possible to support
5849d87a3195Smrg    # filename-based versioning of shared library archives on AIX. While
5850d87a3195Smrg    # this would work for both with and without runtime linking, it will
5851d87a3195Smrg    # prevent static linking of such archives. So we do filename-based
5852d87a3195Smrg    # shared library versioning with .so extension only, which is used
5853d87a3195Smrg    # when both runtime linking and shared linking is enabled.
5854d87a3195Smrg    # Unfortunately, runtime linking may impact performance, so we do
5855d87a3195Smrg    # not want this to be the default eventually. Also, we use the
5856d87a3195Smrg    # versioned .so libs for executables only if there is the -brtl
5857d87a3195Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
5858d87a3195Smrg    # To allow for filename-based versioning support, we need to create
5859d87a3195Smrg    # libNAME.so.V as an archive file, containing:
5860d87a3195Smrg    # *) an Import File, referring to the versioned filename of the
5861d87a3195Smrg    #    archive as well as the shared archive member, telling the
5862d87a3195Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
5863d87a3195Smrg    #    list of exported symbols of that shared object, eventually
5864d87a3195Smrg    #    decorated with the 'weak' keyword
5865d87a3195Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
5866d87a3195Smrg    #    it being seen by the linker.
5867d87a3195Smrg    # At run time we better use the real file rather than another symlink,
5868d87a3195Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
58692378475aSmrg
5870d87a3195Smrg    case $with_aix_soname,$aix_use_runtimelinking in
5871d87a3195Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
5872d87a3195Smrg    # soname into executable. Probably we can add versioning support to
5873d87a3195Smrg    # collect2, so additional links can be useful in future.
5874d87a3195Smrg    aix,yes) # traditional libtool
5875d87a3195Smrg      dynamic_linker='AIX unversionable lib.so'
5876d87a3195Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
5877d87a3195Smrg      # instead of lib<name>.a to let people know that these are not
5878d87a3195Smrg      # typical AIX shared libraries.
5879d87a3195Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5880d87a3195Smrg      ;;
5881d87a3195Smrg    aix,no) # traditional AIX only
5882d87a3195Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
5883d87a3195Smrg      # We preserve .a as extension for shared libraries through AIX4.2
5884d87a3195Smrg      # and later when we are not doing run time linking.
5885d87a3195Smrg      library_names_spec='$libname$release.a $libname.a'
5886d87a3195Smrg      soname_spec='$libname$release$shared_ext$major'
5887d87a3195Smrg      ;;
5888d87a3195Smrg    svr4,*) # full svr4 only
5889d87a3195Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
5890d87a3195Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5891d87a3195Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
5892d87a3195Smrg      shlibpath_overrides_runpath=yes
5893d87a3195Smrg      ;;
5894d87a3195Smrg    *,yes) # both, prefer svr4
5895d87a3195Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
5896d87a3195Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5897d87a3195Smrg      # unpreferred sharedlib libNAME.a needs extra handling
5898d87a3195Smrg      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
5899d87a3195Smrg      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
5900d87a3195Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
5901d87a3195Smrg      shlibpath_overrides_runpath=yes
5902d87a3195Smrg      ;;
5903d87a3195Smrg    *,no) # both, prefer aix
5904d87a3195Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
5905d87a3195Smrg      library_names_spec='$libname$release.a $libname.a'
5906d87a3195Smrg      soname_spec='$libname$release$shared_ext$major'
5907d87a3195Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
5908d87a3195Smrg      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
5909d87a3195Smrg      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
5910d87a3195Smrg      ;;
5911d87a3195Smrg    esac
5912d87a3195Smrg    shlibpath_var=LIBPATH
5913d87a3195Smrg  fi
5914d87a3195Smrg  ;;
59152378475aSmrg
5916d87a3195Smrgamigaos*)
5917d87a3195Smrg  case $host_cpu in
5918d87a3195Smrg  powerpc)
5919d87a3195Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
5920d87a3195Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
5921d87a3195Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5922d87a3195Smrg    ;;
5923d87a3195Smrg  m68k)
5924d87a3195Smrg    library_names_spec='$libname.ixlibrary $libname.a'
5925d87a3195Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
5926d87a3195Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
5927d87a3195Smrg    ;;
5928d87a3195Smrg  esac
5929d87a3195Smrg  ;;
59302378475aSmrg
5931d87a3195Smrgbeos*)
5932d87a3195Smrg  library_names_spec='$libname$shared_ext'
5933d87a3195Smrg  dynamic_linker="$host_os ld.so"
5934d87a3195Smrg  shlibpath_var=LIBRARY_PATH
5935d87a3195Smrg  ;;
59362378475aSmrg
5937d87a3195Smrgbsdi[[45]]*)
5938d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
5939d87a3195Smrg  need_version=no
5940d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5941d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
5942d87a3195Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
5943d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
5944d87a3195Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
5945d87a3195Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
5946d87a3195Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
5947d87a3195Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
5948d87a3195Smrg  # libtool to hard-code these into programs
5949d87a3195Smrg  ;;
59502378475aSmrg
5951d87a3195Smrgcygwin* | mingw* | pw32* | cegcc*)
5952d87a3195Smrg  version_type=windows
5953d87a3195Smrg  shrext_cmds=.dll
5954d87a3195Smrg  need_version=no
5955d87a3195Smrg  need_lib_prefix=no
59562378475aSmrg
5957d87a3195Smrg  case $GCC,$cc_basename in
5958d87a3195Smrg  yes,*)
5959d87a3195Smrg    # gcc
5960d87a3195Smrg    library_names_spec='$libname.dll.a'
5961d87a3195Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
5962d87a3195Smrg    postinstall_cmds='base_file=`basename \$file`~
5963d87a3195Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
5964d87a3195Smrg      dldir=$destdir/`dirname \$dlpath`~
5965d87a3195Smrg      test -d \$dldir || mkdir -p \$dldir~
5966d87a3195Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
5967d87a3195Smrg      chmod a+x \$dldir/$dlname~
5968d87a3195Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
5969d87a3195Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
5970d87a3195Smrg      fi'
5971d87a3195Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
5972d87a3195Smrg      dlpath=$dir/\$dldll~
5973d87a3195Smrg       $RM \$dlpath'
5974d87a3195Smrg    shlibpath_overrides_runpath=yes
59752378475aSmrg
5976d87a3195Smrg    case $host_os in
5977d87a3195Smrg    cygwin*)
5978d87a3195Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
5979d87a3195Smrg      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5980d87a3195Smrgm4_if([$1], [],[
5981d87a3195Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
5982d87a3195Smrg      ;;
5983d87a3195Smrg    mingw* | cegcc*)
5984d87a3195Smrg      # MinGW DLLs use traditional 'lib' prefix
5985d87a3195Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5986d87a3195Smrg      ;;
5987d87a3195Smrg    pw32*)
5988d87a3195Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
5989d87a3195Smrg      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5990d87a3195Smrg      ;;
5991d87a3195Smrg    esac
5992d87a3195Smrg    dynamic_linker='Win32 ld.exe'
5993d87a3195Smrg    ;;
59942378475aSmrg
5995d87a3195Smrg  *,cl* | *,icl*)
5996d87a3195Smrg    # Native MSVC or ICC
5997d87a3195Smrg    libname_spec='$name'
5998d87a3195Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5999d87a3195Smrg    library_names_spec='$libname.dll.lib'
60002378475aSmrg
6001d87a3195Smrg    case $build_os in
6002d87a3195Smrg    mingw*)
6003d87a3195Smrg      sys_lib_search_path_spec=
6004d87a3195Smrg      lt_save_ifs=$IFS
6005d87a3195Smrg      IFS=';'
6006d87a3195Smrg      for lt_path in $LIB
6007d87a3195Smrg      do
6008d87a3195Smrg        IFS=$lt_save_ifs
6009d87a3195Smrg        # Let DOS variable expansion print the short 8.3 style file name.
6010d87a3195Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
6011d87a3195Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
6012d87a3195Smrg      done
6013d87a3195Smrg      IFS=$lt_save_ifs
6014d87a3195Smrg      # Convert to MSYS style.
6015d87a3195Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
6016d87a3195Smrg      ;;
6017d87a3195Smrg    cygwin*)
6018d87a3195Smrg      # Convert to unix form, then to dos form, then back to unix form
6019d87a3195Smrg      # but this time dos style (no spaces!) so that the unix form looks
6020d87a3195Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
6021d87a3195Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
6022d87a3195Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
6023d87a3195Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
6024d87a3195Smrg      ;;
6025d87a3195Smrg    *)
6026d87a3195Smrg      sys_lib_search_path_spec=$LIB
6027d87a3195Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
6028d87a3195Smrg        # It is most probably a Windows format PATH.
6029d87a3195Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
6030d87a3195Smrg      else
6031d87a3195Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
6032d87a3195Smrg      fi
6033d87a3195Smrg      # FIXME: find the short name or the path components, as spaces are
6034d87a3195Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
6035d87a3195Smrg      ;;
6036d87a3195Smrg    esac
60372378475aSmrg
6038d87a3195Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
6039d87a3195Smrg    postinstall_cmds='base_file=`basename \$file`~
6040d87a3195Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
6041d87a3195Smrg      dldir=$destdir/`dirname \$dlpath`~
6042d87a3195Smrg      test -d \$dldir || mkdir -p \$dldir~
6043d87a3195Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
6044d87a3195Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
6045d87a3195Smrg      dlpath=$dir/\$dldll~
6046d87a3195Smrg       $RM \$dlpath'
6047d87a3195Smrg    shlibpath_overrides_runpath=yes
6048d87a3195Smrg    dynamic_linker='Win32 link.exe'
6049d87a3195Smrg    ;;
60502378475aSmrg
6051d87a3195Smrg  *)
6052d87a3195Smrg    # Assume MSVC and ICC wrapper
6053d87a3195Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
6054d87a3195Smrg    dynamic_linker='Win32 ld.exe'
6055d87a3195Smrg    ;;
6056d87a3195Smrg  esac
6057d87a3195Smrg  # FIXME: first we should search . and the directory the executable is in
6058d87a3195Smrg  shlibpath_var=PATH
6059d87a3195Smrg  ;;
60602378475aSmrg
6061d87a3195Smrgdarwin* | rhapsody*)
6062d87a3195Smrg  dynamic_linker="$host_os dyld"
6063d87a3195Smrg  version_type=darwin
6064d87a3195Smrg  need_lib_prefix=no
6065d87a3195Smrg  need_version=no
6066d87a3195Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
6067d87a3195Smrg  soname_spec='$libname$release$major$shared_ext'
6068d87a3195Smrg  shlibpath_overrides_runpath=yes
6069d87a3195Smrg  shlibpath_var=DYLD_LIBRARY_PATH
6070d87a3195Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
6071d87a3195Smrgm4_if([$1], [],[
6072d87a3195Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
6073d87a3195Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
6074d87a3195Smrg  ;;
60752378475aSmrg
6076d87a3195Smrgdgux*)
6077d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6078d87a3195Smrg  need_lib_prefix=no
6079d87a3195Smrg  need_version=no
6080d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6081d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6082d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6083d87a3195Smrg  ;;
608495b296d0Smrg
6085d87a3195Smrgfreebsd* | dragonfly* | midnightbsd*)
6086d87a3195Smrg  # DragonFly does not have aout.  When/if they implement a new
6087d87a3195Smrg  # versioning mechanism, adjust this.
6088d87a3195Smrg  if test -x /usr/bin/objformat; then
6089d87a3195Smrg    objformat=`/usr/bin/objformat`
6090d87a3195Smrg  else
6091d87a3195Smrg    case $host_os in
6092d87a3195Smrg    freebsd[[23]].*) objformat=aout ;;
6093d87a3195Smrg    *) objformat=elf ;;
6094d87a3195Smrg    esac
6095d87a3195Smrg  fi
6096d87a3195Smrg  version_type=freebsd-$objformat
6097d87a3195Smrg  case $version_type in
6098d87a3195Smrg    freebsd-elf*)
6099d87a3195Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6100d87a3195Smrg      soname_spec='$libname$release$shared_ext$major'
6101d87a3195Smrg      need_version=no
6102d87a3195Smrg      need_lib_prefix=no
6103d87a3195Smrg      ;;
6104d87a3195Smrg    freebsd-*)
6105d87a3195Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6106d87a3195Smrg      need_version=yes
610714330f12Smrg      ;;
6108d87a3195Smrg  esac
6109d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6110d87a3195Smrg  case $host_os in
6111d87a3195Smrg  freebsd2.*)
6112d87a3195Smrg    shlibpath_overrides_runpath=yes
6113d87a3195Smrg    ;;
6114d87a3195Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
6115d87a3195Smrg    shlibpath_overrides_runpath=yes
6116d87a3195Smrg    hardcode_into_libs=yes
6117d87a3195Smrg    ;;
6118d87a3195Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
6119d87a3195Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
6120d87a3195Smrg    shlibpath_overrides_runpath=no
6121d87a3195Smrg    hardcode_into_libs=yes
6122d87a3195Smrg    ;;
6123d87a3195Smrg  *) # from 4.6 on, and DragonFly
6124d87a3195Smrg    shlibpath_overrides_runpath=yes
6125d87a3195Smrg    hardcode_into_libs=yes
6126d87a3195Smrg    ;;
6127d87a3195Smrg  esac
6128d87a3195Smrg  ;;
6129d87a3195Smrg
6130d87a3195Smrghaiku*)
6131d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6132d87a3195Smrg  need_lib_prefix=no
6133d87a3195Smrg  need_version=no
6134d87a3195Smrg  dynamic_linker="$host_os runtime_loader"
6135d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6136d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6137d87a3195Smrg  shlibpath_var=LIBRARY_PATH
6138d87a3195Smrg  shlibpath_overrides_runpath=no
6139d87a3195Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
6140d87a3195Smrg  hardcode_into_libs=yes
6141d87a3195Smrg  ;;
614295b296d0Smrg
6143d87a3195Smrghpux9* | hpux10* | hpux11*)
6144d87a3195Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
6145d87a3195Smrg  # link against other versions.
6146d87a3195Smrg  version_type=sunos
6147d87a3195Smrg  need_lib_prefix=no
6148d87a3195Smrg  need_version=no
6149d87a3195Smrg  case $host_cpu in
6150d87a3195Smrg  ia64*)
6151d87a3195Smrg    shrext_cmds='.so'
6152d87a3195Smrg    hardcode_into_libs=yes
6153d87a3195Smrg    dynamic_linker="$host_os dld.so"
6154d87a3195Smrg    shlibpath_var=LD_LIBRARY_PATH
6155d87a3195Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6156d87a3195Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6157d87a3195Smrg    soname_spec='$libname$release$shared_ext$major'
6158d87a3195Smrg    if test 32 = "$HPUX_IA64_MODE"; then
6159d87a3195Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
6160d87a3195Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
6161d87a3195Smrg    else
6162d87a3195Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
6163d87a3195Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
6164d87a3195Smrg    fi
6165d87a3195Smrg    ;;
6166d87a3195Smrg  hppa*64*)
6167d87a3195Smrg    shrext_cmds='.sl'
6168d87a3195Smrg    hardcode_into_libs=yes
6169d87a3195Smrg    dynamic_linker="$host_os dld.sl"
6170d87a3195Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
6171d87a3195Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6172d87a3195Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6173d87a3195Smrg    soname_spec='$libname$release$shared_ext$major'
6174d87a3195Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
6175d87a3195Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6176d87a3195Smrg    ;;
6177d87a3195Smrg  *)
6178d87a3195Smrg    shrext_cmds='.sl'
6179d87a3195Smrg    dynamic_linker="$host_os dld.sl"
6180d87a3195Smrg    shlibpath_var=SHLIB_PATH
6181d87a3195Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6182d87a3195Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6183d87a3195Smrg    soname_spec='$libname$release$shared_ext$major'
6184d87a3195Smrg    ;;
6185d87a3195Smrg  esac
6186d87a3195Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
6187d87a3195Smrg  postinstall_cmds='chmod 555 $lib'
6188d87a3195Smrg  # or fails outright, so override atomically:
6189d87a3195Smrg  install_override_mode=555
6190d87a3195Smrg  ;;
619195b296d0Smrg
6192d87a3195Smrginterix[[3-9]]*)
6193d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6194d87a3195Smrg  need_lib_prefix=no
6195d87a3195Smrg  need_version=no
6196d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6197d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6198d87a3195Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
6199d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6200d87a3195Smrg  shlibpath_overrides_runpath=no
6201d87a3195Smrg  hardcode_into_libs=yes
6202d87a3195Smrg  ;;
620395b296d0Smrg
6204d87a3195Smrgirix5* | irix6* | nonstopux*)
6205d87a3195Smrg  case $host_os in
6206d87a3195Smrg    nonstopux*) version_type=nonstopux ;;
6207d87a3195Smrg    *)
6208d87a3195Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
6209d87a3195Smrg		version_type=linux # correct to gnu/linux during the next big refactor
6210d87a3195Smrg	else
6211d87a3195Smrg		version_type=irix
6212d87a3195Smrg	fi ;;
6213d87a3195Smrg  esac
6214d87a3195Smrg  need_lib_prefix=no
6215d87a3195Smrg  need_version=no
6216d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6217d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
6218d87a3195Smrg  case $host_os in
6219d87a3195Smrg  irix5* | nonstopux*)
6220d87a3195Smrg    libsuff= shlibsuff=
6221d87a3195Smrg    ;;
6222d87a3195Smrg  *)
6223d87a3195Smrg    case $LD in # libtool.m4 will add one of these switches to LD
6224d87a3195Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
6225d87a3195Smrg      libsuff= shlibsuff= libmagic=32-bit;;
6226d87a3195Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
6227d87a3195Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
6228d87a3195Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
6229d87a3195Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
6230d87a3195Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
623114330f12Smrg    esac
6232d87a3195Smrg    ;;
6233d87a3195Smrg  esac
6234d87a3195Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6235d87a3195Smrg  shlibpath_overrides_runpath=no
6236d87a3195Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
6237d87a3195Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
6238d87a3195Smrg  hardcode_into_libs=yes
6239d87a3195Smrg  ;;
624095b296d0Smrg
6241d87a3195Smrg# No shared lib support for Linux oldld, aout, or coff.
6242d87a3195Smrglinux*oldld* | linux*aout* | linux*coff*)
6243d87a3195Smrg  dynamic_linker=no
6244d87a3195Smrg  ;;
624595b296d0Smrg
6246d87a3195Smrglinux*android*)
6247d87a3195Smrg  version_type=none # Android doesn't support versioned libraries.
6248d87a3195Smrg  need_lib_prefix=no
6249d87a3195Smrg  need_version=no
6250d87a3195Smrg  library_names_spec='$libname$release$shared_ext'
6251d87a3195Smrg  soname_spec='$libname$release$shared_ext'
6252d87a3195Smrg  finish_cmds=
6253d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6254d87a3195Smrg  shlibpath_overrides_runpath=yes
625595b296d0Smrg
6256d87a3195Smrg  # This implies no fast_install, which is unacceptable.
6257d87a3195Smrg  # Some rework will be needed to allow for fast_install
6258d87a3195Smrg  # before this can be enabled.
6259d87a3195Smrg  hardcode_into_libs=yes
626095b296d0Smrg
6261d87a3195Smrg  dynamic_linker='Android linker'
6262d87a3195Smrg  # Don't embed -rpath directories since the linker doesn't support them.
6263d87a3195Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6264d87a3195Smrg  ;;
626539713583Smrg
6266d87a3195Smrg# This must be glibc/ELF.
6267d87a3195Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6268d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6269d87a3195Smrg  need_lib_prefix=no
6270d87a3195Smrg  need_version=no
6271d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6272d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6273d87a3195Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6274d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6275d87a3195Smrg  shlibpath_overrides_runpath=no
627639713583Smrg
6277d87a3195Smrg  # Some binutils ld are patched to set DT_RUNPATH
6278d87a3195Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
6279d87a3195Smrg    [lt_cv_shlibpath_overrides_runpath=no
6280d87a3195Smrg    save_LDFLAGS=$LDFLAGS
6281d87a3195Smrg    save_libdir=$libdir
6282d87a3195Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
6283d87a3195Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
6284d87a3195Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
6285d87a3195Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
6286d87a3195Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
6287d87a3195Smrg    LDFLAGS=$save_LDFLAGS
6288d87a3195Smrg    libdir=$save_libdir
6289d87a3195Smrg    ])
6290d87a3195Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
62912378475aSmrg
6292d87a3195Smrg  # This implies no fast_install, which is unacceptable.
6293d87a3195Smrg  # Some rework will be needed to allow for fast_install
6294d87a3195Smrg  # before this can be enabled.
6295d87a3195Smrg  hardcode_into_libs=yes
629695b296d0Smrg
6297d87a3195Smrg  # Ideally, we could use ldconfig to report *all* directores which are
6298d87a3195Smrg  # searched for libraries, however this is still not possible.  Aside from not
6299d87a3195Smrg  # being certain /sbin/ldconfig is available, command
6300d87a3195Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
6301d87a3195Smrg  # even though it is searched at run-time.  Try to do the best guess by
6302d87a3195Smrg  # appending ld.so.conf contents (and includes) to the search path.
6303d87a3195Smrg  if test -f /etc/ld.so.conf; then
6304d87a3195Smrg    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' ' '`
6305d87a3195Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
6306d87a3195Smrg  fi
630789b0dc75Smrg
6308d87a3195Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
6309d87a3195Smrg  # powerpc, because MkLinux only supported shared libraries with the
6310d87a3195Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
6311d87a3195Smrg  # most powerpc-linux boxes support dynamic linking these days and
6312d87a3195Smrg  # people can always --disable-shared, the test was removed, and we
6313d87a3195Smrg  # assume the GNU/Linux dynamic linker is in use.
6314d87a3195Smrg  dynamic_linker='GNU/Linux ld.so'
6315d87a3195Smrg  ;;
631695b296d0Smrg
6317d87a3195Smrgnetbsd*)
6318d87a3195Smrg  version_type=sunos
6319d87a3195Smrg  need_lib_prefix=no
6320d87a3195Smrg  need_version=no
6321d87a3195Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6322d87a3195Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6323d87a3195Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6324d87a3195Smrg    dynamic_linker='NetBSD (a.out) ld.so'
6325d87a3195Smrg  else
6326d87a3195Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6327d87a3195Smrg    soname_spec='$libname$release$shared_ext$major'
6328d87a3195Smrg    dynamic_linker='NetBSD ld.elf_so'
6329d87a3195Smrg  fi
6330d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6331d87a3195Smrg  shlibpath_overrides_runpath=yes
6332d87a3195Smrg  hardcode_into_libs=yes
6333d87a3195Smrg  ;;
633495b296d0Smrg
6335d87a3195Smrgnewsos6)
6336d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6337d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6338d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6339d87a3195Smrg  shlibpath_overrides_runpath=yes
6340d87a3195Smrg  ;;
634195b296d0Smrg
6342d87a3195Smrg*nto* | *qnx*)
6343d87a3195Smrg  version_type=qnx
6344d87a3195Smrg  need_lib_prefix=no
6345d87a3195Smrg  need_version=no
6346d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6347d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6348d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6349d87a3195Smrg  shlibpath_overrides_runpath=no
6350d87a3195Smrg  hardcode_into_libs=yes
6351d87a3195Smrg  dynamic_linker='ldqnx.so'
6352d87a3195Smrg  ;;
635395b296d0Smrg
6354d87a3195Smrgopenbsd* | bitrig*)
6355d87a3195Smrg  version_type=sunos
6356d87a3195Smrg  sys_lib_dlsearch_path_spec=/usr/lib
6357d87a3195Smrg  need_lib_prefix=no
6358d87a3195Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
6359d87a3195Smrg    need_version=no
6360d87a3195Smrg  else
6361d87a3195Smrg    need_version=yes
6362d87a3195Smrg  fi
6363d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6364d87a3195Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6365d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6366d87a3195Smrg  shlibpath_overrides_runpath=yes
6367d87a3195Smrg  ;;
636895b296d0Smrg
6369d87a3195Smrgos2*)
6370d87a3195Smrg  libname_spec='$name'
6371d87a3195Smrg  version_type=windows
6372d87a3195Smrg  shrext_cmds=.dll
6373d87a3195Smrg  need_version=no
6374d87a3195Smrg  need_lib_prefix=no
6375d87a3195Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
6376d87a3195Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
6377d87a3195Smrg    v=$($ECHO $release$versuffix | tr -d .-);
6378d87a3195Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
6379d87a3195Smrg    $ECHO $n$v`$shared_ext'
6380d87a3195Smrg  library_names_spec='${libname}_dll.$libext'
6381d87a3195Smrg  dynamic_linker='OS/2 ld.exe'
6382d87a3195Smrg  shlibpath_var=BEGINLIBPATH
6383d87a3195Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6384d87a3195Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6385d87a3195Smrg  postinstall_cmds='base_file=`basename \$file`~
6386d87a3195Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
6387d87a3195Smrg    dldir=$destdir/`dirname \$dlpath`~
6388d87a3195Smrg    test -d \$dldir || mkdir -p \$dldir~
6389d87a3195Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
6390d87a3195Smrg    chmod a+x \$dldir/$dlname~
6391d87a3195Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
6392d87a3195Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
6393d87a3195Smrg    fi'
6394d87a3195Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
6395d87a3195Smrg    dlpath=$dir/\$dldll~
6396d87a3195Smrg    $RM \$dlpath'
6397d87a3195Smrg  ;;
63982378475aSmrg
6399d87a3195Smrgosf3* | osf4* | osf5*)
6400d87a3195Smrg  version_type=osf
6401d87a3195Smrg  need_lib_prefix=no
6402d87a3195Smrg  need_version=no
6403d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6404d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6405d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6406d87a3195Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6407d87a3195Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6408d87a3195Smrg  ;;
64092378475aSmrg
6410d87a3195Smrgrdos*)
6411d87a3195Smrg  dynamic_linker=no
6412d87a3195Smrg  ;;
64132378475aSmrg
6414d87a3195Smrgsolaris*)
6415d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6416d87a3195Smrg  need_lib_prefix=no
6417d87a3195Smrg  need_version=no
6418d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6419d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6420d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6421d87a3195Smrg  shlibpath_overrides_runpath=yes
6422d87a3195Smrg  hardcode_into_libs=yes
6423d87a3195Smrg  # ldd complains unless libraries are executable
6424d87a3195Smrg  postinstall_cmds='chmod +x $lib'
6425d87a3195Smrg  ;;
64262378475aSmrg
6427d87a3195Smrgsunos4*)
6428d87a3195Smrg  version_type=sunos
6429d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6430d87a3195Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6431d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6432d87a3195Smrg  shlibpath_overrides_runpath=yes
6433d87a3195Smrg  if test yes = "$with_gnu_ld"; then
6434d87a3195Smrg    need_lib_prefix=no
6435d87a3195Smrg  fi
6436d87a3195Smrg  need_version=yes
6437d87a3195Smrg  ;;
6438d87a3195Smrg
6439d87a3195Smrgsysv4 | sysv4.3*)
6440d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6441d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6442d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6443d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6444d87a3195Smrg  case $host_vendor in
6445d87a3195Smrg    sni)
6446d87a3195Smrg      shlibpath_overrides_runpath=no
6447d87a3195Smrg      need_lib_prefix=no
6448d87a3195Smrg      runpath_var=LD_RUN_PATH
6449d87a3195Smrg      ;;
6450d87a3195Smrg    siemens)
6451d87a3195Smrg      need_lib_prefix=no
6452d87a3195Smrg      ;;
6453d87a3195Smrg    motorola)
6454d87a3195Smrg      need_lib_prefix=no
6455d87a3195Smrg      need_version=no
6456d87a3195Smrg      shlibpath_overrides_runpath=no
6457d87a3195Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6458d87a3195Smrg      ;;
6459d87a3195Smrg  esac
6460d87a3195Smrg  ;;
64612378475aSmrg
6462d87a3195Smrgsysv4*MP*)
6463d87a3195Smrg  if test -d /usr/nec; then
6464d87a3195Smrg    version_type=linux # correct to gnu/linux during the next big refactor
6465d87a3195Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
6466d87a3195Smrg    soname_spec='$libname$shared_ext.$major'
6467d87a3195Smrg    shlibpath_var=LD_LIBRARY_PATH
6468d87a3195Smrg  fi
6469d87a3195Smrg  ;;
647095b296d0Smrg
6471d87a3195Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
6472d87a3195Smrg  version_type=sco
6473d87a3195Smrg  need_lib_prefix=no
6474d87a3195Smrg  need_version=no
6475d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
6476d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6477d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6478d87a3195Smrg  shlibpath_overrides_runpath=yes
6479d87a3195Smrg  hardcode_into_libs=yes
6480d87a3195Smrg  if test yes = "$with_gnu_ld"; then
6481d87a3195Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
6482d87a3195Smrg  else
6483d87a3195Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
6484d87a3195Smrg    case $host_os in
6485d87a3195Smrg      sco3.2v5*)
6486d87a3195Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
6487d87a3195Smrg	;;
648814330f12Smrg    esac
6489d87a3195Smrg  fi
6490d87a3195Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
6491d87a3195Smrg  ;;
64922378475aSmrg
6493d87a3195Smrgtpf*)
6494d87a3195Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
6495d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6496d87a3195Smrg  need_lib_prefix=no
6497d87a3195Smrg  need_version=no
6498d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6499d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6500d87a3195Smrg  shlibpath_overrides_runpath=no
6501d87a3195Smrg  hardcode_into_libs=yes
6502d87a3195Smrg  ;;
650395b296d0Smrg
6504d87a3195Smrguts4*)
6505d87a3195Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6506d87a3195Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6507d87a3195Smrg  soname_spec='$libname$release$shared_ext$major'
6508d87a3195Smrg  shlibpath_var=LD_LIBRARY_PATH
6509d87a3195Smrg  ;;
651095b296d0Smrg
6511d87a3195Smrg*)
6512d87a3195Smrg  dynamic_linker=no
651314330f12Smrg  ;;
651414330f12Smrgesac
6515d87a3195SmrgAC_MSG_RESULT([$dynamic_linker])
6516d87a3195Smrgtest no = "$dynamic_linker" && can_build_shared=no
651739713583Smrg
6518d87a3195Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6519d87a3195Smrgif test yes = "$GCC"; then
6520d87a3195Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
652114330f12Smrgfi
652239713583Smrg
6523d87a3195Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
6524d87a3195Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
6525d87a3195Smrgfi
652695b296d0Smrg
6527d87a3195Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
6528d87a3195Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
652914330f12Smrgfi
653095b296d0Smrg
6531d87a3195Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
6532d87a3195Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
653395b296d0Smrg
6534d87a3195Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
6535d87a3195Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
653695b296d0Smrg
6537d87a3195Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
6538d87a3195Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
653995b296d0Smrg
6540d87a3195Smrg_LT_DECL([], [variables_saved_for_relink], [1],
6541d87a3195Smrg    [Variables whose values should be saved in libtool wrapper scripts and
6542d87a3195Smrg    restored at link time])
6543d87a3195Smrg_LT_DECL([], [need_lib_prefix], [0],
6544d87a3195Smrg    [Do we need the "lib" prefix for modules?])
6545d87a3195Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
6546d87a3195Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
6547d87a3195Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
6548d87a3195Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
6549d87a3195Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
6550d87a3195Smrg    [Is shlibpath searched before the hard-coded library search path?])
6551d87a3195Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
6552d87a3195Smrg_LT_DECL([], [library_names_spec], [1],
6553d87a3195Smrg    [[List of archive names.  First name is the real one, the rest are links.
6554d87a3195Smrg    The last name is the one that the linker finds with -lNAME]])
6555d87a3195Smrg_LT_DECL([], [soname_spec], [1],
6556d87a3195Smrg    [[The coded name of the library, if different from the real name]])
6557d87a3195Smrg_LT_DECL([], [install_override_mode], [1],
6558d87a3195Smrg    [Permission mode override for installation of shared libraries])
6559d87a3195Smrg_LT_DECL([], [postinstall_cmds], [2],
6560d87a3195Smrg    [Command to use after installation of a shared archive])
6561d87a3195Smrg_LT_DECL([], [postuninstall_cmds], [2],
6562d87a3195Smrg    [Command to use after uninstallation of a shared archive])
6563d87a3195Smrg_LT_DECL([], [finish_cmds], [2],
6564d87a3195Smrg    [Commands used to finish a libtool library installation in a directory])
6565d87a3195Smrg_LT_DECL([], [finish_eval], [1],
6566d87a3195Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
6567d87a3195Smrg    not shown]])
6568d87a3195Smrg_LT_DECL([], [hardcode_into_libs], [0],
6569d87a3195Smrg    [Whether we should hardcode library paths into libraries])
6570d87a3195Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
6571d87a3195Smrg    [Compile-time system search path for libraries])
6572d87a3195Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
6573d87a3195Smrg    [Detected run-time system search path for libraries])
6574d87a3195Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
6575d87a3195Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
6576d87a3195Smrg])# _LT_SYS_DYNAMIC_LINKER
657795b296d0Smrg
657895b296d0Smrg
6579d87a3195Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
6580d87a3195Smrg# --------------------------
6581d87a3195Smrg# find a file program that can recognize shared library
6582d87a3195SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
6583d87a3195Smrg[m4_require([_LT_DECL_EGREP])dnl
6584d87a3195SmrgAC_MSG_CHECKING([for $1])
6585d87a3195SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
6586d87a3195Smrg[case $MAGIC_CMD in
6587d87a3195Smrg[[\\/*] |  ?:[\\/]*])
6588d87a3195Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
6589d87a3195Smrg  ;;
6590d87a3195Smrg*)
6591d87a3195Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
6592d87a3195Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6593d87a3195Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
6594d87a3195Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
6595d87a3195Smrgdnl not every word.  This closes a longstanding sh security hole.
6596d87a3195Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
6597d87a3195Smrg  for ac_dir in $ac_dummy; do
6598d87a3195Smrg    IFS=$lt_save_ifs
6599d87a3195Smrg    test -z "$ac_dir" && ac_dir=.
6600d87a3195Smrg    if test -f "$ac_dir/$1"; then
6601d87a3195Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
6602d87a3195Smrg      if test -n "$file_magic_test_file"; then
6603d87a3195Smrg	case $deplibs_check_method in
6604d87a3195Smrg	"file_magic "*)
6605d87a3195Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
6606d87a3195Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
6607d87a3195Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
6608d87a3195Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
6609d87a3195Smrg	    :
6610d87a3195Smrg	  else
6611d87a3195Smrg	    cat <<_LT_EOF 1>&2
661295b296d0Smrg
6613d87a3195Smrg*** Warning: the command libtool uses to detect shared libraries,
6614d87a3195Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
6615d87a3195Smrg*** The result is that libtool may fail to recognize shared libraries
6616d87a3195Smrg*** as such.  This will affect the creation of libtool libraries that
6617d87a3195Smrg*** depend on shared libraries, but programs linked with such libtool
6618d87a3195Smrg*** libraries will work regardless of this problem.  Nevertheless, you
6619d87a3195Smrg*** may want to report the problem to your system manager and/or to
6620d87a3195Smrg*** bug-libtool@gnu.org
6621d87a3195Smrg
6622d87a3195Smrg_LT_EOF
6623d87a3195Smrg	  fi ;;
6624d87a3195Smrg	esac
6625d87a3195Smrg      fi
6626d87a3195Smrg      break
6627d87a3195Smrg    fi
6628d87a3195Smrg  done
6629d87a3195Smrg  IFS=$lt_save_ifs
6630d87a3195Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
6631d87a3195Smrg  ;;
6632d87a3195Smrgesac])
6633d87a3195SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
6634d87a3195Smrgif test -n "$MAGIC_CMD"; then
6635d87a3195Smrg  AC_MSG_RESULT($MAGIC_CMD)
6636d87a3195Smrgelse
6637d87a3195Smrg  AC_MSG_RESULT(no)
6638d87a3195Smrgfi
6639d87a3195Smrg_LT_DECL([], [MAGIC_CMD], [0],
6640d87a3195Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
6641d87a3195Smrg])# _LT_PATH_TOOL_PREFIX
664295b296d0Smrg
6643d87a3195Smrg# Old name:
6644d87a3195SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
6645d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
6646d87a3195Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
66472378475aSmrg
664814330f12Smrg
6649d87a3195Smrg# _LT_PATH_MAGIC
6650d87a3195Smrg# --------------
6651d87a3195Smrg# find a file program that can recognize a shared library
6652d87a3195Smrgm4_defun([_LT_PATH_MAGIC],
6653d87a3195Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
6654d87a3195Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
6655d87a3195Smrg  if test -n "$ac_tool_prefix"; then
6656d87a3195Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
6657d87a3195Smrg  else
6658d87a3195Smrg    MAGIC_CMD=:
6659d87a3195Smrg  fi
6660d87a3195Smrgfi
6661d87a3195Smrg])# _LT_PATH_MAGIC
666295b296d0Smrg
666395b296d0Smrg
6664d87a3195Smrg# LT_PATH_LD
6665d87a3195Smrg# ----------
6666d87a3195Smrg# find the pathname to the GNU or non-GNU linker
6667d87a3195SmrgAC_DEFUN([LT_PATH_LD],
6668d87a3195Smrg[AC_REQUIRE([AC_PROG_CC])dnl
6669d87a3195SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
6670d87a3195SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
6671d87a3195Smrgm4_require([_LT_DECL_SED])dnl
6672d87a3195Smrgm4_require([_LT_DECL_EGREP])dnl
6673d87a3195Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
667495b296d0Smrg
6675d87a3195SmrgAC_ARG_WITH([gnu-ld],
6676d87a3195Smrg    [AS_HELP_STRING([--with-gnu-ld],
6677d87a3195Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
6678d87a3195Smrg    [test no = "$withval" || with_gnu_ld=yes],
6679d87a3195Smrg    [with_gnu_ld=no])dnl
668014330f12Smrg
6681d87a3195Smrgac_prog=ld
6682d87a3195Smrgif test yes = "$GCC"; then
6683d87a3195Smrg  # Check if gcc -print-prog-name=ld gives a path.
6684d87a3195Smrg  AC_MSG_CHECKING([for ld used by $CC])
6685d87a3195Smrg  case $host in
6686d87a3195Smrg  *-*-mingw*)
6687d87a3195Smrg    # gcc leaves a trailing carriage return, which upsets mingw
6688d87a3195Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6689d87a3195Smrg  *)
6690d87a3195Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6691d87a3195Smrg  esac
6692d87a3195Smrg  case $ac_prog in
6693d87a3195Smrg    # Accept absolute paths.
6694d87a3195Smrg    [[\\/]]* | ?:[[\\/]]*)
6695d87a3195Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
6696d87a3195Smrg      # Canonicalize the pathname of ld
6697d87a3195Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
6698d87a3195Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
6699d87a3195Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
6700d87a3195Smrg      done
6701d87a3195Smrg      test -z "$LD" && LD=$ac_prog
6702d87a3195Smrg      ;;
6703d87a3195Smrg  "")
6704d87a3195Smrg    # If it fails, then pretend we aren't using GCC.
6705d87a3195Smrg    ac_prog=ld
6706d87a3195Smrg    ;;
6707d87a3195Smrg  *)
6708d87a3195Smrg    # If it is relative, then search for the first ld in PATH.
6709d87a3195Smrg    with_gnu_ld=unknown
6710d87a3195Smrg    ;;
6711d87a3195Smrg  esac
6712d87a3195Smrgelif test yes = "$with_gnu_ld"; then
6713d87a3195Smrg  AC_MSG_CHECKING([for GNU ld])
6714d87a3195Smrgelse
6715d87a3195Smrg  AC_MSG_CHECKING([for non-GNU ld])
6716d87a3195Smrgfi
6717d87a3195SmrgAC_CACHE_VAL(lt_cv_path_LD,
6718d87a3195Smrg[if test -z "$LD"; then
6719d87a3195Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6720d87a3195Smrg  for ac_dir in $PATH; do
6721d87a3195Smrg    IFS=$lt_save_ifs
6722d87a3195Smrg    test -z "$ac_dir" && ac_dir=.
6723d87a3195Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6724d87a3195Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
6725d87a3195Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
6726d87a3195Smrg      # but apparently some variants of GNU ld only accept -v.
6727d87a3195Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
6728d87a3195Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
6729d87a3195Smrg      *GNU* | *'with BFD'*)
6730d87a3195Smrg	test no != "$with_gnu_ld" && break
6731d87a3195Smrg	;;
6732d87a3195Smrg      *)
6733d87a3195Smrg	test yes != "$with_gnu_ld" && break
6734d87a3195Smrg	;;
6735d87a3195Smrg      esac
6736d87a3195Smrg    fi
6737d87a3195Smrg  done
6738d87a3195Smrg  IFS=$lt_save_ifs
6739d87a3195Smrgelse
6740d87a3195Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
6741d87a3195Smrgfi])
6742d87a3195SmrgLD=$lt_cv_path_LD
6743d87a3195Smrgif test -n "$LD"; then
6744d87a3195Smrg  AC_MSG_RESULT($LD)
6745d87a3195Smrgelse
6746d87a3195Smrg  AC_MSG_RESULT(no)
6747d87a3195Smrgfi
6748d87a3195Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
6749d87a3195Smrg_LT_PATH_LD_GNU
6750d87a3195SmrgAC_SUBST([LD])
675114330f12Smrg
6752d87a3195Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
6753d87a3195Smrg])# LT_PATH_LD
675414330f12Smrg
6755d87a3195Smrg# Old names:
6756d87a3195SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
6757d87a3195SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
6758d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
6759d87a3195Smrgdnl AC_DEFUN([AM_PROG_LD], [])
6760d87a3195Smrgdnl AC_DEFUN([AC_PROG_LD], [])
67612378475aSmrg
676295b296d0Smrg
6763d87a3195Smrg# _LT_PATH_LD_GNU
6764d87a3195Smrg#- --------------
6765d87a3195Smrgm4_defun([_LT_PATH_LD_GNU],
6766d87a3195Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
6767d87a3195Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
6768d87a3195Smrgcase `$LD -v 2>&1 </dev/null` in
6769d87a3195Smrg*GNU* | *'with BFD'*)
6770d87a3195Smrg  lt_cv_prog_gnu_ld=yes
6771d87a3195Smrg  ;;
6772d87a3195Smrg*)
6773d87a3195Smrg  lt_cv_prog_gnu_ld=no
6774d87a3195Smrg  ;;
6775d87a3195Smrgesac])
6776d87a3195Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
6777d87a3195Smrg])# _LT_PATH_LD_GNU
677895b296d0Smrg
677995b296d0Smrg
6780d87a3195Smrg# _LT_CMD_RELOAD
6781d87a3195Smrg# --------------
6782d87a3195Smrg# find reload flag for linker
6783d87a3195Smrg#   -- PORTME Some linkers may need a different reload flag.
6784d87a3195Smrgm4_defun([_LT_CMD_RELOAD],
6785d87a3195Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
6786d87a3195Smrg  lt_cv_ld_reload_flag,
6787d87a3195Smrg  [lt_cv_ld_reload_flag='-r'])
6788d87a3195Smrgreload_flag=$lt_cv_ld_reload_flag
6789d87a3195Smrgcase $reload_flag in
6790d87a3195Smrg"" | " "*) ;;
6791d87a3195Smrg*) reload_flag=" $reload_flag" ;;
6792d87a3195Smrgesac
6793d87a3195Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
6794d87a3195Smrgcase $host_os in
6795d87a3195Smrg  cygwin* | mingw* | pw32* | cegcc*)
6796d87a3195Smrg    if test yes != "$GCC"; then
6797d87a3195Smrg      reload_cmds=false
6798d87a3195Smrg    fi
6799d87a3195Smrg    ;;
6800d87a3195Smrg  darwin*)
6801d87a3195Smrg    if test yes = "$GCC"; then
6802d87a3195Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
6803d87a3195Smrg    else
6804d87a3195Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
6805d87a3195Smrg    fi
6806d87a3195Smrg    ;;
6807d87a3195Smrgesac
6808d87a3195Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
6809d87a3195Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
6810d87a3195Smrg])# _LT_CMD_RELOAD
681195b296d0Smrg
681295b296d0Smrg
6813d87a3195Smrg# _LT_PATH_DD
6814d87a3195Smrg# -----------
6815d87a3195Smrg# find a working dd
6816d87a3195Smrgm4_defun([_LT_PATH_DD],
6817d87a3195Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
6818d87a3195Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
6819d87a3195Smrgcat conftest.i conftest.i >conftest2.i
6820d87a3195Smrg: ${lt_DD:=$DD}
6821d87a3195SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
6822d87a3195Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6823d87a3195Smrg  cmp -s conftest.i conftest.out \
6824d87a3195Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6825d87a3195Smrgfi])
6826d87a3195Smrgrm -f conftest.i conftest2.i conftest.out])
6827d87a3195Smrg])# _LT_PATH_DD
682895b296d0Smrg
682995b296d0Smrg
6830d87a3195Smrg# _LT_CMD_TRUNCATE
6831d87a3195Smrg# ----------------
6832d87a3195Smrg# find command to truncate a binary pipe
6833d87a3195Smrgm4_defun([_LT_CMD_TRUNCATE],
6834d87a3195Smrg[m4_require([_LT_PATH_DD])
6835d87a3195SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
6836d87a3195Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
6837d87a3195Smrgcat conftest.i conftest.i >conftest2.i
6838d87a3195Smrglt_cv_truncate_bin=
6839d87a3195Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6840d87a3195Smrg  cmp -s conftest.i conftest.out \
6841d87a3195Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6842d87a3195Smrgfi
6843d87a3195Smrgrm -f conftest.i conftest2.i conftest.out
6844d87a3195Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
6845d87a3195Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
6846d87a3195Smrg  [Command to truncate a binary pipe])
6847d87a3195Smrg])# _LT_CMD_TRUNCATE
684895b296d0Smrg
684995b296d0Smrg
6850d87a3195Smrg# _LT_CHECK_MAGIC_METHOD
6851d87a3195Smrg# ----------------------
6852d87a3195Smrg# how to check for library dependencies
6853d87a3195Smrg#  -- PORTME fill in with the dynamic library characteristics
6854d87a3195Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
6855d87a3195Smrg[m4_require([_LT_DECL_EGREP])
6856d87a3195Smrgm4_require([_LT_DECL_OBJDUMP])
6857d87a3195SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
6858d87a3195Smrglt_cv_deplibs_check_method,
6859d87a3195Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
6860d87a3195Smrglt_cv_file_magic_test_file=
6861d87a3195Smrglt_cv_deplibs_check_method='unknown'
6862d87a3195Smrg# Need to set the preceding variable on all platforms that support
6863d87a3195Smrg# interlibrary dependencies.
6864d87a3195Smrg# 'none' -- dependencies not supported.
6865d87a3195Smrg# 'unknown' -- same as none, but documents that we really don't know.
6866d87a3195Smrg# 'pass_all' -- all dependencies passed with no checks.
6867d87a3195Smrg# 'test_compile' -- check by making test program.
6868d87a3195Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
6869d87a3195Smrg# that responds to the $file_magic_cmd with a given extended regex.
6870d87a3195Smrg# If you have 'file' or equivalent on your system and you're not sure
6871d87a3195Smrg# whether 'pass_all' will *always* work, you probably want this one.
687295b296d0Smrg
6873d87a3195Smrgcase $host_os in
6874d87a3195Smrgaix[[4-9]]*)
6875d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
6876d87a3195Smrg  ;;
687795b296d0Smrg
6878d87a3195Smrgbeos*)
6879d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
6880d87a3195Smrg  ;;
688195b296d0Smrg
6882d87a3195Smrgbsdi[[45]]*)
6883d87a3195Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
6884d87a3195Smrg  lt_cv_file_magic_cmd='$FILECMD -L'
6885d87a3195Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
6886d87a3195Smrg  ;;
688795b296d0Smrg
6888d87a3195Smrgcygwin*)
6889d87a3195Smrg  # func_win32_libid is a shell function defined in ltmain.sh
6890d87a3195Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6891d87a3195Smrg  lt_cv_file_magic_cmd='func_win32_libid'
6892d87a3195Smrg  ;;
689339713583Smrg
6894d87a3195Smrgmingw* | pw32*)
6895d87a3195Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
6896d87a3195Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
6897d87a3195Smrg  # unless we find 'file', for example because we are cross-compiling.
6898d87a3195Smrg  if ( file / ) >/dev/null 2>&1; then
6899d87a3195Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6900d87a3195Smrg    lt_cv_file_magic_cmd='func_win32_libid'
6901d87a3195Smrg  else
6902d87a3195Smrg    # Keep this pattern in sync with the one in func_win32_libid.
6903d87a3195Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
6904d87a3195Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
6905d87a3195Smrg  fi
6906d87a3195Smrg  ;;
6907d87a3195Smrg
6908d87a3195Smrgcegcc*)
6909d87a3195Smrg  # use the weaker test based on 'objdump'. See mingw*.
6910d87a3195Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
6911d87a3195Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
6912d87a3195Smrg  ;;
6913d87a3195Smrg
6914d87a3195Smrgdarwin* | rhapsody*)
6915d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
6916d87a3195Smrg  ;;
6917d87a3195Smrg
6918d87a3195Smrgfreebsd* | dragonfly* | midnightbsd*)
6919d87a3195Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6920d87a3195Smrg    case $host_cpu in
6921d87a3195Smrg    i*86 )
6922d87a3195Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
6923d87a3195Smrg      # Let's accept both of them until this is cleared up.
6924d87a3195Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
6925d87a3195Smrg      lt_cv_file_magic_cmd=$FILECMD
6926d87a3195Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
6927d87a3195Smrg      ;;
692814330f12Smrg    esac
6929d87a3195Smrg  else
6930d87a3195Smrg    lt_cv_deplibs_check_method=pass_all
6931d87a3195Smrg  fi
6932d87a3195Smrg  ;;
693395b296d0Smrg
6934d87a3195Smrghaiku*)
6935d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
6936d87a3195Smrg  ;;
693795b296d0Smrg
6938d87a3195Smrghpux10.20* | hpux11*)
6939d87a3195Smrg  lt_cv_file_magic_cmd=$FILECMD
6940d87a3195Smrg  case $host_cpu in
6941d87a3195Smrg  ia64*)
6942d87a3195Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
6943d87a3195Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
6944d87a3195Smrg    ;;
6945d87a3195Smrg  hppa*64*)
6946d87a3195Smrg    [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]']
6947d87a3195Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
6948d87a3195Smrg    ;;
6949d87a3195Smrg  *)
6950d87a3195Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
6951d87a3195Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
6952d87a3195Smrg    ;;
6953d87a3195Smrg  esac
6954d87a3195Smrg  ;;
695595b296d0Smrg
6956d87a3195Smrginterix[[3-9]]*)
6957d87a3195Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
6958d87a3195Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
6959d87a3195Smrg  ;;
696095b296d0Smrg
6961d87a3195Smrgirix5* | irix6* | nonstopux*)
6962d87a3195Smrg  case $LD in
6963d87a3195Smrg  *-32|*"-32 ") libmagic=32-bit;;
6964d87a3195Smrg  *-n32|*"-n32 ") libmagic=N32;;
6965d87a3195Smrg  *-64|*"-64 ") libmagic=64-bit;;
6966d87a3195Smrg  *) libmagic=never-match;;
6967d87a3195Smrg  esac
6968d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
6969d87a3195Smrg  ;;
697095b296d0Smrg
6971d87a3195Smrg# This must be glibc/ELF.
6972d87a3195Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6973d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
6974d87a3195Smrg  ;;
697595b296d0Smrg
6976d87a3195Smrgnetbsd*)
6977d87a3195Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6978d87a3195Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
6979d87a3195Smrg  else
6980d87a3195Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
6981d87a3195Smrg  fi
6982d87a3195Smrg  ;;
6983d87a3195Smrg
6984d87a3195Smrgnewos6*)
6985d87a3195Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
6986d87a3195Smrg  lt_cv_file_magic_cmd=$FILECMD
6987d87a3195Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
6988d87a3195Smrg  ;;
698995b296d0Smrg
6990d87a3195Smrg*nto* | *qnx*)
6991d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
6992d87a3195Smrg  ;;
699395b296d0Smrg
6994d87a3195Smrgopenbsd* | bitrig*)
6995d87a3195Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
6996d87a3195Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
6997d87a3195Smrg  else
6998d87a3195Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
6999d87a3195Smrg  fi
7000d87a3195Smrg  ;;
700195b296d0Smrg
7002d87a3195Smrgosf3* | osf4* | osf5*)
7003d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
7004d87a3195Smrg  ;;
700539713583Smrg
7006d87a3195Smrgrdos*)
7007d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
7008d87a3195Smrg  ;;
70092378475aSmrg
7010d87a3195Smrgsolaris*)
7011d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
7012d87a3195Smrg  ;;
701395b296d0Smrg
7014d87a3195Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
7015d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
7016d87a3195Smrg  ;;
701714330f12Smrg
7018d87a3195Smrgsysv4 | sysv4.3*)
7019d87a3195Smrg  case $host_vendor in
7020d87a3195Smrg  motorola)
7021d87a3195Smrg    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]]'
7022d87a3195Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
7023d87a3195Smrg    ;;
7024d87a3195Smrg  ncr)
7025d87a3195Smrg    lt_cv_deplibs_check_method=pass_all
7026d87a3195Smrg    ;;
7027d87a3195Smrg  sequent)
7028d87a3195Smrg    lt_cv_file_magic_cmd='/bin/file'
7029d87a3195Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
7030d87a3195Smrg    ;;
7031d87a3195Smrg  sni)
7032d87a3195Smrg    lt_cv_file_magic_cmd='/bin/file'
7033d87a3195Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
7034d87a3195Smrg    lt_cv_file_magic_test_file=/lib/libc.so
7035d87a3195Smrg    ;;
7036d87a3195Smrg  siemens)
7037d87a3195Smrg    lt_cv_deplibs_check_method=pass_all
7038d87a3195Smrg    ;;
7039d87a3195Smrg  pc)
7040d87a3195Smrg    lt_cv_deplibs_check_method=pass_all
7041d87a3195Smrg    ;;
7042d87a3195Smrg  esac
7043d87a3195Smrg  ;;
70442378475aSmrg
7045d87a3195Smrgtpf*)
7046d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
7047d87a3195Smrg  ;;
7048d87a3195Smrgos2*)
7049d87a3195Smrg  lt_cv_deplibs_check_method=pass_all
7050d87a3195Smrg  ;;
7051d87a3195Smrgesac
7052d87a3195Smrg])
70532378475aSmrg
7054d87a3195Smrgfile_magic_glob=
7055d87a3195Smrgwant_nocaseglob=no
7056d87a3195Smrgif test "$build" = "$host"; then
7057d87a3195Smrg  case $host_os in
7058d87a3195Smrg  mingw* | pw32*)
7059d87a3195Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
7060d87a3195Smrg      want_nocaseglob=yes
7061d87a3195Smrg    else
7062d87a3195Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
7063d87a3195Smrg    fi
7064d87a3195Smrg    ;;
7065d87a3195Smrg  esac
7066d87a3195Smrgfi
70672378475aSmrg
7068d87a3195Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
7069d87a3195Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
7070d87a3195Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
70712378475aSmrg
7072d87a3195Smrg_LT_DECL([], [deplibs_check_method], [1],
7073d87a3195Smrg    [Method to check whether dependent libraries are shared objects])
7074d87a3195Smrg_LT_DECL([], [file_magic_cmd], [1],
7075d87a3195Smrg    [Command to use when deplibs_check_method = "file_magic"])
7076d87a3195Smrg_LT_DECL([], [file_magic_glob], [1],
7077d87a3195Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
7078d87a3195Smrg_LT_DECL([], [want_nocaseglob], [1],
7079d87a3195Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
7080d87a3195Smrg])# _LT_CHECK_MAGIC_METHOD
708195b296d0Smrg
708295b296d0Smrg
7083d87a3195Smrg# LT_PATH_NM
7084d87a3195Smrg# ----------
7085d87a3195Smrg# find the pathname to a BSD- or MS-compatible name lister
7086d87a3195SmrgAC_DEFUN([LT_PATH_NM],
7087d87a3195Smrg[AC_REQUIRE([AC_PROG_CC])dnl
7088d87a3195SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
7089d87a3195Smrg[if test -n "$NM"; then
7090d87a3195Smrg  # Let the user override the test.
7091d87a3195Smrg  lt_cv_path_NM=$NM
7092d87a3195Smrgelse
7093d87a3195Smrg  lt_nm_to_check=${ac_tool_prefix}nm
7094d87a3195Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
7095d87a3195Smrg    lt_nm_to_check="$lt_nm_to_check nm"
7096d87a3195Smrg  fi
7097d87a3195Smrg  for lt_tmp_nm in $lt_nm_to_check; do
7098d87a3195Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7099d87a3195Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
7100d87a3195Smrg      IFS=$lt_save_ifs
7101d87a3195Smrg      test -z "$ac_dir" && ac_dir=.
7102d87a3195Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
7103d87a3195Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
7104d87a3195Smrg	# Check to see if the nm accepts a BSD-compat flag.
7105d87a3195Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
7106d87a3195Smrg	#   nm: unknown option "B" ignored
7107d87a3195Smrg	# Tru64's nm complains that /dev/null is an invalid object file
7108d87a3195Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
7109d87a3195Smrg	case $build_os in
7110d87a3195Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
7111d87a3195Smrg	*) lt_bad_file=/dev/null ;;
7112d87a3195Smrg	esac
7113d87a3195Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
7114d87a3195Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
7115d87a3195Smrg	  lt_cv_path_NM="$tmp_nm -B"
7116d87a3195Smrg	  break 2
7117d87a3195Smrg	  ;;
7118d87a3195Smrg	*)
7119d87a3195Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
7120d87a3195Smrg	  */dev/null*)
7121d87a3195Smrg	    lt_cv_path_NM="$tmp_nm -p"
7122d87a3195Smrg	    break 2
7123d87a3195Smrg	    ;;
7124d87a3195Smrg	  *)
7125d87a3195Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7126d87a3195Smrg	    continue # so that we can try to find one that supports BSD flags
7127d87a3195Smrg	    ;;
7128d87a3195Smrg	  esac
7129d87a3195Smrg	  ;;
7130d87a3195Smrg	esac
7131d87a3195Smrg      fi
7132d87a3195Smrg    done
7133d87a3195Smrg    IFS=$lt_save_ifs
7134d87a3195Smrg  done
7135d87a3195Smrg  : ${lt_cv_path_NM=no}
7136d87a3195Smrgfi])
7137d87a3195Smrgif test no != "$lt_cv_path_NM"; then
7138d87a3195Smrg  NM=$lt_cv_path_NM
7139d87a3195Smrgelse
7140d87a3195Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
7141d87a3195Smrg  if test -n "$DUMPBIN"; then :
7142d87a3195Smrg    # Let the user override the test.
7143d87a3195Smrg  else
7144d87a3195Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
7145d87a3195Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
7146d87a3195Smrg    *COFF*)
7147d87a3195Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
7148d87a3195Smrg      ;;
7149d87a3195Smrg    *)
7150d87a3195Smrg      DUMPBIN=:
7151d87a3195Smrg      ;;
7152d87a3195Smrg    esac
7153d87a3195Smrg  fi
7154d87a3195Smrg  AC_SUBST([DUMPBIN])
7155d87a3195Smrg  if test : != "$DUMPBIN"; then
7156d87a3195Smrg    NM=$DUMPBIN
7157d87a3195Smrg  fi
715814330f12Smrgfi
7159d87a3195Smrgtest -z "$NM" && NM=nm
7160d87a3195SmrgAC_SUBST([NM])
7161d87a3195Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
716295b296d0Smrg
7163d87a3195SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
7164d87a3195Smrg  [lt_cv_nm_interface="BSD nm"
7165d87a3195Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
7166d87a3195Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
7167d87a3195Smrg  (eval "$ac_compile" 2>conftest.err)
7168d87a3195Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7169d87a3195Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
7170d87a3195Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
7171d87a3195Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7172d87a3195Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
7173d87a3195Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
7174d87a3195Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
7175d87a3195Smrg    lt_cv_nm_interface="MS dumpbin"
7176d87a3195Smrg  fi
7177d87a3195Smrg  rm -f conftest*])
7178d87a3195Smrg])# LT_PATH_NM
717995b296d0Smrg
7180d87a3195Smrg# Old names:
7181d87a3195SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
7182d87a3195SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
7183d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
7184d87a3195Smrgdnl AC_DEFUN([AM_PROG_NM], [])
7185d87a3195Smrgdnl AC_DEFUN([AC_PROG_NM], [])
71862378475aSmrg
7187d87a3195Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7188d87a3195Smrg# --------------------------------
7189d87a3195Smrg# how to determine the name of the shared library
7190d87a3195Smrg# associated with a specific link library.
7191d87a3195Smrg#  -- PORTME fill in with the dynamic library characteristics
7192d87a3195Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
7193d87a3195Smrg[m4_require([_LT_DECL_EGREP])
7194d87a3195Smrgm4_require([_LT_DECL_OBJDUMP])
7195d87a3195Smrgm4_require([_LT_DECL_DLLTOOL])
7196d87a3195SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
7197d87a3195Smrglt_cv_sharedlib_from_linklib_cmd,
7198d87a3195Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
71992378475aSmrg
7200d87a3195Smrgcase $host_os in
7201d87a3195Smrgcygwin* | mingw* | pw32* | cegcc*)
7202d87a3195Smrg  # two different shell functions defined in ltmain.sh;
7203d87a3195Smrg  # decide which one to use based on capabilities of $DLLTOOL
7204d87a3195Smrg  case `$DLLTOOL --help 2>&1` in
7205d87a3195Smrg  *--identify-strict*)
7206d87a3195Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
7207d87a3195Smrg    ;;
7208d87a3195Smrg  *)
7209d87a3195Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
7210d87a3195Smrg    ;;
7211d87a3195Smrg  esac
7212d87a3195Smrg  ;;
7213d87a3195Smrg*)
7214d87a3195Smrg  # fallback: assume linklib IS sharedlib
7215d87a3195Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
7216d87a3195Smrg  ;;
7217d87a3195Smrgesac
7218d87a3195Smrg])
7219d87a3195Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
7220d87a3195Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
7221eca46af7Smrg
7222d87a3195Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
7223d87a3195Smrg    [Command to associate shared and link libraries])
7224d87a3195Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7225eca46af7Smrg
7226eca46af7Smrg
7227d87a3195Smrg# _LT_PATH_MANIFEST_TOOL
7228d87a3195Smrg# ----------------------
7229d87a3195Smrg# locate the manifest tool
7230d87a3195Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
7231d87a3195Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
7232d87a3195Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
7233d87a3195SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
7234d87a3195Smrg  [lt_cv_path_mainfest_tool=no
7235d87a3195Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
7236d87a3195Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
7237d87a3195Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7238d87a3195Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
7239d87a3195Smrg    lt_cv_path_mainfest_tool=yes
7240d87a3195Smrg  fi
7241d87a3195Smrg  rm -f conftest*])
7242d87a3195Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
7243d87a3195Smrg  MANIFEST_TOOL=:
7244d87a3195Smrgfi
7245d87a3195Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
7246d87a3195Smrg])# _LT_PATH_MANIFEST_TOOL
7247eca46af7Smrg
7248eca46af7Smrg
7249d87a3195Smrg# _LT_DLL_DEF_P([FILE])
7250d87a3195Smrg# ---------------------
7251d87a3195Smrg# True iff FILE is a Windows DLL '.def' file.
7252d87a3195Smrg# Keep in sync with func_dll_def_p in the libtool script
7253d87a3195SmrgAC_DEFUN([_LT_DLL_DEF_P],
7254d87a3195Smrg[dnl
7255d87a3195Smrg  test DEF = "`$SED -n dnl
7256d87a3195Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
7257d87a3195Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
7258d87a3195Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
7259d87a3195Smrg    -e q dnl                          Only consider the first "real" line
7260d87a3195Smrg    $1`" dnl
7261d87a3195Smrg])# _LT_DLL_DEF_P
7262eca46af7Smrg
7263eca46af7Smrg
7264d87a3195Smrg# LT_LIB_M
7265d87a3195Smrg# --------
7266d87a3195Smrg# check for math library
7267d87a3195SmrgAC_DEFUN([LT_LIB_M],
7268d87a3195Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7269d87a3195SmrgLIBM=
7270d87a3195Smrgcase $host in
7271d87a3195Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
7272d87a3195Smrg  # These system don't have libm, or don't need it
7273d87a3195Smrg  ;;
7274d87a3195Smrg*-ncr-sysv4.3*)
7275d87a3195Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
7276d87a3195Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
7277d87a3195Smrg  ;;
7278d87a3195Smrg*)
7279d87a3195Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
7280d87a3195Smrg  ;;
7281d87a3195Smrgesac
7282d87a3195SmrgAC_SUBST([LIBM])
7283d87a3195Smrg])# LT_LIB_M
7284eca46af7Smrg
7285d87a3195Smrg# Old name:
7286d87a3195SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
7287d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
7288d87a3195Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
7289eca46af7Smrg
7290eca46af7Smrg
7291d87a3195Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
7292d87a3195Smrg# -------------------------------
7293d87a3195Smrgm4_defun([_LT_COMPILER_NO_RTTI],
7294d87a3195Smrg[m4_require([_LT_TAG_COMPILER])dnl
7295eca46af7Smrg
7296d87a3195Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7297d87a3195Smrg
7298d87a3195Smrgif test yes = "$GCC"; then
7299d87a3195Smrg  case $cc_basename in
7300d87a3195Smrg  nvcc*)
7301d87a3195Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
7302d87a3195Smrg  *)
7303d87a3195Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
7304d87a3195Smrg  esac
7305d87a3195Smrg
7306d87a3195Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
7307d87a3195Smrg    lt_cv_prog_compiler_rtti_exceptions,
7308d87a3195Smrg    [-fno-rtti -fno-exceptions], [],
7309d87a3195Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
7310eca46af7Smrgfi
7311d87a3195Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
7312d87a3195Smrg	[Compiler flag to turn off builtin functions])
7313d87a3195Smrg])# _LT_COMPILER_NO_RTTI
7314eca46af7Smrg
7315eca46af7Smrg
7316d87a3195Smrg# _LT_CMD_GLOBAL_SYMBOLS
7317d87a3195Smrg# ----------------------
7318d87a3195Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
7319d87a3195Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7320d87a3195SmrgAC_REQUIRE([AC_PROG_CC])dnl
7321d87a3195SmrgAC_REQUIRE([AC_PROG_AWK])dnl
7322d87a3195SmrgAC_REQUIRE([LT_PATH_NM])dnl
7323d87a3195SmrgAC_REQUIRE([LT_PATH_LD])dnl
7324d87a3195Smrgm4_require([_LT_DECL_SED])dnl
7325d87a3195Smrgm4_require([_LT_DECL_EGREP])dnl
7326d87a3195Smrgm4_require([_LT_TAG_COMPILER])dnl
7327eca46af7Smrg
7328d87a3195Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
7329d87a3195SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
7330d87a3195SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
7331d87a3195Smrg[
7332d87a3195Smrg# These are sane defaults that work on at least a few old systems.
7333d87a3195Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
7334eca46af7Smrg
7335d87a3195Smrg# Character class describing NM global symbol codes.
7336d87a3195Smrgsymcode='[[BCDEGRST]]'
73372378475aSmrg
7338d87a3195Smrg# Regexp to match symbols that can be accessed directly from C.
7339d87a3195Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
73402378475aSmrg
7341d87a3195Smrg# Define system-specific variables.
7342d87a3195Smrgcase $host_os in
7343d87a3195Smrgaix*)
7344d87a3195Smrg  symcode='[[BCDT]]'
7345d87a3195Smrg  ;;
7346d87a3195Smrgcygwin* | mingw* | pw32* | cegcc*)
7347d87a3195Smrg  symcode='[[ABCDGISTW]]'
7348d87a3195Smrg  ;;
7349d87a3195Smrghpux*)
7350d87a3195Smrg  if test ia64 = "$host_cpu"; then
7351d87a3195Smrg    symcode='[[ABCDEGRST]]'
7352d87a3195Smrg  fi
7353d87a3195Smrg  ;;
7354d87a3195Smrgirix* | nonstopux*)
7355d87a3195Smrg  symcode='[[BCDEGRST]]'
7356d87a3195Smrg  ;;
7357d87a3195Smrgosf*)
7358d87a3195Smrg  symcode='[[BCDEGQRST]]'
7359d87a3195Smrg  ;;
7360d87a3195Smrgsolaris*)
7361d87a3195Smrg  symcode='[[BDRT]]'
7362d87a3195Smrg  ;;
7363d87a3195Smrgsco3.2v5*)
7364d87a3195Smrg  symcode='[[DT]]'
7365d87a3195Smrg  ;;
7366d87a3195Smrgsysv4.2uw2*)
7367d87a3195Smrg  symcode='[[DT]]'
7368d87a3195Smrg  ;;
7369d87a3195Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
7370d87a3195Smrg  symcode='[[ABDT]]'
7371d87a3195Smrg  ;;
7372d87a3195Smrgsysv4)
7373d87a3195Smrg  symcode='[[DFNSTU]]'
7374d87a3195Smrg  ;;
7375d87a3195Smrgesac
73762378475aSmrg
7377d87a3195Smrg# If we're using GNU nm, then use its standard symbol codes.
7378d87a3195Smrgcase `$NM -V 2>&1` in
7379d87a3195Smrg*GNU* | *'with BFD'*)
7380d87a3195Smrg  symcode='[[ABCDGIRSTW]]' ;;
7381d87a3195Smrgesac
73822378475aSmrg
7383d87a3195Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
7384d87a3195Smrg  # Gets list of data symbols to import.
7385d87a3195Smrg  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
7386d87a3195Smrg  # Adjust the below global symbol transforms to fixup imported variables.
7387d87a3195Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
7388d87a3195Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
7389d87a3195Smrg  lt_c_name_lib_hook="\
7390d87a3195Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
7391d87a3195Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
7392d87a3195Smrgelse
7393d87a3195Smrg  # Disable hooks by default.
7394d87a3195Smrg  lt_cv_sys_global_symbol_to_import=
7395d87a3195Smrg  lt_cdecl_hook=
7396d87a3195Smrg  lt_c_name_hook=
7397d87a3195Smrg  lt_c_name_lib_hook=
7398d87a3195Smrgfi
73992378475aSmrg
7400d87a3195Smrg# Transform an extracted symbol line into a proper C declaration.
7401d87a3195Smrg# Some systems (esp. on ia64) link data and code symbols differently,
7402d87a3195Smrg# so use this general approach.
7403d87a3195Smrglt_cv_sys_global_symbol_to_cdecl="$SED -n"\
7404d87a3195Smrg$lt_cdecl_hook\
7405d87a3195Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
7406d87a3195Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
74072378475aSmrg
7408d87a3195Smrg# Transform an extracted symbol line into symbol name and symbol address
7409d87a3195Smrglt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
7410d87a3195Smrg$lt_c_name_hook\
7411d87a3195Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
7412d87a3195Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
74132378475aSmrg
7414d87a3195Smrg# Transform an extracted symbol line into symbol name with lib prefix and
7415d87a3195Smrg# symbol address.
7416d87a3195Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
7417d87a3195Smrg$lt_c_name_lib_hook\
7418d87a3195Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
7419d87a3195Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
7420d87a3195Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
7421d87a3195Smrg
7422d87a3195Smrg# Handle CRLF in mingw tool chain
7423d87a3195Smrgopt_cr=
7424d87a3195Smrgcase $build_os in
7425d87a3195Smrgmingw*)
7426d87a3195Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
7427d87a3195Smrg  ;;
7428d87a3195Smrgesac
74292378475aSmrg
7430d87a3195Smrg# Try without a prefix underscore, then with it.
7431d87a3195Smrgfor ac_symprfx in "" "_"; do
74322378475aSmrg
7433d87a3195Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
7434d87a3195Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
743595b296d0Smrg
7436d87a3195Smrg  # Write the raw and C identifiers.
7437d87a3195Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
7438d87a3195Smrg    # Fake it for dumpbin and say T for any non-static function,
7439d87a3195Smrg    # D for any global variable and I for any imported variable.
7440d87a3195Smrg    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
7441d87a3195Smrg    # which start with @ or ?.
7442d87a3195Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
7443d87a3195Smrg"     {last_section=section; section=\$ 3};"\
7444d87a3195Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
7445d87a3195Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
7446d87a3195Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
7447d87a3195Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
7448d87a3195Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
7449d87a3195Smrg"     \$ 0!~/External *\|/{next};"\
7450d87a3195Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
7451d87a3195Smrg"     {if(hide[section]) next};"\
7452d87a3195Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
7453d87a3195Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
7454d87a3195Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
7455d87a3195Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
7456d87a3195Smrg"     ' prfx=^$ac_symprfx]"
7457d87a3195Smrg  else
7458d87a3195Smrg    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
7459d87a3195Smrg  fi
7460d87a3195Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
746195b296d0Smrg
7462d87a3195Smrg  # Check to see that the pipe works correctly.
7463d87a3195Smrg  pipe_works=no
746495b296d0Smrg
7465d87a3195Smrg  rm -f conftest*
7466d87a3195Smrg  cat > conftest.$ac_ext <<_LT_EOF
7467d87a3195Smrg#ifdef __cplusplus
7468d87a3195Smrgextern "C" {
7469d87a3195Smrg#endif
7470d87a3195Smrgchar nm_test_var;
7471d87a3195Smrgvoid nm_test_func(void);
7472d87a3195Smrgvoid nm_test_func(void){}
7473d87a3195Smrg#ifdef __cplusplus
7474d87a3195Smrg}
7475d87a3195Smrg#endif
7476d87a3195Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
7477d87a3195Smrg_LT_EOF
747895b296d0Smrg
7479d87a3195Smrg  if AC_TRY_EVAL(ac_compile); then
7480d87a3195Smrg    # Now try to grab the symbols.
7481d87a3195Smrg    nlist=conftest.nm
7482d87a3195Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
7483d87a3195Smrg      # Try sorting and uniquifying the output.
7484d87a3195Smrg      if sort "$nlist" | uniq > "$nlist"T; then
7485d87a3195Smrg	mv -f "$nlist"T "$nlist"
7486d87a3195Smrg      else
7487d87a3195Smrg	rm -f "$nlist"T
7488d87a3195Smrg      fi
74892378475aSmrg
7490d87a3195Smrg      # Make sure that we snagged all the symbols we need.
7491d87a3195Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
7492d87a3195Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
7493d87a3195Smrg	  cat <<_LT_EOF > conftest.$ac_ext
7494d87a3195Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
7495d87a3195Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
7496d87a3195Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
7497d87a3195Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
7498d87a3195Smrg# define LT@&t@_DLSYM_CONST
7499d87a3195Smrg#elif defined __osf__
7500d87a3195Smrg/* This system does not cope well with relocations in const data.  */
7501d87a3195Smrg# define LT@&t@_DLSYM_CONST
7502d87a3195Smrg#else
7503d87a3195Smrg# define LT@&t@_DLSYM_CONST const
7504d87a3195Smrg#endif
7505eca46af7Smrg
7506d87a3195Smrg#ifdef __cplusplus
7507d87a3195Smrgextern "C" {
7508d87a3195Smrg#endif
7509eca46af7Smrg
7510d87a3195Smrg_LT_EOF
7511d87a3195Smrg	  # Now generate the symbol file.
7512d87a3195Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
751395b296d0Smrg
7514d87a3195Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
75152378475aSmrg
7516d87a3195Smrg/* The mapping between symbol names and symbols.  */
7517d87a3195SmrgLT@&t@_DLSYM_CONST struct {
7518d87a3195Smrg  const char *name;
7519d87a3195Smrg  void       *address;
7520d87a3195Smrg}
7521d87a3195Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
7522d87a3195Smrg{
7523d87a3195Smrg  { "@PROGRAM@", (void *) 0 },
7524d87a3195Smrg_LT_EOF
7525d87a3195Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
7526d87a3195Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
7527d87a3195Smrg  {0, (void *) 0}
7528d87a3195Smrg};
75292378475aSmrg
7530d87a3195Smrg/* This works around a problem in FreeBSD linker */
7531d87a3195Smrg#ifdef FREEBSD_WORKAROUND
7532d87a3195Smrgstatic const void *lt_preloaded_setup() {
7533d87a3195Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
7534d87a3195Smrg}
7535d87a3195Smrg#endif
753695b296d0Smrg
7537d87a3195Smrg#ifdef __cplusplus
7538d87a3195Smrg}
7539d87a3195Smrg#endif
7540d87a3195Smrg_LT_EOF
7541d87a3195Smrg	  # Now try linking the two files.
7542d87a3195Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
7543d87a3195Smrg	  lt_globsym_save_LIBS=$LIBS
7544d87a3195Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
7545d87a3195Smrg	  LIBS=conftstm.$ac_objext
7546d87a3195Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
7547d87a3195Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
7548d87a3195Smrg	    pipe_works=yes
7549d87a3195Smrg	  fi
7550d87a3195Smrg	  LIBS=$lt_globsym_save_LIBS
7551d87a3195Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
7552d87a3195Smrg	else
7553d87a3195Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
7554d87a3195Smrg	fi
7555d87a3195Smrg      else
7556d87a3195Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
7557d87a3195Smrg      fi
7558d87a3195Smrg    else
7559d87a3195Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
7560d87a3195Smrg    fi
7561d87a3195Smrg  else
7562d87a3195Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
7563d87a3195Smrg    cat conftest.$ac_ext >&5
7564d87a3195Smrg  fi
7565d87a3195Smrg  rm -rf conftest* conftst*
7566ff89ac2bSmrg
7567d87a3195Smrg  # Do not use the global_symbol_pipe unless it works.
7568d87a3195Smrg  if test yes = "$pipe_works"; then
7569d87a3195Smrg    break
7570d87a3195Smrg  else
7571d87a3195Smrg    lt_cv_sys_global_symbol_pipe=
7572d87a3195Smrg  fi
7573d87a3195Smrgdone
757414330f12Smrg])
7575d87a3195Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
7576d87a3195Smrg  lt_cv_sys_global_symbol_to_cdecl=
7577d87a3195Smrgfi
7578d87a3195Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
7579d87a3195Smrg  AC_MSG_RESULT(failed)
7580d87a3195Smrgelse
7581d87a3195Smrg  AC_MSG_RESULT(ok)
7582d87a3195Smrgfi
758314330f12Smrg
7584d87a3195Smrg# Response file support.
7585d87a3195Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
7586d87a3195Smrg  nm_file_list_spec='@'
7587d87a3195Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
7588d87a3195Smrg  nm_file_list_spec='@'
7589d87a3195Smrgfi
7590ff89ac2bSmrg
7591d87a3195Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
7592d87a3195Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
7593d87a3195Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
7594d87a3195Smrg    [Transform the output of nm in a proper C declaration])
7595d87a3195Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
7596d87a3195Smrg    [Transform the output of nm into a list of symbols to manually relocate])
7597d87a3195Smrg_LT_DECL([global_symbol_to_c_name_address],
7598d87a3195Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
7599d87a3195Smrg    [Transform the output of nm in a C name address pair])
7600d87a3195Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
7601d87a3195Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
7602d87a3195Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
7603d87a3195Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
7604d87a3195Smrg    [The name lister interface])
7605d87a3195Smrg_LT_DECL([], [nm_file_list_spec], [1],
7606d87a3195Smrg    [Specify filename containing input files for $NM])
7607d87a3195Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
7608d87a3195Smrg
7609d87a3195Smrg
7610d87a3195Smrg# _LT_COMPILER_PIC([TAGNAME])
7611d87a3195Smrg# ---------------------------
7612d87a3195Smrgm4_defun([_LT_COMPILER_PIC],
7613d87a3195Smrg[m4_require([_LT_TAG_COMPILER])dnl
7614d87a3195Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
7615d87a3195Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
7616d87a3195Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
7617d87a3195Smrg
7618d87a3195Smrgm4_if([$1], [CXX], [
7619d87a3195Smrg  # C++ specific cases for pic, static, wl, etc.
7620d87a3195Smrg  if test yes = "$GXX"; then
7621d87a3195Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7622d87a3195Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7623ff89ac2bSmrg
7624d87a3195Smrg    case $host_os in
7625d87a3195Smrg    aix*)
7626d87a3195Smrg      # All AIX code is PIC.
7627d87a3195Smrg      if test ia64 = "$host_cpu"; then
7628d87a3195Smrg	# AIX 5 now supports IA64 processor
7629d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7630d87a3195Smrg      fi
7631d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7632d87a3195Smrg      ;;
7633d87a3195Smrg
7634d87a3195Smrg    amigaos*)
7635d87a3195Smrg      case $host_cpu in
7636d87a3195Smrg      powerpc)
7637d87a3195Smrg            # see comment about AmigaOS4 .so support
7638d87a3195Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7639d87a3195Smrg        ;;
7640d87a3195Smrg      m68k)
7641d87a3195Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
7642d87a3195Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
7643d87a3195Smrg            # like '-m68040'.
7644d87a3195Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7645d87a3195Smrg        ;;
7646d87a3195Smrg      esac
7647d87a3195Smrg      ;;
7648d87a3195Smrg
7649d87a3195Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7650d87a3195Smrg      # PIC is the default for these OSes.
7651d87a3195Smrg      ;;
7652d87a3195Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
7653d87a3195Smrg      # This hack is so that the source file can tell whether it is being
7654d87a3195Smrg      # built for inclusion in a dll (and should export symbols for example).
7655d87a3195Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
7656d87a3195Smrg      # (--disable-auto-import) libraries
7657d87a3195Smrg      m4_if([$1], [GCJ], [],
7658d87a3195Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7659d87a3195Smrg      case $host_os in
7660d87a3195Smrg      os2*)
7661d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7662d87a3195Smrg	;;
7663d87a3195Smrg      esac
7664d87a3195Smrg      ;;
7665d87a3195Smrg    darwin* | rhapsody*)
7666d87a3195Smrg      # PIC is the default on this platform
7667d87a3195Smrg      # Common symbols not allowed in MH_DYLIB files
7668d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7669d87a3195Smrg      ;;
7670d87a3195Smrg    *djgpp*)
7671d87a3195Smrg      # DJGPP does not support shared libraries at all
7672d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7673d87a3195Smrg      ;;
7674d87a3195Smrg    haiku*)
7675d87a3195Smrg      # PIC is the default for Haiku.
7676d87a3195Smrg      # The "-static" flag exists, but is broken.
7677d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
7678d87a3195Smrg      ;;
7679d87a3195Smrg    interix[[3-9]]*)
7680d87a3195Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7681d87a3195Smrg      # Instead, we relocate shared libraries at runtime.
7682d87a3195Smrg      ;;
7683d87a3195Smrg    sysv4*MP*)
7684d87a3195Smrg      if test -d /usr/nec; then
7685d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7686d87a3195Smrg      fi
7687d87a3195Smrg      ;;
7688d87a3195Smrg    hpux*)
7689d87a3195Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7690d87a3195Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
7691d87a3195Smrg      # sets the default TLS model and affects inlining.
7692d87a3195Smrg      case $host_cpu in
7693d87a3195Smrg      hppa*64*)
7694d87a3195Smrg	;;
7695d87a3195Smrg      *)
7696d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7697d87a3195Smrg	;;
7698d87a3195Smrg      esac
7699d87a3195Smrg      ;;
7700d87a3195Smrg    *qnx* | *nto*)
7701d87a3195Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
7702d87a3195Smrg      # it will coredump.
7703d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7704d87a3195Smrg      ;;
7705d87a3195Smrg    *)
7706d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7707d87a3195Smrg      ;;
7708d87a3195Smrg    esac
7709d87a3195Smrg  else
7710d87a3195Smrg    case $host_os in
7711d87a3195Smrg      aix[[4-9]]*)
7712d87a3195Smrg	# All AIX code is PIC.
7713d87a3195Smrg	if test ia64 = "$host_cpu"; then
7714d87a3195Smrg	  # AIX 5 now supports IA64 processor
7715d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7716d87a3195Smrg	else
7717d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7718d87a3195Smrg	fi
7719d87a3195Smrg	;;
7720d87a3195Smrg      chorus*)
7721d87a3195Smrg	case $cc_basename in
7722d87a3195Smrg	cxch68*)
7723d87a3195Smrg	  # Green Hills C++ Compiler
7724d87a3195Smrg	  # _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"
7725d87a3195Smrg	  ;;
7726d87a3195Smrg	esac
7727d87a3195Smrg	;;
7728d87a3195Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
7729d87a3195Smrg	# This hack is so that the source file can tell whether it is being
7730d87a3195Smrg	# built for inclusion in a dll (and should export symbols for example).
7731d87a3195Smrg	m4_if([$1], [GCJ], [],
7732d87a3195Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7733d87a3195Smrg	;;
7734d87a3195Smrg      dgux*)
7735d87a3195Smrg	case $cc_basename in
7736d87a3195Smrg	  ec++*)
7737d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7738d87a3195Smrg	    ;;
7739d87a3195Smrg	  ghcx*)
7740d87a3195Smrg	    # Green Hills C++ Compiler
7741d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7742d87a3195Smrg	    ;;
7743d87a3195Smrg	  *)
7744d87a3195Smrg	    ;;
7745d87a3195Smrg	esac
7746d87a3195Smrg	;;
7747d87a3195Smrg      freebsd* | dragonfly* | midnightbsd*)
7748d87a3195Smrg	# FreeBSD uses GNU C++
7749d87a3195Smrg	;;
7750d87a3195Smrg      hpux9* | hpux10* | hpux11*)
7751d87a3195Smrg	case $cc_basename in
7752d87a3195Smrg	  CC*)
7753d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7754d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7755d87a3195Smrg	    if test ia64 != "$host_cpu"; then
7756d87a3195Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7757d87a3195Smrg	    fi
7758d87a3195Smrg	    ;;
7759d87a3195Smrg	  aCC*)
7760d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7761d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7762d87a3195Smrg	    case $host_cpu in
7763d87a3195Smrg	    hppa*64*|ia64*)
7764d87a3195Smrg	      # +Z the default
7765d87a3195Smrg	      ;;
7766d87a3195Smrg	    *)
7767d87a3195Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7768d87a3195Smrg	      ;;
7769d87a3195Smrg	    esac
7770d87a3195Smrg	    ;;
7771d87a3195Smrg	  *)
7772d87a3195Smrg	    ;;
7773d87a3195Smrg	esac
7774d87a3195Smrg	;;
7775d87a3195Smrg      interix*)
7776d87a3195Smrg	# This is c89, which is MS Visual C++ (no shared libs)
7777d87a3195Smrg	# Anyone wants to do a port?
7778d87a3195Smrg	;;
7779d87a3195Smrg      irix5* | irix6* | nonstopux*)
7780d87a3195Smrg	case $cc_basename in
7781d87a3195Smrg	  CC*)
7782d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7783d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7784d87a3195Smrg	    # CC pic flag -KPIC is the default.
7785d87a3195Smrg	    ;;
7786d87a3195Smrg	  *)
7787d87a3195Smrg	    ;;
7788d87a3195Smrg	esac
7789d87a3195Smrg	;;
7790d87a3195Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7791d87a3195Smrg	case $cc_basename in
7792d87a3195Smrg	  KCC*)
7793d87a3195Smrg	    # KAI C++ Compiler
7794d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7795d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7796d87a3195Smrg	    ;;
7797d87a3195Smrg	  ecpc* )
7798d87a3195Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
7799d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7800d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7801d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7802d87a3195Smrg	    ;;
7803d87a3195Smrg	  icpc* )
7804d87a3195Smrg	    # Intel C++, used to be incompatible with GCC.
7805d87a3195Smrg	    # ICC 10 doesn't accept -KPIC any more.
7806d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7807d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7808d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7809d87a3195Smrg	    ;;
7810d87a3195Smrg	  pgCC* | pgcpp*)
7811d87a3195Smrg	    # Portland Group C++ compiler
7812d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7813d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
7814d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7815d87a3195Smrg	    ;;
7816d87a3195Smrg	  cxx*)
7817d87a3195Smrg	    # Compaq C++
7818d87a3195Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
7819d87a3195Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
7820d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7821d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7822d87a3195Smrg	    ;;
7823d87a3195Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
7824d87a3195Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
7825d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7826d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
7827d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
7828d87a3195Smrg	    ;;
7829d87a3195Smrg	  *)
7830d87a3195Smrg	    case `$CC -V 2>&1 | $SED 5q` in
7831d87a3195Smrg	    *Sun\ C*)
7832d87a3195Smrg	      # Sun C++ 5.9
7833d87a3195Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7834d87a3195Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7835d87a3195Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7836d87a3195Smrg	      ;;
7837d87a3195Smrg	    esac
7838d87a3195Smrg	    ;;
7839d87a3195Smrg	esac
7840d87a3195Smrg	;;
7841d87a3195Smrg      lynxos*)
7842d87a3195Smrg	;;
7843d87a3195Smrg      m88k*)
7844d87a3195Smrg	;;
7845d87a3195Smrg      mvs*)
7846d87a3195Smrg	case $cc_basename in
7847d87a3195Smrg	  cxx*)
7848d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
7849d87a3195Smrg	    ;;
7850d87a3195Smrg	  *)
7851d87a3195Smrg	    ;;
7852d87a3195Smrg	esac
7853d87a3195Smrg	;;
7854d87a3195Smrg      netbsd*)
7855d87a3195Smrg	;;
7856d87a3195Smrg      *qnx* | *nto*)
7857d87a3195Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
7858d87a3195Smrg        # it will coredump.
7859d87a3195Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7860d87a3195Smrg        ;;
7861d87a3195Smrg      osf3* | osf4* | osf5*)
7862d87a3195Smrg	case $cc_basename in
7863d87a3195Smrg	  KCC*)
7864d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7865d87a3195Smrg	    ;;
7866d87a3195Smrg	  RCC*)
7867d87a3195Smrg	    # Rational C++ 2.4.1
7868d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7869d87a3195Smrg	    ;;
7870d87a3195Smrg	  cxx*)
7871d87a3195Smrg	    # Digital/Compaq C++
7872d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7873d87a3195Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
7874d87a3195Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
7875d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7876d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7877d87a3195Smrg	    ;;
7878d87a3195Smrg	  *)
7879d87a3195Smrg	    ;;
7880d87a3195Smrg	esac
7881d87a3195Smrg	;;
7882d87a3195Smrg      psos*)
7883d87a3195Smrg	;;
7884d87a3195Smrg      solaris*)
7885d87a3195Smrg	case $cc_basename in
7886d87a3195Smrg	  CC* | sunCC*)
7887d87a3195Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
7888d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7889d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7890d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7891d87a3195Smrg	    ;;
7892d87a3195Smrg	  gcx*)
7893d87a3195Smrg	    # Green Hills C++ Compiler
7894d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7895d87a3195Smrg	    ;;
7896d87a3195Smrg	  *)
7897d87a3195Smrg	    ;;
7898d87a3195Smrg	esac
7899d87a3195Smrg	;;
7900d87a3195Smrg      sunos4*)
7901d87a3195Smrg	case $cc_basename in
7902d87a3195Smrg	  CC*)
7903d87a3195Smrg	    # Sun C++ 4.x
7904d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7905d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7906d87a3195Smrg	    ;;
7907d87a3195Smrg	  lcc*)
7908d87a3195Smrg	    # Lucid
7909d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7910d87a3195Smrg	    ;;
7911d87a3195Smrg	  *)
7912d87a3195Smrg	    ;;
7913d87a3195Smrg	esac
7914d87a3195Smrg	;;
7915d87a3195Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7916d87a3195Smrg	case $cc_basename in
7917d87a3195Smrg	  CC*)
7918d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7919d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7920d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7921d87a3195Smrg	    ;;
7922d87a3195Smrg	esac
7923d87a3195Smrg	;;
7924d87a3195Smrg      tandem*)
7925d87a3195Smrg	case $cc_basename in
7926d87a3195Smrg	  NCC*)
7927d87a3195Smrg	    # NonStop-UX NCC 3.20
7928d87a3195Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7929d87a3195Smrg	    ;;
7930d87a3195Smrg	  *)
7931d87a3195Smrg	    ;;
7932d87a3195Smrg	esac
7933d87a3195Smrg	;;
7934d87a3195Smrg      vxworks*)
7935d87a3195Smrg	;;
7936d87a3195Smrg      *)
7937d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7938d87a3195Smrg	;;
7939d87a3195Smrg    esac
7940d87a3195Smrg  fi
7941d87a3195Smrg],
7942d87a3195Smrg[
7943d87a3195Smrg  if test yes = "$GCC"; then
7944d87a3195Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7945d87a3195Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7946ff89ac2bSmrg
7947d87a3195Smrg    case $host_os in
7948d87a3195Smrg      aix*)
7949d87a3195Smrg      # All AIX code is PIC.
7950d87a3195Smrg      if test ia64 = "$host_cpu"; then
7951d87a3195Smrg	# AIX 5 now supports IA64 processor
7952d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
795314330f12Smrg      fi
7954d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7955d87a3195Smrg      ;;
795639713583Smrg
7957d87a3195Smrg    amigaos*)
7958d87a3195Smrg      case $host_cpu in
7959d87a3195Smrg      powerpc)
7960d87a3195Smrg            # see comment about AmigaOS4 .so support
7961d87a3195Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7962d87a3195Smrg        ;;
7963d87a3195Smrg      m68k)
7964d87a3195Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
7965d87a3195Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
7966d87a3195Smrg            # like '-m68040'.
7967d87a3195Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7968d87a3195Smrg        ;;
7969d87a3195Smrg      esac
7970d87a3195Smrg      ;;
79712378475aSmrg
7972d87a3195Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7973d87a3195Smrg      # PIC is the default for these OSes.
7974d87a3195Smrg      ;;
79752378475aSmrg
7976d87a3195Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
7977d87a3195Smrg      # This hack is so that the source file can tell whether it is being
7978d87a3195Smrg      # built for inclusion in a dll (and should export symbols for example).
7979d87a3195Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
7980d87a3195Smrg      # (--disable-auto-import) libraries
7981d87a3195Smrg      m4_if([$1], [GCJ], [],
7982d87a3195Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7983d87a3195Smrg      case $host_os in
7984d87a3195Smrg      os2*)
7985d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7986d87a3195Smrg	;;
7987d87a3195Smrg      esac
7988d87a3195Smrg      ;;
79892378475aSmrg
7990d87a3195Smrg    darwin* | rhapsody*)
7991d87a3195Smrg      # PIC is the default on this platform
7992d87a3195Smrg      # Common symbols not allowed in MH_DYLIB files
7993d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7994d87a3195Smrg      ;;
799595b296d0Smrg
7996d87a3195Smrg    haiku*)
7997d87a3195Smrg      # PIC is the default for Haiku.
7998d87a3195Smrg      # The "-static" flag exists, but is broken.
7999d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
8000d87a3195Smrg      ;;
800195b296d0Smrg
8002d87a3195Smrg    hpux*)
8003d87a3195Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
8004d87a3195Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
8005d87a3195Smrg      # sets the default TLS model and affects inlining.
8006d87a3195Smrg      case $host_cpu in
8007d87a3195Smrg      hppa*64*)
8008d87a3195Smrg	# +Z the default
8009d87a3195Smrg	;;
8010d87a3195Smrg      *)
8011d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8012d87a3195Smrg	;;
8013d87a3195Smrg      esac
8014d87a3195Smrg      ;;
801514330f12Smrg
8016d87a3195Smrg    interix[[3-9]]*)
8017d87a3195Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8018d87a3195Smrg      # Instead, we relocate shared libraries at runtime.
8019d87a3195Smrg      ;;
802014330f12Smrg
8021d87a3195Smrg    msdosdjgpp*)
8022d87a3195Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
8023d87a3195Smrg      # on systems that don't support them.
8024d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8025d87a3195Smrg      enable_shared=no
8026d87a3195Smrg      ;;
802795b296d0Smrg
8028d87a3195Smrg    *nto* | *qnx*)
8029d87a3195Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
8030d87a3195Smrg      # it will coredump.
8031d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8032d87a3195Smrg      ;;
803395b296d0Smrg
8034d87a3195Smrg    sysv4*MP*)
8035d87a3195Smrg      if test -d /usr/nec; then
8036d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
8037d87a3195Smrg      fi
8038d87a3195Smrg      ;;
803995b296d0Smrg
8040d87a3195Smrg    *)
8041d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8042d87a3195Smrg      ;;
8043d87a3195Smrg    esac
804495b296d0Smrg
8045d87a3195Smrg    case $cc_basename in
8046d87a3195Smrg    nvcc*) # Cuda Compiler Driver 2.2
8047d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
8048d87a3195Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8049d87a3195Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
8050d87a3195Smrg      fi
8051d87a3195Smrg      ;;
8052d87a3195Smrg    esac
8053d87a3195Smrg  else
8054d87a3195Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
8055d87a3195Smrg    case $host_os in
8056d87a3195Smrg    aix*)
8057d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8058d87a3195Smrg      if test ia64 = "$host_cpu"; then
8059d87a3195Smrg	# AIX 5 now supports IA64 processor
8060d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8061d87a3195Smrg      else
8062d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
8063d87a3195Smrg      fi
8064d87a3195Smrg      ;;
806595b296d0Smrg
8066d87a3195Smrg    darwin* | rhapsody*)
8067d87a3195Smrg      # PIC is the default on this platform
8068d87a3195Smrg      # Common symbols not allowed in MH_DYLIB files
8069d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8070d87a3195Smrg      case $cc_basename in
8071d87a3195Smrg      nagfor*)
8072d87a3195Smrg        # NAG Fortran compiler
8073d87a3195Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8074d87a3195Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8075d87a3195Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8076d87a3195Smrg        ;;
8077d87a3195Smrg      esac
8078d87a3195Smrg      ;;
807995b296d0Smrg
8080d87a3195Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
8081d87a3195Smrg      # This hack is so that the source file can tell whether it is being
8082d87a3195Smrg      # built for inclusion in a dll (and should export symbols for example).
8083d87a3195Smrg      m4_if([$1], [GCJ], [],
8084d87a3195Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8085d87a3195Smrg      case $host_os in
8086d87a3195Smrg      os2*)
8087d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
8088d87a3195Smrg	;;
8089d87a3195Smrg      esac
8090d87a3195Smrg      ;;
809195b296d0Smrg
8092d87a3195Smrg    hpux9* | hpux10* | hpux11*)
8093d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8094d87a3195Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8095d87a3195Smrg      # not for PA HP-UX.
8096d87a3195Smrg      case $host_cpu in
8097d87a3195Smrg      hppa*64*|ia64*)
8098d87a3195Smrg	# +Z the default
8099d87a3195Smrg	;;
8100d87a3195Smrg      *)
8101d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8102d87a3195Smrg	;;
8103d87a3195Smrg      esac
8104d87a3195Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
8105d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
8106d87a3195Smrg      ;;
810795b296d0Smrg
8108d87a3195Smrg    irix5* | irix6* | nonstopux*)
8109d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8110d87a3195Smrg      # PIC (with -KPIC) is the default.
8111d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8112d87a3195Smrg      ;;
811395b296d0Smrg
8114d87a3195Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
8115d87a3195Smrg      case $cc_basename in
8116d87a3195Smrg      # old Intel for x86_64, which still supported -KPIC.
8117d87a3195Smrg      ecc*)
8118d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8119d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8120d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8121d87a3195Smrg        ;;
8122d87a3195Smrg      # icc used to be incompatible with GCC.
8123d87a3195Smrg      # ICC 10 doesn't accept -KPIC any more.
8124d87a3195Smrg      icc* | ifort*)
8125d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8126d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8127d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8128d87a3195Smrg        ;;
8129d87a3195Smrg      # Lahey Fortran 8.1.
8130d87a3195Smrg      lf95*)
8131d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8132d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
8133d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
8134d87a3195Smrg	;;
8135d87a3195Smrg      nagfor*)
8136d87a3195Smrg	# NAG Fortran compiler
8137d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8138d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8139d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8140d87a3195Smrg	;;
8141d87a3195Smrg      tcc*)
8142d87a3195Smrg	# Fabrice Bellard et al's Tiny C Compiler
8143d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8144d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8145d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8146d87a3195Smrg	;;
8147d87a3195Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
8148d87a3195Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
8149d87a3195Smrg	# which looks to be a dead project)
8150d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8151d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8152d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8153d87a3195Smrg        ;;
8154d87a3195Smrg      ccc*)
8155d87a3195Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8156d87a3195Smrg        # All Alpha code is PIC.
8157d87a3195Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8158d87a3195Smrg        ;;
8159d87a3195Smrg      xl* | bgxl* | bgf* | mpixl*)
8160d87a3195Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
8161d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8162d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
8163d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
8164d87a3195Smrg	;;
8165d87a3195Smrg      *)
8166d87a3195Smrg	case `$CC -V 2>&1 | $SED 5q` in
8167d87a3195Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
8168d87a3195Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
8169d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8170d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8171d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
8172d87a3195Smrg	  ;;
8173d87a3195Smrg	*Sun\ F* | *Sun*Fortran*)
8174d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8175d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8176d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8177d87a3195Smrg	  ;;
8178d87a3195Smrg	*Sun\ C*)
8179d87a3195Smrg	  # Sun C 5.9
8180d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8181d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8182d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8183d87a3195Smrg	  ;;
8184d87a3195Smrg        *Intel*\ [[CF]]*Compiler*)
8185d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8186d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8187d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8188d87a3195Smrg	  ;;
8189d87a3195Smrg	*Portland\ Group*)
8190d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8191d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8192d87a3195Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8193d87a3195Smrg	  ;;
8194d87a3195Smrg	esac
8195d87a3195Smrg	;;
8196d87a3195Smrg      esac
8197d87a3195Smrg      ;;
819895b296d0Smrg
8199d87a3195Smrg    newsos6)
8200d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8201d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8202d87a3195Smrg      ;;
820395b296d0Smrg
8204d87a3195Smrg    *nto* | *qnx*)
8205d87a3195Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
8206d87a3195Smrg      # it will coredump.
8207d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8208d87a3195Smrg      ;;
820995b296d0Smrg
8210d87a3195Smrg    osf3* | osf4* | osf5*)
8211d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8212d87a3195Smrg      # All OSF/1 code is PIC.
8213d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8214d87a3195Smrg      ;;
821595b296d0Smrg
8216d87a3195Smrg    rdos*)
8217d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8218d87a3195Smrg      ;;
821995b296d0Smrg
8220d87a3195Smrg    solaris*)
8221d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8222d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8223d87a3195Smrg      case $cc_basename in
8224d87a3195Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
8225d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
8226d87a3195Smrg      *)
8227d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
8228d87a3195Smrg      esac
8229d87a3195Smrg      ;;
823095b296d0Smrg
8231d87a3195Smrg    sunos4*)
8232d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8233d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8234d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8235d87a3195Smrg      ;;
823695b296d0Smrg
8237d87a3195Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
8238d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8239d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8240d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8241d87a3195Smrg      ;;
824295b296d0Smrg
8243d87a3195Smrg    sysv4*MP*)
8244d87a3195Smrg      if test -d /usr/nec; then
8245d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
8246d87a3195Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8247d87a3195Smrg      fi
8248d87a3195Smrg      ;;
824995b296d0Smrg
8250d87a3195Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8251d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8252d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8253d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8254d87a3195Smrg      ;;
825595b296d0Smrg
8256d87a3195Smrg    unicos*)
8257d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8258d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8259d87a3195Smrg      ;;
826095b296d0Smrg
8261d87a3195Smrg    uts4*)
8262d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8263d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8264d87a3195Smrg      ;;
826595b296d0Smrg
8266d87a3195Smrg    *)
8267d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8268d87a3195Smrg      ;;
8269d87a3195Smrg    esac
8270d87a3195Smrg  fi
827114330f12Smrg])
8272d87a3195Smrgcase $host_os in
8273d87a3195Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
8274d87a3195Smrg  *djgpp*)
8275d87a3195Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
8276d87a3195Smrg    ;;
8277d87a3195Smrg  *)
8278d87a3195Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
8279d87a3195Smrg    ;;
8280d87a3195Smrgesac
828195b296d0Smrg
8282d87a3195SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
8283d87a3195Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
8284d87a3195Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
8285d87a3195Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
828695b296d0Smrg
8287d87a3195Smrg#
8288d87a3195Smrg# Check to make sure the PIC flag actually works.
8289d87a3195Smrg#
8290d87a3195Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8291d87a3195Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
8292d87a3195Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
8293d87a3195Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
8294d87a3195Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
8295d87a3195Smrg     "" | " "*) ;;
8296d87a3195Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
8297d87a3195Smrg     esac],
8298d87a3195Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
8299d87a3195Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
8300d87a3195Smrgfi
8301d87a3195Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
8302d87a3195Smrg	[Additional compiler flags for building library objects])
830395b296d0Smrg
8304d87a3195Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
8305d87a3195Smrg	[How to pass a linker flag through the compiler])
8306d87a3195Smrg#
8307d87a3195Smrg# Check to make sure the static flag actually works.
8308d87a3195Smrg#
8309d87a3195Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
8310d87a3195Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
8311d87a3195Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
8312d87a3195Smrg  $lt_tmp_static_flag,
8313d87a3195Smrg  [],
8314d87a3195Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
8315d87a3195Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
8316d87a3195Smrg	[Compiler flag to prevent dynamic linking])
8317d87a3195Smrg])# _LT_COMPILER_PIC
831895b296d0Smrg
83192378475aSmrg
8320d87a3195Smrg# _LT_LINKER_SHLIBS([TAGNAME])
8321d87a3195Smrg# ----------------------------
8322d87a3195Smrg# See if the linker supports building shared libraries.
8323d87a3195Smrgm4_defun([_LT_LINKER_SHLIBS],
8324d87a3195Smrg[AC_REQUIRE([LT_PATH_LD])dnl
8325d87a3195SmrgAC_REQUIRE([LT_PATH_NM])dnl
8326d87a3195Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
8327d87a3195Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
8328d87a3195Smrgm4_require([_LT_DECL_EGREP])dnl
8329d87a3195Smrgm4_require([_LT_DECL_SED])dnl
8330d87a3195Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
8331d87a3195Smrgm4_require([_LT_TAG_COMPILER])dnl
8332d87a3195SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
8333d87a3195Smrgm4_if([$1], [CXX], [
8334d87a3195Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8335d87a3195Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8336d87a3195Smrg  case $host_os in
8337d87a3195Smrg  aix[[4-9]]*)
8338d87a3195Smrg    # If we're using GNU nm, then we don't want the "-C" option.
8339d87a3195Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
8340d87a3195Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
8341d87a3195Smrg    # weak defined symbols like other global defined symbols, whereas
8342d87a3195Smrg    # GNU nm marks them as "W".
8343d87a3195Smrg    # While the 'weak' keyword is ignored in the Export File, we need
8344d87a3195Smrg    # it in the Import File for the 'aix-soname' feature, so we have
8345d87a3195Smrg    # to replace the "-B" option with "-P" for AIX nm.
8346d87a3195Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8347d87a3195Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
8348d87a3195Smrg    else
8349d87a3195Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
8350d87a3195Smrg    fi
8351d87a3195Smrg    ;;
8352d87a3195Smrg  pw32*)
8353d87a3195Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
8354d87a3195Smrg    ;;
8355d87a3195Smrg  cygwin* | mingw* | cegcc*)
8356d87a3195Smrg    case $cc_basename in
8357d87a3195Smrg    cl* | icl*)
8358d87a3195Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
8359d87a3195Smrg      ;;
8360d87a3195Smrg    *)
8361d87a3195Smrg      _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'
8362d87a3195Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
8363d87a3195Smrg      ;;
8364d87a3195Smrg    esac
8365d87a3195Smrg    ;;
8366d87a3195Smrg  *)
8367d87a3195Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8368d87a3195Smrg    ;;
8369d87a3195Smrg  esac
8370d87a3195Smrg], [
8371d87a3195Smrg  runpath_var=
8372d87a3195Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
8373d87a3195Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
8374d87a3195Smrg  _LT_TAGVAR(archive_cmds, $1)=
8375d87a3195Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
8376d87a3195Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
8377d87a3195Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8378d87a3195Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8379d87a3195Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8380d87a3195Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
8381d87a3195Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
8382d87a3195Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8383d87a3195Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8384d87a3195Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
8385d87a3195Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
8386d87a3195Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8387d87a3195Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
8388d87a3195Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
8389d87a3195Smrg  _LT_TAGVAR(module_cmds, $1)=
8390d87a3195Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
8391d87a3195Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
8392d87a3195Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
8393d87a3195Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
8394d87a3195Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
8395d87a3195Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
8396d87a3195Smrg  # included in the symbol list
8397d87a3195Smrg  _LT_TAGVAR(include_expsyms, $1)=
8398d87a3195Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
8399d87a3195Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
8400d87a3195Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
8401d87a3195Smrg  # as well as any symbol that contains 'd'.
8402d87a3195Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8403d87a3195Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8404d87a3195Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
8405d87a3195Smrg  # the symbol is explicitly referenced.  Since portable code cannot
8406d87a3195Smrg  # rely on this symbol name, it's probably fine to never include it in
8407d87a3195Smrg  # preloaded symbol tables.
8408d87a3195Smrg  # Exclude shared library initialization/finalization symbols.
8409d87a3195Smrgdnl Note also adjust exclude_expsyms for C++ above.
8410d87a3195Smrg  extract_expsyms_cmds=
8411d87a3195Smrg
8412d87a3195Smrg  case $host_os in
8413d87a3195Smrg  cygwin* | mingw* | pw32* | cegcc*)
8414d87a3195Smrg    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
8415d87a3195Smrg    # When not using gcc, we currently assume that we are using
8416d87a3195Smrg    # Microsoft Visual C++ or Intel C++ Compiler.
8417d87a3195Smrg    if test yes != "$GCC"; then
8418d87a3195Smrg      with_gnu_ld=no
8419d87a3195Smrg    fi
8420d87a3195Smrg    ;;
8421d87a3195Smrg  interix*)
8422d87a3195Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
8423d87a3195Smrg    with_gnu_ld=yes
8424d87a3195Smrg    ;;
8425d87a3195Smrg  openbsd* | bitrig*)
8426d87a3195Smrg    with_gnu_ld=no
8427d87a3195Smrg    ;;
8428d87a3195Smrg  esac
8429d87a3195Smrg
8430d87a3195Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
84312378475aSmrg
8432d87a3195Smrg  # On some targets, GNU ld is compatible enough with the native linker
8433d87a3195Smrg  # that we're better off using the native interface for both.
8434d87a3195Smrg  lt_use_gnu_ld_interface=no
8435d87a3195Smrg  if test yes = "$with_gnu_ld"; then
8436d87a3195Smrg    case $host_os in
8437d87a3195Smrg      aix*)
8438d87a3195Smrg	# The AIX port of GNU ld has always aspired to compatibility
8439d87a3195Smrg	# with the native linker.  However, as the warning in the GNU ld
8440d87a3195Smrg	# block says, versions before 2.19.5* couldn't really create working
8441d87a3195Smrg	# shared libraries, regardless of the interface used.
8442d87a3195Smrg	case `$LD -v 2>&1` in
8443d87a3195Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
8444d87a3195Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
8445d87a3195Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
8446d87a3195Smrg	  *)
8447d87a3195Smrg	    lt_use_gnu_ld_interface=yes
8448d87a3195Smrg	    ;;
8449d87a3195Smrg	esac
8450d87a3195Smrg	;;
8451d87a3195Smrg      *)
8452d87a3195Smrg	lt_use_gnu_ld_interface=yes
8453d87a3195Smrg	;;
8454d87a3195Smrg    esac
8455d87a3195Smrg  fi
845695b296d0Smrg
8457d87a3195Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
8458d87a3195Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
8459d87a3195Smrg    wlarc='$wl'
84602378475aSmrg
8461d87a3195Smrg    # Set some defaults for GNU ld with shared library support. These
8462d87a3195Smrg    # are reset later if shared libraries are not supported. Putting them
8463d87a3195Smrg    # here allows them to be overridden if necessary.
8464d87a3195Smrg    runpath_var=LD_RUN_PATH
8465d87a3195Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8466d87a3195Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
8467d87a3195Smrg    # ancient GNU ld didn't support --whole-archive et. al.
8468d87a3195Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8469d87a3195Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
8470d87a3195Smrg    else
8471d87a3195Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
8472d87a3195Smrg    fi
8473d87a3195Smrg    supports_anon_versioning=no
8474d87a3195Smrg    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
8475d87a3195Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
8476d87a3195Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
8477d87a3195Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8478d87a3195Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8479d87a3195Smrg      *\ 2.11.*) ;; # other 2.11 versions
8480d87a3195Smrg      *) supports_anon_versioning=yes ;;
8481d87a3195Smrg    esac
84822378475aSmrg
8483d87a3195Smrg    # See if GNU ld supports shared libraries.
8484d87a3195Smrg    case $host_os in
8485d87a3195Smrg    aix[[3-9]]*)
8486d87a3195Smrg      # On AIX/PPC, the GNU linker is very broken
8487d87a3195Smrg      if test ia64 != "$host_cpu"; then
8488d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8489d87a3195Smrg	cat <<_LT_EOF 1>&2
84902378475aSmrg
8491d87a3195Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
8492d87a3195Smrg*** to be unable to reliably create shared libraries on AIX.
8493d87a3195Smrg*** Therefore, libtool is disabling shared libraries support.  If you
8494d87a3195Smrg*** really care for shared libraries, you may want to install binutils
8495d87a3195Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
8496d87a3195Smrg*** You will then need to restart the configuration process.
849795b296d0Smrg
8498d87a3195Smrg_LT_EOF
8499d87a3195Smrg      fi
850014330f12Smrg      ;;
850195b296d0Smrg
8502d87a3195Smrg    amigaos*)
8503d87a3195Smrg      case $host_cpu in
8504d87a3195Smrg      powerpc)
8505d87a3195Smrg            # see comment about AmigaOS4 .so support
8506d87a3195Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8507d87a3195Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
8508d87a3195Smrg        ;;
8509d87a3195Smrg      m68k)
8510d87a3195Smrg            _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)'
8511d87a3195Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8512d87a3195Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
8513d87a3195Smrg        ;;
8514d87a3195Smrg      esac
8515d87a3195Smrg      ;;
851695b296d0Smrg
8517d87a3195Smrg    beos*)
8518d87a3195Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8519d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8520d87a3195Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8521d87a3195Smrg	# support --undefined.  This deserves some investigation.  FIXME
8522d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8523d87a3195Smrg      else
8524d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8525d87a3195Smrg      fi
8526d87a3195Smrg      ;;
852795b296d0Smrg
8528d87a3195Smrg    cygwin* | mingw* | pw32* | cegcc*)
8529d87a3195Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
8530d87a3195Smrg      # as there is no search path for DLLs.
8531d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8532d87a3195Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
8533d87a3195Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8534d87a3195Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
8535d87a3195Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8536d87a3195Smrg      _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'
8537d87a3195Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
853895b296d0Smrg
8539d87a3195Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8540d87a3195Smrg        _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'
8541d87a3195Smrg	# If the export-symbols file already is a .def file, use it as
8542d87a3195Smrg	# is; otherwise, prepend EXPORTS...
8543d87a3195Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
8544d87a3195Smrg          cp $export_symbols $output_objdir/$soname.def;
8545d87a3195Smrg        else
8546d87a3195Smrg          echo EXPORTS > $output_objdir/$soname.def;
8547d87a3195Smrg          cat $export_symbols >> $output_objdir/$soname.def;
8548d87a3195Smrg        fi~
8549d87a3195Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8550d87a3195Smrg      else
8551d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8552d87a3195Smrg      fi
8553d87a3195Smrg      ;;
855495b296d0Smrg
8555d87a3195Smrg    haiku*)
8556d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8557d87a3195Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
8558d87a3195Smrg      ;;
855995b296d0Smrg
8560d87a3195Smrg    os2*)
8561d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8562d87a3195Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
8563d87a3195Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8564d87a3195Smrg      shrext_cmds=.dll
8565d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8566d87a3195Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8567d87a3195Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8568d87a3195Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
8569d87a3195Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
8570d87a3195Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8571d87a3195Smrg	emximp -o $lib $output_objdir/$libname.def'
8572d87a3195Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8573d87a3195Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8574d87a3195Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8575d87a3195Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
8576d87a3195Smrg	prefix_cmds="$SED"~
8577d87a3195Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
8578d87a3195Smrg	  prefix_cmds="$prefix_cmds -e 1d";
8579d87a3195Smrg	fi~
8580d87a3195Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
8581d87a3195Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
8582d87a3195Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8583d87a3195Smrg	emximp -o $lib $output_objdir/$libname.def'
8584d87a3195Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
8585d87a3195Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8586d87a3195Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
8587d87a3195Smrg      ;;
8588d87a3195Smrg
8589d87a3195Smrg    interix[[3-9]]*)
8590d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
8591d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8592d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
8593d87a3195Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
8594d87a3195Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8595d87a3195Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
8596d87a3195Smrg      # default) and relocated if they conflict, which is a slow very memory
8597d87a3195Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
8598d87a3195Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8599d87a3195Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
8600d87a3195Smrg      _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'
8601d87a3195Smrg      _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'
8602d87a3195Smrg      ;;
860395b296d0Smrg
8604d87a3195Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
8605d87a3195Smrg      tmp_diet=no
8606d87a3195Smrg      if test linux-dietlibc = "$host_os"; then
8607d87a3195Smrg	case $cc_basename in
8608d87a3195Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
8609d87a3195Smrg	esac
8610d87a3195Smrg      fi
8611d87a3195Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8612d87a3195Smrg	 && test no = "$tmp_diet"
8613d87a3195Smrg      then
8614d87a3195Smrg	tmp_addflag=' $pic_flag'
8615d87a3195Smrg	tmp_sharedflag='-shared'
8616d87a3195Smrg	case $cc_basename,$host_cpu in
8617d87a3195Smrg        pgcc*)				# Portland Group C compiler
8618d87a3195Smrg	  _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'
8619d87a3195Smrg	  tmp_addflag=' $pic_flag'
8620d87a3195Smrg	  ;;
8621d87a3195Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
8622d87a3195Smrg					# Portland Group f77 and f90 compilers
8623d87a3195Smrg	  _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'
8624d87a3195Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
8625d87a3195Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
8626d87a3195Smrg	  tmp_addflag=' -i_dynamic' ;;
8627d87a3195Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
8628d87a3195Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
8629d87a3195Smrg	ifc* | ifort*)			# Intel Fortran compiler
8630d87a3195Smrg	  tmp_addflag=' -nofor_main' ;;
8631d87a3195Smrg	lf95*)				# Lahey Fortran 8.1
8632d87a3195Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
8633d87a3195Smrg	  tmp_sharedflag='--shared' ;;
8634d87a3195Smrg        nagfor*)                        # NAGFOR 5.3
8635d87a3195Smrg          tmp_sharedflag='-Wl,-shared' ;;
8636d87a3195Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8637d87a3195Smrg	  tmp_sharedflag='-qmkshrobj'
8638d87a3195Smrg	  tmp_addflag= ;;
8639d87a3195Smrg	nvcc*)	# Cuda Compiler Driver 2.2
8640d87a3195Smrg	  _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'
8641d87a3195Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
8642d87a3195Smrg	  ;;
8643d87a3195Smrg	esac
8644d87a3195Smrg	case `$CC -V 2>&1 | $SED 5q` in
8645d87a3195Smrg	*Sun\ C*)			# Sun C 5.9
8646d87a3195Smrg	  _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'
8647d87a3195Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
8648d87a3195Smrg	  tmp_sharedflag='-G' ;;
8649d87a3195Smrg	*Sun\ F*)			# Sun Fortran 8.3
8650d87a3195Smrg	  tmp_sharedflag='-G' ;;
8651d87a3195Smrg	esac
8652d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
865395b296d0Smrg
8654d87a3195Smrg        if test yes = "$supports_anon_versioning"; then
8655d87a3195Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8656d87a3195Smrg            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8657d87a3195Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
8658d87a3195Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
8659d87a3195Smrg        fi
866095b296d0Smrg
8661d87a3195Smrg	case $cc_basename in
8662d87a3195Smrg	tcc*)
8663d87a3195Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
8664d87a3195Smrg	  ;;
8665d87a3195Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
8666d87a3195Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8667d87a3195Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
8668d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8669d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
8670d87a3195Smrg	  if test yes = "$supports_anon_versioning"; then
8671d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8672d87a3195Smrg              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8673d87a3195Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
8674d87a3195Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8675d87a3195Smrg	  fi
8676d87a3195Smrg	  ;;
8677d87a3195Smrg	esac
8678d87a3195Smrg      else
8679d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
8680d87a3195Smrg      fi
868114330f12Smrg      ;;
868214330f12Smrg
8683d87a3195Smrg    netbsd*)
8684d87a3195Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8685d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8686d87a3195Smrg	wlarc=
8687d87a3195Smrg      else
8688d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8689d87a3195Smrg	_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'
8690d87a3195Smrg      fi
8691d87a3195Smrg      ;;
869214330f12Smrg
8693d87a3195Smrg    solaris*)
8694d87a3195Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8695d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8696d87a3195Smrg	cat <<_LT_EOF 1>&2
869795b296d0Smrg
8698d87a3195Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
8699d87a3195Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
8700d87a3195Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
8701d87a3195Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
8702d87a3195Smrg*** your PATH or compiler configuration so that the native linker is
8703d87a3195Smrg*** used, and then restart.
870495b296d0Smrg
8705d87a3195Smrg_LT_EOF
8706d87a3195Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8707d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8708d87a3195Smrg	_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'
8709d87a3195Smrg      else
8710d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8711d87a3195Smrg      fi
8712d87a3195Smrg      ;;
87132378475aSmrg
8714d87a3195Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8715d87a3195Smrg      case `$LD -v 2>&1` in
8716d87a3195Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
8717d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8718d87a3195Smrg	cat <<_LT_EOF 1>&2
8719ff89ac2bSmrg
8720d87a3195Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
8721d87a3195Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
8722d87a3195Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
8723d87a3195Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
8724d87a3195Smrg*** your PATH or compiler configuration so that the native linker is
8725d87a3195Smrg*** used, and then restart.
8726ff89ac2bSmrg
8727d87a3195Smrg_LT_EOF
8728d87a3195Smrg	;;
8729d87a3195Smrg	*)
8730d87a3195Smrg	  # For security reasons, it is highly recommended that you always
8731d87a3195Smrg	  # use absolute paths for naming shared libraries, and exclude the
8732d87a3195Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
8733d87a3195Smrg	  # requires that you compile everything twice, which is a pain.
8734d87a3195Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8735d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8736d87a3195Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8737d87a3195Smrg	    _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'
8738d87a3195Smrg	  else
8739d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8740d87a3195Smrg	  fi
8741d87a3195Smrg	;;
8742d87a3195Smrg      esac
8743d87a3195Smrg      ;;
8744ff89ac2bSmrg
8745d87a3195Smrg    sunos4*)
8746d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8747d87a3195Smrg      wlarc=
8748d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
8749d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8750d87a3195Smrg      ;;
8751ff89ac2bSmrg
875214330f12Smrg    *)
8753d87a3195Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8754d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8755d87a3195Smrg	_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'
8756d87a3195Smrg      else
8757d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8758d87a3195Smrg      fi
875914330f12Smrg      ;;
8760d87a3195Smrg    esac
8761ff89ac2bSmrg
8762d87a3195Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
8763d87a3195Smrg      runpath_var=
8764d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8765d87a3195Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8766d87a3195Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
8767d87a3195Smrg    fi
8768d87a3195Smrg  else
8769d87a3195Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
8770d87a3195Smrg    case $host_os in
8771d87a3195Smrg    aix3*)
8772d87a3195Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8773d87a3195Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
8774d87a3195Smrg      _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'
8775d87a3195Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
8776d87a3195Smrg      # are no directories specified by -L.
8777d87a3195Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
8778d87a3195Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
8779d87a3195Smrg	# Neither direct hardcoding nor static linking is supported with a
8780d87a3195Smrg	# broken collect2.
8781d87a3195Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
8782d87a3195Smrg      fi
8783d87a3195Smrg      ;;
8784ff89ac2bSmrg
8785d87a3195Smrg    aix[[4-9]]*)
8786d87a3195Smrg      if test ia64 = "$host_cpu"; then
8787d87a3195Smrg	# On IA64, the linker does run time linking by default, so we don't
8788d87a3195Smrg	# have to do anything special.
8789d87a3195Smrg	aix_use_runtimelinking=no
8790d87a3195Smrg	exp_sym_flag='-Bexport'
8791d87a3195Smrg	no_entry_flag=
8792d87a3195Smrg      else
8793d87a3195Smrg	# If we're using GNU nm, then we don't want the "-C" option.
8794d87a3195Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
8795d87a3195Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
8796d87a3195Smrg	# weak defined symbols like other global defined symbols, whereas
8797d87a3195Smrg	# GNU nm marks them as "W".
8798d87a3195Smrg	# While the 'weak' keyword is ignored in the Export File, we need
8799d87a3195Smrg	# it in the Import File for the 'aix-soname' feature, so we have
8800d87a3195Smrg	# to replace the "-B" option with "-P" for AIX nm.
8801d87a3195Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8802d87a3195Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
8803d87a3195Smrg	else
8804d87a3195Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
8805d87a3195Smrg	fi
8806d87a3195Smrg	aix_use_runtimelinking=no
8807ff89ac2bSmrg
8808d87a3195Smrg	# Test if we are trying to use run time linking or normal
8809d87a3195Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
8810d87a3195Smrg	# have runtime linking enabled, and use it for executables.
8811d87a3195Smrg	# For shared libraries, we enable/disable runtime linking
8812d87a3195Smrg	# depending on the kind of the shared library created -
8813d87a3195Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
8814d87a3195Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
8815d87a3195Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
8816d87a3195Smrg	#            lib.a           static archive
8817d87a3195Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
8818d87a3195Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
8819d87a3195Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
8820d87a3195Smrg	#            lib.a(lib.so.V) shared, rtl:no
8821d87a3195Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
8822d87a3195Smrg	#            lib.a           static archive
8823d87a3195Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
8824d87a3195Smrg	  for ld_flag in $LDFLAGS; do
8825d87a3195Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
8826d87a3195Smrg	    aix_use_runtimelinking=yes
8827d87a3195Smrg	    break
8828d87a3195Smrg	  fi
8829d87a3195Smrg	  done
8830d87a3195Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
8831d87a3195Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
8832d87a3195Smrg	    # so we don't have lib.a shared libs to link our executables.
8833d87a3195Smrg	    # We have to force runtime linking in this case.
8834d87a3195Smrg	    aix_use_runtimelinking=yes
8835d87a3195Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
8836d87a3195Smrg	  fi
8837d87a3195Smrg	  ;;
8838d87a3195Smrg	esac
8839d87a3195Smrg
8840d87a3195Smrg	exp_sym_flag='-bexport'
8841d87a3195Smrg	no_entry_flag='-bnoentry'
8842d87a3195Smrg      fi
8843ff89ac2bSmrg
8844d87a3195Smrg      # When large executables or shared objects are built, AIX ld can
8845d87a3195Smrg      # have problems creating the table of contents.  If linking a library
8846d87a3195Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
8847d87a3195Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8848d87a3195Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
88492378475aSmrg
8850d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)=''
8851d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
8852d87a3195Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8853d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
8854d87a3195Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
8855d87a3195Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
8856d87a3195Smrg      case $with_aix_soname,$aix_use_runtimelinking in
8857d87a3195Smrg      aix,*) ;; # traditional, no import file
8858d87a3195Smrg      svr4,* | *,yes) # use import file
8859d87a3195Smrg	# The Import File defines what to hardcode.
8860d87a3195Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
8861d87a3195Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8862d87a3195Smrg	;;
8863d87a3195Smrg      esac
88642378475aSmrg
8865d87a3195Smrg      if test yes = "$GCC"; then
8866d87a3195Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
8867d87a3195Smrg	# We only want to do this on AIX 4.2 and lower, the check
8868d87a3195Smrg	# below for broken collect2 doesn't work under 4.3+
8869d87a3195Smrg	  collect2name=`$CC -print-prog-name=collect2`
8870d87a3195Smrg	  if test -f "$collect2name" &&
8871d87a3195Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8872d87a3195Smrg	  then
8873d87a3195Smrg	  # We have reworked collect2
8874d87a3195Smrg	  :
8875d87a3195Smrg	  else
8876d87a3195Smrg	  # We have old collect2
8877d87a3195Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
8878d87a3195Smrg	  # It fails to find uninstalled libraries when the uninstalled
8879d87a3195Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
8880d87a3195Smrg	  # to unsupported forces relinking
8881d87a3195Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
8882d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8883d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
8884d87a3195Smrg	  fi
8885d87a3195Smrg	  ;;
8886d87a3195Smrg	esac
8887d87a3195Smrg	shared_flag='-shared'
8888d87a3195Smrg	if test yes = "$aix_use_runtimelinking"; then
8889d87a3195Smrg	  shared_flag="$shared_flag "'$wl-G'
8890d87a3195Smrg	fi
8891d87a3195Smrg	# Need to ensure runtime linking is disabled for the traditional
8892d87a3195Smrg	# shared library, or the linker may eventually find shared libraries
8893d87a3195Smrg	# /with/ Import File - we do not want to mix them.
8894d87a3195Smrg	shared_flag_aix='-shared'
8895d87a3195Smrg	shared_flag_svr4='-shared $wl-G'
8896d87a3195Smrg      else
8897d87a3195Smrg	# not using gcc
8898d87a3195Smrg	if test ia64 = "$host_cpu"; then
8899d87a3195Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8900d87a3195Smrg	# chokes on -Wl,-G. The following line is correct:
8901d87a3195Smrg	  shared_flag='-G'
8902d87a3195Smrg	else
8903d87a3195Smrg	  if test yes = "$aix_use_runtimelinking"; then
8904d87a3195Smrg	    shared_flag='$wl-G'
8905d87a3195Smrg	  else
8906d87a3195Smrg	    shared_flag='$wl-bM:SRE'
8907d87a3195Smrg	  fi
8908d87a3195Smrg	  shared_flag_aix='$wl-bM:SRE'
8909d87a3195Smrg	  shared_flag_svr4='$wl-G'
8910d87a3195Smrg	fi
8911d87a3195Smrg      fi
89122378475aSmrg
8913d87a3195Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
8914d87a3195Smrg      # It seems that -bexpall does not export symbols beginning with
8915d87a3195Smrg      # underscore (_), so it is better to generate a list of symbols to export.
8916d87a3195Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
8917d87a3195Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
8918d87a3195Smrg	# Warning - without using the other runtime loading flags (-brtl),
8919d87a3195Smrg	# -berok will link without error, but may produce a broken library.
8920d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
8921d87a3195Smrg        # Determine the default libpath from the value encoded in an
8922d87a3195Smrg        # empty executable.
8923d87a3195Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
8924d87a3195Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
8925d87a3195Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
8926d87a3195Smrg      else
8927d87a3195Smrg	if test ia64 = "$host_cpu"; then
8928d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
8929d87a3195Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8930d87a3195Smrg	  _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"
8931d87a3195Smrg	else
8932d87a3195Smrg	 # Determine the default libpath from the value encoded in an
8933d87a3195Smrg	 # empty executable.
8934d87a3195Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
8935d87a3195Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
8936d87a3195Smrg	  # Warning - without using the other run time loading flags,
8937d87a3195Smrg	  # -berok will link without error, but may produce a broken library.
8938d87a3195Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
8939d87a3195Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
8940d87a3195Smrg	  if test yes = "$with_gnu_ld"; then
8941d87a3195Smrg	    # We only use this code for GNU lds that support --whole-archive.
8942d87a3195Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
8943d87a3195Smrg	  else
8944d87a3195Smrg	    # Exported symbols can be pulled into shared objects from archives
8945d87a3195Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
8946d87a3195Smrg	  fi
8947d87a3195Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
8948d87a3195Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
8949d87a3195Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
8950d87a3195Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
8951d87a3195Smrg	  if test svr4 != "$with_aix_soname"; then
8952d87a3195Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
8953d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
8954d87a3195Smrg	  fi
8955d87a3195Smrg	  if test aix != "$with_aix_soname"; then
8956d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
8957d87a3195Smrg	  else
8958d87a3195Smrg	    # used by -dlpreopen to get the symbols
8959d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
8960d87a3195Smrg	  fi
8961d87a3195Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
8962d87a3195Smrg	fi
8963d87a3195Smrg      fi
8964eca46af7Smrg      ;;
8965eca46af7Smrg
8966d87a3195Smrg    amigaos*)
8967d87a3195Smrg      case $host_cpu in
8968d87a3195Smrg      powerpc)
8969d87a3195Smrg            # see comment about AmigaOS4 .so support
8970d87a3195Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8971d87a3195Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
8972d87a3195Smrg        ;;
8973d87a3195Smrg      m68k)
8974d87a3195Smrg            _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)'
8975d87a3195Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8976d87a3195Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
8977d87a3195Smrg        ;;
8978d87a3195Smrg      esac
8979d87a3195Smrg      ;;
8980eca46af7Smrg
8981d87a3195Smrg    bsdi[[45]]*)
8982d87a3195Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
8983d87a3195Smrg      ;;
8984eca46af7Smrg
8985d87a3195Smrg    cygwin* | mingw* | pw32* | cegcc*)
8986d87a3195Smrg      # When not using gcc, we currently assume that we are using
8987d87a3195Smrg      # Microsoft Visual C++ or Intel C++ Compiler.
8988d87a3195Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
8989d87a3195Smrg      # no search path for DLLs.
8990d87a3195Smrg      case $cc_basename in
8991d87a3195Smrg      cl* | icl*)
8992d87a3195Smrg	# Native MSVC or ICC
8993d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
8994d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8995d87a3195Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
8996d87a3195Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
8997d87a3195Smrg	# Tell ltmain to make .lib files, not .a files.
8998d87a3195Smrg	libext=lib
8999d87a3195Smrg	# Tell ltmain to make .dll files, not .so files.
9000d87a3195Smrg	shrext_cmds=.dll
9001d87a3195Smrg	# FIXME: Setting linknames here is a bad hack.
9002d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
9003d87a3195Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
9004d87a3195Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
9005d87a3195Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
9006d87a3195Smrg          else
9007d87a3195Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
9008d87a3195Smrg          fi~
9009d87a3195Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9010d87a3195Smrg          linknames='
9011d87a3195Smrg	# The linker will not automatically build a static lib if we build a DLL.
9012d87a3195Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9013d87a3195Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9014d87a3195Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
9015d87a3195Smrg	_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'
9016d87a3195Smrg	# Don't use ranlib
9017d87a3195Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
9018d87a3195Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
9019d87a3195Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
9020d87a3195Smrg          case $lt_outputfile in
9021d87a3195Smrg            *.exe|*.EXE) ;;
9022d87a3195Smrg            *)
9023d87a3195Smrg              lt_outputfile=$lt_outputfile.exe
9024d87a3195Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
9025d87a3195Smrg              ;;
9026d87a3195Smrg          esac~
9027d87a3195Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
9028d87a3195Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9029d87a3195Smrg            $RM "$lt_outputfile.manifest";
9030d87a3195Smrg          fi'
9031d87a3195Smrg	;;
9032d87a3195Smrg      *)
9033d87a3195Smrg	# Assume MSVC and ICC wrapper
9034d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9035d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9036d87a3195Smrg	# Tell ltmain to make .lib files, not .a files.
9037d87a3195Smrg	libext=lib
9038d87a3195Smrg	# Tell ltmain to make .dll files, not .so files.
9039d87a3195Smrg	shrext_cmds=.dll
9040d87a3195Smrg	# FIXME: Setting linknames here is a bad hack.
9041d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
9042d87a3195Smrg	# The linker will automatically build a .lib file if we build a DLL.
9043d87a3195Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9044d87a3195Smrg	# FIXME: Should let the user specify the lib program.
9045d87a3195Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
9046d87a3195Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9047d87a3195Smrg	;;
9048d87a3195Smrg      esac
9049eca46af7Smrg      ;;
90502378475aSmrg
9051d87a3195Smrg    darwin* | rhapsody*)
9052d87a3195Smrg      _LT_DARWIN_LINKER_FEATURES($1)
9053d87a3195Smrg      ;;
90542378475aSmrg
9055d87a3195Smrg    dgux*)
9056d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9057d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9058d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9059d87a3195Smrg      ;;
90602378475aSmrg
9061d87a3195Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
9062d87a3195Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
9063d87a3195Smrg    # does not break anything, and helps significantly (at the cost of a little
9064d87a3195Smrg    # extra space).
9065d87a3195Smrg    freebsd2.2*)
9066d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
9067d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9068d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9069d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9070d87a3195Smrg      ;;
90712378475aSmrg
9072d87a3195Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9073d87a3195Smrg    freebsd2.*)
9074d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9075d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9076d87a3195Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9077d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9078d87a3195Smrg      ;;
90792378475aSmrg
9080d87a3195Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9081d87a3195Smrg    freebsd* | dragonfly* | midnightbsd*)
9082d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9083d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9084d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9085d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9086d87a3195Smrg      ;;
90872378475aSmrg
9088d87a3195Smrg    hpux9*)
9089d87a3195Smrg      if test yes = "$GCC"; then
9090d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9091d87a3195Smrg      else
9092d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9093d87a3195Smrg      fi
9094d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9095d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9096d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
90972378475aSmrg
9098d87a3195Smrg      # hardcode_minus_L: Not really in the search PATH,
9099d87a3195Smrg      # but as the default location of the library.
9100d87a3195Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9101d87a3195Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9102d87a3195Smrg      ;;
91032378475aSmrg
9104d87a3195Smrg    hpux10*)
9105d87a3195Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
9106d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9107d87a3195Smrg      else
9108d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9109d87a3195Smrg      fi
9110d87a3195Smrg      if test no = "$with_gnu_ld"; then
9111d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9112d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9113d87a3195Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
9114d87a3195Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9115d87a3195Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9116d87a3195Smrg	# hardcode_minus_L: Not really in the search PATH,
9117d87a3195Smrg	# but as the default location of the library.
9118d87a3195Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
9119d87a3195Smrg      fi
9120d87a3195Smrg      ;;
912195b296d0Smrg
9122d87a3195Smrg    hpux11*)
9123d87a3195Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
9124d87a3195Smrg	case $host_cpu in
9125d87a3195Smrg	hppa*64*)
9126d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9127d87a3195Smrg	  ;;
9128d87a3195Smrg	ia64*)
9129d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9130d87a3195Smrg	  ;;
9131d87a3195Smrg	*)
9132d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9133d87a3195Smrg	  ;;
9134d87a3195Smrg	esac
9135d87a3195Smrg      else
9136d87a3195Smrg	case $host_cpu in
9137d87a3195Smrg	hppa*64*)
9138d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9139d87a3195Smrg	  ;;
9140d87a3195Smrg	ia64*)
9141d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9142d87a3195Smrg	  ;;
9143d87a3195Smrg	*)
9144d87a3195Smrg	m4_if($1, [], [
9145d87a3195Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
9146d87a3195Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
9147d87a3195Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
9148d87a3195Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
9149d87a3195Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
9150d87a3195Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
9151d87a3195Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
9152d87a3195Smrg	  ;;
9153d87a3195Smrg	esac
9154d87a3195Smrg      fi
9155d87a3195Smrg      if test no = "$with_gnu_ld"; then
9156d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9157d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
915895b296d0Smrg
9159d87a3195Smrg	case $host_cpu in
9160d87a3195Smrg	hppa*64*|ia64*)
9161d87a3195Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
9162d87a3195Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9163d87a3195Smrg	  ;;
9164d87a3195Smrg	*)
9165d87a3195Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
9166d87a3195Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9167d87a3195Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
916895b296d0Smrg
9169d87a3195Smrg	  # hardcode_minus_L: Not really in the search PATH,
9170d87a3195Smrg	  # but as the default location of the library.
9171d87a3195Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
9172d87a3195Smrg	  ;;
9173d87a3195Smrg	esac
9174d87a3195Smrg      fi
9175d87a3195Smrg      ;;
917695b296d0Smrg
9177d87a3195Smrg    irix5* | irix6* | nonstopux*)
9178d87a3195Smrg      if test yes = "$GCC"; then
9179d87a3195Smrg	_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'
9180d87a3195Smrg	# Try to use the -exported_symbol ld option, if it does not
9181d87a3195Smrg	# work, assume that -exports_file does not work either and
9182d87a3195Smrg	# implicitly export all symbols.
9183d87a3195Smrg	# This should be the same for all languages, so no per-tag cache variable.
9184d87a3195Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
9185d87a3195Smrg	  [lt_cv_irix_exported_symbol],
9186d87a3195Smrg	  [save_LDFLAGS=$LDFLAGS
9187d87a3195Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
9188d87a3195Smrg	   AC_LINK_IFELSE(
9189d87a3195Smrg	     [AC_LANG_SOURCE(
9190d87a3195Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
9191d87a3195Smrg			      [C++], [[int foo (void) { return 0; }]],
9192d87a3195Smrg			      [Fortran 77], [[
9193d87a3195Smrg      subroutine foo
9194d87a3195Smrg      end]],
9195d87a3195Smrg			      [Fortran], [[
9196d87a3195Smrg      subroutine foo
9197d87a3195Smrg      end]])])],
9198d87a3195Smrg	      [lt_cv_irix_exported_symbol=yes],
9199d87a3195Smrg	      [lt_cv_irix_exported_symbol=no])
9200d87a3195Smrg           LDFLAGS=$save_LDFLAGS])
9201d87a3195Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
9202d87a3195Smrg          _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'
9203d87a3195Smrg	fi
9204d87a3195Smrg      else
9205d87a3195Smrg	_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'
9206d87a3195Smrg	_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'
9207d87a3195Smrg      fi
9208d87a3195Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9209d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9210d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9211d87a3195Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
9212d87a3195Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9213d87a3195Smrg      ;;
921414330f12Smrg
9215d87a3195Smrg    linux*)
9216d87a3195Smrg      case $cc_basename in
9217d87a3195Smrg      tcc*)
9218d87a3195Smrg	# Fabrice Bellard et al's Tiny C Compiler
9219d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
9220d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9221d87a3195Smrg	;;
9222d87a3195Smrg      esac
9223d87a3195Smrg      ;;
922495b296d0Smrg
9225d87a3195Smrg    netbsd*)
9226d87a3195Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9227d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
9228d87a3195Smrg      else
9229d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
9230d87a3195Smrg      fi
9231d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9232d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9233d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9234d87a3195Smrg      ;;
92352378475aSmrg
9236d87a3195Smrg    newsos6)
9237d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9238d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9239d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9240d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9241d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9242d87a3195Smrg      ;;
92432378475aSmrg
9244d87a3195Smrg    *nto* | *qnx*)
9245d87a3195Smrg      ;;
924614330f12Smrg
9247d87a3195Smrg    openbsd* | bitrig*)
9248d87a3195Smrg      if test -f /usr/libexec/ld.so; then
9249d87a3195Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
9250d87a3195Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9251d87a3195Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9252d87a3195Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
9253d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9254d87a3195Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
9255d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9256d87a3195Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9257d87a3195Smrg	else
9258d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9259d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9260d87a3195Smrg	fi
9261d87a3195Smrg      else
9262d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
9263d87a3195Smrg      fi
9264d87a3195Smrg      ;;
926514330f12Smrg
9266d87a3195Smrg    os2*)
9267d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9268d87a3195Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9269d87a3195Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9270d87a3195Smrg      shrext_cmds=.dll
9271d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9272d87a3195Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9273d87a3195Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9274d87a3195Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
9275d87a3195Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9276d87a3195Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9277d87a3195Smrg	emximp -o $lib $output_objdir/$libname.def'
9278d87a3195Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9279d87a3195Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9280d87a3195Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9281d87a3195Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
9282d87a3195Smrg	prefix_cmds="$SED"~
9283d87a3195Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
9284d87a3195Smrg	  prefix_cmds="$prefix_cmds -e 1d";
9285d87a3195Smrg	fi~
9286d87a3195Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9287d87a3195Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9288d87a3195Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9289d87a3195Smrg	emximp -o $lib $output_objdir/$libname.def'
9290d87a3195Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9291d87a3195Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9292d87a3195Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
9293d87a3195Smrg      ;;
929414330f12Smrg
9295d87a3195Smrg    osf3*)
9296d87a3195Smrg      if test yes = "$GCC"; then
9297d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9298d87a3195Smrg	_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'
9299d87a3195Smrg      else
9300d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9301d87a3195Smrg	_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'
9302d87a3195Smrg      fi
9303d87a3195Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9304d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9305d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9306d87a3195Smrg      ;;
930714330f12Smrg
9308d87a3195Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
9309d87a3195Smrg      if test yes = "$GCC"; then
9310d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9311d87a3195Smrg	_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'
9312d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9313d87a3195Smrg      else
9314d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9315d87a3195Smrg	_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'
9316d87a3195Smrg	_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~
9317d87a3195Smrg          $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'
931814330f12Smrg
9319d87a3195Smrg	# Both c and cxx compiler support -rpath directly
9320d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9321d87a3195Smrg      fi
9322d87a3195Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9323d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9324d87a3195Smrg      ;;
932514330f12Smrg
9326d87a3195Smrg    solaris*)
9327d87a3195Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
9328d87a3195Smrg      if test yes = "$GCC"; then
9329d87a3195Smrg	wlarc='$wl'
9330d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9331d87a3195Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9332d87a3195Smrg          $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'
9333d87a3195Smrg      else
9334d87a3195Smrg	case `$CC -V 2>&1` in
9335d87a3195Smrg	*"Compilers 5.0"*)
9336d87a3195Smrg	  wlarc=''
9337d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
9338d87a3195Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9339d87a3195Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
9340d87a3195Smrg	  ;;
9341d87a3195Smrg	*)
9342d87a3195Smrg	  wlarc='$wl'
9343d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
9344d87a3195Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9345d87a3195Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9346d87a3195Smrg	  ;;
9347d87a3195Smrg	esac
9348d87a3195Smrg      fi
9349d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9350d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9351d87a3195Smrg      case $host_os in
9352d87a3195Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
9353d87a3195Smrg      *)
9354d87a3195Smrg	# The compiler driver will combine and reorder linker options,
9355d87a3195Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
9356d87a3195Smrg	# but is careful enough not to reorder.
9357d87a3195Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
9358d87a3195Smrg	if test yes = "$GCC"; then
9359d87a3195Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
9360d87a3195Smrg	else
9361d87a3195Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
9362d87a3195Smrg	fi
9363d87a3195Smrg	;;
9364d87a3195Smrg      esac
9365d87a3195Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9366d87a3195Smrg      ;;
936714330f12Smrg
9368d87a3195Smrg    sunos4*)
9369d87a3195Smrg      if test sequent = "$host_vendor"; then
9370d87a3195Smrg	# Use $CC to link under sequent, because it throws in some extra .o
9371d87a3195Smrg	# files that make .init and .fini sections work.
9372d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
9373d87a3195Smrg      else
9374d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
9375d87a3195Smrg      fi
9376d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9377d87a3195Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9378d87a3195Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9379d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9380d87a3195Smrg      ;;
938114330f12Smrg
9382d87a3195Smrg    sysv4)
9383d87a3195Smrg      case $host_vendor in
9384d87a3195Smrg	sni)
9385d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9386d87a3195Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
9387d87a3195Smrg	;;
9388d87a3195Smrg	siemens)
9389d87a3195Smrg	  ## LD is ld it makes a PLAMLIB
9390d87a3195Smrg	  ## CC just makes a GrossModule.
9391d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
9392d87a3195Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
9393d87a3195Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
9394d87a3195Smrg        ;;
9395d87a3195Smrg	motorola)
9396d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9397d87a3195Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
9398d87a3195Smrg	;;
9399d87a3195Smrg      esac
9400d87a3195Smrg      runpath_var='LD_RUN_PATH'
9401d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9402d87a3195Smrg      ;;
940314330f12Smrg
9404d87a3195Smrg    sysv4.3*)
9405d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9406d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9407d87a3195Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
9408d87a3195Smrg      ;;
94092378475aSmrg
9410d87a3195Smrg    sysv4*MP*)
9411d87a3195Smrg      if test -d /usr/nec; then
9412d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9413d87a3195Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9414d87a3195Smrg	runpath_var=LD_RUN_PATH
9415d87a3195Smrg	hardcode_runpath_var=yes
9416d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
9417d87a3195Smrg      fi
9418d87a3195Smrg      ;;
941995b296d0Smrg
9420d87a3195Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
9421d87a3195Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
9422d87a3195Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9423d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9424d87a3195Smrg      runpath_var='LD_RUN_PATH'
942595b296d0Smrg
9426d87a3195Smrg      if test yes = "$GCC"; then
9427d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9428d87a3195Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9429d87a3195Smrg      else
9430d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9431d87a3195Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9432d87a3195Smrg      fi
9433d87a3195Smrg      ;;
943495b296d0Smrg
9435d87a3195Smrg    sysv5* | sco3.2v5* | sco5v6*)
9436d87a3195Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
9437d87a3195Smrg      # link with -lc, and that would cause any symbols used from libc to
9438d87a3195Smrg      # always be unresolved, which means just about no library would
9439d87a3195Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
9440d87a3195Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
9441d87a3195Smrg      # as -z defs.
9442d87a3195Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
9443d87a3195Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
9444d87a3195Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9445d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9446d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
9447d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9448d87a3195Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9449d87a3195Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
9450d87a3195Smrg      runpath_var='LD_RUN_PATH'
945195b296d0Smrg
9452d87a3195Smrg      if test yes = "$GCC"; then
9453d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9454d87a3195Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9455d87a3195Smrg      else
9456d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9457d87a3195Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9458d87a3195Smrg      fi
9459d87a3195Smrg      ;;
94602378475aSmrg
9461d87a3195Smrg    uts4*)
9462d87a3195Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9463d87a3195Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9464d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9465d87a3195Smrg      ;;
94662378475aSmrg
9467d87a3195Smrg    *)
9468d87a3195Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
9469d87a3195Smrg      ;;
9470d87a3195Smrg    esac
947195b296d0Smrg
9472d87a3195Smrg    if test sni = "$host_vendor"; then
9473d87a3195Smrg      case $host in
9474d87a3195Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9475d87a3195Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
9476d87a3195Smrg	;;
9477d87a3195Smrg      esac
9478d87a3195Smrg    fi
9479d87a3195Smrg  fi
948014330f12Smrg])
9481d87a3195SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
9482d87a3195Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
948395b296d0Smrg
9484d87a3195Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
94852378475aSmrg
9486d87a3195Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
9487d87a3195Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
9488d87a3195Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
9489d87a3195Smrg    [The commands to extract the exported symbol list from a shared archive])
9490eca46af7Smrg
9491eca46af7Smrg#
9492d87a3195Smrg# Do we need to explicitly link libc?
9493eca46af7Smrg#
9494d87a3195Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
9495d87a3195Smrgx|xyes)
9496d87a3195Smrg  # Assume -lc should be added
9497d87a3195Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9498eca46af7Smrg
9499d87a3195Smrg  if test yes,yes = "$GCC,$enable_shared"; then
9500d87a3195Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
9501d87a3195Smrg    *'~'*)
9502d87a3195Smrg      # FIXME: we may have to deal with multi-command sequences.
9503d87a3195Smrg      ;;
9504d87a3195Smrg    '$CC '*)
9505d87a3195Smrg      # Test whether the compiler implicitly links with -lc since on some
9506d87a3195Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
9507d87a3195Smrg      # to ld, don't add -lc before -lgcc.
9508d87a3195Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
9509d87a3195Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
9510d87a3195Smrg	[$RM conftest*
9511d87a3195Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9512eca46af7Smrg
9513d87a3195Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
9514d87a3195Smrg	  soname=conftest
9515d87a3195Smrg	  lib=conftest
9516d87a3195Smrg	  libobjs=conftest.$ac_objext
9517d87a3195Smrg	  deplibs=
9518d87a3195Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
9519d87a3195Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
9520d87a3195Smrg	  compiler_flags=-v
9521d87a3195Smrg	  linker_flags=-v
9522d87a3195Smrg	  verstring=
9523d87a3195Smrg	  output_objdir=.
9524d87a3195Smrg	  libname=conftest
9525d87a3195Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
9526d87a3195Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
9527d87a3195Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
9528d87a3195Smrg	  then
9529d87a3195Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9530d87a3195Smrg	  else
9531d87a3195Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9532d87a3195Smrg	  fi
9533d87a3195Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
9534d87a3195Smrg	else
9535d87a3195Smrg	  cat conftest.err 1>&5
9536d87a3195Smrg	fi
9537d87a3195Smrg	$RM conftest*
9538d87a3195Smrg	])
9539d87a3195Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
9540d87a3195Smrg      ;;
9541d87a3195Smrg    esac
9542d87a3195Smrg  fi
9543d87a3195Smrg  ;;
9544d87a3195Smrgesac
9545eca46af7Smrg
9546d87a3195Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
9547d87a3195Smrg    [Whether or not to add -lc for building shared libraries])
9548d87a3195Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
9549d87a3195Smrg    [enable_shared_with_static_runtimes], [0],
9550d87a3195Smrg    [Whether or not to disallow shared libs when runtime libs are static])
9551d87a3195Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
9552d87a3195Smrg    [Compiler flag to allow reflexive dlopens])
9553d87a3195Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
9554d87a3195Smrg    [Compiler flag to generate shared objects directly from archives])
9555d87a3195Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
9556d87a3195Smrg    [Whether the compiler copes with passing no objects directly])
9557d87a3195Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
9558d87a3195Smrg    [Create an old-style archive from a shared archive])
9559d87a3195Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
9560d87a3195Smrg    [Create a temporary old-style archive to link instead of a shared archive])
9561d87a3195Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
9562d87a3195Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
9563d87a3195Smrg_LT_TAGDECL([], [module_cmds], [2],
9564d87a3195Smrg    [Commands used to build a loadable module if different from building
9565d87a3195Smrg    a shared archive.])
9566d87a3195Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
9567d87a3195Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
9568d87a3195Smrg    [Whether we are building with GNU ld or not])
9569d87a3195Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
9570d87a3195Smrg    [Flag that allows shared libraries with undefined symbols to be built])
9571d87a3195Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
9572d87a3195Smrg    [Flag that enforces no undefined symbols])
9573d87a3195Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
9574d87a3195Smrg    [Flag to hardcode $libdir into a binary during linking.
9575d87a3195Smrg    This must work even if $libdir does not exist])
9576d87a3195Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
9577d87a3195Smrg    [Whether we need a single "-rpath" flag with a separated argument])
9578d87a3195Smrg_LT_TAGDECL([], [hardcode_direct], [0],
9579d87a3195Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
9580d87a3195Smrg    DIR into the resulting binary])
9581d87a3195Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
9582d87a3195Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
9583d87a3195Smrg    DIR into the resulting binary and the resulting library dependency is
9584d87a3195Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
9585d87a3195Smrg    library is relocated])
9586d87a3195Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
9587d87a3195Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
9588d87a3195Smrg    into the resulting binary])
9589d87a3195Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
9590d87a3195Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
9591d87a3195Smrg    into the resulting binary])
9592d87a3195Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
9593d87a3195Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
9594d87a3195Smrg    into the library and all subsequent libraries and executables linked
9595d87a3195Smrg    against it])
9596d87a3195Smrg_LT_TAGDECL([], [inherit_rpath], [0],
9597d87a3195Smrg    [Set to yes if linker adds runtime paths of dependent libraries
9598d87a3195Smrg    to runtime path list])
9599d87a3195Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
9600d87a3195Smrg    [Whether libtool must link a program against all its dependency libraries])
9601d87a3195Smrg_LT_TAGDECL([], [always_export_symbols], [0],
9602d87a3195Smrg    [Set to "yes" if exported symbols are required])
9603d87a3195Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
9604d87a3195Smrg    [The commands to list exported symbols])
9605d87a3195Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
9606d87a3195Smrg    [Symbols that should not be listed in the preloaded symbols])
9607d87a3195Smrg_LT_TAGDECL([], [include_expsyms], [1],
9608d87a3195Smrg    [Symbols that must always be exported])
9609d87a3195Smrg_LT_TAGDECL([], [prelink_cmds], [2],
9610d87a3195Smrg    [Commands necessary for linking programs (against libraries) with templates])
9611d87a3195Smrg_LT_TAGDECL([], [postlink_cmds], [2],
9612d87a3195Smrg    [Commands necessary for finishing linking programs])
9613d87a3195Smrg_LT_TAGDECL([], [file_list_spec], [1],
9614d87a3195Smrg    [Specify filename containing input files])
9615d87a3195Smrgdnl FIXME: Not yet implemented
9616d87a3195Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
9617d87a3195Smrgdnl    [Compiler flag to generate thread safe objects])
9618d87a3195Smrg])# _LT_LINKER_SHLIBS
9619eca46af7Smrg
9620eca46af7Smrg
9621d87a3195Smrg# _LT_LANG_C_CONFIG([TAG])
9622d87a3195Smrg# ------------------------
9623d87a3195Smrg# Ensure that the configuration variables for a C compiler are suitably
9624d87a3195Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
9625d87a3195Smrg# the compiler configuration to 'libtool'.
9626d87a3195Smrgm4_defun([_LT_LANG_C_CONFIG],
9627d87a3195Smrg[m4_require([_LT_DECL_EGREP])dnl
9628d87a3195Smrglt_save_CC=$CC
9629d87a3195SmrgAC_LANG_PUSH(C)
9630eca46af7Smrg
9631d87a3195Smrg# Source file extension for C test sources.
9632d87a3195Smrgac_ext=c
9633eca46af7Smrg
9634d87a3195Smrg# Object file extension for compiled C test sources.
9635d87a3195Smrgobjext=o
9636d87a3195Smrg_LT_TAGVAR(objext, $1)=$objext
9637eca46af7Smrg
9638d87a3195Smrg# Code to be used in simple compile tests
9639d87a3195Smrglt_simple_compile_test_code="int some_variable = 0;"
9640eca46af7Smrg
9641d87a3195Smrg# Code to be used in simple link tests
9642d87a3195Smrglt_simple_link_test_code='int main(){return(0);}'
9643eca46af7Smrg
9644d87a3195Smrg_LT_TAG_COMPILER
9645d87a3195Smrg# Save the default compiler, since it gets overwritten when the other
9646d87a3195Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
9647d87a3195Smrgcompiler_DEFAULT=$CC
9648eca46af7Smrg
9649d87a3195Smrg# save warnings/boilerplate of simple test code
9650d87a3195Smrg_LT_COMPILER_BOILERPLATE
9651d87a3195Smrg_LT_LINKER_BOILERPLATE
9652eca46af7Smrg
9653d87a3195Smrgif test -n "$compiler"; then
9654d87a3195Smrg  _LT_COMPILER_NO_RTTI($1)
9655d87a3195Smrg  _LT_COMPILER_PIC($1)
9656d87a3195Smrg  _LT_COMPILER_C_O($1)
9657d87a3195Smrg  _LT_COMPILER_FILE_LOCKS($1)
9658d87a3195Smrg  _LT_LINKER_SHLIBS($1)
9659d87a3195Smrg  _LT_SYS_DYNAMIC_LINKER($1)
9660d87a3195Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
9661d87a3195Smrg  LT_SYS_DLOPEN_SELF
9662d87a3195Smrg  _LT_CMD_STRIPLIB
9663eca46af7Smrg
9664d87a3195Smrg  # Report what library types will actually be built
9665d87a3195Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
9666d87a3195Smrg  AC_MSG_RESULT([$can_build_shared])
9667eca46af7Smrg
9668d87a3195Smrg  AC_MSG_CHECKING([whether to build shared libraries])
9669d87a3195Smrg  test no = "$can_build_shared" && enable_shared=no
9670eca46af7Smrg
9671d87a3195Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
9672d87a3195Smrg  # are all built from PIC.
9673d87a3195Smrg  case $host_os in
9674d87a3195Smrg  aix3*)
9675d87a3195Smrg    test yes = "$enable_shared" && enable_static=no
9676d87a3195Smrg    if test -n "$RANLIB"; then
9677d87a3195Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
9678d87a3195Smrg      postinstall_cmds='$RANLIB $lib'
9679d87a3195Smrg    fi
9680d87a3195Smrg    ;;
9681eca46af7Smrg
9682d87a3195Smrg  aix[[4-9]]*)
9683d87a3195Smrg    if test ia64 != "$host_cpu"; then
9684d87a3195Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
9685d87a3195Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
9686d87a3195Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
9687d87a3195Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
9688d87a3195Smrg      esac
9689d87a3195Smrg    fi
9690d87a3195Smrg    ;;
9691d87a3195Smrg  esac
9692d87a3195Smrg  AC_MSG_RESULT([$enable_shared])
9693eca46af7Smrg
9694d87a3195Smrg  AC_MSG_CHECKING([whether to build static libraries])
9695d87a3195Smrg  # Make sure either enable_shared or enable_static is yes.
9696d87a3195Smrg  test yes = "$enable_shared" || enable_static=yes
9697d87a3195Smrg  AC_MSG_RESULT([$enable_static])
9698eca46af7Smrg
9699d87a3195Smrg  _LT_CONFIG($1)
9700d87a3195Smrgfi
9701d87a3195SmrgAC_LANG_POP
9702d87a3195SmrgCC=$lt_save_CC
9703d87a3195Smrg])# _LT_LANG_C_CONFIG
9704eca46af7Smrg
9705eca46af7Smrg
9706d87a3195Smrg# _LT_LANG_CXX_CONFIG([TAG])
9707d87a3195Smrg# --------------------------
9708d87a3195Smrg# Ensure that the configuration variables for a C++ compiler are suitably
9709d87a3195Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
9710d87a3195Smrg# the compiler configuration to 'libtool'.
9711d87a3195Smrgm4_defun([_LT_LANG_CXX_CONFIG],
9712d87a3195Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
9713d87a3195Smrgm4_require([_LT_DECL_EGREP])dnl
9714d87a3195Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
9715d87a3195Smrgif test -n "$CXX" && ( test no != "$CXX" &&
9716d87a3195Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
9717d87a3195Smrg    (test g++ != "$CXX"))); then
9718d87a3195Smrg  AC_PROG_CXXCPP
9719eca46af7Smrgelse
9720d87a3195Smrg  _lt_caught_CXX_error=yes
9721d87a3195Smrgfi
9722eca46af7Smrg
9723d87a3195SmrgAC_LANG_PUSH(C++)
9724d87a3195Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9725d87a3195Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
9726d87a3195Smrg_LT_TAGVAR(always_export_symbols, $1)=no
9727d87a3195Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
9728d87a3195Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
9729d87a3195Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
9730d87a3195Smrg_LT_TAGVAR(hardcode_direct, $1)=no
9731d87a3195Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
9732d87a3195Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9733d87a3195Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
9734d87a3195Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
9735d87a3195Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9736d87a3195Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
9737d87a3195Smrg_LT_TAGVAR(inherit_rpath, $1)=no
9738d87a3195Smrg_LT_TAGVAR(module_cmds, $1)=
9739d87a3195Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
9740d87a3195Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
9741d87a3195Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9742d87a3195Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
9743d87a3195Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
9744d87a3195Smrg_LT_TAGVAR(no_undefined_flag, $1)=
9745d87a3195Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
9746d87a3195Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
97472378475aSmrg
9748d87a3195Smrg# Source file extension for C++ test sources.
9749d87a3195Smrgac_ext=cpp
9750eca46af7Smrg
9751d87a3195Smrg# Object file extension for compiled C++ test sources.
9752d87a3195Smrgobjext=o
9753d87a3195Smrg_LT_TAGVAR(objext, $1)=$objext
9754eca46af7Smrg
9755d87a3195Smrg# No sense in running all these tests if we already determined that
9756d87a3195Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
9757d87a3195Smrg# are currently assumed to apply to all compilers on this platform,
9758d87a3195Smrg# and will be corrupted by setting them based on a non-working compiler.
9759d87a3195Smrgif test yes != "$_lt_caught_CXX_error"; then
9760d87a3195Smrg  # Code to be used in simple compile tests
9761d87a3195Smrg  lt_simple_compile_test_code="int some_variable = 0;"
9762eca46af7Smrg
9763d87a3195Smrg  # Code to be used in simple link tests
9764d87a3195Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
9765eca46af7Smrg
9766d87a3195Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9767d87a3195Smrg  _LT_TAG_COMPILER
976895b296d0Smrg
9769d87a3195Smrg  # save warnings/boilerplate of simple test code
9770d87a3195Smrg  _LT_COMPILER_BOILERPLATE
9771d87a3195Smrg  _LT_LINKER_BOILERPLATE
977214330f12Smrg
9773d87a3195Smrg  # Allow CC to be a program name with arguments.
9774d87a3195Smrg  lt_save_CC=$CC
9775d87a3195Smrg  lt_save_CFLAGS=$CFLAGS
9776d87a3195Smrg  lt_save_LD=$LD
9777d87a3195Smrg  lt_save_GCC=$GCC
9778d87a3195Smrg  GCC=$GXX
9779d87a3195Smrg  lt_save_with_gnu_ld=$with_gnu_ld
9780d87a3195Smrg  lt_save_path_LD=$lt_cv_path_LD
9781d87a3195Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
9782d87a3195Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
9783d87a3195Smrg  else
9784d87a3195Smrg    $as_unset lt_cv_prog_gnu_ld
9785d87a3195Smrg  fi
9786d87a3195Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
9787d87a3195Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
9788d87a3195Smrg  else
9789d87a3195Smrg    $as_unset lt_cv_path_LD
9790d87a3195Smrg  fi
9791d87a3195Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
9792d87a3195Smrg  CC=${CXX-"c++"}
9793d87a3195Smrg  CFLAGS=$CXXFLAGS
9794d87a3195Smrg  compiler=$CC
9795d87a3195Smrg  _LT_TAGVAR(compiler, $1)=$CC
9796d87a3195Smrg  _LT_CC_BASENAME([$compiler])
979795b296d0Smrg
9798d87a3195Smrg  if test -n "$compiler"; then
9799d87a3195Smrg    # We don't want -fno-exception when compiling C++ code, so set the
9800d87a3195Smrg    # no_builtin_flag separately
9801d87a3195Smrg    if test yes = "$GXX"; then
9802d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
9803d87a3195Smrg    else
9804d87a3195Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
9805d87a3195Smrg    fi
980614330f12Smrg
9807d87a3195Smrg    if test yes = "$GXX"; then
9808d87a3195Smrg      # Set up default GNU C++ configuration
9809eca46af7Smrg
9810d87a3195Smrg      LT_PATH_LD
9811eca46af7Smrg
9812d87a3195Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
9813d87a3195Smrg      # archiving commands below assume that GNU ld is being used.
9814d87a3195Smrg      if test yes = "$with_gnu_ld"; then
9815d87a3195Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9816d87a3195Smrg        _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'
9817eca46af7Smrg
9818d87a3195Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9819d87a3195Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9820eca46af7Smrg
9821d87a3195Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
9822d87a3195Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
9823d87a3195Smrg        #     investigate it a little bit more. (MM)
9824d87a3195Smrg        wlarc='$wl'
9825eca46af7Smrg
9826d87a3195Smrg        # ancient GNU ld didn't support --whole-archive et. al.
9827d87a3195Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
9828d87a3195Smrg	  $GREP 'no-whole-archive' > /dev/null; then
9829d87a3195Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
9830d87a3195Smrg        else
9831d87a3195Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
9832d87a3195Smrg        fi
9833d87a3195Smrg      else
9834d87a3195Smrg        with_gnu_ld=no
9835d87a3195Smrg        wlarc=
9836eca46af7Smrg
9837d87a3195Smrg        # A generic and very simple default shared library creation
9838d87a3195Smrg        # command for GNU C++ for the case where it uses the native
9839d87a3195Smrg        # linker, instead of GNU ld.  If possible, this setting should
9840d87a3195Smrg        # overridden to take advantage of the native linker features on
9841d87a3195Smrg        # the platform it is being used on.
9842d87a3195Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
9843d87a3195Smrg      fi
9844eca46af7Smrg
9845d87a3195Smrg      # Commands to make compiler produce verbose output that lists
9846d87a3195Smrg      # what "hidden" libraries, object files and flags are used when
9847d87a3195Smrg      # linking a shared library.
9848d87a3195Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
9849eca46af7Smrg
9850d87a3195Smrg    else
9851d87a3195Smrg      GXX=no
9852d87a3195Smrg      with_gnu_ld=no
9853d87a3195Smrg      wlarc=
9854d87a3195Smrg    fi
9855d87a3195Smrg
9856d87a3195Smrg    # PORTME: fill in a description of your system's C++ link characteristics
9857d87a3195Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9858d87a3195Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
9859eca46af7Smrg    case $host_os in
9860d87a3195Smrg      aix3*)
9861d87a3195Smrg        # FIXME: insert proper C++ library support
9862d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
9863d87a3195Smrg        ;;
9864d87a3195Smrg      aix[[4-9]]*)
9865d87a3195Smrg        if test ia64 = "$host_cpu"; then
9866d87a3195Smrg          # On IA64, the linker does run time linking by default, so we don't
9867d87a3195Smrg          # have to do anything special.
9868d87a3195Smrg          aix_use_runtimelinking=no
9869d87a3195Smrg          exp_sym_flag='-Bexport'
9870d87a3195Smrg          no_entry_flag=
9871d87a3195Smrg        else
9872d87a3195Smrg          aix_use_runtimelinking=no
9873d87a3195Smrg
9874d87a3195Smrg          # Test if we are trying to use run time linking or normal
9875d87a3195Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
9876d87a3195Smrg          # have runtime linking enabled, and use it for executables.
9877d87a3195Smrg          # For shared libraries, we enable/disable runtime linking
9878d87a3195Smrg          # depending on the kind of the shared library created -
9879d87a3195Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
9880d87a3195Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
9881d87a3195Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
9882d87a3195Smrg          #            lib.a           static archive
9883d87a3195Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
9884d87a3195Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
9885d87a3195Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
9886d87a3195Smrg          #            lib.a(lib.so.V) shared, rtl:no
9887d87a3195Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
9888d87a3195Smrg          #            lib.a           static archive
9889d87a3195Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
9890d87a3195Smrg	    for ld_flag in $LDFLAGS; do
9891d87a3195Smrg	      case $ld_flag in
9892d87a3195Smrg	      *-brtl*)
9893d87a3195Smrg	        aix_use_runtimelinking=yes
9894d87a3195Smrg	        break
9895d87a3195Smrg	        ;;
9896d87a3195Smrg	      esac
9897d87a3195Smrg	    done
9898d87a3195Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
9899d87a3195Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
9900d87a3195Smrg	      # so we don't have lib.a shared libs to link our executables.
9901d87a3195Smrg	      # We have to force runtime linking in this case.
9902d87a3195Smrg	      aix_use_runtimelinking=yes
9903d87a3195Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
9904d87a3195Smrg	    fi
9905d87a3195Smrg	    ;;
9906d87a3195Smrg          esac
9907eca46af7Smrg
9908d87a3195Smrg          exp_sym_flag='-bexport'
9909d87a3195Smrg          no_entry_flag='-bnoentry'
9910d87a3195Smrg        fi
9911eca46af7Smrg
9912d87a3195Smrg        # When large executables or shared objects are built, AIX ld can
9913d87a3195Smrg        # have problems creating the table of contents.  If linking a library
9914d87a3195Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
9915d87a3195Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
9916d87a3195Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9917eca46af7Smrg
9918d87a3195Smrg        _LT_TAGVAR(archive_cmds, $1)=''
9919d87a3195Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
9920d87a3195Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9921d87a3195Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9922d87a3195Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
9923d87a3195Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
9924d87a3195Smrg        case $with_aix_soname,$aix_use_runtimelinking in
9925d87a3195Smrg        aix,*) ;;	# no import file
9926d87a3195Smrg        svr4,* | *,yes) # use import file
9927d87a3195Smrg          # The Import File defines what to hardcode.
9928d87a3195Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
9929d87a3195Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
9930d87a3195Smrg          ;;
9931d87a3195Smrg        esac
9932eca46af7Smrg
9933d87a3195Smrg        if test yes = "$GXX"; then
9934d87a3195Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
9935d87a3195Smrg          # We only want to do this on AIX 4.2 and lower, the check
9936d87a3195Smrg          # below for broken collect2 doesn't work under 4.3+
9937d87a3195Smrg	  collect2name=`$CC -print-prog-name=collect2`
9938d87a3195Smrg	  if test -f "$collect2name" &&
9939d87a3195Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
9940d87a3195Smrg	  then
9941d87a3195Smrg	    # We have reworked collect2
9942d87a3195Smrg	    :
9943d87a3195Smrg	  else
9944d87a3195Smrg	    # We have old collect2
9945d87a3195Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
9946d87a3195Smrg	    # It fails to find uninstalled libraries when the uninstalled
9947d87a3195Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
9948d87a3195Smrg	    # to unsupported forces relinking
9949d87a3195Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
9950d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9951d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
9952d87a3195Smrg	  fi
9953d87a3195Smrg          esac
9954d87a3195Smrg          shared_flag='-shared'
9955d87a3195Smrg	  if test yes = "$aix_use_runtimelinking"; then
9956d87a3195Smrg	    shared_flag=$shared_flag' $wl-G'
9957d87a3195Smrg	  fi
9958d87a3195Smrg	  # Need to ensure runtime linking is disabled for the traditional
9959d87a3195Smrg	  # shared library, or the linker may eventually find shared libraries
9960d87a3195Smrg	  # /with/ Import File - we do not want to mix them.
9961d87a3195Smrg	  shared_flag_aix='-shared'
9962d87a3195Smrg	  shared_flag_svr4='-shared $wl-G'
9963d87a3195Smrg        else
9964d87a3195Smrg          # not using gcc
9965d87a3195Smrg          if test ia64 = "$host_cpu"; then
9966d87a3195Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9967d87a3195Smrg	  # chokes on -Wl,-G. The following line is correct:
9968d87a3195Smrg	  shared_flag='-G'
9969d87a3195Smrg          else
9970d87a3195Smrg	    if test yes = "$aix_use_runtimelinking"; then
9971d87a3195Smrg	      shared_flag='$wl-G'
9972d87a3195Smrg	    else
9973d87a3195Smrg	      shared_flag='$wl-bM:SRE'
9974d87a3195Smrg	    fi
9975d87a3195Smrg	    shared_flag_aix='$wl-bM:SRE'
9976d87a3195Smrg	    shared_flag_svr4='$wl-G'
9977d87a3195Smrg          fi
9978d87a3195Smrg        fi
9979eca46af7Smrg
9980d87a3195Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
9981d87a3195Smrg        # It seems that -bexpall does not export symbols beginning with
9982d87a3195Smrg        # underscore (_), so it is better to generate a list of symbols to
9983d87a3195Smrg	# export.
9984d87a3195Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
9985d87a3195Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
9986d87a3195Smrg          # Warning - without using the other runtime loading flags (-brtl),
9987d87a3195Smrg          # -berok will link without error, but may produce a broken library.
9988d87a3195Smrg          # The "-G" linker flag allows undefined symbols.
9989d87a3195Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
9990d87a3195Smrg          # Determine the default libpath from the value encoded in an empty
9991d87a3195Smrg          # executable.
9992d87a3195Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
9993d87a3195Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9994eca46af7Smrg
9995d87a3195Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
9996d87a3195Smrg        else
9997d87a3195Smrg          if test ia64 = "$host_cpu"; then
9998d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
9999d87a3195Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
10000d87a3195Smrg	    _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"
10001d87a3195Smrg          else
10002d87a3195Smrg	    # Determine the default libpath from the value encoded in an
10003d87a3195Smrg	    # empty executable.
10004d87a3195Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
10005d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
10006d87a3195Smrg	    # Warning - without using the other run time loading flags,
10007d87a3195Smrg	    # -berok will link without error, but may produce a broken library.
10008d87a3195Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
10009d87a3195Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
10010d87a3195Smrg	    if test yes = "$with_gnu_ld"; then
10011d87a3195Smrg	      # We only use this code for GNU lds that support --whole-archive.
10012d87a3195Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
10013d87a3195Smrg	    else
10014d87a3195Smrg	      # Exported symbols can be pulled into shared objects from archives
10015d87a3195Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
10016d87a3195Smrg	    fi
10017d87a3195Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10018d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
10019d87a3195Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
10020d87a3195Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
10021d87a3195Smrg	    if test svr4 != "$with_aix_soname"; then
10022d87a3195Smrg	      # This is similar to how AIX traditionally builds its shared
10023d87a3195Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
10024d87a3195Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
10025d87a3195Smrg	    fi
10026d87a3195Smrg	    if test aix != "$with_aix_soname"; then
10027d87a3195Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
10028d87a3195Smrg	    else
10029d87a3195Smrg	      # used by -dlpreopen to get the symbols
10030d87a3195Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
10031d87a3195Smrg	    fi
10032d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
10033d87a3195Smrg          fi
10034d87a3195Smrg        fi
10035d87a3195Smrg        ;;
10036eca46af7Smrg
10037d87a3195Smrg      beos*)
10038d87a3195Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10039d87a3195Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10040d87a3195Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
10041d87a3195Smrg	  # support --undefined.  This deserves some investigation.  FIXME
10042d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10043d87a3195Smrg	else
10044d87a3195Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
10045d87a3195Smrg	fi
10046d87a3195Smrg	;;
10047eca46af7Smrg
10048d87a3195Smrg      chorus*)
10049d87a3195Smrg        case $cc_basename in
10050d87a3195Smrg          *)
10051d87a3195Smrg	  # FIXME: insert proper C++ library support
10052d87a3195Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
10053d87a3195Smrg	  ;;
10054d87a3195Smrg        esac
10055d87a3195Smrg        ;;
1005639713583Smrg
10057d87a3195Smrg      cygwin* | mingw* | pw32* | cegcc*)
10058d87a3195Smrg	case $GXX,$cc_basename in
10059d87a3195Smrg	,cl* | no,cl* | ,icl* | no,icl*)
10060d87a3195Smrg	  # Native MSVC or ICC
10061d87a3195Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
10062d87a3195Smrg	  # no search path for DLLs.
10063d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
10064d87a3195Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10065d87a3195Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
10066d87a3195Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
10067d87a3195Smrg	  # Tell ltmain to make .lib files, not .a files.
10068d87a3195Smrg	  libext=lib
10069d87a3195Smrg	  # Tell ltmain to make .dll files, not .so files.
10070d87a3195Smrg	  shrext_cmds=.dll
10071d87a3195Smrg	  # FIXME: Setting linknames here is a bad hack.
10072d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
10073d87a3195Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10074d87a3195Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
10075d87a3195Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
10076d87a3195Smrg            else
10077d87a3195Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
10078d87a3195Smrg            fi~
10079d87a3195Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
10080d87a3195Smrg            linknames='
10081d87a3195Smrg	  # The linker will not automatically build a static lib if we build a DLL.
10082d87a3195Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
10083d87a3195Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10084d87a3195Smrg	  # Don't use ranlib
10085d87a3195Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
10086d87a3195Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
10087d87a3195Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
10088d87a3195Smrg            case $lt_outputfile in
10089d87a3195Smrg              *.exe|*.EXE) ;;
10090d87a3195Smrg              *)
10091d87a3195Smrg                lt_outputfile=$lt_outputfile.exe
10092d87a3195Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
10093d87a3195Smrg                ;;
10094d87a3195Smrg            esac~
10095d87a3195Smrg            func_to_tool_file "$lt_outputfile"~
10096d87a3195Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
10097d87a3195Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
10098d87a3195Smrg              $RM "$lt_outputfile.manifest";
10099d87a3195Smrg            fi'
10100d87a3195Smrg	  ;;
10101d87a3195Smrg	*)
10102d87a3195Smrg	  # g++
10103d87a3195Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
10104d87a3195Smrg	  # as there is no search path for DLLs.
10105d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10106d87a3195Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
10107d87a3195Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10108d87a3195Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
10109d87a3195Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10110eca46af7Smrg
10111d87a3195Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
10112d87a3195Smrg	    _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'
10113d87a3195Smrg	    # If the export-symbols file already is a .def file, use it as
10114d87a3195Smrg	    # is; otherwise, prepend EXPORTS...
10115d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10116d87a3195Smrg              cp $export_symbols $output_objdir/$soname.def;
10117d87a3195Smrg            else
10118d87a3195Smrg              echo EXPORTS > $output_objdir/$soname.def;
10119d87a3195Smrg              cat $export_symbols >> $output_objdir/$soname.def;
10120d87a3195Smrg            fi~
10121d87a3195Smrg            $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'
10122d87a3195Smrg	  else
10123d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10124d87a3195Smrg	  fi
10125d87a3195Smrg	  ;;
10126d87a3195Smrg	esac
10127d87a3195Smrg	;;
10128d87a3195Smrg      darwin* | rhapsody*)
10129d87a3195Smrg        _LT_DARWIN_LINKER_FEATURES($1)
10130d87a3195Smrg	;;
10131eca46af7Smrg
10132d87a3195Smrg      os2*)
10133d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10134d87a3195Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
10135d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10136d87a3195Smrg	shrext_cmds=.dll
10137d87a3195Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10138d87a3195Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10139d87a3195Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10140d87a3195Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10141d87a3195Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
10142d87a3195Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10143d87a3195Smrg	  emximp -o $lib $output_objdir/$libname.def'
10144d87a3195Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10145d87a3195Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10146d87a3195Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10147d87a3195Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10148d87a3195Smrg	  prefix_cmds="$SED"~
10149d87a3195Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
10150d87a3195Smrg	    prefix_cmds="$prefix_cmds -e 1d";
10151d87a3195Smrg	  fi~
10152d87a3195Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
10153d87a3195Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
10154d87a3195Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10155d87a3195Smrg	  emximp -o $lib $output_objdir/$libname.def'
10156d87a3195Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
10157d87a3195Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10158d87a3195Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
10159d87a3195Smrg	;;
101602378475aSmrg
10161d87a3195Smrg      dgux*)
10162d87a3195Smrg        case $cc_basename in
10163d87a3195Smrg          ec++*)
10164d87a3195Smrg	    # FIXME: insert proper C++ library support
10165d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10166d87a3195Smrg	    ;;
10167d87a3195Smrg          ghcx*)
10168d87a3195Smrg	    # Green Hills C++ Compiler
10169d87a3195Smrg	    # FIXME: insert proper C++ library support
10170d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10171d87a3195Smrg	    ;;
10172d87a3195Smrg          *)
10173d87a3195Smrg	    # FIXME: insert proper C++ library support
10174d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10175d87a3195Smrg	    ;;
10176d87a3195Smrg        esac
10177d87a3195Smrg        ;;
10178eca46af7Smrg
10179d87a3195Smrg      freebsd2.*)
10180d87a3195Smrg        # C++ shared libraries reported to be fairly broken before
10181d87a3195Smrg	# switch to ELF
10182d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10183d87a3195Smrg        ;;
10184eca46af7Smrg
10185d87a3195Smrg      freebsd-elf*)
10186d87a3195Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10187d87a3195Smrg        ;;
101882378475aSmrg
10189d87a3195Smrg      freebsd* | dragonfly* | midnightbsd*)
10190d87a3195Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
10191d87a3195Smrg        # conventions
10192d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
10193d87a3195Smrg        ;;
10194eca46af7Smrg
10195d87a3195Smrg      haiku*)
10196d87a3195Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10197d87a3195Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
10198d87a3195Smrg        ;;
10199eca46af7Smrg
10200d87a3195Smrg      hpux9*)
10201d87a3195Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10202d87a3195Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10203d87a3195Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10204d87a3195Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
10205d87a3195Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10206d87a3195Smrg				             # but as the default
10207d87a3195Smrg				             # location of the library.
10208eca46af7Smrg
10209d87a3195Smrg        case $cc_basename in
10210d87a3195Smrg          CC*)
10211d87a3195Smrg            # FIXME: insert proper C++ library support
10212d87a3195Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
10213d87a3195Smrg            ;;
10214d87a3195Smrg          aCC*)
10215d87a3195Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
10216d87a3195Smrg            # Commands to make compiler produce verbose output that lists
10217d87a3195Smrg            # what "hidden" libraries, object files and flags are used when
10218d87a3195Smrg            # linking a shared library.
10219d87a3195Smrg            #
10220d87a3195Smrg            # There doesn't appear to be a way to prevent this compiler from
10221d87a3195Smrg            # explicitly linking system object files so we need to strip them
10222d87a3195Smrg            # from the output so that they don't get included in the library
10223d87a3195Smrg            # dependencies.
10224d87a3195Smrg            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"'
10225d87a3195Smrg            ;;
10226d87a3195Smrg          *)
10227d87a3195Smrg            if test yes = "$GXX"; then
10228d87a3195Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
10229d87a3195Smrg            else
10230d87a3195Smrg              # FIXME: insert proper C++ library support
10231d87a3195Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
10232d87a3195Smrg            fi
10233d87a3195Smrg            ;;
10234d87a3195Smrg        esac
10235d87a3195Smrg        ;;
102362378475aSmrg
10237d87a3195Smrg      hpux10*|hpux11*)
10238d87a3195Smrg        if test no = "$with_gnu_ld"; then
10239d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10240d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10241eca46af7Smrg
10242d87a3195Smrg          case $host_cpu in
10243d87a3195Smrg            hppa*64*|ia64*)
10244d87a3195Smrg              ;;
10245d87a3195Smrg            *)
10246d87a3195Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10247d87a3195Smrg              ;;
10248d87a3195Smrg          esac
10249d87a3195Smrg        fi
10250d87a3195Smrg        case $host_cpu in
10251d87a3195Smrg          hppa*64*|ia64*)
10252d87a3195Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
10253d87a3195Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10254d87a3195Smrg            ;;
10255d87a3195Smrg          *)
10256d87a3195Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
10257d87a3195Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10258d87a3195Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10259d87a3195Smrg					         # but as the default
10260d87a3195Smrg					         # location of the library.
10261d87a3195Smrg            ;;
10262d87a3195Smrg        esac
10263eca46af7Smrg
10264d87a3195Smrg        case $cc_basename in
10265d87a3195Smrg          CC*)
10266d87a3195Smrg	    # FIXME: insert proper C++ library support
10267d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10268d87a3195Smrg	    ;;
10269d87a3195Smrg          aCC*)
10270d87a3195Smrg	    case $host_cpu in
10271d87a3195Smrg	      hppa*64*)
10272d87a3195Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10273d87a3195Smrg	        ;;
10274d87a3195Smrg	      ia64*)
10275d87a3195Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10276d87a3195Smrg	        ;;
10277d87a3195Smrg	      *)
10278d87a3195Smrg	        _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'
10279d87a3195Smrg	        ;;
10280d87a3195Smrg	    esac
10281d87a3195Smrg	    # Commands to make compiler produce verbose output that lists
10282d87a3195Smrg	    # what "hidden" libraries, object files and flags are used when
10283d87a3195Smrg	    # linking a shared library.
10284d87a3195Smrg	    #
10285d87a3195Smrg	    # There doesn't appear to be a way to prevent this compiler from
10286d87a3195Smrg	    # explicitly linking system object files so we need to strip them
10287d87a3195Smrg	    # from the output so that they don't get included in the library
10288d87a3195Smrg	    # dependencies.
10289d87a3195Smrg	    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"'
10290d87a3195Smrg	    ;;
10291d87a3195Smrg          *)
10292d87a3195Smrg	    if test yes = "$GXX"; then
10293d87a3195Smrg	      if test no = "$with_gnu_ld"; then
10294d87a3195Smrg	        case $host_cpu in
10295d87a3195Smrg	          hppa*64*)
10296d87a3195Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10297d87a3195Smrg	            ;;
10298d87a3195Smrg	          ia64*)
10299d87a3195Smrg	            _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'
10300d87a3195Smrg	            ;;
10301d87a3195Smrg	          *)
10302d87a3195Smrg	            _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'
10303d87a3195Smrg	            ;;
10304d87a3195Smrg	        esac
10305d87a3195Smrg	      fi
10306d87a3195Smrg	    else
10307d87a3195Smrg	      # FIXME: insert proper C++ library support
10308d87a3195Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
10309d87a3195Smrg	    fi
10310d87a3195Smrg	    ;;
10311d87a3195Smrg        esac
10312d87a3195Smrg        ;;
10313eca46af7Smrg
10314d87a3195Smrg      interix[[3-9]]*)
10315d87a3195Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
10316d87a3195Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10317d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10318d87a3195Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10319d87a3195Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
10320d87a3195Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
10321d87a3195Smrg	# default) and relocated if they conflict, which is a slow very memory
10322d87a3195Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
10323d87a3195Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
10324d87a3195Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
10325d87a3195Smrg	_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'
10326d87a3195Smrg	_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'
10327d87a3195Smrg	;;
10328d87a3195Smrg      irix5* | irix6*)
10329d87a3195Smrg        case $cc_basename in
10330d87a3195Smrg          CC*)
10331d87a3195Smrg	    # SGI C++
10332d87a3195Smrg	    _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'
10333eca46af7Smrg
10334d87a3195Smrg	    # Archives containing C++ object files must be created using
10335d87a3195Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
10336d87a3195Smrg	    # necessary to make sure instantiated templates are included
10337d87a3195Smrg	    # in the archive.
10338d87a3195Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
10339d87a3195Smrg	    ;;
10340d87a3195Smrg          *)
10341d87a3195Smrg	    if test yes = "$GXX"; then
10342d87a3195Smrg	      if test no = "$with_gnu_ld"; then
10343d87a3195Smrg	        _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'
10344d87a3195Smrg	      else
10345d87a3195Smrg	        _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'
10346d87a3195Smrg	      fi
10347d87a3195Smrg	    fi
10348d87a3195Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
10349d87a3195Smrg	    ;;
10350d87a3195Smrg        esac
10351d87a3195Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10352d87a3195Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10353d87a3195Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
10354d87a3195Smrg        ;;
1035595b296d0Smrg
10356d87a3195Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
10357d87a3195Smrg        case $cc_basename in
10358d87a3195Smrg          KCC*)
10359d87a3195Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
1036095b296d0Smrg
10361d87a3195Smrg	    # KCC will only create a shared library if the output file
10362d87a3195Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
10363d87a3195Smrg	    # to its proper name (with version) after linking.
10364d87a3195Smrg	    _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'
10365d87a3195Smrg	    _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'
10366d87a3195Smrg	    # Commands to make compiler produce verbose output that lists
10367d87a3195Smrg	    # what "hidden" libraries, object files and flags are used when
10368d87a3195Smrg	    # linking a shared library.
10369d87a3195Smrg	    #
10370d87a3195Smrg	    # There doesn't appear to be a way to prevent this compiler from
10371d87a3195Smrg	    # explicitly linking system object files so we need to strip them
10372d87a3195Smrg	    # from the output so that they don't get included in the library
10373d87a3195Smrg	    # dependencies.
10374d87a3195Smrg	    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"'
10375eca46af7Smrg
10376d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10377d87a3195Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
1037895b296d0Smrg
10379d87a3195Smrg	    # Archives containing C++ object files must be created using
10380d87a3195Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
10381d87a3195Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
10382d87a3195Smrg	    ;;
10383d87a3195Smrg	  icpc* | ecpc* )
10384d87a3195Smrg	    # Intel C++
10385d87a3195Smrg	    with_gnu_ld=yes
10386d87a3195Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
10387d87a3195Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
10388d87a3195Smrg	    # earlier do not add the objects themselves.
10389d87a3195Smrg	    case `$CC -V 2>&1` in
10390d87a3195Smrg	      *"Version 7."*)
10391d87a3195Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10392d87a3195Smrg		_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'
10393d87a3195Smrg		;;
10394d87a3195Smrg	      *)  # Version 8.0 or newer
10395d87a3195Smrg	        tmp_idyn=
10396d87a3195Smrg	        case $host_cpu in
10397d87a3195Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
10398d87a3195Smrg		esac
10399d87a3195Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10400d87a3195Smrg		_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'
10401d87a3195Smrg		;;
10402d87a3195Smrg	    esac
10403d87a3195Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10404d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10405d87a3195Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10406d87a3195Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
10407d87a3195Smrg	    ;;
10408d87a3195Smrg          pgCC* | pgcpp*)
10409d87a3195Smrg            # Portland Group C++ compiler
10410d87a3195Smrg	    case `$CC -V` in
10411d87a3195Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
10412d87a3195Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
10413d87a3195Smrg               rm -rf $tpldir~
10414d87a3195Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
10415d87a3195Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
10416d87a3195Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
10417d87a3195Smrg                rm -rf $tpldir~
10418d87a3195Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
10419d87a3195Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
10420d87a3195Smrg                $RANLIB $oldlib'
10421d87a3195Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
10422d87a3195Smrg                rm -rf $tpldir~
10423d87a3195Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
10424d87a3195Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10425d87a3195Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
10426d87a3195Smrg                rm -rf $tpldir~
10427d87a3195Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
10428d87a3195Smrg                $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'
10429d87a3195Smrg	      ;;
10430d87a3195Smrg	    *) # Version 6 and above use weak symbols
10431d87a3195Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10432d87a3195Smrg	      _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'
10433d87a3195Smrg	      ;;
10434d87a3195Smrg	    esac
10435eca46af7Smrg
10436d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
10437d87a3195Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10438d87a3195Smrg	    _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'
10439d87a3195Smrg            ;;
10440d87a3195Smrg	  cxx*)
10441d87a3195Smrg	    # Compaq C++
10442d87a3195Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10443d87a3195Smrg	    _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'
1044495b296d0Smrg
10445d87a3195Smrg	    runpath_var=LD_RUN_PATH
10446d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10447d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10448eca46af7Smrg
10449d87a3195Smrg	    # Commands to make compiler produce verbose output that lists
10450d87a3195Smrg	    # what "hidden" libraries, object files and flags are used when
10451d87a3195Smrg	    # linking a shared library.
10452d87a3195Smrg	    #
10453d87a3195Smrg	    # There doesn't appear to be a way to prevent this compiler from
10454d87a3195Smrg	    # explicitly linking system object files so we need to strip them
10455d87a3195Smrg	    # from the output so that they don't get included in the library
10456d87a3195Smrg	    # dependencies.
10457d87a3195Smrg	    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'
10458d87a3195Smrg	    ;;
10459d87a3195Smrg	  xl* | mpixl* | bgxl*)
10460d87a3195Smrg	    # IBM XL 8.0 on PPC, with GNU ld
10461d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10462d87a3195Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10463d87a3195Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10464d87a3195Smrg	    if test yes = "$supports_anon_versioning"; then
10465d87a3195Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
10466d87a3195Smrg                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
10467d87a3195Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
10468d87a3195Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
10469d87a3195Smrg	    fi
10470d87a3195Smrg	    ;;
10471d87a3195Smrg	  *)
10472d87a3195Smrg	    case `$CC -V 2>&1 | $SED 5q` in
10473d87a3195Smrg	    *Sun\ C*)
10474d87a3195Smrg	      # Sun C++ 5.9
10475d87a3195Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10476d87a3195Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10477d87a3195Smrg	      _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'
10478d87a3195Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10479d87a3195Smrg	      _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'
10480d87a3195Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
10481eca46af7Smrg
10482d87a3195Smrg	      # Not sure whether something based on
10483d87a3195Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
10484d87a3195Smrg	      # would be better.
10485d87a3195Smrg	      output_verbose_link_cmd='func_echo_all'
10486eca46af7Smrg
10487d87a3195Smrg	      # Archives containing C++ object files must be created using
10488d87a3195Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
10489d87a3195Smrg	      # necessary to make sure instantiated templates are included
10490d87a3195Smrg	      # in the archive.
10491d87a3195Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10492d87a3195Smrg	      ;;
10493d87a3195Smrg	    esac
10494d87a3195Smrg	    ;;
10495d87a3195Smrg	esac
10496d87a3195Smrg	;;
10497eca46af7Smrg
10498d87a3195Smrg      lynxos*)
10499d87a3195Smrg        # FIXME: insert proper C++ library support
10500d87a3195Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
10501d87a3195Smrg	;;
1050295b296d0Smrg
10503d87a3195Smrg      m88k*)
10504d87a3195Smrg        # FIXME: insert proper C++ library support
10505d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10506d87a3195Smrg	;;
1050795b296d0Smrg
10508d87a3195Smrg      mvs*)
10509d87a3195Smrg        case $cc_basename in
10510d87a3195Smrg          cxx*)
10511d87a3195Smrg	    # FIXME: insert proper C++ library support
10512d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10513d87a3195Smrg	    ;;
10514d87a3195Smrg	  *)
10515d87a3195Smrg	    # FIXME: insert proper C++ library support
10516d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10517d87a3195Smrg	    ;;
10518d87a3195Smrg	esac
10519d87a3195Smrg	;;
1052095b296d0Smrg
10521d87a3195Smrg      netbsd*)
10522d87a3195Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10523d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
10524d87a3195Smrg	  wlarc=
10525d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10526d87a3195Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
10527d87a3195Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10528d87a3195Smrg	fi
10529d87a3195Smrg	# Workaround some broken pre-1.5 toolchains
10530d87a3195Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
10531d87a3195Smrg	;;
10532eca46af7Smrg
10533d87a3195Smrg      *nto* | *qnx*)
10534d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
10535d87a3195Smrg	;;
1053695b296d0Smrg
10537d87a3195Smrg      openbsd* | bitrig*)
10538d87a3195Smrg	if test -f /usr/libexec/ld.so; then
10539d87a3195Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
10540d87a3195Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10541d87a3195Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10542d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
10543d87a3195Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10544d87a3195Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
10545d87a3195Smrg	    _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'
10546d87a3195Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10547d87a3195Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
10548d87a3195Smrg	  fi
10549d87a3195Smrg	  output_verbose_link_cmd=func_echo_all
10550d87a3195Smrg	else
10551d87a3195Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
10552d87a3195Smrg	fi
10553d87a3195Smrg	;;
1055495b296d0Smrg
10555d87a3195Smrg      osf3* | osf4* | osf5*)
10556d87a3195Smrg        case $cc_basename in
10557d87a3195Smrg          KCC*)
10558d87a3195Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
1055995b296d0Smrg
10560d87a3195Smrg	    # KCC will only create a shared library if the output file
10561d87a3195Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
10562d87a3195Smrg	    # to its proper name (with version) after linking.
10563d87a3195Smrg	    _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'
1056495b296d0Smrg
10565d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10566d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10567d87a3195Smrg
10568d87a3195Smrg	    # Archives containing C++ object files must be created using
10569d87a3195Smrg	    # the KAI C++ compiler.
10570d87a3195Smrg	    case $host in
10571d87a3195Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
10572d87a3195Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
10573d87a3195Smrg	    esac
10574d87a3195Smrg	    ;;
10575d87a3195Smrg          RCC*)
10576d87a3195Smrg	    # Rational C++ 2.4.1
10577d87a3195Smrg	    # FIXME: insert proper C++ library support
10578d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10579d87a3195Smrg	    ;;
10580d87a3195Smrg          cxx*)
10581d87a3195Smrg	    case $host in
10582d87a3195Smrg	      osf3*)
10583d87a3195Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10584d87a3195Smrg	        _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'
10585d87a3195Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10586d87a3195Smrg		;;
10587d87a3195Smrg	      *)
10588d87a3195Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10589d87a3195Smrg	        _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'
10590d87a3195Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
10591d87a3195Smrg                  echo "-hidden">> $lib.exp~
10592d87a3195Smrg                  $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~
10593d87a3195Smrg                  $RM $lib.exp'
10594d87a3195Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10595d87a3195Smrg		;;
10596d87a3195Smrg	    esac
10597d87a3195Smrg
10598d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10599d87a3195Smrg
10600d87a3195Smrg	    # Commands to make compiler produce verbose output that lists
10601d87a3195Smrg	    # what "hidden" libraries, object files and flags are used when
10602d87a3195Smrg	    # linking a shared library.
10603d87a3195Smrg	    #
10604d87a3195Smrg	    # There doesn't appear to be a way to prevent this compiler from
10605d87a3195Smrg	    # explicitly linking system object files so we need to strip them
10606d87a3195Smrg	    # from the output so that they don't get included in the library
10607d87a3195Smrg	    # dependencies.
10608d87a3195Smrg	    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"'
10609d87a3195Smrg	    ;;
10610d87a3195Smrg	  *)
10611d87a3195Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
10612d87a3195Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10613d87a3195Smrg	      case $host in
10614d87a3195Smrg	        osf3*)
10615d87a3195Smrg	          _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'
10616d87a3195Smrg		  ;;
10617d87a3195Smrg	        *)
10618d87a3195Smrg	          _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'
10619d87a3195Smrg		  ;;
10620d87a3195Smrg	      esac
1062195b296d0Smrg
10622d87a3195Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10623d87a3195Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
1062495b296d0Smrg
10625d87a3195Smrg	      # Commands to make compiler produce verbose output that lists
10626d87a3195Smrg	      # what "hidden" libraries, object files and flags are used when
10627d87a3195Smrg	      # linking a shared library.
10628d87a3195Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10629e6f085baSmrg
10630d87a3195Smrg	    else
10631d87a3195Smrg	      # FIXME: insert proper C++ library support
10632d87a3195Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
10633d87a3195Smrg	    fi
10634d87a3195Smrg	    ;;
10635d87a3195Smrg        esac
10636d87a3195Smrg        ;;
1063714330f12Smrg
10638d87a3195Smrg      psos*)
10639d87a3195Smrg        # FIXME: insert proper C++ library support
10640d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10641d87a3195Smrg        ;;
1064295b296d0Smrg
10643d87a3195Smrg      sunos4*)
10644d87a3195Smrg        case $cc_basename in
10645d87a3195Smrg          CC*)
10646d87a3195Smrg	    # Sun C++ 4.x
10647d87a3195Smrg	    # FIXME: insert proper C++ library support
10648d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10649d87a3195Smrg	    ;;
10650d87a3195Smrg          lcc*)
10651d87a3195Smrg	    # Lucid
10652d87a3195Smrg	    # FIXME: insert proper C++ library support
10653d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10654d87a3195Smrg	    ;;
10655d87a3195Smrg          *)
10656d87a3195Smrg	    # FIXME: insert proper C++ library support
10657d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10658d87a3195Smrg	    ;;
10659d87a3195Smrg        esac
10660d87a3195Smrg        ;;
1066195b296d0Smrg
10662d87a3195Smrg      solaris*)
10663d87a3195Smrg        case $cc_basename in
10664d87a3195Smrg          CC* | sunCC*)
10665d87a3195Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
10666d87a3195Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
10667d87a3195Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10668d87a3195Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10669d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10670d87a3195Smrg              $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'
1067114330f12Smrg
10672d87a3195Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10673d87a3195Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10674d87a3195Smrg	    case $host_os in
10675d87a3195Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10676d87a3195Smrg	      *)
10677d87a3195Smrg		# The compiler driver will combine and reorder linker options,
10678d87a3195Smrg		# but understands '-z linker_flag'.
10679d87a3195Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
10680d87a3195Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
10681d87a3195Smrg	        ;;
10682d87a3195Smrg	    esac
10683d87a3195Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
1068495b296d0Smrg
10685d87a3195Smrg	    output_verbose_link_cmd='func_echo_all'
1068614330f12Smrg
10687d87a3195Smrg	    # Archives containing C++ object files must be created using
10688d87a3195Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
10689d87a3195Smrg	    # necessary to make sure instantiated templates are included
10690d87a3195Smrg	    # in the archive.
10691d87a3195Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10692d87a3195Smrg	    ;;
10693d87a3195Smrg          gcx*)
10694d87a3195Smrg	    # Green Hills C++ Compiler
10695d87a3195Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
1069614330f12Smrg
10697d87a3195Smrg	    # The C++ compiler must be used to create the archive.
10698d87a3195Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
10699d87a3195Smrg	    ;;
10700d87a3195Smrg          *)
10701d87a3195Smrg	    # GNU C++ compiler with Solaris linker
10702d87a3195Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
10703d87a3195Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
10704d87a3195Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
10705d87a3195Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10706d87a3195Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10707d87a3195Smrg                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
1070814330f12Smrg
10709d87a3195Smrg	        # Commands to make compiler produce verbose output that lists
10710d87a3195Smrg	        # what "hidden" libraries, object files and flags are used when
10711d87a3195Smrg	        # linking a shared library.
10712d87a3195Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10713d87a3195Smrg	      else
10714d87a3195Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
10715d87a3195Smrg	        # platform.
10716d87a3195Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10717d87a3195Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10718d87a3195Smrg                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
1071914330f12Smrg
10720d87a3195Smrg	        # Commands to make compiler produce verbose output that lists
10721d87a3195Smrg	        # what "hidden" libraries, object files and flags are used when
10722d87a3195Smrg	        # linking a shared library.
10723d87a3195Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10724d87a3195Smrg	      fi
1072514330f12Smrg
10726d87a3195Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
10727d87a3195Smrg	      case $host_os in
10728d87a3195Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10729d87a3195Smrg		*)
10730d87a3195Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
10731d87a3195Smrg		  ;;
10732d87a3195Smrg	      esac
10733d87a3195Smrg	    fi
10734d87a3195Smrg	    ;;
10735d87a3195Smrg        esac
10736d87a3195Smrg        ;;
1073714330f12Smrg
10738d87a3195Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
10739d87a3195Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10740d87a3195Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10741d87a3195Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10742d87a3195Smrg      runpath_var='LD_RUN_PATH'
1074314330f12Smrg
10744d87a3195Smrg      case $cc_basename in
10745d87a3195Smrg        CC*)
10746d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10747d87a3195Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10748d87a3195Smrg	  ;;
10749d87a3195Smrg	*)
10750d87a3195Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10751d87a3195Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10752d87a3195Smrg	  ;;
10753d87a3195Smrg      esac
10754d87a3195Smrg      ;;
1075589b0dc75Smrg
10756d87a3195Smrg      sysv5* | sco3.2v5* | sco5v6*)
10757d87a3195Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
10758d87a3195Smrg	# link with -lc, and that would cause any symbols used from libc to
10759d87a3195Smrg	# always be unresolved, which means just about no library would
10760d87a3195Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
10761d87a3195Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
10762d87a3195Smrg	# as -z defs.
10763d87a3195Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10764d87a3195Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
10765d87a3195Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
10766d87a3195Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10767d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
10768d87a3195Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10769d87a3195Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
10770d87a3195Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
10771d87a3195Smrg	runpath_var='LD_RUN_PATH'
10772d87a3195Smrg
10773d87a3195Smrg	case $cc_basename in
10774d87a3195Smrg          CC*)
10775d87a3195Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10776d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10777d87a3195Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
10778d87a3195Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
10779d87a3195Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
10780d87a3195Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
10781d87a3195Smrg	    ;;
10782d87a3195Smrg	  *)
10783d87a3195Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10784d87a3195Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10785d87a3195Smrg	    ;;
10786d87a3195Smrg	esac
10787d87a3195Smrg      ;;
10788d87a3195Smrg
10789d87a3195Smrg      tandem*)
10790d87a3195Smrg        case $cc_basename in
10791d87a3195Smrg          NCC*)
10792d87a3195Smrg	    # NonStop-UX NCC 3.20
10793d87a3195Smrg	    # FIXME: insert proper C++ library support
10794d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10795d87a3195Smrg	    ;;
10796d87a3195Smrg          *)
10797d87a3195Smrg	    # FIXME: insert proper C++ library support
10798d87a3195Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10799d87a3195Smrg	    ;;
10800d87a3195Smrg        esac
10801d87a3195Smrg        ;;
1080289b0dc75Smrg
10803d87a3195Smrg      vxworks*)
10804d87a3195Smrg        # FIXME: insert proper C++ library support
10805d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10806d87a3195Smrg        ;;
10807eca46af7Smrg
10808d87a3195Smrg      *)
10809d87a3195Smrg        # FIXME: insert proper C++ library support
10810d87a3195Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10811d87a3195Smrg        ;;
10812d87a3195Smrg    esac
10813eca46af7Smrg
10814d87a3195Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
10815d87a3195Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
10816eca46af7Smrg
10817d87a3195Smrg    _LT_TAGVAR(GCC, $1)=$GXX
10818d87a3195Smrg    _LT_TAGVAR(LD, $1)=$LD
10819eca46af7Smrg
10820d87a3195Smrg    ## CAVEAT EMPTOR:
10821d87a3195Smrg    ## There is no encapsulation within the following macros, do not change
10822d87a3195Smrg    ## the running order or otherwise move them around unless you know exactly
10823d87a3195Smrg    ## what you are doing...
10824d87a3195Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
10825d87a3195Smrg    _LT_COMPILER_PIC($1)
10826d87a3195Smrg    _LT_COMPILER_C_O($1)
10827d87a3195Smrg    _LT_COMPILER_FILE_LOCKS($1)
10828d87a3195Smrg    _LT_LINKER_SHLIBS($1)
10829d87a3195Smrg    _LT_SYS_DYNAMIC_LINKER($1)
10830d87a3195Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
10831eca46af7Smrg
10832d87a3195Smrg    _LT_CONFIG($1)
10833d87a3195Smrg  fi # test -n "$compiler"
1083414330f12Smrg
10835d87a3195Smrg  CC=$lt_save_CC
10836d87a3195Smrg  CFLAGS=$lt_save_CFLAGS
10837d87a3195Smrg  LDCXX=$LD
10838d87a3195Smrg  LD=$lt_save_LD
10839d87a3195Smrg  GCC=$lt_save_GCC
10840d87a3195Smrg  with_gnu_ld=$lt_save_with_gnu_ld
10841d87a3195Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
10842d87a3195Smrg  lt_cv_path_LD=$lt_save_path_LD
10843d87a3195Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
10844d87a3195Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
10845d87a3195Smrgfi # test yes != "$_lt_caught_CXX_error"
1084614330f12Smrg
10847d87a3195SmrgAC_LANG_POP
10848d87a3195Smrg])# _LT_LANG_CXX_CONFIG
10849d87a3195Smrg
10850d87a3195Smrg
10851d87a3195Smrg# _LT_FUNC_STRIPNAME_CNF
10852d87a3195Smrg# ----------------------
10853d87a3195Smrg# func_stripname_cnf prefix suffix name
10854d87a3195Smrg# strip PREFIX and SUFFIX off of NAME.
10855d87a3195Smrg# PREFIX and SUFFIX must not contain globbing or regex special
10856d87a3195Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
10857d87a3195Smrg# dot (in which case that matches only a dot).
1085814330f12Smrg#
10859d87a3195Smrg# This function is identical to the (non-XSI) version of func_stripname,
10860d87a3195Smrg# except this one can be used by m4 code that may be executed by configure,
10861d87a3195Smrg# rather than the libtool script.
10862d87a3195Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
10863d87a3195SmrgAC_REQUIRE([_LT_DECL_SED])
10864d87a3195SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
10865d87a3195Smrgfunc_stripname_cnf ()
10866d87a3195Smrg{
10867d87a3195Smrg  case @S|@2 in
10868d87a3195Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
10869d87a3195Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
10870d87a3195Smrg  esac
10871d87a3195Smrg} # func_stripname_cnf
10872d87a3195Smrg])# _LT_FUNC_STRIPNAME_CNF
1087314330f12Smrg
10874eca46af7Smrg
10875d87a3195Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
10876d87a3195Smrg# ---------------------------------
10877d87a3195Smrg# Figure out "hidden" library dependencies from verbose
10878d87a3195Smrg# compiler output when linking a shared library.
10879d87a3195Smrg# Parse the compiler output and extract the necessary
10880d87a3195Smrg# objects, libraries and library flags.
10881d87a3195Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
10882d87a3195Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
10883d87a3195SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
10884d87a3195Smrg# Dependencies to place before and after the object being linked:
10885d87a3195Smrg_LT_TAGVAR(predep_objects, $1)=
10886d87a3195Smrg_LT_TAGVAR(postdep_objects, $1)=
10887d87a3195Smrg_LT_TAGVAR(predeps, $1)=
10888d87a3195Smrg_LT_TAGVAR(postdeps, $1)=
10889d87a3195Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
10890eca46af7Smrg
10891d87a3195Smrgdnl we can't use the lt_simple_compile_test_code here,
10892d87a3195Smrgdnl because it contains code intended for an executable,
10893d87a3195Smrgdnl not a library.  It's possible we should let each
10894d87a3195Smrgdnl tag define a new lt_????_link_test_code variable,
10895d87a3195Smrgdnl but it's only used here...
10896d87a3195Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
10897d87a3195Smrgint a;
10898d87a3195Smrgvoid foo (void) { a = 0; }
10899d87a3195Smrg_LT_EOF
10900d87a3195Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
10901d87a3195Smrgclass Foo
10902d87a3195Smrg{
10903d87a3195Smrgpublic:
10904d87a3195Smrg  Foo (void) { a = 0; }
10905d87a3195Smrgprivate:
10906d87a3195Smrg  int a;
10907d87a3195Smrg};
10908d87a3195Smrg_LT_EOF
10909d87a3195Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
10910d87a3195Smrg      subroutine foo
10911d87a3195Smrg      implicit none
10912d87a3195Smrg      integer*4 a
10913d87a3195Smrg      a=0
10914d87a3195Smrg      return
10915d87a3195Smrg      end
10916d87a3195Smrg_LT_EOF
10917d87a3195Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
10918d87a3195Smrg      subroutine foo
10919d87a3195Smrg      implicit none
10920d87a3195Smrg      integer a
10921d87a3195Smrg      a=0
10922d87a3195Smrg      return
10923d87a3195Smrg      end
10924d87a3195Smrg_LT_EOF
10925d87a3195Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
10926d87a3195Smrgpublic class foo {
10927d87a3195Smrg  private int a;
10928d87a3195Smrg  public void bar (void) {
10929d87a3195Smrg    a = 0;
10930d87a3195Smrg  }
10931d87a3195Smrg};
10932d87a3195Smrg_LT_EOF
10933d87a3195Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
10934d87a3195Smrgpackage foo
10935d87a3195Smrgfunc foo() {
10936d87a3195Smrg}
10937d87a3195Smrg_LT_EOF
10938d87a3195Smrg])
1093995b296d0Smrg
10940d87a3195Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
10941d87a3195Smrgcase "$CC $CFLAGS " in #(
10942d87a3195Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
10943d87a3195Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
10944d87a3195Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
10945d87a3195Smrgesac
1094614330f12Smrg
10947d87a3195Smrgdnl Parse the compiler output and extract the necessary
10948d87a3195Smrgdnl objects, libraries and library flags.
10949d87a3195Smrgif AC_TRY_EVAL(ac_compile); then
10950d87a3195Smrg  # Parse the compiler output and extract the necessary
10951d87a3195Smrg  # objects, libraries and library flags.
10952eca46af7Smrg
10953d87a3195Smrg  # Sentinel used to keep track of whether or not we are before
10954d87a3195Smrg  # the conftest object file.
10955d87a3195Smrg  pre_test_object_deps_done=no
10956d87a3195Smrg
10957d87a3195Smrg  for p in `eval "$output_verbose_link_cmd"`; do
10958d87a3195Smrg    case $prev$p in
10959d87a3195Smrg
10960d87a3195Smrg    -L* | -R* | -l*)
10961d87a3195Smrg       # Some compilers place space between "-{L,R}" and the path.
10962d87a3195Smrg       # Remove the space.
10963d87a3195Smrg       if test x-L = "$p" ||
10964d87a3195Smrg          test x-R = "$p"; then
10965d87a3195Smrg	 prev=$p
10966d87a3195Smrg	 continue
10967d87a3195Smrg       fi
10968d87a3195Smrg
10969d87a3195Smrg       # Expand the sysroot to ease extracting the directories later.
10970d87a3195Smrg       if test -z "$prev"; then
10971d87a3195Smrg         case $p in
10972d87a3195Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
10973d87a3195Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
10974d87a3195Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
10975d87a3195Smrg         esac
10976d87a3195Smrg       fi
10977d87a3195Smrg       case $p in
10978d87a3195Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
10979d87a3195Smrg       esac
10980d87a3195Smrg       if test no = "$pre_test_object_deps_done"; then
10981d87a3195Smrg	 case $prev in
10982d87a3195Smrg	 -L | -R)
10983d87a3195Smrg	   # Internal compiler library paths should come after those
10984d87a3195Smrg	   # provided the user.  The postdeps already come after the
10985d87a3195Smrg	   # user supplied libs so there is no need to process them.
10986d87a3195Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
10987d87a3195Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
10988d87a3195Smrg	   else
10989d87a3195Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
10990d87a3195Smrg	   fi
10991d87a3195Smrg	   ;;
10992d87a3195Smrg	 # The "-l" case would never come before the object being
10993d87a3195Smrg	 # linked, so don't bother handling this case.
10994d87a3195Smrg	 esac
10995d87a3195Smrg       else
10996d87a3195Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
10997d87a3195Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
10998d87a3195Smrg	 else
10999d87a3195Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
11000d87a3195Smrg	 fi
11001d87a3195Smrg       fi
11002d87a3195Smrg       prev=
11003d87a3195Smrg       ;;
11004d87a3195Smrg
11005d87a3195Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
11006d87a3195Smrg    *.$objext)
11007d87a3195Smrg       # This assumes that the test object file only shows up
11008d87a3195Smrg       # once in the compiler output.
11009d87a3195Smrg       if test "$p" = "conftest.$objext"; then
11010d87a3195Smrg	 pre_test_object_deps_done=yes
11011d87a3195Smrg	 continue
11012d87a3195Smrg       fi
11013d87a3195Smrg
11014d87a3195Smrg       if test no = "$pre_test_object_deps_done"; then
11015d87a3195Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
11016d87a3195Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
11017d87a3195Smrg	 else
11018d87a3195Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
11019d87a3195Smrg	 fi
11020d87a3195Smrg       else
11021d87a3195Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
11022d87a3195Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
11023d87a3195Smrg	 else
11024d87a3195Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
11025d87a3195Smrg	 fi
11026d87a3195Smrg       fi
11027d87a3195Smrg       ;;
1102895b296d0Smrg
11029d87a3195Smrg    *) ;; # Ignore the rest.
11030d87a3195Smrg
11031d87a3195Smrg    esac
11032d87a3195Smrg  done
11033d87a3195Smrg
11034d87a3195Smrg  # Clean up.
11035d87a3195Smrg  rm -f a.out a.exe
11036eca46af7Smrgelse
11037d87a3195Smrg  echo "libtool.m4: error: problem compiling $1 test program"
11038eca46af7Smrgfi
11039eca46af7Smrg
11040d87a3195Smrg$RM -f confest.$objext
11041d87a3195SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
1104295b296d0Smrg
11043d87a3195Smrg# PORTME: override above test on systems where it is broken
11044d87a3195Smrgm4_if([$1], [CXX],
11045d87a3195Smrg[case $host_os in
11046d87a3195Smrginterix[[3-9]]*)
11047d87a3195Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
11048d87a3195Smrg  # hack all around it, let's just trust "g++" to DTRT.
11049d87a3195Smrg  _LT_TAGVAR(predep_objects,$1)=
11050d87a3195Smrg  _LT_TAGVAR(postdep_objects,$1)=
11051d87a3195Smrg  _LT_TAGVAR(postdeps,$1)=
11052d87a3195Smrg  ;;
11053d87a3195Smrgesac
11054d87a3195Smrg])
1105595b296d0Smrg
11056d87a3195Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
11057d87a3195Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
11058eca46af7Smrgesac
11059d87a3195Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
11060d87a3195Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
11061d87a3195Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
11062d87a3195Smrgfi
11063d87a3195Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
11064d87a3195Smrg    [The directories searched by this compiler when creating a shared library])
11065d87a3195Smrg_LT_TAGDECL([], [predep_objects], [1],
11066d87a3195Smrg    [Dependencies to place before and after the objects being linked to
11067d87a3195Smrg    create a shared library])
11068d87a3195Smrg_LT_TAGDECL([], [postdep_objects], [1])
11069d87a3195Smrg_LT_TAGDECL([], [predeps], [1])
11070d87a3195Smrg_LT_TAGDECL([], [postdeps], [1])
11071d87a3195Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
11072d87a3195Smrg    [The library search path used internally by the compiler when linking
11073d87a3195Smrg    a shared library])
11074d87a3195Smrg])# _LT_SYS_HIDDEN_LIBDEPS
1107595b296d0Smrg
11076d87a3195Smrg
11077d87a3195Smrg# _LT_LANG_F77_CONFIG([TAG])
11078d87a3195Smrg# --------------------------
11079d87a3195Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
11080d87a3195Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
11081d87a3195Smrg# to write the compiler configuration to 'libtool'.
11082d87a3195Smrgm4_defun([_LT_LANG_F77_CONFIG],
11083d87a3195Smrg[AC_LANG_PUSH(Fortran 77)
11084d87a3195Smrgif test -z "$F77" || test no = "$F77"; then
11085d87a3195Smrg  _lt_disable_F77=yes
1108695b296d0Smrgfi
1108795b296d0Smrg
11088d87a3195Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11089d87a3195Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
11090d87a3195Smrg_LT_TAGVAR(always_export_symbols, $1)=no
11091d87a3195Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
11092d87a3195Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11093d87a3195Smrg_LT_TAGVAR(hardcode_direct, $1)=no
11094d87a3195Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11095d87a3195Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11096d87a3195Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
11097d87a3195Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
11098d87a3195Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
11099d87a3195Smrg_LT_TAGVAR(inherit_rpath, $1)=no
11100d87a3195Smrg_LT_TAGVAR(module_cmds, $1)=
11101d87a3195Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
11102d87a3195Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
11103d87a3195Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11104d87a3195Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11105d87a3195Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11106d87a3195Smrg_LT_TAGVAR(no_undefined_flag, $1)=
11107d87a3195Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
11108d87a3195Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
1110995b296d0Smrg
11110d87a3195Smrg# Source file extension for f77 test sources.
11111d87a3195Smrgac_ext=f
1111295b296d0Smrg
11113d87a3195Smrg# Object file extension for compiled f77 test sources.
11114d87a3195Smrgobjext=o
11115d87a3195Smrg_LT_TAGVAR(objext, $1)=$objext
11116eca46af7Smrg
11117d87a3195Smrg# No sense in running all these tests if we already determined that
11118d87a3195Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
11119d87a3195Smrg# are currently assumed to apply to all compilers on this platform,
11120d87a3195Smrg# and will be corrupted by setting them based on a non-working compiler.
11121d87a3195Smrgif test yes != "$_lt_disable_F77"; then
11122d87a3195Smrg  # Code to be used in simple compile tests
11123d87a3195Smrg  lt_simple_compile_test_code="\
11124d87a3195Smrg      subroutine t
11125d87a3195Smrg      return
11126d87a3195Smrg      end
11127d87a3195Smrg"
11128d87a3195Smrg
11129d87a3195Smrg  # Code to be used in simple link tests
11130d87a3195Smrg  lt_simple_link_test_code="\
11131d87a3195Smrg      program t
11132d87a3195Smrg      end
11133d87a3195Smrg"
11134d87a3195Smrg
11135d87a3195Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11136d87a3195Smrg  _LT_TAG_COMPILER
11137d87a3195Smrg
11138d87a3195Smrg  # save warnings/boilerplate of simple test code
11139d87a3195Smrg  _LT_COMPILER_BOILERPLATE
11140d87a3195Smrg  _LT_LINKER_BOILERPLATE
11141d87a3195Smrg
11142d87a3195Smrg  # Allow CC to be a program name with arguments.
11143d87a3195Smrg  lt_save_CC=$CC
11144d87a3195Smrg  lt_save_GCC=$GCC
11145d87a3195Smrg  lt_save_CFLAGS=$CFLAGS
11146d87a3195Smrg  CC=${F77-"f77"}
11147d87a3195Smrg  CFLAGS=$FFLAGS
11148d87a3195Smrg  compiler=$CC
11149d87a3195Smrg  _LT_TAGVAR(compiler, $1)=$CC
11150d87a3195Smrg  _LT_CC_BASENAME([$compiler])
11151d87a3195Smrg  GCC=$G77
11152d87a3195Smrg  if test -n "$compiler"; then
11153d87a3195Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
11154d87a3195Smrg    AC_MSG_RESULT([$can_build_shared])
1115595b296d0Smrg
11156d87a3195Smrg    AC_MSG_CHECKING([whether to build shared libraries])
11157d87a3195Smrg    test no = "$can_build_shared" && enable_shared=no
1115895b296d0Smrg
11159d87a3195Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
11160d87a3195Smrg    # are all built from PIC.
11161d87a3195Smrg    case $host_os in
11162d87a3195Smrg      aix3*)
11163d87a3195Smrg        test yes = "$enable_shared" && enable_static=no
11164d87a3195Smrg        if test -n "$RANLIB"; then
11165d87a3195Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11166d87a3195Smrg          postinstall_cmds='$RANLIB $lib'
11167d87a3195Smrg        fi
11168d87a3195Smrg        ;;
11169d87a3195Smrg      aix[[4-9]]*)
11170d87a3195Smrg	if test ia64 != "$host_cpu"; then
11171d87a3195Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11172d87a3195Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
11173d87a3195Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11174d87a3195Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11175d87a3195Smrg	  esac
11176d87a3195Smrg	fi
11177d87a3195Smrg        ;;
11178d87a3195Smrg    esac
11179d87a3195Smrg    AC_MSG_RESULT([$enable_shared])
11180eca46af7Smrg
11181d87a3195Smrg    AC_MSG_CHECKING([whether to build static libraries])
11182d87a3195Smrg    # Make sure either enable_shared or enable_static is yes.
11183d87a3195Smrg    test yes = "$enable_shared" || enable_static=yes
11184d87a3195Smrg    AC_MSG_RESULT([$enable_static])
11185e6f085baSmrg
11186d87a3195Smrg    _LT_TAGVAR(GCC, $1)=$G77
11187d87a3195Smrg    _LT_TAGVAR(LD, $1)=$LD
11188eca46af7Smrg
11189d87a3195Smrg    ## CAVEAT EMPTOR:
11190d87a3195Smrg    ## There is no encapsulation within the following macros, do not change
11191d87a3195Smrg    ## the running order or otherwise move them around unless you know exactly
11192d87a3195Smrg    ## what you are doing...
11193d87a3195Smrg    _LT_COMPILER_PIC($1)
11194d87a3195Smrg    _LT_COMPILER_C_O($1)
11195d87a3195Smrg    _LT_COMPILER_FILE_LOCKS($1)
11196d87a3195Smrg    _LT_LINKER_SHLIBS($1)
11197d87a3195Smrg    _LT_SYS_DYNAMIC_LINKER($1)
11198d87a3195Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
1119995b296d0Smrg
11200d87a3195Smrg    _LT_CONFIG($1)
11201d87a3195Smrg  fi # test -n "$compiler"
11202eca46af7Smrg
11203d87a3195Smrg  GCC=$lt_save_GCC
11204d87a3195Smrg  CC=$lt_save_CC
11205d87a3195Smrg  CFLAGS=$lt_save_CFLAGS
11206d87a3195Smrgfi # test yes != "$_lt_disable_F77"
11207eca46af7Smrg
11208d87a3195SmrgAC_LANG_POP
11209d87a3195Smrg])# _LT_LANG_F77_CONFIG
11210eca46af7Smrg
1121195b296d0Smrg
11212d87a3195Smrg# _LT_LANG_FC_CONFIG([TAG])
11213d87a3195Smrg# -------------------------
11214d87a3195Smrg# Ensure that the configuration variables for a Fortran compiler are
11215d87a3195Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
11216d87a3195Smrg# to write the compiler configuration to 'libtool'.
11217d87a3195Smrgm4_defun([_LT_LANG_FC_CONFIG],
11218d87a3195Smrg[AC_LANG_PUSH(Fortran)
11219eca46af7Smrg
11220d87a3195Smrgif test -z "$FC" || test no = "$FC"; then
11221d87a3195Smrg  _lt_disable_FC=yes
11222eca46af7Smrgfi
11223eca46af7Smrg
11224d87a3195Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11225d87a3195Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
11226d87a3195Smrg_LT_TAGVAR(always_export_symbols, $1)=no
11227d87a3195Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
11228d87a3195Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11229d87a3195Smrg_LT_TAGVAR(hardcode_direct, $1)=no
11230d87a3195Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11231d87a3195Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11232d87a3195Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
11233d87a3195Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
11234d87a3195Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
11235d87a3195Smrg_LT_TAGVAR(inherit_rpath, $1)=no
11236d87a3195Smrg_LT_TAGVAR(module_cmds, $1)=
11237d87a3195Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
11238d87a3195Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
11239d87a3195Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11240d87a3195Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11241d87a3195Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11242d87a3195Smrg_LT_TAGVAR(no_undefined_flag, $1)=
11243d87a3195Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
11244d87a3195Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11245eca46af7Smrg
11246d87a3195Smrg# Source file extension for fc test sources.
11247d87a3195Smrgac_ext=${ac_fc_srcext-f}
11248eca46af7Smrg
11249d87a3195Smrg# Object file extension for compiled fc test sources.
11250d87a3195Smrgobjext=o
11251d87a3195Smrg_LT_TAGVAR(objext, $1)=$objext
1125295b296d0Smrg
11253d87a3195Smrg# No sense in running all these tests if we already determined that
11254d87a3195Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
11255d87a3195Smrg# are currently assumed to apply to all compilers on this platform,
11256d87a3195Smrg# and will be corrupted by setting them based on a non-working compiler.
11257d87a3195Smrgif test yes != "$_lt_disable_FC"; then
11258d87a3195Smrg  # Code to be used in simple compile tests
11259d87a3195Smrg  lt_simple_compile_test_code="\
11260d87a3195Smrg      subroutine t
11261d87a3195Smrg      return
11262d87a3195Smrg      end
11263d87a3195Smrg"
11264eca46af7Smrg
11265d87a3195Smrg  # Code to be used in simple link tests
11266d87a3195Smrg  lt_simple_link_test_code="\
11267d87a3195Smrg      program t
11268d87a3195Smrg      end
11269d87a3195Smrg"
11270d87a3195Smrg
11271d87a3195Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11272d87a3195Smrg  _LT_TAG_COMPILER
11273d87a3195Smrg
11274d87a3195Smrg  # save warnings/boilerplate of simple test code
11275d87a3195Smrg  _LT_COMPILER_BOILERPLATE
11276d87a3195Smrg  _LT_LINKER_BOILERPLATE
11277d87a3195Smrg
11278d87a3195Smrg  # Allow CC to be a program name with arguments.
11279d87a3195Smrg  lt_save_CC=$CC
11280d87a3195Smrg  lt_save_GCC=$GCC
11281d87a3195Smrg  lt_save_CFLAGS=$CFLAGS
11282d87a3195Smrg  CC=${FC-"f95"}
11283d87a3195Smrg  CFLAGS=$FCFLAGS
11284d87a3195Smrg  compiler=$CC
11285d87a3195Smrg  GCC=$ac_cv_fc_compiler_gnu
11286eca46af7Smrg
11287d87a3195Smrg  _LT_TAGVAR(compiler, $1)=$CC
11288d87a3195Smrg  _LT_CC_BASENAME([$compiler])
11289eca46af7Smrg
11290d87a3195Smrg  if test -n "$compiler"; then
11291d87a3195Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
11292d87a3195Smrg    AC_MSG_RESULT([$can_build_shared])
11293eca46af7Smrg
11294d87a3195Smrg    AC_MSG_CHECKING([whether to build shared libraries])
11295d87a3195Smrg    test no = "$can_build_shared" && enable_shared=no
11296eca46af7Smrg
11297d87a3195Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
11298d87a3195Smrg    # are all built from PIC.
11299d87a3195Smrg    case $host_os in
11300d87a3195Smrg      aix3*)
11301d87a3195Smrg        test yes = "$enable_shared" && enable_static=no
11302d87a3195Smrg        if test -n "$RANLIB"; then
11303d87a3195Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11304d87a3195Smrg          postinstall_cmds='$RANLIB $lib'
11305d87a3195Smrg        fi
11306d87a3195Smrg        ;;
11307d87a3195Smrg      aix[[4-9]]*)
11308d87a3195Smrg	if test ia64 != "$host_cpu"; then
11309d87a3195Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11310d87a3195Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
11311d87a3195Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11312d87a3195Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11313d87a3195Smrg	  esac
11314eca46af7Smrg	fi
11315d87a3195Smrg        ;;
11316d87a3195Smrg    esac
11317d87a3195Smrg    AC_MSG_RESULT([$enable_shared])
11318eca46af7Smrg
11319d87a3195Smrg    AC_MSG_CHECKING([whether to build static libraries])
11320d87a3195Smrg    # Make sure either enable_shared or enable_static is yes.
11321d87a3195Smrg    test yes = "$enable_shared" || enable_static=yes
11322d87a3195Smrg    AC_MSG_RESULT([$enable_static])
1132395b296d0Smrg
11324d87a3195Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
11325d87a3195Smrg    _LT_TAGVAR(LD, $1)=$LD
1132614330f12Smrg
11327d87a3195Smrg    ## CAVEAT EMPTOR:
11328d87a3195Smrg    ## There is no encapsulation within the following macros, do not change
11329d87a3195Smrg    ## the running order or otherwise move them around unless you know exactly
11330d87a3195Smrg    ## what you are doing...
11331d87a3195Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
11332d87a3195Smrg    _LT_COMPILER_PIC($1)
11333d87a3195Smrg    _LT_COMPILER_C_O($1)
11334d87a3195Smrg    _LT_COMPILER_FILE_LOCKS($1)
11335d87a3195Smrg    _LT_LINKER_SHLIBS($1)
11336d87a3195Smrg    _LT_SYS_DYNAMIC_LINKER($1)
11337d87a3195Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
11338eca46af7Smrg
11339d87a3195Smrg    _LT_CONFIG($1)
11340d87a3195Smrg  fi # test -n "$compiler"
11341eca46af7Smrg
11342d87a3195Smrg  GCC=$lt_save_GCC
11343d87a3195Smrg  CC=$lt_save_CC
11344d87a3195Smrg  CFLAGS=$lt_save_CFLAGS
11345d87a3195Smrgfi # test yes != "$_lt_disable_FC"
11346eca46af7Smrg
11347d87a3195SmrgAC_LANG_POP
11348d87a3195Smrg])# _LT_LANG_FC_CONFIG
11349eca46af7Smrg
1135014330f12Smrg
11351d87a3195Smrg# _LT_LANG_GCJ_CONFIG([TAG])
11352d87a3195Smrg# --------------------------
11353d87a3195Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
11354d87a3195Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11355d87a3195Smrg# to write the compiler configuration to 'libtool'.
11356d87a3195Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
11357d87a3195Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
11358d87a3195SmrgAC_LANG_SAVE
11359eca46af7Smrg
11360d87a3195Smrg# Source file extension for Java test sources.
11361d87a3195Smrgac_ext=java
11362eca46af7Smrg
11363d87a3195Smrg# Object file extension for compiled Java test sources.
11364d87a3195Smrgobjext=o
11365d87a3195Smrg_LT_TAGVAR(objext, $1)=$objext
11366eca46af7Smrg
11367d87a3195Smrg# Code to be used in simple compile tests
11368d87a3195Smrglt_simple_compile_test_code="class foo {}"
11369eca46af7Smrg
11370d87a3195Smrg# Code to be used in simple link tests
11371d87a3195Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
11372eca46af7Smrg
11373d87a3195Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11374d87a3195Smrg_LT_TAG_COMPILER
11375eca46af7Smrg
11376d87a3195Smrg# save warnings/boilerplate of simple test code
11377d87a3195Smrg_LT_COMPILER_BOILERPLATE
11378d87a3195Smrg_LT_LINKER_BOILERPLATE
11379eca46af7Smrg
11380d87a3195Smrg# Allow CC to be a program name with arguments.
11381d87a3195Smrglt_save_CC=$CC
11382d87a3195Smrglt_save_CFLAGS=$CFLAGS
11383d87a3195Smrglt_save_GCC=$GCC
11384d87a3195SmrgGCC=yes
11385d87a3195SmrgCC=${GCJ-"gcj"}
11386d87a3195SmrgCFLAGS=$GCJFLAGS
11387d87a3195Smrgcompiler=$CC
11388d87a3195Smrg_LT_TAGVAR(compiler, $1)=$CC
11389d87a3195Smrg_LT_TAGVAR(LD, $1)=$LD
11390d87a3195Smrg_LT_CC_BASENAME([$compiler])
11391d87a3195Smrg
11392d87a3195Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
11393d87a3195Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11394d87a3195Smrg
11395d87a3195Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11396d87a3195Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11397d87a3195Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11398d87a3195Smrg
11399d87a3195Smrgif test -n "$compiler"; then
11400d87a3195Smrg  _LT_COMPILER_NO_RTTI($1)
11401d87a3195Smrg  _LT_COMPILER_PIC($1)
11402d87a3195Smrg  _LT_COMPILER_C_O($1)
11403d87a3195Smrg  _LT_COMPILER_FILE_LOCKS($1)
11404d87a3195Smrg  _LT_LINKER_SHLIBS($1)
11405d87a3195Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
11406d87a3195Smrg
11407d87a3195Smrg  _LT_CONFIG($1)
11408eca46af7Smrgfi
11409eca46af7Smrg
11410d87a3195SmrgAC_LANG_RESTORE
11411eca46af7Smrg
11412d87a3195SmrgGCC=$lt_save_GCC
11413d87a3195SmrgCC=$lt_save_CC
11414d87a3195SmrgCFLAGS=$lt_save_CFLAGS
11415d87a3195Smrg])# _LT_LANG_GCJ_CONFIG
11416eca46af7Smrg
1141795b296d0Smrg
11418d87a3195Smrg# _LT_LANG_GO_CONFIG([TAG])
11419d87a3195Smrg# --------------------------
11420d87a3195Smrg# Ensure that the configuration variables for the GNU Go compiler
11421d87a3195Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11422d87a3195Smrg# to write the compiler configuration to 'libtool'.
11423d87a3195Smrgm4_defun([_LT_LANG_GO_CONFIG],
11424d87a3195Smrg[AC_REQUIRE([LT_PROG_GO])dnl
11425d87a3195SmrgAC_LANG_SAVE
1142695b296d0Smrg
11427d87a3195Smrg# Source file extension for Go test sources.
11428d87a3195Smrgac_ext=go
1142995b296d0Smrg
11430d87a3195Smrg# Object file extension for compiled Go test sources.
11431d87a3195Smrgobjext=o
11432d87a3195Smrg_LT_TAGVAR(objext, $1)=$objext
1143395b296d0Smrg
11434d87a3195Smrg# Code to be used in simple compile tests
11435d87a3195Smrglt_simple_compile_test_code="package main; func main() { }"
1143695b296d0Smrg
11437d87a3195Smrg# Code to be used in simple link tests
11438d87a3195Smrglt_simple_link_test_code='package main; func main() { }'
11439eca46af7Smrg
11440d87a3195Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11441d87a3195Smrg_LT_TAG_COMPILER
1144295b296d0Smrg
11443d87a3195Smrg# save warnings/boilerplate of simple test code
11444d87a3195Smrg_LT_COMPILER_BOILERPLATE
11445d87a3195Smrg_LT_LINKER_BOILERPLATE
11446eca46af7Smrg
11447d87a3195Smrg# Allow CC to be a program name with arguments.
11448d87a3195Smrglt_save_CC=$CC
11449d87a3195Smrglt_save_CFLAGS=$CFLAGS
11450d87a3195Smrglt_save_GCC=$GCC
11451d87a3195SmrgGCC=yes
11452d87a3195SmrgCC=${GOC-"gccgo"}
11453d87a3195SmrgCFLAGS=$GOFLAGS
11454d87a3195Smrgcompiler=$CC
11455d87a3195Smrg_LT_TAGVAR(compiler, $1)=$CC
11456d87a3195Smrg_LT_TAGVAR(LD, $1)=$LD
11457d87a3195Smrg_LT_CC_BASENAME([$compiler])
11458eca46af7Smrg
11459d87a3195Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
11460d87a3195Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11461eca46af7Smrg
11462d87a3195Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11463d87a3195Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11464d87a3195Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11465eca46af7Smrg
11466d87a3195Smrgif test -n "$compiler"; then
11467d87a3195Smrg  _LT_COMPILER_NO_RTTI($1)
11468d87a3195Smrg  _LT_COMPILER_PIC($1)
11469d87a3195Smrg  _LT_COMPILER_C_O($1)
11470d87a3195Smrg  _LT_COMPILER_FILE_LOCKS($1)
11471d87a3195Smrg  _LT_LINKER_SHLIBS($1)
11472d87a3195Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
11473d87a3195Smrg
11474d87a3195Smrg  _LT_CONFIG($1)
11475d87a3195Smrgfi
11476d87a3195Smrg
11477d87a3195SmrgAC_LANG_RESTORE
11478d87a3195Smrg
11479d87a3195SmrgGCC=$lt_save_GCC
11480d87a3195SmrgCC=$lt_save_CC
11481d87a3195SmrgCFLAGS=$lt_save_CFLAGS
11482d87a3195Smrg])# _LT_LANG_GO_CONFIG
11483d87a3195Smrg
11484d87a3195Smrg
11485d87a3195Smrg# _LT_LANG_RC_CONFIG([TAG])
11486d87a3195Smrg# -------------------------
11487d87a3195Smrg# Ensure that the configuration variables for the Windows resource compiler
11488d87a3195Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11489d87a3195Smrg# to write the compiler configuration to 'libtool'.
11490d87a3195Smrgm4_defun([_LT_LANG_RC_CONFIG],
11491d87a3195Smrg[AC_REQUIRE([LT_PROG_RC])dnl
11492d87a3195SmrgAC_LANG_SAVE
11493d87a3195Smrg
11494d87a3195Smrg# Source file extension for RC test sources.
11495d87a3195Smrgac_ext=rc
11496eca46af7Smrg
11497d87a3195Smrg# Object file extension for compiled RC test sources.
11498d87a3195Smrgobjext=o
11499d87a3195Smrg_LT_TAGVAR(objext, $1)=$objext
11500eca46af7Smrg
11501d87a3195Smrg# Code to be used in simple compile tests
11502d87a3195Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
11503eca46af7Smrg
11504d87a3195Smrg# Code to be used in simple link tests
11505d87a3195Smrglt_simple_link_test_code=$lt_simple_compile_test_code
11506eca46af7Smrg
11507d87a3195Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11508d87a3195Smrg_LT_TAG_COMPILER
11509eca46af7Smrg
11510d87a3195Smrg# save warnings/boilerplate of simple test code
11511d87a3195Smrg_LT_COMPILER_BOILERPLATE
11512d87a3195Smrg_LT_LINKER_BOILERPLATE
11513eca46af7Smrg
11514d87a3195Smrg# Allow CC to be a program name with arguments.
11515d87a3195Smrglt_save_CC=$CC
11516d87a3195Smrglt_save_CFLAGS=$CFLAGS
11517d87a3195Smrglt_save_GCC=$GCC
11518d87a3195SmrgGCC=
11519d87a3195SmrgCC=${RC-"windres"}
11520d87a3195SmrgCFLAGS=
11521d87a3195Smrgcompiler=$CC
11522d87a3195Smrg_LT_TAGVAR(compiler, $1)=$CC
11523d87a3195Smrg_LT_CC_BASENAME([$compiler])
11524d87a3195Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
11525eca46af7Smrg
11526d87a3195Smrgif test -n "$compiler"; then
11527d87a3195Smrg  :
11528d87a3195Smrg  _LT_CONFIG($1)
11529d87a3195Smrgfi
11530eca46af7Smrg
11531d87a3195SmrgGCC=$lt_save_GCC
11532d87a3195SmrgAC_LANG_RESTORE
11533d87a3195SmrgCC=$lt_save_CC
11534d87a3195SmrgCFLAGS=$lt_save_CFLAGS
11535d87a3195Smrg])# _LT_LANG_RC_CONFIG
11536eca46af7Smrg
11537eca46af7Smrg
11538d87a3195Smrg# LT_PROG_GCJ
11539d87a3195Smrg# -----------
11540d87a3195SmrgAC_DEFUN([LT_PROG_GCJ],
11541d87a3195Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
11542d87a3195Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
11543d87a3195Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
11544d87a3195Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
11545d87a3195Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
11546eca46af7Smrg])
11547eca46af7Smrg
11548d87a3195Smrg# Old name:
11549d87a3195SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
11550d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
11551d87a3195Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
11552eca46af7Smrg
11553eca46af7Smrg
11554d87a3195Smrg# LT_PROG_GO
11555d87a3195Smrg# ----------
11556d87a3195SmrgAC_DEFUN([LT_PROG_GO],
11557d87a3195Smrg[AC_CHECK_TOOL(GOC, gccgo,)
11558d87a3195Smrg])
1155995b296d0Smrg
11560eca46af7Smrg
11561d87a3195Smrg# LT_PROG_RC
11562d87a3195Smrg# ----------
11563d87a3195SmrgAC_DEFUN([LT_PROG_RC],
11564d87a3195Smrg[AC_CHECK_TOOL(RC, windres,)
11565d87a3195Smrg])
11566eca46af7Smrg
11567d87a3195Smrg# Old name:
11568d87a3195SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
11569d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
11570d87a3195Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
11571eca46af7Smrg
11572eca46af7Smrg
11573d87a3195Smrg# _LT_DECL_EGREP
11574d87a3195Smrg# --------------
11575d87a3195Smrg# If we don't have a new enough Autoconf to choose the best grep
11576d87a3195Smrg# available, choose the one first in the user's PATH.
11577d87a3195Smrgm4_defun([_LT_DECL_EGREP],
11578d87a3195Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
11579d87a3195SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
11580d87a3195Smrgtest -z "$GREP" && GREP=grep
11581d87a3195Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
11582d87a3195Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
11583d87a3195Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
11584d87a3195Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
11585d87a3195SmrgAC_SUBST([GREP])
11586d87a3195Smrg])
11587eca46af7Smrg
11588eca46af7Smrg
11589d87a3195Smrg# _LT_DECL_OBJDUMP
11590d87a3195Smrg# --------------
11591d87a3195Smrg# If we don't have a new enough Autoconf to choose the best objdump
11592d87a3195Smrg# available, choose the one first in the user's PATH.
11593d87a3195Smrgm4_defun([_LT_DECL_OBJDUMP],
11594d87a3195Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
11595d87a3195Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
11596d87a3195Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
11597d87a3195SmrgAC_SUBST([OBJDUMP])
11598d87a3195Smrg])
11599eca46af7Smrg
11600d87a3195Smrg# _LT_DECL_DLLTOOL
11601d87a3195Smrg# ----------------
11602d87a3195Smrg# Ensure DLLTOOL variable is set.
11603d87a3195Smrgm4_defun([_LT_DECL_DLLTOOL],
11604d87a3195Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
11605d87a3195Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
11606d87a3195Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
11607d87a3195SmrgAC_SUBST([DLLTOOL])
11608d87a3195Smrg])
11609eca46af7Smrg
11610d87a3195Smrg# _LT_DECL_FILECMD
11611d87a3195Smrg# ----------------
11612d87a3195Smrg# Check for a file(cmd) program that can be used to detect file type and magic
11613d87a3195Smrgm4_defun([_LT_DECL_FILECMD],
11614d87a3195Smrg[AC_CHECK_TOOL([FILECMD], [file], [:])
11615d87a3195Smrg_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
11616d87a3195Smrg])# _LD_DECL_FILECMD
11617eca46af7Smrg
11618d87a3195Smrg# _LT_DECL_SED
11619d87a3195Smrg# ------------
11620d87a3195Smrg# Check for a fully-functional sed program, that truncates
11621d87a3195Smrg# as few characters as possible.  Prefer GNU sed if found.
11622d87a3195Smrgm4_defun([_LT_DECL_SED],
11623d87a3195Smrg[AC_PROG_SED
11624d87a3195Smrgtest -z "$SED" && SED=sed
11625d87a3195SmrgXsed="$SED -e 1s/^X//"
11626d87a3195Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
11627d87a3195Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
11628d87a3195Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
11629d87a3195Smrg])# _LT_DECL_SED
11630d87a3195Smrg
11631d87a3195Smrgm4_ifndef([AC_PROG_SED], [
11632d87a3195Smrg# NOTE: This macro has been submitted for inclusion into   #
11633d87a3195Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
11634d87a3195Smrg#  a released version of Autoconf we should remove this    #
11635d87a3195Smrg#  macro and use it instead.                               #
11636d87a3195Smrg
11637d87a3195Smrgm4_defun([AC_PROG_SED],
11638d87a3195Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
11639d87a3195SmrgAC_CACHE_VAL(lt_cv_path_SED,
11640d87a3195Smrg[# Loop through the user's path and test for sed and gsed.
11641d87a3195Smrg# Then use that list of sed's as ones to test for truncation.
11642d87a3195Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11643d87a3195Smrgfor as_dir in $PATH
11644d87a3195Smrgdo
11645d87a3195Smrg  IFS=$as_save_IFS
11646d87a3195Smrg  test -z "$as_dir" && as_dir=.
11647d87a3195Smrg  for lt_ac_prog in sed gsed; do
11648d87a3195Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
11649d87a3195Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
11650d87a3195Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
11651eca46af7Smrg      fi
11652d87a3195Smrg    done
11653d87a3195Smrg  done
11654d87a3195Smrgdone
11655d87a3195SmrgIFS=$as_save_IFS
11656d87a3195Smrglt_ac_max=0
11657d87a3195Smrglt_ac_count=0
11658d87a3195Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
11659d87a3195Smrg# along with /bin/sed that truncates output.
11660d87a3195Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
11661d87a3195Smrg  test ! -f "$lt_ac_sed" && continue
11662d87a3195Smrg  cat /dev/null > conftest.in
11663d87a3195Smrg  lt_ac_count=0
11664d87a3195Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
11665d87a3195Smrg  # Check for GNU sed and select it if it is found.
11666d87a3195Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
11667d87a3195Smrg    lt_cv_path_SED=$lt_ac_sed
11668d87a3195Smrg    break
11669d87a3195Smrg  fi
11670d87a3195Smrg  while true; do
11671d87a3195Smrg    cat conftest.in conftest.in >conftest.tmp
11672d87a3195Smrg    mv conftest.tmp conftest.in
11673d87a3195Smrg    cp conftest.in conftest.nl
11674d87a3195Smrg    echo >>conftest.nl
11675d87a3195Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
11676d87a3195Smrg    cmp -s conftest.out conftest.nl || break
11677d87a3195Smrg    # 10000 chars as input seems more than enough
11678d87a3195Smrg    test 10 -lt "$lt_ac_count" && break
11679d87a3195Smrg    lt_ac_count=`expr $lt_ac_count + 1`
11680d87a3195Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
11681d87a3195Smrg      lt_ac_max=$lt_ac_count
11682d87a3195Smrg      lt_cv_path_SED=$lt_ac_sed
11683eca46af7Smrg    fi
11684eca46af7Smrg  done
11685d87a3195Smrgdone
11686d87a3195Smrg])
11687d87a3195SmrgSED=$lt_cv_path_SED
11688d87a3195SmrgAC_SUBST([SED])
11689d87a3195SmrgAC_MSG_RESULT([$SED])
11690d87a3195Smrg])#AC_PROG_SED
11691d87a3195Smrg])#m4_ifndef
11692eca46af7Smrg
11693d87a3195Smrg# Old name:
11694d87a3195SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
11695d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
11696d87a3195Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
11697d87a3195Smrg
11698d87a3195Smrg
11699d87a3195Smrg# _LT_CHECK_SHELL_FEATURES
11700d87a3195Smrg# ------------------------
11701d87a3195Smrg# Find out whether the shell is Bourne or XSI compatible,
11702d87a3195Smrg# or has some other useful features.
11703d87a3195Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
11704d87a3195Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
11705d87a3195Smrg  lt_unset=unset
11706eca46af7Smrgelse
11707d87a3195Smrg  lt_unset=false
11708eca46af7Smrgfi
11709d87a3195Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
11710d87a3195Smrg
11711d87a3195Smrg# test EBCDIC or ASCII
11712d87a3195Smrgcase `echo X|tr X '\101'` in
11713d87a3195Smrg A) # ASCII based system
11714d87a3195Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
11715d87a3195Smrg  lt_SP2NL='tr \040 \012'
11716d87a3195Smrg  lt_NL2SP='tr \015\012 \040\040'
11717d87a3195Smrg  ;;
11718d87a3195Smrg *) # EBCDIC based system
11719d87a3195Smrg  lt_SP2NL='tr \100 \n'
11720d87a3195Smrg  lt_NL2SP='tr \r\n \100\100'
11721d87a3195Smrg  ;;
11722d87a3195Smrgesac
11723d87a3195Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
11724d87a3195Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
11725d87a3195Smrg])# _LT_CHECK_SHELL_FEATURES
11726d87a3195Smrg
11727d87a3195Smrg
11728d87a3195Smrg# _LT_PATH_CONVERSION_FUNCTIONS
11729d87a3195Smrg# -----------------------------
11730d87a3195Smrg# Determine what file name conversion functions should be used by
11731d87a3195Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
11732d87a3195Smrg# for certain cross-compile configurations and native mingw.
11733d87a3195Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
11734d87a3195Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11735d87a3195SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
11736d87a3195SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
11737d87a3195SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
11738d87a3195Smrg[case $host in
11739d87a3195Smrg  *-*-mingw* )
11740d87a3195Smrg    case $build in
11741d87a3195Smrg      *-*-mingw* ) # actually msys
11742d87a3195Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
11743d87a3195Smrg        ;;
11744d87a3195Smrg      *-*-cygwin* )
11745d87a3195Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
11746d87a3195Smrg        ;;
11747d87a3195Smrg      * ) # otherwise, assume *nix
11748d87a3195Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
11749d87a3195Smrg        ;;
11750d87a3195Smrg    esac
11751d87a3195Smrg    ;;
11752d87a3195Smrg  *-*-cygwin* )
11753d87a3195Smrg    case $build in
11754d87a3195Smrg      *-*-mingw* ) # actually msys
11755d87a3195Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
11756d87a3195Smrg        ;;
11757d87a3195Smrg      *-*-cygwin* )
11758d87a3195Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
11759d87a3195Smrg        ;;
11760d87a3195Smrg      * ) # otherwise, assume *nix
11761d87a3195Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
11762d87a3195Smrg        ;;
11763d87a3195Smrg    esac
11764d87a3195Smrg    ;;
11765d87a3195Smrg  * ) # unhandled hosts (and "normal" native builds)
11766d87a3195Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
11767d87a3195Smrg    ;;
11768d87a3195Smrgesac
11769eca46af7Smrg])
11770d87a3195Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
11771d87a3195SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
11772d87a3195Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
11773d87a3195Smrg         [0], [convert $build file names to $host format])dnl
11774d87a3195Smrg
11775d87a3195SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
11776d87a3195SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
11777d87a3195Smrg[#assume ordinary cross tools, or native build.
11778d87a3195Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
11779d87a3195Smrgcase $host in
11780d87a3195Smrg  *-*-mingw* )
11781d87a3195Smrg    case $build in
11782d87a3195Smrg      *-*-mingw* ) # actually msys
11783d87a3195Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
11784d87a3195Smrg        ;;
11785d87a3195Smrg    esac
11786d87a3195Smrg    ;;
11787d87a3195Smrgesac
11788eca46af7Smrg])
11789d87a3195Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
11790d87a3195SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
11791d87a3195Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
11792d87a3195Smrg         [0], [convert $build files to toolchain format])dnl
11793d87a3195Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
11794d87a3195Smrg
11795d87a3195Smrg# Helper functions for option handling.                    -*- Autoconf -*-
11796d87a3195Smrg#
11797d87a3195Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
11798d87a3195Smrg#   Software Foundation, Inc.
11799d87a3195Smrg#   Written by Gary V. Vaughan, 2004
11800d87a3195Smrg#
11801d87a3195Smrg# This file is free software; the Free Software Foundation gives
11802d87a3195Smrg# unlimited permission to copy and/or distribute it, with or without
11803d87a3195Smrg# modifications, as long as this notice is preserved.
1180495b296d0Smrg
11805d87a3195Smrg# serial 8 ltoptions.m4
1180695b296d0Smrg
11807d87a3195Smrg# This is to help aclocal find these macros, as it can't see m4_define.
11808d87a3195SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
11809d87a3195Smrg
11810d87a3195Smrg
11811d87a3195Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
11812d87a3195Smrg# ------------------------------------------
11813d87a3195Smrgm4_define([_LT_MANGLE_OPTION],
11814d87a3195Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
11815d87a3195Smrg
11816d87a3195Smrg
11817d87a3195Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
11818d87a3195Smrg# ---------------------------------------
11819d87a3195Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
11820d87a3195Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
11821d87a3195Smrg# saved as a flag.
11822d87a3195Smrgm4_define([_LT_SET_OPTION],
11823d87a3195Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
11824d87a3195Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
11825d87a3195Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
11826d87a3195Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
11827eca46af7Smrg])
1182814330f12Smrg
11829eca46af7Smrg
11830d87a3195Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
11831d87a3195Smrg# ------------------------------------------------------------
11832d87a3195Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11833d87a3195Smrgm4_define([_LT_IF_OPTION],
11834d87a3195Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
11835d87a3195Smrg
11836d87a3195Smrg
11837d87a3195Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
11838d87a3195Smrg# -------------------------------------------------------
11839d87a3195Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
11840d87a3195Smrg# are set.
11841d87a3195Smrgm4_define([_LT_UNLESS_OPTIONS],
11842d87a3195Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11843d87a3195Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
11844d87a3195Smrg		      [m4_define([$0_found])])])[]dnl
11845d87a3195Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
11846d87a3195Smrg])[]dnl
11847eca46af7Smrg])
1184895b296d0Smrg
1184995b296d0Smrg
11850d87a3195Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
11851d87a3195Smrg# ----------------------------------------
11852d87a3195Smrg# OPTION-LIST is a space-separated list of Libtool options associated
11853d87a3195Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
11854d87a3195Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
11855d87a3195Smrg# the unknown option and exit.
11856d87a3195Smrgm4_defun([_LT_SET_OPTIONS],
11857d87a3195Smrg[# Set options
11858d87a3195Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11859d87a3195Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
1186095b296d0Smrg
11861d87a3195Smrgm4_if([$1],[LT_INIT],[
11862d87a3195Smrg  dnl
11863d87a3195Smrg  dnl Simply set some default values (i.e off) if boolean options were not
11864d87a3195Smrg  dnl specified:
11865d87a3195Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
11866d87a3195Smrg  ])
11867d87a3195Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
11868d87a3195Smrg  ])
11869d87a3195Smrg  dnl
11870d87a3195Smrg  dnl If no reference was made to various pairs of opposing options, then
11871d87a3195Smrg  dnl we run the default mode handler for the pair.  For example, if neither
11872d87a3195Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
11873d87a3195Smrg  dnl archives by default:
11874d87a3195Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
11875d87a3195Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
11876d87a3195Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
11877d87a3195Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
11878d87a3195Smrg		   [_LT_ENABLE_FAST_INSTALL])
11879d87a3195Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
11880d87a3195Smrg		   [_LT_WITH_AIX_SONAME([aix])])
11881d87a3195Smrg  ])
11882d87a3195Smrg])# _LT_SET_OPTIONS
1188314330f12Smrg
1188495b296d0Smrg
1188514330f12Smrg
11886d87a3195Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
11887d87a3195Smrg# -----------------------------------------
11888d87a3195Smrgm4_define([_LT_MANGLE_DEFUN],
11889d87a3195Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
11890d87a3195Smrg
11891d87a3195Smrg
11892d87a3195Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
11893d87a3195Smrg# -----------------------------------------------
11894d87a3195Smrgm4_define([LT_OPTION_DEFINE],
11895d87a3195Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
11896d87a3195Smrg])# LT_OPTION_DEFINE
11897d87a3195Smrg
11898d87a3195Smrg
11899d87a3195Smrg# dlopen
11900d87a3195Smrg# ------
11901d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
11902eca46af7Smrg])
11903eca46af7Smrg
11904d87a3195SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
11905d87a3195Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
11906d87a3195SmrgAC_DIAGNOSE([obsolete],
11907d87a3195Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
11908d87a3195Smrgput the 'dlopen' option into LT_INIT's first parameter.])
11909d87a3195Smrg])
11910eca46af7Smrg
11911d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
11912d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
1191395b296d0Smrg
1191414330f12Smrg
11915d87a3195Smrg# win32-dll
11916d87a3195Smrg# ---------
11917d87a3195Smrg# Declare package support for building win32 dll's.
11918d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
11919d87a3195Smrg[enable_win32_dll=yes
11920d87a3195Smrg
11921d87a3195Smrgcase $host in
11922d87a3195Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
11923d87a3195Smrg  AC_CHECK_TOOL(AS, as, false)
11924d87a3195Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
11925d87a3195Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
11926d87a3195Smrg  ;;
11927d87a3195Smrgesac
11928d87a3195Smrg
11929d87a3195Smrgtest -z "$AS" && AS=as
11930d87a3195Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
11931d87a3195Smrg
11932d87a3195Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
11933d87a3195Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
11934d87a3195Smrg
11935d87a3195Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
11936d87a3195Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
11937d87a3195Smrg])# win32-dll
11938d87a3195Smrg
11939d87a3195SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
11940d87a3195Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11941d87a3195Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
11942d87a3195SmrgAC_DIAGNOSE([obsolete],
11943d87a3195Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
11944d87a3195Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
11945eca46af7Smrg])
1194695b296d0Smrg
11947d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
11948d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
11949d87a3195Smrg
11950d87a3195Smrg
11951d87a3195Smrg# _LT_ENABLE_SHARED([DEFAULT])
11952d87a3195Smrg# ----------------------------
11953d87a3195Smrg# implement the --enable-shared flag, and supports the 'shared' and
11954d87a3195Smrg# 'disable-shared' LT_INIT options.
11955d87a3195Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
11956d87a3195Smrgm4_define([_LT_ENABLE_SHARED],
11957d87a3195Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
11958d87a3195SmrgAC_ARG_ENABLE([shared],
11959d87a3195Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
11960d87a3195Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
11961d87a3195Smrg    [p=${PACKAGE-default}
11962d87a3195Smrg    case $enableval in
11963d87a3195Smrg    yes) enable_shared=yes ;;
11964d87a3195Smrg    no) enable_shared=no ;;
11965d87a3195Smrg    *)
11966d87a3195Smrg      enable_shared=no
11967d87a3195Smrg      # Look at the argument we got.  We use all the common list separators.
11968d87a3195Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
11969d87a3195Smrg      for pkg in $enableval; do
11970d87a3195Smrg	IFS=$lt_save_ifs
11971d87a3195Smrg	if test "X$pkg" = "X$p"; then
11972d87a3195Smrg	  enable_shared=yes
11973d87a3195Smrg	fi
11974d87a3195Smrg      done
11975d87a3195Smrg      IFS=$lt_save_ifs
11976d87a3195Smrg      ;;
11977d87a3195Smrg    esac],
11978d87a3195Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
1197995b296d0Smrg
11980d87a3195Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
11981d87a3195Smrg	[Whether or not to build shared libraries])
11982d87a3195Smrg])# _LT_ENABLE_SHARED
1198395b296d0Smrg
11984d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
11985d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
1198695b296d0Smrg
11987d87a3195Smrg# Old names:
11988d87a3195SmrgAC_DEFUN([AC_ENABLE_SHARED],
11989d87a3195Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
11990d87a3195Smrg])
1199195b296d0Smrg
11992d87a3195SmrgAC_DEFUN([AC_DISABLE_SHARED],
11993d87a3195Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
11994eca46af7Smrg])
1199595b296d0Smrg
11996d87a3195SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
11997d87a3195SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
11998eca46af7Smrg
11999d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
12000d87a3195Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
12001d87a3195Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
12002eca46af7Smrg
1200395b296d0Smrg
1200495b296d0Smrg
12005d87a3195Smrg# _LT_ENABLE_STATIC([DEFAULT])
12006d87a3195Smrg# ----------------------------
12007d87a3195Smrg# implement the --enable-static flag, and support the 'static' and
12008d87a3195Smrg# 'disable-static' LT_INIT options.
12009d87a3195Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
12010d87a3195Smrgm4_define([_LT_ENABLE_STATIC],
12011d87a3195Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
12012d87a3195SmrgAC_ARG_ENABLE([static],
12013d87a3195Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
12014d87a3195Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
12015d87a3195Smrg    [p=${PACKAGE-default}
12016d87a3195Smrg    case $enableval in
12017d87a3195Smrg    yes) enable_static=yes ;;
12018d87a3195Smrg    no) enable_static=no ;;
12019d87a3195Smrg    *)
12020d87a3195Smrg     enable_static=no
12021d87a3195Smrg      # Look at the argument we got.  We use all the common list separators.
12022d87a3195Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12023d87a3195Smrg      for pkg in $enableval; do
12024d87a3195Smrg	IFS=$lt_save_ifs
12025d87a3195Smrg	if test "X$pkg" = "X$p"; then
12026d87a3195Smrg	  enable_static=yes
12027d87a3195Smrg	fi
12028d87a3195Smrg      done
12029d87a3195Smrg      IFS=$lt_save_ifs
12030d87a3195Smrg      ;;
12031d87a3195Smrg    esac],
12032d87a3195Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
1203395b296d0Smrg
12034d87a3195Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
12035d87a3195Smrg	[Whether or not to build static libraries])
12036d87a3195Smrg])# _LT_ENABLE_STATIC
1203795b296d0Smrg
12038d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
12039d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
12040d87a3195Smrg
12041d87a3195Smrg# Old names:
12042d87a3195SmrgAC_DEFUN([AC_ENABLE_STATIC],
12043d87a3195Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
1204489b0dc75Smrg])
1204595b296d0Smrg
12046d87a3195SmrgAC_DEFUN([AC_DISABLE_STATIC],
12047d87a3195Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
12048d87a3195Smrg])
1204914330f12Smrg
12050d87a3195SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
12051d87a3195SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
1205214330f12Smrg
12053d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
12054d87a3195Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
12055d87a3195Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
12056e6f085baSmrg
1205714330f12Smrg
1205895b296d0Smrg
12059d87a3195Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
12060d87a3195Smrg# ----------------------------------
12061d87a3195Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
12062d87a3195Smrg# and 'disable-fast-install' LT_INIT options.
12063d87a3195Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
12064d87a3195Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
12065d87a3195Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
12066d87a3195SmrgAC_ARG_ENABLE([fast-install],
12067d87a3195Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
12068d87a3195Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
12069d87a3195Smrg    [p=${PACKAGE-default}
12070d87a3195Smrg    case $enableval in
12071d87a3195Smrg    yes) enable_fast_install=yes ;;
12072d87a3195Smrg    no) enable_fast_install=no ;;
12073d87a3195Smrg    *)
12074d87a3195Smrg      enable_fast_install=no
12075d87a3195Smrg      # Look at the argument we got.  We use all the common list separators.
12076d87a3195Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12077d87a3195Smrg      for pkg in $enableval; do
12078d87a3195Smrg	IFS=$lt_save_ifs
12079d87a3195Smrg	if test "X$pkg" = "X$p"; then
12080d87a3195Smrg	  enable_fast_install=yes
12081d87a3195Smrg	fi
12082d87a3195Smrg      done
12083d87a3195Smrg      IFS=$lt_save_ifs
12084d87a3195Smrg      ;;
12085d87a3195Smrg    esac],
12086d87a3195Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
12087eca46af7Smrg
12088d87a3195Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
12089d87a3195Smrg	 [Whether or not to optimize for fast installation])dnl
12090d87a3195Smrg])# _LT_ENABLE_FAST_INSTALL
1209195b296d0Smrg
12092d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
12093d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
1209414330f12Smrg
12095d87a3195Smrg# Old names:
12096d87a3195SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
12097d87a3195Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
12098d87a3195SmrgAC_DIAGNOSE([obsolete],
12099d87a3195Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
12100d87a3195Smrgthe 'fast-install' option into LT_INIT's first parameter.])
12101d87a3195Smrg])
1210214330f12Smrg
12103d87a3195SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
12104d87a3195Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
12105d87a3195SmrgAC_DIAGNOSE([obsolete],
12106d87a3195Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
12107d87a3195Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
12108d87a3195Smrg])
1210914330f12Smrg
12110d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
12111d87a3195Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
12112d87a3195Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
1211314330f12Smrg
1211414330f12Smrg
12115d87a3195Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
12116d87a3195Smrg# ----------------------------------
12117d87a3195Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
12118d87a3195Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
12119d87a3195Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
12120d87a3195Smrgm4_define([_LT_WITH_AIX_SONAME],
12121d87a3195Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
12122d87a3195Smrgshared_archive_member_spec=
12123d87a3195Smrgcase $host,$enable_shared in
12124d87a3195Smrgpower*-*-aix[[5-9]]*,yes)
12125d87a3195Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
12126d87a3195Smrg  AC_ARG_WITH([aix-soname],
12127d87a3195Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
12128d87a3195Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
12129d87a3195Smrg    [case $withval in
12130d87a3195Smrg    aix|svr4|both)
12131d87a3195Smrg      ;;
12132d87a3195Smrg    *)
12133d87a3195Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
12134d87a3195Smrg      ;;
12135d87a3195Smrg    esac
12136d87a3195Smrg    lt_cv_with_aix_soname=$with_aix_soname],
12137d87a3195Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
12138d87a3195Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
12139d87a3195Smrg    with_aix_soname=$lt_cv_with_aix_soname])
12140d87a3195Smrg  AC_MSG_RESULT([$with_aix_soname])
12141d87a3195Smrg  if test aix != "$with_aix_soname"; then
12142d87a3195Smrg    # For the AIX way of multilib, we name the shared archive member
12143d87a3195Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
12144d87a3195Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
12145d87a3195Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
12146d87a3195Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
12147d87a3195Smrg    if test 64 = "${OBJECT_MODE-32}"; then
12148d87a3195Smrg      shared_archive_member_spec=shr_64
12149d87a3195Smrg    else
12150d87a3195Smrg      shared_archive_member_spec=shr
12151d87a3195Smrg    fi
12152d87a3195Smrg  fi
12153d87a3195Smrg  ;;
12154d87a3195Smrg*)
12155d87a3195Smrg  with_aix_soname=aix
12156eca46af7Smrg  ;;
12157eca46af7Smrgesac
1215814330f12Smrg
12159d87a3195Smrg_LT_DECL([], [shared_archive_member_spec], [0],
12160d87a3195Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
12161d87a3195Smrg])# _LT_WITH_AIX_SONAME
1216214330f12Smrg
12163d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
12164d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
12165d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
1216695b296d0Smrg
1216714330f12Smrg
12168d87a3195Smrg# _LT_WITH_PIC([MODE])
12169d87a3195Smrg# --------------------
12170d87a3195Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
12171d87a3195Smrg# LT_INIT options.
12172d87a3195Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
12173d87a3195Smrgm4_define([_LT_WITH_PIC],
12174d87a3195Smrg[AC_ARG_WITH([pic],
12175d87a3195Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
12176d87a3195Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
12177d87a3195Smrg    [lt_p=${PACKAGE-default}
12178d87a3195Smrg    case $withval in
12179d87a3195Smrg    yes|no) pic_mode=$withval ;;
12180d87a3195Smrg    *)
12181d87a3195Smrg      pic_mode=default
12182d87a3195Smrg      # Look at the argument we got.  We use all the common list separators.
12183d87a3195Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12184d87a3195Smrg      for lt_pkg in $withval; do
12185d87a3195Smrg	IFS=$lt_save_ifs
12186d87a3195Smrg	if test "X$lt_pkg" = "X$lt_p"; then
12187d87a3195Smrg	  pic_mode=yes
12188d87a3195Smrg	fi
12189d87a3195Smrg      done
12190d87a3195Smrg      IFS=$lt_save_ifs
12191d87a3195Smrg      ;;
12192d87a3195Smrg    esac],
12193d87a3195Smrg    [pic_mode=m4_default([$1], [default])])
121942378475aSmrg
12195d87a3195Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
12196d87a3195Smrg])# _LT_WITH_PIC
1219714330f12Smrg
12198d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
12199d87a3195SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
1220014330f12Smrg
12201d87a3195Smrg# Old name:
12202d87a3195SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
12203d87a3195Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
12204d87a3195SmrgAC_DIAGNOSE([obsolete],
12205d87a3195Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
12206d87a3195Smrgput the 'pic-only' option into LT_INIT's first parameter.])
12207d87a3195Smrg])
1220814330f12Smrg
12209d87a3195Smrgdnl aclocal-1.4 backwards compatibility:
12210d87a3195Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
122112378475aSmrg
122122378475aSmrg
12213d87a3195Smrgm4_define([_LTDL_MODE], [])
12214d87a3195SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
12215d87a3195Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
12216d87a3195SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
12217d87a3195Smrg		 [m4_define([_LTDL_MODE], [recursive])])
12218d87a3195SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
12219d87a3195Smrg		 [m4_define([_LTDL_MODE], [subproject])])
1222095b296d0Smrg
12221d87a3195Smrgm4_define([_LTDL_TYPE], [])
12222d87a3195SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
12223d87a3195Smrg		 [m4_define([_LTDL_TYPE], [installable])])
12224d87a3195SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
12225d87a3195Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
12226eca46af7Smrg
12227d87a3195Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
12228ff89ac2bSmrg#
12229d87a3195Smrg# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
12230d87a3195Smrg# Foundation, Inc.
12231d87a3195Smrg# Written by Gary V. Vaughan, 2004
12232d87a3195Smrg#
12233d87a3195Smrg# This file is free software; the Free Software Foundation gives
12234d87a3195Smrg# unlimited permission to copy and/or distribute it, with or without
12235d87a3195Smrg# modifications, as long as this notice is preserved.
12236eca46af7Smrg
12237d87a3195Smrg# serial 6 ltsugar.m4
12238eca46af7Smrg
12239d87a3195Smrg# This is to help aclocal find these macros, as it can't see m4_define.
12240d87a3195SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
12241eca46af7Smrg
12242ff89ac2bSmrg
12243d87a3195Smrg# lt_join(SEP, ARG1, [ARG2...])
12244d87a3195Smrg# -----------------------------
12245d87a3195Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
12246d87a3195Smrg# associated separator.
12247d87a3195Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
12248d87a3195Smrg# versions in m4sugar had bugs.
12249d87a3195Smrgm4_define([lt_join],
12250d87a3195Smrg[m4_if([$#], [1], [],
12251d87a3195Smrg       [$#], [2], [[$2]],
12252d87a3195Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
12253d87a3195Smrgm4_define([_lt_join],
12254d87a3195Smrg[m4_if([$#$2], [2], [],
12255d87a3195Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
12256eca46af7Smrg
12257eca46af7Smrg
12258d87a3195Smrg# lt_car(LIST)
12259d87a3195Smrg# lt_cdr(LIST)
12260d87a3195Smrg# ------------
12261d87a3195Smrg# Manipulate m4 lists.
12262d87a3195Smrg# These macros are necessary as long as will still need to support
12263d87a3195Smrg# Autoconf-2.59, which quotes differently.
12264d87a3195Smrgm4_define([lt_car], [[$1]])
12265d87a3195Smrgm4_define([lt_cdr],
12266d87a3195Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
12267d87a3195Smrg       [$#], 1, [],
12268d87a3195Smrg       [m4_dquote(m4_shift($@))])])
12269d87a3195Smrgm4_define([lt_unquote], $1)
12270d87a3195Smrg
12271e6f085baSmrg
12272d87a3195Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
12273d87a3195Smrg# ------------------------------------------
12274d87a3195Smrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
12275d87a3195Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
12276d87a3195Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
12277d87a3195Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
12278d87a3195Smrg# than defined and empty).
12279eca46af7Smrg#
12280d87a3195Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
12281d87a3195Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
12282d87a3195Smrgm4_define([lt_append],
12283d87a3195Smrg[m4_define([$1],
12284d87a3195Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
12285ff89ac2bSmrg
12286e6f085baSmrg
1228795b296d0Smrg
12288d87a3195Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
12289d87a3195Smrg# ----------------------------------------------------------
12290d87a3195Smrg# Produce a SEP delimited list of all paired combinations of elements of
12291d87a3195Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
12292d87a3195Smrg# has the form PREFIXmINFIXSUFFIXn.
12293d87a3195Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
12294d87a3195Smrgm4_define([lt_combine],
12295d87a3195Smrg[m4_if(m4_eval([$# > 3]), [1],
12296d87a3195Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
12297d87a3195Smrg[[m4_foreach([_Lt_prefix], [$2],
12298d87a3195Smrg	     [m4_foreach([_Lt_suffix],
12299d87a3195Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
12300d87a3195Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
12301d87a3195Smrg
12302d87a3195Smrg
12303d87a3195Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
12304d87a3195Smrg# -----------------------------------------------------------------------
12305d87a3195Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
12306d87a3195Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
12307d87a3195Smrgm4_define([lt_if_append_uniq],
12308d87a3195Smrg[m4_ifdef([$1],
12309d87a3195Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
12310d87a3195Smrg		 [lt_append([$1], [$2], [$3])$4],
12311d87a3195Smrg		 [$5])],
12312d87a3195Smrg	  [lt_append([$1], [$2], [$3])$4])])
12313d87a3195Smrg
12314d87a3195Smrg
12315d87a3195Smrg# lt_dict_add(DICT, KEY, VALUE)
12316d87a3195Smrg# -----------------------------
12317d87a3195Smrgm4_define([lt_dict_add],
12318d87a3195Smrg[m4_define([$1($2)], [$3])])
1231914330f12Smrg
1232095b296d0Smrg
12321d87a3195Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
12322d87a3195Smrg# --------------------------------------------
12323d87a3195Smrgm4_define([lt_dict_add_subkey],
12324d87a3195Smrg[m4_define([$1($2:$3)], [$4])])
12325eca46af7Smrg
12326eca46af7Smrg
12327d87a3195Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
12328d87a3195Smrg# ----------------------------------
12329d87a3195Smrgm4_define([lt_dict_fetch],
12330d87a3195Smrg[m4_ifval([$3],
12331d87a3195Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
12332d87a3195Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
12333eca46af7Smrg
1233495b296d0Smrg
12335d87a3195Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
12336d87a3195Smrg# -----------------------------------------------------------------
12337d87a3195Smrgm4_define([lt_if_dict_fetch],
12338d87a3195Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
12339d87a3195Smrg	[$5],
12340d87a3195Smrg    [$6])])
1234195b296d0Smrg
1234295b296d0Smrg
12343d87a3195Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
12344d87a3195Smrg# --------------------------------------------------------------
12345d87a3195Smrgm4_define([lt_dict_filter],
12346d87a3195Smrg[m4_if([$5], [], [],
12347d87a3195Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
12348d87a3195Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
12349d87a3195Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
12350d87a3195Smrg])
12351eca46af7Smrg
12352d87a3195Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
12353d87a3195Smrg#
12354d87a3195Smrg#   Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
12355d87a3195Smrg#   Inc.
12356d87a3195Smrg#   Written by Scott James Remnant, 2004
12357d87a3195Smrg#
12358d87a3195Smrg# This file is free software; the Free Software Foundation gives
12359d87a3195Smrg# unlimited permission to copy and/or distribute it, with or without
12360d87a3195Smrg# modifications, as long as this notice is preserved.
1236195b296d0Smrg
12362d87a3195Smrg# @configure_input@
12363eca46af7Smrg
12364d87a3195Smrg# serial 4245 ltversion.m4
12365d87a3195Smrg# This file is part of GNU Libtool
12366eca46af7Smrg
12367d87a3195Smrgm4_define([LT_PACKAGE_VERSION], [2.4.7])
12368d87a3195Smrgm4_define([LT_PACKAGE_REVISION], [2.4.7])
12369eca46af7Smrg
12370d87a3195SmrgAC_DEFUN([LTVERSION_VERSION],
12371d87a3195Smrg[macro_version='2.4.7'
12372d87a3195Smrgmacro_revision='2.4.7'
12373d87a3195Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
12374d87a3195Smrg_LT_DECL(, macro_revision, 0)
12375d87a3195Smrg])
12376eca46af7Smrg
12377d87a3195Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
12378d87a3195Smrg#
12379d87a3195Smrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
12380d87a3195Smrg#   Software Foundation, Inc.
12381d87a3195Smrg#   Written by Scott James Remnant, 2004.
12382d87a3195Smrg#
12383d87a3195Smrg# This file is free software; the Free Software Foundation gives
12384d87a3195Smrg# unlimited permission to copy and/or distribute it, with or without
12385d87a3195Smrg# modifications, as long as this notice is preserved.
12386eca46af7Smrg
12387d87a3195Smrg# serial 5 lt~obsolete.m4
12388eca46af7Smrg
12389d87a3195Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
12390d87a3195Smrg#
12391d87a3195Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
12392d87a3195Smrg# which have later been changed to m4_define as they aren't part of the
12393d87a3195Smrg# exported API, or moved to Autoconf or Automake where they belong.
12394d87a3195Smrg#
12395d87a3195Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
12396d87a3195Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
12397d87a3195Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
12398d87a3195Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
12399d87a3195Smrg# and doesn't know about Autoconf macros at all.)
12400d87a3195Smrg#
12401d87a3195Smrg# So we provide this file, which has a silly filename so it's always
12402d87a3195Smrg# included after everything else.  This provides aclocal with the
12403d87a3195Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
12404d87a3195Smrg# because those macros already exist, or will be overwritten later.
12405d87a3195Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
12406d87a3195Smrg#
12407d87a3195Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
12408d87a3195Smrg# Yes, that means every name once taken will need to remain here until
12409d87a3195Smrg# we give up compatibility with versions before 1.7, at which point
12410d87a3195Smrg# we need to keep only those names which we still refer to.
12411eca46af7Smrg
12412d87a3195Smrg# This is to help aclocal find these macros, as it can't see m4_define.
12413d87a3195SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
12414eca46af7Smrg
12415d87a3195Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
12416d87a3195Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
12417d87a3195Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
12418d87a3195Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
12419d87a3195Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
12420d87a3195Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
12421d87a3195Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
12422d87a3195Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
12423d87a3195Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
12424d87a3195Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
12425d87a3195Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
12426d87a3195Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
12427d87a3195Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
12428d87a3195Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
12429d87a3195Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
12430d87a3195Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
12431d87a3195Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
12432d87a3195Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
12433d87a3195Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
12434d87a3195Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
12435d87a3195Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
12436d87a3195Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
12437d87a3195Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
12438d87a3195Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
12439d87a3195Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
12440d87a3195Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
12441d87a3195Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
12442d87a3195Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
12443d87a3195Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
12444d87a3195Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
12445d87a3195Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
12446d87a3195Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
12447d87a3195Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
12448d87a3195Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
12449d87a3195Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
12450d87a3195Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
12451d87a3195Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
12452d87a3195Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
12453d87a3195Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
12454d87a3195Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
12455d87a3195Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
12456d87a3195Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
12457d87a3195Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
12458d87a3195Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
12459d87a3195Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
12460d87a3195Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
12461d87a3195Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
12462d87a3195Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
12463d87a3195Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
12464d87a3195Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
12465d87a3195Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
12466d87a3195Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
12467d87a3195Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
12468d87a3195Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
12469d87a3195Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
12470d87a3195Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
12471d87a3195Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
12472d87a3195Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
12473d87a3195Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
12474d87a3195Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
12475d87a3195Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
1247695b296d0Smrg
12477