aclocal.m4 revision ee3e8c14
1ee3e8c14Smrg# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2d9dcd5aeSmrg
3ee3e8c14Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
4191cded7Smrg
5191cded7Smrg# This file is free software; the Free Software Foundation
6191cded7Smrg# gives unlimited permission to copy and/or distribute it,
7191cded7Smrg# with or without modifications, as long as this notice is preserved.
8191cded7Smrg
9191cded7Smrg# This program is distributed in the hope that it will be useful,
10191cded7Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11191cded7Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12191cded7Smrg# PARTICULAR PURPOSE.
13191cded7Smrg
14d9dcd5aeSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15b290cf36Smrgm4_ifndef([AC_AUTOCONF_VERSION],
16b290cf36Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17ee3e8c14Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
18ee3e8c14Smrg[m4_warning([this file was generated for autoconf 2.71.
19b290cf36SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20b290cf36SmrgIf you have problems, you may need to regenerate the build system entirely.
21d9dcd5aeSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22b290cf36Smrg
23ee3e8c14Smrg# Copyright (C) 2002-2021 Free Software Foundation, Inc.
24b290cf36Smrg#
25ba064abeSmrg# This file is free software; the Free Software Foundation
26ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
27ba064abeSmrg# with or without modifications, as long as this notice is preserved.
28ba064abeSmrg
29ba064abeSmrg# AM_AUTOMAKE_VERSION(VERSION)
30ba064abeSmrg# ----------------------------
31ba064abeSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32ba064abeSmrg# generated from the m4 files accompanying Automake X.Y.
33ba064abeSmrg# (This private macro should not be called outside this file.)
34ba064abeSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
35ee3e8c14Smrg[am__api_version='1.16'
36ba064abeSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37ba064abeSmrgdnl require some minimum version.  Point them to the right macro.
38ee3e8c14Smrgm4_if([$1], [1.16.5], [],
39ba064abeSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40ba064abeSmrg])
41ba064abeSmrg
42ba064abeSmrg# _AM_AUTOCONF_VERSION(VERSION)
43ba064abeSmrg# -----------------------------
44ba064abeSmrg# aclocal traces this macro to find the Autoconf version.
45ba064abeSmrg# This is a private macro too.  Using m4_define simplifies
46ba064abeSmrg# the logic in aclocal, which can simply ignore this definition.
47ba064abeSmrgm4_define([_AM_AUTOCONF_VERSION], [])
48ba064abeSmrg
49ba064abeSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50ba064abeSmrg# -------------------------------
51ba064abeSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52ba064abeSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53ba064abeSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54ee3e8c14Smrg[AM_AUTOMAKE_VERSION([1.16.5])dnl
55ba064abeSmrgm4_ifndef([AC_AUTOCONF_VERSION],
56ba064abeSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57ba064abeSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58ba064abeSmrg
59ba064abeSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60ba064abeSmrg
61ee3e8c14Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
62b290cf36Smrg#
63ba064abeSmrg# This file is free software; the Free Software Foundation
64ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
65ba064abeSmrg# with or without modifications, as long as this notice is preserved.
66b290cf36Smrg
67ba064abeSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68d9dcd5aeSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69d9dcd5aeSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70b290cf36Smrg#
71ba064abeSmrg# Of course, Automake must honor this variable whenever it calls a
72ba064abeSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73ba064abeSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74ba064abeSmrg# depending on how configure is run.  This is pretty annoying, since
75ba064abeSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76ba064abeSmrg# source directory, any form will work fine, but in subdirectories a
77ba064abeSmrg# relative path needs to be adjusted first.
78b290cf36Smrg#
79ba064abeSmrg# $ac_aux_dir/missing
80ba064abeSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81ba064abeSmrg# $top_srcdir/$ac_aux_dir/missing
82ba064abeSmrg#    fails if $ac_aux_dir is absolute,
83ba064abeSmrg#    fails when called from a subdirectory in a VPATH build with
84ba064abeSmrg#          a relative $ac_aux_dir
85b290cf36Smrg#
86ba064abeSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87ba064abeSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
88d9dcd5aeSmrg# harmless because $srcdir is '.', but things will broke when you
89ba064abeSmrg# start a VPATH build or use an absolute $srcdir.
90b290cf36Smrg#
91ba064abeSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92ba064abeSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93ba064abeSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94ba064abeSmrg# and then we would define $MISSING as
95ba064abeSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96ba064abeSmrg# This will work as long as MISSING is not called from configure, because
97ba064abeSmrg# unfortunately $(top_srcdir) has no meaning in configure.
98ba064abeSmrg# However there are other variables, like CC, which are often used in
99ba064abeSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
100b290cf36Smrg#
101ba064abeSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
102ba064abeSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
103ba064abeSmrg# configured tree to be moved without reconfiguration.
104191cded7Smrg
105ba064abeSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10658deefebSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
10758deefebSmrg# Expand $ac_aux_dir to an absolute path.
10858deefebSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
109b290cf36Smrg])
110b290cf36Smrg
111ba064abeSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112b290cf36Smrg
113ee3e8c14Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
114ba064abeSmrg#
115ba064abeSmrg# This file is free software; the Free Software Foundation
116ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
117ba064abeSmrg# with or without modifications, as long as this notice is preserved.
118191cded7Smrg
119ba064abeSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
120ba064abeSmrg# -------------------------------------
121ba064abeSmrg# Define a conditional.
122ba064abeSmrgAC_DEFUN([AM_CONDITIONAL],
123d9dcd5aeSmrg[AC_PREREQ([2.52])dnl
124d9dcd5aeSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
125d9dcd5aeSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
126ba064abeSmrgAC_SUBST([$1_TRUE])dnl
127ba064abeSmrgAC_SUBST([$1_FALSE])dnl
128ba064abeSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
129ba064abeSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
130ba064abeSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
131ba064abeSmrgif $2; then
132ba064abeSmrg  $1_TRUE=
133ba064abeSmrg  $1_FALSE='#'
134ba064abeSmrgelse
135ba064abeSmrg  $1_TRUE='#'
136ba064abeSmrg  $1_FALSE=
137ba064abeSmrgfi
138ba064abeSmrgAC_CONFIG_COMMANDS_PRE(
139ba064abeSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
140ba064abeSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
141ba064abeSmrgUsually this means the macro was only invoked conditionally.]])
142ba064abeSmrgfi])])
143191cded7Smrg
144ee3e8c14Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
145ba064abeSmrg#
146ba064abeSmrg# This file is free software; the Free Software Foundation
147ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
148ba064abeSmrg# with or without modifications, as long as this notice is preserved.
149b290cf36Smrg
150b290cf36Smrg
151d9dcd5aeSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
152ba064abeSmrg# written in clear, in which case automake, when reading aclocal.m4,
153ba064abeSmrg# will think it sees a *use*, and therefore will trigger all it's
154ba064abeSmrg# C support machinery.  Also note that it means that autoscan, seeing
155ba064abeSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
156b290cf36Smrg
157b290cf36Smrg
158ba064abeSmrg# _AM_DEPENDENCIES(NAME)
159b290cf36Smrg# ----------------------
160ba064abeSmrg# See how the compiler implements dependency checking.
161d9dcd5aeSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
162ba064abeSmrg# We try a few techniques and use that to set a single cache variable.
163ba064abeSmrg#
164ba064abeSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
165ba064abeSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
166ba064abeSmrg# dependency, and given that the user is not expected to run this macro,
167ba064abeSmrg# just rely on AC_PROG_CC.
168ba064abeSmrgAC_DEFUN([_AM_DEPENDENCIES],
169ba064abeSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
170ba064abeSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
171ba064abeSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
172ba064abeSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
173b290cf36Smrg
174d9dcd5aeSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
175d9dcd5aeSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
176d9dcd5aeSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
177d9dcd5aeSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
178d9dcd5aeSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
179d9dcd5aeSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
180d9dcd5aeSmrg                    [depcc="$$1"   am_compiler_list=])
181b290cf36Smrg
182ba064abeSmrgAC_CACHE_CHECK([dependency style of $depcc],
183ba064abeSmrg               [am_cv_$1_dependencies_compiler_type],
184ba064abeSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
185ba064abeSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
186ba064abeSmrg  # making bogus files that we don't know about and never remove.  For
187ba064abeSmrg  # instance it was reported that on HP-UX the gcc test will end up
188d9dcd5aeSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
189d9dcd5aeSmrg  # in D".
190d9dcd5aeSmrg  rm -rf conftest.dir
191ba064abeSmrg  mkdir conftest.dir
192ba064abeSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
193ba064abeSmrg  # using a relative directory.
194ba064abeSmrg  cp "$am_depcomp" conftest.dir
195ba064abeSmrg  cd conftest.dir
196ba064abeSmrg  # We will build objects and dependencies in a subdirectory because
197ba064abeSmrg  # it helps to detect inapplicable dependency modes.  For instance
198ba064abeSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
199ba064abeSmrg  # side effect of compilation, but ICC will put the dependencies in
200ba064abeSmrg  # the current directory while Tru64 will put them in the object
201ba064abeSmrg  # directory.
202ba064abeSmrg  mkdir sub
203191cded7Smrg
204ba064abeSmrg  am_cv_$1_dependencies_compiler_type=none
205ba064abeSmrg  if test "$am_compiler_list" = ""; then
206ba064abeSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
207191cded7Smrg  fi
208ba064abeSmrg  am__universal=false
209ba064abeSmrg  m4_case([$1], [CC],
210ba064abeSmrg    [case " $depcc " in #(
211ba064abeSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
212ba064abeSmrg     esac],
213ba064abeSmrg    [CXX],
214ba064abeSmrg    [case " $depcc " in #(
215ba064abeSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
216ba064abeSmrg     esac])
217191cded7Smrg
218ba064abeSmrg  for depmode in $am_compiler_list; do
219ba064abeSmrg    # Setup a source with many dependencies, because some compilers
220ba064abeSmrg    # like to wrap large dependency lists on column 80 (with \), and
221ba064abeSmrg    # we should not choose a depcomp mode which is confused by this.
222ba064abeSmrg    #
223ba064abeSmrg    # We need to recreate these files for each test, as the compiler may
224ba064abeSmrg    # overwrite some of them when testing with obscure command lines.
225ba064abeSmrg    # This happens at least with the AIX C compiler.
226ba064abeSmrg    : > sub/conftest.c
227ba064abeSmrg    for i in 1 2 3 4 5 6; do
228ba064abeSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
229d9dcd5aeSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
230d9dcd5aeSmrg      # Solaris 10 /bin/sh.
231d9dcd5aeSmrg      echo '/* dummy */' > sub/conftst$i.h
232ba064abeSmrg    done
233ba064abeSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
234191cded7Smrg
235d9dcd5aeSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
236ba064abeSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
237d9dcd5aeSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
238d9dcd5aeSmrg    # versions had trouble with output in subdirs.
239ba064abeSmrg    am__obj=sub/conftest.${OBJEXT-o}
240ba064abeSmrg    am__minus_obj="-o $am__obj"
241ba064abeSmrg    case $depmode in
242ba064abeSmrg    gcc)
243ba064abeSmrg      # This depmode causes a compiler race in universal mode.
244ba064abeSmrg      test "$am__universal" = false || continue
245ba064abeSmrg      ;;
246ba064abeSmrg    nosideeffect)
247d9dcd5aeSmrg      # After this tag, mechanisms are not by side-effect, so they'll
248d9dcd5aeSmrg      # only be used when explicitly requested.
249ba064abeSmrg      if test "x$enable_dependency_tracking" = xyes; then
250ba064abeSmrg	continue
251ba064abeSmrg      else
252ba064abeSmrg	break
253ba064abeSmrg      fi
254ba064abeSmrg      ;;
255d9dcd5aeSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
256d9dcd5aeSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
257ba064abeSmrg      # not run yet.  These depmodes are late enough in the game, and
258ba064abeSmrg      # so weak that their functioning should not be impacted.
259ba064abeSmrg      am__obj=conftest.${OBJEXT-o}
260ba064abeSmrg      am__minus_obj=
261ba064abeSmrg      ;;
262ba064abeSmrg    none) break ;;
263ba064abeSmrg    esac
264ba064abeSmrg    if depmode=$depmode \
265ba064abeSmrg       source=sub/conftest.c object=$am__obj \
266ba064abeSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
267ba064abeSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
268ba064abeSmrg         >/dev/null 2>conftest.err &&
269ba064abeSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
270ba064abeSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
271ba064abeSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
272ba064abeSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
273ba064abeSmrg      # icc doesn't choke on unknown options, it will just issue warnings
274ba064abeSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
275ba064abeSmrg      # that says an option was ignored or not supported.
276ba064abeSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
277ba064abeSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
278ba064abeSmrg      # The diagnosis changed in icc 8.0:
279ba064abeSmrg      #   icc: Command line remark: option '-MP' not supported
280ba064abeSmrg      if (grep 'ignoring option' conftest.err ||
281ba064abeSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
282ba064abeSmrg        am_cv_$1_dependencies_compiler_type=$depmode
283ba064abeSmrg        break
284ba064abeSmrg      fi
285ba064abeSmrg    fi
286ba064abeSmrg  done
287191cded7Smrg
288ba064abeSmrg  cd ..
289ba064abeSmrg  rm -rf conftest.dir
290ba064abeSmrgelse
291ba064abeSmrg  am_cv_$1_dependencies_compiler_type=none
292ba064abeSmrgfi
293ba064abeSmrg])
294ba064abeSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
295ba064abeSmrgAM_CONDITIONAL([am__fastdep$1], [
296ba064abeSmrg  test "x$enable_dependency_tracking" != xno \
297ba064abeSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
298ba064abeSmrg])
299191cded7Smrg
300191cded7Smrg
301ba064abeSmrg# AM_SET_DEPDIR
302ba064abeSmrg# -------------
303ba064abeSmrg# Choose a directory name for dependency files.
304d9dcd5aeSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
305ba064abeSmrgAC_DEFUN([AM_SET_DEPDIR],
306ba064abeSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
307ba064abeSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
308ba064abeSmrg])
309191cded7Smrg
310191cded7Smrg
311ba064abeSmrg# AM_DEP_TRACK
312ba064abeSmrg# ------------
313ba064abeSmrgAC_DEFUN([AM_DEP_TRACK],
314d9dcd5aeSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
315d9dcd5aeSmrgAS_HELP_STRING(
316d9dcd5aeSmrg  [--enable-dependency-tracking],
317d9dcd5aeSmrg  [do not reject slow dependency extractors])
318d9dcd5aeSmrgAS_HELP_STRING(
319d9dcd5aeSmrg  [--disable-dependency-tracking],
320d9dcd5aeSmrg  [speeds up one-time build])])
321ba064abeSmrgif test "x$enable_dependency_tracking" != xno; then
322ba064abeSmrg  am_depcomp="$ac_aux_dir/depcomp"
323ba064abeSmrg  AMDEPBACKSLASH='\'
324d9dcd5aeSmrg  am__nodep='_no'
325ba064abeSmrgfi
326ba064abeSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
327ba064abeSmrgAC_SUBST([AMDEPBACKSLASH])dnl
328ba064abeSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
329d9dcd5aeSmrgAC_SUBST([am__nodep])dnl
330d9dcd5aeSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
331ba064abeSmrg])
332191cded7Smrg
333ba064abeSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
334191cded7Smrg
335ee3e8c14Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
336ba064abeSmrg#
337ba064abeSmrg# This file is free software; the Free Software Foundation
338ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
339ba064abeSmrg# with or without modifications, as long as this notice is preserved.
340191cded7Smrg
341ba064abeSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
342b290cf36Smrg# ------------------------------
343ba064abeSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
344ba064abeSmrg[{
345d9dcd5aeSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
346ba064abeSmrg  # are listed without --file.  Let's play safe and only enable the eval
347ba064abeSmrg  # if we detect the quoting.
348ee3e8c14Smrg  # TODO: see whether this extra hack can be removed once we start
349ee3e8c14Smrg  # requiring Autoconf 2.70 or later.
350ee3e8c14Smrg  AS_CASE([$CONFIG_FILES],
351ee3e8c14Smrg          [*\'*], [eval set x "$CONFIG_FILES"],
352ee3e8c14Smrg          [*], [set x $CONFIG_FILES])
353ba064abeSmrg  shift
354ee3e8c14Smrg  # Used to flag and report bootstrapping failures.
355ee3e8c14Smrg  am_rc=0
356ee3e8c14Smrg  for am_mf
357ba064abeSmrg  do
358ba064abeSmrg    # Strip MF so we end up with the name of the file.
359ee3e8c14Smrg    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
360ee3e8c14Smrg    # Check whether this is an Automake generated Makefile which includes
361ee3e8c14Smrg    # dependency-tracking related rules and includes.
362ee3e8c14Smrg    # Grep'ing the whole file directly is not great: AIX grep has a line
363ba064abeSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
364ee3e8c14Smrg    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
365ee3e8c14Smrg      || continue
366ee3e8c14Smrg    am_dirpart=`AS_DIRNAME(["$am_mf"])`
367ee3e8c14Smrg    am_filepart=`AS_BASENAME(["$am_mf"])`
368ee3e8c14Smrg    AM_RUN_LOG([cd "$am_dirpart" \
369ee3e8c14Smrg      && sed -e '/# am--include-marker/d' "$am_filepart" \
370ee3e8c14Smrg        | $MAKE -f - am--depfiles]) || am_rc=$?
371ba064abeSmrg  done
372ee3e8c14Smrg  if test $am_rc -ne 0; then
373ee3e8c14Smrg    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
374ee3e8c14Smrg    for automatic dependency tracking.  If GNU make was not used, consider
375ee3e8c14Smrg    re-running the configure script with MAKE="gmake" (or whatever is
376ee3e8c14Smrg    necessary).  You can also try re-running configure with the
377ee3e8c14Smrg    '--disable-dependency-tracking' option to at least be able to build
378ee3e8c14Smrg    the package (albeit without support for automatic dependency tracking).])
379ee3e8c14Smrg  fi
380ee3e8c14Smrg  AS_UNSET([am_dirpart])
381ee3e8c14Smrg  AS_UNSET([am_filepart])
382ee3e8c14Smrg  AS_UNSET([am_mf])
383ee3e8c14Smrg  AS_UNSET([am_rc])
384ee3e8c14Smrg  rm -f conftest-deps.mk
385ba064abeSmrg}
386ba064abeSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
387b290cf36Smrg
388b290cf36Smrg
389ba064abeSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
390ba064abeSmrg# -----------------------------
391ba064abeSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
392ba064abeSmrg#
393ee3e8c14Smrg# This code is only required when automatic dependency tracking is enabled.
394ee3e8c14Smrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
395ee3e8c14Smrg# order to bootstrap the dependency handling code.
396ba064abeSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
397ba064abeSmrg[AC_CONFIG_COMMANDS([depfiles],
398ba064abeSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
399ee3e8c14Smrg     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
400191cded7Smrg
401ba064abeSmrg# Do all the work for Automake.                             -*- Autoconf -*-
402b290cf36Smrg
403ee3e8c14Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
404ba064abeSmrg#
405ba064abeSmrg# This file is free software; the Free Software Foundation
406ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
407ba064abeSmrg# with or without modifications, as long as this notice is preserved.
408b290cf36Smrg
409ba064abeSmrg# This macro actually does too much.  Some checks are only needed if
410ba064abeSmrg# your package does certain things.  But this isn't really a big deal.
411191cded7Smrg
41258deefebSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
41358deefebSmrgm4_define([AC_PROG_CC],
41458deefebSmrgm4_defn([AC_PROG_CC])
41558deefebSmrg[_AM_PROG_CC_C_O
41658deefebSmrg])
41758deefebSmrg
418ba064abeSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
419ba064abeSmrg# AM_INIT_AUTOMAKE([OPTIONS])
420ba064abeSmrg# -----------------------------------------------
421ba064abeSmrg# The call with PACKAGE and VERSION arguments is the old style
422ba064abeSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
423ba064abeSmrg# and VERSION should now be passed to AC_INIT and removed from
424ba064abeSmrg# the call to AM_INIT_AUTOMAKE.
425ba064abeSmrg# We support both call styles for the transition.  After
426ba064abeSmrg# the next Automake release, Autoconf can make the AC_INIT
427ba064abeSmrg# arguments mandatory, and then we can depend on a new Autoconf
428ba064abeSmrg# release and drop the old call support.
429ba064abeSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
430d9dcd5aeSmrg[AC_PREREQ([2.65])dnl
431ee3e8c14Smrgm4_ifdef([_$0_ALREADY_INIT],
432ee3e8c14Smrg  [m4_fatal([$0 expanded multiple times
433ee3e8c14Smrg]m4_defn([_$0_ALREADY_INIT]))],
434ee3e8c14Smrg  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
435ba064abeSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
436ba064abeSmrgdnl the ones we care about.
437ba064abeSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
438ba064abeSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
439ba064abeSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
440ba064abeSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
441ba064abeSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
442ba064abeSmrg  # is not polluted with repeated "-I."
443ba064abeSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
444ba064abeSmrg  # test to see if srcdir already configured
445ba064abeSmrg  if test -f $srcdir/config.status; then
446ba064abeSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
447ba064abeSmrg  fi
448ba064abeSmrgfi
449191cded7Smrg
450ba064abeSmrg# test whether we have cygpath
451ba064abeSmrgif test -z "$CYGPATH_W"; then
452ba064abeSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
453ba064abeSmrg    CYGPATH_W='cygpath -w'
454ba064abeSmrg  else
455ba064abeSmrg    CYGPATH_W=echo
456ba064abeSmrg  fi
457ba064abeSmrgfi
458ba064abeSmrgAC_SUBST([CYGPATH_W])
459191cded7Smrg
460ba064abeSmrg# Define the identity of the package.
461ba064abeSmrgdnl Distinguish between old-style and new-style calls.
462ba064abeSmrgm4_ifval([$2],
463d9dcd5aeSmrg[AC_DIAGNOSE([obsolete],
464d9dcd5aeSmrg             [$0: two- and three-arguments forms are deprecated.])
465d9dcd5aeSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
466ba064abeSmrg AC_SUBST([PACKAGE], [$1])dnl
467ba064abeSmrg AC_SUBST([VERSION], [$2])],
468ba064abeSmrg[_AM_SET_OPTIONS([$1])dnl
469ba064abeSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
470d9dcd5aeSmrgm4_if(
471ee3e8c14Smrg  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
472d9dcd5aeSmrg  [ok:ok],,
473ba064abeSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
474ba064abeSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
475ba064abeSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
476191cded7Smrg
477ba064abeSmrg_AM_IF_OPTION([no-define],,
478d9dcd5aeSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
479d9dcd5aeSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
480191cded7Smrg
481ba064abeSmrg# Some tools Automake needs.
482ba064abeSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
483ba064abeSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
484d9dcd5aeSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
485d9dcd5aeSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
486d9dcd5aeSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
487d9dcd5aeSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
488d9dcd5aeSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
489ba064abeSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
490ba064abeSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
491d9dcd5aeSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
492d9dcd5aeSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
493d9dcd5aeSmrg# dies out for good.  For more background, see:
494ee3e8c14Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
495ee3e8c14Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
496d9dcd5aeSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
49758deefebSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
49858deefebSmrg# system "awk" is bad on some platforms.
499ba064abeSmrgAC_REQUIRE([AC_PROG_AWK])dnl
500ba064abeSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
501ba064abeSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
502ba064abeSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
503ba064abeSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
504ba064abeSmrg			     [_AM_PROG_TAR([v7])])])
505ba064abeSmrg_AM_IF_OPTION([no-dependencies],,
506ba064abeSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
507d9dcd5aeSmrg		  [_AM_DEPENDENCIES([CC])],
508d9dcd5aeSmrg		  [m4_define([AC_PROG_CC],
509d9dcd5aeSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
510ba064abeSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
511d9dcd5aeSmrg		  [_AM_DEPENDENCIES([CXX])],
512d9dcd5aeSmrg		  [m4_define([AC_PROG_CXX],
513d9dcd5aeSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
514ba064abeSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
515d9dcd5aeSmrg		  [_AM_DEPENDENCIES([OBJC])],
516d9dcd5aeSmrg		  [m4_define([AC_PROG_OBJC],
517d9dcd5aeSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
518d9dcd5aeSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
519d9dcd5aeSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
520d9dcd5aeSmrg		  [m4_define([AC_PROG_OBJCXX],
521d9dcd5aeSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
522ba064abeSmrg])
523ee3e8c14Smrg# Variables for tags utilities; see am/tags.am
524ee3e8c14Smrgif test -z "$CTAGS"; then
525ee3e8c14Smrg  CTAGS=ctags
526ee3e8c14Smrgfi
527ee3e8c14SmrgAC_SUBST([CTAGS])
528ee3e8c14Smrgif test -z "$ETAGS"; then
529ee3e8c14Smrg  ETAGS=etags
530ee3e8c14Smrgfi
531ee3e8c14SmrgAC_SUBST([ETAGS])
532ee3e8c14Smrgif test -z "$CSCOPE"; then
533ee3e8c14Smrg  CSCOPE=cscope
534ee3e8c14Smrgfi
535ee3e8c14SmrgAC_SUBST([CSCOPE])
536ee3e8c14Smrg
537d9dcd5aeSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
538d9dcd5aeSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
539d9dcd5aeSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
540d9dcd5aeSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
541ba064abeSmrgAC_CONFIG_COMMANDS_PRE(dnl
542ba064abeSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
543ba064abeSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
54458deefebSmrg
54558deefebSmrg# POSIX will say in a future version that running "rm -f" with no argument
54658deefebSmrg# is OK; and we want to be able to make that assumption in our Makefile
54758deefebSmrg# recipes.  So use an aggressive probe to check that the usage we want is
54858deefebSmrg# actually supported "in the wild" to an acceptable degree.
54958deefebSmrg# See automake bug#10828.
55058deefebSmrg# To make any issue more visible, cause the running configure to be aborted
55158deefebSmrg# by default if the 'rm' program in use doesn't match our expectations; the
55258deefebSmrg# user can still override this though.
55358deefebSmrgif rm -f && rm -fr && rm -rf; then : OK; else
55458deefebSmrg  cat >&2 <<'END'
55558deefebSmrgOops!
55658deefebSmrg
55758deefebSmrgYour 'rm' program seems unable to run without file operands specified
55858deefebSmrgon the command line, even when the '-f' option is present.  This is contrary
55958deefebSmrgto the behaviour of most rm programs out there, and not conforming with
56058deefebSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
56158deefebSmrg
56258deefebSmrgPlease tell bug-automake@gnu.org about your system, including the value
56358deefebSmrgof your $PATH and any error possibly output before this message.  This
56458deefebSmrgcan help us improve future automake versions.
56558deefebSmrg
56658deefebSmrgEND
56758deefebSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
56858deefebSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
56958deefebSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
57058deefebSmrg    echo >&2
57158deefebSmrg  else
57258deefebSmrg    cat >&2 <<'END'
57358deefebSmrgAborting the configuration process, to ensure you take notice of the issue.
57458deefebSmrg
57558deefebSmrgYou can download and install GNU coreutils to get an 'rm' implementation
576ee3e8c14Smrgthat behaves properly: <https://www.gnu.org/software/coreutils/>.
57758deefebSmrg
57858deefebSmrgIf you want to complete the configuration process using your problematic
57958deefebSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
58058deefebSmrgto "yes", and re-run configure.
58158deefebSmrg
58258deefebSmrgEND
58358deefebSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
58458deefebSmrg  fi
58558deefebSmrgfi
58658deefebSmrgdnl The trailing newline in this macro's definition is deliberate, for
58758deefebSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
58858deefebSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
589b290cf36Smrg])
590191cded7Smrg
591d9dcd5aeSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
592ba064abeSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
593ba064abeSmrgdnl mangled by Autoconf and run in a shell conditional statement.
594ba064abeSmrgm4_define([_AC_COMPILER_EXEEXT],
595ba064abeSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
596191cded7Smrg
597ba064abeSmrg# When config.status generates a header, we must update the stamp-h file.
598ba064abeSmrg# This file resides in the same directory as the config header
599ba064abeSmrg# that is generated.  The stamp files are numbered to have different names.
600191cded7Smrg
601ba064abeSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
602ba064abeSmrg# loop where config.status creates the headers, so we can generate
603ba064abeSmrg# our stamp files there.
604ba064abeSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
605ba064abeSmrg[# Compute $1's index in $config_headers.
606ba064abeSmrg_am_arg=$1
607ba064abeSmrg_am_stamp_count=1
608ba064abeSmrgfor _am_header in $config_headers :; do
609ba064abeSmrg  case $_am_header in
610ba064abeSmrg    $_am_arg | $_am_arg:* )
611ba064abeSmrg      break ;;
612ba064abeSmrg    * )
613ba064abeSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
614ba064abeSmrg  esac
615ba064abeSmrgdone
616ba064abeSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
617191cded7Smrg
618ee3e8c14Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
619ba064abeSmrg#
620ba064abeSmrg# This file is free software; the Free Software Foundation
621ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
622ba064abeSmrg# with or without modifications, as long as this notice is preserved.
623191cded7Smrg
624ba064abeSmrg# AM_PROG_INSTALL_SH
625ba064abeSmrg# ------------------
626ba064abeSmrg# Define $install_sh.
627ba064abeSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
628ba064abeSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
62958deefebSmrgif test x"${install_sh+set}" != xset; then
630ba064abeSmrg  case $am_aux_dir in
631ba064abeSmrg  *\ * | *\	*)
632ba064abeSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
633ba064abeSmrg  *)
634ba064abeSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
635ba064abeSmrg  esac
636ba064abeSmrgfi
637d9dcd5aeSmrgAC_SUBST([install_sh])])
638191cded7Smrg
639ee3e8c14Smrg# Copyright (C) 2003-2021 Free Software Foundation, Inc.
640ba064abeSmrg#
641ba064abeSmrg# This file is free software; the Free Software Foundation
642ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
643ba064abeSmrg# with or without modifications, as long as this notice is preserved.
644191cded7Smrg
645ba064abeSmrg# Check whether the underlying file-system supports filenames
646ba064abeSmrg# with a leading dot.  For instance MS-DOS doesn't.
647ba064abeSmrgAC_DEFUN([AM_SET_LEADING_DOT],
648ba064abeSmrg[rm -rf .tst 2>/dev/null
649ba064abeSmrgmkdir .tst 2>/dev/null
650ba064abeSmrgif test -d .tst; then
651ba064abeSmrg  am__leading_dot=.
652ba064abeSmrgelse
653ba064abeSmrg  am__leading_dot=_
654ba064abeSmrgfi
655ba064abeSmrgrmdir .tst 2>/dev/null
656ba064abeSmrgAC_SUBST([am__leading_dot])])
657191cded7Smrg
658ba064abeSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
659ba064abeSmrg
660ee3e8c14Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
661b290cf36Smrg#
662ba064abeSmrg# This file is free software; the Free Software Foundation
663ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
664ba064abeSmrg# with or without modifications, as long as this notice is preserved.
665191cded7Smrg
666ba064abeSmrg# AM_MAKE_INCLUDE()
667ba064abeSmrg# -----------------
668ee3e8c14Smrg# Check whether make has an 'include' directive that can support all
669ee3e8c14Smrg# the idioms we need for our automatic dependency tracking code.
670ba064abeSmrgAC_DEFUN([AM_MAKE_INCLUDE],
671ee3e8c14Smrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
672ee3e8c14Smrgcat > confinc.mk << 'END'
673ba064abeSmrgam__doit:
674ee3e8c14Smrg	@echo this is the am__doit target >confinc.out
675ba064abeSmrg.PHONY: am__doit
676ba064abeSmrgEND
677ba064abeSmrgam__include="#"
678ba064abeSmrgam__quote=
679ee3e8c14Smrg# BSD make does it like this.
680ee3e8c14Smrgecho '.include "confinc.mk" # ignored' > confmf.BSD
681ee3e8c14Smrg# Other make implementations (GNU, Solaris 10, AIX) do it like this.
682ee3e8c14Smrgecho 'include confinc.mk # ignored' > confmf.GNU
683ee3e8c14Smrg_am_result=no
684ee3e8c14Smrgfor s in GNU BSD; do
685ee3e8c14Smrg  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
686ee3e8c14Smrg  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
687ee3e8c14Smrg      ['0:this is the am__doit target'],
688ee3e8c14Smrg      [AS_CASE([$s],
689ee3e8c14Smrg          [BSD], [am__include='.include' am__quote='"'],
690ee3e8c14Smrg          [am__include='include' am__quote=''])])
691ee3e8c14Smrg  if test "$am__include" != "#"; then
692ee3e8c14Smrg    _am_result="yes ($s style)"
693ee3e8c14Smrg    break
694ee3e8c14Smrg  fi
695ee3e8c14Smrgdone
696ee3e8c14Smrgrm -f confinc.* confmf.*
697ee3e8c14SmrgAC_MSG_RESULT([${_am_result}])
698ee3e8c14SmrgAC_SUBST([am__include])])
699ee3e8c14SmrgAC_SUBST([am__quote])])
700b290cf36Smrg
701ba064abeSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
702b290cf36Smrg
703ee3e8c14Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
704ba064abeSmrg#
705ba064abeSmrg# This file is free software; the Free Software Foundation
706ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
707ba064abeSmrg# with or without modifications, as long as this notice is preserved.
708b290cf36Smrg
709ba064abeSmrg# AM_MISSING_PROG(NAME, PROGRAM)
710b290cf36Smrg# ------------------------------
711ba064abeSmrgAC_DEFUN([AM_MISSING_PROG],
712ba064abeSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
713ba064abeSmrg$1=${$1-"${am_missing_run}$2"}
714ba064abeSmrgAC_SUBST($1)])
715b290cf36Smrg
716ba064abeSmrg# AM_MISSING_HAS_RUN
717ba064abeSmrg# ------------------
718d9dcd5aeSmrg# Define MISSING if not defined so far and test if it is modern enough.
719d9dcd5aeSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
720ba064abeSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
721ba064abeSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
722ba064abeSmrgAC_REQUIRE_AUX_FILE([missing])dnl
723ba064abeSmrgif test x"${MISSING+set}" != xset; then
724ee3e8c14Smrg  MISSING="\${SHELL} '$am_aux_dir/missing'"
725ba064abeSmrgfi
726ba064abeSmrg# Use eval to expand $SHELL
727d9dcd5aeSmrgif eval "$MISSING --is-lightweight"; then
728d9dcd5aeSmrg  am_missing_run="$MISSING "
729ba064abeSmrgelse
730ba064abeSmrg  am_missing_run=
731d9dcd5aeSmrg  AC_MSG_WARN(['missing' script is too old or missing])
732ba064abeSmrgfi
733ba064abeSmrg])
734b290cf36Smrg
735ba064abeSmrg# Helper functions for option handling.                     -*- Autoconf -*-
736191cded7Smrg
737ee3e8c14Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
738ba064abeSmrg#
739ba064abeSmrg# This file is free software; the Free Software Foundation
740ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
741ba064abeSmrg# with or without modifications, as long as this notice is preserved.
742b290cf36Smrg
743ba064abeSmrg# _AM_MANGLE_OPTION(NAME)
744ba064abeSmrg# -----------------------
745ba064abeSmrgAC_DEFUN([_AM_MANGLE_OPTION],
746ba064abeSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
747191cded7Smrg
748ba064abeSmrg# _AM_SET_OPTION(NAME)
749d9dcd5aeSmrg# --------------------
750ba064abeSmrg# Set option NAME.  Presently that only means defining a flag for this option.
751ba064abeSmrgAC_DEFUN([_AM_SET_OPTION],
752d9dcd5aeSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
753191cded7Smrg
754ba064abeSmrg# _AM_SET_OPTIONS(OPTIONS)
755d9dcd5aeSmrg# ------------------------
756ba064abeSmrg# OPTIONS is a space-separated list of Automake options.
757ba064abeSmrgAC_DEFUN([_AM_SET_OPTIONS],
758ba064abeSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
759191cded7Smrg
760ba064abeSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
761ba064abeSmrg# -------------------------------------------
762ba064abeSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
763ba064abeSmrgAC_DEFUN([_AM_IF_OPTION],
764ba064abeSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
765191cded7Smrg
766ee3e8c14Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
76758deefebSmrg#
76858deefebSmrg# This file is free software; the Free Software Foundation
76958deefebSmrg# gives unlimited permission to copy and/or distribute it,
77058deefebSmrg# with or without modifications, as long as this notice is preserved.
77158deefebSmrg
77258deefebSmrg# _AM_PROG_CC_C_O
77358deefebSmrg# ---------------
77458deefebSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
77558deefebSmrg# to automatically call this.
77658deefebSmrgAC_DEFUN([_AM_PROG_CC_C_O],
77758deefebSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
77858deefebSmrgAC_REQUIRE_AUX_FILE([compile])dnl
77958deefebSmrgAC_LANG_PUSH([C])dnl
78058deefebSmrgAC_CACHE_CHECK(
78158deefebSmrg  [whether $CC understands -c and -o together],
78258deefebSmrg  [am_cv_prog_cc_c_o],
78358deefebSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
78458deefebSmrg  # Make sure it works both with $CC and with simple cc.
78558deefebSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
78658deefebSmrg  # compilers refuse to overwrite an existing .o file with -o,
78758deefebSmrg  # though they will create one.
78858deefebSmrg  am_cv_prog_cc_c_o=yes
78958deefebSmrg  for am_i in 1 2; do
79058deefebSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
79158deefebSmrg         && test -f conftest2.$ac_objext; then
79258deefebSmrg      : OK
79358deefebSmrg    else
79458deefebSmrg      am_cv_prog_cc_c_o=no
79558deefebSmrg      break
79658deefebSmrg    fi
79758deefebSmrg  done
79858deefebSmrg  rm -f core conftest*
79958deefebSmrg  unset am_i])
80058deefebSmrgif test "$am_cv_prog_cc_c_o" != yes; then
80158deefebSmrg   # Losing compiler, so override with the script.
80258deefebSmrg   # FIXME: It is wrong to rewrite CC.
80358deefebSmrg   # But if we don't then we get into trouble of one sort or another.
80458deefebSmrg   # A longer-term fix would be to have automake use am__CC in this case,
80558deefebSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
80658deefebSmrg   CC="$am_aux_dir/compile $CC"
80758deefebSmrgfi
80858deefebSmrgAC_LANG_POP([C])])
80958deefebSmrg
81058deefebSmrg# For backward compatibility.
81158deefebSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
81258deefebSmrg
813ee3e8c14Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
81458deefebSmrg#
81558deefebSmrg# This file is free software; the Free Software Foundation
81658deefebSmrg# gives unlimited permission to copy and/or distribute it,
81758deefebSmrg# with or without modifications, as long as this notice is preserved.
81858deefebSmrg
81958deefebSmrg# AM_RUN_LOG(COMMAND)
82058deefebSmrg# -------------------
82158deefebSmrg# Run COMMAND, save the exit status in ac_status, and log it.
82258deefebSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
82358deefebSmrgAC_DEFUN([AM_RUN_LOG],
82458deefebSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
82558deefebSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
82658deefebSmrg   ac_status=$?
82758deefebSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
82858deefebSmrg   (exit $ac_status); }])
82958deefebSmrg
830ba064abeSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
831191cded7Smrg
832ee3e8c14Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
833ba064abeSmrg#
834ba064abeSmrg# This file is free software; the Free Software Foundation
835ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
836ba064abeSmrg# with or without modifications, as long as this notice is preserved.
837191cded7Smrg
838ba064abeSmrg# AM_SANITY_CHECK
839ba064abeSmrg# ---------------
840ba064abeSmrgAC_DEFUN([AM_SANITY_CHECK],
841ba064abeSmrg[AC_MSG_CHECKING([whether build environment is sane])
842ba064abeSmrg# Reject unsafe characters in $srcdir or the absolute working directory
843ba064abeSmrg# name.  Accept space and tab only in the latter.
844ba064abeSmrgam_lf='
845ba064abeSmrg'
846ba064abeSmrgcase `pwd` in
847ba064abeSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
848ba064abeSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
849ba064abeSmrgesac
850ba064abeSmrgcase $srcdir in
851ba064abeSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
852d9dcd5aeSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
853ba064abeSmrgesac
854b290cf36Smrg
855d9dcd5aeSmrg# Do 'set' in a subshell so we don't clobber the current shell's
856ba064abeSmrg# arguments.  Must try -L first in case configure is actually a
857ba064abeSmrg# symlink; some systems play weird games with the mod time of symlinks
858ba064abeSmrg# (eg FreeBSD returns the mod time of the symlink's containing
859ba064abeSmrg# directory).
860ba064abeSmrgif (
861d9dcd5aeSmrg   am_has_slept=no
862d9dcd5aeSmrg   for am_try in 1 2; do
863d9dcd5aeSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
864d9dcd5aeSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
865d9dcd5aeSmrg     if test "$[*]" = "X"; then
866d9dcd5aeSmrg	# -L didn't work.
867d9dcd5aeSmrg	set X `ls -t "$srcdir/configure" conftest.file`
868d9dcd5aeSmrg     fi
869d9dcd5aeSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
870d9dcd5aeSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
871d9dcd5aeSmrg
872d9dcd5aeSmrg	# If neither matched, then we have a broken ls.  This can happen
873d9dcd5aeSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
874d9dcd5aeSmrg	# broken ls alias from the environment.  This has actually
875d9dcd5aeSmrg	# happened.  Such a system could not be considered "sane".
876d9dcd5aeSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
877d9dcd5aeSmrg  alias in your environment])
878d9dcd5aeSmrg     fi
879d9dcd5aeSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
880d9dcd5aeSmrg       break
881d9dcd5aeSmrg     fi
882d9dcd5aeSmrg     # Just in case.
883d9dcd5aeSmrg     sleep 1
884d9dcd5aeSmrg     am_has_slept=yes
885d9dcd5aeSmrg   done
886ba064abeSmrg   test "$[2]" = conftest.file
887ba064abeSmrg   )
888ba064abeSmrgthen
889ba064abeSmrg   # Ok.
890ba064abeSmrg   :
891ba064abeSmrgelse
892ba064abeSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
893ba064abeSmrgCheck your system clock])
894b290cf36Smrgfi
895d9dcd5aeSmrgAC_MSG_RESULT([yes])
896d9dcd5aeSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
897d9dcd5aeSmrg# generated files are strictly newer.
898d9dcd5aeSmrgam_sleep_pid=
899d9dcd5aeSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
900d9dcd5aeSmrg  ( sleep 1 ) &
901d9dcd5aeSmrg  am_sleep_pid=$!
902d9dcd5aeSmrgfi
903d9dcd5aeSmrgAC_CONFIG_COMMANDS_PRE(
904d9dcd5aeSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
905d9dcd5aeSmrg   if test -n "$am_sleep_pid"; then
906d9dcd5aeSmrg     # Hide warnings about reused PIDs.
907d9dcd5aeSmrg     wait $am_sleep_pid 2>/dev/null
908d9dcd5aeSmrg   fi
909d9dcd5aeSmrg   AC_MSG_RESULT([done])])
910d9dcd5aeSmrgrm -f conftest.file
911d9dcd5aeSmrg])
912b290cf36Smrg
913ee3e8c14Smrg# Copyright (C) 2009-2021 Free Software Foundation, Inc.
914ba064abeSmrg#
915ba064abeSmrg# This file is free software; the Free Software Foundation
916ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
917ba064abeSmrg# with or without modifications, as long as this notice is preserved.
918191cded7Smrg
919ba064abeSmrg# AM_SILENT_RULES([DEFAULT])
920ba064abeSmrg# --------------------------
921ba064abeSmrg# Enable less verbose build rules; with the default set to DEFAULT
922d9dcd5aeSmrg# ("yes" being less verbose, "no" or empty being verbose).
923ba064abeSmrgAC_DEFUN([AM_SILENT_RULES],
924d9dcd5aeSmrg[AC_ARG_ENABLE([silent-rules], [dnl
925d9dcd5aeSmrgAS_HELP_STRING(
926d9dcd5aeSmrg  [--enable-silent-rules],
927d9dcd5aeSmrg  [less verbose build output (undo: "make V=1")])
928d9dcd5aeSmrgAS_HELP_STRING(
929d9dcd5aeSmrg  [--disable-silent-rules],
930d9dcd5aeSmrg  [verbose build output (undo: "make V=0")])dnl
931d9dcd5aeSmrg])
932d9dcd5aeSmrgcase $enable_silent_rules in @%:@ (((
933d9dcd5aeSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
934d9dcd5aeSmrg   no) AM_DEFAULT_VERBOSITY=1;;
935d9dcd5aeSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
936ba064abeSmrgesac
937d9dcd5aeSmrgdnl
938d9dcd5aeSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
939d9dcd5aeSmrgdnl do not support nested variable expansions.
940d9dcd5aeSmrgdnl See automake bug#9928 and bug#10237.
941d9dcd5aeSmrgam_make=${MAKE-make}
942d9dcd5aeSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
943d9dcd5aeSmrg   [am_cv_make_support_nested_variables],
944d9dcd5aeSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
945d9dcd5aeSmrgBAR0=false
946d9dcd5aeSmrgBAR1=true
947d9dcd5aeSmrgV=1
948d9dcd5aeSmrgam__doit:
949d9dcd5aeSmrg	@$(TRUE)
950d9dcd5aeSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
951d9dcd5aeSmrg  am_cv_make_support_nested_variables=yes
952d9dcd5aeSmrgelse
953d9dcd5aeSmrg  am_cv_make_support_nested_variables=no
954d9dcd5aeSmrgfi])
955d9dcd5aeSmrgif test $am_cv_make_support_nested_variables = yes; then
956d9dcd5aeSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
957d9dcd5aeSmrg  AM_V='$(V)'
958d9dcd5aeSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
959d9dcd5aeSmrgelse
960d9dcd5aeSmrg  AM_V=$AM_DEFAULT_VERBOSITY
961d9dcd5aeSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
962d9dcd5aeSmrgfi
963d9dcd5aeSmrgAC_SUBST([AM_V])dnl
964d9dcd5aeSmrgAM_SUBST_NOTMAKE([AM_V])dnl
965d9dcd5aeSmrgAC_SUBST([AM_DEFAULT_V])dnl
966d9dcd5aeSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
967ba064abeSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
968ba064abeSmrgAM_BACKSLASH='\'
969ba064abeSmrgAC_SUBST([AM_BACKSLASH])dnl
970ba064abeSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
971ba064abeSmrg])
972191cded7Smrg
973ee3e8c14Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
974b290cf36Smrg#
975ba064abeSmrg# This file is free software; the Free Software Foundation
976ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
977ba064abeSmrg# with or without modifications, as long as this notice is preserved.
978191cded7Smrg
979ba064abeSmrg# AM_PROG_INSTALL_STRIP
980ba064abeSmrg# ---------------------
981d9dcd5aeSmrg# One issue with vendor 'install' (even GNU) is that you can't
982ba064abeSmrg# specify the program used to strip binaries.  This is especially
983ba064abeSmrg# annoying in cross-compiling environments, where the build's strip
984ba064abeSmrg# is unlikely to handle the host's binaries.
985ba064abeSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
986d9dcd5aeSmrg# always use install-sh in "make install-strip", and initialize
987ba064abeSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
988ba064abeSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
989ba064abeSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
990d9dcd5aeSmrg# Installed binaries are usually stripped using 'strip' when the user
991d9dcd5aeSmrg# run "make install-strip".  However 'strip' might not be the right
992ba064abeSmrg# tool to use in cross-compilation environments, therefore Automake
993d9dcd5aeSmrg# will honor the 'STRIP' environment variable to overrule this program.
994d9dcd5aeSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
995ba064abeSmrgif test "$cross_compiling" != no; then
996ba064abeSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
997b290cf36Smrgfi
998ba064abeSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
999ba064abeSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1000191cded7Smrg
1001ee3e8c14Smrg# Copyright (C) 2006-2021 Free Software Foundation, Inc.
1002ba064abeSmrg#
1003ba064abeSmrg# This file is free software; the Free Software Foundation
1004ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
1005ba064abeSmrg# with or without modifications, as long as this notice is preserved.
1006191cded7Smrg
1007ba064abeSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
1008ba064abeSmrg# ---------------------------
1009ba064abeSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1010ba064abeSmrg# This macro is traced by Automake.
1011ba064abeSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1012191cded7Smrg
1013ba064abeSmrg# AM_SUBST_NOTMAKE(VARIABLE)
1014d9dcd5aeSmrg# --------------------------
1015ba064abeSmrg# Public sister of _AM_SUBST_NOTMAKE.
1016ba064abeSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1017191cded7Smrg
1018ba064abeSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1019191cded7Smrg
1020ee3e8c14Smrg# Copyright (C) 2004-2021 Free Software Foundation, Inc.
1021ba064abeSmrg#
1022ba064abeSmrg# This file is free software; the Free Software Foundation
1023ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
1024ba064abeSmrg# with or without modifications, as long as this notice is preserved.
1025191cded7Smrg
1026ba064abeSmrg# _AM_PROG_TAR(FORMAT)
1027ba064abeSmrg# --------------------
1028ba064abeSmrg# Check how to create a tarball in format FORMAT.
1029d9dcd5aeSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1030ba064abeSmrg#
1031ba064abeSmrg# Substitute a variable $(am__tar) that is a command
1032ba064abeSmrg# writing to stdout a FORMAT-tarball containing the directory
1033ba064abeSmrg# $tardir.
1034ba064abeSmrg#     tardir=directory && $(am__tar) > result.tar
1035ba064abeSmrg#
1036ba064abeSmrg# Substitute a variable $(am__untar) that extract such
1037ba064abeSmrg# a tarball read from stdin.
1038ba064abeSmrg#     $(am__untar) < result.tar
1039d9dcd5aeSmrg#
1040ba064abeSmrgAC_DEFUN([_AM_PROG_TAR],
1041d9dcd5aeSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1042d9dcd5aeSmrg# in the wild :-(  We should find a proper way to deprecate it ...
1043d9dcd5aeSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1044d9dcd5aeSmrg
1045d9dcd5aeSmrg# We'll loop over all known methods to create a tar archive until one works.
1046ba064abeSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1047191cded7Smrg
1048d9dcd5aeSmrgm4_if([$1], [v7],
1049d9dcd5aeSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1050d9dcd5aeSmrg
1051d9dcd5aeSmrg  [m4_case([$1],
1052d9dcd5aeSmrg    [ustar],
1053d9dcd5aeSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1054d9dcd5aeSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1055d9dcd5aeSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1056d9dcd5aeSmrg      # and bug#13588).
1057d9dcd5aeSmrg      am_max_uid=2097151 # 2^21 - 1
1058d9dcd5aeSmrg      am_max_gid=$am_max_uid
1059d9dcd5aeSmrg      # The $UID and $GID variables are not portable, so we need to resort
1060d9dcd5aeSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1061d9dcd5aeSmrg      # below are definitely unexpected, so allow the users to see them
1062d9dcd5aeSmrg      # (that is, avoid stderr redirection).
1063d9dcd5aeSmrg      am_uid=`id -u || echo unknown`
1064d9dcd5aeSmrg      am_gid=`id -g || echo unknown`
1065d9dcd5aeSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1066d9dcd5aeSmrg      if test $am_uid -le $am_max_uid; then
1067d9dcd5aeSmrg         AC_MSG_RESULT([yes])
1068d9dcd5aeSmrg      else
1069d9dcd5aeSmrg         AC_MSG_RESULT([no])
1070d9dcd5aeSmrg         _am_tools=none
1071d9dcd5aeSmrg      fi
1072d9dcd5aeSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1073d9dcd5aeSmrg      if test $am_gid -le $am_max_gid; then
1074d9dcd5aeSmrg         AC_MSG_RESULT([yes])
1075d9dcd5aeSmrg      else
1076d9dcd5aeSmrg        AC_MSG_RESULT([no])
1077d9dcd5aeSmrg        _am_tools=none
1078d9dcd5aeSmrg      fi],
1079d9dcd5aeSmrg
1080d9dcd5aeSmrg  [pax],
1081d9dcd5aeSmrg    [],
1082191cded7Smrg
1083d9dcd5aeSmrg  [m4_fatal([Unknown tar format])])
1084d9dcd5aeSmrg
1085d9dcd5aeSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
1086d9dcd5aeSmrg
1087d9dcd5aeSmrg  # Go ahead even if we have the value already cached.  We do so because we
1088d9dcd5aeSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
1089d9dcd5aeSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1090d9dcd5aeSmrg
1091d9dcd5aeSmrg  for _am_tool in $_am_tools; do
1092d9dcd5aeSmrg    case $_am_tool in
1093d9dcd5aeSmrg    gnutar)
1094d9dcd5aeSmrg      for _am_tar in tar gnutar gtar; do
1095d9dcd5aeSmrg        AM_RUN_LOG([$_am_tar --version]) && break
1096d9dcd5aeSmrg      done
1097d9dcd5aeSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1098d9dcd5aeSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1099d9dcd5aeSmrg      am__untar="$_am_tar -xf -"
1100d9dcd5aeSmrg      ;;
1101d9dcd5aeSmrg    plaintar)
1102d9dcd5aeSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
1103d9dcd5aeSmrg      # ustar tarball either.
1104d9dcd5aeSmrg      (tar --version) >/dev/null 2>&1 && continue
1105d9dcd5aeSmrg      am__tar='tar chf - "$$tardir"'
1106d9dcd5aeSmrg      am__tar_='tar chf - "$tardir"'
1107d9dcd5aeSmrg      am__untar='tar xf -'
1108d9dcd5aeSmrg      ;;
1109d9dcd5aeSmrg    pax)
1110d9dcd5aeSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
1111d9dcd5aeSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
1112d9dcd5aeSmrg      am__untar='pax -r'
1113d9dcd5aeSmrg      ;;
1114d9dcd5aeSmrg    cpio)
1115d9dcd5aeSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1116d9dcd5aeSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1117d9dcd5aeSmrg      am__untar='cpio -i -H $1 -d'
1118d9dcd5aeSmrg      ;;
1119d9dcd5aeSmrg    none)
1120d9dcd5aeSmrg      am__tar=false
1121d9dcd5aeSmrg      am__tar_=false
1122d9dcd5aeSmrg      am__untar=false
1123d9dcd5aeSmrg      ;;
1124d9dcd5aeSmrg    esac
1125d9dcd5aeSmrg
1126d9dcd5aeSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
1127d9dcd5aeSmrg    # and am__untar set.
1128d9dcd5aeSmrg    test -n "${am_cv_prog_tar_$1}" && break
1129d9dcd5aeSmrg
1130d9dcd5aeSmrg    # tar/untar a dummy directory, and stop if the command works.
1131d9dcd5aeSmrg    rm -rf conftest.dir
1132d9dcd5aeSmrg    mkdir conftest.dir
1133d9dcd5aeSmrg    echo GrepMe > conftest.dir/file
1134d9dcd5aeSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1135d9dcd5aeSmrg    rm -rf conftest.dir
1136d9dcd5aeSmrg    if test -s conftest.tar; then
1137d9dcd5aeSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
1138d9dcd5aeSmrg      AM_RUN_LOG([cat conftest.dir/file])
1139d9dcd5aeSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1140d9dcd5aeSmrg    fi
1141d9dcd5aeSmrg  done
1142ba064abeSmrg  rm -rf conftest.dir
1143191cded7Smrg
1144d9dcd5aeSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1145d9dcd5aeSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1146d9dcd5aeSmrg
1147ba064abeSmrgAC_SUBST([am__tar])
1148ba064abeSmrgAC_SUBST([am__untar])
1149ba064abeSmrg]) # _AM_PROG_TAR
1150b290cf36Smrg
1151ee3e8c14Smrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
1152ee3e8c14Smrgdnl serial 11 (pkg-config-0.29)
1153ee3e8c14Smrgdnl
1154ee3e8c14Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1155ee3e8c14Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
1156ee3e8c14Smrgdnl
1157ee3e8c14Smrgdnl This program is free software; you can redistribute it and/or modify
1158ee3e8c14Smrgdnl it under the terms of the GNU General Public License as published by
1159ee3e8c14Smrgdnl the Free Software Foundation; either version 2 of the License, or
1160ee3e8c14Smrgdnl (at your option) any later version.
1161ee3e8c14Smrgdnl
1162ee3e8c14Smrgdnl This program is distributed in the hope that it will be useful, but
1163ee3e8c14Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
1164ee3e8c14Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1165ee3e8c14Smrgdnl General Public License for more details.
1166ee3e8c14Smrgdnl
1167ee3e8c14Smrgdnl You should have received a copy of the GNU General Public License
1168ee3e8c14Smrgdnl along with this program; if not, write to the Free Software
1169ee3e8c14Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1170ee3e8c14Smrgdnl 02111-1307, USA.
1171ee3e8c14Smrgdnl
1172ee3e8c14Smrgdnl As a special exception to the GNU General Public License, if you
1173ee3e8c14Smrgdnl distribute this file as part of a program that contains a
1174ee3e8c14Smrgdnl configuration script generated by Autoconf, you may include it under
1175ee3e8c14Smrgdnl the same distribution terms that you use for the rest of that
1176ee3e8c14Smrgdnl program.
1177ee3e8c14Smrg
1178ee3e8c14Smrgdnl PKG_PREREQ(MIN-VERSION)
1179ee3e8c14Smrgdnl -----------------------
1180ee3e8c14Smrgdnl Since: 0.29
1181ee3e8c14Smrgdnl
1182ee3e8c14Smrgdnl Verify that the version of the pkg-config macros are at least
1183ee3e8c14Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
1184ee3e8c14Smrgdnl installed version of pkg-config, this checks the developer's version
1185ee3e8c14Smrgdnl of pkg.m4 when generating configure.
1186ee3e8c14Smrgdnl
1187ee3e8c14Smrgdnl To ensure that this macro is defined, also add:
1188ee3e8c14Smrgdnl m4_ifndef([PKG_PREREQ],
1189ee3e8c14Smrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
1190ee3e8c14Smrgdnl
1191ee3e8c14Smrgdnl See the "Since" comment for each macro you use to see what version
1192ee3e8c14Smrgdnl of the macros you require.
1193ee3e8c14Smrgm4_defun([PKG_PREREQ],
1194ee3e8c14Smrg[m4_define([PKG_MACROS_VERSION], [0.29])
1195ee3e8c14Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
1196ee3e8c14Smrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
1197ee3e8c14Smrg])dnl PKG_PREREQ
1198ee3e8c14Smrg
1199ee3e8c14Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
1200ee3e8c14Smrgdnl ----------------------------------
1201ee3e8c14Smrgdnl Since: 0.16
1202ee3e8c14Smrgdnl
1203ee3e8c14Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
1204ee3e8c14Smrgdnl first found in the path. Checks that the version of pkg-config found
1205ee3e8c14Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
1206ee3e8c14Smrgdnl used since that's the first version where most current features of
1207ee3e8c14Smrgdnl pkg-config existed.
1208ee3e8c14SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1209ee3e8c14Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1210ee3e8c14Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1211ee3e8c14Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1212ee3e8c14SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1213ee3e8c14SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1214ee3e8c14SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1215b290cf36Smrg
1216ee3e8c14Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1217ee3e8c14Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1218ee3e8c14Smrgfi
1219ee3e8c14Smrgif test -n "$PKG_CONFIG"; then
1220ee3e8c14Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
1221ee3e8c14Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1222ee3e8c14Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1223ee3e8c14Smrg		AC_MSG_RESULT([yes])
1224ee3e8c14Smrg	else
1225ee3e8c14Smrg		AC_MSG_RESULT([no])
1226ee3e8c14Smrg		PKG_CONFIG=""
1227ee3e8c14Smrg	fi
1228ee3e8c14Smrgfi[]dnl
1229ee3e8c14Smrg])dnl PKG_PROG_PKG_CONFIG
1230191cded7Smrg
1231ee3e8c14Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1232ee3e8c14Smrgdnl -------------------------------------------------------------------
1233ee3e8c14Smrgdnl Since: 0.18
1234ee3e8c14Smrgdnl
1235ee3e8c14Smrgdnl Check to see whether a particular set of modules exists. Similar to
1236ee3e8c14Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
1237ee3e8c14Smrgdnl
1238ee3e8c14Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1239ee3e8c14Smrgdnl only at the first occurence in configure.ac, so if the first place
1240ee3e8c14Smrgdnl it's called might be skipped (such as if it is within an "if", you
1241ee3e8c14Smrgdnl have to call PKG_CHECK_EXISTS manually
1242ee3e8c14SmrgAC_DEFUN([PKG_CHECK_EXISTS],
1243ee3e8c14Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1244ee3e8c14Smrgif test -n "$PKG_CONFIG" && \
1245ee3e8c14Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1246ee3e8c14Smrg  m4_default([$2], [:])
1247ee3e8c14Smrgm4_ifvaln([$3], [else
1248ee3e8c14Smrg  $3])dnl
1249ee3e8c14Smrgfi])
1250b290cf36Smrg
1251ee3e8c14Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1252ee3e8c14Smrgdnl ---------------------------------------------
1253ee3e8c14Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
1254ee3e8c14Smrgdnl pkg_failed based on the result.
1255ee3e8c14Smrgm4_define([_PKG_CONFIG],
1256ee3e8c14Smrg[if test -n "$$1"; then
1257ee3e8c14Smrg    pkg_cv_[]$1="$$1"
1258ee3e8c14Smrg elif test -n "$PKG_CONFIG"; then
1259ee3e8c14Smrg    PKG_CHECK_EXISTS([$3],
1260ee3e8c14Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1261ee3e8c14Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
1262ee3e8c14Smrg		     [pkg_failed=yes])
1263ee3e8c14Smrg else
1264ee3e8c14Smrg    pkg_failed=untried
1265ee3e8c14Smrgfi[]dnl
1266ee3e8c14Smrg])dnl _PKG_CONFIG
1267b290cf36Smrg
1268ee3e8c14Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED
1269ee3e8c14Smrgdnl ---------------------------
1270ee3e8c14Smrgdnl Internal check to see if pkg-config supports short errors.
1271ee3e8c14SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1272ee3e8c14Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1273ee3e8c14Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1274ee3e8c14Smrg        _pkg_short_errors_supported=yes
1275ee3e8c14Smrgelse
1276ee3e8c14Smrg        _pkg_short_errors_supported=no
1277ee3e8c14Smrgfi[]dnl
1278ee3e8c14Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
1279b290cf36Smrg
1280b290cf36Smrg
1281ee3e8c14Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1282ee3e8c14Smrgdnl   [ACTION-IF-NOT-FOUND])
1283ee3e8c14Smrgdnl --------------------------------------------------------------
1284ee3e8c14Smrgdnl Since: 0.4.0
1285ee3e8c14Smrgdnl
1286ee3e8c14Smrgdnl Note that if there is a possibility the first call to
1287ee3e8c14Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
1288ee3e8c14Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1289ee3e8c14SmrgAC_DEFUN([PKG_CHECK_MODULES],
1290ee3e8c14Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1291ee3e8c14SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1292ee3e8c14SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1293b290cf36Smrg
1294ee3e8c14Smrgpkg_failed=no
1295ee3e8c14SmrgAC_MSG_CHECKING([for $1])
1296b290cf36Smrg
1297ee3e8c14Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1298ee3e8c14Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1299191cded7Smrg
1300ee3e8c14Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1301ee3e8c14Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1302ee3e8c14SmrgSee the pkg-config man page for more details.])
1303191cded7Smrg
1304ee3e8c14Smrgif test $pkg_failed = yes; then
1305ee3e8c14Smrg   	AC_MSG_RESULT([no])
1306ee3e8c14Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1307ee3e8c14Smrg        if test $_pkg_short_errors_supported = yes; then
1308ee3e8c14Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1309ee3e8c14Smrg        else 
1310ee3e8c14Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1311ee3e8c14Smrg        fi
1312ee3e8c14Smrg	# Put the nasty error message in config.log where it belongs
1313ee3e8c14Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1314191cded7Smrg
1315ee3e8c14Smrg	m4_default([$4], [AC_MSG_ERROR(
1316ee3e8c14Smrg[Package requirements ($2) were not met:
1317191cded7Smrg
1318ee3e8c14Smrg$$1_PKG_ERRORS
1319191cded7Smrg
1320ee3e8c14SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1321ee3e8c14Smrginstalled software in a non-standard prefix.
1322191cded7Smrg
1323ee3e8c14Smrg_PKG_TEXT])[]dnl
1324ee3e8c14Smrg        ])
1325ee3e8c14Smrgelif test $pkg_failed = untried; then
1326ee3e8c14Smrg     	AC_MSG_RESULT([no])
1327ee3e8c14Smrg	m4_default([$4], [AC_MSG_FAILURE(
1328ee3e8c14Smrg[The pkg-config script could not be found or is too old.  Make sure it
1329ee3e8c14Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1330ee3e8c14Smrgpath to pkg-config.
1331ba064abeSmrg
1332ee3e8c14Smrg_PKG_TEXT
1333191cded7Smrg
1334ee3e8c14SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1335ee3e8c14Smrg        ])
1336ee3e8c14Smrgelse
1337ee3e8c14Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1338ee3e8c14Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1339ee3e8c14Smrg        AC_MSG_RESULT([yes])
1340ee3e8c14Smrg	$3
1341ee3e8c14Smrgfi[]dnl
1342ee3e8c14Smrg])dnl PKG_CHECK_MODULES
1343191cded7Smrg
1344191cded7Smrg
1345ee3e8c14Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1346ee3e8c14Smrgdnl   [ACTION-IF-NOT-FOUND])
1347ee3e8c14Smrgdnl ---------------------------------------------------------------------
1348ee3e8c14Smrgdnl Since: 0.29
1349ee3e8c14Smrgdnl
1350ee3e8c14Smrgdnl Checks for existence of MODULES and gathers its build flags with
1351ee3e8c14Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
1352ee3e8c14Smrgdnl and VARIABLE-PREFIX_LIBS from --libs.
1353ee3e8c14Smrgdnl
1354ee3e8c14Smrgdnl Note that if there is a possibility the first call to
1355ee3e8c14Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
1356ee3e8c14Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
1357ee3e8c14Smrgdnl configure.ac.
1358ee3e8c14SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
1359ee3e8c14Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1360ee3e8c14Smrg_save_PKG_CONFIG=$PKG_CONFIG
1361ee3e8c14SmrgPKG_CONFIG="$PKG_CONFIG --static"
1362ee3e8c14SmrgPKG_CHECK_MODULES($@)
1363ee3e8c14SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
1364ee3e8c14Smrg])dnl PKG_CHECK_MODULES_STATIC
1365191cded7Smrg
1366191cded7Smrg
1367ee3e8c14Smrgdnl PKG_INSTALLDIR([DIRECTORY])
1368ee3e8c14Smrgdnl -------------------------
1369ee3e8c14Smrgdnl Since: 0.27
1370ee3e8c14Smrgdnl
1371ee3e8c14Smrgdnl Substitutes the variable pkgconfigdir as the location where a module
1372ee3e8c14Smrgdnl should install pkg-config .pc files. By default the directory is
1373ee3e8c14Smrgdnl $libdir/pkgconfig, but the default can be changed by passing
1374ee3e8c14Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
1375ee3e8c14Smrgdnl parameter.
1376ee3e8c14SmrgAC_DEFUN([PKG_INSTALLDIR],
1377ee3e8c14Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1378ee3e8c14Smrgm4_pushdef([pkg_description],
1379ee3e8c14Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
1380ee3e8c14SmrgAC_ARG_WITH([pkgconfigdir],
1381ee3e8c14Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1382ee3e8c14Smrg    [with_pkgconfigdir=]pkg_default)
1383ee3e8c14SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1384ee3e8c14Smrgm4_popdef([pkg_default])
1385ee3e8c14Smrgm4_popdef([pkg_description])
1386ee3e8c14Smrg])dnl PKG_INSTALLDIR
1387ee3e8c14Smrg
1388ee3e8c14Smrg
1389ee3e8c14Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
1390ee3e8c14Smrgdnl --------------------------------
1391ee3e8c14Smrgdnl Since: 0.27
1392ee3e8c14Smrgdnl
1393ee3e8c14Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
1394ee3e8c14Smrgdnl module should install arch-independent pkg-config .pc files. By
1395ee3e8c14Smrgdnl default the directory is $datadir/pkgconfig, but the default can be
1396ee3e8c14Smrgdnl changed by passing DIRECTORY. The user can override through the
1397ee3e8c14Smrgdnl --with-noarch-pkgconfigdir parameter.
1398ee3e8c14SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
1399ee3e8c14Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
1400ee3e8c14Smrgm4_pushdef([pkg_description],
1401ee3e8c14Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1402ee3e8c14SmrgAC_ARG_WITH([noarch-pkgconfigdir],
1403ee3e8c14Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1404ee3e8c14Smrg    [with_noarch_pkgconfigdir=]pkg_default)
1405ee3e8c14SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
1406ee3e8c14Smrgm4_popdef([pkg_default])
1407ee3e8c14Smrgm4_popdef([pkg_description])
1408ee3e8c14Smrg])dnl PKG_NOARCH_INSTALLDIR
1409ee3e8c14Smrg
1410ee3e8c14Smrg
1411ee3e8c14Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1412ee3e8c14Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1413ee3e8c14Smrgdnl -------------------------------------------
1414ee3e8c14Smrgdnl Since: 0.28
1415ee3e8c14Smrgdnl
1416ee3e8c14Smrgdnl Retrieves the value of the pkg-config variable for the given module.
1417ee3e8c14SmrgAC_DEFUN([PKG_CHECK_VAR],
1418ee3e8c14Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1419ee3e8c14SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
1420191cded7Smrg
1421ee3e8c14Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
1422ee3e8c14SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
1423191cded7Smrg
1424ee3e8c14SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
1425ee3e8c14Smrg])dnl PKG_CHECK_VAR
1426191cded7Smrg
1427ee3e8c14Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1428d9dcd5aeSmrgdnl
1429ee3e8c14Smrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
1430d9dcd5aeSmrgdnl
1431ee3e8c14Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1432ee3e8c14Smrgdnl copy of this software and associated documentation files (the "Software"),
1433ee3e8c14Smrgdnl to deal in the Software without restriction, including without limitation
1434ee3e8c14Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1435ee3e8c14Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1436ee3e8c14Smrgdnl Software is furnished to do so, subject to the following conditions:
1437d9dcd5aeSmrgdnl
1438ee3e8c14Smrgdnl The above copyright notice and this permission notice (including the next
1439ee3e8c14Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1440ee3e8c14Smrgdnl Software.
1441d9dcd5aeSmrgdnl
1442ee3e8c14Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1443ee3e8c14Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1444ee3e8c14Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1445ee3e8c14Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1446ee3e8c14Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1447ee3e8c14Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1448ee3e8c14Smrgdnl DEALINGS IN THE SOFTWARE.
1449191cded7Smrg
1450ee3e8c14Smrg# XORG_MACROS_VERSION(required-version)
1451ee3e8c14Smrg# -------------------------------------
1452ee3e8c14Smrg# Minimum version: 1.1.0
1453ee3e8c14Smrg#
1454ee3e8c14Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1455ee3e8c14Smrg# your configure.ac with the minimum required version, such as:
1456ee3e8c14Smrg# XORG_MACROS_VERSION(1.1)
1457ee3e8c14Smrg#
1458ee3e8c14Smrg# To ensure that this macro is defined, also add:
1459ee3e8c14Smrg# m4_ifndef([XORG_MACROS_VERSION],
1460ee3e8c14Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1461ee3e8c14Smrg#
1462ee3e8c14Smrg#
1463ee3e8c14Smrg# See the "minimum version" comment for each macro you use to see what
1464ee3e8c14Smrg# version you require.
1465ee3e8c14Smrgm4_defun([XORG_MACROS_VERSION],[
1466ee3e8c14Smrgm4_define([vers_have], [1.19.3])
1467ee3e8c14Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1468ee3e8c14Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1469ee3e8c14Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1470ee3e8c14Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1471ee3e8c14Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1472ee3e8c14Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1473ee3e8c14Smrgm4_undefine([vers_have])
1474ee3e8c14Smrgm4_undefine([maj_have])
1475ee3e8c14Smrgm4_undefine([maj_needed])
1476ee3e8c14Smrg]) # XORG_MACROS_VERSION
1477191cded7Smrg
1478ee3e8c14Smrg# XORG_PROG_RAWCPP()
1479ee3e8c14Smrg# ------------------
1480ee3e8c14Smrg# Minimum version: 1.0.0
1481ee3e8c14Smrg#
1482ee3e8c14Smrg# Find cpp program and necessary flags for use in pre-processing text files
1483ee3e8c14Smrg# such as man pages and config files
1484ee3e8c14SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1485ee3e8c14SmrgAC_REQUIRE([AC_PROG_CPP])
1486ee3e8c14SmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
1487ee3e8c14Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1488191cded7Smrg
1489ee3e8c14Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1490ee3e8c14Smrg# which is not the best choice for supporting other OS'es, but covers most
1491ee3e8c14Smrg# of the ones we need for now.
1492ee3e8c14SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1493ee3e8c14SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1494ee3e8c14Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1495ee3e8c14Smrg	AC_MSG_RESULT([no])
1496ee3e8c14Smrgelse
1497ee3e8c14Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1498ee3e8c14Smrg		RAWCPPFLAGS=-undef
1499ee3e8c14Smrg		AC_MSG_RESULT([yes])
1500ee3e8c14Smrg	# under Cygwin unix is still defined even with -undef
1501ee3e8c14Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1502ee3e8c14Smrg		RAWCPPFLAGS="-undef -ansi"
1503ee3e8c14Smrg		AC_MSG_RESULT([yes, with -ansi])
1504ee3e8c14Smrg	else
1505ee3e8c14Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1506ee3e8c14Smrg	fi
1507ee3e8c14Smrgfi
1508ee3e8c14Smrgrm -f conftest.$ac_ext
1509191cded7Smrg
1510ee3e8c14SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1511ee3e8c14SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
1512ee3e8c14Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1513ee3e8c14Smrg	AC_MSG_RESULT([no])
1514ee3e8c14Smrgelse
1515ee3e8c14Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1516ee3e8c14Smrg		TRADITIONALCPPFLAGS="-traditional"
1517ee3e8c14Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1518ee3e8c14Smrg		AC_MSG_RESULT([yes])
1519ee3e8c14Smrg	else
1520ee3e8c14Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1521ee3e8c14Smrg	fi
1522ee3e8c14Smrgfi
1523ee3e8c14Smrgrm -f conftest.$ac_ext
1524ee3e8c14SmrgAC_SUBST(RAWCPPFLAGS)
1525ee3e8c14SmrgAC_SUBST(TRADITIONALCPPFLAGS)
1526ee3e8c14Smrg]) # XORG_PROG_RAWCPP
1527191cded7Smrg
1528ee3e8c14Smrg# XORG_MANPAGE_SECTIONS()
1529ee3e8c14Smrg# -----------------------
1530ee3e8c14Smrg# Minimum version: 1.0.0
1531ee3e8c14Smrg#
1532ee3e8c14Smrg# Determine which sections man pages go in for the different man page types
1533ee3e8c14Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1534ee3e8c14Smrg# Not sure if there's any better way than just hardcoding by OS name.
1535ee3e8c14Smrg# Override default settings by setting environment variables
1536ee3e8c14Smrg# Added MAN_SUBSTS in version 1.8
1537ee3e8c14Smrg# Added AC_PROG_SED in version 1.8
1538191cded7Smrg
1539ee3e8c14SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1540ee3e8c14SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1541ee3e8c14SmrgAC_REQUIRE([AC_PROG_SED])
1542191cded7Smrg
1543ee3e8c14Smrgcase $host_os in
1544ee3e8c14Smrg    solaris*)
1545ee3e8c14Smrg        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
1546ee3e8c14Smrg        # check for a man page file found in later versions that use
1547ee3e8c14Smrg        # traditional section numbers instead
1548ee3e8c14Smrg        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
1549ee3e8c14Smrg                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
1550ee3e8c14Smrg        ;;
1551ee3e8c14Smrg    *) SYSV_MAN_SECTIONS=false ;;
1552d9dcd5aeSmrgesac
1553191cded7Smrg
1554ee3e8c14Smrgif test x$APP_MAN_SUFFIX = x    ; then
1555ee3e8c14Smrg    APP_MAN_SUFFIX=1
1556ee3e8c14Smrgfi
1557ee3e8c14Smrgif test x$APP_MAN_DIR = x    ; then
1558ee3e8c14Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1559ee3e8c14Smrgfi
1560b290cf36Smrg
1561ee3e8c14Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1562ee3e8c14Smrg    LIB_MAN_SUFFIX=3
1563ee3e8c14Smrgfi
1564ee3e8c14Smrgif test x$LIB_MAN_DIR = x    ; then
1565ee3e8c14Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1566ee3e8c14Smrgfi
1567191cded7Smrg
1568ee3e8c14Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1569ee3e8c14Smrg    case $SYSV_MAN_SECTIONS in
1570ee3e8c14Smrg	true)				FILE_MAN_SUFFIX=4  ;;
1571ee3e8c14Smrg	*)				FILE_MAN_SUFFIX=5  ;;
1572ee3e8c14Smrg    esac
1573ee3e8c14Smrgfi
1574ee3e8c14Smrgif test x$FILE_MAN_DIR = x    ; then
1575ee3e8c14Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1576ee3e8c14Smrgfi
1577ba064abeSmrg
1578ee3e8c14Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1579ee3e8c14Smrg    case $SYSV_MAN_SECTIONS in
1580ee3e8c14Smrg	true)				MISC_MAN_SUFFIX=5  ;;
1581ee3e8c14Smrg	*)				MISC_MAN_SUFFIX=7  ;;
1582ee3e8c14Smrg    esac
1583ee3e8c14Smrgfi
1584ee3e8c14Smrgif test x$MISC_MAN_DIR = x    ; then
1585ee3e8c14Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1586ee3e8c14Smrgfi
1587191cded7Smrg
1588ee3e8c14Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1589ee3e8c14Smrg    case $SYSV_MAN_SECTIONS in
1590ee3e8c14Smrg	true)				DRIVER_MAN_SUFFIX=7  ;;
1591ee3e8c14Smrg	*)				DRIVER_MAN_SUFFIX=4  ;;
1592ee3e8c14Smrg    esac
1593ee3e8c14Smrgfi
1594ee3e8c14Smrgif test x$DRIVER_MAN_DIR = x    ; then
1595ee3e8c14Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1596ee3e8c14Smrgfi
1597191cded7Smrg
1598ee3e8c14Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1599ee3e8c14Smrg    case $SYSV_MAN_SECTIONS in
1600ee3e8c14Smrg	true)				ADMIN_MAN_SUFFIX=1m ;;
1601ee3e8c14Smrg	*)				ADMIN_MAN_SUFFIX=8  ;;
1602ee3e8c14Smrg    esac
1603ee3e8c14Smrgfi
1604ee3e8c14Smrgif test x$ADMIN_MAN_DIR = x    ; then
1605ee3e8c14Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1606ee3e8c14Smrgfi
1607ba064abeSmrg
1608ba064abeSmrg
1609ee3e8c14SmrgAC_SUBST([APP_MAN_SUFFIX])
1610ee3e8c14SmrgAC_SUBST([LIB_MAN_SUFFIX])
1611ee3e8c14SmrgAC_SUBST([FILE_MAN_SUFFIX])
1612ee3e8c14SmrgAC_SUBST([MISC_MAN_SUFFIX])
1613ee3e8c14SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1614ee3e8c14SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1615ee3e8c14SmrgAC_SUBST([APP_MAN_DIR])
1616ee3e8c14SmrgAC_SUBST([LIB_MAN_DIR])
1617ee3e8c14SmrgAC_SUBST([FILE_MAN_DIR])
1618ee3e8c14SmrgAC_SUBST([MISC_MAN_DIR])
1619ee3e8c14SmrgAC_SUBST([DRIVER_MAN_DIR])
1620ee3e8c14SmrgAC_SUBST([ADMIN_MAN_DIR])
1621b290cf36Smrg
1622ee3e8c14SmrgXORG_MAN_PAGE="X Version 11"
1623ee3e8c14SmrgAC_SUBST([XORG_MAN_PAGE])
1624ee3e8c14SmrgMAN_SUBSTS="\
1625ee3e8c14Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1626ee3e8c14Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1627ee3e8c14Smrg	-e 's|__xservername__|Xorg|g' \
1628ee3e8c14Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1629ee3e8c14Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1630ee3e8c14Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1631ee3e8c14Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1632ee3e8c14Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1633ee3e8c14Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1634ee3e8c14Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1635ee3e8c14Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1636ee3e8c14Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1637ee3e8c14SmrgAC_SUBST([MAN_SUBSTS])
1638ba064abeSmrg
1639ee3e8c14Smrg]) # XORG_MANPAGE_SECTIONS
1640191cded7Smrg
1641ee3e8c14Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1642ee3e8c14Smrg# ------------------------
1643ee3e8c14Smrg# Minimum version: 1.7.0
1644ee3e8c14Smrg#
1645ee3e8c14Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1646ee3e8c14Smrg# provided by xorg-sgml-doctools, if installed.
1647ee3e8c14SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1648ee3e8c14SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1649ee3e8c14SmrgXORG_SGML_PATH=
1650ee3e8c14SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1651ee3e8c14Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1652ee3e8c14Smrg    [m4_ifval([$1],[:],
1653ee3e8c14Smrg        [if test x"$cross_compiling" != x"yes" ; then
1654ee3e8c14Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1655ee3e8c14Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1656ee3e8c14Smrg         fi])
1657ee3e8c14Smrg    ])
1658ba064abeSmrg
1659ee3e8c14Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1660ee3e8c14Smrg# the path and the name of the doc stylesheet
1661ee3e8c14Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1662ee3e8c14Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1663ee3e8c14Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1664ee3e8c14Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1665ee3e8c14Smrgelse
1666ee3e8c14Smrg   AC_MSG_RESULT([no])
1667ee3e8c14Smrgfi
1668b290cf36Smrg
1669ee3e8c14SmrgAC_SUBST(XORG_SGML_PATH)
1670ee3e8c14SmrgAC_SUBST(STYLESHEET_SRCDIR)
1671ee3e8c14SmrgAC_SUBST(XSL_STYLESHEET)
1672ee3e8c14SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1673ee3e8c14Smrg]) # XORG_CHECK_SGML_DOCTOOLS
1674191cded7Smrg
1675ee3e8c14Smrg# XORG_CHECK_LINUXDOC
1676ee3e8c14Smrg# -------------------
1677ee3e8c14Smrg# Minimum version: 1.0.0
1678ee3e8c14Smrg#
1679ee3e8c14Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1680ee3e8c14Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1681ee3e8c14Smrg# Whether or not the necessary tools and files are found can be checked
1682ee3e8c14Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1683ee3e8c14SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1684ee3e8c14SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1685ee3e8c14SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1686191cded7Smrg
1687ee3e8c14SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1688ba064abeSmrg
1689ee3e8c14SmrgAC_MSG_CHECKING([whether to build documentation])
1690b290cf36Smrg
1691ee3e8c14Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1692ee3e8c14Smrg   BUILDDOC=yes
1693ee3e8c14Smrgelse
1694ee3e8c14Smrg   BUILDDOC=no
1695ee3e8c14Smrgfi
1696ba064abeSmrg
1697ee3e8c14SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1698b290cf36Smrg
1699ee3e8c14SmrgAC_MSG_RESULT([$BUILDDOC])
1700ba064abeSmrg
1701ee3e8c14SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1702ba064abeSmrg
1703ee3e8c14Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1704ee3e8c14Smrg   BUILDPDFDOC=yes
1705ee3e8c14Smrgelse
1706ee3e8c14Smrg   BUILDPDFDOC=no
1707ee3e8c14Smrgfi
1708b290cf36Smrg
1709ee3e8c14SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1710b290cf36Smrg
1711ee3e8c14SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1712b290cf36Smrg
1713ee3e8c14SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1714ee3e8c14SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1715ee3e8c14SmrgMAKE_PDF="$PS2PDF"
1716ee3e8c14SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1717b290cf36Smrg
1718ee3e8c14SmrgAC_SUBST(MAKE_TEXT)
1719ee3e8c14SmrgAC_SUBST(MAKE_PS)
1720ee3e8c14SmrgAC_SUBST(MAKE_PDF)
1721ee3e8c14SmrgAC_SUBST(MAKE_HTML)
1722ee3e8c14Smrg]) # XORG_CHECK_LINUXDOC
1723b290cf36Smrg
1724ee3e8c14Smrg# XORG_CHECK_DOCBOOK
1725ee3e8c14Smrg# -------------------
1726ee3e8c14Smrg# Minimum version: 1.0.0
1727ee3e8c14Smrg#
1728ee3e8c14Smrg# Checks for the ability to build output formats from SGML DocBook source.
1729ee3e8c14Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1730ee3e8c14Smrg# indicates whether the necessary tools and files are found and, if set,
1731ee3e8c14Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1732ee3e8c14SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1733ee3e8c14SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1734191cded7Smrg
1735ee3e8c14SmrgBUILDTXTDOC=no
1736ee3e8c14SmrgBUILDPDFDOC=no
1737ee3e8c14SmrgBUILDPSDOC=no
1738ee3e8c14SmrgBUILDHTMLDOC=no
1739191cded7Smrg
1740ee3e8c14SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1741ee3e8c14SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1742ee3e8c14SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1743ee3e8c14SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1744b290cf36Smrg
1745ee3e8c14SmrgAC_MSG_CHECKING([whether to build text documentation])
1746ee3e8c14Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1747ee3e8c14Smrg   test x$BUILD_TXTDOC != xno; then
1748ee3e8c14Smrg	BUILDTXTDOC=yes
1749ee3e8c14Smrgfi
1750ee3e8c14SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1751ee3e8c14SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1752191cded7Smrg
1753ee3e8c14SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1754ee3e8c14Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1755ee3e8c14Smrg   test x$BUILD_PDFDOC != xno; then
1756ee3e8c14Smrg	BUILDPDFDOC=yes
1757ee3e8c14Smrgfi
1758ee3e8c14SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1759ee3e8c14SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1760191cded7Smrg
1761ee3e8c14SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1762ee3e8c14Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1763ee3e8c14Smrg   test x$BUILD_PSDOC != xno; then
1764ee3e8c14Smrg	BUILDPSDOC=yes
1765ee3e8c14Smrgfi
1766ee3e8c14SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1767ee3e8c14SmrgAC_MSG_RESULT([$BUILDPSDOC])
1768191cded7Smrg
1769ee3e8c14SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1770ee3e8c14Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1771ee3e8c14Smrg   test x$BUILD_HTMLDOC != xno; then
1772ee3e8c14Smrg	BUILDHTMLDOC=yes
1773ee3e8c14Smrgfi
1774ee3e8c14SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1775ee3e8c14SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1776191cded7Smrg
1777ee3e8c14SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1778ee3e8c14SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1779ee3e8c14SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1780ee3e8c14SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1781191cded7Smrg
1782ee3e8c14SmrgAC_SUBST(MAKE_TEXT)
1783ee3e8c14SmrgAC_SUBST(MAKE_PS)
1784ee3e8c14SmrgAC_SUBST(MAKE_PDF)
1785ee3e8c14SmrgAC_SUBST(MAKE_HTML)
1786ee3e8c14Smrg]) # XORG_CHECK_DOCBOOK
1787191cded7Smrg
1788ee3e8c14Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1789ee3e8c14Smrg# ----------------
1790ee3e8c14Smrg# Minimum version: 1.5.0
1791ee3e8c14Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1792ee3e8c14Smrg#
1793ee3e8c14Smrg# Documentation tools are not always available on all platforms and sometimes
1794ee3e8c14Smrg# not at the appropriate level. This macro enables a module to test for the
1795ee3e8c14Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1796ee3e8c14Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1797ee3e8c14Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1798ee3e8c14Smrg# --with-xmlto assumes 'auto'.
1799ee3e8c14Smrg#
1800ee3e8c14Smrg# Interface to module:
1801ee3e8c14Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1802ee3e8c14Smrg# XMLTO:	returns the path of the xmlto program found
1803ee3e8c14Smrg#		returns the path set by the user in the environment
1804ee3e8c14Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1805ee3e8c14Smrg#		'no' user instructs the module not to use xmlto
1806ee3e8c14Smrg#
1807ee3e8c14Smrg# Added in version 1.10.0
1808ee3e8c14Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1809ee3e8c14Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1810ee3e8c14Smrg#
1811ee3e8c14Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1812ee3e8c14Smrg#
1813ee3e8c14SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1814ee3e8c14SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1815ee3e8c14Smrgm4_define([_defopt], m4_default([$2], [auto]))
1816ee3e8c14SmrgAC_ARG_WITH(xmlto,
1817ee3e8c14Smrg	AS_HELP_STRING([--with-xmlto],
1818ee3e8c14Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1819ee3e8c14Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1820ee3e8c14Smrgm4_undefine([_defopt])
1821191cded7Smrg
1822ee3e8c14Smrgif test "x$use_xmlto" = x"auto"; then
1823ee3e8c14Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1824ee3e8c14Smrg   if test "x$XMLTO" = "x"; then
1825ee3e8c14Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1826ee3e8c14Smrg	have_xmlto=no
1827ee3e8c14Smrg   else
1828ee3e8c14Smrg        have_xmlto=yes
1829ee3e8c14Smrg   fi
1830ee3e8c14Smrgelif test "x$use_xmlto" = x"yes" ; then
1831ee3e8c14Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1832ee3e8c14Smrg   if test "x$XMLTO" = "x"; then
1833ee3e8c14Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1834ee3e8c14Smrg   fi
1835ee3e8c14Smrg   have_xmlto=yes
1836ee3e8c14Smrgelif test "x$use_xmlto" = x"no" ; then
1837ee3e8c14Smrg   if test "x$XMLTO" != "x"; then
1838ee3e8c14Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1839ee3e8c14Smrg   fi
1840ee3e8c14Smrg   have_xmlto=no
1841ee3e8c14Smrgelse
1842ee3e8c14Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1843ee3e8c14Smrgfi
1844b290cf36Smrg
1845ee3e8c14Smrg# Test for a minimum version of xmlto, if provided.
1846ee3e8c14Smrgm4_ifval([$1],
1847ee3e8c14Smrg[if test "$have_xmlto" = yes; then
1848ee3e8c14Smrg    # scrape the xmlto version
1849ee3e8c14Smrg    AC_MSG_CHECKING([the xmlto version])
1850ee3e8c14Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1851ee3e8c14Smrg    AC_MSG_RESULT([$xmlto_version])
1852ee3e8c14Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1853ee3e8c14Smrg        [if test "x$use_xmlto" = xauto; then
1854ee3e8c14Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1855ee3e8c14Smrg            have_xmlto=no
1856ee3e8c14Smrg        else
1857ee3e8c14Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1858ee3e8c14Smrg        fi])
1859ee3e8c14Smrgfi])
1860191cded7Smrg
1861ee3e8c14Smrg# Test for the ability of xmlto to generate a text target
1862ba064abeSmrg#
1863ee3e8c14Smrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
1864ee3e8c14Smrg# following test for empty XML docbook files.
1865ee3e8c14Smrg# For compatibility reasons use the following empty XML docbook file and if
1866ee3e8c14Smrg# it fails try it again with a non-empty XML file.
1867ee3e8c14Smrghave_xmlto_text=no
1868ee3e8c14Smrgcat > conftest.xml << "EOF"
1869ee3e8c14SmrgEOF
1870ee3e8c14SmrgAS_IF([test "$have_xmlto" = yes],
1871ee3e8c14Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1872ee3e8c14Smrg             [have_xmlto_text=yes],
1873ee3e8c14Smrg             [# Try it again with a non-empty XML file.
1874ee3e8c14Smrg              cat > conftest.xml << "EOF"
1875ee3e8c14Smrg<x></x>
1876ee3e8c14SmrgEOF
1877ee3e8c14Smrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1878ee3e8c14Smrg                    [have_xmlto_text=yes],
1879ee3e8c14Smrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
1880ee3e8c14Smrgrm -f conftest.xml
1881ee3e8c14SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1882ee3e8c14SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1883ee3e8c14Smrg]) # XORG_WITH_XMLTO
1884191cded7Smrg
1885ee3e8c14Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1886ee3e8c14Smrg# --------------------------------------------
1887ee3e8c14Smrg# Minimum version: 1.12.0
1888ee3e8c14Smrg# Minimum version for optional DEFAULT argument: 1.12.0
1889ba064abeSmrg#
1890ee3e8c14Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1891ee3e8c14Smrg# XML-based language used for the transformation of XML documents.
1892ee3e8c14Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1893ee3e8c14Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1894ee3e8c14Smrg# The XSLT processor is often used as a standalone tool for transformations.
1895ee3e8c14Smrg# It should not be assumed that this tool is used only to work with documnetation.
1896ee3e8c14Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1897ee3e8c14Smrg#
1898ee3e8c14Smrg# Interface to module:
1899ee3e8c14Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1900ee3e8c14Smrg# XSLTPROC:	 returns the path of the xsltproc program found
1901ee3e8c14Smrg#		 returns the path set by the user in the environment
1902ee3e8c14Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1903ee3e8c14Smrg#		  'no' user instructs the module not to use xsltproc
1904ee3e8c14Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
1905ee3e8c14Smrg#
1906ee3e8c14Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1907ee3e8c14Smrg#
1908ee3e8c14SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1909ee3e8c14SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1910ee3e8c14Smrg# Preserves the interface, should it be implemented later
1911ee3e8c14Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1912ee3e8c14Smrgm4_define([_defopt], m4_default([$2], [auto]))
1913ee3e8c14SmrgAC_ARG_WITH(xsltproc,
1914ee3e8c14Smrg	AS_HELP_STRING([--with-xsltproc],
1915ee3e8c14Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1916ee3e8c14Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1917ee3e8c14Smrgm4_undefine([_defopt])
1918191cded7Smrg
1919ee3e8c14Smrgif test "x$use_xsltproc" = x"auto"; then
1920ee3e8c14Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1921ee3e8c14Smrg   if test "x$XSLTPROC" = "x"; then
1922ee3e8c14Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1923ee3e8c14Smrg	have_xsltproc=no
1924ee3e8c14Smrg   else
1925ee3e8c14Smrg        have_xsltproc=yes
1926ee3e8c14Smrg   fi
1927ee3e8c14Smrgelif test "x$use_xsltproc" = x"yes" ; then
1928ee3e8c14Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1929ee3e8c14Smrg   if test "x$XSLTPROC" = "x"; then
1930ee3e8c14Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1931ee3e8c14Smrg   fi
1932ee3e8c14Smrg   have_xsltproc=yes
1933ee3e8c14Smrgelif test "x$use_xsltproc" = x"no" ; then
1934ee3e8c14Smrg   if test "x$XSLTPROC" != "x"; then
1935ee3e8c14Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1936ee3e8c14Smrg   fi
1937ee3e8c14Smrg   have_xsltproc=no
1938ee3e8c14Smrgelse
1939ee3e8c14Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1940ee3e8c14Smrgfi
1941191cded7Smrg
1942ee3e8c14SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1943ee3e8c14Smrg]) # XORG_WITH_XSLTPROC
1944191cded7Smrg
1945ee3e8c14Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1946ee3e8c14Smrg# ----------------------------------------
1947ee3e8c14Smrg# Minimum version: 1.15.0
1948ee3e8c14Smrg#
1949ee3e8c14Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
1950ee3e8c14Smrg# scanning arbitrary text files, extracting information from those text files,
1951ee3e8c14Smrg# and printing reports based on that information.
1952ee3e8c14Smrg#
1953ee3e8c14Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
1954ee3e8c14Smrg#
1955ee3e8c14Smrg# Interface to module:
1956ee3e8c14Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
1957ee3e8c14Smrg# PERL:	     returns the path of the perl program found
1958ee3e8c14Smrg#	     returns the path set by the user in the environment
1959ee3e8c14Smrg# --with-perl: 'yes' user instructs the module to use perl
1960ee3e8c14Smrg#	       'no' user instructs the module not to use perl
1961ee3e8c14Smrg# have_perl: returns yes if perl found in PATH or no
1962ee3e8c14Smrg#
1963ee3e8c14Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1964ee3e8c14Smrg#
1965ee3e8c14SmrgAC_DEFUN([XORG_WITH_PERL],[
1966ee3e8c14SmrgAC_ARG_VAR([PERL], [Path to perl command])
1967ee3e8c14Smrg# Preserves the interface, should it be implemented later
1968ee3e8c14Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1969ee3e8c14Smrgm4_define([_defopt], m4_default([$2], [auto]))
1970ee3e8c14SmrgAC_ARG_WITH(perl,
1971ee3e8c14Smrg	AS_HELP_STRING([--with-perl],
1972ee3e8c14Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1973ee3e8c14Smrg	   [use_perl=$withval], [use_perl=]_defopt)
1974ee3e8c14Smrgm4_undefine([_defopt])
1975191cded7Smrg
1976ee3e8c14Smrgif test "x$use_perl" = x"auto"; then
1977ee3e8c14Smrg   AC_PATH_PROG([PERL], [perl])
1978ee3e8c14Smrg   if test "x$PERL" = "x"; then
1979ee3e8c14Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1980ee3e8c14Smrg	have_perl=no
1981ee3e8c14Smrg   else
1982ee3e8c14Smrg        have_perl=yes
1983ee3e8c14Smrg   fi
1984ee3e8c14Smrgelif test "x$use_perl" = x"yes" ; then
1985ee3e8c14Smrg   AC_PATH_PROG([PERL], [perl])
1986ee3e8c14Smrg   if test "x$PERL" = "x"; then
1987ee3e8c14Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1988ee3e8c14Smrg   fi
1989ee3e8c14Smrg   have_perl=yes
1990ee3e8c14Smrgelif test "x$use_perl" = x"no" ; then
1991ee3e8c14Smrg   if test "x$PERL" != "x"; then
1992ee3e8c14Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1993ee3e8c14Smrg   fi
1994ee3e8c14Smrg   have_perl=no
1995ee3e8c14Smrgelse
1996ee3e8c14Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1997ee3e8c14Smrgfi
1998191cded7Smrg
1999ee3e8c14SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
2000ee3e8c14Smrg]) # XORG_WITH_PERL
2001191cded7Smrg
2002ee3e8c14Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
2003ee3e8c14Smrg# ----------------
2004ee3e8c14Smrg# Minimum version: 1.5.0
2005ee3e8c14Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2006ee3e8c14Smrg#
2007ee3e8c14Smrg# Documentation tools are not always available on all platforms and sometimes
2008ee3e8c14Smrg# not at the appropriate level. This macro enables a module to test for the
2009ee3e8c14Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2010ee3e8c14Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
2011ee3e8c14Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
2012ee3e8c14Smrg# --with-asciidoc assumes 'auto'.
2013ee3e8c14Smrg#
2014ee3e8c14Smrg# Interface to module:
2015ee3e8c14Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
2016ee3e8c14Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
2017ee3e8c14Smrg#		 returns the path set by the user in the environment
2018ee3e8c14Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
2019ee3e8c14Smrg#		  'no' user instructs the module not to use asciidoc
2020ee3e8c14Smrg#
2021ee3e8c14Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
2022ee3e8c14Smrg#
2023ee3e8c14SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
2024ee3e8c14SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
2025ee3e8c14Smrgm4_define([_defopt], m4_default([$2], [auto]))
2026ee3e8c14SmrgAC_ARG_WITH(asciidoc,
2027ee3e8c14Smrg	AS_HELP_STRING([--with-asciidoc],
2028ee3e8c14Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
2029ee3e8c14Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
2030ee3e8c14Smrgm4_undefine([_defopt])
2031191cded7Smrg
2032ee3e8c14Smrgif test "x$use_asciidoc" = x"auto"; then
2033ee3e8c14Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2034ee3e8c14Smrg   if test "x$ASCIIDOC" = "x"; then
2035ee3e8c14Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
2036ee3e8c14Smrg	have_asciidoc=no
2037ee3e8c14Smrg   else
2038ee3e8c14Smrg        have_asciidoc=yes
2039ee3e8c14Smrg   fi
2040ee3e8c14Smrgelif test "x$use_asciidoc" = x"yes" ; then
2041ee3e8c14Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2042ee3e8c14Smrg   if test "x$ASCIIDOC" = "x"; then
2043ee3e8c14Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
2044ee3e8c14Smrg   fi
2045ee3e8c14Smrg   have_asciidoc=yes
2046ee3e8c14Smrgelif test "x$use_asciidoc" = x"no" ; then
2047ee3e8c14Smrg   if test "x$ASCIIDOC" != "x"; then
2048ee3e8c14Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
2049ee3e8c14Smrg   fi
2050ee3e8c14Smrg   have_asciidoc=no
2051ee3e8c14Smrgelse
2052ee3e8c14Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
2053ee3e8c14Smrgfi
2054ee3e8c14Smrgm4_ifval([$1],
2055ee3e8c14Smrg[if test "$have_asciidoc" = yes; then
2056ee3e8c14Smrg    # scrape the asciidoc version
2057ee3e8c14Smrg    AC_MSG_CHECKING([the asciidoc version])
2058ee3e8c14Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
2059ee3e8c14Smrg    AC_MSG_RESULT([$asciidoc_version])
2060ee3e8c14Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
2061ee3e8c14Smrg        [if test "x$use_asciidoc" = xauto; then
2062ee3e8c14Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
2063ee3e8c14Smrg            have_asciidoc=no
2064ee3e8c14Smrg        else
2065ee3e8c14Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
2066ee3e8c14Smrg        fi])
2067ee3e8c14Smrgfi])
2068ee3e8c14SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
2069ee3e8c14Smrg]) # XORG_WITH_ASCIIDOC
2070191cded7Smrg
2071ee3e8c14Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
2072ee3e8c14Smrg# -------------------------------------------
2073ee3e8c14Smrg# Minimum version: 1.5.0
2074ee3e8c14Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2075ee3e8c14Smrg# Minimum version for optional DOT checking: 1.18.0
2076ee3e8c14Smrg#
2077ee3e8c14Smrg# Documentation tools are not always available on all platforms and sometimes
2078ee3e8c14Smrg# not at the appropriate level. This macro enables a module to test for the
2079ee3e8c14Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2080ee3e8c14Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
2081ee3e8c14Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
2082ee3e8c14Smrg# --with-doxygen assumes 'auto'.
2083ee3e8c14Smrg#
2084ee3e8c14Smrg# Interface to module:
2085ee3e8c14Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
2086ee3e8c14Smrg# DOXYGEN:	 returns the path of the doxygen program found
2087ee3e8c14Smrg#		 returns the path set by the user in the environment
2088ee3e8c14Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
2089ee3e8c14Smrg#		  'no' user instructs the module not to use doxygen
2090ee3e8c14Smrg#
2091ee3e8c14Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
2092ee3e8c14Smrg#
2093ee3e8c14SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
2094ee3e8c14SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
2095ee3e8c14SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
2096ee3e8c14Smrgm4_define([_defopt], m4_default([$2], [auto]))
2097ee3e8c14SmrgAC_ARG_WITH(doxygen,
2098ee3e8c14Smrg	AS_HELP_STRING([--with-doxygen],
2099ee3e8c14Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
2100ee3e8c14Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
2101ee3e8c14Smrgm4_undefine([_defopt])
2102191cded7Smrg
2103ee3e8c14Smrgif test "x$use_doxygen" = x"auto"; then
2104ee3e8c14Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2105ee3e8c14Smrg   if test "x$DOXYGEN" = "x"; then
2106ee3e8c14Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
2107ee3e8c14Smrg	have_doxygen=no
2108ee3e8c14Smrg   else
2109ee3e8c14Smrg        have_doxygen=yes
2110ee3e8c14Smrg   fi
2111ee3e8c14Smrgelif test "x$use_doxygen" = x"yes" ; then
2112ee3e8c14Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2113ee3e8c14Smrg   if test "x$DOXYGEN" = "x"; then
2114ee3e8c14Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
2115ee3e8c14Smrg   fi
2116ee3e8c14Smrg   have_doxygen=yes
2117ee3e8c14Smrgelif test "x$use_doxygen" = x"no" ; then
2118ee3e8c14Smrg   if test "x$DOXYGEN" != "x"; then
2119ee3e8c14Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
2120ee3e8c14Smrg   fi
2121ee3e8c14Smrg   have_doxygen=no
2122ee3e8c14Smrgelse
2123ee3e8c14Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
2124ee3e8c14Smrgfi
2125ee3e8c14Smrgm4_ifval([$1],
2126ee3e8c14Smrg[if test "$have_doxygen" = yes; then
2127ee3e8c14Smrg    # scrape the doxygen version
2128ee3e8c14Smrg    AC_MSG_CHECKING([the doxygen version])
2129ee3e8c14Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
2130ee3e8c14Smrg    AC_MSG_RESULT([$doxygen_version])
2131ee3e8c14Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
2132ee3e8c14Smrg        [if test "x$use_doxygen" = xauto; then
2133ee3e8c14Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
2134ee3e8c14Smrg            have_doxygen=no
2135ee3e8c14Smrg        else
2136ee3e8c14Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
2137ee3e8c14Smrg        fi])
2138ee3e8c14Smrgfi])
2139191cded7Smrg
2140ee3e8c14Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
2141ee3e8c14Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
2142ee3e8c14Smrgdnl 	HAVE_DOT = @HAVE_DOT@
2143ee3e8c14SmrgHAVE_DOT=no
2144ee3e8c14Smrgif test "x$have_doxygen" = "xyes"; then
2145ee3e8c14Smrg  AC_PATH_PROG([DOT], [dot])
2146ee3e8c14Smrg    if test "x$DOT" != "x"; then
2147ee3e8c14Smrg      HAVE_DOT=yes
2148ee3e8c14Smrg    fi
2149ee3e8c14Smrgfi
2150191cded7Smrg
2151ee3e8c14SmrgAC_SUBST([HAVE_DOT])
2152ee3e8c14SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
2153ee3e8c14SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
2154ee3e8c14Smrg]) # XORG_WITH_DOXYGEN
2155191cded7Smrg
2156ee3e8c14Smrg# XORG_WITH_GROFF([DEFAULT])
2157ee3e8c14Smrg# ----------------
2158ee3e8c14Smrg# Minimum version: 1.6.0
2159ee3e8c14Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2160ee3e8c14Smrg#
2161ee3e8c14Smrg# Documentation tools are not always available on all platforms and sometimes
2162ee3e8c14Smrg# not at the appropriate level. This macro enables a module to test for the
2163ee3e8c14Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2164ee3e8c14Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
2165ee3e8c14Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
2166ee3e8c14Smrg# --with-groff assumes 'auto'.
2167ee3e8c14Smrg#
2168ee3e8c14Smrg# Interface to module:
2169ee3e8c14Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
2170ee3e8c14Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
2171ee3e8c14Smrg# HAVE_GROFF_MS: the -ms macros package
2172ee3e8c14Smrg# GROFF:	 returns the path of the groff program found
2173ee3e8c14Smrg#		 returns the path set by the user in the environment
2174ee3e8c14Smrg# --with-groff:	 'yes' user instructs the module to use groff
2175ee3e8c14Smrg#		 'no' user instructs the module not to use groff
2176ee3e8c14Smrg#
2177ee3e8c14Smrg# Added in version 1.9.0:
2178ee3e8c14Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
2179ee3e8c14Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
2180ee3e8c14Smrg#		   psselect from the psutils package.
2181ee3e8c14Smrg#		   the ghostcript package. Refer to the grohtml man pages
2182ee3e8c14Smrg#
2183ee3e8c14Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
2184ee3e8c14Smrg#
2185ee3e8c14Smrg# OS and distros often splits groff in a basic and full package, the former
2186ee3e8c14Smrg# having the groff program and the later having devices, fonts and macros
2187ee3e8c14Smrg# Checking for the groff executable is not enough.
2188ee3e8c14Smrg#
2189ee3e8c14Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
2190ee3e8c14Smrg# unset HAVE_GROFF or GROFF env variables.
2191ee3e8c14Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
2192ee3e8c14Smrg#
2193ee3e8c14SmrgAC_DEFUN([XORG_WITH_GROFF],[
2194ee3e8c14SmrgAC_ARG_VAR([GROFF], [Path to groff command])
2195ee3e8c14Smrgm4_define([_defopt], m4_default([$1], [auto]))
2196ee3e8c14SmrgAC_ARG_WITH(groff,
2197ee3e8c14Smrg	AS_HELP_STRING([--with-groff],
2198ee3e8c14Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
2199ee3e8c14Smrg	   [use_groff=$withval], [use_groff=]_defopt)
2200ee3e8c14Smrgm4_undefine([_defopt])
2201191cded7Smrg
2202ee3e8c14Smrgif test "x$use_groff" = x"auto"; then
2203ee3e8c14Smrg   AC_PATH_PROG([GROFF], [groff])
2204ee3e8c14Smrg   if test "x$GROFF" = "x"; then
2205ee3e8c14Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
2206ee3e8c14Smrg	have_groff=no
2207ee3e8c14Smrg   else
2208ee3e8c14Smrg        have_groff=yes
2209ee3e8c14Smrg   fi
2210ee3e8c14Smrgelif test "x$use_groff" = x"yes" ; then
2211ee3e8c14Smrg   AC_PATH_PROG([GROFF], [groff])
2212ee3e8c14Smrg   if test "x$GROFF" = "x"; then
2213ee3e8c14Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2214ee3e8c14Smrg   fi
2215ee3e8c14Smrg   have_groff=yes
2216ee3e8c14Smrgelif test "x$use_groff" = x"no" ; then
2217ee3e8c14Smrg   if test "x$GROFF" != "x"; then
2218ee3e8c14Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2219ee3e8c14Smrg   fi
2220ee3e8c14Smrg   have_groff=no
2221ee3e8c14Smrgelse
2222ee3e8c14Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
2223ee3e8c14Smrgfi
2224ba064abeSmrg
2225ee3e8c14Smrg# We have groff, test for the presence of the macro packages
2226ee3e8c14Smrgif test "x$have_groff" = x"yes"; then
2227ee3e8c14Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
2228ee3e8c14Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2229ee3e8c14Smrg        groff_ms_works=yes
2230ee3e8c14Smrg    else
2231ee3e8c14Smrg        groff_ms_works=no
2232ee3e8c14Smrg    fi
2233ee3e8c14Smrg    AC_MSG_RESULT([$groff_ms_works])
2234ee3e8c14Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
2235ee3e8c14Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2236ee3e8c14Smrg        groff_mm_works=yes
2237ee3e8c14Smrg    else
2238ee3e8c14Smrg        groff_mm_works=no
2239ee3e8c14Smrg    fi
2240ee3e8c14Smrg    AC_MSG_RESULT([$groff_mm_works])
2241ee3e8c14Smrgfi
2242191cded7Smrg
2243ee3e8c14Smrg# We have groff, test for HTML dependencies, one command per package
2244ee3e8c14Smrgif test "x$have_groff" = x"yes"; then
2245ee3e8c14Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2246ee3e8c14Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2247ee3e8c14Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
2248ee3e8c14Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2249ee3e8c14Smrg      have_groff_html=yes
2250ee3e8c14Smrg   else
2251ee3e8c14Smrg      have_groff_html=no
2252ee3e8c14Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2253ee3e8c14Smrg   fi
2254ee3e8c14Smrgfi
2255191cded7Smrg
2256ee3e8c14Smrg# Set Automake conditionals for Makefiles
2257ee3e8c14SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2258ee3e8c14SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2259ee3e8c14SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2260ee3e8c14SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2261ee3e8c14Smrg]) # XORG_WITH_GROFF
2262191cded7Smrg
2263ee3e8c14Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
2264ee3e8c14Smrg# ---------------------------------------
2265ee3e8c14Smrg# Minimum version: 1.6.0
2266ee3e8c14Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2267ee3e8c14Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
2268ee3e8c14Smrg#
2269ee3e8c14Smrg# Documentation tools are not always available on all platforms and sometimes
2270ee3e8c14Smrg# not at the appropriate level. This macro enables a module to test for the
2271ee3e8c14Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2272ee3e8c14Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
2273ee3e8c14Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
2274ee3e8c14Smrg# --with-fop assumes 'auto'.
2275ee3e8c14Smrg#
2276ee3e8c14Smrg# Interface to module:
2277ee3e8c14Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
2278ee3e8c14Smrg# FOP:	 	returns the path of the fop program found
2279ee3e8c14Smrg#		returns the path set by the user in the environment
2280ee3e8c14Smrg# --with-fop: 	'yes' user instructs the module to use fop
2281ee3e8c14Smrg#		'no' user instructs the module not to use fop
2282ee3e8c14Smrg#
2283ee3e8c14Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2284ee3e8c14Smrg#
2285ee3e8c14SmrgAC_DEFUN([XORG_WITH_FOP],[
2286ee3e8c14SmrgAC_ARG_VAR([FOP], [Path to fop command])
2287ee3e8c14Smrgm4_define([_defopt], m4_default([$2], [auto]))
2288ee3e8c14SmrgAC_ARG_WITH(fop,
2289ee3e8c14Smrg	AS_HELP_STRING([--with-fop],
2290ee3e8c14Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
2291ee3e8c14Smrg	   [use_fop=$withval], [use_fop=]_defopt)
2292ee3e8c14Smrgm4_undefine([_defopt])
2293191cded7Smrg
2294ee3e8c14Smrgif test "x$use_fop" = x"auto"; then
2295ee3e8c14Smrg   AC_PATH_PROG([FOP], [fop])
2296ee3e8c14Smrg   if test "x$FOP" = "x"; then
2297ee3e8c14Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
2298ee3e8c14Smrg	have_fop=no
2299ee3e8c14Smrg   else
2300ee3e8c14Smrg        have_fop=yes
2301ee3e8c14Smrg   fi
2302ee3e8c14Smrgelif test "x$use_fop" = x"yes" ; then
2303ee3e8c14Smrg   AC_PATH_PROG([FOP], [fop])
2304ee3e8c14Smrg   if test "x$FOP" = "x"; then
2305ee3e8c14Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2306ee3e8c14Smrg   fi
2307ee3e8c14Smrg   have_fop=yes
2308ee3e8c14Smrgelif test "x$use_fop" = x"no" ; then
2309ee3e8c14Smrg   if test "x$FOP" != "x"; then
2310ee3e8c14Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2311ee3e8c14Smrg   fi
2312ee3e8c14Smrg   have_fop=no
2313ee3e8c14Smrgelse
2314ee3e8c14Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
2315ee3e8c14Smrgfi
2316191cded7Smrg
2317ee3e8c14Smrg# Test for a minimum version of fop, if provided.
2318ee3e8c14Smrgm4_ifval([$1],
2319ee3e8c14Smrg[if test "$have_fop" = yes; then
2320ee3e8c14Smrg    # scrape the fop version
2321ee3e8c14Smrg    AC_MSG_CHECKING([for fop minimum version])
2322ee3e8c14Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2323ee3e8c14Smrg    AC_MSG_RESULT([$fop_version])
2324ee3e8c14Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
2325ee3e8c14Smrg        [if test "x$use_fop" = xauto; then
2326ee3e8c14Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2327ee3e8c14Smrg            have_fop=no
2328ee3e8c14Smrg        else
2329ee3e8c14Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2330ee3e8c14Smrg        fi])
2331ee3e8c14Smrgfi])
2332ee3e8c14SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2333ee3e8c14Smrg]) # XORG_WITH_FOP
2334191cded7Smrg
2335ee3e8c14Smrg# XORG_WITH_M4([MIN-VERSION])
2336ee3e8c14Smrg# ---------------------------
2337ee3e8c14Smrg# Minimum version: 1.19.0
2338ee3e8c14Smrg#
2339ee3e8c14Smrg# This macro attempts to locate an m4 macro processor which supports
2340ee3e8c14Smrg# -I option and is only useful for modules relying on M4 in order to
2341ee3e8c14Smrg# expand macros in source code files.
2342ee3e8c14Smrg#
2343ee3e8c14Smrg# Interface to module:
2344ee3e8c14Smrg# M4:	 	returns the path of the m4 program found
2345ee3e8c14Smrg#		returns the path set by the user in the environment
2346ee3e8c14Smrg#
2347ee3e8c14SmrgAC_DEFUN([XORG_WITH_M4], [
2348ee3e8c14SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
2349ee3e8c14Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
2350ee3e8c14Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
2351ee3e8c14Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
2352ee3e8c14Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
2353ee3e8c14Smrg   [$PATH:/usr/gnu/bin])])
2354191cded7Smrg
2355ee3e8c14SmrgAC_SUBST([M4], [$ac_cv_path_M4])
2356ee3e8c14Smrg]) # XORG_WITH_M4
2357ba064abeSmrg
2358ee3e8c14Smrg# XORG_WITH_PS2PDF([DEFAULT])
2359ee3e8c14Smrg# ----------------
2360ee3e8c14Smrg# Minimum version: 1.6.0
2361ee3e8c14Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2362ee3e8c14Smrg#
2363ee3e8c14Smrg# Documentation tools are not always available on all platforms and sometimes
2364ee3e8c14Smrg# not at the appropriate level. This macro enables a module to test for the
2365ee3e8c14Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2366ee3e8c14Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
2367ee3e8c14Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2368ee3e8c14Smrg# --with-ps2pdf assumes 'auto'.
2369ee3e8c14Smrg#
2370ee3e8c14Smrg# Interface to module:
2371ee3e8c14Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
2372ee3e8c14Smrg# PS2PDF:	returns the path of the ps2pdf program found
2373ee3e8c14Smrg#		returns the path set by the user in the environment
2374ee3e8c14Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2375ee3e8c14Smrg#		 'no' user instructs the module not to use ps2pdf
2376ee3e8c14Smrg#
2377ee3e8c14Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2378ee3e8c14Smrg#
2379ee3e8c14SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
2380ee3e8c14SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2381ee3e8c14Smrgm4_define([_defopt], m4_default([$1], [auto]))
2382ee3e8c14SmrgAC_ARG_WITH(ps2pdf,
2383ee3e8c14Smrg	AS_HELP_STRING([--with-ps2pdf],
2384ee3e8c14Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2385ee3e8c14Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2386ee3e8c14Smrgm4_undefine([_defopt])
2387ba064abeSmrg
2388ee3e8c14Smrgif test "x$use_ps2pdf" = x"auto"; then
2389ee3e8c14Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2390ee3e8c14Smrg   if test "x$PS2PDF" = "x"; then
2391ee3e8c14Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2392ee3e8c14Smrg	have_ps2pdf=no
2393ee3e8c14Smrg   else
2394ee3e8c14Smrg        have_ps2pdf=yes
2395ee3e8c14Smrg   fi
2396ee3e8c14Smrgelif test "x$use_ps2pdf" = x"yes" ; then
2397ee3e8c14Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2398ee3e8c14Smrg   if test "x$PS2PDF" = "x"; then
2399ee3e8c14Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2400ee3e8c14Smrg   fi
2401ee3e8c14Smrg   have_ps2pdf=yes
2402ee3e8c14Smrgelif test "x$use_ps2pdf" = x"no" ; then
2403ee3e8c14Smrg   if test "x$PS2PDF" != "x"; then
2404ee3e8c14Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2405ee3e8c14Smrg   fi
2406ee3e8c14Smrg   have_ps2pdf=no
2407ee3e8c14Smrgelse
2408ee3e8c14Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2409d9dcd5aeSmrgfi
2410ee3e8c14SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2411ee3e8c14Smrg]) # XORG_WITH_PS2PDF
2412ba064abeSmrg
2413ee3e8c14Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
2414ee3e8c14Smrg# ----------------
2415ee3e8c14Smrg# Minimum version: 1.6.0
2416ee3e8c14Smrg#
2417ee3e8c14Smrg# Documentation tools are not always available on all platforms and sometimes
2418ee3e8c14Smrg# not at the appropriate level. This macro enables a builder to skip all
2419ee3e8c14Smrg# documentation targets except traditional man pages.
2420ee3e8c14Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2421ee3e8c14Smrg# maximum flexibilty in controlling documentation building.
2422ee3e8c14Smrg# Refer to:
2423ee3e8c14Smrg# XORG_WITH_XMLTO         --with-xmlto
2424ee3e8c14Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2425ee3e8c14Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2426ee3e8c14Smrg# XORG_WITH_FOP           --with-fop
2427ee3e8c14Smrg# XORG_WITH_GROFF         --with-groff
2428ee3e8c14Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2429ee3e8c14Smrg#
2430ee3e8c14Smrg# Interface to module:
2431ee3e8c14Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
2432ee3e8c14Smrg# --enable-docs: 'yes' user instructs the module to generate docs
2433ee3e8c14Smrg#		 'no' user instructs the module not to generate docs
2434ee3e8c14Smrg# parm1:	specify the default value, yes or no.
2435ee3e8c14Smrg#
2436ee3e8c14SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
2437ee3e8c14Smrgm4_define([docs_default], m4_default([$1], [yes]))
2438ee3e8c14SmrgAC_ARG_ENABLE(docs,
2439ee3e8c14Smrg	AS_HELP_STRING([--enable-docs],
2440ee3e8c14Smrg	   [Enable building the documentation (default: ]docs_default[)]),
2441ee3e8c14Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
2442ee3e8c14Smrgm4_undefine([docs_default])
2443ee3e8c14SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2444ee3e8c14SmrgAC_MSG_CHECKING([whether to build documentation])
2445ee3e8c14SmrgAC_MSG_RESULT([$build_docs])
2446ee3e8c14Smrg]) # XORG_ENABLE_DOCS
2447ba064abeSmrg
2448ee3e8c14Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2449ee3e8c14Smrg# ----------------
2450ee3e8c14Smrg# Minimum version: 1.6.0
2451ee3e8c14Smrg#
2452ee3e8c14Smrg# This macro enables a builder to skip all developer documentation.
2453ee3e8c14Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2454ee3e8c14Smrg# maximum flexibilty in controlling documentation building.
2455ee3e8c14Smrg# Refer to:
2456ee3e8c14Smrg# XORG_WITH_XMLTO         --with-xmlto
2457ee3e8c14Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2458ee3e8c14Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2459ee3e8c14Smrg# XORG_WITH_FOP           --with-fop
2460ee3e8c14Smrg# XORG_WITH_GROFF         --with-groff
2461ee3e8c14Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2462ee3e8c14Smrg#
2463ee3e8c14Smrg# Interface to module:
2464ee3e8c14Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
2465ee3e8c14Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
2466ee3e8c14Smrg#			'no' user instructs the module not to generate developer docs
2467ee3e8c14Smrg# parm1:		specify the default value, yes or no.
2468ee3e8c14Smrg#
2469ee3e8c14SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2470ee3e8c14Smrgm4_define([devel_default], m4_default([$1], [yes]))
2471ee3e8c14SmrgAC_ARG_ENABLE(devel-docs,
2472ee3e8c14Smrg	AS_HELP_STRING([--enable-devel-docs],
2473ee3e8c14Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
2474ee3e8c14Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2475ee3e8c14Smrgm4_undefine([devel_default])
2476ee3e8c14SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2477ee3e8c14SmrgAC_MSG_CHECKING([whether to build developer documentation])
2478ee3e8c14SmrgAC_MSG_RESULT([$build_devel_docs])
2479ee3e8c14Smrg]) # XORG_ENABLE_DEVEL_DOCS
2480191cded7Smrg
2481ee3e8c14Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
2482ee3e8c14Smrg# ----------------
2483ee3e8c14Smrg# Minimum version: 1.6.0
2484ee3e8c14Smrg#
2485ee3e8c14Smrg# This macro enables a builder to skip all functional specification targets.
2486ee3e8c14Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2487ee3e8c14Smrg# maximum flexibilty in controlling documentation building.
2488ee3e8c14Smrg# Refer to:
2489ee3e8c14Smrg# XORG_WITH_XMLTO         --with-xmlto
2490ee3e8c14Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2491ee3e8c14Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2492ee3e8c14Smrg# XORG_WITH_FOP           --with-fop
2493ee3e8c14Smrg# XORG_WITH_GROFF         --with-groff
2494ee3e8c14Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2495ee3e8c14Smrg#
2496ee3e8c14Smrg# Interface to module:
2497ee3e8c14Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
2498ee3e8c14Smrg# --enable-specs:	'yes' user instructs the module to generate specs
2499ee3e8c14Smrg#			'no' user instructs the module not to generate specs
2500ee3e8c14Smrg# parm1:		specify the default value, yes or no.
2501ee3e8c14Smrg#
2502ee3e8c14SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
2503ee3e8c14Smrgm4_define([spec_default], m4_default([$1], [yes]))
2504ee3e8c14SmrgAC_ARG_ENABLE(specs,
2505ee3e8c14Smrg	AS_HELP_STRING([--enable-specs],
2506ee3e8c14Smrg	   [Enable building the specs (default: ]spec_default[)]),
2507ee3e8c14Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
2508ee3e8c14Smrgm4_undefine([spec_default])
2509ee3e8c14SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2510ee3e8c14SmrgAC_MSG_CHECKING([whether to build functional specifications])
2511ee3e8c14SmrgAC_MSG_RESULT([$build_specs])
2512ee3e8c14Smrg]) # XORG_ENABLE_SPECS
2513191cded7Smrg
2514ee3e8c14Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2515ee3e8c14Smrg# ----------------------------------------------
2516ee3e8c14Smrg# Minimum version: 1.13.0
2517d9dcd5aeSmrg#
2518ee3e8c14Smrg# This macro enables a builder to enable/disable unit testing
2519ee3e8c14Smrg# It makes no assumption about the test cases implementation
2520ee3e8c14Smrg# Test cases may or may not use Automake "Support for test suites"
2521ee3e8c14Smrg# They may or may not use the software utility library GLib
2522ee3e8c14Smrg#
2523ee3e8c14Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2524ee3e8c14Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2525ee3e8c14Smrg# The variable enable_unit_tests is used by other macros in this file.
2526ee3e8c14Smrg#
2527ee3e8c14Smrg# Interface to module:
2528ee3e8c14Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2529ee3e8c14Smrg# enable_unit_tests:    used in configure.ac for additional configuration
2530ee3e8c14Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
2531ee3e8c14Smrg#			'no' user instructs the module not to build tests
2532ee3e8c14Smrg# parm1:		specify the default value, yes or no.
2533ee3e8c14Smrg#
2534ee3e8c14SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2535ee3e8c14SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
2536ee3e8c14SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
2537ee3e8c14SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2538ee3e8c14Smrgm4_define([_defopt], m4_default([$1], [auto]))
2539ee3e8c14SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2540ee3e8c14Smrg	[Enable building unit test cases (default: ]_defopt[)]),
2541ee3e8c14Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2542ee3e8c14Smrgm4_undefine([_defopt])
2543ee3e8c14SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2544ee3e8c14SmrgAC_MSG_CHECKING([whether to build unit test cases])
2545ee3e8c14SmrgAC_MSG_RESULT([$enable_unit_tests])
2546ee3e8c14Smrg]) # XORG_ENABLE_UNIT_TESTS
2547191cded7Smrg
2548ee3e8c14Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2549ee3e8c14Smrg# ------------------------------------------------------
2550ee3e8c14Smrg# Minimum version: 1.17.0
2551ee3e8c14Smrg#
2552ee3e8c14Smrg# This macro enables a builder to enable/disable integration testing
2553ee3e8c14Smrg# It makes no assumption about the test cases' implementation
2554ee3e8c14Smrg# Test cases may or may not use Automake "Support for test suites"
2555ee3e8c14Smrg#
2556ee3e8c14Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2557ee3e8c14Smrg# usually requires less dependencies and may be built and run under less
2558ee3e8c14Smrg# stringent environments than integration tests.
2559ee3e8c14Smrg#
2560ee3e8c14Smrg# Interface to module:
2561ee3e8c14Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
2562ee3e8c14Smrg# enable_integration_tests:   used in configure.ac for additional configuration
2563ee3e8c14Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
2564ee3e8c14Smrg#                             'no' user instructs the module not to build tests
2565ee3e8c14Smrg# parm1:                      specify the default value, yes or no.
2566ee3e8c14Smrg#
2567ee3e8c14SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2568ee3e8c14SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2569ee3e8c14Smrgm4_define([_defopt], m4_default([$1], [auto]))
2570ee3e8c14SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2571ee3e8c14Smrg	[Enable building integration test cases (default: ]_defopt[)]),
2572ee3e8c14Smrg	[enable_integration_tests=$enableval],
2573ee3e8c14Smrg	[enable_integration_tests=]_defopt)
2574ee3e8c14Smrgm4_undefine([_defopt])
2575ee3e8c14SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2576ee3e8c14Smrg	[test "x$enable_integration_tests" != xno])
2577ee3e8c14SmrgAC_MSG_CHECKING([whether to build unit test cases])
2578ee3e8c14SmrgAC_MSG_RESULT([$enable_integration_tests])
2579ee3e8c14Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
2580b290cf36Smrg
2581ee3e8c14Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2582ee3e8c14Smrg# ----------------------------------------
2583ee3e8c14Smrg# Minimum version: 1.13.0
2584ee3e8c14Smrg#
2585ee3e8c14Smrg# GLib is a library which provides advanced data structures and functions.
2586ee3e8c14Smrg# This macro enables a module to test for the presence of Glib.
2587ee3e8c14Smrg#
2588ee3e8c14Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2589ee3e8c14Smrg# Otherwise the value of $enable_unit_tests is blank.
2590ee3e8c14Smrg#
2591ee3e8c14Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2592ee3e8c14Smrg# test support usually requires less dependencies and may be built and run under
2593ee3e8c14Smrg# less stringent environments than integration tests.
2594ee3e8c14Smrg#
2595ee3e8c14Smrg# Interface to module:
2596ee3e8c14Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
2597ee3e8c14Smrg# with_glib: used in configure.ac to know if GLib has been found
2598ee3e8c14Smrg# --with-glib:	'yes' user instructs the module to use glib
2599ee3e8c14Smrg#		'no' user instructs the module not to use glib
2600ee3e8c14Smrg#
2601ee3e8c14SmrgAC_DEFUN([XORG_WITH_GLIB],[
2602ee3e8c14SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2603ee3e8c14Smrgm4_define([_defopt], m4_default([$2], [auto]))
2604ee3e8c14SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2605ee3e8c14Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
2606ee3e8c14Smrg	[with_glib=$withval], [with_glib=]_defopt)
2607ee3e8c14Smrgm4_undefine([_defopt])
2608b290cf36Smrg
2609ee3e8c14Smrghave_glib=no
2610ee3e8c14Smrg# Do not probe GLib if user explicitly disabled unit testing
2611ee3e8c14Smrgif test "x$enable_unit_tests" != x"no"; then
2612ee3e8c14Smrg  # Do not probe GLib if user explicitly disabled it
2613ee3e8c14Smrg  if test "x$with_glib" != x"no"; then
2614ee3e8c14Smrg    m4_ifval(
2615ee3e8c14Smrg      [$1],
2616ee3e8c14Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2617ee3e8c14Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2618ee3e8c14Smrg    )
2619ee3e8c14Smrg  fi
2620d9dcd5aeSmrgfi
2621b290cf36Smrg
2622ee3e8c14Smrg# Not having GLib when unit testing has been explicitly requested is an error
2623ee3e8c14Smrgif test "x$enable_unit_tests" = x"yes"; then
2624ee3e8c14Smrg  if test "x$have_glib" = x"no"; then
2625ee3e8c14Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2626ee3e8c14Smrg  fi
2627ee3e8c14Smrgfi
2628b290cf36Smrg
2629ee3e8c14Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
2630ee3e8c14Smrgif test "x$enable_unit_tests" = x"no"; then
2631ee3e8c14Smrg  if test "x$with_glib" = x"yes"; then
2632ee3e8c14Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2633ee3e8c14Smrg  fi
2634ee3e8c14Smrgfi
2635b290cf36Smrg
2636ee3e8c14Smrg# Not having GLib when it has been explicitly requested is an error
2637ee3e8c14Smrgif test "x$with_glib" = x"yes"; then
2638ee3e8c14Smrg  if test "x$have_glib" = x"no"; then
2639ee3e8c14Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2640ee3e8c14Smrg  fi
2641ee3e8c14Smrgfi
2642191cded7Smrg
2643ee3e8c14SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2644ee3e8c14Smrg]) # XORG_WITH_GLIB
2645191cded7Smrg
2646ee3e8c14Smrg# XORG_LD_WRAP([required|optional])
2647ee3e8c14Smrg# ---------------------------------
2648ee3e8c14Smrg# Minimum version: 1.13.0
2649ee3e8c14Smrg#
2650ee3e8c14Smrg# Check if linker supports -wrap, passed via compiler flags
2651ee3e8c14Smrg#
2652ee3e8c14Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2653ee3e8c14Smrg# Otherwise the value of $enable_unit_tests is blank.
2654ee3e8c14Smrg#
2655ee3e8c14Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
2656ee3e8c14Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
2657ee3e8c14Smrg# available, an argument of "optional" allows use when some unit tests require
2658ee3e8c14Smrg# ld -wrap and others do not.
2659ee3e8c14Smrg#
2660ee3e8c14SmrgAC_DEFUN([XORG_LD_WRAP],[
2661ee3e8c14SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2662ee3e8c14Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
2663ee3e8c14Smrg                      void __wrap_exit(int status) { return; }],
2664ee3e8c14Smrg                     [exit(0);])])
2665ee3e8c14Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
2666ee3e8c14Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2667ee3e8c14Smrg  if test "x$have_ld_wrap" = x"no"; then
2668ee3e8c14Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2669ee3e8c14Smrg  fi
2670ee3e8c14Smrgfi
2671ee3e8c14SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2672ee3e8c14Smrg#
2673ee3e8c14Smrg]) # XORG_LD_WRAP
2674191cded7Smrg
2675ee3e8c14Smrg# XORG_CHECK_LINKER_FLAGS
2676ee3e8c14Smrg# -----------------------
2677ee3e8c14Smrg# SYNOPSIS
2678ee3e8c14Smrg#
2679ee3e8c14Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2680ee3e8c14Smrg#
2681ee3e8c14Smrg# DESCRIPTION
2682ee3e8c14Smrg#
2683ee3e8c14Smrg#   Check whether the given linker FLAGS work with the current language's
2684ee3e8c14Smrg#   linker, or whether they give an error.
2685ee3e8c14Smrg#
2686ee3e8c14Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2687ee3e8c14Smrg#   success/failure.
2688ee3e8c14Smrg#
2689ee3e8c14Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
2690ee3e8c14Smrg#
2691ee3e8c14Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2692ee3e8c14Smrg#
2693ee3e8c14Smrg# LICENSE
2694ee3e8c14Smrg#
2695ee3e8c14Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2696ee3e8c14Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2697ee3e8c14Smrg#   Copyright (c) 2009 Matteo Frigo
2698ee3e8c14Smrg#
2699ee3e8c14Smrg#   This program is free software: you can redistribute it and/or modify it
2700ee3e8c14Smrg#   under the terms of the GNU General Public License as published by the
2701ee3e8c14Smrg#   Free Software Foundation, either version 3 of the License, or (at your
2702ee3e8c14Smrg#   option) any later version.
2703ee3e8c14Smrg#
2704ee3e8c14Smrg#   This program is distributed in the hope that it will be useful, but
2705ee3e8c14Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
2706ee3e8c14Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2707ee3e8c14Smrg#   Public License for more details.
2708ee3e8c14Smrg#
2709ee3e8c14Smrg#   You should have received a copy of the GNU General Public License along
2710ee3e8c14Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
2711ee3e8c14Smrg#
2712ee3e8c14Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
2713ee3e8c14Smrg#   gives unlimited permission to copy, distribute and modify the configure
2714ee3e8c14Smrg#   scripts that are the output of Autoconf when processing the Macro. You
2715ee3e8c14Smrg#   need not follow the terms of the GNU General Public License when using
2716ee3e8c14Smrg#   or distributing such scripts, even though portions of the text of the
2717ee3e8c14Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
2718ee3e8c14Smrg#   all other use of the material that constitutes the Autoconf Macro.
2719ee3e8c14Smrg#
2720ee3e8c14Smrg#   This special exception to the GPL applies to versions of the Autoconf
2721ee3e8c14Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
2722ee3e8c14Smrg#   modified version of the Autoconf Macro, you may extend this special
2723ee3e8c14Smrg#   exception to the GPL to apply to your modified version as well.#
2724ee3e8c14SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2725ee3e8c14Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
2726ee3e8c14Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2727ee3e8c14SmrgAS_LITERAL_IF([$1],
2728ee3e8c14Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2729ee3e8c14Smrg      ax_save_FLAGS=$LDFLAGS
2730ee3e8c14Smrg      LDFLAGS="$1"
2731ee3e8c14Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2732ee3e8c14Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2733ee3e8c14Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2734ee3e8c14Smrg      LDFLAGS=$ax_save_FLAGS])],
2735ee3e8c14Smrg  [ax_save_FLAGS=$LDFLAGS
2736ee3e8c14Smrg   LDFLAGS="$1"
2737ee3e8c14Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2738ee3e8c14Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2739ee3e8c14Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2740ee3e8c14Smrg   LDFLAGS=$ax_save_FLAGS])
2741ee3e8c14Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2742ee3e8c14SmrgAC_MSG_RESULT($xorg_check_linker_flags)
2743ee3e8c14Smrgif test "x$xorg_check_linker_flags" = xyes; then
2744ee3e8c14Smrg	m4_default([$2], :)
2745ee3e8c14Smrgelse
2746ee3e8c14Smrg	m4_default([$3], :)
2747ee3e8c14Smrgfi
2748ee3e8c14Smrg]) # XORG_CHECK_LINKER_FLAGS
2749b290cf36Smrg
2750ee3e8c14Smrg# XORG_MEMORY_CHECK_FLAGS
2751ee3e8c14Smrg# -----------------------
2752ee3e8c14Smrg# Minimum version: 1.16.0
2753ee3e8c14Smrg#
2754ee3e8c14Smrg# This macro attempts to find appropriate memory checking functionality
2755ee3e8c14Smrg# for various platforms which unit testing code may use to catch various
2756ee3e8c14Smrg# forms of memory allocation and access errors in testing.
2757ee3e8c14Smrg#
2758ee3e8c14Smrg# Interface to module:
2759ee3e8c14Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2760ee3e8c14Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
2761ee3e8c14Smrg#
2762ee3e8c14Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2763ee3e8c14Smrg#
2764ee3e8c14SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
2765b290cf36Smrg
2766ee3e8c14SmrgAC_REQUIRE([AC_CANONICAL_HOST])
2767ee3e8c14SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2768ee3e8c14Smrg           [Environment variables to enable memory checking in tests])
2769b290cf36Smrg
2770ee3e8c14Smrg# Check for different types of support on different platforms
2771ee3e8c14Smrgcase $host_os in
2772ee3e8c14Smrg    solaris*)
2773ee3e8c14Smrg        AC_CHECK_LIB([umem], [umem_alloc],
2774ee3e8c14Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2775ee3e8c14Smrg        ;;
2776ee3e8c14Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2777ee3e8c14Smrg        # both directly and inverted, so should not be 0 or 255.
2778ee3e8c14Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
2779ee3e8c14Smrg        ;;
2780ee3e8c14Smrg    darwin*)
2781ee3e8c14Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2782ee3e8c14Smrg        ;;
2783ee3e8c14Smrg    *bsd*)
2784ee3e8c14Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2785ee3e8c14Smrg        ;;
2786ee3e8c14Smrgesac
2787b290cf36Smrg
2788ee3e8c14Smrg# User supplied flags override default flags
2789ee3e8c14Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2790ee3e8c14Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2791ee3e8c14Smrgfi
2792191cded7Smrg
2793ee3e8c14SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2794ee3e8c14Smrg]) # XORG_WITH_LINT
2795191cded7Smrg
2796ee3e8c14Smrg# XORG_CHECK_MALLOC_ZERO
2797ee3e8c14Smrg# ----------------------
2798ee3e8c14Smrg# Minimum version: 1.0.0
2799ee3e8c14Smrg#
2800ee3e8c14Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2801ee3e8c14Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
2802ee3e8c14Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2803ee3e8c14SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2804ee3e8c14SmrgAC_ARG_ENABLE(malloc0returnsnull,
2805ee3e8c14Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
2806ee3e8c14Smrg		       [malloc(0) returns NULL (default: auto)]),
2807ee3e8c14Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2808ee3e8c14Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2809191cded7Smrg
2810ee3e8c14SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
2811ee3e8c14Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2812ee3e8c14SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
2813ee3e8c14Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
2814ee3e8c14Smrg#include <stdlib.h>
2815ee3e8c14Smrg],[
2816ee3e8c14Smrg    char *m0, *r0, *c0, *p;
2817ee3e8c14Smrg    m0 = malloc(0);
2818ee3e8c14Smrg    p = malloc(10);
2819ee3e8c14Smrg    r0 = realloc(p,0);
2820ee3e8c14Smrg    c0 = calloc(0,10);
2821ee3e8c14Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2822ee3e8c14Smrg])],
2823ee3e8c14Smrg		[xorg_cv_malloc0_returns_null=yes],
2824ee3e8c14Smrg		[xorg_cv_malloc0_returns_null=no])])
2825ee3e8c14SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2826d9dcd5aeSmrgfi
2827ee3e8c14SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2828ee3e8c14Smrg
2829ee3e8c14Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2830ee3e8c14Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2831ee3e8c14Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2832ee3e8c14Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2833ee3e8c14Smrgelse
2834ee3e8c14Smrg	MALLOC_ZERO_CFLAGS=""
2835ee3e8c14Smrg	XMALLOC_ZERO_CFLAGS=""
2836ee3e8c14Smrg	XTMALLOC_ZERO_CFLAGS=""
2837d9dcd5aeSmrgfi
2838191cded7Smrg
2839ee3e8c14SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
2840ee3e8c14SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
2841ee3e8c14SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
2842ee3e8c14Smrg]) # XORG_CHECK_MALLOC_ZERO
2843191cded7Smrg
2844ee3e8c14Smrg# XORG_WITH_LINT()
2845ee3e8c14Smrg# ----------------
2846ee3e8c14Smrg# Minimum version: 1.1.0
2847ee3e8c14Smrg#
2848ee3e8c14Smrg# This macro enables the use of a tool that flags some suspicious and
2849ee3e8c14Smrg# non-portable constructs (likely to be bugs) in C language source code.
2850ee3e8c14Smrg# It will attempt to locate the tool and use appropriate options.
2851ee3e8c14Smrg# There are various lint type tools on different platforms.
2852ee3e8c14Smrg#
2853ee3e8c14Smrg# Interface to module:
2854ee3e8c14Smrg# LINT:		returns the path to the tool found on the platform
2855ee3e8c14Smrg#		or the value set to LINT on the configure cmd line
2856ee3e8c14Smrg#		also an Automake conditional
2857ee3e8c14Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
2858ee3e8c14Smrg#
2859ee3e8c14Smrg# --with-lint:	'yes' user instructs the module to use lint
2860ee3e8c14Smrg#		'no' user instructs the module not to use lint (default)
2861ee3e8c14Smrg#
2862ee3e8c14Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2863ee3e8c14Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
2864ee3e8c14Smrg#
2865ee3e8c14SmrgAC_DEFUN([XORG_WITH_LINT],[
2866191cded7Smrg
2867ee3e8c14SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
2868ee3e8c14SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2869ee3e8c14SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2870ee3e8c14Smrg		[Use a lint-style source code checker (default: disabled)])],
2871ee3e8c14Smrg		[use_lint=$withval], [use_lint=no])
2872191cded7Smrg
2873ee3e8c14Smrg# Obtain platform specific info like program name and options
2874ee3e8c14Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2875ee3e8c14Smrgcase $host_os in
2876ee3e8c14Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2877ee3e8c14Smrg	lint_name=splint
2878ee3e8c14Smrg	lint_options="-badflag"
2879ee3e8c14Smrg	;;
2880ee3e8c14Smrg  *freebsd* | *netbsd*)
2881ee3e8c14Smrg	lint_name=lint
2882ee3e8c14Smrg	lint_options="-u -b"
2883ee3e8c14Smrg	;;
2884ee3e8c14Smrg  *solaris*)
2885ee3e8c14Smrg	lint_name=lint
2886ee3e8c14Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2887ee3e8c14Smrg	;;
2888ee3e8c14Smrgesac
2889191cded7Smrg
2890ee3e8c14Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2891ee3e8c14Smrgif test "x$use_lint" = x"yes" ; then
2892ee3e8c14Smrg   AC_PATH_PROG([LINT], [$lint_name])
2893ee3e8c14Smrg   if test "x$LINT" = "x"; then
2894ee3e8c14Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2895ee3e8c14Smrg   fi
2896ee3e8c14Smrgelif test "x$use_lint" = x"no" ; then
2897ee3e8c14Smrg   if test "x$LINT" != "x"; then
2898ee3e8c14Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2899ee3e8c14Smrg   fi
2900ee3e8c14Smrgelse
2901ee3e8c14Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2902ee3e8c14Smrgfi
2903191cded7Smrg
2904ee3e8c14Smrg# User supplied flags override default flags
2905ee3e8c14Smrgif test "x$LINT_FLAGS" != "x"; then
2906ee3e8c14Smrg   lint_options=$LINT_FLAGS
2907ee3e8c14Smrgfi
2908191cded7Smrg
2909ee3e8c14SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2910ee3e8c14SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2911191cded7Smrg
2912ee3e8c14Smrg]) # XORG_WITH_LINT
2913191cded7Smrg
2914ee3e8c14Smrg# XORG_LINT_LIBRARY(LIBNAME)
2915ee3e8c14Smrg# --------------------------
2916ee3e8c14Smrg# Minimum version: 1.1.0
2917ee3e8c14Smrg#
2918ee3e8c14Smrg# Sets up flags for building lint libraries for checking programs that call
2919ee3e8c14Smrg# functions in the library.
2920ee3e8c14Smrg#
2921ee3e8c14Smrg# Interface to module:
2922ee3e8c14Smrg# LINTLIB		- Automake variable with the name of lint library file to make
2923ee3e8c14Smrg# MAKE_LINT_LIB		- Automake conditional
2924ee3e8c14Smrg#
2925ee3e8c14Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2926ee3e8c14Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2927191cded7Smrg
2928ee3e8c14SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2929ee3e8c14SmrgAC_REQUIRE([XORG_WITH_LINT])
2930ee3e8c14SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2931ee3e8c14Smrg	[Create lint library (default: disabled)])],
2932ee3e8c14Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2933191cded7Smrg
2934ee3e8c14Smrgif test "x$make_lint_lib" = x"yes" ; then
2935ee3e8c14Smrg   LINTLIB=llib-l$1.ln
2936ee3e8c14Smrg   if test "x$LINT" = "x"; then
2937ee3e8c14Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2938ee3e8c14Smrg   fi
2939ee3e8c14Smrgelif test "x$make_lint_lib" != x"no" ; then
2940ee3e8c14Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2941ee3e8c14Smrgfi
2942191cded7Smrg
2943ee3e8c14SmrgAC_SUBST(LINTLIB)
2944ee3e8c14SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2945191cded7Smrg
2946ee3e8c14Smrg]) # XORG_LINT_LIBRARY
2947191cded7Smrg
2948ee3e8c14Smrg# XORG_COMPILER_BRAND
2949ee3e8c14Smrg# -------------------
2950ee3e8c14Smrg# Minimum version: 1.14.0
2951ee3e8c14Smrg#
2952ee3e8c14Smrg# Checks for various brands of compilers and sets flags as appropriate:
2953ee3e8c14Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2954ee3e8c14Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2955ee3e8c14Smrg#   clang compiler - sets CLANGCC to "yes"
2956ee3e8c14Smrg#   Intel compiler - sets INTELCC to "yes"
2957ee3e8c14Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2958ee3e8c14Smrg#
2959ee3e8c14SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
2960ee3e8c14SmrgAC_LANG_CASE(
2961ee3e8c14Smrg	[C], [
2962ee3e8c14Smrg		AC_REQUIRE([AC_PROG_CC_C99])
2963ee3e8c14Smrg	],
2964ee3e8c14Smrg	[C++], [
2965ee3e8c14Smrg		AC_REQUIRE([AC_PROG_CXX])
2966ee3e8c14Smrg	]
2967ee3e8c14Smrg)
2968ee3e8c14SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2969ee3e8c14SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2970ee3e8c14SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2971ee3e8c14Smrg]) # XORG_COMPILER_BRAND
2972191cded7Smrg
2973ee3e8c14Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
2974ee3e8c14Smrg# ---------------
2975ee3e8c14Smrg# Minimum version: 1.16.0
2976ee3e8c14Smrg#
2977ee3e8c14Smrg# Test if the compiler works when passed the given flag as a command line argument.
2978ee3e8c14Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
2979ee3e8c14Smrg# next flag in the list until there are no more options.
2980ee3e8c14Smrg#
2981ee3e8c14Smrg# Note that this does not guarantee that the compiler supports the flag as some
2982ee3e8c14Smrg# compilers will simply ignore arguments that they do not understand, but we do
2983ee3e8c14Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
2984ee3e8c14Smrg# -Werror=unused-command-line-argument
2985ee3e8c14Smrg#
2986ee3e8c14SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
2987ee3e8c14Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2988ee3e8c14Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2989b290cf36Smrg
2990ee3e8c14SmrgAC_LANG_COMPILER_REQUIRE
2991b290cf36Smrg
2992ee3e8c14SmrgAC_LANG_CASE(
2993ee3e8c14Smrg	[C], [
2994ee3e8c14Smrg		AC_REQUIRE([AC_PROG_CC_C99])
2995ee3e8c14Smrg		define([PREFIX], [C])
2996ee3e8c14Smrg		define([CACHE_PREFIX], [cc])
2997ee3e8c14Smrg		define([COMPILER], [$CC])
2998ee3e8c14Smrg	],
2999ee3e8c14Smrg	[C++], [
3000ee3e8c14Smrg		define([PREFIX], [CXX])
3001ee3e8c14Smrg		define([CACHE_PREFIX], [cxx])
3002ee3e8c14Smrg		define([COMPILER], [$CXX])
3003ee3e8c14Smrg	]
3004ee3e8c14Smrg)
3005191cded7Smrg
3006ee3e8c14Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
3007191cded7Smrg
3008ee3e8c14Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
3009ee3e8c14Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3010ee3e8c14Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
3011ee3e8c14Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
3012ee3e8c14Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3013ee3e8c14Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
3014ee3e8c14Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
3015ee3e8c14Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
3016ee3e8c14Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3017ee3e8c14Smrgfi
3018191cded7Smrg
3019ee3e8c14Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
3020ee3e8c14Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
3021ee3e8c14Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3022d9dcd5aeSmrg	fi
3023ee3e8c14Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3024ee3e8c14Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
3025ee3e8c14Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
3026ee3e8c14Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3027ee3e8c14Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
3028ee3e8c14Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
3029ee3e8c14Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
3030ee3e8c14Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3031ee3e8c14Smrgfi
3032191cded7Smrg
3033ee3e8c14Smrgfound="no"
3034ee3e8c14Smrgm4_foreach([flag], m4_cdr($@), [
3035ee3e8c14Smrg	if test $found = "no" ; then
3036ee3e8c14Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
3037ee3e8c14Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3038ee3e8c14Smrg		fi
3039191cded7Smrg
3040ee3e8c14Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
3041ee3e8c14Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3042ee3e8c14Smrg		fi
3043191cded7Smrg
3044ee3e8c14Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
3045191cded7Smrg
3046ee3e8c14Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
3047ee3e8c14Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
3048ee3e8c14Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
3049ee3e8c14Smrg		AC_CACHE_VAL($cacheid,
3050ee3e8c14Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
3051ee3e8c14Smrg					     [eval $cacheid=yes],
3052ee3e8c14Smrg					     [eval $cacheid=no])])
3053ee3e8c14Smrg
3054ee3e8c14Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3055ee3e8c14Smrg
3056ee3e8c14Smrg		eval supported=\$$cacheid
3057ee3e8c14Smrg		AC_MSG_RESULT([$supported])
3058ee3e8c14Smrg		if test "$supported" = "yes" ; then
3059ee3e8c14Smrg			$1="$$1 ]flag["
3060ee3e8c14Smrg			found="yes"
3061ee3e8c14Smrg		fi
3062ee3e8c14Smrg	fi
3063ba064abeSmrg])
3064ee3e8c14Smrg]) # XORG_TESTSET_CFLAG
3065191cded7Smrg
3066ee3e8c14Smrg# XORG_COMPILER_FLAGS
3067ee3e8c14Smrg# ---------------
3068ee3e8c14Smrg# Minimum version: 1.16.0
3069ee3e8c14Smrg#
3070ee3e8c14Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
3071ee3e8c14Smrg# arguments supported by the selected compiler which do NOT alter the generated
3072ee3e8c14Smrg# code.  These arguments will cause the compiler to print various warnings
3073ee3e8c14Smrg# during compilation AND turn a conservative set of warnings into errors.
3074ee3e8c14Smrg#
3075ee3e8c14Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
3076ee3e8c14Smrg# future versions of util-macros as options are added to new compilers.
3077ee3e8c14Smrg#
3078ee3e8c14SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
3079ee3e8c14SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3080ee3e8c14Smrg
3081ee3e8c14SmrgAC_ARG_ENABLE(selective-werror,
3082ee3e8c14Smrg              AS_HELP_STRING([--disable-selective-werror],
3083ee3e8c14Smrg                             [Turn off selective compiler errors. (default: enabled)]),
3084ee3e8c14Smrg              [SELECTIVE_WERROR=$enableval],
3085ee3e8c14Smrg              [SELECTIVE_WERROR=yes])
3086ee3e8c14Smrg
3087ee3e8c14SmrgAC_LANG_CASE(
3088ee3e8c14Smrg        [C], [
3089ee3e8c14Smrg                define([PREFIX], [C])
3090ee3e8c14Smrg        ],
3091ee3e8c14Smrg        [C++], [
3092ee3e8c14Smrg                define([PREFIX], [CXX])
3093ee3e8c14Smrg        ]
3094ee3e8c14Smrg)
3095ee3e8c14Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
3096ee3e8c14Smrgif test "x$SUNCC" = "xyes"; then
3097ee3e8c14Smrg    [BASE_]PREFIX[FLAGS]="-v"
3098d9dcd5aeSmrgelse
3099ee3e8c14Smrg    [BASE_]PREFIX[FLAGS]=""
3100d9dcd5aeSmrgfi
3101191cded7Smrg
3102ee3e8c14Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
3103ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
3104ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
3105ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
3106ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
3107191cded7Smrg
3108ee3e8c14SmrgAC_LANG_CASE(
3109ee3e8c14Smrg	[C], [
3110ee3e8c14Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
3111ee3e8c14Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
3112ee3e8c14Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
3113ee3e8c14Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
3114ee3e8c14Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
3115ee3e8c14Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
3116ee3e8c14Smrg	]
3117ee3e8c14Smrg)
3118191cded7Smrg
3119ee3e8c14Smrg# This chunk adds additional warnings that could catch undesired effects.
3120ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
3121ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
3122ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
3123ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
3124ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
3125ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
3126ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
3127191cded7Smrg
3128ee3e8c14Smrg# These are currently disabled because they are noisy.  They will be enabled
3129ee3e8c14Smrg# in the future once the codebase is sufficiently modernized to silence
3130ee3e8c14Smrg# them.  For now, I don't want them to drown out the other warnings.
3131ee3e8c14Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
3132ee3e8c14Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
3133ee3e8c14Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
3134191cded7Smrg
3135ee3e8c14Smrg# Turn some warnings into errors, so we don't accidently get successful builds
3136ee3e8c14Smrg# when there are problems that should be fixed.
3137191cded7Smrg
3138ee3e8c14Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
3139ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
3140ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
3141ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
3142ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
3143ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
3144ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
3145ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
3146ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
3147ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
3148ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3149ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3150ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3151ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
3152d9dcd5aeSmrgelse
3153ee3e8c14SmrgAC_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])
3154ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3155ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3156ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3157ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3158ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3159ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3160ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3161ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3162ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3163ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3164ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3165ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3166ee3e8c14SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
3167d9dcd5aeSmrgfi
3168191cded7Smrg
3169ee3e8c14SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3170ee3e8c14Smrg]) # XORG_COMPILER_FLAGS
3171191cded7Smrg
3172ee3e8c14Smrg# XORG_CWARNFLAGS
3173ee3e8c14Smrg# ---------------
3174ee3e8c14Smrg# Minimum version: 1.2.0
3175ee3e8c14Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3176ee3e8c14Smrg#
3177ee3e8c14Smrg# Defines CWARNFLAGS to enable C compiler warnings.
3178ee3e8c14Smrg#
3179ee3e8c14Smrg# This function is deprecated because it defines -fno-strict-aliasing
3180ee3e8c14Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
3181ee3e8c14Smrg# is needed, then it should be added explicitly in the module when
3182ee3e8c14Smrg# it is updated to use BASE_CFLAGS.
3183ee3e8c14Smrg#
3184ee3e8c14SmrgAC_DEFUN([XORG_CWARNFLAGS], [
3185ee3e8c14SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3186ee3e8c14SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3187ee3e8c14SmrgAC_LANG_CASE(
3188ee3e8c14Smrg	[C], [
3189ee3e8c14Smrg		CWARNFLAGS="$BASE_CFLAGS"
3190ee3e8c14Smrg		if  test "x$GCC" = xyes ; then
3191ee3e8c14Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3192ee3e8c14Smrg		fi
3193ee3e8c14Smrg		AC_SUBST(CWARNFLAGS)
3194ee3e8c14Smrg	]
3195ee3e8c14Smrg)
3196ee3e8c14Smrg]) # XORG_CWARNFLAGS
3197191cded7Smrg
3198ee3e8c14Smrg# XORG_STRICT_OPTION
3199ee3e8c14Smrg# -----------------------
3200ee3e8c14Smrg# Minimum version: 1.3.0
3201ee3e8c14Smrg#
3202ee3e8c14Smrg# Add configure option to enable strict compilation flags, such as treating
3203ee3e8c14Smrg# warnings as fatal errors.
3204ee3e8c14Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
3205ee3e8c14Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
3206ee3e8c14Smrg#
3207ee3e8c14Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
3208ee3e8c14Smrg# when strict compilation is unconditionally desired.
3209ee3e8c14SmrgAC_DEFUN([XORG_STRICT_OPTION], [
3210ee3e8c14SmrgAC_REQUIRE([XORG_CWARNFLAGS])
3211ee3e8c14SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3212191cded7Smrg
3213ee3e8c14SmrgAC_ARG_ENABLE(strict-compilation,
3214ee3e8c14Smrg			  AS_HELP_STRING([--enable-strict-compilation],
3215ee3e8c14Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
3216ee3e8c14Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
3217191cded7Smrg
3218ee3e8c14SmrgAC_LANG_CASE(
3219ee3e8c14Smrg        [C], [
3220ee3e8c14Smrg                define([PREFIX], [C])
3221ee3e8c14Smrg        ],
3222ee3e8c14Smrg        [C++], [
3223ee3e8c14Smrg                define([PREFIX], [CXX])
3224ee3e8c14Smrg        ]
3225ee3e8c14Smrg)
3226191cded7Smrg
3227ee3e8c14Smrg[STRICT_]PREFIX[FLAGS]=""
3228ee3e8c14SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3229ee3e8c14SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3230d9dcd5aeSmrg
3231ee3e8c14Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3232ee3e8c14Smrg# activate it with -Werror, so we add it here explicitly.
3233ee3e8c14SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
3234191cded7Smrg
3235ee3e8c14Smrgif test "x$STRICT_COMPILE" = "xyes"; then
3236ee3e8c14Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3237ee3e8c14Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
3238ee3e8c14Smrgfi
3239ee3e8c14SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
3240ee3e8c14SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3241ee3e8c14SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
3242ee3e8c14Smrg]) # XORG_STRICT_OPTION
3243191cded7Smrg
3244ee3e8c14Smrg# XORG_DEFAULT_OPTIONS
3245ee3e8c14Smrg# --------------------
3246ee3e8c14Smrg# Minimum version: 1.3.0
3247ee3e8c14Smrg#
3248ee3e8c14Smrg# Defines default options for X.Org modules.
3249ee3e8c14Smrg#
3250ee3e8c14SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
3251ee3e8c14SmrgAC_REQUIRE([AC_PROG_INSTALL])
3252ee3e8c14SmrgXORG_COMPILER_FLAGS
3253ee3e8c14SmrgXORG_CWARNFLAGS
3254ee3e8c14SmrgXORG_STRICT_OPTION
3255ee3e8c14SmrgXORG_RELEASE_VERSION
3256ee3e8c14SmrgXORG_CHANGELOG
3257ee3e8c14SmrgXORG_INSTALL
3258ee3e8c14SmrgXORG_MANPAGE_SECTIONS
3259ee3e8c14Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
3260ee3e8c14Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
3261ee3e8c14Smrg]) # XORG_DEFAULT_OPTIONS
3262d9dcd5aeSmrg
3263ee3e8c14Smrg# XORG_INSTALL()
3264ee3e8c14Smrg# ----------------
3265ee3e8c14Smrg# Minimum version: 1.4.0
3266ee3e8c14Smrg#
3267ee3e8c14Smrg# Defines the variable INSTALL_CMD as the command to copy
3268ee3e8c14Smrg# INSTALL from $prefix/share/util-macros.
3269ee3e8c14Smrg#
3270ee3e8c14SmrgAC_DEFUN([XORG_INSTALL], [
3271ee3e8c14SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
3272ee3e8c14Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
3273ee3e8c14SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
3274ee3e8c14Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
3275ee3e8c14Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
3276ee3e8c14Smrgtouch \$(top_srcdir)/INSTALL; \
3277ee3e8c14Smrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
3278ee3e8c14SmrgAC_SUBST([INSTALL_CMD])
3279ee3e8c14Smrg]) # XORG_INSTALL
3280ee3e8c14Smrgdnl Copyright 2005 Red Hat, Inc
3281ee3e8c14Smrgdnl
3282ee3e8c14Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
3283ee3e8c14Smrgdnl documentation for any purpose is hereby granted without fee, provided that
3284ee3e8c14Smrgdnl the above copyright notice appear in all copies and that both that
3285ee3e8c14Smrgdnl copyright notice and this permission notice appear in supporting
3286ee3e8c14Smrgdnl documentation.
3287ee3e8c14Smrgdnl
3288ee3e8c14Smrgdnl The above copyright notice and this permission notice shall be included
3289ee3e8c14Smrgdnl in all copies or substantial portions of the Software.
3290ee3e8c14Smrgdnl
3291ee3e8c14Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3292ee3e8c14Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3293ee3e8c14Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3294ee3e8c14Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3295ee3e8c14Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3296ee3e8c14Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3297ee3e8c14Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
3298ee3e8c14Smrgdnl
3299ee3e8c14Smrgdnl Except as contained in this notice, the name of the copyright holders shall
3300ee3e8c14Smrgdnl not be used in advertising or otherwise to promote the sale, use or
3301ee3e8c14Smrgdnl other dealings in this Software without prior written authorization
3302ee3e8c14Smrgdnl from the copyright holders.
3303ee3e8c14Smrgdnl
3304191cded7Smrg
3305ee3e8c14Smrg# XORG_RELEASE_VERSION
3306ee3e8c14Smrg# --------------------
3307ee3e8c14Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
3308191cded7Smrg
3309ee3e8c14SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
3310ee3e8c14Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3311ee3e8c14Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
3312ee3e8c14Smrg		[Major version of this package])
3313ee3e8c14Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3314ee3e8c14Smrg	if test "x$PVM" = "x"; then
3315ee3e8c14Smrg		PVM="0"
3316d9dcd5aeSmrg	fi
3317ee3e8c14Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3318ee3e8c14Smrg		[$PVM],
3319ee3e8c14Smrg		[Minor version of this package])
3320ee3e8c14Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3321ee3e8c14Smrg	if test "x$PVP" = "x"; then
3322ee3e8c14Smrg		PVP="0"
3323ee3e8c14Smrg	fi
3324ee3e8c14Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3325ee3e8c14Smrg		[$PVP],
3326ee3e8c14Smrg		[Patch version of this package])
3327ee3e8c14Smrg])
3328191cded7Smrg
3329ee3e8c14Smrg# XORG_CHANGELOG()
3330ee3e8c14Smrg# ----------------
3331ee3e8c14Smrg# Minimum version: 1.2.0
3332ee3e8c14Smrg#
3333ee3e8c14Smrg# Defines the variable CHANGELOG_CMD as the command to generate
3334ee3e8c14Smrg# ChangeLog from git.
3335ee3e8c14Smrg#
3336ee3e8c14Smrg#
3337ee3e8c14SmrgAC_DEFUN([XORG_CHANGELOG], [
3338ee3e8c14SmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
3339ee3e8c14Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3340ee3e8c14Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
3341ee3e8c14Smrgtouch \$(top_srcdir)/ChangeLog; \
3342ee3e8c14Smrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
3343ee3e8c14SmrgAC_SUBST([CHANGELOG_CMD])
3344ee3e8c14Smrg]) # XORG_CHANGELOG
3345191cded7Smrg
3346ee3e8c14Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
3347ee3e8c14Smrg#
3348ee3e8c14Smrg#   Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
3349ee3e8c14Smrg#   Foundation, Inc.
3350ee3e8c14Smrg#   Written by Gordon Matzigkeit, 1996
3351ee3e8c14Smrg#
3352ee3e8c14Smrg# This file is free software; the Free Software Foundation gives
3353ee3e8c14Smrg# unlimited permission to copy and/or distribute it, with or without
3354ee3e8c14Smrg# modifications, as long as this notice is preserved.
3355191cded7Smrg
3356ee3e8c14Smrgm4_define([_LT_COPYING], [dnl
3357ee3e8c14Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
3358ee3e8c14Smrg# This is free software; see the source for copying conditions.  There is NO
3359ee3e8c14Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3360d9dcd5aeSmrg
3361ee3e8c14Smrg# GNU Libtool is free software; you can redistribute it and/or modify
3362ee3e8c14Smrg# it under the terms of the GNU General Public License as published by
3363ee3e8c14Smrg# the Free Software Foundation; either version 2 of of the License, or
3364ee3e8c14Smrg# (at your option) any later version.
3365ee3e8c14Smrg#
3366ee3e8c14Smrg# As a special exception to the GNU General Public License, if you
3367ee3e8c14Smrg# distribute this file as part of a program or library that is built
3368ee3e8c14Smrg# using GNU Libtool, you may include this file under the  same
3369ee3e8c14Smrg# distribution terms that you use for the rest of that program.
3370ee3e8c14Smrg#
3371ee3e8c14Smrg# GNU Libtool is distributed in the hope that it will be useful, but
3372ee3e8c14Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
3373ee3e8c14Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3374ee3e8c14Smrg# GNU General Public License for more details.
3375ee3e8c14Smrg#
3376ee3e8c14Smrg# You should have received a copy of the GNU General Public License
3377ee3e8c14Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
3378ee3e8c14Smrg])
3379191cded7Smrg
3380ee3e8c14Smrg# serial 59 LT_INIT
3381191cded7Smrg
3382191cded7Smrg
3383ee3e8c14Smrg# LT_PREREQ(VERSION)
3384ee3e8c14Smrg# ------------------
3385ee3e8c14Smrg# Complain and exit if this libtool version is less that VERSION.
3386ee3e8c14Smrgm4_defun([LT_PREREQ],
3387ee3e8c14Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
3388ee3e8c14Smrg       [m4_default([$3],
3389ee3e8c14Smrg		   [m4_fatal([Libtool version $1 or higher is required],
3390ee3e8c14Smrg		             63)])],
3391ee3e8c14Smrg       [$2])])
3392191cded7Smrg
3393191cded7Smrg
3394ee3e8c14Smrg# _LT_CHECK_BUILDDIR
3395ee3e8c14Smrg# ------------------
3396ee3e8c14Smrg# Complain if the absolute build directory name contains unusual characters
3397ee3e8c14Smrgm4_defun([_LT_CHECK_BUILDDIR],
3398ee3e8c14Smrg[case `pwd` in
3399ee3e8c14Smrg  *\ * | *\	*)
3400ee3e8c14Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
3401ee3e8c14Smrgesac
3402ee3e8c14Smrg])
3403191cded7Smrg
3404191cded7Smrg
3405ee3e8c14Smrg# LT_INIT([OPTIONS])
3406ee3e8c14Smrg# ------------------
3407ee3e8c14SmrgAC_DEFUN([LT_INIT],
3408ee3e8c14Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
3409ee3e8c14SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3410ee3e8c14SmrgAC_BEFORE([$0], [LT_LANG])dnl
3411ee3e8c14SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
3412ee3e8c14SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
3413ee3e8c14Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
3414b290cf36Smrg
3415ee3e8c14Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
3416ee3e8c14Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
3417ee3e8c14Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
3418ee3e8c14Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
3419ee3e8c14Smrgdnl unless we require an AC_DEFUNed macro:
3420ee3e8c14SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
3421ee3e8c14SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
3422ee3e8c14SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
3423ee3e8c14SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
3424ee3e8c14Smrgm4_require([_LT_PROG_LTMAIN])dnl
3425b290cf36Smrg
3426ee3e8c14Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
3427191cded7Smrg
3428ee3e8c14Smrgdnl Parse OPTIONS
3429ee3e8c14Smrg_LT_SET_OPTIONS([$0], [$1])
3430191cded7Smrg
3431ee3e8c14Smrg# This can be used to rebuild libtool when needed
3432ee3e8c14SmrgLIBTOOL_DEPS=$ltmain
3433191cded7Smrg
3434ee3e8c14Smrg# Always use our own libtool.
3435ee3e8c14SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
3436ee3e8c14SmrgAC_SUBST(LIBTOOL)dnl
3437ee3e8c14Smrg
3438ee3e8c14Smrg_LT_SETUP
3439ee3e8c14Smrg
3440ee3e8c14Smrg# Only expand once:
3441ee3e8c14Smrgm4_define([LT_INIT])
3442ee3e8c14Smrg])# LT_INIT
3443ee3e8c14Smrg
3444ee3e8c14Smrg# Old names:
3445ee3e8c14SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
3446ee3e8c14SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
3447d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
3448ee3e8c14Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
3449ee3e8c14Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
3450191cded7Smrg
3451b290cf36Smrg
3452ee3e8c14Smrg# _LT_PREPARE_CC_BASENAME
3453ee3e8c14Smrg# -----------------------
3454ee3e8c14Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
3455ee3e8c14Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
3456ee3e8c14Smrgfunc_cc_basename ()
3457ee3e8c14Smrg{
3458ee3e8c14Smrg    for cc_temp in @S|@*""; do
3459ee3e8c14Smrg      case $cc_temp in
3460ee3e8c14Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
3461ee3e8c14Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
3462ee3e8c14Smrg        \-*) ;;
3463ee3e8c14Smrg        *) break;;
3464ee3e8c14Smrg      esac
3465ee3e8c14Smrg    done
3466ee3e8c14Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
3467ee3e8c14Smrg}
3468ee3e8c14Smrg])# _LT_PREPARE_CC_BASENAME
3469ee3e8c14Smrg
3470ee3e8c14Smrg
3471ee3e8c14Smrg# _LT_CC_BASENAME(CC)
3472ee3e8c14Smrg# -------------------
3473ee3e8c14Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
3474ee3e8c14Smrg# but that macro is also expanded into generated libtool script, which
3475ee3e8c14Smrg# arranges for $SED and $ECHO to be set by different means.
3476ee3e8c14Smrgm4_defun([_LT_CC_BASENAME],
3477ee3e8c14Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
3478ee3e8c14SmrgAC_REQUIRE([_LT_DECL_SED])dnl
3479ee3e8c14SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
3480ee3e8c14Smrgfunc_cc_basename $1
3481ee3e8c14Smrgcc_basename=$func_cc_basename_result
3482d9dcd5aeSmrg])
3483191cded7Smrg
3484191cded7Smrg
3485ee3e8c14Smrg# _LT_FILEUTILS_DEFAULTS
3486ee3e8c14Smrg# ----------------------
3487ee3e8c14Smrg# It is okay to use these file commands and assume they have been set
3488ee3e8c14Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
3489ee3e8c14Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
3490ee3e8c14Smrg[: ${CP="cp -f"}
3491ee3e8c14Smrg: ${MV="mv -f"}
3492ee3e8c14Smrg: ${RM="rm -f"}
3493ee3e8c14Smrg])# _LT_FILEUTILS_DEFAULTS
3494191cded7Smrg
3495191cded7Smrg
3496ee3e8c14Smrg# _LT_SETUP
3497ee3e8c14Smrg# ---------
3498ee3e8c14Smrgm4_defun([_LT_SETUP],
3499d9dcd5aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3500ee3e8c14SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3501ee3e8c14SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
3502ee3e8c14SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
3503191cded7Smrg
3504ee3e8c14Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
3505ee3e8c14Smrgdnl
3506ee3e8c14Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
3507ee3e8c14Smrg_LT_DECL([], [host], [0])dnl
3508ee3e8c14Smrg_LT_DECL([], [host_os], [0])dnl
3509ee3e8c14Smrgdnl
3510ee3e8c14Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
3511ee3e8c14Smrg_LT_DECL([], [build], [0])dnl
3512ee3e8c14Smrg_LT_DECL([], [build_os], [0])dnl
3513ee3e8c14Smrgdnl
3514ee3e8c14SmrgAC_REQUIRE([AC_PROG_CC])dnl
3515ee3e8c14SmrgAC_REQUIRE([LT_PATH_LD])dnl
3516ee3e8c14SmrgAC_REQUIRE([LT_PATH_NM])dnl
3517ee3e8c14Smrgdnl
3518ee3e8c14SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
3519ee3e8c14Smrgtest -z "$LN_S" && LN_S="ln -s"
3520ee3e8c14Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
3521ee3e8c14Smrgdnl
3522ee3e8c14SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
3523ee3e8c14Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
3524ee3e8c14Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
3525ee3e8c14Smrgdnl
3526ee3e8c14Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3527ee3e8c14Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
3528ee3e8c14Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
3529ee3e8c14Smrgm4_require([_LT_CMD_RELOAD])dnl
3530ee3e8c14Smrgm4_require([_LT_DECL_FILECMD])dnl
3531ee3e8c14Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
3532ee3e8c14Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
3533ee3e8c14Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
3534ee3e8c14Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
3535ee3e8c14Smrgm4_require([_LT_WITH_SYSROOT])dnl
3536ee3e8c14Smrgm4_require([_LT_CMD_TRUNCATE])dnl
3537191cded7Smrg
3538ee3e8c14Smrg_LT_CONFIG_LIBTOOL_INIT([
3539ee3e8c14Smrg# See if we are running on zsh, and set the options that allow our
3540ee3e8c14Smrg# commands through without removal of \ escapes INIT.
3541ee3e8c14Smrgif test -n "\${ZSH_VERSION+set}"; then
3542ee3e8c14Smrg   setopt NO_GLOB_SUBST
3543ee3e8c14Smrgfi
3544ee3e8c14Smrg])
3545ee3e8c14Smrgif test -n "${ZSH_VERSION+set}"; then
3546ee3e8c14Smrg   setopt NO_GLOB_SUBST
3547ee3e8c14Smrgfi
3548191cded7Smrg
3549ee3e8c14Smrg_LT_CHECK_OBJDIR
3550191cded7Smrg
3551ee3e8c14Smrgm4_require([_LT_TAG_COMPILER])dnl
3552191cded7Smrg
3553ee3e8c14Smrgcase $host_os in
3554ee3e8c14Smrgaix3*)
3555ee3e8c14Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
3556ee3e8c14Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
3557ee3e8c14Smrg  # vanish in a puff of smoke.
3558ee3e8c14Smrg  if test set != "${COLLECT_NAMES+set}"; then
3559ee3e8c14Smrg    COLLECT_NAMES=
3560ee3e8c14Smrg    export COLLECT_NAMES
3561ee3e8c14Smrg  fi
3562ee3e8c14Smrg  ;;
3563ee3e8c14Smrgesac
3564191cded7Smrg
3565ee3e8c14Smrg# Global variables:
3566ee3e8c14Smrgofile=libtool
3567ee3e8c14Smrgcan_build_shared=yes
3568191cded7Smrg
3569ee3e8c14Smrg# All known linkers require a '.a' archive for static linking (except MSVC and
3570ee3e8c14Smrg# ICC, which need '.lib').
3571ee3e8c14Smrglibext=a
3572191cded7Smrg
3573ee3e8c14Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3574191cded7Smrg
3575ee3e8c14Smrgold_CC=$CC
3576ee3e8c14Smrgold_CFLAGS=$CFLAGS
3577191cded7Smrg
3578ee3e8c14Smrg# Set sane defaults for various variables
3579ee3e8c14Smrgtest -z "$CC" && CC=cc
3580ee3e8c14Smrgtest -z "$LTCC" && LTCC=$CC
3581ee3e8c14Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
3582ee3e8c14Smrgtest -z "$LD" && LD=ld
3583ee3e8c14Smrgtest -z "$ac_objext" && ac_objext=o
3584191cded7Smrg
3585ee3e8c14Smrg_LT_CC_BASENAME([$compiler])
3586191cded7Smrg
3587ee3e8c14Smrg# Only perform the check for file, if the check method requires it
3588ee3e8c14Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
3589ee3e8c14Smrgcase $deplibs_check_method in
3590ee3e8c14Smrgfile_magic*)
3591ee3e8c14Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
3592ee3e8c14Smrg    _LT_PATH_MAGIC
3593ee3e8c14Smrg  fi
3594ee3e8c14Smrg  ;;
3595ee3e8c14Smrgesac
3596191cded7Smrg
3597ee3e8c14Smrg# Use C for the default configuration in the libtool script
3598ee3e8c14SmrgLT_SUPPORTED_TAG([CC])
3599ee3e8c14Smrg_LT_LANG_C_CONFIG
3600ee3e8c14Smrg_LT_LANG_DEFAULT_CONFIG
3601ee3e8c14Smrg_LT_CONFIG_COMMANDS
3602ee3e8c14Smrg])# _LT_SETUP
3603191cded7Smrg
3604191cded7Smrg
3605ee3e8c14Smrg# _LT_PREPARE_SED_QUOTE_VARS
3606ee3e8c14Smrg# --------------------------
3607ee3e8c14Smrg# Define a few sed substitution that help us do robust quoting.
3608ee3e8c14Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
3609ee3e8c14Smrg[# Backslashify metacharacters that are still active within
3610ee3e8c14Smrg# double-quoted strings.
3611ee3e8c14Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
3612191cded7Smrg
3613ee3e8c14Smrg# Same as above, but do not quote variable references.
3614ee3e8c14Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
3615191cded7Smrg
3616ee3e8c14Smrg# Sed substitution to delay expansion of an escaped shell variable in a
3617ee3e8c14Smrg# double_quote_subst'ed string.
3618ee3e8c14Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
3619191cded7Smrg
3620ee3e8c14Smrg# Sed substitution to delay expansion of an escaped single quote.
3621ee3e8c14Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
3622191cded7Smrg
3623ee3e8c14Smrg# Sed substitution to avoid accidental globbing in evaled expressions
3624ee3e8c14Smrgno_glob_subst='s/\*/\\\*/g'
3625ee3e8c14Smrg])
3626191cded7Smrg
3627ee3e8c14Smrg# _LT_PROG_LTMAIN
3628ee3e8c14Smrg# ---------------
3629ee3e8c14Smrg# Note that this code is called both from 'configure', and 'config.status'
3630ee3e8c14Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
3631ee3e8c14Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
3632ee3e8c14Smrg# so we pass a copy along to make sure it has a sensible value anyway.
3633ee3e8c14Smrgm4_defun([_LT_PROG_LTMAIN],
3634ee3e8c14Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3635ee3e8c14Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3636ee3e8c14Smrgltmain=$ac_aux_dir/ltmain.sh
3637ee3e8c14Smrg])# _LT_PROG_LTMAIN
3638191cded7Smrg
3639191cded7Smrg
3640191cded7Smrg
3641ee3e8c14Smrg# So that we can recreate a full libtool script including additional
3642ee3e8c14Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3643ee3e8c14Smrg# in macros and then make a single call at the end using the 'libtool'
3644ee3e8c14Smrg# label.
3645191cded7Smrg
3646191cded7Smrg
3647ee3e8c14Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3648ee3e8c14Smrg# ----------------------------------------
3649ee3e8c14Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3650ee3e8c14Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
3651ee3e8c14Smrg[m4_ifval([$1],
3652ee3e8c14Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3653ee3e8c14Smrg                     [$1
3654ee3e8c14Smrg])])])
3655ba064abeSmrg
3656ee3e8c14Smrg# Initialize.
3657ee3e8c14Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
3658ba064abeSmrg
3659ba064abeSmrg
3660ee3e8c14Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3661ee3e8c14Smrg# ------------------------------
3662ee3e8c14Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3663ee3e8c14Smrgm4_define([_LT_CONFIG_LIBTOOL],
3664ee3e8c14Smrg[m4_ifval([$1],
3665ee3e8c14Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3666ee3e8c14Smrg                     [$1
3667ee3e8c14Smrg])])])
3668ba064abeSmrg
3669ee3e8c14Smrg# Initialize.
3670ee3e8c14Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3671ba064abeSmrg
3672ba064abeSmrg
3673ee3e8c14Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3674ee3e8c14Smrg# -----------------------------------------------------
3675ee3e8c14Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3676ee3e8c14Smrg[_LT_CONFIG_LIBTOOL([$1])
3677ee3e8c14Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3678ee3e8c14Smrg])
3679ba064abeSmrg
3680ba064abeSmrg
3681ee3e8c14Smrg# _LT_FORMAT_COMMENT([COMMENT])
3682ee3e8c14Smrg# -----------------------------
3683ee3e8c14Smrg# Add leading comment marks to the start of each line, and a trailing
3684ee3e8c14Smrg# full-stop to the whole comment if one is not present already.
3685ee3e8c14Smrgm4_define([_LT_FORMAT_COMMENT],
3686ee3e8c14Smrg[m4_ifval([$1], [
3687ee3e8c14Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3688ee3e8c14Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3689ee3e8c14Smrg)])
3690ba064abeSmrg
3691ba064abeSmrg
3692ba064abeSmrg
3693ba064abeSmrg
3694ba064abeSmrg
3695ee3e8c14Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3696ee3e8c14Smrg# -------------------------------------------------------------------
3697ee3e8c14Smrg# CONFIGNAME is the name given to the value in the libtool script.
3698ee3e8c14Smrg# VARNAME is the (base) name used in the configure script.
3699ee3e8c14Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3700ee3e8c14Smrg# VARNAME.  Any other value will be used directly.
3701ee3e8c14Smrgm4_define([_LT_DECL],
3702ee3e8c14Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3703ee3e8c14Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3704ee3e8c14Smrg	[m4_ifval([$1], [$1], [$2])])
3705ee3e8c14Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3706ee3e8c14Smrg    m4_ifval([$4],
3707ee3e8c14Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3708ee3e8c14Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3709ee3e8c14Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3710ee3e8c14Smrg])
3711ba064abeSmrg
3712ba064abeSmrg
3713ee3e8c14Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3714ee3e8c14Smrg# --------------------------------------------------------
3715ee3e8c14Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3716ba064abeSmrg
3717ba064abeSmrg
3718ee3e8c14Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3719ee3e8c14Smrg# ------------------------------------------------
3720ee3e8c14Smrgm4_define([lt_decl_tag_varnames],
3721ee3e8c14Smrg[_lt_decl_filter([tagged?], [yes], $@)])
3722ee3e8c14Smrg
3723ee3e8c14Smrg
3724ee3e8c14Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3725ee3e8c14Smrg# ---------------------------------------------------------
3726ee3e8c14Smrgm4_define([_lt_decl_filter],
3727ee3e8c14Smrg[m4_case([$#],
3728ee3e8c14Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
3729ee3e8c14Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
3730ee3e8c14Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3731ee3e8c14Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3732ee3e8c14Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3733d9dcd5aeSmrg])
3734ba064abeSmrg
3735ba064abeSmrg
3736ee3e8c14Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
3737ee3e8c14Smrg# --------------------------------------------------
3738ee3e8c14Smrgm4_define([lt_decl_quote_varnames],
3739ee3e8c14Smrg[_lt_decl_filter([value], [1], $@)])
3740ba064abeSmrg
3741ba064abeSmrg
3742ee3e8c14Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
3743ee3e8c14Smrg# ---------------------------------------------------
3744ee3e8c14Smrgm4_define([lt_decl_dquote_varnames],
3745ee3e8c14Smrg[_lt_decl_filter([value], [2], $@)])
3746ba064abeSmrg
3747ba064abeSmrg
3748ee3e8c14Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
3749ee3e8c14Smrg# ---------------------------------------------------
3750ee3e8c14Smrgm4_define([lt_decl_varnames_tagged],
3751ee3e8c14Smrg[m4_assert([$# <= 2])dnl
3752ee3e8c14Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
3753ee3e8c14Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
3754ee3e8c14Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
3755ee3e8c14Smrgm4_define([_lt_decl_varnames_tagged],
3756ee3e8c14Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
3757ba064abeSmrg
3758ba064abeSmrg
3759ee3e8c14Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
3760ee3e8c14Smrg# ------------------------------------------------
3761ee3e8c14Smrgm4_define([lt_decl_all_varnames],
3762ee3e8c14Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
3763ee3e8c14Smrg     m4_if([$2], [],
3764ee3e8c14Smrg	   m4_quote(lt_decl_varnames),
3765ee3e8c14Smrg	m4_quote(m4_shift($@))))[]dnl
3766ee3e8c14Smrg])
3767ee3e8c14Smrgm4_define([_lt_decl_all_varnames],
3768ee3e8c14Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
3769ee3e8c14Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
3770ee3e8c14Smrg])
3771ba064abeSmrg
3772ba064abeSmrg
3773ee3e8c14Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
3774ee3e8c14Smrg# ------------------------------------
3775ee3e8c14Smrg# Quote a variable value, and forward it to 'config.status' so that its
3776ee3e8c14Smrg# declaration there will have the same value as in 'configure'.  VARNAME
3777ee3e8c14Smrg# must have a single quote delimited value for this to work.
3778ee3e8c14Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
3779ee3e8c14Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
3780d9dcd5aeSmrg
3781ba064abeSmrg
3782ee3e8c14Smrg# _LT_CONFIG_STATUS_DECLARATIONS
3783ee3e8c14Smrg# ------------------------------
3784ee3e8c14Smrg# We delimit libtool config variables with single quotes, so when
3785ee3e8c14Smrg# we write them to config.status, we have to be sure to quote all
3786ee3e8c14Smrg# embedded single quotes properly.  In configure, this macro expands
3787ee3e8c14Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
3788ee3e8c14Smrg#
3789ee3e8c14Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
3790ee3e8c14Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
3791ee3e8c14Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
3792ee3e8c14Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
3793ba064abeSmrg
3794d9dcd5aeSmrg
3795ee3e8c14Smrg# _LT_LIBTOOL_TAGS
3796ee3e8c14Smrg# ----------------
3797ee3e8c14Smrg# Output comment and list of tags supported by the script
3798ee3e8c14Smrgm4_defun([_LT_LIBTOOL_TAGS],
3799ee3e8c14Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
3800ee3e8c14Smrgavailable_tags='_LT_TAGS'dnl
3801ee3e8c14Smrg])
3802d9dcd5aeSmrg
3803d9dcd5aeSmrg
3804ee3e8c14Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
3805ee3e8c14Smrg# -----------------------------------
3806ee3e8c14Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
3807ee3e8c14Smrg# expand to a commented shell variable setting:
3808ee3e8c14Smrg#
3809ee3e8c14Smrg#    # Some comment about what VAR is for.
3810ee3e8c14Smrg#    visible_name=$lt_internal_name
3811ee3e8c14Smrgm4_define([_LT_LIBTOOL_DECLARE],
3812ee3e8c14Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
3813ee3e8c14Smrg					   [description])))[]dnl
3814ee3e8c14Smrgm4_pushdef([_libtool_name],
3815ee3e8c14Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
3816ee3e8c14Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
3817ee3e8c14Smrg    [0], [_libtool_name=[$]$1],
3818ee3e8c14Smrg    [1], [_libtool_name=$lt_[]$1],
3819ee3e8c14Smrg    [2], [_libtool_name=$lt_[]$1],
3820ee3e8c14Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
3821ee3e8c14Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
3822ee3e8c14Smrg])
3823d9dcd5aeSmrg
3824ba064abeSmrg
3825ee3e8c14Smrg# _LT_LIBTOOL_CONFIG_VARS
3826ee3e8c14Smrg# -----------------------
3827ee3e8c14Smrg# Produce commented declarations of non-tagged libtool config variables
3828ee3e8c14Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
3829ee3e8c14Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
3830ee3e8c14Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
3831ee3e8c14Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
3832ee3e8c14Smrg[m4_foreach([_lt_var],
3833ee3e8c14Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
3834ee3e8c14Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
3835ba064abeSmrg
3836ba064abeSmrg
3837ee3e8c14Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
3838ee3e8c14Smrg# -------------------------
3839ee3e8c14Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
3840ee3e8c14Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
3841ee3e8c14Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
3842ba064abeSmrg
3843ba064abeSmrg
3844ee3e8c14Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
3845ee3e8c14Smrg# ------------------------------
3846ee3e8c14Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
3847ba064abeSmrg
3848ba064abeSmrg
3849ee3e8c14Smrg# _LT_CONFIG_COMMANDS
3850ee3e8c14Smrg# -------------------
3851ee3e8c14Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
3852ee3e8c14Smrg# variables for single and double quote escaping we saved from calls
3853ee3e8c14Smrg# to _LT_DECL, we can put quote escaped variables declarations
3854ee3e8c14Smrg# into 'config.status', and then the shell code to quote escape them in
3855ee3e8c14Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
3856ee3e8c14Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
3857ee3e8c14Smrgm4_defun([_LT_CONFIG_COMMANDS],
3858ee3e8c14Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
3859ee3e8c14Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
3860ee3e8c14Smrg	dnl instead of duplicating it all over again into config.status,
3861ee3e8c14Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
3862ee3e8c14Smrg	dnl needs to know what name is stored there:
3863ee3e8c14Smrg        [AC_CONFIG_COMMANDS([libtool],
3864ee3e8c14Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
3865ee3e8c14Smrg    dnl If the libtool generation code is destined for config.status,
3866ee3e8c14Smrg    dnl expand the accumulated commands and init code now:
3867ee3e8c14Smrg    [AC_CONFIG_COMMANDS([libtool],
3868ee3e8c14Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
3869ee3e8c14Smrg])#_LT_CONFIG_COMMANDS
3870d9dcd5aeSmrg
3871ee3e8c14Smrg
3872ee3e8c14Smrg# Initialize.
3873ee3e8c14Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
3874ee3e8c14Smrg[
3875ee3e8c14Smrg
3876ee3e8c14Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
3877ee3e8c14Smrg# if CDPATH is set.
3878ee3e8c14Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3879ee3e8c14Smrg
3880ee3e8c14Smrgsed_quote_subst='$sed_quote_subst'
3881ee3e8c14Smrgdouble_quote_subst='$double_quote_subst'
3882ee3e8c14Smrgdelay_variable_subst='$delay_variable_subst'
3883ee3e8c14Smrg_LT_CONFIG_STATUS_DECLARATIONS
3884ee3e8c14SmrgLTCC='$LTCC'
3885ee3e8c14SmrgLTCFLAGS='$LTCFLAGS'
3886ee3e8c14Smrgcompiler='$compiler_DEFAULT'
3887ee3e8c14Smrg
3888ee3e8c14Smrg# A function that is used when there is no print builtin or printf.
3889ee3e8c14Smrgfunc_fallback_echo ()
3890ee3e8c14Smrg{
3891ee3e8c14Smrg  eval 'cat <<_LTECHO_EOF
3892ee3e8c14Smrg\$[]1
3893ee3e8c14Smrg_LTECHO_EOF'
3894ee3e8c14Smrg}
3895ee3e8c14Smrg
3896ee3e8c14Smrg# Quote evaled strings.
3897ee3e8c14Smrgfor var in lt_decl_all_varnames([[ \
3898ee3e8c14Smrg]], lt_decl_quote_varnames); do
3899ee3e8c14Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
3900ee3e8c14Smrg    *[[\\\\\\\`\\"\\\$]]*)
3901ee3e8c14Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
3902d9dcd5aeSmrg      ;;
3903d9dcd5aeSmrg    *)
3904ee3e8c14Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
3905d9dcd5aeSmrg      ;;
3906d9dcd5aeSmrg    esac
3907ee3e8c14Smrgdone
3908ba064abeSmrg
3909ee3e8c14Smrg# Double-quote double-evaled strings.
3910ee3e8c14Smrgfor var in lt_decl_all_varnames([[ \
3911ee3e8c14Smrg]], lt_decl_dquote_varnames); do
3912ee3e8c14Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
3913ee3e8c14Smrg    *[[\\\\\\\`\\"\\\$]]*)
3914ee3e8c14Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
3915ee3e8c14Smrg      ;;
3916ee3e8c14Smrg    *)
3917ee3e8c14Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
3918ee3e8c14Smrg      ;;
3919ee3e8c14Smrg    esac
3920ee3e8c14Smrgdone
3921ba064abeSmrg
3922ee3e8c14Smrg_LT_OUTPUT_LIBTOOL_INIT
3923ee3e8c14Smrg])
3924ba064abeSmrg
3925ee3e8c14Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
3926ee3e8c14Smrg# ------------------------------------
3927ee3e8c14Smrg# Generate a child script FILE with all initialization necessary to
3928ee3e8c14Smrg# reuse the environment learned by the parent script, and make the
3929ee3e8c14Smrg# file executable.  If COMMENT is supplied, it is inserted after the
3930ee3e8c14Smrg# '#!' sequence but before initialization text begins.  After this
3931ee3e8c14Smrg# macro, additional text can be appended to FILE to form the body of
3932ee3e8c14Smrg# the child script.  The macro ends with non-zero status if the
3933ee3e8c14Smrg# file could not be fully written (such as if the disk is full).
3934ee3e8c14Smrgm4_ifdef([AS_INIT_GENERATED],
3935ee3e8c14Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
3936ee3e8c14Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
3937ee3e8c14Smrg[m4_require([AS_PREPARE])]dnl
3938ee3e8c14Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
3939ee3e8c14Smrg[lt_write_fail=0
3940ee3e8c14Smrgcat >$1 <<_ASEOF || lt_write_fail=1
3941ee3e8c14Smrg#! $SHELL
3942ee3e8c14Smrg# Generated by $as_me.
3943ee3e8c14Smrg$2
3944ee3e8c14SmrgSHELL=\${CONFIG_SHELL-$SHELL}
3945ee3e8c14Smrgexport SHELL
3946ee3e8c14Smrg_ASEOF
3947ee3e8c14Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
3948ee3e8c14SmrgAS_SHELL_SANITIZE
3949ee3e8c14Smrg_AS_PREPARE
3950ee3e8c14Smrgexec AS_MESSAGE_FD>&1
3951ee3e8c14Smrg_ASEOF
3952ee3e8c14Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
3953ee3e8c14Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
3954ba064abeSmrg
3955ee3e8c14Smrg# LT_OUTPUT
3956ee3e8c14Smrg# ---------
3957ee3e8c14Smrg# This macro allows early generation of the libtool script (before
3958ee3e8c14Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
3959ee3e8c14Smrg# tests.
3960ee3e8c14SmrgAC_DEFUN([LT_OUTPUT],
3961ee3e8c14Smrg[: ${CONFIG_LT=./config.lt}
3962ee3e8c14SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
3963ee3e8c14Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
3964ee3e8c14Smrg[# Run this file to recreate a libtool stub with the current configuration.])
3965ba064abeSmrg
3966ee3e8c14Smrgcat >>"$CONFIG_LT" <<\_LTEOF
3967ee3e8c14Smrglt_cl_silent=false
3968ee3e8c14Smrgexec AS_MESSAGE_LOG_FD>>config.log
3969ee3e8c14Smrg{
3970ee3e8c14Smrg  echo
3971ee3e8c14Smrg  AS_BOX([Running $as_me.])
3972ee3e8c14Smrg} >&AS_MESSAGE_LOG_FD
3973d9dcd5aeSmrg
3974ee3e8c14Smrglt_cl_help="\
3975ee3e8c14Smrg'$as_me' creates a local libtool stub from the current configuration,
3976ee3e8c14Smrgfor use in further configure time tests before the real libtool is
3977ee3e8c14Smrggenerated.
3978d9dcd5aeSmrg
3979ee3e8c14SmrgUsage: $[0] [[OPTIONS]]
3980d9dcd5aeSmrg
3981ee3e8c14Smrg  -h, --help      print this help, then exit
3982ee3e8c14Smrg  -V, --version   print version number, then exit
3983ee3e8c14Smrg  -q, --quiet     do not print progress messages
3984ee3e8c14Smrg  -d, --debug     don't remove temporary files
3985ba064abeSmrg
3986ee3e8c14SmrgReport bugs to <bug-libtool@gnu.org>."
3987ba064abeSmrg
3988ee3e8c14Smrglt_cl_version="\
3989ee3e8c14Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
3990ee3e8c14Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
3991ee3e8c14Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
3992ee3e8c14Smrg
3993ee3e8c14SmrgCopyright (C) 2011 Free Software Foundation, Inc.
3994ee3e8c14SmrgThis config.lt script is free software; the Free Software Foundation
3995ee3e8c14Smrggives unlimited permision to copy, distribute and modify it."
3996ee3e8c14Smrg
3997ee3e8c14Smrgwhile test 0 != $[#]
3998ee3e8c14Smrgdo
3999ee3e8c14Smrg  case $[1] in
4000ee3e8c14Smrg    --version | --v* | -V )
4001ee3e8c14Smrg      echo "$lt_cl_version"; exit 0 ;;
4002ee3e8c14Smrg    --help | --h* | -h )
4003ee3e8c14Smrg      echo "$lt_cl_help"; exit 0 ;;
4004ee3e8c14Smrg    --debug | --d* | -d )
4005ee3e8c14Smrg      debug=: ;;
4006ee3e8c14Smrg    --quiet | --q* | --silent | --s* | -q )
4007ee3e8c14Smrg      lt_cl_silent=: ;;
4008ee3e8c14Smrg
4009ee3e8c14Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
4010ee3e8c14SmrgTry '$[0] --help' for more information.]) ;;
4011ee3e8c14Smrg
4012ee3e8c14Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
4013ee3e8c14SmrgTry '$[0] --help' for more information.]) ;;
4014d9dcd5aeSmrg  esac
4015ee3e8c14Smrg  shift
4016ee3e8c14Smrgdone
4017ba064abeSmrg
4018ee3e8c14Smrgif $lt_cl_silent; then
4019ee3e8c14Smrg  exec AS_MESSAGE_FD>/dev/null
4020ee3e8c14Smrgfi
4021ee3e8c14Smrg_LTEOF
4022ba064abeSmrg
4023ee3e8c14Smrgcat >>"$CONFIG_LT" <<_LTEOF
4024ee3e8c14Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
4025ee3e8c14Smrg_LTEOF
4026ba064abeSmrg
4027ee3e8c14Smrgcat >>"$CONFIG_LT" <<\_LTEOF
4028ee3e8c14SmrgAC_MSG_NOTICE([creating $ofile])
4029ee3e8c14Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
4030ee3e8c14SmrgAS_EXIT(0)
4031ee3e8c14Smrg_LTEOF
4032ee3e8c14Smrgchmod +x "$CONFIG_LT"
4033ba064abeSmrg
4034ee3e8c14Smrg# configure is writing to config.log, but config.lt does its own redirection,
4035ee3e8c14Smrg# appending to config.log, which fails on DOS, as config.log is still kept
4036ee3e8c14Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
4037ee3e8c14Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
4038ee3e8c14Smrglt_cl_success=:
4039ee3e8c14Smrgtest yes = "$silent" &&
4040ee3e8c14Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
4041ee3e8c14Smrgexec AS_MESSAGE_LOG_FD>/dev/null
4042ee3e8c14Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
4043ee3e8c14Smrgexec AS_MESSAGE_LOG_FD>>config.log
4044ee3e8c14Smrg$lt_cl_success || AS_EXIT(1)
4045ee3e8c14Smrg])# LT_OUTPUT
4046ba064abeSmrg
4047ba064abeSmrg
4048ee3e8c14Smrg# _LT_CONFIG(TAG)
4049ee3e8c14Smrg# ---------------
4050ee3e8c14Smrg# If TAG is the built-in tag, create an initial libtool script with a
4051ee3e8c14Smrg# default configuration from the untagged config vars.  Otherwise add code
4052ee3e8c14Smrg# to config.status for appending the configuration named by TAG from the
4053ee3e8c14Smrg# matching tagged config vars.
4054ee3e8c14Smrgm4_defun([_LT_CONFIG],
4055ee3e8c14Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4056ee3e8c14Smrg_LT_CONFIG_SAVE_COMMANDS([
4057ee3e8c14Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
4058ee3e8c14Smrg  m4_if(_LT_TAG, [C], [
4059ee3e8c14Smrg    # See if we are running on zsh, and set the options that allow our
4060ee3e8c14Smrg    # commands through without removal of \ escapes.
4061ee3e8c14Smrg    if test -n "${ZSH_VERSION+set}"; then
4062ee3e8c14Smrg      setopt NO_GLOB_SUBST
4063ee3e8c14Smrg    fi
4064ba064abeSmrg
4065ee3e8c14Smrg    cfgfile=${ofile}T
4066ee3e8c14Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
4067ee3e8c14Smrg    $RM "$cfgfile"
4068191cded7Smrg
4069ee3e8c14Smrg    cat <<_LT_EOF >> "$cfgfile"
4070ee3e8c14Smrg#! $SHELL
4071ee3e8c14Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
4072ee3e8c14Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4073ee3e8c14Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4074191cded7Smrg
4075ee3e8c14Smrg# Provide generalized library-building support services.
4076ee3e8c14Smrg# Written by Gordon Matzigkeit, 1996
4077191cded7Smrg
4078ee3e8c14Smrg_LT_COPYING
4079ee3e8c14Smrg_LT_LIBTOOL_TAGS
4080191cded7Smrg
4081ee3e8c14Smrg# Configured defaults for sys_lib_dlsearch_path munging.
4082ee3e8c14Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
4083191cded7Smrg
4084ee3e8c14Smrg# ### BEGIN LIBTOOL CONFIG
4085ee3e8c14Smrg_LT_LIBTOOL_CONFIG_VARS
4086ee3e8c14Smrg_LT_LIBTOOL_TAG_VARS
4087ee3e8c14Smrg# ### END LIBTOOL CONFIG
4088191cded7Smrg
4089ee3e8c14Smrg_LT_EOF
4090191cded7Smrg
4091ee3e8c14Smrg    cat <<'_LT_EOF' >> "$cfgfile"
4092191cded7Smrg
4093ee3e8c14Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
4094191cded7Smrg
4095ee3e8c14Smrg_LT_PREPARE_MUNGE_PATH_LIST
4096ee3e8c14Smrg_LT_PREPARE_CC_BASENAME
4097191cded7Smrg
4098ee3e8c14Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
4099191cded7Smrg
4100ee3e8c14Smrg_LT_EOF
4101191cded7Smrg
4102ee3e8c14Smrg  case $host_os in
4103ee3e8c14Smrg  aix3*)
4104ee3e8c14Smrg    cat <<\_LT_EOF >> "$cfgfile"
4105ee3e8c14Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
4106ee3e8c14Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
4107ee3e8c14Smrg# vanish in a puff of smoke.
4108ee3e8c14Smrgif test set != "${COLLECT_NAMES+set}"; then
4109ee3e8c14Smrg  COLLECT_NAMES=
4110ee3e8c14Smrg  export COLLECT_NAMES
4111ee3e8c14Smrgfi
4112ee3e8c14Smrg_LT_EOF
4113ee3e8c14Smrg    ;;
4114ee3e8c14Smrg  esac
4115191cded7Smrg
4116ee3e8c14Smrg  _LT_PROG_LTMAIN
4117191cded7Smrg
4118ee3e8c14Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
4119ee3e8c14Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4120ee3e8c14Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
4121ee3e8c14Smrg  # is reportedly fixed, but why not run on old versions too?
4122ee3e8c14Smrg  $SED '$q' "$ltmain" >> "$cfgfile" \
4123ee3e8c14Smrg     || (rm -f "$cfgfile"; exit 1)
4124191cded7Smrg
4125ee3e8c14Smrg   mv -f "$cfgfile" "$ofile" ||
4126ee3e8c14Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4127ee3e8c14Smrg  chmod +x "$ofile"
4128ee3e8c14Smrg],
4129ee3e8c14Smrg[cat <<_LT_EOF >> "$ofile"
4130191cded7Smrg
4131ee3e8c14Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
4132ee3e8c14Smrgdnl in a comment (ie after a #).
4133ee3e8c14Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
4134ee3e8c14Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
4135ee3e8c14Smrg# ### END LIBTOOL TAG CONFIG: $1
4136ee3e8c14Smrg_LT_EOF
4137ee3e8c14Smrg])dnl /m4_if
4138ee3e8c14Smrg],
4139ee3e8c14Smrg[m4_if([$1], [], [
4140ee3e8c14Smrg    PACKAGE='$PACKAGE'
4141ee3e8c14Smrg    VERSION='$VERSION'
4142ee3e8c14Smrg    RM='$RM'
4143ee3e8c14Smrg    ofile='$ofile'], [])
4144ee3e8c14Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
4145ee3e8c14Smrg])# _LT_CONFIG
4146191cded7Smrg
4147191cded7Smrg
4148ee3e8c14Smrg# LT_SUPPORTED_TAG(TAG)
4149ee3e8c14Smrg# ---------------------
4150ee3e8c14Smrg# Trace this macro to discover what tags are supported by the libtool
4151ee3e8c14Smrg# --tag option, using:
4152ee3e8c14Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
4153ee3e8c14SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
4154191cded7Smrg
4155d9dcd5aeSmrg
4156ee3e8c14Smrg# C support is built-in for now
4157ee3e8c14Smrgm4_define([_LT_LANG_C_enabled], [])
4158ee3e8c14Smrgm4_define([_LT_TAGS], [])
4159d9dcd5aeSmrg
4160191cded7Smrg
4161ee3e8c14Smrg# LT_LANG(LANG)
4162ee3e8c14Smrg# -------------
4163ee3e8c14Smrg# Enable libtool support for the given language if not already enabled.
4164ee3e8c14SmrgAC_DEFUN([LT_LANG],
4165ee3e8c14Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
4166ee3e8c14Smrgm4_case([$1],
4167ee3e8c14Smrg  [C],			[_LT_LANG(C)],
4168ee3e8c14Smrg  [C++],		[_LT_LANG(CXX)],
4169ee3e8c14Smrg  [Go],			[_LT_LANG(GO)],
4170ee3e8c14Smrg  [Java],		[_LT_LANG(GCJ)],
4171ee3e8c14Smrg  [Fortran 77],		[_LT_LANG(F77)],
4172ee3e8c14Smrg  [Fortran],		[_LT_LANG(FC)],
4173ee3e8c14Smrg  [Windows Resource],	[_LT_LANG(RC)],
4174ee3e8c14Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
4175ee3e8c14Smrg    [_LT_LANG($1)],
4176ee3e8c14Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
4177ee3e8c14Smrg])# LT_LANG
4178191cded7Smrg
4179d9dcd5aeSmrg
4180ee3e8c14Smrg# _LT_LANG(LANGNAME)
4181ee3e8c14Smrg# ------------------
4182ee3e8c14Smrgm4_defun([_LT_LANG],
4183ee3e8c14Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
4184ee3e8c14Smrg  [LT_SUPPORTED_TAG([$1])dnl
4185ee3e8c14Smrg  m4_append([_LT_TAGS], [$1 ])dnl
4186ee3e8c14Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
4187ee3e8c14Smrg  _LT_LANG_$1_CONFIG($1)])dnl
4188ee3e8c14Smrg])# _LT_LANG
4189ee3e8c14Smrg
4190ee3e8c14Smrg
4191ee3e8c14Smrgm4_ifndef([AC_PROG_GO], [
4192ee3e8c14Smrg# NOTE: This macro has been submitted for inclusion into   #
4193ee3e8c14Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
4194ee3e8c14Smrg#  a released version of Autoconf we should remove this    #
4195ee3e8c14Smrg#  macro and use it instead.                               #
4196ee3e8c14Smrgm4_defun([AC_PROG_GO],
4197ee3e8c14Smrg[AC_LANG_PUSH(Go)dnl
4198ee3e8c14SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
4199ee3e8c14SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
4200ee3e8c14Smrg_AC_ARG_VAR_LDFLAGS()dnl
4201ee3e8c14SmrgAC_CHECK_TOOL(GOC, gccgo)
4202ee3e8c14Smrgif test -z "$GOC"; then
4203d9dcd5aeSmrg  if test -n "$ac_tool_prefix"; then
4204ee3e8c14Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
4205d9dcd5aeSmrg  fi
4206d9dcd5aeSmrgfi
4207ee3e8c14Smrgif test -z "$GOC"; then
4208ee3e8c14Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
4209ee3e8c14Smrgfi
4210ee3e8c14Smrg])#m4_defun
4211ee3e8c14Smrg])#m4_ifndef
4212d9dcd5aeSmrg
4213d9dcd5aeSmrg
4214ee3e8c14Smrg# _LT_LANG_DEFAULT_CONFIG
4215ee3e8c14Smrg# -----------------------
4216ee3e8c14Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
4217ee3e8c14Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
4218ee3e8c14Smrg  [LT_LANG(CXX)],
4219ee3e8c14Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
4220d9dcd5aeSmrg
4221ee3e8c14SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
4222ee3e8c14Smrg  [LT_LANG(F77)],
4223ee3e8c14Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
4224d9dcd5aeSmrg
4225ee3e8c14SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
4226ee3e8c14Smrg  [LT_LANG(FC)],
4227ee3e8c14Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
4228191cded7Smrg
4229ee3e8c14Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
4230ee3e8c14Smrgdnl pulling things in needlessly.
4231ee3e8c14SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
4232ee3e8c14Smrg  [LT_LANG(GCJ)],
4233ee3e8c14Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
4234ee3e8c14Smrg    [LT_LANG(GCJ)],
4235ee3e8c14Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
4236ee3e8c14Smrg      [LT_LANG(GCJ)],
4237ee3e8c14Smrg      [m4_ifdef([AC_PROG_GCJ],
4238ee3e8c14Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
4239ee3e8c14Smrg       m4_ifdef([A][M_PROG_GCJ],
4240ee3e8c14Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
4241ee3e8c14Smrg       m4_ifdef([LT_PROG_GCJ],
4242ee3e8c14Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
4243ba064abeSmrg
4244ee3e8c14SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
4245ee3e8c14Smrg  [LT_LANG(GO)],
4246ee3e8c14Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
4247ba064abeSmrg
4248ee3e8c14SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
4249ee3e8c14Smrg  [LT_LANG(RC)],
4250ee3e8c14Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
4251ee3e8c14Smrg])# _LT_LANG_DEFAULT_CONFIG
4252d9dcd5aeSmrg
4253ee3e8c14Smrg# Obsolete macros:
4254ee3e8c14SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
4255ee3e8c14SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
4256ee3e8c14SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
4257ee3e8c14SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
4258ee3e8c14SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
4259ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
4260ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
4261ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
4262ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
4263ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
4264ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
4265191cded7Smrg
4266d9dcd5aeSmrg
4267ee3e8c14Smrg# _LT_TAG_COMPILER
4268ee3e8c14Smrg# ----------------
4269ee3e8c14Smrgm4_defun([_LT_TAG_COMPILER],
4270ee3e8c14Smrg[AC_REQUIRE([AC_PROG_CC])dnl
4271d9dcd5aeSmrg
4272ee3e8c14Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
4273ee3e8c14Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
4274ee3e8c14Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
4275ee3e8c14Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
4276d9dcd5aeSmrg
4277ee3e8c14Smrg# If no C compiler was specified, use CC.
4278ee3e8c14SmrgLTCC=${LTCC-"$CC"}
4279d9dcd5aeSmrg
4280ee3e8c14Smrg# If no C compiler flags were specified, use CFLAGS.
4281ee3e8c14SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
4282191cded7Smrg
4283ee3e8c14Smrg# Allow CC to be a program name with arguments.
4284ee3e8c14Smrgcompiler=$CC
4285ee3e8c14Smrg])# _LT_TAG_COMPILER
4286191cded7Smrg
4287ba064abeSmrg
4288ee3e8c14Smrg# _LT_COMPILER_BOILERPLATE
4289ee3e8c14Smrg# ------------------------
4290ee3e8c14Smrg# Check for compiler boilerplate output or warnings with
4291ee3e8c14Smrg# the simple compiler test code.
4292ee3e8c14Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
4293ee3e8c14Smrg[m4_require([_LT_DECL_SED])dnl
4294ee3e8c14Smrgac_outfile=conftest.$ac_objext
4295ee3e8c14Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
4296ee3e8c14Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
4297ee3e8c14Smrg_lt_compiler_boilerplate=`cat conftest.err`
4298ee3e8c14Smrg$RM conftest*
4299ee3e8c14Smrg])# _LT_COMPILER_BOILERPLATE
4300191cded7Smrg
4301191cded7Smrg
4302ee3e8c14Smrg# _LT_LINKER_BOILERPLATE
4303ee3e8c14Smrg# ----------------------
4304ee3e8c14Smrg# Check for linker boilerplate output or warnings with
4305ee3e8c14Smrg# the simple link test code.
4306ee3e8c14Smrgm4_defun([_LT_LINKER_BOILERPLATE],
4307ee3e8c14Smrg[m4_require([_LT_DECL_SED])dnl
4308ee3e8c14Smrgac_outfile=conftest.$ac_objext
4309ee3e8c14Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
4310ee3e8c14Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
4311ee3e8c14Smrg_lt_linker_boilerplate=`cat conftest.err`
4312ee3e8c14Smrg$RM -r conftest*
4313ee3e8c14Smrg])# _LT_LINKER_BOILERPLATE
4314ba064abeSmrg
4315ee3e8c14Smrg# _LT_REQUIRED_DARWIN_CHECKS
4316ee3e8c14Smrg# -------------------------
4317ee3e8c14Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
4318ee3e8c14Smrg  case $host_os in
4319ee3e8c14Smrg    rhapsody* | darwin*)
4320ee3e8c14Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
4321ee3e8c14Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
4322ee3e8c14Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
4323ee3e8c14Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
4324ee3e8c14Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
4325ee3e8c14Smrg    _LT_DECL([], [DSYMUTIL], [1],
4326ee3e8c14Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
4327ee3e8c14Smrg    _LT_DECL([], [NMEDIT], [1],
4328ee3e8c14Smrg      [Tool to change global to local symbols on Mac OS X])
4329ee3e8c14Smrg    _LT_DECL([], [LIPO], [1],
4330ee3e8c14Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
4331ee3e8c14Smrg    _LT_DECL([], [OTOOL], [1],
4332ee3e8c14Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
4333ee3e8c14Smrg    _LT_DECL([], [OTOOL64], [1],
4334ee3e8c14Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
4335ba064abeSmrg
4336ee3e8c14Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
4337ee3e8c14Smrg      [lt_cv_apple_cc_single_mod=no
4338ee3e8c14Smrg      if test -z "$LT_MULTI_MODULE"; then
4339ee3e8c14Smrg	# By default we will add the -single_module flag. You can override
4340ee3e8c14Smrg	# by either setting the environment variable LT_MULTI_MODULE
4341ee3e8c14Smrg	# non-empty at configure time, or by adding -multi_module to the
4342ee3e8c14Smrg	# link flags.
4343ee3e8c14Smrg	rm -rf libconftest.dylib*
4344ee3e8c14Smrg	echo "int foo(void){return 1;}" > conftest.c
4345ee3e8c14Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
4346ee3e8c14Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
4347ee3e8c14Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
4348ee3e8c14Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
4349ee3e8c14Smrg        _lt_result=$?
4350ee3e8c14Smrg	# If there is a non-empty error log, and "single_module"
4351ee3e8c14Smrg	# appears in it, assume the flag caused a linker warning
4352ee3e8c14Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
4353ee3e8c14Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
4354ee3e8c14Smrg	# Otherwise, if the output was created with a 0 exit code from
4355ee3e8c14Smrg	# the compiler, it worked.
4356ee3e8c14Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
4357ee3e8c14Smrg	  lt_cv_apple_cc_single_mod=yes
4358ee3e8c14Smrg	else
4359ee3e8c14Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
4360ee3e8c14Smrg	fi
4361ee3e8c14Smrg	rm -rf libconftest.dylib*
4362ee3e8c14Smrg	rm -f conftest.*
4363ee3e8c14Smrg      fi])
4364191cded7Smrg
4365ee3e8c14Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
4366ee3e8c14Smrg      [lt_cv_ld_exported_symbols_list],
4367ee3e8c14Smrg      [lt_cv_ld_exported_symbols_list=no
4368ee3e8c14Smrg      save_LDFLAGS=$LDFLAGS
4369ee3e8c14Smrg      echo "_main" > conftest.sym
4370ee3e8c14Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
4371ee3e8c14Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
4372ee3e8c14Smrg	[lt_cv_ld_exported_symbols_list=yes],
4373ee3e8c14Smrg	[lt_cv_ld_exported_symbols_list=no])
4374ee3e8c14Smrg	LDFLAGS=$save_LDFLAGS
4375ee3e8c14Smrg    ])
4376ba064abeSmrg
4377ee3e8c14Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
4378ee3e8c14Smrg      [lt_cv_ld_force_load=no
4379ee3e8c14Smrg      cat > conftest.c << _LT_EOF
4380ee3e8c14Smrgint forced_loaded() { return 2;}
4381ee3e8c14Smrg_LT_EOF
4382ee3e8c14Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
4383ee3e8c14Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
4384ee3e8c14Smrg      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
4385ee3e8c14Smrg      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
4386ee3e8c14Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
4387ee3e8c14Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
4388ee3e8c14Smrg      cat > conftest.c << _LT_EOF
4389ee3e8c14Smrgint main() { return 0;}
4390ee3e8c14Smrg_LT_EOF
4391ee3e8c14Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
4392ee3e8c14Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
4393ee3e8c14Smrg      _lt_result=$?
4394ee3e8c14Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
4395ee3e8c14Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
4396ee3e8c14Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
4397ee3e8c14Smrg	lt_cv_ld_force_load=yes
4398ee3e8c14Smrg      else
4399ee3e8c14Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
4400ee3e8c14Smrg      fi
4401ee3e8c14Smrg        rm -f conftest.err libconftest.a conftest conftest.c
4402ee3e8c14Smrg        rm -rf conftest.dSYM
4403ee3e8c14Smrg    ])
4404ee3e8c14Smrg    case $host_os in
4405ee3e8c14Smrg    rhapsody* | darwin1.[[012]])
4406ee3e8c14Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
4407ee3e8c14Smrg    darwin1.*)
4408ee3e8c14Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
4409ee3e8c14Smrg    darwin*)
4410ee3e8c14Smrg      case $MACOSX_DEPLOYMENT_TARGET,$host in
4411ee3e8c14Smrg        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
4412ee3e8c14Smrg          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
4413ee3e8c14Smrg        *)
4414ee3e8c14Smrg          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
4415ee3e8c14Smrg      esac
4416ba064abeSmrg    ;;
4417ba064abeSmrg  esac
4418ee3e8c14Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
4419ee3e8c14Smrg      _lt_dar_single_mod='$single_module'
4420ee3e8c14Smrg    fi
4421ee3e8c14Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
4422ee3e8c14Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
4423ee3e8c14Smrg    else
4424ee3e8c14Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
4425ee3e8c14Smrg    fi
4426ee3e8c14Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
4427ee3e8c14Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
4428ee3e8c14Smrg    else
4429ee3e8c14Smrg      _lt_dsymutil=
4430ee3e8c14Smrg    fi
4431ee3e8c14Smrg    ;;
4432ba064abeSmrg  esac
4433ee3e8c14Smrg])
4434191cded7Smrg
4435191cded7Smrg
4436ee3e8c14Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
4437ee3e8c14Smrg# ---------------------------------
4438ee3e8c14Smrg# Checks for linker and compiler features on darwin
4439ee3e8c14Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
4440ee3e8c14Smrg[
4441ee3e8c14Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
4442ee3e8c14Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
4443ee3e8c14Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4444ee3e8c14Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
4445ee3e8c14Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4446ee3e8c14Smrg  if test yes = "$lt_cv_ld_force_load"; then
4447ee3e8c14Smrg    _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\"`'
4448ee3e8c14Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
4449ee3e8c14Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
4450ba064abeSmrg  else
4451ee3e8c14Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
4452ba064abeSmrg  fi
4453ee3e8c14Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
4454ee3e8c14Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
4455ee3e8c14Smrg  case $cc_basename in
4456ee3e8c14Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
4457ee3e8c14Smrg     *) _lt_dar_can_shared=$GCC ;;
4458ee3e8c14Smrg  esac
4459ee3e8c14Smrg  if test yes = "$_lt_dar_can_shared"; then
4460ee3e8c14Smrg    output_verbose_link_cmd=func_echo_all
4461ee3e8c14Smrg    _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"
4462ee3e8c14Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
4463ee3e8c14Smrg    _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"
4464ee3e8c14Smrg    _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"
4465ee3e8c14Smrg    m4_if([$1], [CXX],
4466ee3e8c14Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
4467ee3e8c14Smrg      _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"
4468ee3e8c14Smrg      _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"
4469ee3e8c14Smrg    fi
4470ee3e8c14Smrg],[])
4471ba064abeSmrg  else
4472ee3e8c14Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
4473ba064abeSmrg  fi
4474ee3e8c14Smrg])
4475191cded7Smrg
4476ee3e8c14Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
4477ee3e8c14Smrg# ----------------------------------
4478ee3e8c14Smrg# Links a minimal program and checks the executable
4479ee3e8c14Smrg# for the system default hardcoded library path. In most cases,
4480ee3e8c14Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
4481ee3e8c14Smrg# the location of the communication and MPI libs are included too.
4482ee3e8c14Smrg# If we don't find anything, use the default library path according
4483ee3e8c14Smrg# to the aix ld manual.
4484ee3e8c14Smrg# Store the results from the different compilers for each TAGNAME.
4485ee3e8c14Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
4486ee3e8c14Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
4487ee3e8c14Smrg[m4_require([_LT_DECL_SED])dnl
4488ee3e8c14Smrgif test set = "${lt_cv_aix_libpath+set}"; then
4489ee3e8c14Smrg  aix_libpath=$lt_cv_aix_libpath
4490ee3e8c14Smrgelse
4491ee3e8c14Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
4492ee3e8c14Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
4493ee3e8c14Smrg  lt_aix_libpath_sed='[
4494ee3e8c14Smrg      /Import File Strings/,/^$/ {
4495ee3e8c14Smrg	  /^0/ {
4496ee3e8c14Smrg	      s/^0  *\([^ ]*\) *$/\1/
4497ee3e8c14Smrg	      p
4498ee3e8c14Smrg	  }
4499ee3e8c14Smrg      }]'
4500ee3e8c14Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
4501ee3e8c14Smrg  # Check for a 64-bit object if we didn't find anything.
4502ee3e8c14Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
4503ee3e8c14Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
4504ee3e8c14Smrg  fi],[])
4505ee3e8c14Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
4506ee3e8c14Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
4507ee3e8c14Smrg  fi
4508ee3e8c14Smrg  ])
4509ee3e8c14Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
4510ee3e8c14Smrgfi
4511ee3e8c14Smrg])# _LT_SYS_MODULE_PATH_AIX
4512191cded7Smrg
4513191cded7Smrg
4514ee3e8c14Smrg# _LT_SHELL_INIT(ARG)
4515ee3e8c14Smrg# -------------------
4516ee3e8c14Smrgm4_define([_LT_SHELL_INIT],
4517ee3e8c14Smrg[m4_divert_text([M4SH-INIT], [$1
4518ee3e8c14Smrg])])# _LT_SHELL_INIT
4519191cded7Smrg
4520191cded7Smrg
4521191cded7Smrg
4522ee3e8c14Smrg# _LT_PROG_ECHO_BACKSLASH
4523ee3e8c14Smrg# -----------------------
4524ee3e8c14Smrg# Find how we can fake an echo command that does not interpret backslash.
4525ee3e8c14Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
4526ee3e8c14Smrg# of the generated configure script that will find a shell with a builtin
4527ee3e8c14Smrg# printf (that we can use as an echo command).
4528ee3e8c14Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
4529ee3e8c14Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4530ee3e8c14SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4531ee3e8c14SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4532191cded7Smrg
4533ee3e8c14SmrgAC_MSG_CHECKING([how to print strings])
4534ee3e8c14Smrg# Test print first, because it will be a builtin if present.
4535ee3e8c14Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
4536ee3e8c14Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
4537ee3e8c14Smrg  ECHO='print -r --'
4538ee3e8c14Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
4539ee3e8c14Smrg  ECHO='printf %s\n'
4540d9dcd5aeSmrgelse
4541ee3e8c14Smrg  # Use this function as a fallback that always works.
4542ee3e8c14Smrg  func_fallback_echo ()
4543ee3e8c14Smrg  {
4544ee3e8c14Smrg    eval 'cat <<_LTECHO_EOF
4545ee3e8c14Smrg$[]1
4546ee3e8c14Smrg_LTECHO_EOF'
4547ee3e8c14Smrg  }
4548ee3e8c14Smrg  ECHO='func_fallback_echo'
4549d9dcd5aeSmrgfi
4550d9dcd5aeSmrg
4551ee3e8c14Smrg# func_echo_all arg...
4552ee3e8c14Smrg# Invoke $ECHO with all args, space-separated.
4553ee3e8c14Smrgfunc_echo_all ()
4554ee3e8c14Smrg{
4555ee3e8c14Smrg    $ECHO "$*"
4556ee3e8c14Smrg}
4557191cded7Smrg
4558ee3e8c14Smrgcase $ECHO in
4559ee3e8c14Smrg  printf*) AC_MSG_RESULT([printf]) ;;
4560ee3e8c14Smrg  print*) AC_MSG_RESULT([print -r]) ;;
4561ee3e8c14Smrg  *) AC_MSG_RESULT([cat]) ;;
4562ba064abeSmrgesac
4563191cded7Smrg
4564ee3e8c14Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
4565ee3e8c14Smrg[_AS_DETECT_SUGGESTED([
4566ee3e8c14Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
4567ee3e8c14Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4568ee3e8c14Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4569ee3e8c14Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4570ee3e8c14Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
4571ee3e8c14Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
4572ee3e8c14Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
4573191cded7Smrg
4574ee3e8c14Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
4575ee3e8c14Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
4576ee3e8c14Smrg])# _LT_PROG_ECHO_BACKSLASH
4577191cded7Smrg
4578191cded7Smrg
4579ee3e8c14Smrg# _LT_WITH_SYSROOT
4580ee3e8c14Smrg# ----------------
4581ee3e8c14SmrgAC_DEFUN([_LT_WITH_SYSROOT],
4582ee3e8c14Smrg[m4_require([_LT_DECL_SED])dnl
4583ee3e8c14SmrgAC_MSG_CHECKING([for sysroot])
4584ee3e8c14SmrgAC_ARG_WITH([sysroot],
4585ee3e8c14Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
4586ee3e8c14Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
4587ee3e8c14Smrg   if not specified).])],
4588ee3e8c14Smrg[], [with_sysroot=no])
4589191cded7Smrg
4590ee3e8c14Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
4591ee3e8c14Smrgdnl in case the user passed a directory name.
4592ee3e8c14Smrglt_sysroot=
4593ee3e8c14Smrgcase $with_sysroot in #(
4594ee3e8c14Smrg yes)
4595ee3e8c14Smrg   if test yes = "$GCC"; then
4596ee3e8c14Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
4597ee3e8c14Smrg   fi
4598ee3e8c14Smrg   ;; #(
4599ee3e8c14Smrg /*)
4600ee3e8c14Smrg   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
4601ee3e8c14Smrg   ;; #(
4602ee3e8c14Smrg no|'')
4603ee3e8c14Smrg   ;; #(
4604ee3e8c14Smrg *)
4605ee3e8c14Smrg   AC_MSG_RESULT([$with_sysroot])
4606ee3e8c14Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
4607ee3e8c14Smrg   ;;
4608d9dcd5aeSmrgesac
4609191cded7Smrg
4610ee3e8c14Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
4611ee3e8c14Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
4612ee3e8c14Smrg[dependent libraries, and where our libraries should be installed.])])
4613191cded7Smrg
4614ee3e8c14Smrg# _LT_ENABLE_LOCK
4615ee3e8c14Smrg# ---------------
4616ee3e8c14Smrgm4_defun([_LT_ENABLE_LOCK],
4617ee3e8c14Smrg[AC_ARG_ENABLE([libtool-lock],
4618ee3e8c14Smrg  [AS_HELP_STRING([--disable-libtool-lock],
4619ee3e8c14Smrg    [avoid locking (might break parallel builds)])])
4620ee3e8c14Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
4621ba064abeSmrg
4622ee3e8c14Smrg# Some flags need to be propagated to the compiler or linker for good
4623ee3e8c14Smrg# libtool support.
4624ee3e8c14Smrgcase $host in
4625ee3e8c14Smrgia64-*-hpux*)
4626ee3e8c14Smrg  # Find out what ABI is being produced by ac_compile, and set mode
4627ee3e8c14Smrg  # options accordingly.
4628ee3e8c14Smrg  echo 'int i;' > conftest.$ac_ext
4629ee3e8c14Smrg  if AC_TRY_EVAL(ac_compile); then
4630ee3e8c14Smrg    case `$FILECMD conftest.$ac_objext` in
4631ee3e8c14Smrg      *ELF-32*)
4632ee3e8c14Smrg	HPUX_IA64_MODE=32
4633ee3e8c14Smrg	;;
4634ee3e8c14Smrg      *ELF-64*)
4635ee3e8c14Smrg	HPUX_IA64_MODE=64
4636ee3e8c14Smrg	;;
4637ee3e8c14Smrg    esac
4638191cded7Smrg  fi
4639ee3e8c14Smrg  rm -rf conftest*
4640ba064abeSmrg  ;;
4641ee3e8c14Smrg*-*-irix6*)
4642ee3e8c14Smrg  # Find out what ABI is being produced by ac_compile, and set linker
4643ee3e8c14Smrg  # options accordingly.
4644ee3e8c14Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4645ee3e8c14Smrg  if AC_TRY_EVAL(ac_compile); then
4646ee3e8c14Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
4647ee3e8c14Smrg      case `$FILECMD conftest.$ac_objext` in
4648ee3e8c14Smrg	*32-bit*)
4649ee3e8c14Smrg	  LD="${LD-ld} -melf32bsmip"
4650ee3e8c14Smrg	  ;;
4651ee3e8c14Smrg	*N32*)
4652ee3e8c14Smrg	  LD="${LD-ld} -melf32bmipn32"
4653ee3e8c14Smrg	  ;;
4654ee3e8c14Smrg	*64-bit*)
4655ee3e8c14Smrg	  LD="${LD-ld} -melf64bmip"
4656ee3e8c14Smrg	;;
4657ee3e8c14Smrg      esac
4658ee3e8c14Smrg    else
4659ee3e8c14Smrg      case `$FILECMD conftest.$ac_objext` in
4660ee3e8c14Smrg	*32-bit*)
4661ee3e8c14Smrg	  LD="${LD-ld} -32"
4662ee3e8c14Smrg	  ;;
4663ee3e8c14Smrg	*N32*)
4664ee3e8c14Smrg	  LD="${LD-ld} -n32"
4665ee3e8c14Smrg	  ;;
4666ee3e8c14Smrg	*64-bit*)
4667ee3e8c14Smrg	  LD="${LD-ld} -64"
4668ee3e8c14Smrg	  ;;
4669ee3e8c14Smrg      esac
4670ee3e8c14Smrg    fi
4671ee3e8c14Smrg  fi
4672ee3e8c14Smrg  rm -rf conftest*
4673191cded7Smrg  ;;
4674ee3e8c14Smrg
4675ee3e8c14Smrgmips64*-*linux*)
4676ee3e8c14Smrg  # Find out what ABI is being produced by ac_compile, and set linker
4677ee3e8c14Smrg  # options accordingly.
4678ee3e8c14Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4679ee3e8c14Smrg  if AC_TRY_EVAL(ac_compile); then
4680ee3e8c14Smrg    emul=elf
4681ee3e8c14Smrg    case `$FILECMD conftest.$ac_objext` in
4682ee3e8c14Smrg      *32-bit*)
4683ee3e8c14Smrg	emul="${emul}32"
4684ee3e8c14Smrg	;;
4685ee3e8c14Smrg      *64-bit*)
4686ee3e8c14Smrg	emul="${emul}64"
4687ee3e8c14Smrg	;;
4688ee3e8c14Smrg    esac
4689ee3e8c14Smrg    case `$FILECMD conftest.$ac_objext` in
4690ee3e8c14Smrg      *MSB*)
4691ee3e8c14Smrg	emul="${emul}btsmip"
4692ee3e8c14Smrg	;;
4693ee3e8c14Smrg      *LSB*)
4694ee3e8c14Smrg	emul="${emul}ltsmip"
4695ee3e8c14Smrg	;;
4696ee3e8c14Smrg    esac
4697ee3e8c14Smrg    case `$FILECMD conftest.$ac_objext` in
4698ee3e8c14Smrg      *N32*)
4699ee3e8c14Smrg	emul="${emul}n32"
4700ee3e8c14Smrg	;;
4701ee3e8c14Smrg    esac
4702ee3e8c14Smrg    LD="${LD-ld} -m $emul"
4703ee3e8c14Smrg  fi
4704ee3e8c14Smrg  rm -rf conftest*
4705ba064abeSmrg  ;;
4706ee3e8c14Smrg
4707ee3e8c14Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
4708ee3e8c14Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
4709ee3e8c14Smrg  # Find out what ABI is being produced by ac_compile, and set linker
4710ee3e8c14Smrg  # options accordingly.  Note that the listed cases only cover the
4711ee3e8c14Smrg  # situations where additional linker options are needed (such as when
4712ee3e8c14Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
4713ee3e8c14Smrg  # vice versa); the common cases where no linker options are needed do
4714ee3e8c14Smrg  # not appear in the list.
4715ee3e8c14Smrg  echo 'int i;' > conftest.$ac_ext
4716ee3e8c14Smrg  if AC_TRY_EVAL(ac_compile); then
4717ee3e8c14Smrg    case `$FILECMD conftest.o` in
4718ee3e8c14Smrg      *32-bit*)
4719ee3e8c14Smrg	case $host in
4720ee3e8c14Smrg	  x86_64-*kfreebsd*-gnu)
4721ee3e8c14Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
4722ee3e8c14Smrg	    ;;
4723ee3e8c14Smrg	  x86_64-*linux*)
4724ee3e8c14Smrg	    case `$FILECMD conftest.o` in
4725ee3e8c14Smrg	      *x86-64*)
4726ee3e8c14Smrg		LD="${LD-ld} -m elf32_x86_64"
4727ee3e8c14Smrg		;;
4728ee3e8c14Smrg	      *)
4729ee3e8c14Smrg		LD="${LD-ld} -m elf_i386"
4730ee3e8c14Smrg		;;
4731ee3e8c14Smrg	    esac
4732ee3e8c14Smrg	    ;;
4733ee3e8c14Smrg	  powerpc64le-*linux*)
4734ee3e8c14Smrg	    LD="${LD-ld} -m elf32lppclinux"
4735ee3e8c14Smrg	    ;;
4736ee3e8c14Smrg	  powerpc64-*linux*)
4737ee3e8c14Smrg	    LD="${LD-ld} -m elf32ppclinux"
4738ee3e8c14Smrg	    ;;
4739ee3e8c14Smrg	  s390x-*linux*)
4740ee3e8c14Smrg	    LD="${LD-ld} -m elf_s390"
4741ee3e8c14Smrg	    ;;
4742ee3e8c14Smrg	  sparc64-*linux*)
4743ee3e8c14Smrg	    LD="${LD-ld} -m elf32_sparc"
4744ee3e8c14Smrg	    ;;
4745ee3e8c14Smrg	esac
4746ee3e8c14Smrg	;;
4747ee3e8c14Smrg      *64-bit*)
4748ee3e8c14Smrg	case $host in
4749ee3e8c14Smrg	  x86_64-*kfreebsd*-gnu)
4750ee3e8c14Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
4751ee3e8c14Smrg	    ;;
4752ee3e8c14Smrg	  x86_64-*linux*)
4753ee3e8c14Smrg	    LD="${LD-ld} -m elf_x86_64"
4754ee3e8c14Smrg	    ;;
4755ee3e8c14Smrg	  powerpcle-*linux*)
4756ee3e8c14Smrg	    LD="${LD-ld} -m elf64lppc"
4757ee3e8c14Smrg	    ;;
4758ee3e8c14Smrg	  powerpc-*linux*)
4759ee3e8c14Smrg	    LD="${LD-ld} -m elf64ppc"
4760ee3e8c14Smrg	    ;;
4761ee3e8c14Smrg	  s390*-*linux*|s390*-*tpf*)
4762ee3e8c14Smrg	    LD="${LD-ld} -m elf64_s390"
4763ee3e8c14Smrg	    ;;
4764ee3e8c14Smrg	  sparc*-*linux*)
4765ee3e8c14Smrg	    LD="${LD-ld} -m elf64_sparc"
4766ee3e8c14Smrg	    ;;
4767ee3e8c14Smrg	esac
4768ee3e8c14Smrg	;;
4769ee3e8c14Smrg    esac
4770ee3e8c14Smrg  fi
4771ee3e8c14Smrg  rm -rf conftest*
4772ba064abeSmrg  ;;
4773ee3e8c14Smrg
4774ee3e8c14Smrg*-*-sco3.2v5*)
4775ee3e8c14Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4776ee3e8c14Smrg  SAVE_CFLAGS=$CFLAGS
4777ee3e8c14Smrg  CFLAGS="$CFLAGS -belf"
4778ee3e8c14Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
4779ee3e8c14Smrg    [AC_LANG_PUSH(C)
4780ee3e8c14Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
4781ee3e8c14Smrg     AC_LANG_POP])
4782ee3e8c14Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
4783ee3e8c14Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4784ee3e8c14Smrg    CFLAGS=$SAVE_CFLAGS
4785ee3e8c14Smrg  fi
4786ba064abeSmrg  ;;
4787ee3e8c14Smrg*-*solaris*)
4788ee3e8c14Smrg  # Find out what ABI is being produced by ac_compile, and set linker
4789ee3e8c14Smrg  # options accordingly.
4790ee3e8c14Smrg  echo 'int i;' > conftest.$ac_ext
4791ee3e8c14Smrg  if AC_TRY_EVAL(ac_compile); then
4792ee3e8c14Smrg    case `$FILECMD conftest.o` in
4793ee3e8c14Smrg    *64-bit*)
4794ee3e8c14Smrg      case $lt_cv_prog_gnu_ld in
4795ee3e8c14Smrg      yes*)
4796ee3e8c14Smrg        case $host in
4797ee3e8c14Smrg        i?86-*-solaris*|x86_64-*-solaris*)
4798ee3e8c14Smrg          LD="${LD-ld} -m elf_x86_64"
4799ee3e8c14Smrg          ;;
4800ee3e8c14Smrg        sparc*-*-solaris*)
4801ee3e8c14Smrg          LD="${LD-ld} -m elf64_sparc"
4802ee3e8c14Smrg          ;;
4803ee3e8c14Smrg        esac
4804ee3e8c14Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
4805ee3e8c14Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
4806ee3e8c14Smrg          LD=${LD-ld}_sol2
4807ee3e8c14Smrg        fi
4808ee3e8c14Smrg        ;;
4809ee3e8c14Smrg      *)
4810ee3e8c14Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
4811ee3e8c14Smrg	  LD="${LD-ld} -64"
4812ee3e8c14Smrg	fi
4813ee3e8c14Smrg	;;
4814ee3e8c14Smrg      esac
4815ee3e8c14Smrg      ;;
4816ee3e8c14Smrg    esac
4817ee3e8c14Smrg  fi
4818ee3e8c14Smrg  rm -rf conftest*
4819ba064abeSmrg  ;;
4820d9dcd5aeSmrgesac
4821191cded7Smrg
4822ee3e8c14Smrgneed_locks=$enable_libtool_lock
4823ee3e8c14Smrg])# _LT_ENABLE_LOCK
4824191cded7Smrg
4825191cded7Smrg
4826ee3e8c14Smrg# _LT_PROG_AR
4827ee3e8c14Smrg# -----------
4828ee3e8c14Smrgm4_defun([_LT_PROG_AR],
4829ee3e8c14Smrg[AC_CHECK_TOOLS(AR, [ar], false)
4830ee3e8c14Smrg: ${AR=ar}
4831ee3e8c14Smrg_LT_DECL([], [AR], [1], [The archiver])
4832191cded7Smrg
4833ee3e8c14Smrg# Use ARFLAGS variable as AR's operation code to sync the variable naming with
4834ee3e8c14Smrg# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
4835ee3e8c14Smrg# higher priority because thats what people were doing historically (setting
4836ee3e8c14Smrg# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
4837ee3e8c14Smrg# variable obsoleted/removed.
4838191cded7Smrg
4839ee3e8c14Smrgtest ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
4840ee3e8c14Smrglt_ar_flags=$AR_FLAGS
4841ee3e8c14Smrg_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
4842191cded7Smrg
4843ee3e8c14Smrg# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
4844ee3e8c14Smrg# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
4845ee3e8c14Smrg_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
4846ee3e8c14Smrg         [Flags to create an archive])
4847d9dcd5aeSmrg
4848ee3e8c14SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
4849ee3e8c14Smrg  [lt_cv_ar_at_file=no
4850ee3e8c14Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
4851ee3e8c14Smrg     [echo conftest.$ac_objext > conftest.lst
4852ee3e8c14Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
4853ee3e8c14Smrg      AC_TRY_EVAL([lt_ar_try])
4854ee3e8c14Smrg      if test 0 -eq "$ac_status"; then
4855ee3e8c14Smrg	# Ensure the archiver fails upon bogus file names.
4856ee3e8c14Smrg	rm -f conftest.$ac_objext libconftest.a
4857ee3e8c14Smrg	AC_TRY_EVAL([lt_ar_try])
4858ee3e8c14Smrg	if test 0 -ne "$ac_status"; then
4859ee3e8c14Smrg          lt_cv_ar_at_file=@
4860ee3e8c14Smrg        fi
4861ee3e8c14Smrg      fi
4862ee3e8c14Smrg      rm -f conftest.* libconftest.a
4863ee3e8c14Smrg     ])
4864ee3e8c14Smrg  ])
4865b290cf36Smrg
4866ee3e8c14Smrgif test no = "$lt_cv_ar_at_file"; then
4867ee3e8c14Smrg  archiver_list_spec=
4868ee3e8c14Smrgelse
4869ee3e8c14Smrg  archiver_list_spec=$lt_cv_ar_at_file
4870ee3e8c14Smrgfi
4871ee3e8c14Smrg_LT_DECL([], [archiver_list_spec], [1],
4872ee3e8c14Smrg  [How to feed a file listing to the archiver])
4873ee3e8c14Smrg])# _LT_PROG_AR
4874b290cf36Smrg
4875ba064abeSmrg
4876ee3e8c14Smrg# _LT_CMD_OLD_ARCHIVE
4877ee3e8c14Smrg# -------------------
4878ee3e8c14Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
4879ee3e8c14Smrg[_LT_PROG_AR
4880191cded7Smrg
4881ee3e8c14SmrgAC_CHECK_TOOL(STRIP, strip, :)
4882ee3e8c14Smrgtest -z "$STRIP" && STRIP=:
4883ee3e8c14Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
4884191cded7Smrg
4885ee3e8c14SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
4886ee3e8c14Smrgtest -z "$RANLIB" && RANLIB=:
4887ee3e8c14Smrg_LT_DECL([], [RANLIB], [1],
4888ee3e8c14Smrg    [Commands used to install an old-style archive])
4889191cded7Smrg
4890ee3e8c14Smrg# Determine commands to create old-style static archives.
4891ee3e8c14Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
4892ee3e8c14Smrgold_postinstall_cmds='chmod 644 $oldlib'
4893ee3e8c14Smrgold_postuninstall_cmds=
4894191cded7Smrg
4895ee3e8c14Smrgif test -n "$RANLIB"; then
4896ee3e8c14Smrg  case $host_os in
4897ee3e8c14Smrg  bitrig* | openbsd*)
4898ee3e8c14Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
4899ee3e8c14Smrg    ;;
4900ee3e8c14Smrg  *)
4901ee3e8c14Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
4902ee3e8c14Smrg    ;;
4903ee3e8c14Smrg  esac
4904ee3e8c14Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
4905ee3e8c14Smrgfi
4906d9dcd5aeSmrg
4907ee3e8c14Smrgcase $host_os in
4908ee3e8c14Smrg  darwin*)
4909ee3e8c14Smrg    lock_old_archive_extraction=yes ;;
4910ee3e8c14Smrg  *)
4911ee3e8c14Smrg    lock_old_archive_extraction=no ;;
4912ee3e8c14Smrgesac
4913ee3e8c14Smrg_LT_DECL([], [old_postinstall_cmds], [2])
4914ee3e8c14Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
4915ee3e8c14Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
4916ee3e8c14Smrg    [Commands used to build an old-style archive])
4917ee3e8c14Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
4918ee3e8c14Smrg    [Whether to use a lock for old archive extraction])
4919ee3e8c14Smrg])# _LT_CMD_OLD_ARCHIVE
4920d9dcd5aeSmrg
4921d9dcd5aeSmrg
4922ee3e8c14Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
4923ee3e8c14Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
4924ee3e8c14Smrg# ----------------------------------------------------------------
4925ee3e8c14Smrg# Check whether the given compiler option works
4926ee3e8c14SmrgAC_DEFUN([_LT_COMPILER_OPTION],
4927ee3e8c14Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4928ee3e8c14Smrgm4_require([_LT_DECL_SED])dnl
4929ee3e8c14SmrgAC_CACHE_CHECK([$1], [$2],
4930ee3e8c14Smrg  [$2=no
4931ee3e8c14Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
4932ee3e8c14Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
4933ee3e8c14Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
4934ee3e8c14Smrg   # Insert the option either (1) after the last *FLAGS variable, or
4935ee3e8c14Smrg   # (2) before a word containing "conftest.", or (3) at the end.
4936ee3e8c14Smrg   # Note that $ac_compile itself does not contain backslashes and begins
4937ee3e8c14Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
4938ee3e8c14Smrg   # The option is referenced via a variable to avoid confusing sed.
4939ee3e8c14Smrg   lt_compile=`echo "$ac_compile" | $SED \
4940ee3e8c14Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
4941ee3e8c14Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
4942ee3e8c14Smrg   -e 's:$: $lt_compiler_flag:'`
4943ee3e8c14Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
4944ee3e8c14Smrg   (eval "$lt_compile" 2>conftest.err)
4945ee3e8c14Smrg   ac_status=$?
4946ee3e8c14Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
4947ee3e8c14Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
4948ee3e8c14Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
4949ee3e8c14Smrg     # The compiler can only warn and ignore the option if not recognized
4950ee3e8c14Smrg     # So say no if there are warnings other than the usual output.
4951ee3e8c14Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
4952ee3e8c14Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
4953ee3e8c14Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
4954ee3e8c14Smrg       $2=yes
4955ee3e8c14Smrg     fi
4956ee3e8c14Smrg   fi
4957ee3e8c14Smrg   $RM conftest*
4958d9dcd5aeSmrg])
4959ee3e8c14Smrg
4960ee3e8c14Smrgif test yes = "[$]$2"; then
4961ee3e8c14Smrg    m4_if([$5], , :, [$5])
4962d9dcd5aeSmrgelse
4963ee3e8c14Smrg    m4_if([$6], , :, [$6])
4964b290cf36Smrgfi
4965ee3e8c14Smrg])# _LT_COMPILER_OPTION
4966ba064abeSmrg
4967ee3e8c14Smrg# Old name:
4968ee3e8c14SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
4969ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
4970ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
4971b290cf36Smrg
4972b290cf36Smrg
4973ee3e8c14Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
4974ee3e8c14Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
4975ee3e8c14Smrg# ----------------------------------------------------
4976ee3e8c14Smrg# Check whether the given linker option works
4977ee3e8c14SmrgAC_DEFUN([_LT_LINKER_OPTION],
4978ee3e8c14Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4979ee3e8c14Smrgm4_require([_LT_DECL_SED])dnl
4980ee3e8c14SmrgAC_CACHE_CHECK([$1], [$2],
4981ee3e8c14Smrg  [$2=no
4982ee3e8c14Smrg   save_LDFLAGS=$LDFLAGS
4983ee3e8c14Smrg   LDFLAGS="$LDFLAGS $3"
4984ee3e8c14Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
4985ee3e8c14Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
4986ee3e8c14Smrg     # The linker can only warn and ignore the option if not recognized
4987ee3e8c14Smrg     # So say no if there are warnings
4988ee3e8c14Smrg     if test -s conftest.err; then
4989ee3e8c14Smrg       # Append any errors to the config.log.
4990ee3e8c14Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
4991ee3e8c14Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
4992ee3e8c14Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
4993ee3e8c14Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
4994ee3e8c14Smrg         $2=yes
4995ee3e8c14Smrg       fi
4996ee3e8c14Smrg     else
4997ee3e8c14Smrg       $2=yes
4998ee3e8c14Smrg     fi
4999ee3e8c14Smrg   fi
5000ee3e8c14Smrg   $RM -r conftest*
5001ee3e8c14Smrg   LDFLAGS=$save_LDFLAGS
5002ee3e8c14Smrg])
5003b290cf36Smrg
5004ee3e8c14Smrgif test yes = "[$]$2"; then
5005ee3e8c14Smrg    m4_if([$4], , :, [$4])
5006ee3e8c14Smrgelse
5007ee3e8c14Smrg    m4_if([$5], , :, [$5])
5008ee3e8c14Smrgfi
5009ee3e8c14Smrg])# _LT_LINKER_OPTION
5010b290cf36Smrg
5011ee3e8c14Smrg# Old name:
5012ee3e8c14SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
5013ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
5014ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
5015b290cf36Smrg
5016d9dcd5aeSmrg
5017ee3e8c14Smrg# LT_CMD_MAX_LEN
5018ee3e8c14Smrg#---------------
5019ee3e8c14SmrgAC_DEFUN([LT_CMD_MAX_LEN],
5020ee3e8c14Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5021ee3e8c14Smrg# find the maximum length of command line arguments
5022ee3e8c14SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
5023ee3e8c14SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
5024ee3e8c14Smrg  i=0
5025ee3e8c14Smrg  teststring=ABCD
5026d9dcd5aeSmrg
5027ee3e8c14Smrg  case $build_os in
5028ee3e8c14Smrg  msdosdjgpp*)
5029ee3e8c14Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
5030ee3e8c14Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
5031ee3e8c14Smrg    # during glob expansion).  Even if it were fixed, the result of this
5032ee3e8c14Smrg    # check would be larger than it should be.
5033ee3e8c14Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
5034d9dcd5aeSmrg    ;;
5035ee3e8c14Smrg
5036ee3e8c14Smrg  gnu*)
5037ee3e8c14Smrg    # Under GNU Hurd, this test is not required because there is
5038ee3e8c14Smrg    # no limit to the length of command line arguments.
5039ee3e8c14Smrg    # Libtool will interpret -1 as no limit whatsoever
5040ee3e8c14Smrg    lt_cv_sys_max_cmd_len=-1;
5041d9dcd5aeSmrg    ;;
5042ee3e8c14Smrg
5043d9dcd5aeSmrg  cygwin* | mingw* | cegcc*)
5044ee3e8c14Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
5045ee3e8c14Smrg    # about 5 minutes as the teststring grows exponentially.
5046ee3e8c14Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
5047ee3e8c14Smrg    # you end up with a "frozen" computer, even though with patience
5048ee3e8c14Smrg    # the test eventually succeeds (with a max line length of 256k).
5049ee3e8c14Smrg    # Instead, let's just punt: use the minimum linelength reported by
5050ee3e8c14Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
5051ee3e8c14Smrg    lt_cv_sys_max_cmd_len=8192;
5052d9dcd5aeSmrg    ;;
5053ee3e8c14Smrg
5054ee3e8c14Smrg  mint*)
5055ee3e8c14Smrg    # On MiNT this can take a long time and run out of memory.
5056ee3e8c14Smrg    lt_cv_sys_max_cmd_len=8192;
5057d9dcd5aeSmrg    ;;
5058d9dcd5aeSmrg
5059ee3e8c14Smrg  amigaos*)
5060ee3e8c14Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
5061ee3e8c14Smrg    # So we just punt and use a minimum line length of 8192.
5062ee3e8c14Smrg    lt_cv_sys_max_cmd_len=8192;
5063ee3e8c14Smrg    ;;
5064ee3e8c14Smrg
5065ee3e8c14Smrg  bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
5066ee3e8c14Smrg    # This has been around since 386BSD, at least.  Likely further.
5067ee3e8c14Smrg    if test -x /sbin/sysctl; then
5068ee3e8c14Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
5069ee3e8c14Smrg    elif test -x /usr/sbin/sysctl; then
5070ee3e8c14Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
5071ee3e8c14Smrg    else
5072ee3e8c14Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
5073d9dcd5aeSmrg    fi
5074ee3e8c14Smrg    # And add a safety zone
5075ee3e8c14Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5076ee3e8c14Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5077d9dcd5aeSmrg    ;;
5078ee3e8c14Smrg
5079d9dcd5aeSmrg  interix*)
5080ee3e8c14Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
5081ee3e8c14Smrg    lt_cv_sys_max_cmd_len=196608
5082d9dcd5aeSmrg    ;;
5083d9dcd5aeSmrg
5084ee3e8c14Smrg  os2*)
5085ee3e8c14Smrg    # The test takes a long time on OS/2.
5086ee3e8c14Smrg    lt_cv_sys_max_cmd_len=8192
5087ee3e8c14Smrg    ;;
5088d9dcd5aeSmrg
5089ee3e8c14Smrg  osf*)
5090ee3e8c14Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
5091ee3e8c14Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
5092ee3e8c14Smrg    # nice to cause kernel panics so lets avoid the loop below.
5093ee3e8c14Smrg    # First set a reasonable default.
5094ee3e8c14Smrg    lt_cv_sys_max_cmd_len=16384
5095ee3e8c14Smrg    #
5096ee3e8c14Smrg    if test -x /sbin/sysconfig; then
5097ee3e8c14Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
5098ee3e8c14Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
5099ee3e8c14Smrg      esac
5100ee3e8c14Smrg    fi
5101ee3e8c14Smrg    ;;
5102ee3e8c14Smrg  sco3.2v5*)
5103ee3e8c14Smrg    lt_cv_sys_max_cmd_len=102400
5104ee3e8c14Smrg    ;;
5105ee3e8c14Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
5106ee3e8c14Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
5107ee3e8c14Smrg    if test -n "$kargmax"; then
5108ee3e8c14Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
5109d9dcd5aeSmrg    else
5110ee3e8c14Smrg      lt_cv_sys_max_cmd_len=32768
5111d9dcd5aeSmrg    fi
5112ee3e8c14Smrg    ;;
5113ee3e8c14Smrg  *)
5114ee3e8c14Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
5115ee3e8c14Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
5116ee3e8c14Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
5117ee3e8c14Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5118ee3e8c14Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5119ee3e8c14Smrg    else
5120ee3e8c14Smrg      # Make teststring a little bigger before we do anything with it.
5121ee3e8c14Smrg      # a 1K string should be a reasonable start.
5122ee3e8c14Smrg      for i in 1 2 3 4 5 6 7 8; do
5123ee3e8c14Smrg        teststring=$teststring$teststring
5124ee3e8c14Smrg      done
5125ee3e8c14Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
5126ee3e8c14Smrg      # If test is not a shell built-in, we'll probably end up computing a
5127ee3e8c14Smrg      # maximum length that is only half of the actual maximum length, but
5128ee3e8c14Smrg      # we can't tell.
5129ee3e8c14Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
5130ee3e8c14Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
5131ee3e8c14Smrg	      test 17 != "$i" # 1/2 MB should be enough
5132ee3e8c14Smrg      do
5133ee3e8c14Smrg        i=`expr $i + 1`
5134ee3e8c14Smrg        teststring=$teststring$teststring
5135ee3e8c14Smrg      done
5136ee3e8c14Smrg      # Only check the string length outside the loop.
5137ee3e8c14Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
5138ee3e8c14Smrg      teststring=
5139ee3e8c14Smrg      # Add a significant safety factor because C++ compilers can tack on
5140ee3e8c14Smrg      # massive amounts of additional arguments before passing them to the
5141ee3e8c14Smrg      # linker.  It appears as though 1/2 is a usable value.
5142ee3e8c14Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
5143ee3e8c14Smrg    fi
5144ee3e8c14Smrg    ;;
5145ee3e8c14Smrg  esac
5146ee3e8c14Smrg])
5147ee3e8c14Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
5148ee3e8c14Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
5149ee3e8c14Smrgelse
5150ee3e8c14Smrg  AC_MSG_RESULT(none)
5151ee3e8c14Smrgfi
5152ee3e8c14Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
5153ee3e8c14Smrg_LT_DECL([], [max_cmd_len], [0],
5154ee3e8c14Smrg    [What is the maximum length of a command?])
5155ee3e8c14Smrg])# LT_CMD_MAX_LEN
5156d9dcd5aeSmrg
5157ee3e8c14Smrg# Old name:
5158ee3e8c14SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
5159ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
5160ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
5161d9dcd5aeSmrg
5162d9dcd5aeSmrg
5163ee3e8c14Smrg# _LT_HEADER_DLFCN
5164ee3e8c14Smrg# ----------------
5165ee3e8c14Smrgm4_defun([_LT_HEADER_DLFCN],
5166ee3e8c14Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
5167ee3e8c14Smrg])# _LT_HEADER_DLFCN
5168d9dcd5aeSmrg
5169d9dcd5aeSmrg
5170ee3e8c14Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
5171ee3e8c14Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
5172ee3e8c14Smrg# ----------------------------------------------------------------
5173ee3e8c14Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
5174ee3e8c14Smrg[m4_require([_LT_HEADER_DLFCN])dnl
5175ee3e8c14Smrgif test yes = "$cross_compiling"; then :
5176ee3e8c14Smrg  [$4]
5177ee3e8c14Smrgelse
5178ee3e8c14Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
5179ee3e8c14Smrg  lt_status=$lt_dlunknown
5180ee3e8c14Smrg  cat > conftest.$ac_ext <<_LT_EOF
5181ee3e8c14Smrg[#line $LINENO "configure"
5182ee3e8c14Smrg#include "confdefs.h"
5183d9dcd5aeSmrg
5184ee3e8c14Smrg#if HAVE_DLFCN_H
5185ee3e8c14Smrg#include <dlfcn.h>
5186ee3e8c14Smrg#endif
5187d9dcd5aeSmrg
5188ee3e8c14Smrg#include <stdio.h>
5189d9dcd5aeSmrg
5190ee3e8c14Smrg#ifdef RTLD_GLOBAL
5191ee3e8c14Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
5192ee3e8c14Smrg#else
5193ee3e8c14Smrg#  ifdef DL_GLOBAL
5194ee3e8c14Smrg#    define LT_DLGLOBAL		DL_GLOBAL
5195ee3e8c14Smrg#  else
5196ee3e8c14Smrg#    define LT_DLGLOBAL		0
5197ee3e8c14Smrg#  endif
5198ee3e8c14Smrg#endif
5199d9dcd5aeSmrg
5200ee3e8c14Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
5201ee3e8c14Smrg   find out it does not work in some platform. */
5202ee3e8c14Smrg#ifndef LT_DLLAZY_OR_NOW
5203ee3e8c14Smrg#  ifdef RTLD_LAZY
5204ee3e8c14Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
5205ee3e8c14Smrg#  else
5206ee3e8c14Smrg#    ifdef DL_LAZY
5207ee3e8c14Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
5208ee3e8c14Smrg#    else
5209ee3e8c14Smrg#      ifdef RTLD_NOW
5210ee3e8c14Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
5211ee3e8c14Smrg#      else
5212ee3e8c14Smrg#        ifdef DL_NOW
5213ee3e8c14Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
5214ee3e8c14Smrg#        else
5215ee3e8c14Smrg#          define LT_DLLAZY_OR_NOW	0
5216ee3e8c14Smrg#        endif
5217ee3e8c14Smrg#      endif
5218ee3e8c14Smrg#    endif
5219ee3e8c14Smrg#  endif
5220ee3e8c14Smrg#endif
5221d9dcd5aeSmrg
5222ee3e8c14Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
5223ee3e8c14Smrg   correspondingly for the symbols needed.  */
5224ee3e8c14Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
5225ee3e8c14Smrgint fnord () __attribute__((visibility("default")));
5226ee3e8c14Smrg#endif
5227d9dcd5aeSmrg
5228ee3e8c14Smrgint fnord () { return 42; }
5229ee3e8c14Smrgint main ()
5230ee3e8c14Smrg{
5231ee3e8c14Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
5232ee3e8c14Smrg  int status = $lt_dlunknown;
5233d9dcd5aeSmrg
5234ee3e8c14Smrg  if (self)
5235ee3e8c14Smrg    {
5236ee3e8c14Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
5237d9dcd5aeSmrg      else
5238ee3e8c14Smrg        {
5239ee3e8c14Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
5240ee3e8c14Smrg          else puts (dlerror ());
5241ee3e8c14Smrg	}
5242ee3e8c14Smrg      /* dlclose (self); */
5243ee3e8c14Smrg    }
5244ee3e8c14Smrg  else
5245ee3e8c14Smrg    puts (dlerror ());
5246d9dcd5aeSmrg
5247ee3e8c14Smrg  return status;
5248ee3e8c14Smrg}]
5249ee3e8c14Smrg_LT_EOF
5250ee3e8c14Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
5251ee3e8c14Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
5252ee3e8c14Smrg    lt_status=$?
5253ee3e8c14Smrg    case x$lt_status in
5254ee3e8c14Smrg      x$lt_dlno_uscore) $1 ;;
5255ee3e8c14Smrg      x$lt_dlneed_uscore) $2 ;;
5256ee3e8c14Smrg      x$lt_dlunknown|x*) $3 ;;
5257ee3e8c14Smrg    esac
5258ee3e8c14Smrg  else :
5259ee3e8c14Smrg    # compilation failed
5260ee3e8c14Smrg    $3
5261ee3e8c14Smrg  fi
5262ee3e8c14Smrgfi
5263ee3e8c14Smrgrm -fr conftest*
5264ee3e8c14Smrg])# _LT_TRY_DLOPEN_SELF
5265d9dcd5aeSmrg
5266d9dcd5aeSmrg
5267ee3e8c14Smrg# LT_SYS_DLOPEN_SELF
5268ee3e8c14Smrg# ------------------
5269ee3e8c14SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
5270ee3e8c14Smrg[m4_require([_LT_HEADER_DLFCN])dnl
5271ee3e8c14Smrgif test yes != "$enable_dlopen"; then
5272ee3e8c14Smrg  enable_dlopen=unknown
5273ee3e8c14Smrg  enable_dlopen_self=unknown
5274ee3e8c14Smrg  enable_dlopen_self_static=unknown
5275ee3e8c14Smrgelse
5276ee3e8c14Smrg  lt_cv_dlopen=no
5277ee3e8c14Smrg  lt_cv_dlopen_libs=
5278d9dcd5aeSmrg
5279ee3e8c14Smrg  case $host_os in
5280ee3e8c14Smrg  beos*)
5281ee3e8c14Smrg    lt_cv_dlopen=load_add_on
5282ee3e8c14Smrg    lt_cv_dlopen_libs=
5283ee3e8c14Smrg    lt_cv_dlopen_self=yes
5284ee3e8c14Smrg    ;;
5285d9dcd5aeSmrg
5286ee3e8c14Smrg  mingw* | pw32* | cegcc*)
5287ee3e8c14Smrg    lt_cv_dlopen=LoadLibrary
5288ee3e8c14Smrg    lt_cv_dlopen_libs=
5289ee3e8c14Smrg    ;;
5290d9dcd5aeSmrg
5291ee3e8c14Smrg  cygwin*)
5292ee3e8c14Smrg    lt_cv_dlopen=dlopen
5293ee3e8c14Smrg    lt_cv_dlopen_libs=
5294ee3e8c14Smrg    ;;
5295d9dcd5aeSmrg
5296ee3e8c14Smrg  darwin*)
5297ee3e8c14Smrg    # if libdl is installed we need to link against it
5298ee3e8c14Smrg    AC_CHECK_LIB([dl], [dlopen],
5299ee3e8c14Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
5300ee3e8c14Smrg    lt_cv_dlopen=dyld
5301ee3e8c14Smrg    lt_cv_dlopen_libs=
5302ee3e8c14Smrg    lt_cv_dlopen_self=yes
5303ee3e8c14Smrg    ])
5304ee3e8c14Smrg    ;;
5305ee3e8c14Smrg
5306ee3e8c14Smrg  tpf*)
5307ee3e8c14Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
5308ee3e8c14Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
5309ee3e8c14Smrg    lt_cv_dlopen=dlopen
5310ee3e8c14Smrg    lt_cv_dlopen_libs=
5311ee3e8c14Smrg    lt_cv_dlopen_self=no
5312ee3e8c14Smrg    ;;
5313ee3e8c14Smrg
5314ee3e8c14Smrg  *)
5315ee3e8c14Smrg    AC_CHECK_FUNC([shl_load],
5316ee3e8c14Smrg	  [lt_cv_dlopen=shl_load],
5317ee3e8c14Smrg      [AC_CHECK_LIB([dld], [shl_load],
5318ee3e8c14Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
5319ee3e8c14Smrg	[AC_CHECK_FUNC([dlopen],
5320ee3e8c14Smrg	      [lt_cv_dlopen=dlopen],
5321ee3e8c14Smrg	  [AC_CHECK_LIB([dl], [dlopen],
5322ee3e8c14Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
5323ee3e8c14Smrg	    [AC_CHECK_LIB([svld], [dlopen],
5324ee3e8c14Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
5325ee3e8c14Smrg	      [AC_CHECK_LIB([dld], [dld_link],
5326ee3e8c14Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
5327ee3e8c14Smrg	      ])
5328ee3e8c14Smrg	    ])
5329ee3e8c14Smrg	  ])
5330ee3e8c14Smrg	])
5331ee3e8c14Smrg      ])
5332ee3e8c14Smrg    ;;
5333ee3e8c14Smrg  esac
5334ee3e8c14Smrg
5335ee3e8c14Smrg  if test no = "$lt_cv_dlopen"; then
5336ee3e8c14Smrg    enable_dlopen=no
5337ee3e8c14Smrg  else
5338ee3e8c14Smrg    enable_dlopen=yes
5339ee3e8c14Smrg  fi
5340d9dcd5aeSmrg
5341ee3e8c14Smrg  case $lt_cv_dlopen in
5342ee3e8c14Smrg  dlopen)
5343ee3e8c14Smrg    save_CPPFLAGS=$CPPFLAGS
5344ee3e8c14Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
5345d9dcd5aeSmrg
5346ee3e8c14Smrg    save_LDFLAGS=$LDFLAGS
5347ee3e8c14Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
5348d9dcd5aeSmrg
5349ee3e8c14Smrg    save_LIBS=$LIBS
5350ee3e8c14Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
5351ee3e8c14Smrg
5352ee3e8c14Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
5353ee3e8c14Smrg	  lt_cv_dlopen_self, [dnl
5354ee3e8c14Smrg	  _LT_TRY_DLOPEN_SELF(
5355ee3e8c14Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
5356ee3e8c14Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
5357ee3e8c14Smrg    ])
5358ee3e8c14Smrg
5359ee3e8c14Smrg    if test yes = "$lt_cv_dlopen_self"; then
5360ee3e8c14Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
5361ee3e8c14Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
5362ee3e8c14Smrg	  lt_cv_dlopen_self_static, [dnl
5363ee3e8c14Smrg	  _LT_TRY_DLOPEN_SELF(
5364ee3e8c14Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
5365ee3e8c14Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
5366ee3e8c14Smrg      ])
5367d9dcd5aeSmrg    fi
5368d9dcd5aeSmrg
5369ee3e8c14Smrg    CPPFLAGS=$save_CPPFLAGS
5370ee3e8c14Smrg    LDFLAGS=$save_LDFLAGS
5371ee3e8c14Smrg    LIBS=$save_LIBS
5372ee3e8c14Smrg    ;;
5373ee3e8c14Smrg  esac
5374d9dcd5aeSmrg
5375ee3e8c14Smrg  case $lt_cv_dlopen_self in
5376ee3e8c14Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
5377ee3e8c14Smrg  *) enable_dlopen_self=unknown ;;
5378ee3e8c14Smrg  esac
5379d9dcd5aeSmrg
5380ee3e8c14Smrg  case $lt_cv_dlopen_self_static in
5381ee3e8c14Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
5382ee3e8c14Smrg  *) enable_dlopen_self_static=unknown ;;
5383ee3e8c14Smrg  esac
5384ee3e8c14Smrgfi
5385ee3e8c14Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
5386ee3e8c14Smrg	 [Whether dlopen is supported])
5387ee3e8c14Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
5388ee3e8c14Smrg	 [Whether dlopen of programs is supported])
5389ee3e8c14Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
5390ee3e8c14Smrg	 [Whether dlopen of statically linked programs is supported])
5391ee3e8c14Smrg])# LT_SYS_DLOPEN_SELF
5392d9dcd5aeSmrg
5393ee3e8c14Smrg# Old name:
5394ee3e8c14SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
5395ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
5396ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
5397d9dcd5aeSmrg
5398d9dcd5aeSmrg
5399ee3e8c14Smrg# _LT_COMPILER_C_O([TAGNAME])
5400ee3e8c14Smrg# ---------------------------
5401ee3e8c14Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
5402ee3e8c14Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
5403ee3e8c14Smrgm4_defun([_LT_COMPILER_C_O],
5404ee3e8c14Smrg[m4_require([_LT_DECL_SED])dnl
5405ee3e8c14Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5406ee3e8c14Smrgm4_require([_LT_TAG_COMPILER])dnl
5407ee3e8c14SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
5408ee3e8c14Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
5409ee3e8c14Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
5410ee3e8c14Smrg   $RM -r conftest 2>/dev/null
5411ee3e8c14Smrg   mkdir conftest
5412ee3e8c14Smrg   cd conftest
5413ee3e8c14Smrg   mkdir out
5414ee3e8c14Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5415d9dcd5aeSmrg
5416ee3e8c14Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
5417ee3e8c14Smrg   # Insert the option either (1) after the last *FLAGS variable, or
5418ee3e8c14Smrg   # (2) before a word containing "conftest.", or (3) at the end.
5419ee3e8c14Smrg   # Note that $ac_compile itself does not contain backslashes and begins
5420ee3e8c14Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
5421ee3e8c14Smrg   lt_compile=`echo "$ac_compile" | $SED \
5422ee3e8c14Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
5423ee3e8c14Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
5424ee3e8c14Smrg   -e 's:$: $lt_compiler_flag:'`
5425ee3e8c14Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
5426ee3e8c14Smrg   (eval "$lt_compile" 2>out/conftest.err)
5427ee3e8c14Smrg   ac_status=$?
5428ee3e8c14Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
5429ee3e8c14Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
5430ee3e8c14Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
5431ee3e8c14Smrg   then
5432ee3e8c14Smrg     # The compiler can only warn and ignore the option if not recognized
5433ee3e8c14Smrg     # So say no if there are warnings
5434ee3e8c14Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
5435ee3e8c14Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
5436ee3e8c14Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
5437ee3e8c14Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
5438ee3e8c14Smrg     fi
5439ee3e8c14Smrg   fi
5440ee3e8c14Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
5441ee3e8c14Smrg   $RM conftest*
5442ee3e8c14Smrg   # SGI C++ compiler will create directory out/ii_files/ for
5443ee3e8c14Smrg   # template instantiation
5444ee3e8c14Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
5445ee3e8c14Smrg   $RM out/* && rmdir out
5446ee3e8c14Smrg   cd ..
5447ee3e8c14Smrg   $RM -r conftest
5448ee3e8c14Smrg   $RM conftest*
5449ee3e8c14Smrg])
5450ee3e8c14Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
5451ee3e8c14Smrg	[Does compiler simultaneously support -c and -o options?])
5452ee3e8c14Smrg])# _LT_COMPILER_C_O
5453d9dcd5aeSmrg
5454d9dcd5aeSmrg
5455ee3e8c14Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
5456ee3e8c14Smrg# ----------------------------------
5457ee3e8c14Smrg# Check to see if we can do hard links to lock some files if needed
5458ee3e8c14Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
5459ee3e8c14Smrg[m4_require([_LT_ENABLE_LOCK])dnl
5460ee3e8c14Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5461ee3e8c14Smrg_LT_COMPILER_C_O([$1])
5462ee3e8c14Smrg
5463ee3e8c14Smrghard_links=nottested
5464ee3e8c14Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
5465ee3e8c14Smrg  # do not overwrite the value of need_locks provided by the user
5466ee3e8c14Smrg  AC_MSG_CHECKING([if we can lock with hard links])
5467ee3e8c14Smrg  hard_links=yes
5468ee3e8c14Smrg  $RM conftest*
5469ee3e8c14Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5470ee3e8c14Smrg  touch conftest.a
5471ee3e8c14Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
5472ee3e8c14Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5473ee3e8c14Smrg  AC_MSG_RESULT([$hard_links])
5474ee3e8c14Smrg  if test no = "$hard_links"; then
5475ee3e8c14Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
5476ee3e8c14Smrg    need_locks=warn
5477ee3e8c14Smrg  fi
5478ee3e8c14Smrgelse
5479ee3e8c14Smrg  need_locks=no
5480ee3e8c14Smrgfi
5481ee3e8c14Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
5482ee3e8c14Smrg])# _LT_COMPILER_FILE_LOCKS
5483d9dcd5aeSmrg
5484d9dcd5aeSmrg
5485ee3e8c14Smrg# _LT_CHECK_OBJDIR
5486ee3e8c14Smrg# ----------------
5487ee3e8c14Smrgm4_defun([_LT_CHECK_OBJDIR],
5488ee3e8c14Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
5489ee3e8c14Smrg[rm -f .libs 2>/dev/null
5490ee3e8c14Smrgmkdir .libs 2>/dev/null
5491ee3e8c14Smrgif test -d .libs; then
5492ee3e8c14Smrg  lt_cv_objdir=.libs
5493ee3e8c14Smrgelse
5494ee3e8c14Smrg  # MS-DOS does not allow filenames that begin with a dot.
5495ee3e8c14Smrg  lt_cv_objdir=_libs
5496ee3e8c14Smrgfi
5497ee3e8c14Smrgrmdir .libs 2>/dev/null])
5498ee3e8c14Smrgobjdir=$lt_cv_objdir
5499ee3e8c14Smrg_LT_DECL([], [objdir], [0],
5500ee3e8c14Smrg         [The name of the directory that contains temporary libtool files])dnl
5501ee3e8c14Smrgm4_pattern_allow([LT_OBJDIR])dnl
5502ee3e8c14SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
5503ee3e8c14Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
5504ee3e8c14Smrg])# _LT_CHECK_OBJDIR
5505d9dcd5aeSmrg
5506d9dcd5aeSmrg
5507ee3e8c14Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
5508ee3e8c14Smrg# --------------------------------------
5509ee3e8c14Smrg# Check hardcoding attributes.
5510ee3e8c14Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
5511ee3e8c14Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
5512ee3e8c14Smrg_LT_TAGVAR(hardcode_action, $1)=
5513ee3e8c14Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
5514ee3e8c14Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
5515ee3e8c14Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
5516d9dcd5aeSmrg
5517ee3e8c14Smrg  # We can hardcode non-existent directories.
5518ee3e8c14Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
5519ee3e8c14Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
5520ee3e8c14Smrg     # have to relink, otherwise we might link with an installed library
5521ee3e8c14Smrg     # when we should be linking with a yet-to-be-installed one
5522ee3e8c14Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
5523ee3e8c14Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
5524ee3e8c14Smrg    # Linking always hardcodes the temporary library directory.
5525ee3e8c14Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
5526ee3e8c14Smrg  else
5527ee3e8c14Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
5528ee3e8c14Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
5529ee3e8c14Smrg  fi
5530ee3e8c14Smrgelse
5531ee3e8c14Smrg  # We cannot hardcode anything, or else we can only hardcode existing
5532ee3e8c14Smrg  # directories.
5533ee3e8c14Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
5534ee3e8c14Smrgfi
5535ee3e8c14SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
5536d9dcd5aeSmrg
5537ee3e8c14Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
5538ee3e8c14Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
5539ee3e8c14Smrg  # Fast installation is not supported
5540ee3e8c14Smrg  enable_fast_install=no
5541ee3e8c14Smrgelif test yes = "$shlibpath_overrides_runpath" ||
5542ee3e8c14Smrg     test no = "$enable_shared"; then
5543ee3e8c14Smrg  # Fast installation is not necessary
5544ee3e8c14Smrg  enable_fast_install=needless
5545ee3e8c14Smrgfi
5546ee3e8c14Smrg_LT_TAGDECL([], [hardcode_action], [0],
5547ee3e8c14Smrg    [How to hardcode a shared library path into an executable])
5548ee3e8c14Smrg])# _LT_LINKER_HARDCODE_LIBPATH
5549d9dcd5aeSmrg
5550d9dcd5aeSmrg
5551ee3e8c14Smrg# _LT_CMD_STRIPLIB
5552ee3e8c14Smrg# ----------------
5553ee3e8c14Smrgm4_defun([_LT_CMD_STRIPLIB],
5554ee3e8c14Smrg[m4_require([_LT_DECL_EGREP])
5555ee3e8c14Smrgstriplib=
5556ee3e8c14Smrgold_striplib=
5557ee3e8c14SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
5558ee3e8c14Smrgif test -z "$STRIP"; then
5559ee3e8c14Smrg  AC_MSG_RESULT([no])
5560ee3e8c14Smrgelse
5561ee3e8c14Smrg  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
5562ee3e8c14Smrg    old_striplib="$STRIP --strip-debug"
5563ee3e8c14Smrg    striplib="$STRIP --strip-unneeded"
5564ee3e8c14Smrg    AC_MSG_RESULT([yes])
5565ee3e8c14Smrg  else
5566ee3e8c14Smrg    case $host_os in
5567ee3e8c14Smrg    darwin*)
5568ee3e8c14Smrg      # FIXME - insert some real tests, host_os isn't really good enough
5569ee3e8c14Smrg      striplib="$STRIP -x"
5570ee3e8c14Smrg      old_striplib="$STRIP -S"
5571ee3e8c14Smrg      AC_MSG_RESULT([yes])
5572d9dcd5aeSmrg      ;;
5573ee3e8c14Smrg    freebsd*)
5574ee3e8c14Smrg      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
5575ee3e8c14Smrg        old_striplib="$STRIP --strip-debug"
5576ee3e8c14Smrg        striplib="$STRIP --strip-unneeded"
5577ee3e8c14Smrg        AC_MSG_RESULT([yes])
5578d9dcd5aeSmrg      else
5579ee3e8c14Smrg        AC_MSG_RESULT([no])
5580d9dcd5aeSmrg      fi
5581d9dcd5aeSmrg      ;;
5582ee3e8c14Smrg    *)
5583ee3e8c14Smrg      AC_MSG_RESULT([no])
5584ee3e8c14Smrg      ;;
5585ee3e8c14Smrg    esac
5586ee3e8c14Smrg  fi
5587ee3e8c14Smrgfi
5588ee3e8c14Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
5589ee3e8c14Smrg_LT_DECL([], [striplib], [1])
5590ee3e8c14Smrg])# _LT_CMD_STRIPLIB
5591ee3e8c14Smrg
5592ee3e8c14Smrg
5593ee3e8c14Smrg# _LT_PREPARE_MUNGE_PATH_LIST
5594ee3e8c14Smrg# ---------------------------
5595ee3e8c14Smrg# Make sure func_munge_path_list() is defined correctly.
5596ee3e8c14Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
5597ee3e8c14Smrg[[# func_munge_path_list VARIABLE PATH
5598ee3e8c14Smrg# -----------------------------------
5599ee3e8c14Smrg# VARIABLE is name of variable containing _space_ separated list of
5600ee3e8c14Smrg# directories to be munged by the contents of PATH, which is string
5601ee3e8c14Smrg# having a format:
5602ee3e8c14Smrg# "DIR[:DIR]:"
5603ee3e8c14Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
5604ee3e8c14Smrg# ":DIR[:DIR]"
5605ee3e8c14Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
5606ee3e8c14Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
5607ee3e8c14Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
5608ee3e8c14Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
5609ee3e8c14Smrg# "DIR[:DIR]"
5610ee3e8c14Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
5611ee3e8c14Smrgfunc_munge_path_list ()
5612ee3e8c14Smrg{
5613ee3e8c14Smrg    case x@S|@2 in
5614ee3e8c14Smrg    x)
5615ee3e8c14Smrg        ;;
5616ee3e8c14Smrg    *:)
5617ee3e8c14Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
5618ee3e8c14Smrg        ;;
5619ee3e8c14Smrg    x:*)
5620ee3e8c14Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
5621ee3e8c14Smrg        ;;
5622ee3e8c14Smrg    *::*)
5623ee3e8c14Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
5624ee3e8c14Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
5625ee3e8c14Smrg        ;;
5626ee3e8c14Smrg    *)
5627ee3e8c14Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
5628ee3e8c14Smrg        ;;
5629ee3e8c14Smrg    esac
5630ee3e8c14Smrg}
5631ee3e8c14Smrg]])# _LT_PREPARE_PATH_LIST
5632ee3e8c14Smrg
5633ee3e8c14Smrg
5634ee3e8c14Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
5635ee3e8c14Smrg# -----------------------------
5636ee3e8c14Smrg# PORTME Fill in your ld.so characteristics
5637ee3e8c14Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
5638ee3e8c14Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5639ee3e8c14Smrgm4_require([_LT_DECL_EGREP])dnl
5640ee3e8c14Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5641ee3e8c14Smrgm4_require([_LT_DECL_OBJDUMP])dnl
5642ee3e8c14Smrgm4_require([_LT_DECL_SED])dnl
5643ee3e8c14Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
5644ee3e8c14Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
5645ee3e8c14SmrgAC_MSG_CHECKING([dynamic linker characteristics])
5646ee3e8c14Smrgm4_if([$1],
5647ee3e8c14Smrg	[], [
5648ee3e8c14Smrgif test yes = "$GCC"; then
5649ee3e8c14Smrg  case $host_os in
5650ee3e8c14Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
5651ee3e8c14Smrg    *) lt_awk_arg='/^libraries:/' ;;
5652ee3e8c14Smrg  esac
5653ee3e8c14Smrg  case $host_os in
5654ee3e8c14Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
5655ee3e8c14Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
5656ee3e8c14Smrg  esac
5657ee3e8c14Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
5658ee3e8c14Smrg  case $lt_search_path_spec in
5659ee3e8c14Smrg  *\;*)
5660ee3e8c14Smrg    # if the path contains ";" then we assume it to be the separator
5661ee3e8c14Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
5662ee3e8c14Smrg    # assumed that no part of a normal pathname contains ";" but that should
5663ee3e8c14Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
5664ee3e8c14Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
5665ee3e8c14Smrg    ;;
5666ee3e8c14Smrg  *)
5667ee3e8c14Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
5668ee3e8c14Smrg    ;;
5669ee3e8c14Smrg  esac
5670ee3e8c14Smrg  # Ok, now we have the path, separated by spaces, we can step through it
5671ee3e8c14Smrg  # and add multilib dir if necessary...
5672ee3e8c14Smrg  lt_tmp_lt_search_path_spec=
5673ee3e8c14Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
5674ee3e8c14Smrg  # ...but if some path component already ends with the multilib dir we assume
5675ee3e8c14Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
5676ee3e8c14Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
5677ee3e8c14Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
5678ee3e8c14Smrg    lt_multi_os_dir=
5679ee3e8c14Smrg    ;;
5680ee3e8c14Smrg  esac
5681ee3e8c14Smrg  for lt_sys_path in $lt_search_path_spec; do
5682ee3e8c14Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
5683ee3e8c14Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
5684ee3e8c14Smrg    elif test -n "$lt_multi_os_dir"; then
5685ee3e8c14Smrg      test -d "$lt_sys_path" && \
5686ee3e8c14Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
5687ee3e8c14Smrg    fi
5688ee3e8c14Smrg  done
5689ee3e8c14Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
5690ee3e8c14SmrgBEGIN {RS = " "; FS = "/|\n";} {
5691ee3e8c14Smrg  lt_foo = "";
5692ee3e8c14Smrg  lt_count = 0;
5693ee3e8c14Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
5694ee3e8c14Smrg    if ($lt_i != "" && $lt_i != ".") {
5695ee3e8c14Smrg      if ($lt_i == "..") {
5696ee3e8c14Smrg        lt_count++;
5697ee3e8c14Smrg      } else {
5698ee3e8c14Smrg        if (lt_count == 0) {
5699ee3e8c14Smrg          lt_foo = "/" $lt_i lt_foo;
5700ee3e8c14Smrg        } else {
5701ee3e8c14Smrg          lt_count--;
5702ee3e8c14Smrg        }
5703ee3e8c14Smrg      }
5704ee3e8c14Smrg    }
5705ee3e8c14Smrg  }
5706ee3e8c14Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
5707ee3e8c14Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
5708ee3e8c14Smrg}'`
5709ee3e8c14Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
5710ee3e8c14Smrg  # for these hosts.
5711ee3e8c14Smrg  case $host_os in
5712ee3e8c14Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
5713ee3e8c14Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
5714ee3e8c14Smrg  esac
5715ee3e8c14Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
5716ee3e8c14Smrgelse
5717ee3e8c14Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
5718ee3e8c14Smrgfi])
5719ee3e8c14Smrglibrary_names_spec=
5720ee3e8c14Smrglibname_spec='lib$name'
5721ee3e8c14Smrgsoname_spec=
5722ee3e8c14Smrgshrext_cmds=.so
5723ee3e8c14Smrgpostinstall_cmds=
5724ee3e8c14Smrgpostuninstall_cmds=
5725ee3e8c14Smrgfinish_cmds=
5726ee3e8c14Smrgfinish_eval=
5727ee3e8c14Smrgshlibpath_var=
5728ee3e8c14Smrgshlibpath_overrides_runpath=unknown
5729ee3e8c14Smrgversion_type=none
5730ee3e8c14Smrgdynamic_linker="$host_os ld.so"
5731ee3e8c14Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
5732ee3e8c14Smrgneed_lib_prefix=unknown
5733ee3e8c14Smrghardcode_into_libs=no
5734d9dcd5aeSmrg
5735ee3e8c14Smrg# when you set need_version to no, make sure it does not cause -set_version
5736ee3e8c14Smrg# flags to be left without arguments
5737ee3e8c14Smrgneed_version=unknown
5738d9dcd5aeSmrg
5739ee3e8c14SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
5740ee3e8c14Smrg[User-defined run-time library search path.])
5741d9dcd5aeSmrg
5742ee3e8c14Smrgcase $host_os in
5743ee3e8c14Smrgaix3*)
5744ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
5745ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
5746ee3e8c14Smrg  shlibpath_var=LIBPATH
5747d9dcd5aeSmrg
5748ee3e8c14Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
5749ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
5750ee3e8c14Smrg  ;;
5751d9dcd5aeSmrg
5752ee3e8c14Smrgaix[[4-9]]*)
5753ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
5754ee3e8c14Smrg  need_lib_prefix=no
5755ee3e8c14Smrg  need_version=no
5756ee3e8c14Smrg  hardcode_into_libs=yes
5757ee3e8c14Smrg  if test ia64 = "$host_cpu"; then
5758ee3e8c14Smrg    # AIX 5 supports IA64
5759ee3e8c14Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
5760ee3e8c14Smrg    shlibpath_var=LD_LIBRARY_PATH
5761ee3e8c14Smrg  else
5762ee3e8c14Smrg    # With GCC up to 2.95.x, collect2 would create an import file
5763ee3e8c14Smrg    # for dependence libraries.  The import file would start with
5764ee3e8c14Smrg    # the line '#! .'.  This would cause the generated library to
5765ee3e8c14Smrg    # depend on '.', always an invalid library.  This was fixed in
5766ee3e8c14Smrg    # development snapshots of GCC prior to 3.0.
5767ee3e8c14Smrg    case $host_os in
5768ee3e8c14Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
5769ee3e8c14Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
5770ee3e8c14Smrg	   echo ' yes '
5771ee3e8c14Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
5772ee3e8c14Smrg	:
5773d9dcd5aeSmrg      else
5774ee3e8c14Smrg	can_build_shared=no
5775d9dcd5aeSmrg      fi
5776d9dcd5aeSmrg      ;;
5777ee3e8c14Smrg    esac
5778ee3e8c14Smrg    # Using Import Files as archive members, it is possible to support
5779ee3e8c14Smrg    # filename-based versioning of shared library archives on AIX. While
5780ee3e8c14Smrg    # this would work for both with and without runtime linking, it will
5781ee3e8c14Smrg    # prevent static linking of such archives. So we do filename-based
5782ee3e8c14Smrg    # shared library versioning with .so extension only, which is used
5783ee3e8c14Smrg    # when both runtime linking and shared linking is enabled.
5784ee3e8c14Smrg    # Unfortunately, runtime linking may impact performance, so we do
5785ee3e8c14Smrg    # not want this to be the default eventually. Also, we use the
5786ee3e8c14Smrg    # versioned .so libs for executables only if there is the -brtl
5787ee3e8c14Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
5788ee3e8c14Smrg    # To allow for filename-based versioning support, we need to create
5789ee3e8c14Smrg    # libNAME.so.V as an archive file, containing:
5790ee3e8c14Smrg    # *) an Import File, referring to the versioned filename of the
5791ee3e8c14Smrg    #    archive as well as the shared archive member, telling the
5792ee3e8c14Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
5793ee3e8c14Smrg    #    list of exported symbols of that shared object, eventually
5794ee3e8c14Smrg    #    decorated with the 'weak' keyword
5795ee3e8c14Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
5796ee3e8c14Smrg    #    it being seen by the linker.
5797ee3e8c14Smrg    # At run time we better use the real file rather than another symlink,
5798ee3e8c14Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
5799ee3e8c14Smrg
5800ee3e8c14Smrg    case $with_aix_soname,$aix_use_runtimelinking in
5801ee3e8c14Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
5802ee3e8c14Smrg    # soname into executable. Probably we can add versioning support to
5803ee3e8c14Smrg    # collect2, so additional links can be useful in future.
5804ee3e8c14Smrg    aix,yes) # traditional libtool
5805ee3e8c14Smrg      dynamic_linker='AIX unversionable lib.so'
5806ee3e8c14Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
5807ee3e8c14Smrg      # instead of lib<name>.a to let people know that these are not
5808ee3e8c14Smrg      # typical AIX shared libraries.
5809ee3e8c14Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5810d9dcd5aeSmrg      ;;
5811ee3e8c14Smrg    aix,no) # traditional AIX only
5812ee3e8c14Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
5813ee3e8c14Smrg      # We preserve .a as extension for shared libraries through AIX4.2
5814ee3e8c14Smrg      # and later when we are not doing run time linking.
5815ee3e8c14Smrg      library_names_spec='$libname$release.a $libname.a'
5816ee3e8c14Smrg      soname_spec='$libname$release$shared_ext$major'
5817d9dcd5aeSmrg      ;;
5818ee3e8c14Smrg    svr4,*) # full svr4 only
5819ee3e8c14Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
5820ee3e8c14Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5821ee3e8c14Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
5822ee3e8c14Smrg      shlibpath_overrides_runpath=yes
5823d9dcd5aeSmrg      ;;
5824ee3e8c14Smrg    *,yes) # both, prefer svr4
5825ee3e8c14Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
5826ee3e8c14Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5827ee3e8c14Smrg      # unpreferred sharedlib libNAME.a needs extra handling
5828ee3e8c14Smrg      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"'
5829ee3e8c14Smrg      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"'
5830ee3e8c14Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
5831ee3e8c14Smrg      shlibpath_overrides_runpath=yes
5832d9dcd5aeSmrg      ;;
5833ee3e8c14Smrg    *,no) # both, prefer aix
5834ee3e8c14Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
5835ee3e8c14Smrg      library_names_spec='$libname$release.a $libname.a'
5836ee3e8c14Smrg      soname_spec='$libname$release$shared_ext$major'
5837ee3e8c14Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
5838ee3e8c14Smrg      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)'
5839ee3e8c14Smrg      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"'
5840d9dcd5aeSmrg      ;;
5841ee3e8c14Smrg    esac
5842ee3e8c14Smrg    shlibpath_var=LIBPATH
5843ee3e8c14Smrg  fi
5844ee3e8c14Smrg  ;;
5845d9dcd5aeSmrg
5846ee3e8c14Smrgamigaos*)
5847ee3e8c14Smrg  case $host_cpu in
5848ee3e8c14Smrg  powerpc)
5849ee3e8c14Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
5850ee3e8c14Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
5851ee3e8c14Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5852ee3e8c14Smrg    ;;
5853ee3e8c14Smrg  m68k)
5854ee3e8c14Smrg    library_names_spec='$libname.ixlibrary $libname.a'
5855ee3e8c14Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
5856ee3e8c14Smrg    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'
5857ee3e8c14Smrg    ;;
5858ee3e8c14Smrg  esac
5859ee3e8c14Smrg  ;;
5860d9dcd5aeSmrg
5861ee3e8c14Smrgbeos*)
5862ee3e8c14Smrg  library_names_spec='$libname$shared_ext'
5863ee3e8c14Smrg  dynamic_linker="$host_os ld.so"
5864ee3e8c14Smrg  shlibpath_var=LIBRARY_PATH
5865ee3e8c14Smrg  ;;
5866d9dcd5aeSmrg
5867ee3e8c14Smrgbsdi[[45]]*)
5868ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
5869ee3e8c14Smrg  need_version=no
5870ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5871ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
5872ee3e8c14Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
5873ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
5874ee3e8c14Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
5875ee3e8c14Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
5876ee3e8c14Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
5877ee3e8c14Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
5878ee3e8c14Smrg  # libtool to hard-code these into programs
5879ee3e8c14Smrg  ;;
5880d9dcd5aeSmrg
5881ee3e8c14Smrgcygwin* | mingw* | pw32* | cegcc*)
5882ee3e8c14Smrg  version_type=windows
5883ee3e8c14Smrg  shrext_cmds=.dll
5884ee3e8c14Smrg  need_version=no
5885ee3e8c14Smrg  need_lib_prefix=no
5886d9dcd5aeSmrg
5887ee3e8c14Smrg  case $GCC,$cc_basename in
5888ee3e8c14Smrg  yes,*)
5889ee3e8c14Smrg    # gcc
5890ee3e8c14Smrg    library_names_spec='$libname.dll.a'
5891ee3e8c14Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
5892ee3e8c14Smrg    postinstall_cmds='base_file=`basename \$file`~
5893ee3e8c14Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
5894ee3e8c14Smrg      dldir=$destdir/`dirname \$dlpath`~
5895ee3e8c14Smrg      test -d \$dldir || mkdir -p \$dldir~
5896ee3e8c14Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
5897ee3e8c14Smrg      chmod a+x \$dldir/$dlname~
5898ee3e8c14Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
5899ee3e8c14Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
5900ee3e8c14Smrg      fi'
5901ee3e8c14Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
5902ee3e8c14Smrg      dlpath=$dir/\$dldll~
5903ee3e8c14Smrg       $RM \$dlpath'
5904ee3e8c14Smrg    shlibpath_overrides_runpath=yes
5905b290cf36Smrg
5906ee3e8c14Smrg    case $host_os in
5907ee3e8c14Smrg    cygwin*)
5908ee3e8c14Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
5909ee3e8c14Smrg      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5910ee3e8c14Smrgm4_if([$1], [],[
5911ee3e8c14Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
5912d9dcd5aeSmrg      ;;
5913ee3e8c14Smrg    mingw* | cegcc*)
5914ee3e8c14Smrg      # MinGW DLLs use traditional 'lib' prefix
5915ee3e8c14Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5916ee3e8c14Smrg      ;;
5917ee3e8c14Smrg    pw32*)
5918ee3e8c14Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
5919ee3e8c14Smrg      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5920ba064abeSmrg      ;;
5921ee3e8c14Smrg    esac
5922ee3e8c14Smrg    dynamic_linker='Win32 ld.exe'
5923ee3e8c14Smrg    ;;
5924b290cf36Smrg
5925ee3e8c14Smrg  *,cl* | *,icl*)
5926ee3e8c14Smrg    # Native MSVC or ICC
5927ee3e8c14Smrg    libname_spec='$name'
5928ee3e8c14Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5929ee3e8c14Smrg    library_names_spec='$libname.dll.lib'
5930d9dcd5aeSmrg
5931ee3e8c14Smrg    case $build_os in
5932ee3e8c14Smrg    mingw*)
5933ee3e8c14Smrg      sys_lib_search_path_spec=
5934ee3e8c14Smrg      lt_save_ifs=$IFS
5935ee3e8c14Smrg      IFS=';'
5936ee3e8c14Smrg      for lt_path in $LIB
5937ee3e8c14Smrg      do
5938ee3e8c14Smrg        IFS=$lt_save_ifs
5939ee3e8c14Smrg        # Let DOS variable expansion print the short 8.3 style file name.
5940ee3e8c14Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
5941ee3e8c14Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
5942ee3e8c14Smrg      done
5943ee3e8c14Smrg      IFS=$lt_save_ifs
5944ee3e8c14Smrg      # Convert to MSYS style.
5945ee3e8c14Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
5946ee3e8c14Smrg      ;;
5947ee3e8c14Smrg    cygwin*)
5948ee3e8c14Smrg      # Convert to unix form, then to dos form, then back to unix form
5949ee3e8c14Smrg      # but this time dos style (no spaces!) so that the unix form looks
5950ee3e8c14Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
5951ee3e8c14Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
5952ee3e8c14Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
5953ee3e8c14Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
5954ee3e8c14Smrg      ;;
5955ee3e8c14Smrg    *)
5956ee3e8c14Smrg      sys_lib_search_path_spec=$LIB
5957ee3e8c14Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
5958ee3e8c14Smrg        # It is most probably a Windows format PATH.
5959ee3e8c14Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
5960d9dcd5aeSmrg      else
5961ee3e8c14Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
5962d9dcd5aeSmrg      fi
5963ee3e8c14Smrg      # FIXME: find the short name or the path components, as spaces are
5964ee3e8c14Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
5965d9dcd5aeSmrg      ;;
5966ee3e8c14Smrg    esac
5967d9dcd5aeSmrg
5968ee3e8c14Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
5969ee3e8c14Smrg    postinstall_cmds='base_file=`basename \$file`~
5970ee3e8c14Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
5971ee3e8c14Smrg      dldir=$destdir/`dirname \$dlpath`~
5972ee3e8c14Smrg      test -d \$dldir || mkdir -p \$dldir~
5973ee3e8c14Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
5974ee3e8c14Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
5975ee3e8c14Smrg      dlpath=$dir/\$dldll~
5976ee3e8c14Smrg       $RM \$dlpath'
5977ee3e8c14Smrg    shlibpath_overrides_runpath=yes
5978ee3e8c14Smrg    dynamic_linker='Win32 link.exe'
5979ee3e8c14Smrg    ;;
5980d9dcd5aeSmrg
5981ee3e8c14Smrg  *)
5982ee3e8c14Smrg    # Assume MSVC and ICC wrapper
5983ee3e8c14Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
5984ee3e8c14Smrg    dynamic_linker='Win32 ld.exe'
5985ee3e8c14Smrg    ;;
5986ee3e8c14Smrg  esac
5987ee3e8c14Smrg  # FIXME: first we should search . and the directory the executable is in
5988ee3e8c14Smrg  shlibpath_var=PATH
5989ee3e8c14Smrg  ;;
5990d9dcd5aeSmrg
5991ee3e8c14Smrgdarwin* | rhapsody*)
5992ee3e8c14Smrg  dynamic_linker="$host_os dyld"
5993ee3e8c14Smrg  version_type=darwin
5994ee3e8c14Smrg  need_lib_prefix=no
5995ee3e8c14Smrg  need_version=no
5996ee3e8c14Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
5997ee3e8c14Smrg  soname_spec='$libname$release$major$shared_ext'
5998ee3e8c14Smrg  shlibpath_overrides_runpath=yes
5999ee3e8c14Smrg  shlibpath_var=DYLD_LIBRARY_PATH
6000ee3e8c14Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
6001ee3e8c14Smrgm4_if([$1], [],[
6002ee3e8c14Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
6003ee3e8c14Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
6004ee3e8c14Smrg  ;;
6005d9dcd5aeSmrg
6006ee3e8c14Smrgdgux*)
6007ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6008ee3e8c14Smrg  need_lib_prefix=no
6009ee3e8c14Smrg  need_version=no
6010ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6011ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6012ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6013ee3e8c14Smrg  ;;
6014ee3e8c14Smrg
6015ee3e8c14Smrgfreebsd* | dragonfly* | midnightbsd*)
6016ee3e8c14Smrg  # DragonFly does not have aout.  When/if they implement a new
6017ee3e8c14Smrg  # versioning mechanism, adjust this.
6018ee3e8c14Smrg  if test -x /usr/bin/objformat; then
6019ee3e8c14Smrg    objformat=`/usr/bin/objformat`
6020ee3e8c14Smrg  else
6021ee3e8c14Smrg    case $host_os in
6022ee3e8c14Smrg    freebsd[[23]].*) objformat=aout ;;
6023ee3e8c14Smrg    *) objformat=elf ;;
6024d9dcd5aeSmrg    esac
6025ee3e8c14Smrg  fi
6026ee3e8c14Smrg  version_type=freebsd-$objformat
6027ee3e8c14Smrg  case $version_type in
6028ee3e8c14Smrg    freebsd-elf*)
6029ee3e8c14Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6030ee3e8c14Smrg      soname_spec='$libname$release$shared_ext$major'
6031ee3e8c14Smrg      need_version=no
6032ee3e8c14Smrg      need_lib_prefix=no
6033ee3e8c14Smrg      ;;
6034ee3e8c14Smrg    freebsd-*)
6035ee3e8c14Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6036ee3e8c14Smrg      need_version=yes
6037ee3e8c14Smrg      ;;
6038ee3e8c14Smrg  esac
6039ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6040ee3e8c14Smrg  case $host_os in
6041ee3e8c14Smrg  freebsd2.*)
6042ee3e8c14Smrg    shlibpath_overrides_runpath=yes
6043ee3e8c14Smrg    ;;
6044ee3e8c14Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
6045ee3e8c14Smrg    shlibpath_overrides_runpath=yes
6046ee3e8c14Smrg    hardcode_into_libs=yes
6047ee3e8c14Smrg    ;;
6048ee3e8c14Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
6049ee3e8c14Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
6050ee3e8c14Smrg    shlibpath_overrides_runpath=no
6051ee3e8c14Smrg    hardcode_into_libs=yes
6052ee3e8c14Smrg    ;;
6053ee3e8c14Smrg  *) # from 4.6 on, and DragonFly
6054ee3e8c14Smrg    shlibpath_overrides_runpath=yes
6055ee3e8c14Smrg    hardcode_into_libs=yes
6056ee3e8c14Smrg    ;;
6057ee3e8c14Smrg  esac
6058ee3e8c14Smrg  ;;
6059d9dcd5aeSmrg
6060ee3e8c14Smrghaiku*)
6061ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6062ee3e8c14Smrg  need_lib_prefix=no
6063ee3e8c14Smrg  need_version=no
6064ee3e8c14Smrg  dynamic_linker="$host_os runtime_loader"
6065ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6066ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6067ee3e8c14Smrg  shlibpath_var=LIBRARY_PATH
6068ee3e8c14Smrg  shlibpath_overrides_runpath=no
6069ee3e8c14Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
6070ee3e8c14Smrg  hardcode_into_libs=yes
6071ee3e8c14Smrg  ;;
6072ee3e8c14Smrg
6073ee3e8c14Smrghpux9* | hpux10* | hpux11*)
6074ee3e8c14Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
6075ee3e8c14Smrg  # link against other versions.
6076ee3e8c14Smrg  version_type=sunos
6077ee3e8c14Smrg  need_lib_prefix=no
6078ee3e8c14Smrg  need_version=no
6079ee3e8c14Smrg  case $host_cpu in
6080ee3e8c14Smrg  ia64*)
6081ee3e8c14Smrg    shrext_cmds='.so'
6082ee3e8c14Smrg    hardcode_into_libs=yes
6083ee3e8c14Smrg    dynamic_linker="$host_os dld.so"
6084ee3e8c14Smrg    shlibpath_var=LD_LIBRARY_PATH
6085ee3e8c14Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6086ee3e8c14Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6087ee3e8c14Smrg    soname_spec='$libname$release$shared_ext$major'
6088ee3e8c14Smrg    if test 32 = "$HPUX_IA64_MODE"; then
6089ee3e8c14Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
6090ee3e8c14Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
6091ee3e8c14Smrg    else
6092ee3e8c14Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
6093ee3e8c14Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
6094d9dcd5aeSmrg    fi
6095ee3e8c14Smrg    ;;
6096ee3e8c14Smrg  hppa*64*)
6097ee3e8c14Smrg    shrext_cmds='.sl'
6098ee3e8c14Smrg    hardcode_into_libs=yes
6099ee3e8c14Smrg    dynamic_linker="$host_os dld.sl"
6100ee3e8c14Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
6101ee3e8c14Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6102ee3e8c14Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6103ee3e8c14Smrg    soname_spec='$libname$release$shared_ext$major'
6104ee3e8c14Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
6105ee3e8c14Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6106ee3e8c14Smrg    ;;
6107ee3e8c14Smrg  *)
6108ee3e8c14Smrg    shrext_cmds='.sl'
6109ee3e8c14Smrg    dynamic_linker="$host_os dld.sl"
6110ee3e8c14Smrg    shlibpath_var=SHLIB_PATH
6111ee3e8c14Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6112ee3e8c14Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6113ee3e8c14Smrg    soname_spec='$libname$release$shared_ext$major'
6114ee3e8c14Smrg    ;;
6115ee3e8c14Smrg  esac
6116ee3e8c14Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
6117ee3e8c14Smrg  postinstall_cmds='chmod 555 $lib'
6118ee3e8c14Smrg  # or fails outright, so override atomically:
6119ee3e8c14Smrg  install_override_mode=555
6120ee3e8c14Smrg  ;;
6121d9dcd5aeSmrg
6122ee3e8c14Smrginterix[[3-9]]*)
6123ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6124ee3e8c14Smrg  need_lib_prefix=no
6125ee3e8c14Smrg  need_version=no
6126ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6127ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6128ee3e8c14Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
6129ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6130ee3e8c14Smrg  shlibpath_overrides_runpath=no
6131ee3e8c14Smrg  hardcode_into_libs=yes
6132ee3e8c14Smrg  ;;
6133ee3e8c14Smrg
6134ee3e8c14Smrgirix5* | irix6* | nonstopux*)
6135ee3e8c14Smrg  case $host_os in
6136ee3e8c14Smrg    nonstopux*) version_type=nonstopux ;;
6137ee3e8c14Smrg    *)
6138ee3e8c14Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
6139ee3e8c14Smrg		version_type=linux # correct to gnu/linux during the next big refactor
6140ee3e8c14Smrg	else
6141ee3e8c14Smrg		version_type=irix
6142ee3e8c14Smrg	fi ;;
6143ee3e8c14Smrg  esac
6144ee3e8c14Smrg  need_lib_prefix=no
6145ee3e8c14Smrg  need_version=no
6146ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6147ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
6148ee3e8c14Smrg  case $host_os in
6149ee3e8c14Smrg  irix5* | nonstopux*)
6150ee3e8c14Smrg    libsuff= shlibsuff=
6151ee3e8c14Smrg    ;;
6152ee3e8c14Smrg  *)
6153ee3e8c14Smrg    case $LD in # libtool.m4 will add one of these switches to LD
6154ee3e8c14Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
6155ee3e8c14Smrg      libsuff= shlibsuff= libmagic=32-bit;;
6156ee3e8c14Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
6157ee3e8c14Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
6158ee3e8c14Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
6159ee3e8c14Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
6160ee3e8c14Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
6161ee3e8c14Smrg    esac
6162ee3e8c14Smrg    ;;
6163ee3e8c14Smrg  esac
6164ee3e8c14Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6165ee3e8c14Smrg  shlibpath_overrides_runpath=no
6166ee3e8c14Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
6167ee3e8c14Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
6168ee3e8c14Smrg  hardcode_into_libs=yes
6169ee3e8c14Smrg  ;;
6170d9dcd5aeSmrg
6171ee3e8c14Smrg# No shared lib support for Linux oldld, aout, or coff.
6172ee3e8c14Smrglinux*oldld* | linux*aout* | linux*coff*)
6173ee3e8c14Smrg  dynamic_linker=no
6174ee3e8c14Smrg  ;;
6175d9dcd5aeSmrg
6176ee3e8c14Smrglinux*android*)
6177ee3e8c14Smrg  version_type=none # Android doesn't support versioned libraries.
6178ee3e8c14Smrg  need_lib_prefix=no
6179ee3e8c14Smrg  need_version=no
6180ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext'
6181ee3e8c14Smrg  soname_spec='$libname$release$shared_ext'
6182ee3e8c14Smrg  finish_cmds=
6183ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6184ee3e8c14Smrg  shlibpath_overrides_runpath=yes
6185d9dcd5aeSmrg
6186ee3e8c14Smrg  # This implies no fast_install, which is unacceptable.
6187ee3e8c14Smrg  # Some rework will be needed to allow for fast_install
6188ee3e8c14Smrg  # before this can be enabled.
6189ee3e8c14Smrg  hardcode_into_libs=yes
6190d9dcd5aeSmrg
6191ee3e8c14Smrg  dynamic_linker='Android linker'
6192ee3e8c14Smrg  # Don't embed -rpath directories since the linker doesn't support them.
6193ee3e8c14Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6194d9dcd5aeSmrg  ;;
6195d9dcd5aeSmrg
6196ee3e8c14Smrg# This must be glibc/ELF.
6197ee3e8c14Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6198ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6199ee3e8c14Smrg  need_lib_prefix=no
6200ee3e8c14Smrg  need_version=no
6201ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6202ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6203ee3e8c14Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6204ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6205ee3e8c14Smrg  shlibpath_overrides_runpath=no
6206b290cf36Smrg
6207ee3e8c14Smrg  # Some binutils ld are patched to set DT_RUNPATH
6208ee3e8c14Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
6209ee3e8c14Smrg    [lt_cv_shlibpath_overrides_runpath=no
6210ee3e8c14Smrg    save_LDFLAGS=$LDFLAGS
6211ee3e8c14Smrg    save_libdir=$libdir
6212ee3e8c14Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
6213ee3e8c14Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
6214ee3e8c14Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
6215ee3e8c14Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
6216ee3e8c14Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
6217ee3e8c14Smrg    LDFLAGS=$save_LDFLAGS
6218ee3e8c14Smrg    libdir=$save_libdir
6219ee3e8c14Smrg    ])
6220ee3e8c14Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
6221b290cf36Smrg
6222ee3e8c14Smrg  # This implies no fast_install, which is unacceptable.
6223ee3e8c14Smrg  # Some rework will be needed to allow for fast_install
6224ee3e8c14Smrg  # before this can be enabled.
6225ee3e8c14Smrg  hardcode_into_libs=yes
6226b290cf36Smrg
6227ee3e8c14Smrg  # Ideally, we could use ldconfig to report *all* directores which are
6228ee3e8c14Smrg  # searched for libraries, however this is still not possible.  Aside from not
6229ee3e8c14Smrg  # being certain /sbin/ldconfig is available, command
6230ee3e8c14Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
6231ee3e8c14Smrg  # even though it is searched at run-time.  Try to do the best guess by
6232ee3e8c14Smrg  # appending ld.so.conf contents (and includes) to the search path.
6233ee3e8c14Smrg  if test -f /etc/ld.so.conf; then
6234ee3e8c14Smrg    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' ' '`
6235ee3e8c14Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
6236ee3e8c14Smrg  fi
6237b290cf36Smrg
6238ee3e8c14Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
6239ee3e8c14Smrg  # powerpc, because MkLinux only supported shared libraries with the
6240ee3e8c14Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
6241ee3e8c14Smrg  # most powerpc-linux boxes support dynamic linking these days and
6242ee3e8c14Smrg  # people can always --disable-shared, the test was removed, and we
6243ee3e8c14Smrg  # assume the GNU/Linux dynamic linker is in use.
6244ee3e8c14Smrg  dynamic_linker='GNU/Linux ld.so'
6245ee3e8c14Smrg  ;;
6246b290cf36Smrg
6247ee3e8c14Smrgnetbsd*)
6248ee3e8c14Smrg  version_type=sunos
6249ee3e8c14Smrg  need_lib_prefix=no
6250ee3e8c14Smrg  need_version=no
6251ee3e8c14Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6252ee3e8c14Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6253ee3e8c14Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6254ee3e8c14Smrg    dynamic_linker='NetBSD (a.out) ld.so'
6255ee3e8c14Smrg  else
6256ee3e8c14Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6257ee3e8c14Smrg    soname_spec='$libname$release$shared_ext$major'
6258ee3e8c14Smrg    dynamic_linker='NetBSD ld.elf_so'
6259ee3e8c14Smrg  fi
6260ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6261ee3e8c14Smrg  shlibpath_overrides_runpath=yes
6262ee3e8c14Smrg  hardcode_into_libs=yes
6263ee3e8c14Smrg  ;;
6264b290cf36Smrg
6265ee3e8c14Smrgnewsos6)
6266ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6267ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6268ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6269ee3e8c14Smrg  shlibpath_overrides_runpath=yes
6270ee3e8c14Smrg  ;;
6271b290cf36Smrg
6272ee3e8c14Smrg*nto* | *qnx*)
6273ee3e8c14Smrg  version_type=qnx
6274ee3e8c14Smrg  need_lib_prefix=no
6275ee3e8c14Smrg  need_version=no
6276ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6277ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6278ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6279ee3e8c14Smrg  shlibpath_overrides_runpath=no
6280ee3e8c14Smrg  hardcode_into_libs=yes
6281ee3e8c14Smrg  dynamic_linker='ldqnx.so'
6282ee3e8c14Smrg  ;;
6283b290cf36Smrg
6284ee3e8c14Smrgopenbsd* | bitrig*)
6285ee3e8c14Smrg  version_type=sunos
6286ee3e8c14Smrg  sys_lib_dlsearch_path_spec=/usr/lib
6287ee3e8c14Smrg  need_lib_prefix=no
6288ee3e8c14Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
6289ee3e8c14Smrg    need_version=no
6290ee3e8c14Smrg  else
6291ee3e8c14Smrg    need_version=yes
6292ee3e8c14Smrg  fi
6293ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6294ee3e8c14Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6295ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6296ee3e8c14Smrg  shlibpath_overrides_runpath=yes
6297ee3e8c14Smrg  ;;
6298ee3e8c14Smrg
6299ee3e8c14Smrgos2*)
6300ee3e8c14Smrg  libname_spec='$name'
6301ee3e8c14Smrg  version_type=windows
6302ee3e8c14Smrg  shrext_cmds=.dll
6303ee3e8c14Smrg  need_version=no
6304ee3e8c14Smrg  need_lib_prefix=no
6305ee3e8c14Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
6306ee3e8c14Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
6307ee3e8c14Smrg    v=$($ECHO $release$versuffix | tr -d .-);
6308ee3e8c14Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
6309ee3e8c14Smrg    $ECHO $n$v`$shared_ext'
6310ee3e8c14Smrg  library_names_spec='${libname}_dll.$libext'
6311ee3e8c14Smrg  dynamic_linker='OS/2 ld.exe'
6312ee3e8c14Smrg  shlibpath_var=BEGINLIBPATH
6313ee3e8c14Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6314ee3e8c14Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6315ee3e8c14Smrg  postinstall_cmds='base_file=`basename \$file`~
6316ee3e8c14Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
6317ee3e8c14Smrg    dldir=$destdir/`dirname \$dlpath`~
6318ee3e8c14Smrg    test -d \$dldir || mkdir -p \$dldir~
6319ee3e8c14Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
6320ee3e8c14Smrg    chmod a+x \$dldir/$dlname~
6321ee3e8c14Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
6322ee3e8c14Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
6323ee3e8c14Smrg    fi'
6324ee3e8c14Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
6325ee3e8c14Smrg    dlpath=$dir/\$dldll~
6326ee3e8c14Smrg    $RM \$dlpath'
6327ee3e8c14Smrg  ;;
6328b290cf36Smrg
6329ee3e8c14Smrgosf3* | osf4* | osf5*)
6330ee3e8c14Smrg  version_type=osf
6331ee3e8c14Smrg  need_lib_prefix=no
6332ee3e8c14Smrg  need_version=no
6333ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6334ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6335ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6336ee3e8c14Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6337ee3e8c14Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6338ee3e8c14Smrg  ;;
6339b290cf36Smrg
6340ee3e8c14Smrgrdos*)
6341ee3e8c14Smrg  dynamic_linker=no
6342ee3e8c14Smrg  ;;
6343b290cf36Smrg
6344ee3e8c14Smrgsolaris*)
6345ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6346ee3e8c14Smrg  need_lib_prefix=no
6347ee3e8c14Smrg  need_version=no
6348ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6349ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6350ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6351ee3e8c14Smrg  shlibpath_overrides_runpath=yes
6352ee3e8c14Smrg  hardcode_into_libs=yes
6353ee3e8c14Smrg  # ldd complains unless libraries are executable
6354ee3e8c14Smrg  postinstall_cmds='chmod +x $lib'
6355ee3e8c14Smrg  ;;
6356b290cf36Smrg
6357ee3e8c14Smrgsunos4*)
6358ee3e8c14Smrg  version_type=sunos
6359ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6360ee3e8c14Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6361ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6362ee3e8c14Smrg  shlibpath_overrides_runpath=yes
6363ee3e8c14Smrg  if test yes = "$with_gnu_ld"; then
6364ee3e8c14Smrg    need_lib_prefix=no
6365ee3e8c14Smrg  fi
6366ee3e8c14Smrg  need_version=yes
6367ee3e8c14Smrg  ;;
6368b290cf36Smrg
6369ee3e8c14Smrgsysv4 | sysv4.3*)
6370ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6371ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6372ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6373ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6374ee3e8c14Smrg  case $host_vendor in
6375ee3e8c14Smrg    sni)
6376ee3e8c14Smrg      shlibpath_overrides_runpath=no
6377ee3e8c14Smrg      need_lib_prefix=no
6378ee3e8c14Smrg      runpath_var=LD_RUN_PATH
6379ee3e8c14Smrg      ;;
6380ee3e8c14Smrg    siemens)
6381ee3e8c14Smrg      need_lib_prefix=no
6382ee3e8c14Smrg      ;;
6383ee3e8c14Smrg    motorola)
6384ee3e8c14Smrg      need_lib_prefix=no
6385ee3e8c14Smrg      need_version=no
6386ee3e8c14Smrg      shlibpath_overrides_runpath=no
6387ee3e8c14Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6388ee3e8c14Smrg      ;;
6389d9dcd5aeSmrg  esac
6390ee3e8c14Smrg  ;;
6391b290cf36Smrg
6392ee3e8c14Smrgsysv4*MP*)
6393ee3e8c14Smrg  if test -d /usr/nec; then
6394ee3e8c14Smrg    version_type=linux # correct to gnu/linux during the next big refactor
6395ee3e8c14Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
6396ee3e8c14Smrg    soname_spec='$libname$shared_ext.$major'
6397ee3e8c14Smrg    shlibpath_var=LD_LIBRARY_PATH
6398ee3e8c14Smrg  fi
6399ee3e8c14Smrg  ;;
6400b290cf36Smrg
6401ee3e8c14Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
6402ee3e8c14Smrg  version_type=sco
6403ee3e8c14Smrg  need_lib_prefix=no
6404ee3e8c14Smrg  need_version=no
6405ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
6406ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6407ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6408ee3e8c14Smrg  shlibpath_overrides_runpath=yes
6409ee3e8c14Smrg  hardcode_into_libs=yes
6410ee3e8c14Smrg  if test yes = "$with_gnu_ld"; then
6411ee3e8c14Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
6412ee3e8c14Smrg  else
6413ee3e8c14Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
6414ee3e8c14Smrg    case $host_os in
6415ee3e8c14Smrg      sco3.2v5*)
6416ee3e8c14Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
6417ee3e8c14Smrg	;;
6418ee3e8c14Smrg    esac
6419ee3e8c14Smrg  fi
6420ee3e8c14Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
6421ee3e8c14Smrg  ;;
6422b290cf36Smrg
6423ee3e8c14Smrgtpf*)
6424ee3e8c14Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
6425ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6426ee3e8c14Smrg  need_lib_prefix=no
6427ee3e8c14Smrg  need_version=no
6428ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6429ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6430ee3e8c14Smrg  shlibpath_overrides_runpath=no
6431ee3e8c14Smrg  hardcode_into_libs=yes
6432ee3e8c14Smrg  ;;
6433b290cf36Smrg
6434ee3e8c14Smrguts4*)
6435ee3e8c14Smrg  version_type=linux # correct to gnu/linux during the next big refactor
6436ee3e8c14Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6437ee3e8c14Smrg  soname_spec='$libname$release$shared_ext$major'
6438ee3e8c14Smrg  shlibpath_var=LD_LIBRARY_PATH
6439ee3e8c14Smrg  ;;
6440b290cf36Smrg
6441ee3e8c14Smrg*)
6442ee3e8c14Smrg  dynamic_linker=no
6443ee3e8c14Smrg  ;;
6444ee3e8c14Smrgesac
6445ee3e8c14SmrgAC_MSG_RESULT([$dynamic_linker])
6446ee3e8c14Smrgtest no = "$dynamic_linker" && can_build_shared=no
6447b290cf36Smrg
6448ee3e8c14Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6449ee3e8c14Smrgif test yes = "$GCC"; then
6450ee3e8c14Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6451ee3e8c14Smrgfi
6452b290cf36Smrg
6453ee3e8c14Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
6454ee3e8c14Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
6455ee3e8c14Smrgfi
6456191cded7Smrg
6457ee3e8c14Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
6458ee3e8c14Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
6459ee3e8c14Smrgfi
6460b290cf36Smrg
6461ee3e8c14Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
6462ee3e8c14Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
6463b290cf36Smrg
6464ee3e8c14Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
6465ee3e8c14Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
6466b290cf36Smrg
6467ee3e8c14Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
6468ee3e8c14Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
6469b290cf36Smrg
6470ee3e8c14Smrg_LT_DECL([], [variables_saved_for_relink], [1],
6471ee3e8c14Smrg    [Variables whose values should be saved in libtool wrapper scripts and
6472ee3e8c14Smrg    restored at link time])
6473ee3e8c14Smrg_LT_DECL([], [need_lib_prefix], [0],
6474ee3e8c14Smrg    [Do we need the "lib" prefix for modules?])
6475ee3e8c14Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
6476ee3e8c14Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
6477ee3e8c14Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
6478ee3e8c14Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
6479ee3e8c14Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
6480ee3e8c14Smrg    [Is shlibpath searched before the hard-coded library search path?])
6481ee3e8c14Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
6482ee3e8c14Smrg_LT_DECL([], [library_names_spec], [1],
6483ee3e8c14Smrg    [[List of archive names.  First name is the real one, the rest are links.
6484ee3e8c14Smrg    The last name is the one that the linker finds with -lNAME]])
6485ee3e8c14Smrg_LT_DECL([], [soname_spec], [1],
6486ee3e8c14Smrg    [[The coded name of the library, if different from the real name]])
6487ee3e8c14Smrg_LT_DECL([], [install_override_mode], [1],
6488ee3e8c14Smrg    [Permission mode override for installation of shared libraries])
6489ee3e8c14Smrg_LT_DECL([], [postinstall_cmds], [2],
6490ee3e8c14Smrg    [Command to use after installation of a shared archive])
6491ee3e8c14Smrg_LT_DECL([], [postuninstall_cmds], [2],
6492ee3e8c14Smrg    [Command to use after uninstallation of a shared archive])
6493ee3e8c14Smrg_LT_DECL([], [finish_cmds], [2],
6494ee3e8c14Smrg    [Commands used to finish a libtool library installation in a directory])
6495ee3e8c14Smrg_LT_DECL([], [finish_eval], [1],
6496ee3e8c14Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
6497ee3e8c14Smrg    not shown]])
6498ee3e8c14Smrg_LT_DECL([], [hardcode_into_libs], [0],
6499ee3e8c14Smrg    [Whether we should hardcode library paths into libraries])
6500ee3e8c14Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
6501ee3e8c14Smrg    [Compile-time system search path for libraries])
6502ee3e8c14Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
6503ee3e8c14Smrg    [Detected run-time system search path for libraries])
6504ee3e8c14Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
6505ee3e8c14Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
6506ee3e8c14Smrg])# _LT_SYS_DYNAMIC_LINKER
6507191cded7Smrg
6508191cded7Smrg
6509ee3e8c14Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
6510ee3e8c14Smrg# --------------------------
6511ee3e8c14Smrg# find a file program that can recognize shared library
6512ee3e8c14SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
6513ee3e8c14Smrg[m4_require([_LT_DECL_EGREP])dnl
6514ee3e8c14SmrgAC_MSG_CHECKING([for $1])
6515ee3e8c14SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
6516ee3e8c14Smrg[case $MAGIC_CMD in
6517ee3e8c14Smrg[[\\/*] |  ?:[\\/]*])
6518ee3e8c14Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
6519ee3e8c14Smrg  ;;
6520ee3e8c14Smrg*)
6521ee3e8c14Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
6522ee3e8c14Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6523ee3e8c14Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
6524ee3e8c14Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
6525ee3e8c14Smrgdnl not every word.  This closes a longstanding sh security hole.
6526ee3e8c14Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
6527ee3e8c14Smrg  for ac_dir in $ac_dummy; do
6528ee3e8c14Smrg    IFS=$lt_save_ifs
6529ee3e8c14Smrg    test -z "$ac_dir" && ac_dir=.
6530ee3e8c14Smrg    if test -f "$ac_dir/$1"; then
6531ee3e8c14Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
6532ee3e8c14Smrg      if test -n "$file_magic_test_file"; then
6533ee3e8c14Smrg	case $deplibs_check_method in
6534ee3e8c14Smrg	"file_magic "*)
6535ee3e8c14Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
6536ee3e8c14Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
6537ee3e8c14Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
6538ee3e8c14Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
6539ee3e8c14Smrg	    :
6540ee3e8c14Smrg	  else
6541ee3e8c14Smrg	    cat <<_LT_EOF 1>&2
6542ee3e8c14Smrg
6543ee3e8c14Smrg*** Warning: the command libtool uses to detect shared libraries,
6544ee3e8c14Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
6545ee3e8c14Smrg*** The result is that libtool may fail to recognize shared libraries
6546ee3e8c14Smrg*** as such.  This will affect the creation of libtool libraries that
6547ee3e8c14Smrg*** depend on shared libraries, but programs linked with such libtool
6548ee3e8c14Smrg*** libraries will work regardless of this problem.  Nevertheless, you
6549ee3e8c14Smrg*** may want to report the problem to your system manager and/or to
6550ee3e8c14Smrg*** bug-libtool@gnu.org
6551191cded7Smrg
6552ee3e8c14Smrg_LT_EOF
6553ee3e8c14Smrg	  fi ;;
6554ee3e8c14Smrg	esac
6555ee3e8c14Smrg      fi
6556ee3e8c14Smrg      break
6557ee3e8c14Smrg    fi
6558ee3e8c14Smrg  done
6559ee3e8c14Smrg  IFS=$lt_save_ifs
6560ee3e8c14Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
6561ee3e8c14Smrg  ;;
6562ee3e8c14Smrgesac])
6563ee3e8c14SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
6564ee3e8c14Smrgif test -n "$MAGIC_CMD"; then
6565ee3e8c14Smrg  AC_MSG_RESULT($MAGIC_CMD)
6566ee3e8c14Smrgelse
6567ee3e8c14Smrg  AC_MSG_RESULT(no)
6568ee3e8c14Smrgfi
6569ee3e8c14Smrg_LT_DECL([], [MAGIC_CMD], [0],
6570ee3e8c14Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
6571ee3e8c14Smrg])# _LT_PATH_TOOL_PREFIX
6572191cded7Smrg
6573ee3e8c14Smrg# Old name:
6574ee3e8c14SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
6575ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
6576ee3e8c14Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
6577191cded7Smrg
6578191cded7Smrg
6579ee3e8c14Smrg# _LT_PATH_MAGIC
6580ee3e8c14Smrg# --------------
6581ee3e8c14Smrg# find a file program that can recognize a shared library
6582ee3e8c14Smrgm4_defun([_LT_PATH_MAGIC],
6583ee3e8c14Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
6584ee3e8c14Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
6585ee3e8c14Smrg  if test -n "$ac_tool_prefix"; then
6586ee3e8c14Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
6587ee3e8c14Smrg  else
6588ee3e8c14Smrg    MAGIC_CMD=:
6589ee3e8c14Smrg  fi
6590ee3e8c14Smrgfi
6591ee3e8c14Smrg])# _LT_PATH_MAGIC
6592d9dcd5aeSmrg
6593ba064abeSmrg
6594ee3e8c14Smrg# LT_PATH_LD
6595ee3e8c14Smrg# ----------
6596ee3e8c14Smrg# find the pathname to the GNU or non-GNU linker
6597ee3e8c14SmrgAC_DEFUN([LT_PATH_LD],
6598ee3e8c14Smrg[AC_REQUIRE([AC_PROG_CC])dnl
6599ee3e8c14SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
6600ee3e8c14SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
6601ee3e8c14Smrgm4_require([_LT_DECL_SED])dnl
6602ee3e8c14Smrgm4_require([_LT_DECL_EGREP])dnl
6603ee3e8c14Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
6604d9dcd5aeSmrg
6605ee3e8c14SmrgAC_ARG_WITH([gnu-ld],
6606ee3e8c14Smrg    [AS_HELP_STRING([--with-gnu-ld],
6607ee3e8c14Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
6608ee3e8c14Smrg    [test no = "$withval" || with_gnu_ld=yes],
6609ee3e8c14Smrg    [with_gnu_ld=no])dnl
6610d9dcd5aeSmrg
6611ee3e8c14Smrgac_prog=ld
6612ee3e8c14Smrgif test yes = "$GCC"; then
6613ee3e8c14Smrg  # Check if gcc -print-prog-name=ld gives a path.
6614ee3e8c14Smrg  AC_MSG_CHECKING([for ld used by $CC])
6615ee3e8c14Smrg  case $host in
6616ee3e8c14Smrg  *-*-mingw*)
6617ee3e8c14Smrg    # gcc leaves a trailing carriage return, which upsets mingw
6618ee3e8c14Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6619ee3e8c14Smrg  *)
6620ee3e8c14Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6621ee3e8c14Smrg  esac
6622ee3e8c14Smrg  case $ac_prog in
6623ee3e8c14Smrg    # Accept absolute paths.
6624ee3e8c14Smrg    [[\\/]]* | ?:[[\\/]]*)
6625ee3e8c14Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
6626ee3e8c14Smrg      # Canonicalize the pathname of ld
6627ee3e8c14Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
6628ee3e8c14Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
6629ee3e8c14Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
6630ee3e8c14Smrg      done
6631ee3e8c14Smrg      test -z "$LD" && LD=$ac_prog
6632ee3e8c14Smrg      ;;
6633ee3e8c14Smrg  "")
6634ee3e8c14Smrg    # If it fails, then pretend we aren't using GCC.
6635ee3e8c14Smrg    ac_prog=ld
6636ee3e8c14Smrg    ;;
6637ee3e8c14Smrg  *)
6638ee3e8c14Smrg    # If it is relative, then search for the first ld in PATH.
6639ee3e8c14Smrg    with_gnu_ld=unknown
6640ee3e8c14Smrg    ;;
6641ee3e8c14Smrg  esac
6642ee3e8c14Smrgelif test yes = "$with_gnu_ld"; then
6643ee3e8c14Smrg  AC_MSG_CHECKING([for GNU ld])
6644ee3e8c14Smrgelse
6645ee3e8c14Smrg  AC_MSG_CHECKING([for non-GNU ld])
6646ee3e8c14Smrgfi
6647ee3e8c14SmrgAC_CACHE_VAL(lt_cv_path_LD,
6648ee3e8c14Smrg[if test -z "$LD"; then
6649ee3e8c14Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6650ee3e8c14Smrg  for ac_dir in $PATH; do
6651ee3e8c14Smrg    IFS=$lt_save_ifs
6652ee3e8c14Smrg    test -z "$ac_dir" && ac_dir=.
6653ee3e8c14Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6654ee3e8c14Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
6655ee3e8c14Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
6656ee3e8c14Smrg      # but apparently some variants of GNU ld only accept -v.
6657ee3e8c14Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
6658ee3e8c14Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
6659ee3e8c14Smrg      *GNU* | *'with BFD'*)
6660ee3e8c14Smrg	test no != "$with_gnu_ld" && break
6661ee3e8c14Smrg	;;
6662ee3e8c14Smrg      *)
6663ee3e8c14Smrg	test yes != "$with_gnu_ld" && break
6664ee3e8c14Smrg	;;
6665ee3e8c14Smrg      esac
6666ba064abeSmrg    fi
6667ee3e8c14Smrg  done
6668ee3e8c14Smrg  IFS=$lt_save_ifs
6669ee3e8c14Smrgelse
6670ee3e8c14Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
6671ee3e8c14Smrgfi])
6672ee3e8c14SmrgLD=$lt_cv_path_LD
6673ee3e8c14Smrgif test -n "$LD"; then
6674ee3e8c14Smrg  AC_MSG_RESULT($LD)
6675ee3e8c14Smrgelse
6676ee3e8c14Smrg  AC_MSG_RESULT(no)
6677ee3e8c14Smrgfi
6678ee3e8c14Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
6679ee3e8c14Smrg_LT_PATH_LD_GNU
6680ee3e8c14SmrgAC_SUBST([LD])
6681b290cf36Smrg
6682ee3e8c14Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
6683ee3e8c14Smrg])# LT_PATH_LD
6684d9dcd5aeSmrg
6685ee3e8c14Smrg# Old names:
6686ee3e8c14SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
6687ee3e8c14SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
6688ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
6689ee3e8c14Smrgdnl AC_DEFUN([AM_PROG_LD], [])
6690ee3e8c14Smrgdnl AC_DEFUN([AC_PROG_LD], [])
6691d9dcd5aeSmrg
6692d9dcd5aeSmrg
6693ee3e8c14Smrg# _LT_PATH_LD_GNU
6694ee3e8c14Smrg#- --------------
6695ee3e8c14Smrgm4_defun([_LT_PATH_LD_GNU],
6696ee3e8c14Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
6697ee3e8c14Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
6698ee3e8c14Smrgcase `$LD -v 2>&1 </dev/null` in
6699ee3e8c14Smrg*GNU* | *'with BFD'*)
6700ee3e8c14Smrg  lt_cv_prog_gnu_ld=yes
6701ee3e8c14Smrg  ;;
6702ee3e8c14Smrg*)
6703ee3e8c14Smrg  lt_cv_prog_gnu_ld=no
6704ee3e8c14Smrg  ;;
6705ee3e8c14Smrgesac])
6706ee3e8c14Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
6707ee3e8c14Smrg])# _LT_PATH_LD_GNU
6708d9dcd5aeSmrg
6709d9dcd5aeSmrg
6710ee3e8c14Smrg# _LT_CMD_RELOAD
6711ee3e8c14Smrg# --------------
6712ee3e8c14Smrg# find reload flag for linker
6713ee3e8c14Smrg#   -- PORTME Some linkers may need a different reload flag.
6714ee3e8c14Smrgm4_defun([_LT_CMD_RELOAD],
6715ee3e8c14Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
6716ee3e8c14Smrg  lt_cv_ld_reload_flag,
6717ee3e8c14Smrg  [lt_cv_ld_reload_flag='-r'])
6718ee3e8c14Smrgreload_flag=$lt_cv_ld_reload_flag
6719ee3e8c14Smrgcase $reload_flag in
6720ee3e8c14Smrg"" | " "*) ;;
6721ee3e8c14Smrg*) reload_flag=" $reload_flag" ;;
6722ee3e8c14Smrgesac
6723ee3e8c14Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
6724ee3e8c14Smrgcase $host_os in
6725ee3e8c14Smrg  cygwin* | mingw* | pw32* | cegcc*)
6726ee3e8c14Smrg    if test yes != "$GCC"; then
6727ee3e8c14Smrg      reload_cmds=false
6728ee3e8c14Smrg    fi
6729ee3e8c14Smrg    ;;
6730ee3e8c14Smrg  darwin*)
6731ee3e8c14Smrg    if test yes = "$GCC"; then
6732ee3e8c14Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
6733ee3e8c14Smrg    else
6734ee3e8c14Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
6735ee3e8c14Smrg    fi
6736ee3e8c14Smrg    ;;
6737ee3e8c14Smrgesac
6738ee3e8c14Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
6739ee3e8c14Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
6740ee3e8c14Smrg])# _LT_CMD_RELOAD
6741d9dcd5aeSmrg
6742d9dcd5aeSmrg
6743ee3e8c14Smrg# _LT_PATH_DD
6744ee3e8c14Smrg# -----------
6745ee3e8c14Smrg# find a working dd
6746ee3e8c14Smrgm4_defun([_LT_PATH_DD],
6747ee3e8c14Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
6748ee3e8c14Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
6749ee3e8c14Smrgcat conftest.i conftest.i >conftest2.i
6750ee3e8c14Smrg: ${lt_DD:=$DD}
6751ee3e8c14SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
6752ee3e8c14Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6753ee3e8c14Smrg  cmp -s conftest.i conftest.out \
6754ee3e8c14Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6755ee3e8c14Smrgfi])
6756ee3e8c14Smrgrm -f conftest.i conftest2.i conftest.out])
6757ee3e8c14Smrg])# _LT_PATH_DD
6758d9dcd5aeSmrg
6759d9dcd5aeSmrg
6760ee3e8c14Smrg# _LT_CMD_TRUNCATE
6761ee3e8c14Smrg# ----------------
6762ee3e8c14Smrg# find command to truncate a binary pipe
6763ee3e8c14Smrgm4_defun([_LT_CMD_TRUNCATE],
6764ee3e8c14Smrg[m4_require([_LT_PATH_DD])
6765ee3e8c14SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
6766ee3e8c14Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
6767ee3e8c14Smrgcat conftest.i conftest.i >conftest2.i
6768ee3e8c14Smrglt_cv_truncate_bin=
6769ee3e8c14Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6770ee3e8c14Smrg  cmp -s conftest.i conftest.out \
6771ee3e8c14Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6772ee3e8c14Smrgfi
6773ee3e8c14Smrgrm -f conftest.i conftest2.i conftest.out
6774ee3e8c14Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
6775ee3e8c14Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
6776ee3e8c14Smrg  [Command to truncate a binary pipe])
6777ee3e8c14Smrg])# _LT_CMD_TRUNCATE
6778d9dcd5aeSmrg
6779d9dcd5aeSmrg
6780ee3e8c14Smrg# _LT_CHECK_MAGIC_METHOD
6781ee3e8c14Smrg# ----------------------
6782ee3e8c14Smrg# how to check for library dependencies
6783ee3e8c14Smrg#  -- PORTME fill in with the dynamic library characteristics
6784ee3e8c14Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
6785ee3e8c14Smrg[m4_require([_LT_DECL_EGREP])
6786ee3e8c14Smrgm4_require([_LT_DECL_OBJDUMP])
6787ee3e8c14SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
6788ee3e8c14Smrglt_cv_deplibs_check_method,
6789ee3e8c14Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
6790ee3e8c14Smrglt_cv_file_magic_test_file=
6791ee3e8c14Smrglt_cv_deplibs_check_method='unknown'
6792ee3e8c14Smrg# Need to set the preceding variable on all platforms that support
6793ee3e8c14Smrg# interlibrary dependencies.
6794ee3e8c14Smrg# 'none' -- dependencies not supported.
6795ee3e8c14Smrg# 'unknown' -- same as none, but documents that we really don't know.
6796ee3e8c14Smrg# 'pass_all' -- all dependencies passed with no checks.
6797ee3e8c14Smrg# 'test_compile' -- check by making test program.
6798ee3e8c14Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
6799ee3e8c14Smrg# that responds to the $file_magic_cmd with a given extended regex.
6800ee3e8c14Smrg# If you have 'file' or equivalent on your system and you're not sure
6801ee3e8c14Smrg# whether 'pass_all' will *always* work, you probably want this one.
6802b290cf36Smrg
6803ee3e8c14Smrgcase $host_os in
6804ee3e8c14Smrgaix[[4-9]]*)
6805ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6806ee3e8c14Smrg  ;;
6807b290cf36Smrg
6808ee3e8c14Smrgbeos*)
6809ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6810ee3e8c14Smrg  ;;
6811b290cf36Smrg
6812ee3e8c14Smrgbsdi[[45]]*)
6813ee3e8c14Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
6814ee3e8c14Smrg  lt_cv_file_magic_cmd='$FILECMD -L'
6815ee3e8c14Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
6816ee3e8c14Smrg  ;;
6817b290cf36Smrg
6818ee3e8c14Smrgcygwin*)
6819ee3e8c14Smrg  # func_win32_libid is a shell function defined in ltmain.sh
6820ee3e8c14Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6821ee3e8c14Smrg  lt_cv_file_magic_cmd='func_win32_libid'
6822ee3e8c14Smrg  ;;
6823b290cf36Smrg
6824ee3e8c14Smrgmingw* | pw32*)
6825ee3e8c14Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
6826ee3e8c14Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
6827ee3e8c14Smrg  # unless we find 'file', for example because we are cross-compiling.
6828ee3e8c14Smrg  if ( file / ) >/dev/null 2>&1; then
6829ee3e8c14Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6830ee3e8c14Smrg    lt_cv_file_magic_cmd='func_win32_libid'
6831ee3e8c14Smrg  else
6832ee3e8c14Smrg    # Keep this pattern in sync with the one in func_win32_libid.
6833ee3e8c14Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
6834ee3e8c14Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
6835ee3e8c14Smrg  fi
6836ee3e8c14Smrg  ;;
6837d9dcd5aeSmrg
6838ee3e8c14Smrgcegcc*)
6839ee3e8c14Smrg  # use the weaker test based on 'objdump'. See mingw*.
6840ee3e8c14Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
6841ee3e8c14Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
6842ee3e8c14Smrg  ;;
6843b290cf36Smrg
6844ee3e8c14Smrgdarwin* | rhapsody*)
6845ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6846ee3e8c14Smrg  ;;
6847b290cf36Smrg
6848ee3e8c14Smrgfreebsd* | dragonfly* | midnightbsd*)
6849ee3e8c14Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6850ee3e8c14Smrg    case $host_cpu in
6851ee3e8c14Smrg    i*86 )
6852ee3e8c14Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
6853ee3e8c14Smrg      # Let's accept both of them until this is cleared up.
6854ee3e8c14Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
6855ee3e8c14Smrg      lt_cv_file_magic_cmd=$FILECMD
6856ee3e8c14Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
6857ee3e8c14Smrg      ;;
6858ee3e8c14Smrg    esac
6859ee3e8c14Smrg  else
6860ee3e8c14Smrg    lt_cv_deplibs_check_method=pass_all
6861ee3e8c14Smrg  fi
6862ee3e8c14Smrg  ;;
6863ee3e8c14Smrg
6864ee3e8c14Smrghaiku*)
6865ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6866ee3e8c14Smrg  ;;
6867ee3e8c14Smrg
6868ee3e8c14Smrghpux10.20* | hpux11*)
6869ee3e8c14Smrg  lt_cv_file_magic_cmd=$FILECMD
6870ee3e8c14Smrg  case $host_cpu in
6871ee3e8c14Smrg  ia64*)
6872ee3e8c14Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
6873ee3e8c14Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
6874ee3e8c14Smrg    ;;
6875ee3e8c14Smrg  hppa*64*)
6876ee3e8c14Smrg    [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]']
6877ee3e8c14Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
6878ee3e8c14Smrg    ;;
6879ee3e8c14Smrg  *)
6880ee3e8c14Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
6881ee3e8c14Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
6882ee3e8c14Smrg    ;;
6883ee3e8c14Smrg  esac
6884ee3e8c14Smrg  ;;
6885b290cf36Smrg
6886ee3e8c14Smrginterix[[3-9]]*)
6887ee3e8c14Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
6888ee3e8c14Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
6889ee3e8c14Smrg  ;;
6890191cded7Smrg
6891ee3e8c14Smrgirix5* | irix6* | nonstopux*)
6892ee3e8c14Smrg  case $LD in
6893ee3e8c14Smrg  *-32|*"-32 ") libmagic=32-bit;;
6894ee3e8c14Smrg  *-n32|*"-n32 ") libmagic=N32;;
6895ee3e8c14Smrg  *-64|*"-64 ") libmagic=64-bit;;
6896ee3e8c14Smrg  *) libmagic=never-match;;
6897ee3e8c14Smrg  esac
6898ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6899ee3e8c14Smrg  ;;
6900b290cf36Smrg
6901ee3e8c14Smrg# This must be glibc/ELF.
6902ee3e8c14Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6903ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6904ee3e8c14Smrg  ;;
6905d9dcd5aeSmrg
6906ee3e8c14Smrgnetbsd*)
6907ee3e8c14Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6908ee3e8c14Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
6909ee3e8c14Smrg  else
6910ee3e8c14Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
6911ee3e8c14Smrg  fi
6912ee3e8c14Smrg  ;;
6913d9dcd5aeSmrg
6914ee3e8c14Smrgnewos6*)
6915ee3e8c14Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
6916ee3e8c14Smrg  lt_cv_file_magic_cmd=$FILECMD
6917ee3e8c14Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
6918ee3e8c14Smrg  ;;
6919b290cf36Smrg
6920ee3e8c14Smrg*nto* | *qnx*)
6921ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6922ee3e8c14Smrg  ;;
6923b290cf36Smrg
6924ee3e8c14Smrgopenbsd* | bitrig*)
6925ee3e8c14Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
6926ee3e8c14Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
6927ee3e8c14Smrg  else
6928ee3e8c14Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
6929ee3e8c14Smrg  fi
6930ee3e8c14Smrg  ;;
6931b290cf36Smrg
6932ee3e8c14Smrgosf3* | osf4* | osf5*)
6933ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6934ee3e8c14Smrg  ;;
6935b290cf36Smrg
6936ee3e8c14Smrgrdos*)
6937ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6938ee3e8c14Smrg  ;;
6939b290cf36Smrg
6940ee3e8c14Smrgsolaris*)
6941ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6942ee3e8c14Smrg  ;;
6943b290cf36Smrg
6944ee3e8c14Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
6945ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6946ee3e8c14Smrg  ;;
6947b290cf36Smrg
6948ee3e8c14Smrgsysv4 | sysv4.3*)
6949ee3e8c14Smrg  case $host_vendor in
6950ee3e8c14Smrg  motorola)
6951ee3e8c14Smrg    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]]'
6952ee3e8c14Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
6953ee3e8c14Smrg    ;;
6954ee3e8c14Smrg  ncr)
6955ee3e8c14Smrg    lt_cv_deplibs_check_method=pass_all
6956ee3e8c14Smrg    ;;
6957ee3e8c14Smrg  sequent)
6958ee3e8c14Smrg    lt_cv_file_magic_cmd='/bin/file'
6959ee3e8c14Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
6960ee3e8c14Smrg    ;;
6961ee3e8c14Smrg  sni)
6962ee3e8c14Smrg    lt_cv_file_magic_cmd='/bin/file'
6963ee3e8c14Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
6964ee3e8c14Smrg    lt_cv_file_magic_test_file=/lib/libc.so
6965ee3e8c14Smrg    ;;
6966ee3e8c14Smrg  siemens)
6967ee3e8c14Smrg    lt_cv_deplibs_check_method=pass_all
6968ee3e8c14Smrg    ;;
6969ee3e8c14Smrg  pc)
6970ee3e8c14Smrg    lt_cv_deplibs_check_method=pass_all
6971ee3e8c14Smrg    ;;
6972ee3e8c14Smrg  esac
6973ee3e8c14Smrg  ;;
6974b290cf36Smrg
6975ee3e8c14Smrgtpf*)
6976ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6977ee3e8c14Smrg  ;;
6978ee3e8c14Smrgos2*)
6979ee3e8c14Smrg  lt_cv_deplibs_check_method=pass_all
6980ee3e8c14Smrg  ;;
6981ee3e8c14Smrgesac
6982ee3e8c14Smrg])
6983b290cf36Smrg
6984ee3e8c14Smrgfile_magic_glob=
6985ee3e8c14Smrgwant_nocaseglob=no
6986ee3e8c14Smrgif test "$build" = "$host"; then
6987ee3e8c14Smrg  case $host_os in
6988ee3e8c14Smrg  mingw* | pw32*)
6989ee3e8c14Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
6990ee3e8c14Smrg      want_nocaseglob=yes
6991ee3e8c14Smrg    else
6992ee3e8c14Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
6993ee3e8c14Smrg    fi
6994ee3e8c14Smrg    ;;
6995ee3e8c14Smrg  esac
6996ee3e8c14Smrgfi
6997b290cf36Smrg
6998ee3e8c14Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
6999ee3e8c14Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
7000ee3e8c14Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
7001d9dcd5aeSmrg
7002ee3e8c14Smrg_LT_DECL([], [deplibs_check_method], [1],
7003ee3e8c14Smrg    [Method to check whether dependent libraries are shared objects])
7004ee3e8c14Smrg_LT_DECL([], [file_magic_cmd], [1],
7005ee3e8c14Smrg    [Command to use when deplibs_check_method = "file_magic"])
7006ee3e8c14Smrg_LT_DECL([], [file_magic_glob], [1],
7007ee3e8c14Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
7008ee3e8c14Smrg_LT_DECL([], [want_nocaseglob], [1],
7009ee3e8c14Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
7010ee3e8c14Smrg])# _LT_CHECK_MAGIC_METHOD
7011d9dcd5aeSmrg
7012ee3e8c14Smrg
7013ee3e8c14Smrg# LT_PATH_NM
7014ee3e8c14Smrg# ----------
7015ee3e8c14Smrg# find the pathname to a BSD- or MS-compatible name lister
7016ee3e8c14SmrgAC_DEFUN([LT_PATH_NM],
7017ee3e8c14Smrg[AC_REQUIRE([AC_PROG_CC])dnl
7018ee3e8c14SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
7019ee3e8c14Smrg[if test -n "$NM"; then
7020ee3e8c14Smrg  # Let the user override the test.
7021ee3e8c14Smrg  lt_cv_path_NM=$NM
7022ee3e8c14Smrgelse
7023ee3e8c14Smrg  lt_nm_to_check=${ac_tool_prefix}nm
7024ee3e8c14Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
7025ee3e8c14Smrg    lt_nm_to_check="$lt_nm_to_check nm"
7026ee3e8c14Smrg  fi
7027ee3e8c14Smrg  for lt_tmp_nm in $lt_nm_to_check; do
7028ee3e8c14Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7029ee3e8c14Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
7030ee3e8c14Smrg      IFS=$lt_save_ifs
7031ee3e8c14Smrg      test -z "$ac_dir" && ac_dir=.
7032ee3e8c14Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
7033ee3e8c14Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
7034ee3e8c14Smrg	# Check to see if the nm accepts a BSD-compat flag.
7035ee3e8c14Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
7036ee3e8c14Smrg	#   nm: unknown option "B" ignored
7037ee3e8c14Smrg	# Tru64's nm complains that /dev/null is an invalid object file
7038ee3e8c14Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
7039ee3e8c14Smrg	case $build_os in
7040ee3e8c14Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
7041ee3e8c14Smrg	*) lt_bad_file=/dev/null ;;
7042ee3e8c14Smrg	esac
7043ee3e8c14Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
7044ee3e8c14Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
7045ee3e8c14Smrg	  lt_cv_path_NM="$tmp_nm -B"
7046ee3e8c14Smrg	  break 2
7047ee3e8c14Smrg	  ;;
7048ee3e8c14Smrg	*)
7049ee3e8c14Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
7050ee3e8c14Smrg	  */dev/null*)
7051ee3e8c14Smrg	    lt_cv_path_NM="$tmp_nm -p"
7052ee3e8c14Smrg	    break 2
7053d9dcd5aeSmrg	    ;;
7054d9dcd5aeSmrg	  *)
7055ee3e8c14Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7056ee3e8c14Smrg	    continue # so that we can try to find one that supports BSD flags
7057d9dcd5aeSmrg	    ;;
7058ee3e8c14Smrg	  esac
7059ee3e8c14Smrg	  ;;
7060d9dcd5aeSmrg	esac
7061ee3e8c14Smrg      fi
7062ee3e8c14Smrg    done
7063ee3e8c14Smrg    IFS=$lt_save_ifs
7064ee3e8c14Smrg  done
7065ee3e8c14Smrg  : ${lt_cv_path_NM=no}
7066ee3e8c14Smrgfi])
7067ee3e8c14Smrgif test no != "$lt_cv_path_NM"; then
7068ee3e8c14Smrg  NM=$lt_cv_path_NM
7069ee3e8c14Smrgelse
7070ee3e8c14Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
7071ee3e8c14Smrg  if test -n "$DUMPBIN"; then :
7072ee3e8c14Smrg    # Let the user override the test.
7073ee3e8c14Smrg  else
7074ee3e8c14Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
7075ee3e8c14Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
7076ee3e8c14Smrg    *COFF*)
7077ee3e8c14Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
7078ee3e8c14Smrg      ;;
7079ee3e8c14Smrg    *)
7080ee3e8c14Smrg      DUMPBIN=:
7081ee3e8c14Smrg      ;;
7082ee3e8c14Smrg    esac
7083ee3e8c14Smrg  fi
7084ee3e8c14Smrg  AC_SUBST([DUMPBIN])
7085ee3e8c14Smrg  if test : != "$DUMPBIN"; then
7086ee3e8c14Smrg    NM=$DUMPBIN
7087ee3e8c14Smrg  fi
7088ee3e8c14Smrgfi
7089ee3e8c14Smrgtest -z "$NM" && NM=nm
7090ee3e8c14SmrgAC_SUBST([NM])
7091ee3e8c14Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
7092b290cf36Smrg
7093ee3e8c14SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
7094ee3e8c14Smrg  [lt_cv_nm_interface="BSD nm"
7095ee3e8c14Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
7096ee3e8c14Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
7097ee3e8c14Smrg  (eval "$ac_compile" 2>conftest.err)
7098ee3e8c14Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7099ee3e8c14Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
7100ee3e8c14Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
7101ee3e8c14Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7102ee3e8c14Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
7103ee3e8c14Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
7104ee3e8c14Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
7105ee3e8c14Smrg    lt_cv_nm_interface="MS dumpbin"
7106ee3e8c14Smrg  fi
7107ee3e8c14Smrg  rm -f conftest*])
7108ee3e8c14Smrg])# LT_PATH_NM
7109b290cf36Smrg
7110ee3e8c14Smrg# Old names:
7111ee3e8c14SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
7112ee3e8c14SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
7113ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
7114ee3e8c14Smrgdnl AC_DEFUN([AM_PROG_NM], [])
7115ee3e8c14Smrgdnl AC_DEFUN([AC_PROG_NM], [])
7116b290cf36Smrg
7117ee3e8c14Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7118ee3e8c14Smrg# --------------------------------
7119ee3e8c14Smrg# how to determine the name of the shared library
7120ee3e8c14Smrg# associated with a specific link library.
7121ee3e8c14Smrg#  -- PORTME fill in with the dynamic library characteristics
7122ee3e8c14Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
7123ee3e8c14Smrg[m4_require([_LT_DECL_EGREP])
7124ee3e8c14Smrgm4_require([_LT_DECL_OBJDUMP])
7125ee3e8c14Smrgm4_require([_LT_DECL_DLLTOOL])
7126ee3e8c14SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
7127ee3e8c14Smrglt_cv_sharedlib_from_linklib_cmd,
7128ee3e8c14Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
7129b290cf36Smrg
7130ee3e8c14Smrgcase $host_os in
7131ee3e8c14Smrgcygwin* | mingw* | pw32* | cegcc*)
7132ee3e8c14Smrg  # two different shell functions defined in ltmain.sh;
7133ee3e8c14Smrg  # decide which one to use based on capabilities of $DLLTOOL
7134ee3e8c14Smrg  case `$DLLTOOL --help 2>&1` in
7135ee3e8c14Smrg  *--identify-strict*)
7136ee3e8c14Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
7137ee3e8c14Smrg    ;;
7138ee3e8c14Smrg  *)
7139ee3e8c14Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
7140ee3e8c14Smrg    ;;
7141ee3e8c14Smrg  esac
7142ee3e8c14Smrg  ;;
7143ee3e8c14Smrg*)
7144ee3e8c14Smrg  # fallback: assume linklib IS sharedlib
7145ee3e8c14Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
7146ee3e8c14Smrg  ;;
7147ee3e8c14Smrgesac
7148ee3e8c14Smrg])
7149ee3e8c14Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
7150ee3e8c14Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
7151b290cf36Smrg
7152ee3e8c14Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
7153ee3e8c14Smrg    [Command to associate shared and link libraries])
7154ee3e8c14Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7155b290cf36Smrg
7156b290cf36Smrg
7157ee3e8c14Smrg# _LT_PATH_MANIFEST_TOOL
7158ee3e8c14Smrg# ----------------------
7159ee3e8c14Smrg# locate the manifest tool
7160ee3e8c14Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
7161ee3e8c14Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
7162ee3e8c14Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
7163ee3e8c14SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
7164ee3e8c14Smrg  [lt_cv_path_mainfest_tool=no
7165ee3e8c14Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
7166ee3e8c14Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
7167ee3e8c14Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7168ee3e8c14Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
7169ee3e8c14Smrg    lt_cv_path_mainfest_tool=yes
7170ee3e8c14Smrg  fi
7171ee3e8c14Smrg  rm -f conftest*])
7172ee3e8c14Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
7173ee3e8c14Smrg  MANIFEST_TOOL=:
7174ee3e8c14Smrgfi
7175ee3e8c14Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
7176ee3e8c14Smrg])# _LT_PATH_MANIFEST_TOOL
7177b290cf36Smrg
7178d9dcd5aeSmrg
7179ee3e8c14Smrg# _LT_DLL_DEF_P([FILE])
7180ee3e8c14Smrg# ---------------------
7181ee3e8c14Smrg# True iff FILE is a Windows DLL '.def' file.
7182ee3e8c14Smrg# Keep in sync with func_dll_def_p in the libtool script
7183ee3e8c14SmrgAC_DEFUN([_LT_DLL_DEF_P],
7184ee3e8c14Smrg[dnl
7185ee3e8c14Smrg  test DEF = "`$SED -n dnl
7186ee3e8c14Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
7187ee3e8c14Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
7188ee3e8c14Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
7189ee3e8c14Smrg    -e q dnl                          Only consider the first "real" line
7190ee3e8c14Smrg    $1`" dnl
7191ee3e8c14Smrg])# _LT_DLL_DEF_P
7192d9dcd5aeSmrg
7193b290cf36Smrg
7194ee3e8c14Smrg# LT_LIB_M
7195ee3e8c14Smrg# --------
7196ee3e8c14Smrg# check for math library
7197ee3e8c14SmrgAC_DEFUN([LT_LIB_M],
7198ee3e8c14Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7199ee3e8c14SmrgLIBM=
7200ee3e8c14Smrgcase $host in
7201ee3e8c14Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
7202ee3e8c14Smrg  # These system don't have libm, or don't need it
7203ee3e8c14Smrg  ;;
7204ee3e8c14Smrg*-ncr-sysv4.3*)
7205ee3e8c14Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
7206ee3e8c14Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
7207ee3e8c14Smrg  ;;
7208ee3e8c14Smrg*)
7209ee3e8c14Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
7210ee3e8c14Smrg  ;;
7211ee3e8c14Smrgesac
7212ee3e8c14SmrgAC_SUBST([LIBM])
7213ee3e8c14Smrg])# LT_LIB_M
7214b290cf36Smrg
7215ee3e8c14Smrg# Old name:
7216ee3e8c14SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
7217ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
7218ee3e8c14Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
7219b290cf36Smrg
7220b290cf36Smrg
7221ee3e8c14Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
7222ee3e8c14Smrg# -------------------------------
7223ee3e8c14Smrgm4_defun([_LT_COMPILER_NO_RTTI],
7224ee3e8c14Smrg[m4_require([_LT_TAG_COMPILER])dnl
7225b290cf36Smrg
7226ee3e8c14Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7227b290cf36Smrg
7228ee3e8c14Smrgif test yes = "$GCC"; then
7229ee3e8c14Smrg  case $cc_basename in
7230ee3e8c14Smrg  nvcc*)
7231ee3e8c14Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
7232ee3e8c14Smrg  *)
7233ee3e8c14Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
7234ee3e8c14Smrg  esac
7235b290cf36Smrg
7236ee3e8c14Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
7237ee3e8c14Smrg    lt_cv_prog_compiler_rtti_exceptions,
7238ee3e8c14Smrg    [-fno-rtti -fno-exceptions], [],
7239ee3e8c14Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
7240ee3e8c14Smrgfi
7241ee3e8c14Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
7242ee3e8c14Smrg	[Compiler flag to turn off builtin functions])
7243ee3e8c14Smrg])# _LT_COMPILER_NO_RTTI
7244b290cf36Smrg
7245b290cf36Smrg
7246ee3e8c14Smrg# _LT_CMD_GLOBAL_SYMBOLS
7247ee3e8c14Smrg# ----------------------
7248ee3e8c14Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
7249ee3e8c14Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7250ee3e8c14SmrgAC_REQUIRE([AC_PROG_CC])dnl
7251ee3e8c14SmrgAC_REQUIRE([AC_PROG_AWK])dnl
7252ee3e8c14SmrgAC_REQUIRE([LT_PATH_NM])dnl
7253ee3e8c14SmrgAC_REQUIRE([LT_PATH_LD])dnl
7254ee3e8c14Smrgm4_require([_LT_DECL_SED])dnl
7255ee3e8c14Smrgm4_require([_LT_DECL_EGREP])dnl
7256ee3e8c14Smrgm4_require([_LT_TAG_COMPILER])dnl
7257b290cf36Smrg
7258ee3e8c14Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
7259ee3e8c14SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
7260ee3e8c14SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
7261ee3e8c14Smrg[
7262ee3e8c14Smrg# These are sane defaults that work on at least a few old systems.
7263ee3e8c14Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
7264b290cf36Smrg
7265ee3e8c14Smrg# Character class describing NM global symbol codes.
7266ee3e8c14Smrgsymcode='[[BCDEGRST]]'
7267b290cf36Smrg
7268ee3e8c14Smrg# Regexp to match symbols that can be accessed directly from C.
7269ee3e8c14Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
7270b290cf36Smrg
7271ee3e8c14Smrg# Define system-specific variables.
7272ee3e8c14Smrgcase $host_os in
7273ee3e8c14Smrgaix*)
7274ee3e8c14Smrg  symcode='[[BCDT]]'
7275ee3e8c14Smrg  ;;
7276ee3e8c14Smrgcygwin* | mingw* | pw32* | cegcc*)
7277ee3e8c14Smrg  symcode='[[ABCDGISTW]]'
7278ee3e8c14Smrg  ;;
7279ee3e8c14Smrghpux*)
7280ee3e8c14Smrg  if test ia64 = "$host_cpu"; then
7281ee3e8c14Smrg    symcode='[[ABCDEGRST]]'
7282ee3e8c14Smrg  fi
7283ee3e8c14Smrg  ;;
7284ee3e8c14Smrgirix* | nonstopux*)
7285ee3e8c14Smrg  symcode='[[BCDEGRST]]'
7286ee3e8c14Smrg  ;;
7287ee3e8c14Smrgosf*)
7288ee3e8c14Smrg  symcode='[[BCDEGQRST]]'
7289ee3e8c14Smrg  ;;
7290ee3e8c14Smrgsolaris*)
7291ee3e8c14Smrg  symcode='[[BDRT]]'
7292ee3e8c14Smrg  ;;
7293ee3e8c14Smrgsco3.2v5*)
7294ee3e8c14Smrg  symcode='[[DT]]'
7295ee3e8c14Smrg  ;;
7296ee3e8c14Smrgsysv4.2uw2*)
7297ee3e8c14Smrg  symcode='[[DT]]'
7298ee3e8c14Smrg  ;;
7299ee3e8c14Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
7300ee3e8c14Smrg  symcode='[[ABDT]]'
7301ee3e8c14Smrg  ;;
7302ee3e8c14Smrgsysv4)
7303ee3e8c14Smrg  symcode='[[DFNSTU]]'
7304ee3e8c14Smrg  ;;
7305ee3e8c14Smrgesac
7306b290cf36Smrg
7307ee3e8c14Smrg# If we're using GNU nm, then use its standard symbol codes.
7308ee3e8c14Smrgcase `$NM -V 2>&1` in
7309ee3e8c14Smrg*GNU* | *'with BFD'*)
7310ee3e8c14Smrg  symcode='[[ABCDGIRSTW]]' ;;
7311ee3e8c14Smrgesac
7312b290cf36Smrg
7313ee3e8c14Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
7314ee3e8c14Smrg  # Gets list of data symbols to import.
7315ee3e8c14Smrg  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
7316ee3e8c14Smrg  # Adjust the below global symbol transforms to fixup imported variables.
7317ee3e8c14Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
7318ee3e8c14Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
7319ee3e8c14Smrg  lt_c_name_lib_hook="\
7320ee3e8c14Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
7321ee3e8c14Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
7322ee3e8c14Smrgelse
7323ee3e8c14Smrg  # Disable hooks by default.
7324ee3e8c14Smrg  lt_cv_sys_global_symbol_to_import=
7325ee3e8c14Smrg  lt_cdecl_hook=
7326ee3e8c14Smrg  lt_c_name_hook=
7327ee3e8c14Smrg  lt_c_name_lib_hook=
7328ee3e8c14Smrgfi
7329b290cf36Smrg
7330ee3e8c14Smrg# Transform an extracted symbol line into a proper C declaration.
7331ee3e8c14Smrg# Some systems (esp. on ia64) link data and code symbols differently,
7332ee3e8c14Smrg# so use this general approach.
7333ee3e8c14Smrglt_cv_sys_global_symbol_to_cdecl="$SED -n"\
7334ee3e8c14Smrg$lt_cdecl_hook\
7335ee3e8c14Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
7336ee3e8c14Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
7337ee3e8c14Smrg
7338ee3e8c14Smrg# Transform an extracted symbol line into symbol name and symbol address
7339ee3e8c14Smrglt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
7340ee3e8c14Smrg$lt_c_name_hook\
7341ee3e8c14Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
7342ee3e8c14Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
7343ee3e8c14Smrg
7344ee3e8c14Smrg# Transform an extracted symbol line into symbol name with lib prefix and
7345ee3e8c14Smrg# symbol address.
7346ee3e8c14Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
7347ee3e8c14Smrg$lt_c_name_lib_hook\
7348ee3e8c14Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
7349ee3e8c14Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
7350ee3e8c14Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
7351ee3e8c14Smrg
7352ee3e8c14Smrg# Handle CRLF in mingw tool chain
7353ee3e8c14Smrgopt_cr=
7354ee3e8c14Smrgcase $build_os in
7355ee3e8c14Smrgmingw*)
7356ee3e8c14Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
7357ee3e8c14Smrg  ;;
7358ee3e8c14Smrgesac
7359b290cf36Smrg
7360ee3e8c14Smrg# Try without a prefix underscore, then with it.
7361ee3e8c14Smrgfor ac_symprfx in "" "_"; do
7362b290cf36Smrg
7363ee3e8c14Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
7364ee3e8c14Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
7365b290cf36Smrg
7366ee3e8c14Smrg  # Write the raw and C identifiers.
7367ee3e8c14Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
7368ee3e8c14Smrg    # Fake it for dumpbin and say T for any non-static function,
7369ee3e8c14Smrg    # D for any global variable and I for any imported variable.
7370ee3e8c14Smrg    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
7371ee3e8c14Smrg    # which start with @ or ?.
7372ee3e8c14Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
7373ee3e8c14Smrg"     {last_section=section; section=\$ 3};"\
7374ee3e8c14Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
7375ee3e8c14Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
7376ee3e8c14Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
7377ee3e8c14Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
7378ee3e8c14Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
7379ee3e8c14Smrg"     \$ 0!~/External *\|/{next};"\
7380ee3e8c14Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
7381ee3e8c14Smrg"     {if(hide[section]) next};"\
7382ee3e8c14Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
7383ee3e8c14Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
7384ee3e8c14Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
7385ee3e8c14Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
7386ee3e8c14Smrg"     ' prfx=^$ac_symprfx]"
7387ee3e8c14Smrg  else
7388ee3e8c14Smrg    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
7389ee3e8c14Smrg  fi
7390ee3e8c14Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
7391b290cf36Smrg
7392ee3e8c14Smrg  # Check to see that the pipe works correctly.
7393ee3e8c14Smrg  pipe_works=no
7394b290cf36Smrg
7395ee3e8c14Smrg  rm -f conftest*
7396ee3e8c14Smrg  cat > conftest.$ac_ext <<_LT_EOF
7397ee3e8c14Smrg#ifdef __cplusplus
7398ee3e8c14Smrgextern "C" {
7399ee3e8c14Smrg#endif
7400ee3e8c14Smrgchar nm_test_var;
7401ee3e8c14Smrgvoid nm_test_func(void);
7402ee3e8c14Smrgvoid nm_test_func(void){}
7403ee3e8c14Smrg#ifdef __cplusplus
7404ee3e8c14Smrg}
7405ee3e8c14Smrg#endif
7406ee3e8c14Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
7407ee3e8c14Smrg_LT_EOF
7408b290cf36Smrg
7409ee3e8c14Smrg  if AC_TRY_EVAL(ac_compile); then
7410ee3e8c14Smrg    # Now try to grab the symbols.
7411ee3e8c14Smrg    nlist=conftest.nm
7412ee3e8c14Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
7413ee3e8c14Smrg      # Try sorting and uniquifying the output.
7414ee3e8c14Smrg      if sort "$nlist" | uniq > "$nlist"T; then
7415ee3e8c14Smrg	mv -f "$nlist"T "$nlist"
7416ee3e8c14Smrg      else
7417ee3e8c14Smrg	rm -f "$nlist"T
7418ee3e8c14Smrg      fi
7419b290cf36Smrg
7420ee3e8c14Smrg      # Make sure that we snagged all the symbols we need.
7421ee3e8c14Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
7422ee3e8c14Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
7423ee3e8c14Smrg	  cat <<_LT_EOF > conftest.$ac_ext
7424ee3e8c14Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
7425ee3e8c14Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
7426ee3e8c14Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
7427ee3e8c14Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
7428ee3e8c14Smrg# define LT@&t@_DLSYM_CONST
7429ee3e8c14Smrg#elif defined __osf__
7430ee3e8c14Smrg/* This system does not cope well with relocations in const data.  */
7431ee3e8c14Smrg# define LT@&t@_DLSYM_CONST
7432ee3e8c14Smrg#else
7433ee3e8c14Smrg# define LT@&t@_DLSYM_CONST const
7434ee3e8c14Smrg#endif
7435b290cf36Smrg
7436ee3e8c14Smrg#ifdef __cplusplus
7437ee3e8c14Smrgextern "C" {
7438ee3e8c14Smrg#endif
7439b290cf36Smrg
7440ee3e8c14Smrg_LT_EOF
7441ee3e8c14Smrg	  # Now generate the symbol file.
7442ee3e8c14Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
7443b290cf36Smrg
7444ee3e8c14Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
7445b290cf36Smrg
7446ee3e8c14Smrg/* The mapping between symbol names and symbols.  */
7447ee3e8c14SmrgLT@&t@_DLSYM_CONST struct {
7448ee3e8c14Smrg  const char *name;
7449ee3e8c14Smrg  void       *address;
7450ee3e8c14Smrg}
7451ee3e8c14Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
7452d9dcd5aeSmrg{
7453ee3e8c14Smrg  { "@PROGRAM@", (void *) 0 },
7454d9dcd5aeSmrg_LT_EOF
7455ee3e8c14Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
7456ee3e8c14Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
7457ee3e8c14Smrg  {0, (void *) 0}
7458d9dcd5aeSmrg};
7459ee3e8c14Smrg
7460ee3e8c14Smrg/* This works around a problem in FreeBSD linker */
7461ee3e8c14Smrg#ifdef FREEBSD_WORKAROUND
7462ee3e8c14Smrgstatic const void *lt_preloaded_setup() {
7463ee3e8c14Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
7464d9dcd5aeSmrg}
7465ee3e8c14Smrg#endif
7466b290cf36Smrg
7467ee3e8c14Smrg#ifdef __cplusplus
7468ee3e8c14Smrg}
7469ee3e8c14Smrg#endif
7470ee3e8c14Smrg_LT_EOF
7471ee3e8c14Smrg	  # Now try linking the two files.
7472ee3e8c14Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
7473ee3e8c14Smrg	  lt_globsym_save_LIBS=$LIBS
7474ee3e8c14Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
7475ee3e8c14Smrg	  LIBS=conftstm.$ac_objext
7476ee3e8c14Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
7477ee3e8c14Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
7478ee3e8c14Smrg	    pipe_works=yes
7479ee3e8c14Smrg	  fi
7480ee3e8c14Smrg	  LIBS=$lt_globsym_save_LIBS
7481ee3e8c14Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
7482ee3e8c14Smrg	else
7483ee3e8c14Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
7484ee3e8c14Smrg	fi
7485ee3e8c14Smrg      else
7486ee3e8c14Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
7487ee3e8c14Smrg      fi
7488ee3e8c14Smrg    else
7489ee3e8c14Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
7490ee3e8c14Smrg    fi
7491ee3e8c14Smrg  else
7492ee3e8c14Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
7493ee3e8c14Smrg    cat conftest.$ac_ext >&5
7494ee3e8c14Smrg  fi
7495ee3e8c14Smrg  rm -rf conftest* conftst*
7496b290cf36Smrg
7497ee3e8c14Smrg  # Do not use the global_symbol_pipe unless it works.
7498ee3e8c14Smrg  if test yes = "$pipe_works"; then
7499ee3e8c14Smrg    break
7500ee3e8c14Smrg  else
7501ee3e8c14Smrg    lt_cv_sys_global_symbol_pipe=
7502ee3e8c14Smrg  fi
7503ee3e8c14Smrgdone
7504ee3e8c14Smrg])
7505ee3e8c14Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
7506ee3e8c14Smrg  lt_cv_sys_global_symbol_to_cdecl=
7507ee3e8c14Smrgfi
7508ee3e8c14Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
7509ee3e8c14Smrg  AC_MSG_RESULT(failed)
7510ee3e8c14Smrgelse
7511ee3e8c14Smrg  AC_MSG_RESULT(ok)
7512ee3e8c14Smrgfi
7513b290cf36Smrg
7514ee3e8c14Smrg# Response file support.
7515ee3e8c14Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
7516ee3e8c14Smrg  nm_file_list_spec='@'
7517ee3e8c14Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
7518ee3e8c14Smrg  nm_file_list_spec='@'
7519ee3e8c14Smrgfi
7520b290cf36Smrg
7521ee3e8c14Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
7522ee3e8c14Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
7523ee3e8c14Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
7524ee3e8c14Smrg    [Transform the output of nm in a proper C declaration])
7525ee3e8c14Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
7526ee3e8c14Smrg    [Transform the output of nm into a list of symbols to manually relocate])
7527ee3e8c14Smrg_LT_DECL([global_symbol_to_c_name_address],
7528ee3e8c14Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
7529ee3e8c14Smrg    [Transform the output of nm in a C name address pair])
7530ee3e8c14Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
7531ee3e8c14Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
7532ee3e8c14Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
7533ee3e8c14Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
7534ee3e8c14Smrg    [The name lister interface])
7535ee3e8c14Smrg_LT_DECL([], [nm_file_list_spec], [1],
7536ee3e8c14Smrg    [Specify filename containing input files for $NM])
7537ee3e8c14Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
7538b290cf36Smrg
7539b290cf36Smrg
7540ee3e8c14Smrg# _LT_COMPILER_PIC([TAGNAME])
7541ee3e8c14Smrg# ---------------------------
7542ee3e8c14Smrgm4_defun([_LT_COMPILER_PIC],
7543ee3e8c14Smrg[m4_require([_LT_TAG_COMPILER])dnl
7544ee3e8c14Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
7545ee3e8c14Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
7546ee3e8c14Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
7547b290cf36Smrg
7548ee3e8c14Smrgm4_if([$1], [CXX], [
7549ee3e8c14Smrg  # C++ specific cases for pic, static, wl, etc.
7550ee3e8c14Smrg  if test yes = "$GXX"; then
7551ee3e8c14Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7552ee3e8c14Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7553b290cf36Smrg
7554ee3e8c14Smrg    case $host_os in
7555ee3e8c14Smrg    aix*)
7556ee3e8c14Smrg      # All AIX code is PIC.
7557ee3e8c14Smrg      if test ia64 = "$host_cpu"; then
7558ee3e8c14Smrg	# AIX 5 now supports IA64 processor
7559ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7560ee3e8c14Smrg      fi
7561ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7562ee3e8c14Smrg      ;;
7563b290cf36Smrg
7564ee3e8c14Smrg    amigaos*)
7565ee3e8c14Smrg      case $host_cpu in
7566ee3e8c14Smrg      powerpc)
7567ee3e8c14Smrg            # see comment about AmigaOS4 .so support
7568ee3e8c14Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7569ee3e8c14Smrg        ;;
7570ee3e8c14Smrg      m68k)
7571ee3e8c14Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
7572ee3e8c14Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
7573ee3e8c14Smrg            # like '-m68040'.
7574ee3e8c14Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7575ee3e8c14Smrg        ;;
7576ee3e8c14Smrg      esac
7577ee3e8c14Smrg      ;;
7578b290cf36Smrg
7579ee3e8c14Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7580ee3e8c14Smrg      # PIC is the default for these OSes.
7581ee3e8c14Smrg      ;;
7582ee3e8c14Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
7583ee3e8c14Smrg      # This hack is so that the source file can tell whether it is being
7584ee3e8c14Smrg      # built for inclusion in a dll (and should export symbols for example).
7585ee3e8c14Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
7586ee3e8c14Smrg      # (--disable-auto-import) libraries
7587ee3e8c14Smrg      m4_if([$1], [GCJ], [],
7588ee3e8c14Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7589ee3e8c14Smrg      case $host_os in
7590ee3e8c14Smrg      os2*)
7591ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7592ee3e8c14Smrg	;;
7593ee3e8c14Smrg      esac
7594ee3e8c14Smrg      ;;
7595ee3e8c14Smrg    darwin* | rhapsody*)
7596ee3e8c14Smrg      # PIC is the default on this platform
7597ee3e8c14Smrg      # Common symbols not allowed in MH_DYLIB files
7598ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7599ee3e8c14Smrg      ;;
7600ee3e8c14Smrg    *djgpp*)
7601ee3e8c14Smrg      # DJGPP does not support shared libraries at all
7602ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7603ee3e8c14Smrg      ;;
7604ee3e8c14Smrg    haiku*)
7605ee3e8c14Smrg      # PIC is the default for Haiku.
7606ee3e8c14Smrg      # The "-static" flag exists, but is broken.
7607ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
7608ee3e8c14Smrg      ;;
7609ee3e8c14Smrg    interix[[3-9]]*)
7610ee3e8c14Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7611ee3e8c14Smrg      # Instead, we relocate shared libraries at runtime.
7612ee3e8c14Smrg      ;;
7613ee3e8c14Smrg    sysv4*MP*)
7614ee3e8c14Smrg      if test -d /usr/nec; then
7615ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7616ee3e8c14Smrg      fi
7617ee3e8c14Smrg      ;;
7618ee3e8c14Smrg    hpux*)
7619ee3e8c14Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7620ee3e8c14Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
7621ee3e8c14Smrg      # sets the default TLS model and affects inlining.
7622ee3e8c14Smrg      case $host_cpu in
7623ee3e8c14Smrg      hppa*64*)
7624ee3e8c14Smrg	;;
7625ee3e8c14Smrg      *)
7626ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7627ee3e8c14Smrg	;;
7628ee3e8c14Smrg      esac
7629ee3e8c14Smrg      ;;
7630ee3e8c14Smrg    *qnx* | *nto*)
7631ee3e8c14Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
7632ee3e8c14Smrg      # it will coredump.
7633ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7634ee3e8c14Smrg      ;;
7635ee3e8c14Smrg    *)
7636ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7637ee3e8c14Smrg      ;;
7638ee3e8c14Smrg    esac
7639ee3e8c14Smrg  else
7640ee3e8c14Smrg    case $host_os in
7641ee3e8c14Smrg      aix[[4-9]]*)
7642ee3e8c14Smrg	# All AIX code is PIC.
7643ee3e8c14Smrg	if test ia64 = "$host_cpu"; then
7644ee3e8c14Smrg	  # AIX 5 now supports IA64 processor
7645ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7646ee3e8c14Smrg	else
7647ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7648ee3e8c14Smrg	fi
7649ee3e8c14Smrg	;;
7650ee3e8c14Smrg      chorus*)
7651ee3e8c14Smrg	case $cc_basename in
7652ee3e8c14Smrg	cxch68*)
7653ee3e8c14Smrg	  # Green Hills C++ Compiler
7654ee3e8c14Smrg	  # _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"
7655ee3e8c14Smrg	  ;;
7656ee3e8c14Smrg	esac
7657ee3e8c14Smrg	;;
7658ee3e8c14Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
7659ee3e8c14Smrg	# This hack is so that the source file can tell whether it is being
7660ee3e8c14Smrg	# built for inclusion in a dll (and should export symbols for example).
7661ee3e8c14Smrg	m4_if([$1], [GCJ], [],
7662ee3e8c14Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7663ee3e8c14Smrg	;;
7664ee3e8c14Smrg      dgux*)
7665ee3e8c14Smrg	case $cc_basename in
7666ee3e8c14Smrg	  ec++*)
7667ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7668ee3e8c14Smrg	    ;;
7669ee3e8c14Smrg	  ghcx*)
7670ee3e8c14Smrg	    # Green Hills C++ Compiler
7671ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7672ee3e8c14Smrg	    ;;
7673ee3e8c14Smrg	  *)
7674ee3e8c14Smrg	    ;;
7675ee3e8c14Smrg	esac
7676ee3e8c14Smrg	;;
7677ee3e8c14Smrg      freebsd* | dragonfly* | midnightbsd*)
7678ee3e8c14Smrg	# FreeBSD uses GNU C++
7679ee3e8c14Smrg	;;
7680ee3e8c14Smrg      hpux9* | hpux10* | hpux11*)
7681ee3e8c14Smrg	case $cc_basename in
7682ee3e8c14Smrg	  CC*)
7683ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7684ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7685ee3e8c14Smrg	    if test ia64 != "$host_cpu"; then
7686ee3e8c14Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7687ee3e8c14Smrg	    fi
7688ee3e8c14Smrg	    ;;
7689ee3e8c14Smrg	  aCC*)
7690ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7691ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7692ee3e8c14Smrg	    case $host_cpu in
7693ee3e8c14Smrg	    hppa*64*|ia64*)
7694ee3e8c14Smrg	      # +Z the default
7695ee3e8c14Smrg	      ;;
7696ee3e8c14Smrg	    *)
7697ee3e8c14Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7698ee3e8c14Smrg	      ;;
7699ee3e8c14Smrg	    esac
7700ee3e8c14Smrg	    ;;
7701ee3e8c14Smrg	  *)
7702ee3e8c14Smrg	    ;;
7703ee3e8c14Smrg	esac
7704ee3e8c14Smrg	;;
7705ee3e8c14Smrg      interix*)
7706ee3e8c14Smrg	# This is c89, which is MS Visual C++ (no shared libs)
7707ee3e8c14Smrg	# Anyone wants to do a port?
7708ee3e8c14Smrg	;;
7709ee3e8c14Smrg      irix5* | irix6* | nonstopux*)
7710ee3e8c14Smrg	case $cc_basename in
7711ee3e8c14Smrg	  CC*)
7712ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7713ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7714ee3e8c14Smrg	    # CC pic flag -KPIC is the default.
7715ee3e8c14Smrg	    ;;
7716ee3e8c14Smrg	  *)
7717ee3e8c14Smrg	    ;;
7718ee3e8c14Smrg	esac
7719ee3e8c14Smrg	;;
7720ee3e8c14Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7721ee3e8c14Smrg	case $cc_basename in
7722ee3e8c14Smrg	  KCC*)
7723ee3e8c14Smrg	    # KAI C++ Compiler
7724ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7725ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7726ee3e8c14Smrg	    ;;
7727ee3e8c14Smrg	  ecpc* )
7728ee3e8c14Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
7729ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7730ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7731ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7732ee3e8c14Smrg	    ;;
7733ee3e8c14Smrg	  icpc* )
7734ee3e8c14Smrg	    # Intel C++, used to be incompatible with GCC.
7735ee3e8c14Smrg	    # ICC 10 doesn't accept -KPIC any more.
7736ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7737ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7738ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7739ee3e8c14Smrg	    ;;
7740ee3e8c14Smrg	  pgCC* | pgcpp*)
7741ee3e8c14Smrg	    # Portland Group C++ compiler
7742ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7743ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
7744ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7745ee3e8c14Smrg	    ;;
7746ee3e8c14Smrg	  cxx*)
7747ee3e8c14Smrg	    # Compaq C++
7748ee3e8c14Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
7749ee3e8c14Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
7750ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7751ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7752ee3e8c14Smrg	    ;;
7753ee3e8c14Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
7754ee3e8c14Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
7755ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7756ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
7757ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
7758ee3e8c14Smrg	    ;;
7759ee3e8c14Smrg	  *)
7760ee3e8c14Smrg	    case `$CC -V 2>&1 | $SED 5q` in
7761ee3e8c14Smrg	    *Sun\ C*)
7762ee3e8c14Smrg	      # Sun C++ 5.9
7763ee3e8c14Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7764ee3e8c14Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7765ee3e8c14Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7766ee3e8c14Smrg	      ;;
7767ee3e8c14Smrg	    esac
7768ee3e8c14Smrg	    ;;
7769ee3e8c14Smrg	esac
7770ee3e8c14Smrg	;;
7771ee3e8c14Smrg      lynxos*)
7772ee3e8c14Smrg	;;
7773ee3e8c14Smrg      m88k*)
7774ee3e8c14Smrg	;;
7775ee3e8c14Smrg      mvs*)
7776ee3e8c14Smrg	case $cc_basename in
7777ee3e8c14Smrg	  cxx*)
7778ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
7779ee3e8c14Smrg	    ;;
7780ee3e8c14Smrg	  *)
7781ee3e8c14Smrg	    ;;
7782ee3e8c14Smrg	esac
7783ee3e8c14Smrg	;;
7784ee3e8c14Smrg      netbsd*)
7785ee3e8c14Smrg	;;
7786ee3e8c14Smrg      *qnx* | *nto*)
7787ee3e8c14Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
7788ee3e8c14Smrg        # it will coredump.
7789ee3e8c14Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7790ee3e8c14Smrg        ;;
7791ee3e8c14Smrg      osf3* | osf4* | osf5*)
7792ee3e8c14Smrg	case $cc_basename in
7793ee3e8c14Smrg	  KCC*)
7794ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7795ee3e8c14Smrg	    ;;
7796ee3e8c14Smrg	  RCC*)
7797ee3e8c14Smrg	    # Rational C++ 2.4.1
7798ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7799ee3e8c14Smrg	    ;;
7800ee3e8c14Smrg	  cxx*)
7801ee3e8c14Smrg	    # Digital/Compaq C++
7802ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7803ee3e8c14Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
7804ee3e8c14Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
7805ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7806ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7807ee3e8c14Smrg	    ;;
7808ee3e8c14Smrg	  *)
7809ee3e8c14Smrg	    ;;
7810ee3e8c14Smrg	esac
7811ee3e8c14Smrg	;;
7812ee3e8c14Smrg      psos*)
7813ee3e8c14Smrg	;;
7814ee3e8c14Smrg      solaris*)
7815ee3e8c14Smrg	case $cc_basename in
7816ee3e8c14Smrg	  CC* | sunCC*)
7817ee3e8c14Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
7818ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7819ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7820ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7821ee3e8c14Smrg	    ;;
7822ee3e8c14Smrg	  gcx*)
7823ee3e8c14Smrg	    # Green Hills C++ Compiler
7824ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7825ee3e8c14Smrg	    ;;
7826ee3e8c14Smrg	  *)
7827ee3e8c14Smrg	    ;;
7828ee3e8c14Smrg	esac
7829ee3e8c14Smrg	;;
7830ee3e8c14Smrg      sunos4*)
7831ee3e8c14Smrg	case $cc_basename in
7832ee3e8c14Smrg	  CC*)
7833ee3e8c14Smrg	    # Sun C++ 4.x
7834ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7835ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7836ee3e8c14Smrg	    ;;
7837ee3e8c14Smrg	  lcc*)
7838ee3e8c14Smrg	    # Lucid
7839ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7840ee3e8c14Smrg	    ;;
7841ee3e8c14Smrg	  *)
7842ee3e8c14Smrg	    ;;
7843ee3e8c14Smrg	esac
7844ee3e8c14Smrg	;;
7845ee3e8c14Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7846ee3e8c14Smrg	case $cc_basename in
7847ee3e8c14Smrg	  CC*)
7848ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7849ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7850ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7851ee3e8c14Smrg	    ;;
7852ee3e8c14Smrg	esac
7853ee3e8c14Smrg	;;
7854ee3e8c14Smrg      tandem*)
7855ee3e8c14Smrg	case $cc_basename in
7856ee3e8c14Smrg	  NCC*)
7857ee3e8c14Smrg	    # NonStop-UX NCC 3.20
7858ee3e8c14Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7859ee3e8c14Smrg	    ;;
7860ee3e8c14Smrg	  *)
7861ee3e8c14Smrg	    ;;
7862ee3e8c14Smrg	esac
7863ee3e8c14Smrg	;;
7864ee3e8c14Smrg      vxworks*)
7865ee3e8c14Smrg	;;
7866ee3e8c14Smrg      *)
7867ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7868ee3e8c14Smrg	;;
7869d9dcd5aeSmrg    esac
7870ee3e8c14Smrg  fi
7871ee3e8c14Smrg],
7872ee3e8c14Smrg[
7873ee3e8c14Smrg  if test yes = "$GCC"; then
7874ee3e8c14Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7875ee3e8c14Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7876d9dcd5aeSmrg
7877ee3e8c14Smrg    case $host_os in
7878ee3e8c14Smrg      aix*)
7879ee3e8c14Smrg      # All AIX code is PIC.
7880ee3e8c14Smrg      if test ia64 = "$host_cpu"; then
7881ee3e8c14Smrg	# AIX 5 now supports IA64 processor
7882ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7883ee3e8c14Smrg      fi
7884ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7885ba064abeSmrg      ;;
7886d9dcd5aeSmrg
7887ee3e8c14Smrg    amigaos*)
7888ee3e8c14Smrg      case $host_cpu in
7889ee3e8c14Smrg      powerpc)
7890ee3e8c14Smrg            # see comment about AmigaOS4 .so support
7891ee3e8c14Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7892ee3e8c14Smrg        ;;
7893ee3e8c14Smrg      m68k)
7894ee3e8c14Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
7895ee3e8c14Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
7896ee3e8c14Smrg            # like '-m68040'.
7897ee3e8c14Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7898ee3e8c14Smrg        ;;
7899ee3e8c14Smrg      esac
7900d9dcd5aeSmrg      ;;
7901d9dcd5aeSmrg
7902ee3e8c14Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7903ee3e8c14Smrg      # PIC is the default for these OSes.
7904ee3e8c14Smrg      ;;
7905b290cf36Smrg
7906ee3e8c14Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
7907ee3e8c14Smrg      # This hack is so that the source file can tell whether it is being
7908ee3e8c14Smrg      # built for inclusion in a dll (and should export symbols for example).
7909ee3e8c14Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
7910ee3e8c14Smrg      # (--disable-auto-import) libraries
7911ee3e8c14Smrg      m4_if([$1], [GCJ], [],
7912ee3e8c14Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7913ee3e8c14Smrg      case $host_os in
7914ee3e8c14Smrg      os2*)
7915ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7916ee3e8c14Smrg	;;
7917ee3e8c14Smrg      esac
7918ee3e8c14Smrg      ;;
7919b290cf36Smrg
7920ee3e8c14Smrg    darwin* | rhapsody*)
7921ee3e8c14Smrg      # PIC is the default on this platform
7922ee3e8c14Smrg      # Common symbols not allowed in MH_DYLIB files
7923ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7924ee3e8c14Smrg      ;;
7925b290cf36Smrg
7926ee3e8c14Smrg    haiku*)
7927ee3e8c14Smrg      # PIC is the default for Haiku.
7928ee3e8c14Smrg      # The "-static" flag exists, but is broken.
7929ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
7930ee3e8c14Smrg      ;;
7931b290cf36Smrg
7932ee3e8c14Smrg    hpux*)
7933ee3e8c14Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7934ee3e8c14Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
7935ee3e8c14Smrg      # sets the default TLS model and affects inlining.
7936ee3e8c14Smrg      case $host_cpu in
7937ee3e8c14Smrg      hppa*64*)
7938ee3e8c14Smrg	# +Z the default
7939ee3e8c14Smrg	;;
7940ee3e8c14Smrg      *)
7941ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7942ee3e8c14Smrg	;;
7943ee3e8c14Smrg      esac
7944ee3e8c14Smrg      ;;
7945191cded7Smrg
7946ee3e8c14Smrg    interix[[3-9]]*)
7947ee3e8c14Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7948ee3e8c14Smrg      # Instead, we relocate shared libraries at runtime.
7949ee3e8c14Smrg      ;;
7950d9dcd5aeSmrg
7951ee3e8c14Smrg    msdosdjgpp*)
7952ee3e8c14Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
7953ee3e8c14Smrg      # on systems that don't support them.
7954ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7955ee3e8c14Smrg      enable_shared=no
7956ee3e8c14Smrg      ;;
7957191cded7Smrg
7958ee3e8c14Smrg    *nto* | *qnx*)
7959ee3e8c14Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
7960ee3e8c14Smrg      # it will coredump.
7961ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7962ee3e8c14Smrg      ;;
7963191cded7Smrg
7964ee3e8c14Smrg    sysv4*MP*)
7965ee3e8c14Smrg      if test -d /usr/nec; then
7966ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7967ee3e8c14Smrg      fi
7968ee3e8c14Smrg      ;;
7969191cded7Smrg
7970ee3e8c14Smrg    *)
7971ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7972ee3e8c14Smrg      ;;
7973ee3e8c14Smrg    esac
7974191cded7Smrg
7975ee3e8c14Smrg    case $cc_basename in
7976ee3e8c14Smrg    nvcc*) # Cuda Compiler Driver 2.2
7977ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
7978ee3e8c14Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
7979ee3e8c14Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
7980ee3e8c14Smrg      fi
7981ee3e8c14Smrg      ;;
7982ee3e8c14Smrg    esac
7983ee3e8c14Smrg  else
7984ee3e8c14Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
7985ee3e8c14Smrg    case $host_os in
7986ee3e8c14Smrg    aix*)
7987ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7988ee3e8c14Smrg      if test ia64 = "$host_cpu"; then
7989ee3e8c14Smrg	# AIX 5 now supports IA64 processor
7990ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7991ee3e8c14Smrg      else
7992ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7993ee3e8c14Smrg      fi
7994ee3e8c14Smrg      ;;
7995191cded7Smrg
7996ee3e8c14Smrg    darwin* | rhapsody*)
7997ee3e8c14Smrg      # PIC is the default on this platform
7998ee3e8c14Smrg      # Common symbols not allowed in MH_DYLIB files
7999ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8000ee3e8c14Smrg      case $cc_basename in
8001ee3e8c14Smrg      nagfor*)
8002ee3e8c14Smrg        # NAG Fortran compiler
8003ee3e8c14Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8004ee3e8c14Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8005ee3e8c14Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8006ee3e8c14Smrg        ;;
8007ee3e8c14Smrg      esac
8008ee3e8c14Smrg      ;;
8009b290cf36Smrg
8010ee3e8c14Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
8011ee3e8c14Smrg      # This hack is so that the source file can tell whether it is being
8012ee3e8c14Smrg      # built for inclusion in a dll (and should export symbols for example).
8013ee3e8c14Smrg      m4_if([$1], [GCJ], [],
8014ee3e8c14Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8015ee3e8c14Smrg      case $host_os in
8016ee3e8c14Smrg      os2*)
8017ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
8018ee3e8c14Smrg	;;
8019ee3e8c14Smrg      esac
8020ee3e8c14Smrg      ;;
8021d9dcd5aeSmrg
8022ee3e8c14Smrg    hpux9* | hpux10* | hpux11*)
8023ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8024ee3e8c14Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8025ee3e8c14Smrg      # not for PA HP-UX.
8026ee3e8c14Smrg      case $host_cpu in
8027ee3e8c14Smrg      hppa*64*|ia64*)
8028ee3e8c14Smrg	# +Z the default
8029ee3e8c14Smrg	;;
8030ee3e8c14Smrg      *)
8031ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8032ee3e8c14Smrg	;;
8033ee3e8c14Smrg      esac
8034ee3e8c14Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
8035ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
8036ee3e8c14Smrg      ;;
8037ee3e8c14Smrg
8038ee3e8c14Smrg    irix5* | irix6* | nonstopux*)
8039ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8040ee3e8c14Smrg      # PIC (with -KPIC) is the default.
8041ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8042ee3e8c14Smrg      ;;
8043ee3e8c14Smrg
8044ee3e8c14Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
8045ee3e8c14Smrg      case $cc_basename in
8046ee3e8c14Smrg      # old Intel for x86_64, which still supported -KPIC.
8047ee3e8c14Smrg      ecc*)
8048ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8049ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8050ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8051d9dcd5aeSmrg        ;;
8052ee3e8c14Smrg      # icc used to be incompatible with GCC.
8053ee3e8c14Smrg      # ICC 10 doesn't accept -KPIC any more.
8054ee3e8c14Smrg      icc* | ifort*)
8055ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8056ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8057ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8058d9dcd5aeSmrg        ;;
8059ee3e8c14Smrg      # Lahey Fortran 8.1.
8060ee3e8c14Smrg      lf95*)
8061ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8062ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
8063ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
8064ee3e8c14Smrg	;;
8065ee3e8c14Smrg      nagfor*)
8066ee3e8c14Smrg	# NAG Fortran compiler
8067ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8068ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8069ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8070ee3e8c14Smrg	;;
8071ee3e8c14Smrg      tcc*)
8072ee3e8c14Smrg	# Fabrice Bellard et al's Tiny C Compiler
8073ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8074ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8075ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8076ee3e8c14Smrg	;;
8077ee3e8c14Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
8078ee3e8c14Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
8079ee3e8c14Smrg	# which looks to be a dead project)
8080ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8081ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8082ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8083ee3e8c14Smrg        ;;
8084ee3e8c14Smrg      ccc*)
8085ee3e8c14Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8086ee3e8c14Smrg        # All Alpha code is PIC.
8087ee3e8c14Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8088ee3e8c14Smrg        ;;
8089ee3e8c14Smrg      xl* | bgxl* | bgf* | mpixl*)
8090ee3e8c14Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
8091ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8092ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
8093ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
8094ee3e8c14Smrg	;;
8095ee3e8c14Smrg      *)
8096ee3e8c14Smrg	case `$CC -V 2>&1 | $SED 5q` in
8097ee3e8c14Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
8098ee3e8c14Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
8099ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8100ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8101ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
8102ee3e8c14Smrg	  ;;
8103ee3e8c14Smrg	*Sun\ F* | *Sun*Fortran*)
8104ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8105ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8106ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8107ee3e8c14Smrg	  ;;
8108ee3e8c14Smrg	*Sun\ C*)
8109ee3e8c14Smrg	  # Sun C 5.9
8110ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8111ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8112ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8113ee3e8c14Smrg	  ;;
8114ee3e8c14Smrg        *Intel*\ [[CF]]*Compiler*)
8115ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8116ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8117ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8118ee3e8c14Smrg	  ;;
8119ee3e8c14Smrg	*Portland\ Group*)
8120ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8121ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8122ee3e8c14Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8123ee3e8c14Smrg	  ;;
8124ee3e8c14Smrg	esac
8125ee3e8c14Smrg	;;
8126ee3e8c14Smrg      esac
8127ee3e8c14Smrg      ;;
8128b290cf36Smrg
8129ee3e8c14Smrg    newsos6)
8130ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8131ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8132ee3e8c14Smrg      ;;
8133ee3e8c14Smrg
8134ee3e8c14Smrg    *nto* | *qnx*)
8135ee3e8c14Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
8136ee3e8c14Smrg      # it will coredump.
8137ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8138ee3e8c14Smrg      ;;
8139b290cf36Smrg
8140ee3e8c14Smrg    osf3* | osf4* | osf5*)
8141ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8142ee3e8c14Smrg      # All OSF/1 code is PIC.
8143ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8144ee3e8c14Smrg      ;;
8145b290cf36Smrg
8146ee3e8c14Smrg    rdos*)
8147ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8148ee3e8c14Smrg      ;;
8149191cded7Smrg
8150ee3e8c14Smrg    solaris*)
8151ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8152ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8153ee3e8c14Smrg      case $cc_basename in
8154ee3e8c14Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
8155ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
8156ee3e8c14Smrg      *)
8157ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
8158ee3e8c14Smrg      esac
8159ee3e8c14Smrg      ;;
8160ee3e8c14Smrg
8161ee3e8c14Smrg    sunos4*)
8162ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8163ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8164ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8165ee3e8c14Smrg      ;;
8166d9dcd5aeSmrg
8167ee3e8c14Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
8168ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8169ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8170ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8171ee3e8c14Smrg      ;;
8172191cded7Smrg
8173ee3e8c14Smrg    sysv4*MP*)
8174ee3e8c14Smrg      if test -d /usr/nec; then
8175ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
8176ee3e8c14Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8177ee3e8c14Smrg      fi
8178ee3e8c14Smrg      ;;
8179191cded7Smrg
8180ee3e8c14Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8181ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8182ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8183ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8184ee3e8c14Smrg      ;;
8185191cded7Smrg
8186ee3e8c14Smrg    unicos*)
8187ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8188ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8189ee3e8c14Smrg      ;;
8190d9dcd5aeSmrg
8191ee3e8c14Smrg    uts4*)
8192ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8193ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8194ee3e8c14Smrg      ;;
8195191cded7Smrg
8196ee3e8c14Smrg    *)
8197ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8198ee3e8c14Smrg      ;;
8199ee3e8c14Smrg    esac
8200ee3e8c14Smrg  fi
8201ee3e8c14Smrg])
8202ee3e8c14Smrgcase $host_os in
8203ee3e8c14Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
8204ee3e8c14Smrg  *djgpp*)
8205ee3e8c14Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
8206ee3e8c14Smrg    ;;
8207ee3e8c14Smrg  *)
8208ee3e8c14Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
8209ee3e8c14Smrg    ;;
8210ee3e8c14Smrgesac
8211191cded7Smrg
8212ee3e8c14SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
8213ee3e8c14Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
8214ee3e8c14Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
8215ee3e8c14Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
8216191cded7Smrg
8217ee3e8c14Smrg#
8218ee3e8c14Smrg# Check to make sure the PIC flag actually works.
8219ee3e8c14Smrg#
8220ee3e8c14Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8221ee3e8c14Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
8222ee3e8c14Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
8223ee3e8c14Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
8224ee3e8c14Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
8225ee3e8c14Smrg     "" | " "*) ;;
8226ee3e8c14Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
8227ee3e8c14Smrg     esac],
8228ee3e8c14Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
8229ee3e8c14Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
8230ee3e8c14Smrgfi
8231ee3e8c14Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
8232ee3e8c14Smrg	[Additional compiler flags for building library objects])
8233191cded7Smrg
8234ee3e8c14Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
8235ee3e8c14Smrg	[How to pass a linker flag through the compiler])
8236ee3e8c14Smrg#
8237ee3e8c14Smrg# Check to make sure the static flag actually works.
8238ee3e8c14Smrg#
8239ee3e8c14Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
8240ee3e8c14Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
8241ee3e8c14Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
8242ee3e8c14Smrg  $lt_tmp_static_flag,
8243ee3e8c14Smrg  [],
8244ee3e8c14Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
8245ee3e8c14Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
8246ee3e8c14Smrg	[Compiler flag to prevent dynamic linking])
8247ee3e8c14Smrg])# _LT_COMPILER_PIC
8248191cded7Smrg
8249b290cf36Smrg
8250ee3e8c14Smrg# _LT_LINKER_SHLIBS([TAGNAME])
8251ee3e8c14Smrg# ----------------------------
8252ee3e8c14Smrg# See if the linker supports building shared libraries.
8253ee3e8c14Smrgm4_defun([_LT_LINKER_SHLIBS],
8254ee3e8c14Smrg[AC_REQUIRE([LT_PATH_LD])dnl
8255ee3e8c14SmrgAC_REQUIRE([LT_PATH_NM])dnl
8256ee3e8c14Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
8257ee3e8c14Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
8258ee3e8c14Smrgm4_require([_LT_DECL_EGREP])dnl
8259ee3e8c14Smrgm4_require([_LT_DECL_SED])dnl
8260ee3e8c14Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
8261ee3e8c14Smrgm4_require([_LT_TAG_COMPILER])dnl
8262ee3e8c14SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
8263ee3e8c14Smrgm4_if([$1], [CXX], [
8264ee3e8c14Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8265ee3e8c14Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8266ee3e8c14Smrg  case $host_os in
8267ee3e8c14Smrg  aix[[4-9]]*)
8268ee3e8c14Smrg    # If we're using GNU nm, then we don't want the "-C" option.
8269ee3e8c14Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
8270ee3e8c14Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
8271ee3e8c14Smrg    # weak defined symbols like other global defined symbols, whereas
8272ee3e8c14Smrg    # GNU nm marks them as "W".
8273ee3e8c14Smrg    # While the 'weak' keyword is ignored in the Export File, we need
8274ee3e8c14Smrg    # it in the Import File for the 'aix-soname' feature, so we have
8275ee3e8c14Smrg    # to replace the "-B" option with "-P" for AIX nm.
8276ee3e8c14Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8277ee3e8c14Smrg      _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'
8278ee3e8c14Smrg    else
8279ee3e8c14Smrg      _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'
8280ee3e8c14Smrg    fi
8281ee3e8c14Smrg    ;;
8282ee3e8c14Smrg  pw32*)
8283ee3e8c14Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
8284ee3e8c14Smrg    ;;
8285ee3e8c14Smrg  cygwin* | mingw* | cegcc*)
8286ee3e8c14Smrg    case $cc_basename in
8287ee3e8c14Smrg    cl* | icl*)
8288ee3e8c14Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
8289ee3e8c14Smrg      ;;
8290ee3e8c14Smrg    *)
8291ee3e8c14Smrg      _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'
8292ee3e8c14Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
8293ee3e8c14Smrg      ;;
8294ee3e8c14Smrg    esac
8295ee3e8c14Smrg    ;;
8296ee3e8c14Smrg  *)
8297ee3e8c14Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8298ee3e8c14Smrg    ;;
8299ee3e8c14Smrg  esac
8300ee3e8c14Smrg], [
8301ee3e8c14Smrg  runpath_var=
8302ee3e8c14Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
8303ee3e8c14Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
8304ee3e8c14Smrg  _LT_TAGVAR(archive_cmds, $1)=
8305ee3e8c14Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
8306ee3e8c14Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
8307ee3e8c14Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8308ee3e8c14Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8309ee3e8c14Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8310ee3e8c14Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
8311ee3e8c14Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
8312ee3e8c14Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8313ee3e8c14Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8314ee3e8c14Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
8315ee3e8c14Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
8316ee3e8c14Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8317ee3e8c14Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
8318ee3e8c14Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
8319ee3e8c14Smrg  _LT_TAGVAR(module_cmds, $1)=
8320ee3e8c14Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
8321ee3e8c14Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
8322ee3e8c14Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
8323ee3e8c14Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
8324ee3e8c14Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
8325ee3e8c14Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
8326ee3e8c14Smrg  # included in the symbol list
8327ee3e8c14Smrg  _LT_TAGVAR(include_expsyms, $1)=
8328ee3e8c14Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
8329ee3e8c14Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
8330ee3e8c14Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
8331ee3e8c14Smrg  # as well as any symbol that contains 'd'.
8332ee3e8c14Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8333ee3e8c14Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8334ee3e8c14Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
8335ee3e8c14Smrg  # the symbol is explicitly referenced.  Since portable code cannot
8336ee3e8c14Smrg  # rely on this symbol name, it's probably fine to never include it in
8337ee3e8c14Smrg  # preloaded symbol tables.
8338ee3e8c14Smrg  # Exclude shared library initialization/finalization symbols.
8339ee3e8c14Smrgdnl Note also adjust exclude_expsyms for C++ above.
8340ee3e8c14Smrg  extract_expsyms_cmds=
8341191cded7Smrg
8342ee3e8c14Smrg  case $host_os in
8343ee3e8c14Smrg  cygwin* | mingw* | pw32* | cegcc*)
8344ee3e8c14Smrg    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
8345ee3e8c14Smrg    # When not using gcc, we currently assume that we are using
8346ee3e8c14Smrg    # Microsoft Visual C++ or Intel C++ Compiler.
8347ee3e8c14Smrg    if test yes != "$GCC"; then
8348ee3e8c14Smrg      with_gnu_ld=no
8349ee3e8c14Smrg    fi
8350ee3e8c14Smrg    ;;
8351ee3e8c14Smrg  interix*)
8352ee3e8c14Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
8353ee3e8c14Smrg    with_gnu_ld=yes
8354ee3e8c14Smrg    ;;
8355ee3e8c14Smrg  openbsd* | bitrig*)
8356ee3e8c14Smrg    with_gnu_ld=no
8357ee3e8c14Smrg    ;;
8358ee3e8c14Smrg  esac
8359191cded7Smrg
8360ee3e8c14Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
8361d9dcd5aeSmrg
8362ee3e8c14Smrg  # On some targets, GNU ld is compatible enough with the native linker
8363ee3e8c14Smrg  # that we're better off using the native interface for both.
8364ee3e8c14Smrg  lt_use_gnu_ld_interface=no
8365ee3e8c14Smrg  if test yes = "$with_gnu_ld"; then
8366ee3e8c14Smrg    case $host_os in
8367ee3e8c14Smrg      aix*)
8368ee3e8c14Smrg	# The AIX port of GNU ld has always aspired to compatibility
8369ee3e8c14Smrg	# with the native linker.  However, as the warning in the GNU ld
8370ee3e8c14Smrg	# block says, versions before 2.19.5* couldn't really create working
8371ee3e8c14Smrg	# shared libraries, regardless of the interface used.
8372ee3e8c14Smrg	case `$LD -v 2>&1` in
8373ee3e8c14Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
8374ee3e8c14Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
8375ee3e8c14Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
8376ee3e8c14Smrg	  *)
8377ee3e8c14Smrg	    lt_use_gnu_ld_interface=yes
8378ee3e8c14Smrg	    ;;
8379ee3e8c14Smrg	esac
8380ee3e8c14Smrg	;;
8381ee3e8c14Smrg      *)
8382ee3e8c14Smrg	lt_use_gnu_ld_interface=yes
8383ee3e8c14Smrg	;;
8384ee3e8c14Smrg    esac
8385ee3e8c14Smrg  fi
8386191cded7Smrg
8387ee3e8c14Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
8388ee3e8c14Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
8389ee3e8c14Smrg    wlarc='$wl'
8390191cded7Smrg
8391ee3e8c14Smrg    # Set some defaults for GNU ld with shared library support. These
8392ee3e8c14Smrg    # are reset later if shared libraries are not supported. Putting them
8393ee3e8c14Smrg    # here allows them to be overridden if necessary.
8394ee3e8c14Smrg    runpath_var=LD_RUN_PATH
8395ee3e8c14Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8396ee3e8c14Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
8397ee3e8c14Smrg    # ancient GNU ld didn't support --whole-archive et. al.
8398ee3e8c14Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8399ee3e8c14Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
8400ee3e8c14Smrg    else
8401ee3e8c14Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
8402ee3e8c14Smrg    fi
8403ee3e8c14Smrg    supports_anon_versioning=no
8404ee3e8c14Smrg    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
8405ee3e8c14Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
8406ee3e8c14Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
8407ee3e8c14Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8408ee3e8c14Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8409ee3e8c14Smrg      *\ 2.11.*) ;; # other 2.11 versions
8410ee3e8c14Smrg      *) supports_anon_versioning=yes ;;
8411ee3e8c14Smrg    esac
8412191cded7Smrg
8413ee3e8c14Smrg    # See if GNU ld supports shared libraries.
8414d9dcd5aeSmrg    case $host_os in
8415ee3e8c14Smrg    aix[[3-9]]*)
8416ee3e8c14Smrg      # On AIX/PPC, the GNU linker is very broken
8417ee3e8c14Smrg      if test ia64 != "$host_cpu"; then
8418ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8419ee3e8c14Smrg	cat <<_LT_EOF 1>&2
8420ee3e8c14Smrg
8421ee3e8c14Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
8422ee3e8c14Smrg*** to be unable to reliably create shared libraries on AIX.
8423ee3e8c14Smrg*** Therefore, libtool is disabling shared libraries support.  If you
8424ee3e8c14Smrg*** really care for shared libraries, you may want to install binutils
8425ee3e8c14Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
8426ee3e8c14Smrg*** You will then need to restart the configuration process.
8427ee3e8c14Smrg
8428ee3e8c14Smrg_LT_EOF
8429ee3e8c14Smrg      fi
8430ee3e8c14Smrg      ;;
8431ee3e8c14Smrg
8432ee3e8c14Smrg    amigaos*)
8433ee3e8c14Smrg      case $host_cpu in
8434ee3e8c14Smrg      powerpc)
8435ee3e8c14Smrg            # see comment about AmigaOS4 .so support
8436ee3e8c14Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8437ee3e8c14Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
8438d9dcd5aeSmrg        ;;
8439ee3e8c14Smrg      m68k)
8440ee3e8c14Smrg            _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)'
8441ee3e8c14Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8442ee3e8c14Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
8443d9dcd5aeSmrg        ;;
8444ee3e8c14Smrg      esac
8445ee3e8c14Smrg      ;;
8446191cded7Smrg
8447ee3e8c14Smrg    beos*)
8448ee3e8c14Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8449ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8450ee3e8c14Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8451ee3e8c14Smrg	# support --undefined.  This deserves some investigation.  FIXME
8452ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8453ee3e8c14Smrg      else
8454ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8455ee3e8c14Smrg      fi
8456ee3e8c14Smrg      ;;
8457191cded7Smrg
8458ee3e8c14Smrg    cygwin* | mingw* | pw32* | cegcc*)
8459ee3e8c14Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
8460ee3e8c14Smrg      # as there is no search path for DLLs.
8461ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8462ee3e8c14Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
8463ee3e8c14Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8464ee3e8c14Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
8465ee3e8c14Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8466ee3e8c14Smrg      _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'
8467ee3e8c14Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
8468b290cf36Smrg
8469ee3e8c14Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8470ee3e8c14Smrg        _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'
8471ee3e8c14Smrg	# If the export-symbols file already is a .def file, use it as
8472ee3e8c14Smrg	# is; otherwise, prepend EXPORTS...
8473ee3e8c14Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
8474ee3e8c14Smrg          cp $export_symbols $output_objdir/$soname.def;
8475ee3e8c14Smrg        else
8476ee3e8c14Smrg          echo EXPORTS > $output_objdir/$soname.def;
8477ee3e8c14Smrg          cat $export_symbols >> $output_objdir/$soname.def;
8478ee3e8c14Smrg        fi~
8479ee3e8c14Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8480ee3e8c14Smrg      else
8481ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8482ee3e8c14Smrg      fi
8483ee3e8c14Smrg      ;;
8484191cded7Smrg
8485ee3e8c14Smrg    haiku*)
8486ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8487ee3e8c14Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
8488ee3e8c14Smrg      ;;
8489191cded7Smrg
8490ee3e8c14Smrg    os2*)
8491ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8492ee3e8c14Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
8493ee3e8c14Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8494ee3e8c14Smrg      shrext_cmds=.dll
8495ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8496ee3e8c14Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8497ee3e8c14Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8498ee3e8c14Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
8499ee3e8c14Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
8500ee3e8c14Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8501ee3e8c14Smrg	emximp -o $lib $output_objdir/$libname.def'
8502ee3e8c14Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8503ee3e8c14Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8504ee3e8c14Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8505ee3e8c14Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
8506ee3e8c14Smrg	prefix_cmds="$SED"~
8507ee3e8c14Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
8508ee3e8c14Smrg	  prefix_cmds="$prefix_cmds -e 1d";
8509ee3e8c14Smrg	fi~
8510ee3e8c14Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
8511ee3e8c14Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
8512ee3e8c14Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8513ee3e8c14Smrg	emximp -o $lib $output_objdir/$libname.def'
8514ee3e8c14Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
8515ee3e8c14Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8516ee3e8c14Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
8517ee3e8c14Smrg      ;;
8518191cded7Smrg
8519ee3e8c14Smrg    interix[[3-9]]*)
8520ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
8521ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8522ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
8523ee3e8c14Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
8524ee3e8c14Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8525ee3e8c14Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
8526ee3e8c14Smrg      # default) and relocated if they conflict, which is a slow very memory
8527ee3e8c14Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
8528ee3e8c14Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8529ee3e8c14Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
8530ee3e8c14Smrg      _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'
8531ee3e8c14Smrg      _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'
8532ee3e8c14Smrg      ;;
8533ee3e8c14Smrg
8534ee3e8c14Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
8535ee3e8c14Smrg      tmp_diet=no
8536ee3e8c14Smrg      if test linux-dietlibc = "$host_os"; then
8537ee3e8c14Smrg	case $cc_basename in
8538ee3e8c14Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
8539ee3e8c14Smrg	esac
8540ee3e8c14Smrg      fi
8541ee3e8c14Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8542ee3e8c14Smrg	 && test no = "$tmp_diet"
8543ee3e8c14Smrg      then
8544ee3e8c14Smrg	tmp_addflag=' $pic_flag'
8545ee3e8c14Smrg	tmp_sharedflag='-shared'
8546ee3e8c14Smrg	case $cc_basename,$host_cpu in
8547ee3e8c14Smrg        pgcc*)				# Portland Group C compiler
8548ee3e8c14Smrg	  _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'
8549ee3e8c14Smrg	  tmp_addflag=' $pic_flag'
8550ee3e8c14Smrg	  ;;
8551ee3e8c14Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
8552ee3e8c14Smrg					# Portland Group f77 and f90 compilers
8553ee3e8c14Smrg	  _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'
8554ee3e8c14Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
8555ee3e8c14Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
8556ee3e8c14Smrg	  tmp_addflag=' -i_dynamic' ;;
8557ee3e8c14Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
8558ee3e8c14Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
8559ee3e8c14Smrg	ifc* | ifort*)			# Intel Fortran compiler
8560ee3e8c14Smrg	  tmp_addflag=' -nofor_main' ;;
8561ee3e8c14Smrg	lf95*)				# Lahey Fortran 8.1
8562ee3e8c14Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
8563ee3e8c14Smrg	  tmp_sharedflag='--shared' ;;
8564ee3e8c14Smrg        nagfor*)                        # NAGFOR 5.3
8565ee3e8c14Smrg          tmp_sharedflag='-Wl,-shared' ;;
8566ee3e8c14Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8567ee3e8c14Smrg	  tmp_sharedflag='-qmkshrobj'
8568ee3e8c14Smrg	  tmp_addflag= ;;
8569ee3e8c14Smrg	nvcc*)	# Cuda Compiler Driver 2.2
8570ee3e8c14Smrg	  _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'
8571ee3e8c14Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
8572ee3e8c14Smrg	  ;;
8573ee3e8c14Smrg	esac
8574ee3e8c14Smrg	case `$CC -V 2>&1 | $SED 5q` in
8575ee3e8c14Smrg	*Sun\ C*)			# Sun C 5.9
8576ee3e8c14Smrg	  _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'
8577ee3e8c14Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
8578ee3e8c14Smrg	  tmp_sharedflag='-G' ;;
8579ee3e8c14Smrg	*Sun\ F*)			# Sun Fortran 8.3
8580ee3e8c14Smrg	  tmp_sharedflag='-G' ;;
8581ee3e8c14Smrg	esac
8582ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8583191cded7Smrg
8584ee3e8c14Smrg        if test yes = "$supports_anon_versioning"; then
8585ee3e8c14Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8586ee3e8c14Smrg            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8587ee3e8c14Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
8588ee3e8c14Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
8589ee3e8c14Smrg        fi
8590191cded7Smrg
8591ee3e8c14Smrg	case $cc_basename in
8592ee3e8c14Smrg	tcc*)
8593ee3e8c14Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
8594ee3e8c14Smrg	  ;;
8595ee3e8c14Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
8596ee3e8c14Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8597ee3e8c14Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
8598ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8599ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
8600ee3e8c14Smrg	  if test yes = "$supports_anon_versioning"; then
8601ee3e8c14Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8602ee3e8c14Smrg              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8603ee3e8c14Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
8604ee3e8c14Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8605ee3e8c14Smrg	  fi
8606ee3e8c14Smrg	  ;;
8607ee3e8c14Smrg	esac
8608ee3e8c14Smrg      else
8609ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
8610ee3e8c14Smrg      fi
8611ee3e8c14Smrg      ;;
8612d9dcd5aeSmrg
8613ee3e8c14Smrg    netbsd*)
8614ee3e8c14Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8615ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8616ee3e8c14Smrg	wlarc=
8617ee3e8c14Smrg      else
8618ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8619ee3e8c14Smrg	_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'
8620ee3e8c14Smrg      fi
8621ee3e8c14Smrg      ;;
8622d9dcd5aeSmrg
8623ee3e8c14Smrg    solaris*)
8624ee3e8c14Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8625ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8626ee3e8c14Smrg	cat <<_LT_EOF 1>&2
8627d9dcd5aeSmrg
8628ee3e8c14Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
8629ee3e8c14Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
8630ee3e8c14Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
8631ee3e8c14Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
8632ee3e8c14Smrg*** your PATH or compiler configuration so that the native linker is
8633ee3e8c14Smrg*** used, and then restart.
8634d9dcd5aeSmrg
8635ee3e8c14Smrg_LT_EOF
8636ee3e8c14Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8637ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8638ee3e8c14Smrg	_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'
8639ee3e8c14Smrg      else
8640ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8641ee3e8c14Smrg      fi
8642ee3e8c14Smrg      ;;
8643d9dcd5aeSmrg
8644ee3e8c14Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8645ee3e8c14Smrg      case `$LD -v 2>&1` in
8646ee3e8c14Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
8647ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8648ee3e8c14Smrg	cat <<_LT_EOF 1>&2
8649d9dcd5aeSmrg
8650ee3e8c14Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
8651ee3e8c14Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
8652ee3e8c14Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
8653ee3e8c14Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
8654ee3e8c14Smrg*** your PATH or compiler configuration so that the native linker is
8655ee3e8c14Smrg*** used, and then restart.
8656d9dcd5aeSmrg
8657ee3e8c14Smrg_LT_EOF
8658ee3e8c14Smrg	;;
8659ee3e8c14Smrg	*)
8660ee3e8c14Smrg	  # For security reasons, it is highly recommended that you always
8661ee3e8c14Smrg	  # use absolute paths for naming shared libraries, and exclude the
8662ee3e8c14Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
8663ee3e8c14Smrg	  # requires that you compile everything twice, which is a pain.
8664ee3e8c14Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8665ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8666ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8667ee3e8c14Smrg	    _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'
8668ee3e8c14Smrg	  else
8669ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8670ee3e8c14Smrg	  fi
8671ee3e8c14Smrg	;;
8672ee3e8c14Smrg      esac
8673ee3e8c14Smrg      ;;
8674191cded7Smrg
8675ee3e8c14Smrg    sunos4*)
8676ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8677ee3e8c14Smrg      wlarc=
8678ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
8679ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8680ee3e8c14Smrg      ;;
8681191cded7Smrg
8682ee3e8c14Smrg    *)
8683ee3e8c14Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8684ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8685ee3e8c14Smrg	_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'
8686ee3e8c14Smrg      else
8687ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8688ee3e8c14Smrg      fi
8689ee3e8c14Smrg      ;;
8690ee3e8c14Smrg    esac
8691191cded7Smrg
8692ee3e8c14Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
8693ee3e8c14Smrg      runpath_var=
8694ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8695ee3e8c14Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8696ee3e8c14Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
8697ee3e8c14Smrg    fi
8698ee3e8c14Smrg  else
8699ee3e8c14Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
8700ee3e8c14Smrg    case $host_os in
8701ee3e8c14Smrg    aix3*)
8702ee3e8c14Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8703ee3e8c14Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
8704ee3e8c14Smrg      _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'
8705ee3e8c14Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
8706ee3e8c14Smrg      # are no directories specified by -L.
8707ee3e8c14Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
8708ee3e8c14Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
8709ee3e8c14Smrg	# Neither direct hardcoding nor static linking is supported with a
8710ee3e8c14Smrg	# broken collect2.
8711ee3e8c14Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
8712ee3e8c14Smrg      fi
8713ee3e8c14Smrg      ;;
8714191cded7Smrg
8715ee3e8c14Smrg    aix[[4-9]]*)
8716ee3e8c14Smrg      if test ia64 = "$host_cpu"; then
8717ee3e8c14Smrg	# On IA64, the linker does run time linking by default, so we don't
8718ee3e8c14Smrg	# have to do anything special.
8719ee3e8c14Smrg	aix_use_runtimelinking=no
8720ee3e8c14Smrg	exp_sym_flag='-Bexport'
8721ee3e8c14Smrg	no_entry_flag=
8722ee3e8c14Smrg      else
8723ee3e8c14Smrg	# If we're using GNU nm, then we don't want the "-C" option.
8724ee3e8c14Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
8725ee3e8c14Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
8726ee3e8c14Smrg	# weak defined symbols like other global defined symbols, whereas
8727ee3e8c14Smrg	# GNU nm marks them as "W".
8728ee3e8c14Smrg	# While the 'weak' keyword is ignored in the Export File, we need
8729ee3e8c14Smrg	# it in the Import File for the 'aix-soname' feature, so we have
8730ee3e8c14Smrg	# to replace the "-B" option with "-P" for AIX nm.
8731ee3e8c14Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8732ee3e8c14Smrg	  _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'
8733ee3e8c14Smrg	else
8734ee3e8c14Smrg	  _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'
8735ee3e8c14Smrg	fi
8736ee3e8c14Smrg	aix_use_runtimelinking=no
8737191cded7Smrg
8738ee3e8c14Smrg	# Test if we are trying to use run time linking or normal
8739ee3e8c14Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
8740ee3e8c14Smrg	# have runtime linking enabled, and use it for executables.
8741ee3e8c14Smrg	# For shared libraries, we enable/disable runtime linking
8742ee3e8c14Smrg	# depending on the kind of the shared library created -
8743ee3e8c14Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
8744ee3e8c14Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
8745ee3e8c14Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
8746ee3e8c14Smrg	#            lib.a           static archive
8747ee3e8c14Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
8748ee3e8c14Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
8749ee3e8c14Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
8750ee3e8c14Smrg	#            lib.a(lib.so.V) shared, rtl:no
8751ee3e8c14Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
8752ee3e8c14Smrg	#            lib.a           static archive
8753ee3e8c14Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
8754ee3e8c14Smrg	  for ld_flag in $LDFLAGS; do
8755ee3e8c14Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
8756ee3e8c14Smrg	    aix_use_runtimelinking=yes
8757ee3e8c14Smrg	    break
8758ee3e8c14Smrg	  fi
8759ee3e8c14Smrg	  done
8760ee3e8c14Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
8761ee3e8c14Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
8762ee3e8c14Smrg	    # so we don't have lib.a shared libs to link our executables.
8763ee3e8c14Smrg	    # We have to force runtime linking in this case.
8764ee3e8c14Smrg	    aix_use_runtimelinking=yes
8765ee3e8c14Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
8766ee3e8c14Smrg	  fi
8767ee3e8c14Smrg	  ;;
8768ee3e8c14Smrg	esac
8769191cded7Smrg
8770ee3e8c14Smrg	exp_sym_flag='-bexport'
8771ee3e8c14Smrg	no_entry_flag='-bnoentry'
8772ee3e8c14Smrg      fi
8773191cded7Smrg
8774ee3e8c14Smrg      # When large executables or shared objects are built, AIX ld can
8775ee3e8c14Smrg      # have problems creating the table of contents.  If linking a library
8776ee3e8c14Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
8777ee3e8c14Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8778ee3e8c14Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8779b290cf36Smrg
8780ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)=''
8781ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
8782ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8783ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
8784ee3e8c14Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
8785ee3e8c14Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
8786ee3e8c14Smrg      case $with_aix_soname,$aix_use_runtimelinking in
8787ee3e8c14Smrg      aix,*) ;; # traditional, no import file
8788ee3e8c14Smrg      svr4,* | *,yes) # use import file
8789ee3e8c14Smrg	# The Import File defines what to hardcode.
8790ee3e8c14Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
8791ee3e8c14Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8792ee3e8c14Smrg	;;
8793ee3e8c14Smrg      esac
8794b290cf36Smrg
8795ee3e8c14Smrg      if test yes = "$GCC"; then
8796ee3e8c14Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
8797ee3e8c14Smrg	# We only want to do this on AIX 4.2 and lower, the check
8798ee3e8c14Smrg	# below for broken collect2 doesn't work under 4.3+
8799ee3e8c14Smrg	  collect2name=`$CC -print-prog-name=collect2`
8800ee3e8c14Smrg	  if test -f "$collect2name" &&
8801ee3e8c14Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8802ee3e8c14Smrg	  then
8803ee3e8c14Smrg	  # We have reworked collect2
8804ee3e8c14Smrg	  :
8805ee3e8c14Smrg	  else
8806ee3e8c14Smrg	  # We have old collect2
8807ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
8808ee3e8c14Smrg	  # It fails to find uninstalled libraries when the uninstalled
8809ee3e8c14Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
8810ee3e8c14Smrg	  # to unsupported forces relinking
8811ee3e8c14Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
8812ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8813ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
8814ee3e8c14Smrg	  fi
8815ee3e8c14Smrg	  ;;
8816ee3e8c14Smrg	esac
8817ee3e8c14Smrg	shared_flag='-shared'
8818ee3e8c14Smrg	if test yes = "$aix_use_runtimelinking"; then
8819ee3e8c14Smrg	  shared_flag="$shared_flag "'$wl-G'
8820ee3e8c14Smrg	fi
8821ee3e8c14Smrg	# Need to ensure runtime linking is disabled for the traditional
8822ee3e8c14Smrg	# shared library, or the linker may eventually find shared libraries
8823ee3e8c14Smrg	# /with/ Import File - we do not want to mix them.
8824ee3e8c14Smrg	shared_flag_aix='-shared'
8825ee3e8c14Smrg	shared_flag_svr4='-shared $wl-G'
8826ee3e8c14Smrg      else
8827ee3e8c14Smrg	# not using gcc
8828ee3e8c14Smrg	if test ia64 = "$host_cpu"; then
8829ee3e8c14Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8830ee3e8c14Smrg	# chokes on -Wl,-G. The following line is correct:
8831ee3e8c14Smrg	  shared_flag='-G'
8832ee3e8c14Smrg	else
8833ee3e8c14Smrg	  if test yes = "$aix_use_runtimelinking"; then
8834ee3e8c14Smrg	    shared_flag='$wl-G'
8835ee3e8c14Smrg	  else
8836ee3e8c14Smrg	    shared_flag='$wl-bM:SRE'
8837ee3e8c14Smrg	  fi
8838ee3e8c14Smrg	  shared_flag_aix='$wl-bM:SRE'
8839ee3e8c14Smrg	  shared_flag_svr4='$wl-G'
8840ee3e8c14Smrg	fi
8841ee3e8c14Smrg      fi
8842191cded7Smrg
8843ee3e8c14Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
8844ee3e8c14Smrg      # It seems that -bexpall does not export symbols beginning with
8845ee3e8c14Smrg      # underscore (_), so it is better to generate a list of symbols to export.
8846ee3e8c14Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
8847ee3e8c14Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
8848ee3e8c14Smrg	# Warning - without using the other runtime loading flags (-brtl),
8849ee3e8c14Smrg	# -berok will link without error, but may produce a broken library.
8850ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
8851ee3e8c14Smrg        # Determine the default libpath from the value encoded in an
8852ee3e8c14Smrg        # empty executable.
8853ee3e8c14Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
8854ee3e8c14Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
8855ee3e8c14Smrg        _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
8856ee3e8c14Smrg      else
8857ee3e8c14Smrg	if test ia64 = "$host_cpu"; then
8858ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
8859ee3e8c14Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8860ee3e8c14Smrg	  _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"
8861ee3e8c14Smrg	else
8862ee3e8c14Smrg	 # Determine the default libpath from the value encoded in an
8863ee3e8c14Smrg	 # empty executable.
8864ee3e8c14Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
8865ee3e8c14Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
8866ee3e8c14Smrg	  # Warning - without using the other run time loading flags,
8867ee3e8c14Smrg	  # -berok will link without error, but may produce a broken library.
8868ee3e8c14Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
8869ee3e8c14Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
8870ee3e8c14Smrg	  if test yes = "$with_gnu_ld"; then
8871ee3e8c14Smrg	    # We only use this code for GNU lds that support --whole-archive.
8872ee3e8c14Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
8873ee3e8c14Smrg	  else
8874ee3e8c14Smrg	    # Exported symbols can be pulled into shared objects from archives
8875ee3e8c14Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
8876ee3e8c14Smrg	  fi
8877ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
8878ee3e8c14Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
8879ee3e8c14Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
8880ee3e8c14Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
8881ee3e8c14Smrg	  if test svr4 != "$with_aix_soname"; then
8882ee3e8c14Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
8883ee3e8c14Smrg	    _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'
8884ee3e8c14Smrg	  fi
8885ee3e8c14Smrg	  if test aix != "$with_aix_soname"; then
8886ee3e8c14Smrg	    _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'
8887ee3e8c14Smrg	  else
8888ee3e8c14Smrg	    # used by -dlpreopen to get the symbols
8889ee3e8c14Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
8890ee3e8c14Smrg	  fi
8891ee3e8c14Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
8892ee3e8c14Smrg	fi
8893ee3e8c14Smrg      fi
8894ee3e8c14Smrg      ;;
8895b290cf36Smrg
8896ee3e8c14Smrg    amigaos*)
8897ee3e8c14Smrg      case $host_cpu in
8898ee3e8c14Smrg      powerpc)
8899ee3e8c14Smrg            # see comment about AmigaOS4 .so support
8900ee3e8c14Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8901ee3e8c14Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
8902ee3e8c14Smrg        ;;
8903ee3e8c14Smrg      m68k)
8904ee3e8c14Smrg            _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)'
8905ee3e8c14Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8906ee3e8c14Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
8907ee3e8c14Smrg        ;;
8908ee3e8c14Smrg      esac
8909ee3e8c14Smrg      ;;
8910b290cf36Smrg
8911ee3e8c14Smrg    bsdi[[45]]*)
8912ee3e8c14Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
8913ee3e8c14Smrg      ;;
8914b290cf36Smrg
8915ee3e8c14Smrg    cygwin* | mingw* | pw32* | cegcc*)
8916ee3e8c14Smrg      # When not using gcc, we currently assume that we are using
8917ee3e8c14Smrg      # Microsoft Visual C++ or Intel C++ Compiler.
8918ee3e8c14Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
8919ee3e8c14Smrg      # no search path for DLLs.
8920ee3e8c14Smrg      case $cc_basename in
8921ee3e8c14Smrg      cl* | icl*)
8922ee3e8c14Smrg	# Native MSVC or ICC
8923ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
8924ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8925ee3e8c14Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
8926ee3e8c14Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
8927ee3e8c14Smrg	# Tell ltmain to make .lib files, not .a files.
8928ee3e8c14Smrg	libext=lib
8929ee3e8c14Smrg	# Tell ltmain to make .dll files, not .so files.
8930ee3e8c14Smrg	shrext_cmds=.dll
8931ee3e8c14Smrg	# FIXME: Setting linknames here is a bad hack.
8932ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
8933ee3e8c14Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
8934ee3e8c14Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
8935ee3e8c14Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
8936ee3e8c14Smrg          else
8937ee3e8c14Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
8938ee3e8c14Smrg          fi~
8939ee3e8c14Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
8940ee3e8c14Smrg          linknames='
8941ee3e8c14Smrg	# The linker will not automatically build a static lib if we build a DLL.
8942ee3e8c14Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
8943ee3e8c14Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8944ee3e8c14Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
8945ee3e8c14Smrg	_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'
8946ee3e8c14Smrg	# Don't use ranlib
8947ee3e8c14Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
8948ee3e8c14Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
8949ee3e8c14Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
8950ee3e8c14Smrg          case $lt_outputfile in
8951ee3e8c14Smrg            *.exe|*.EXE) ;;
8952ee3e8c14Smrg            *)
8953ee3e8c14Smrg              lt_outputfile=$lt_outputfile.exe
8954ee3e8c14Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
8955ee3e8c14Smrg              ;;
8956ee3e8c14Smrg          esac~
8957ee3e8c14Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
8958ee3e8c14Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
8959ee3e8c14Smrg            $RM "$lt_outputfile.manifest";
8960ee3e8c14Smrg          fi'
8961ee3e8c14Smrg	;;
8962ee3e8c14Smrg      *)
8963ee3e8c14Smrg	# Assume MSVC and ICC wrapper
8964ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
8965ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8966ee3e8c14Smrg	# Tell ltmain to make .lib files, not .a files.
8967ee3e8c14Smrg	libext=lib
8968ee3e8c14Smrg	# Tell ltmain to make .dll files, not .so files.
8969ee3e8c14Smrg	shrext_cmds=.dll
8970ee3e8c14Smrg	# FIXME: Setting linknames here is a bad hack.
8971ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
8972ee3e8c14Smrg	# The linker will automatically build a .lib file if we build a DLL.
8973ee3e8c14Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
8974ee3e8c14Smrg	# FIXME: Should let the user specify the lib program.
8975ee3e8c14Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
8976ee3e8c14Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8977ee3e8c14Smrg	;;
8978ee3e8c14Smrg      esac
8979ee3e8c14Smrg      ;;
8980b290cf36Smrg
8981ee3e8c14Smrg    darwin* | rhapsody*)
8982ee3e8c14Smrg      _LT_DARWIN_LINKER_FEATURES($1)
8983ee3e8c14Smrg      ;;
8984191cded7Smrg
8985ee3e8c14Smrg    dgux*)
8986ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8987ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8988ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8989ee3e8c14Smrg      ;;
8990ee3e8c14Smrg
8991ee3e8c14Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
8992ee3e8c14Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
8993ee3e8c14Smrg    # does not break anything, and helps significantly (at the cost of a little
8994ee3e8c14Smrg    # extra space).
8995ee3e8c14Smrg    freebsd2.2*)
8996ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
8997ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8998ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
8999ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9000ee3e8c14Smrg      ;;
9001191cded7Smrg
9002ee3e8c14Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9003ee3e8c14Smrg    freebsd2.*)
9004ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9005ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9006ee3e8c14Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9007ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9008ee3e8c14Smrg      ;;
9009191cded7Smrg
9010ee3e8c14Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9011ee3e8c14Smrg    freebsd* | dragonfly* | midnightbsd*)
9012ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9013ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9014ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9015ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9016ee3e8c14Smrg      ;;
9017191cded7Smrg
9018ee3e8c14Smrg    hpux9*)
9019ee3e8c14Smrg      if test yes = "$GCC"; then
9020ee3e8c14Smrg	_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'
9021ee3e8c14Smrg      else
9022ee3e8c14Smrg	_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'
9023ee3e8c14Smrg      fi
9024ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9025ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9026ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9027191cded7Smrg
9028ee3e8c14Smrg      # hardcode_minus_L: Not really in the search PATH,
9029ee3e8c14Smrg      # but as the default location of the library.
9030ee3e8c14Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9031ee3e8c14Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9032ee3e8c14Smrg      ;;
9033191cded7Smrg
9034ee3e8c14Smrg    hpux10*)
9035ee3e8c14Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
9036ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9037ee3e8c14Smrg      else
9038ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9039ee3e8c14Smrg      fi
9040ee3e8c14Smrg      if test no = "$with_gnu_ld"; then
9041ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9042ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9043ee3e8c14Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
9044ee3e8c14Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9045ee3e8c14Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9046ee3e8c14Smrg	# hardcode_minus_L: Not really in the search PATH,
9047ee3e8c14Smrg	# but as the default location of the library.
9048ee3e8c14Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
9049ee3e8c14Smrg      fi
9050ee3e8c14Smrg      ;;
9051191cded7Smrg
9052ee3e8c14Smrg    hpux11*)
9053ee3e8c14Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
9054ee3e8c14Smrg	case $host_cpu in
9055ee3e8c14Smrg	hppa*64*)
9056ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9057ee3e8c14Smrg	  ;;
9058ee3e8c14Smrg	ia64*)
9059ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9060ee3e8c14Smrg	  ;;
9061ee3e8c14Smrg	*)
9062ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9063ee3e8c14Smrg	  ;;
9064ee3e8c14Smrg	esac
9065ee3e8c14Smrg      else
9066ee3e8c14Smrg	case $host_cpu in
9067ee3e8c14Smrg	hppa*64*)
9068ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9069ee3e8c14Smrg	  ;;
9070ee3e8c14Smrg	ia64*)
9071ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9072ee3e8c14Smrg	  ;;
9073ee3e8c14Smrg	*)
9074ee3e8c14Smrg	m4_if($1, [], [
9075ee3e8c14Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
9076ee3e8c14Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
9077ee3e8c14Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
9078ee3e8c14Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
9079ee3e8c14Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
9080ee3e8c14Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
9081ee3e8c14Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
9082ee3e8c14Smrg	  ;;
9083ee3e8c14Smrg	esac
9084ee3e8c14Smrg      fi
9085ee3e8c14Smrg      if test no = "$with_gnu_ld"; then
9086ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9087ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9088191cded7Smrg
9089ee3e8c14Smrg	case $host_cpu in
9090ee3e8c14Smrg	hppa*64*|ia64*)
9091ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
9092ee3e8c14Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9093ee3e8c14Smrg	  ;;
9094ee3e8c14Smrg	*)
9095ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
9096ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9097ee3e8c14Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9098191cded7Smrg
9099ee3e8c14Smrg	  # hardcode_minus_L: Not really in the search PATH,
9100ee3e8c14Smrg	  # but as the default location of the library.
9101ee3e8c14Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
9102ee3e8c14Smrg	  ;;
9103ee3e8c14Smrg	esac
9104ee3e8c14Smrg      fi
9105ee3e8c14Smrg      ;;
9106191cded7Smrg
9107ee3e8c14Smrg    irix5* | irix6* | nonstopux*)
9108ee3e8c14Smrg      if test yes = "$GCC"; then
9109ee3e8c14Smrg	_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'
9110ee3e8c14Smrg	# Try to use the -exported_symbol ld option, if it does not
9111ee3e8c14Smrg	# work, assume that -exports_file does not work either and
9112ee3e8c14Smrg	# implicitly export all symbols.
9113ee3e8c14Smrg	# This should be the same for all languages, so no per-tag cache variable.
9114ee3e8c14Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
9115ee3e8c14Smrg	  [lt_cv_irix_exported_symbol],
9116ee3e8c14Smrg	  [save_LDFLAGS=$LDFLAGS
9117ee3e8c14Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
9118ee3e8c14Smrg	   AC_LINK_IFELSE(
9119ee3e8c14Smrg	     [AC_LANG_SOURCE(
9120ee3e8c14Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
9121ee3e8c14Smrg			      [C++], [[int foo (void) { return 0; }]],
9122ee3e8c14Smrg			      [Fortran 77], [[
9123ee3e8c14Smrg      subroutine foo
9124ee3e8c14Smrg      end]],
9125ee3e8c14Smrg			      [Fortran], [[
9126ee3e8c14Smrg      subroutine foo
9127ee3e8c14Smrg      end]])])],
9128ee3e8c14Smrg	      [lt_cv_irix_exported_symbol=yes],
9129ee3e8c14Smrg	      [lt_cv_irix_exported_symbol=no])
9130ee3e8c14Smrg           LDFLAGS=$save_LDFLAGS])
9131ee3e8c14Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
9132ee3e8c14Smrg          _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'
9133ee3e8c14Smrg	fi
9134ee3e8c14Smrg      else
9135ee3e8c14Smrg	_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'
9136ee3e8c14Smrg	_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'
9137ee3e8c14Smrg      fi
9138ee3e8c14Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9139ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9140ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9141ee3e8c14Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
9142ee3e8c14Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9143ee3e8c14Smrg      ;;
9144191cded7Smrg
9145ee3e8c14Smrg    linux*)
9146ee3e8c14Smrg      case $cc_basename in
9147ee3e8c14Smrg      tcc*)
9148ee3e8c14Smrg	# Fabrice Bellard et al's Tiny C Compiler
9149ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
9150ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9151ee3e8c14Smrg	;;
9152ee3e8c14Smrg      esac
9153ee3e8c14Smrg      ;;
9154191cded7Smrg
9155ee3e8c14Smrg    netbsd*)
9156ee3e8c14Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9157ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
9158ee3e8c14Smrg      else
9159ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
9160ee3e8c14Smrg      fi
9161ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9162ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9163ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9164ee3e8c14Smrg      ;;
9165191cded7Smrg
9166ee3e8c14Smrg    newsos6)
9167ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9168ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9169ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9170ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9171ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9172ee3e8c14Smrg      ;;
9173191cded7Smrg
9174ee3e8c14Smrg    *nto* | *qnx*)
9175ee3e8c14Smrg      ;;
9176191cded7Smrg
9177ee3e8c14Smrg    openbsd* | bitrig*)
9178ee3e8c14Smrg      if test -f /usr/libexec/ld.so; then
9179ee3e8c14Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
9180ee3e8c14Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9181ee3e8c14Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9182ee3e8c14Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
9183ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9184ee3e8c14Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
9185ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9186ee3e8c14Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9187ee3e8c14Smrg	else
9188ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9189ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9190ee3e8c14Smrg	fi
9191ee3e8c14Smrg      else
9192ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
9193ee3e8c14Smrg      fi
9194ee3e8c14Smrg      ;;
9195d9dcd5aeSmrg
9196ee3e8c14Smrg    os2*)
9197ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9198ee3e8c14Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9199ee3e8c14Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9200ee3e8c14Smrg      shrext_cmds=.dll
9201ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9202ee3e8c14Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9203ee3e8c14Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9204ee3e8c14Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
9205ee3e8c14Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9206ee3e8c14Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9207ee3e8c14Smrg	emximp -o $lib $output_objdir/$libname.def'
9208ee3e8c14Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9209ee3e8c14Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9210ee3e8c14Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9211ee3e8c14Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
9212ee3e8c14Smrg	prefix_cmds="$SED"~
9213ee3e8c14Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
9214ee3e8c14Smrg	  prefix_cmds="$prefix_cmds -e 1d";
9215ee3e8c14Smrg	fi~
9216ee3e8c14Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9217ee3e8c14Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9218ee3e8c14Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9219ee3e8c14Smrg	emximp -o $lib $output_objdir/$libname.def'
9220ee3e8c14Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9221ee3e8c14Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9222ee3e8c14Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
9223ee3e8c14Smrg      ;;
9224d9dcd5aeSmrg
9225ee3e8c14Smrg    osf3*)
9226ee3e8c14Smrg      if test yes = "$GCC"; then
9227ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9228ee3e8c14Smrg	_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'
9229ee3e8c14Smrg      else
9230ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9231ee3e8c14Smrg	_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'
9232ee3e8c14Smrg      fi
9233ee3e8c14Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9234ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9235ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9236ee3e8c14Smrg      ;;
9237d9dcd5aeSmrg
9238ee3e8c14Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
9239ee3e8c14Smrg      if test yes = "$GCC"; then
9240ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9241ee3e8c14Smrg	_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'
9242ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9243ee3e8c14Smrg      else
9244ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9245ee3e8c14Smrg	_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'
9246ee3e8c14Smrg	_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~
9247ee3e8c14Smrg          $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'
9248ee3e8c14Smrg
9249ee3e8c14Smrg	# Both c and cxx compiler support -rpath directly
9250ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9251ee3e8c14Smrg      fi
9252ee3e8c14Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9253ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9254ee3e8c14Smrg      ;;
9255d9dcd5aeSmrg
9256ee3e8c14Smrg    solaris*)
9257ee3e8c14Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
9258ee3e8c14Smrg      if test yes = "$GCC"; then
9259ee3e8c14Smrg	wlarc='$wl'
9260ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9261ee3e8c14Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9262ee3e8c14Smrg          $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'
9263ee3e8c14Smrg      else
9264ee3e8c14Smrg	case `$CC -V 2>&1` in
9265ee3e8c14Smrg	*"Compilers 5.0"*)
9266ee3e8c14Smrg	  wlarc=''
9267ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
9268ee3e8c14Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9269ee3e8c14Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
9270ee3e8c14Smrg	  ;;
9271ee3e8c14Smrg	*)
9272ee3e8c14Smrg	  wlarc='$wl'
9273ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
9274ee3e8c14Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9275ee3e8c14Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9276ee3e8c14Smrg	  ;;
9277ee3e8c14Smrg	esac
9278ee3e8c14Smrg      fi
9279ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9280ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9281ee3e8c14Smrg      case $host_os in
9282ee3e8c14Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
9283ee3e8c14Smrg      *)
9284ee3e8c14Smrg	# The compiler driver will combine and reorder linker options,
9285ee3e8c14Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
9286ee3e8c14Smrg	# but is careful enough not to reorder.
9287ee3e8c14Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
9288ee3e8c14Smrg	if test yes = "$GCC"; then
9289ee3e8c14Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
9290ee3e8c14Smrg	else
9291ee3e8c14Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
9292ee3e8c14Smrg	fi
9293ee3e8c14Smrg	;;
9294ee3e8c14Smrg      esac
9295ee3e8c14Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9296ee3e8c14Smrg      ;;
9297d9dcd5aeSmrg
9298ee3e8c14Smrg    sunos4*)
9299ee3e8c14Smrg      if test sequent = "$host_vendor"; then
9300ee3e8c14Smrg	# Use $CC to link under sequent, because it throws in some extra .o
9301ee3e8c14Smrg	# files that make .init and .fini sections work.
9302ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
9303ee3e8c14Smrg      else
9304ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
9305ee3e8c14Smrg      fi
9306ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9307ee3e8c14Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9308ee3e8c14Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9309ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9310ee3e8c14Smrg      ;;
9311d9dcd5aeSmrg
9312ee3e8c14Smrg    sysv4)
9313ee3e8c14Smrg      case $host_vendor in
9314ee3e8c14Smrg	sni)
9315ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9316ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
9317ee3e8c14Smrg	;;
9318ee3e8c14Smrg	siemens)
9319ee3e8c14Smrg	  ## LD is ld it makes a PLAMLIB
9320ee3e8c14Smrg	  ## CC just makes a GrossModule.
9321ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
9322ee3e8c14Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
9323ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
9324ee3e8c14Smrg        ;;
9325ee3e8c14Smrg	motorola)
9326ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9327ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
9328ee3e8c14Smrg	;;
9329ee3e8c14Smrg      esac
9330ee3e8c14Smrg      runpath_var='LD_RUN_PATH'
9331ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9332ee3e8c14Smrg      ;;
9333191cded7Smrg
9334ee3e8c14Smrg    sysv4.3*)
9335ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9336ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9337ee3e8c14Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
9338ee3e8c14Smrg      ;;
9339191cded7Smrg
9340ee3e8c14Smrg    sysv4*MP*)
9341ee3e8c14Smrg      if test -d /usr/nec; then
9342ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9343ee3e8c14Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9344ee3e8c14Smrg	runpath_var=LD_RUN_PATH
9345ee3e8c14Smrg	hardcode_runpath_var=yes
9346ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
9347ee3e8c14Smrg      fi
9348ee3e8c14Smrg      ;;
9349191cded7Smrg
9350ee3e8c14Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
9351ee3e8c14Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
9352ee3e8c14Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9353ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9354ee3e8c14Smrg      runpath_var='LD_RUN_PATH'
9355191cded7Smrg
9356ee3e8c14Smrg      if test yes = "$GCC"; then
9357ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9358ee3e8c14Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9359ee3e8c14Smrg      else
9360ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9361ee3e8c14Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9362ee3e8c14Smrg      fi
9363ee3e8c14Smrg      ;;
9364191cded7Smrg
9365ee3e8c14Smrg    sysv5* | sco3.2v5* | sco5v6*)
9366ee3e8c14Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
9367ee3e8c14Smrg      # link with -lc, and that would cause any symbols used from libc to
9368ee3e8c14Smrg      # always be unresolved, which means just about no library would
9369ee3e8c14Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
9370ee3e8c14Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
9371ee3e8c14Smrg      # as -z defs.
9372ee3e8c14Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
9373ee3e8c14Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
9374ee3e8c14Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9375ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9376ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
9377ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9378ee3e8c14Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9379ee3e8c14Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
9380ee3e8c14Smrg      runpath_var='LD_RUN_PATH'
9381191cded7Smrg
9382ee3e8c14Smrg      if test yes = "$GCC"; then
9383ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9384ee3e8c14Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9385ee3e8c14Smrg      else
9386ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9387ee3e8c14Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9388ee3e8c14Smrg      fi
9389ee3e8c14Smrg      ;;
9390191cded7Smrg
9391ee3e8c14Smrg    uts4*)
9392ee3e8c14Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9393ee3e8c14Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9394ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9395ee3e8c14Smrg      ;;
9396191cded7Smrg
9397ee3e8c14Smrg    *)
9398ee3e8c14Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
9399ee3e8c14Smrg      ;;
9400ee3e8c14Smrg    esac
9401191cded7Smrg
9402ee3e8c14Smrg    if test sni = "$host_vendor"; then
9403ee3e8c14Smrg      case $host in
9404ee3e8c14Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9405ee3e8c14Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
9406ee3e8c14Smrg	;;
9407ee3e8c14Smrg      esac
9408ee3e8c14Smrg    fi
9409ee3e8c14Smrg  fi
9410d9dcd5aeSmrg])
9411ee3e8c14SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
9412ee3e8c14Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
9413191cded7Smrg
9414ee3e8c14Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
9415191cded7Smrg
9416ee3e8c14Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
9417ee3e8c14Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
9418ee3e8c14Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
9419ee3e8c14Smrg    [The commands to extract the exported symbol list from a shared archive])
9420191cded7Smrg
9421ee3e8c14Smrg#
9422ee3e8c14Smrg# Do we need to explicitly link libc?
9423ee3e8c14Smrg#
9424ee3e8c14Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
9425ee3e8c14Smrgx|xyes)
9426ee3e8c14Smrg  # Assume -lc should be added
9427ee3e8c14Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9428191cded7Smrg
9429ee3e8c14Smrg  if test yes,yes = "$GCC,$enable_shared"; then
9430ee3e8c14Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
9431ee3e8c14Smrg    *'~'*)
9432ee3e8c14Smrg      # FIXME: we may have to deal with multi-command sequences.
9433ee3e8c14Smrg      ;;
9434ee3e8c14Smrg    '$CC '*)
9435ee3e8c14Smrg      # Test whether the compiler implicitly links with -lc since on some
9436ee3e8c14Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
9437ee3e8c14Smrg      # to ld, don't add -lc before -lgcc.
9438ee3e8c14Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
9439ee3e8c14Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
9440ee3e8c14Smrg	[$RM conftest*
9441ee3e8c14Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9442ee3e8c14Smrg
9443ee3e8c14Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
9444ee3e8c14Smrg	  soname=conftest
9445ee3e8c14Smrg	  lib=conftest
9446ee3e8c14Smrg	  libobjs=conftest.$ac_objext
9447ee3e8c14Smrg	  deplibs=
9448ee3e8c14Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
9449ee3e8c14Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
9450ee3e8c14Smrg	  compiler_flags=-v
9451ee3e8c14Smrg	  linker_flags=-v
9452ee3e8c14Smrg	  verstring=
9453ee3e8c14Smrg	  output_objdir=.
9454ee3e8c14Smrg	  libname=conftest
9455ee3e8c14Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
9456ee3e8c14Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
9457ee3e8c14Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
9458ee3e8c14Smrg	  then
9459ee3e8c14Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9460ee3e8c14Smrg	  else
9461ee3e8c14Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9462ee3e8c14Smrg	  fi
9463ee3e8c14Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
9464ee3e8c14Smrg	else
9465ee3e8c14Smrg	  cat conftest.err 1>&5
9466ee3e8c14Smrg	fi
9467ee3e8c14Smrg	$RM conftest*
9468ee3e8c14Smrg	])
9469ee3e8c14Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
9470ee3e8c14Smrg      ;;
9471ee3e8c14Smrg    esac
9472ee3e8c14Smrg  fi
9473ee3e8c14Smrg  ;;
9474ee3e8c14Smrgesac
9475191cded7Smrg
9476ee3e8c14Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
9477ee3e8c14Smrg    [Whether or not to add -lc for building shared libraries])
9478ee3e8c14Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
9479ee3e8c14Smrg    [enable_shared_with_static_runtimes], [0],
9480ee3e8c14Smrg    [Whether or not to disallow shared libs when runtime libs are static])
9481ee3e8c14Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
9482ee3e8c14Smrg    [Compiler flag to allow reflexive dlopens])
9483ee3e8c14Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
9484ee3e8c14Smrg    [Compiler flag to generate shared objects directly from archives])
9485ee3e8c14Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
9486ee3e8c14Smrg    [Whether the compiler copes with passing no objects directly])
9487ee3e8c14Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
9488ee3e8c14Smrg    [Create an old-style archive from a shared archive])
9489ee3e8c14Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
9490ee3e8c14Smrg    [Create a temporary old-style archive to link instead of a shared archive])
9491ee3e8c14Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
9492ee3e8c14Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
9493ee3e8c14Smrg_LT_TAGDECL([], [module_cmds], [2],
9494ee3e8c14Smrg    [Commands used to build a loadable module if different from building
9495ee3e8c14Smrg    a shared archive.])
9496ee3e8c14Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
9497ee3e8c14Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
9498ee3e8c14Smrg    [Whether we are building with GNU ld or not])
9499ee3e8c14Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
9500ee3e8c14Smrg    [Flag that allows shared libraries with undefined symbols to be built])
9501ee3e8c14Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
9502ee3e8c14Smrg    [Flag that enforces no undefined symbols])
9503ee3e8c14Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
9504ee3e8c14Smrg    [Flag to hardcode $libdir into a binary during linking.
9505ee3e8c14Smrg    This must work even if $libdir does not exist])
9506ee3e8c14Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
9507ee3e8c14Smrg    [Whether we need a single "-rpath" flag with a separated argument])
9508ee3e8c14Smrg_LT_TAGDECL([], [hardcode_direct], [0],
9509ee3e8c14Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
9510ee3e8c14Smrg    DIR into the resulting binary])
9511ee3e8c14Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
9512ee3e8c14Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
9513ee3e8c14Smrg    DIR into the resulting binary and the resulting library dependency is
9514ee3e8c14Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
9515ee3e8c14Smrg    library is relocated])
9516ee3e8c14Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
9517ee3e8c14Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
9518ee3e8c14Smrg    into the resulting binary])
9519ee3e8c14Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
9520ee3e8c14Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
9521ee3e8c14Smrg    into the resulting binary])
9522ee3e8c14Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
9523ee3e8c14Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
9524ee3e8c14Smrg    into the library and all subsequent libraries and executables linked
9525ee3e8c14Smrg    against it])
9526ee3e8c14Smrg_LT_TAGDECL([], [inherit_rpath], [0],
9527ee3e8c14Smrg    [Set to yes if linker adds runtime paths of dependent libraries
9528ee3e8c14Smrg    to runtime path list])
9529ee3e8c14Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
9530ee3e8c14Smrg    [Whether libtool must link a program against all its dependency libraries])
9531ee3e8c14Smrg_LT_TAGDECL([], [always_export_symbols], [0],
9532ee3e8c14Smrg    [Set to "yes" if exported symbols are required])
9533ee3e8c14Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
9534ee3e8c14Smrg    [The commands to list exported symbols])
9535ee3e8c14Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
9536ee3e8c14Smrg    [Symbols that should not be listed in the preloaded symbols])
9537ee3e8c14Smrg_LT_TAGDECL([], [include_expsyms], [1],
9538ee3e8c14Smrg    [Symbols that must always be exported])
9539ee3e8c14Smrg_LT_TAGDECL([], [prelink_cmds], [2],
9540ee3e8c14Smrg    [Commands necessary for linking programs (against libraries) with templates])
9541ee3e8c14Smrg_LT_TAGDECL([], [postlink_cmds], [2],
9542ee3e8c14Smrg    [Commands necessary for finishing linking programs])
9543ee3e8c14Smrg_LT_TAGDECL([], [file_list_spec], [1],
9544ee3e8c14Smrg    [Specify filename containing input files])
9545ee3e8c14Smrgdnl FIXME: Not yet implemented
9546ee3e8c14Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
9547ee3e8c14Smrgdnl    [Compiler flag to generate thread safe objects])
9548ee3e8c14Smrg])# _LT_LINKER_SHLIBS
9549191cded7Smrg
9550b290cf36Smrg
9551ee3e8c14Smrg# _LT_LANG_C_CONFIG([TAG])
9552d9dcd5aeSmrg# ------------------------
9553ee3e8c14Smrg# Ensure that the configuration variables for a C compiler are suitably
9554ee3e8c14Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
9555ee3e8c14Smrg# the compiler configuration to 'libtool'.
9556ee3e8c14Smrgm4_defun([_LT_LANG_C_CONFIG],
9557ee3e8c14Smrg[m4_require([_LT_DECL_EGREP])dnl
9558ee3e8c14Smrglt_save_CC=$CC
9559ee3e8c14SmrgAC_LANG_PUSH(C)
9560191cded7Smrg
9561ee3e8c14Smrg# Source file extension for C test sources.
9562ee3e8c14Smrgac_ext=c
9563b290cf36Smrg
9564ee3e8c14Smrg# Object file extension for compiled C test sources.
9565ee3e8c14Smrgobjext=o
9566ee3e8c14Smrg_LT_TAGVAR(objext, $1)=$objext
9567b290cf36Smrg
9568ee3e8c14Smrg# Code to be used in simple compile tests
9569ee3e8c14Smrglt_simple_compile_test_code="int some_variable = 0;"
9570b290cf36Smrg
9571ee3e8c14Smrg# Code to be used in simple link tests
9572ee3e8c14Smrglt_simple_link_test_code='int main(){return(0);}'
9573191cded7Smrg
9574ee3e8c14Smrg_LT_TAG_COMPILER
9575ee3e8c14Smrg# Save the default compiler, since it gets overwritten when the other
9576ee3e8c14Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
9577ee3e8c14Smrgcompiler_DEFAULT=$CC
9578ee3e8c14Smrg
9579ee3e8c14Smrg# save warnings/boilerplate of simple test code
9580ee3e8c14Smrg_LT_COMPILER_BOILERPLATE
9581ee3e8c14Smrg_LT_LINKER_BOILERPLATE
9582191cded7Smrg
9583ee3e8c14Smrgif test -n "$compiler"; then
9584ee3e8c14Smrg  _LT_COMPILER_NO_RTTI($1)
9585ee3e8c14Smrg  _LT_COMPILER_PIC($1)
9586ee3e8c14Smrg  _LT_COMPILER_C_O($1)
9587ee3e8c14Smrg  _LT_COMPILER_FILE_LOCKS($1)
9588ee3e8c14Smrg  _LT_LINKER_SHLIBS($1)
9589ee3e8c14Smrg  _LT_SYS_DYNAMIC_LINKER($1)
9590ee3e8c14Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
9591ee3e8c14Smrg  LT_SYS_DLOPEN_SELF
9592ee3e8c14Smrg  _LT_CMD_STRIPLIB
9593b290cf36Smrg
9594ee3e8c14Smrg  # Report what library types will actually be built
9595ee3e8c14Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
9596ee3e8c14Smrg  AC_MSG_RESULT([$can_build_shared])
9597b290cf36Smrg
9598ee3e8c14Smrg  AC_MSG_CHECKING([whether to build shared libraries])
9599ee3e8c14Smrg  test no = "$can_build_shared" && enable_shared=no
9600b290cf36Smrg
9601ee3e8c14Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
9602ee3e8c14Smrg  # are all built from PIC.
9603ee3e8c14Smrg  case $host_os in
9604ee3e8c14Smrg  aix3*)
9605ee3e8c14Smrg    test yes = "$enable_shared" && enable_static=no
9606ee3e8c14Smrg    if test -n "$RANLIB"; then
9607ee3e8c14Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
9608ee3e8c14Smrg      postinstall_cmds='$RANLIB $lib'
9609ee3e8c14Smrg    fi
9610ee3e8c14Smrg    ;;
9611b290cf36Smrg
9612ee3e8c14Smrg  aix[[4-9]]*)
9613ee3e8c14Smrg    if test ia64 != "$host_cpu"; then
9614ee3e8c14Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
9615ee3e8c14Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
9616ee3e8c14Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
9617ee3e8c14Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
9618ee3e8c14Smrg      esac
9619ee3e8c14Smrg    fi
9620ee3e8c14Smrg    ;;
9621ee3e8c14Smrg  esac
9622ee3e8c14Smrg  AC_MSG_RESULT([$enable_shared])
9623b290cf36Smrg
9624ee3e8c14Smrg  AC_MSG_CHECKING([whether to build static libraries])
9625ee3e8c14Smrg  # Make sure either enable_shared or enable_static is yes.
9626ee3e8c14Smrg  test yes = "$enable_shared" || enable_static=yes
9627ee3e8c14Smrg  AC_MSG_RESULT([$enable_static])
9628191cded7Smrg
9629ee3e8c14Smrg  _LT_CONFIG($1)
9630d9dcd5aeSmrgfi
9631ee3e8c14SmrgAC_LANG_POP
9632ee3e8c14SmrgCC=$lt_save_CC
9633ee3e8c14Smrg])# _LT_LANG_C_CONFIG
9634191cded7Smrg
9635b290cf36Smrg
9636ee3e8c14Smrg# _LT_LANG_CXX_CONFIG([TAG])
9637ee3e8c14Smrg# --------------------------
9638ee3e8c14Smrg# Ensure that the configuration variables for a C++ compiler are suitably
9639ee3e8c14Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
9640ee3e8c14Smrg# the compiler configuration to 'libtool'.
9641ee3e8c14Smrgm4_defun([_LT_LANG_CXX_CONFIG],
9642ee3e8c14Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
9643ee3e8c14Smrgm4_require([_LT_DECL_EGREP])dnl
9644ee3e8c14Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
9645ee3e8c14Smrgif test -n "$CXX" && ( test no != "$CXX" &&
9646ee3e8c14Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
9647ee3e8c14Smrg    (test g++ != "$CXX"))); then
9648ee3e8c14Smrg  AC_PROG_CXXCPP
9649d9dcd5aeSmrgelse
9650ee3e8c14Smrg  _lt_caught_CXX_error=yes
9651d9dcd5aeSmrgfi
9652b290cf36Smrg
9653ee3e8c14SmrgAC_LANG_PUSH(C++)
9654ee3e8c14Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9655ee3e8c14Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
9656ee3e8c14Smrg_LT_TAGVAR(always_export_symbols, $1)=no
9657ee3e8c14Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
9658ee3e8c14Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
9659ee3e8c14Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
9660ee3e8c14Smrg_LT_TAGVAR(hardcode_direct, $1)=no
9661ee3e8c14Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
9662ee3e8c14Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9663ee3e8c14Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
9664ee3e8c14Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
9665ee3e8c14Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9666ee3e8c14Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
9667ee3e8c14Smrg_LT_TAGVAR(inherit_rpath, $1)=no
9668ee3e8c14Smrg_LT_TAGVAR(module_cmds, $1)=
9669ee3e8c14Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
9670ee3e8c14Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
9671ee3e8c14Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9672ee3e8c14Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
9673ee3e8c14Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
9674ee3e8c14Smrg_LT_TAGVAR(no_undefined_flag, $1)=
9675ee3e8c14Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
9676ee3e8c14Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9677b290cf36Smrg
9678ee3e8c14Smrg# Source file extension for C++ test sources.
9679ee3e8c14Smrgac_ext=cpp
9680d9dcd5aeSmrg
9681ee3e8c14Smrg# Object file extension for compiled C++ test sources.
9682ee3e8c14Smrgobjext=o
9683ee3e8c14Smrg_LT_TAGVAR(objext, $1)=$objext
9684b290cf36Smrg
9685ee3e8c14Smrg# No sense in running all these tests if we already determined that
9686ee3e8c14Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
9687ee3e8c14Smrg# are currently assumed to apply to all compilers on this platform,
9688ee3e8c14Smrg# and will be corrupted by setting them based on a non-working compiler.
9689ee3e8c14Smrgif test yes != "$_lt_caught_CXX_error"; then
9690ee3e8c14Smrg  # Code to be used in simple compile tests
9691ee3e8c14Smrg  lt_simple_compile_test_code="int some_variable = 0;"
9692b290cf36Smrg
9693ee3e8c14Smrg  # Code to be used in simple link tests
9694ee3e8c14Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
9695b290cf36Smrg
9696ee3e8c14Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9697ee3e8c14Smrg  _LT_TAG_COMPILER
9698b290cf36Smrg
9699ee3e8c14Smrg  # save warnings/boilerplate of simple test code
9700ee3e8c14Smrg  _LT_COMPILER_BOILERPLATE
9701ee3e8c14Smrg  _LT_LINKER_BOILERPLATE
9702b290cf36Smrg
9703ee3e8c14Smrg  # Allow CC to be a program name with arguments.
9704ee3e8c14Smrg  lt_save_CC=$CC
9705ee3e8c14Smrg  lt_save_CFLAGS=$CFLAGS
9706ee3e8c14Smrg  lt_save_LD=$LD
9707ee3e8c14Smrg  lt_save_GCC=$GCC
9708ee3e8c14Smrg  GCC=$GXX
9709ee3e8c14Smrg  lt_save_with_gnu_ld=$with_gnu_ld
9710ee3e8c14Smrg  lt_save_path_LD=$lt_cv_path_LD
9711ee3e8c14Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
9712ee3e8c14Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
9713ee3e8c14Smrg  else
9714ee3e8c14Smrg    $as_unset lt_cv_prog_gnu_ld
9715ee3e8c14Smrg  fi
9716ee3e8c14Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
9717ee3e8c14Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
9718ee3e8c14Smrg  else
9719ee3e8c14Smrg    $as_unset lt_cv_path_LD
9720ee3e8c14Smrg  fi
9721ee3e8c14Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
9722ee3e8c14Smrg  CC=${CXX-"c++"}
9723ee3e8c14Smrg  CFLAGS=$CXXFLAGS
9724ee3e8c14Smrg  compiler=$CC
9725ee3e8c14Smrg  _LT_TAGVAR(compiler, $1)=$CC
9726ee3e8c14Smrg  _LT_CC_BASENAME([$compiler])
9727b290cf36Smrg
9728ee3e8c14Smrg  if test -n "$compiler"; then
9729ee3e8c14Smrg    # We don't want -fno-exception when compiling C++ code, so set the
9730ee3e8c14Smrg    # no_builtin_flag separately
9731ee3e8c14Smrg    if test yes = "$GXX"; then
9732ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
9733ee3e8c14Smrg    else
9734ee3e8c14Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
9735ee3e8c14Smrg    fi
9736b290cf36Smrg
9737ee3e8c14Smrg    if test yes = "$GXX"; then
9738ee3e8c14Smrg      # Set up default GNU C++ configuration
9739b290cf36Smrg
9740ee3e8c14Smrg      LT_PATH_LD
9741b290cf36Smrg
9742ee3e8c14Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
9743ee3e8c14Smrg      # archiving commands below assume that GNU ld is being used.
9744ee3e8c14Smrg      if test yes = "$with_gnu_ld"; then
9745ee3e8c14Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9746ee3e8c14Smrg        _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'
9747b290cf36Smrg
9748ee3e8c14Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9749ee3e8c14Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9750b290cf36Smrg
9751ee3e8c14Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
9752ee3e8c14Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
9753ee3e8c14Smrg        #     investigate it a little bit more. (MM)
9754ee3e8c14Smrg        wlarc='$wl'
9755b290cf36Smrg
9756ee3e8c14Smrg        # ancient GNU ld didn't support --whole-archive et. al.
9757ee3e8c14Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
9758ee3e8c14Smrg	  $GREP 'no-whole-archive' > /dev/null; then
9759ee3e8c14Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
9760ee3e8c14Smrg        else
9761ee3e8c14Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
9762ee3e8c14Smrg        fi
9763ee3e8c14Smrg      else
9764ee3e8c14Smrg        with_gnu_ld=no
9765ee3e8c14Smrg        wlarc=
9766b290cf36Smrg
9767ee3e8c14Smrg        # A generic and very simple default shared library creation
9768ee3e8c14Smrg        # command for GNU C++ for the case where it uses the native
9769ee3e8c14Smrg        # linker, instead of GNU ld.  If possible, this setting should
9770ee3e8c14Smrg        # overridden to take advantage of the native linker features on
9771ee3e8c14Smrg        # the platform it is being used on.
9772ee3e8c14Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
9773ee3e8c14Smrg      fi
9774b290cf36Smrg
9775ee3e8c14Smrg      # Commands to make compiler produce verbose output that lists
9776ee3e8c14Smrg      # what "hidden" libraries, object files and flags are used when
9777ee3e8c14Smrg      # linking a shared library.
9778ee3e8c14Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
9779191cded7Smrg
9780ee3e8c14Smrg    else
9781ee3e8c14Smrg      GXX=no
9782ee3e8c14Smrg      with_gnu_ld=no
9783ee3e8c14Smrg      wlarc=
9784ee3e8c14Smrg    fi
9785191cded7Smrg
9786ee3e8c14Smrg    # PORTME: fill in a description of your system's C++ link characteristics
9787ee3e8c14Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9788ee3e8c14Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
9789ee3e8c14Smrg    case $host_os in
9790ee3e8c14Smrg      aix3*)
9791ee3e8c14Smrg        # FIXME: insert proper C++ library support
9792ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
9793ee3e8c14Smrg        ;;
9794ee3e8c14Smrg      aix[[4-9]]*)
9795ee3e8c14Smrg        if test ia64 = "$host_cpu"; then
9796ee3e8c14Smrg          # On IA64, the linker does run time linking by default, so we don't
9797ee3e8c14Smrg          # have to do anything special.
9798ee3e8c14Smrg          aix_use_runtimelinking=no
9799ee3e8c14Smrg          exp_sym_flag='-Bexport'
9800ee3e8c14Smrg          no_entry_flag=
9801ee3e8c14Smrg        else
9802ee3e8c14Smrg          aix_use_runtimelinking=no
9803191cded7Smrg
9804ee3e8c14Smrg          # Test if we are trying to use run time linking or normal
9805ee3e8c14Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
9806ee3e8c14Smrg          # have runtime linking enabled, and use it for executables.
9807ee3e8c14Smrg          # For shared libraries, we enable/disable runtime linking
9808ee3e8c14Smrg          # depending on the kind of the shared library created -
9809ee3e8c14Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
9810ee3e8c14Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
9811ee3e8c14Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
9812ee3e8c14Smrg          #            lib.a           static archive
9813ee3e8c14Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
9814ee3e8c14Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
9815ee3e8c14Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
9816ee3e8c14Smrg          #            lib.a(lib.so.V) shared, rtl:no
9817ee3e8c14Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
9818ee3e8c14Smrg          #            lib.a           static archive
9819ee3e8c14Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
9820ee3e8c14Smrg	    for ld_flag in $LDFLAGS; do
9821ee3e8c14Smrg	      case $ld_flag in
9822ee3e8c14Smrg	      *-brtl*)
9823ee3e8c14Smrg	        aix_use_runtimelinking=yes
9824ee3e8c14Smrg	        break
9825ee3e8c14Smrg	        ;;
9826ee3e8c14Smrg	      esac
9827ee3e8c14Smrg	    done
9828ee3e8c14Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
9829ee3e8c14Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
9830ee3e8c14Smrg	      # so we don't have lib.a shared libs to link our executables.
9831ee3e8c14Smrg	      # We have to force runtime linking in this case.
9832ee3e8c14Smrg	      aix_use_runtimelinking=yes
9833ee3e8c14Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
9834ee3e8c14Smrg	    fi
9835ee3e8c14Smrg	    ;;
9836ee3e8c14Smrg          esac
9837191cded7Smrg
9838ee3e8c14Smrg          exp_sym_flag='-bexport'
9839ee3e8c14Smrg          no_entry_flag='-bnoentry'
9840ee3e8c14Smrg        fi
9841191cded7Smrg
9842ee3e8c14Smrg        # When large executables or shared objects are built, AIX ld can
9843ee3e8c14Smrg        # have problems creating the table of contents.  If linking a library
9844ee3e8c14Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
9845ee3e8c14Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
9846ee3e8c14Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9847ee3e8c14Smrg
9848ee3e8c14Smrg        _LT_TAGVAR(archive_cmds, $1)=''
9849ee3e8c14Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
9850ee3e8c14Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9851ee3e8c14Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9852ee3e8c14Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
9853ee3e8c14Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
9854ee3e8c14Smrg        case $with_aix_soname,$aix_use_runtimelinking in
9855ee3e8c14Smrg        aix,*) ;;	# no import file
9856ee3e8c14Smrg        svr4,* | *,yes) # use import file
9857ee3e8c14Smrg          # The Import File defines what to hardcode.
9858ee3e8c14Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
9859ee3e8c14Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
9860ee3e8c14Smrg          ;;
9861ee3e8c14Smrg        esac
9862ee3e8c14Smrg
9863ee3e8c14Smrg        if test yes = "$GXX"; then
9864ee3e8c14Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
9865ee3e8c14Smrg          # We only want to do this on AIX 4.2 and lower, the check
9866ee3e8c14Smrg          # below for broken collect2 doesn't work under 4.3+
9867ee3e8c14Smrg	  collect2name=`$CC -print-prog-name=collect2`
9868ee3e8c14Smrg	  if test -f "$collect2name" &&
9869ee3e8c14Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
9870ee3e8c14Smrg	  then
9871ee3e8c14Smrg	    # We have reworked collect2
9872ee3e8c14Smrg	    :
9873ee3e8c14Smrg	  else
9874ee3e8c14Smrg	    # We have old collect2
9875ee3e8c14Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
9876ee3e8c14Smrg	    # It fails to find uninstalled libraries when the uninstalled
9877ee3e8c14Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
9878ee3e8c14Smrg	    # to unsupported forces relinking
9879ee3e8c14Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
9880ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9881ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
9882ee3e8c14Smrg	  fi
9883ee3e8c14Smrg          esac
9884ee3e8c14Smrg          shared_flag='-shared'
9885ee3e8c14Smrg	  if test yes = "$aix_use_runtimelinking"; then
9886ee3e8c14Smrg	    shared_flag=$shared_flag' $wl-G'
9887ee3e8c14Smrg	  fi
9888ee3e8c14Smrg	  # Need to ensure runtime linking is disabled for the traditional
9889ee3e8c14Smrg	  # shared library, or the linker may eventually find shared libraries
9890ee3e8c14Smrg	  # /with/ Import File - we do not want to mix them.
9891ee3e8c14Smrg	  shared_flag_aix='-shared'
9892ee3e8c14Smrg	  shared_flag_svr4='-shared $wl-G'
9893ee3e8c14Smrg        else
9894ee3e8c14Smrg          # not using gcc
9895ee3e8c14Smrg          if test ia64 = "$host_cpu"; then
9896ee3e8c14Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9897ee3e8c14Smrg	  # chokes on -Wl,-G. The following line is correct:
9898ee3e8c14Smrg	  shared_flag='-G'
9899ee3e8c14Smrg          else
9900ee3e8c14Smrg	    if test yes = "$aix_use_runtimelinking"; then
9901ee3e8c14Smrg	      shared_flag='$wl-G'
9902ee3e8c14Smrg	    else
9903ee3e8c14Smrg	      shared_flag='$wl-bM:SRE'
9904ee3e8c14Smrg	    fi
9905ee3e8c14Smrg	    shared_flag_aix='$wl-bM:SRE'
9906ee3e8c14Smrg	    shared_flag_svr4='$wl-G'
9907ee3e8c14Smrg          fi
9908ee3e8c14Smrg        fi
9909191cded7Smrg
9910ee3e8c14Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
9911ee3e8c14Smrg        # It seems that -bexpall does not export symbols beginning with
9912ee3e8c14Smrg        # underscore (_), so it is better to generate a list of symbols to
9913ee3e8c14Smrg	# export.
9914ee3e8c14Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
9915ee3e8c14Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
9916ee3e8c14Smrg          # Warning - without using the other runtime loading flags (-brtl),
9917ee3e8c14Smrg          # -berok will link without error, but may produce a broken library.
9918ee3e8c14Smrg          # The "-G" linker flag allows undefined symbols.
9919ee3e8c14Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
9920ee3e8c14Smrg          # Determine the default libpath from the value encoded in an empty
9921ee3e8c14Smrg          # executable.
9922ee3e8c14Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
9923ee3e8c14Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9924191cded7Smrg
9925ee3e8c14Smrg          _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
9926ee3e8c14Smrg        else
9927ee3e8c14Smrg          if test ia64 = "$host_cpu"; then
9928ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
9929ee3e8c14Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
9930ee3e8c14Smrg	    _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"
9931ee3e8c14Smrg          else
9932ee3e8c14Smrg	    # Determine the default libpath from the value encoded in an
9933ee3e8c14Smrg	    # empty executable.
9934ee3e8c14Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
9935ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9936ee3e8c14Smrg	    # Warning - without using the other run time loading flags,
9937ee3e8c14Smrg	    # -berok will link without error, but may produce a broken library.
9938ee3e8c14Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
9939ee3e8c14Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
9940ee3e8c14Smrg	    if test yes = "$with_gnu_ld"; then
9941ee3e8c14Smrg	      # We only use this code for GNU lds that support --whole-archive.
9942ee3e8c14Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
9943ee3e8c14Smrg	    else
9944ee3e8c14Smrg	      # Exported symbols can be pulled into shared objects from archives
9945ee3e8c14Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
9946ee3e8c14Smrg	    fi
9947ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9948ee3e8c14Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
9949ee3e8c14Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
9950ee3e8c14Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
9951ee3e8c14Smrg	    if test svr4 != "$with_aix_soname"; then
9952ee3e8c14Smrg	      # This is similar to how AIX traditionally builds its shared
9953ee3e8c14Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
9954ee3e8c14Smrg	      _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'
9955ee3e8c14Smrg	    fi
9956ee3e8c14Smrg	    if test aix != "$with_aix_soname"; then
9957ee3e8c14Smrg	      _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'
9958ee3e8c14Smrg	    else
9959ee3e8c14Smrg	      # used by -dlpreopen to get the symbols
9960ee3e8c14Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
9961ee3e8c14Smrg	    fi
9962ee3e8c14Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
9963ee3e8c14Smrg          fi
9964ee3e8c14Smrg        fi
9965ee3e8c14Smrg        ;;
9966d9dcd5aeSmrg
9967ee3e8c14Smrg      beos*)
9968ee3e8c14Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9969ee3e8c14Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9970ee3e8c14Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9971ee3e8c14Smrg	  # support --undefined.  This deserves some investigation.  FIXME
9972ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9973ee3e8c14Smrg	else
9974ee3e8c14Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
9975ee3e8c14Smrg	fi
9976ee3e8c14Smrg	;;
9977191cded7Smrg
9978ee3e8c14Smrg      chorus*)
9979ee3e8c14Smrg        case $cc_basename in
9980ee3e8c14Smrg          *)
9981ee3e8c14Smrg	  # FIXME: insert proper C++ library support
9982ee3e8c14Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
9983ee3e8c14Smrg	  ;;
9984ee3e8c14Smrg        esac
9985ee3e8c14Smrg        ;;
9986b290cf36Smrg
9987ee3e8c14Smrg      cygwin* | mingw* | pw32* | cegcc*)
9988ee3e8c14Smrg	case $GXX,$cc_basename in
9989ee3e8c14Smrg	,cl* | no,cl* | ,icl* | no,icl*)
9990ee3e8c14Smrg	  # Native MSVC or ICC
9991ee3e8c14Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
9992ee3e8c14Smrg	  # no search path for DLLs.
9993ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9994ee3e8c14Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9995ee3e8c14Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
9996ee3e8c14Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
9997ee3e8c14Smrg	  # Tell ltmain to make .lib files, not .a files.
9998ee3e8c14Smrg	  libext=lib
9999ee3e8c14Smrg	  # Tell ltmain to make .dll files, not .so files.
10000ee3e8c14Smrg	  shrext_cmds=.dll
10001ee3e8c14Smrg	  # FIXME: Setting linknames here is a bad hack.
10002ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
10003ee3e8c14Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10004ee3e8c14Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
10005ee3e8c14Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
10006ee3e8c14Smrg            else
10007ee3e8c14Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
10008ee3e8c14Smrg            fi~
10009ee3e8c14Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
10010ee3e8c14Smrg            linknames='
10011ee3e8c14Smrg	  # The linker will not automatically build a static lib if we build a DLL.
10012ee3e8c14Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
10013ee3e8c14Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10014ee3e8c14Smrg	  # Don't use ranlib
10015ee3e8c14Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
10016ee3e8c14Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
10017ee3e8c14Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
10018ee3e8c14Smrg            case $lt_outputfile in
10019ee3e8c14Smrg              *.exe|*.EXE) ;;
10020ee3e8c14Smrg              *)
10021ee3e8c14Smrg                lt_outputfile=$lt_outputfile.exe
10022ee3e8c14Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
10023ee3e8c14Smrg                ;;
10024ee3e8c14Smrg            esac~
10025ee3e8c14Smrg            func_to_tool_file "$lt_outputfile"~
10026ee3e8c14Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
10027ee3e8c14Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
10028ee3e8c14Smrg              $RM "$lt_outputfile.manifest";
10029ee3e8c14Smrg            fi'
10030ee3e8c14Smrg	  ;;
10031ee3e8c14Smrg	*)
10032ee3e8c14Smrg	  # g++
10033ee3e8c14Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
10034ee3e8c14Smrg	  # as there is no search path for DLLs.
10035ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10036ee3e8c14Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
10037ee3e8c14Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10038ee3e8c14Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
10039ee3e8c14Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10040b290cf36Smrg
10041ee3e8c14Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
10042ee3e8c14Smrg	    _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'
10043ee3e8c14Smrg	    # If the export-symbols file already is a .def file, use it as
10044ee3e8c14Smrg	    # is; otherwise, prepend EXPORTS...
10045ee3e8c14Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10046ee3e8c14Smrg              cp $export_symbols $output_objdir/$soname.def;
10047ee3e8c14Smrg            else
10048ee3e8c14Smrg              echo EXPORTS > $output_objdir/$soname.def;
10049ee3e8c14Smrg              cat $export_symbols >> $output_objdir/$soname.def;
10050ee3e8c14Smrg            fi~
10051ee3e8c14Smrg            $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'
10052ee3e8c14Smrg	  else
10053ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10054ee3e8c14Smrg	  fi
10055ee3e8c14Smrg	  ;;
10056ee3e8c14Smrg	esac
10057ee3e8c14Smrg	;;
10058ee3e8c14Smrg      darwin* | rhapsody*)
10059ee3e8c14Smrg        _LT_DARWIN_LINKER_FEATURES($1)
10060ee3e8c14Smrg	;;
10061b290cf36Smrg
10062ee3e8c14Smrg      os2*)
10063ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10064ee3e8c14Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
10065ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10066ee3e8c14Smrg	shrext_cmds=.dll
10067ee3e8c14Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10068ee3e8c14Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10069ee3e8c14Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10070ee3e8c14Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10071ee3e8c14Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
10072ee3e8c14Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10073ee3e8c14Smrg	  emximp -o $lib $output_objdir/$libname.def'
10074ee3e8c14Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10075ee3e8c14Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10076ee3e8c14Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10077ee3e8c14Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10078ee3e8c14Smrg	  prefix_cmds="$SED"~
10079ee3e8c14Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
10080ee3e8c14Smrg	    prefix_cmds="$prefix_cmds -e 1d";
10081ee3e8c14Smrg	  fi~
10082ee3e8c14Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
10083ee3e8c14Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
10084ee3e8c14Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10085ee3e8c14Smrg	  emximp -o $lib $output_objdir/$libname.def'
10086ee3e8c14Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
10087ee3e8c14Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10088ee3e8c14Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
10089ee3e8c14Smrg	;;
10090b290cf36Smrg
10091ee3e8c14Smrg      dgux*)
10092ee3e8c14Smrg        case $cc_basename in
10093ee3e8c14Smrg          ec++*)
10094ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10095ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10096ee3e8c14Smrg	    ;;
10097ee3e8c14Smrg          ghcx*)
10098ee3e8c14Smrg	    # Green Hills C++ Compiler
10099ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10100ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10101ee3e8c14Smrg	    ;;
10102ee3e8c14Smrg          *)
10103ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10104ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10105ee3e8c14Smrg	    ;;
10106ee3e8c14Smrg        esac
10107ee3e8c14Smrg        ;;
10108191cded7Smrg
10109ee3e8c14Smrg      freebsd2.*)
10110ee3e8c14Smrg        # C++ shared libraries reported to be fairly broken before
10111ee3e8c14Smrg	# switch to ELF
10112ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10113ee3e8c14Smrg        ;;
10114b290cf36Smrg
10115ee3e8c14Smrg      freebsd-elf*)
10116ee3e8c14Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10117ee3e8c14Smrg        ;;
10118b290cf36Smrg
10119ee3e8c14Smrg      freebsd* | dragonfly* | midnightbsd*)
10120ee3e8c14Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
10121ee3e8c14Smrg        # conventions
10122ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
10123ee3e8c14Smrg        ;;
10124b290cf36Smrg
10125ee3e8c14Smrg      haiku*)
10126ee3e8c14Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10127ee3e8c14Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
10128ee3e8c14Smrg        ;;
10129b290cf36Smrg
10130ee3e8c14Smrg      hpux9*)
10131ee3e8c14Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10132ee3e8c14Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10133ee3e8c14Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10134ee3e8c14Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
10135ee3e8c14Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10136ee3e8c14Smrg				             # but as the default
10137ee3e8c14Smrg				             # location of the library.
10138191cded7Smrg
10139ee3e8c14Smrg        case $cc_basename in
10140ee3e8c14Smrg          CC*)
10141ee3e8c14Smrg            # FIXME: insert proper C++ library support
10142ee3e8c14Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
10143ee3e8c14Smrg            ;;
10144ee3e8c14Smrg          aCC*)
10145ee3e8c14Smrg            _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'
10146ee3e8c14Smrg            # Commands to make compiler produce verbose output that lists
10147ee3e8c14Smrg            # what "hidden" libraries, object files and flags are used when
10148ee3e8c14Smrg            # linking a shared library.
10149ee3e8c14Smrg            #
10150ee3e8c14Smrg            # There doesn't appear to be a way to prevent this compiler from
10151ee3e8c14Smrg            # explicitly linking system object files so we need to strip them
10152ee3e8c14Smrg            # from the output so that they don't get included in the library
10153ee3e8c14Smrg            # dependencies.
10154ee3e8c14Smrg            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"'
10155ee3e8c14Smrg            ;;
10156ee3e8c14Smrg          *)
10157ee3e8c14Smrg            if test yes = "$GXX"; then
10158ee3e8c14Smrg              _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'
10159ee3e8c14Smrg            else
10160ee3e8c14Smrg              # FIXME: insert proper C++ library support
10161ee3e8c14Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
10162ee3e8c14Smrg            fi
10163ee3e8c14Smrg            ;;
10164ee3e8c14Smrg        esac
10165ee3e8c14Smrg        ;;
10166ba064abeSmrg
10167ee3e8c14Smrg      hpux10*|hpux11*)
10168ee3e8c14Smrg        if test no = "$with_gnu_ld"; then
10169ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10170ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10171ba064abeSmrg
10172ee3e8c14Smrg          case $host_cpu in
10173ee3e8c14Smrg            hppa*64*|ia64*)
10174ee3e8c14Smrg              ;;
10175ee3e8c14Smrg            *)
10176ee3e8c14Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10177ee3e8c14Smrg              ;;
10178ee3e8c14Smrg          esac
10179ee3e8c14Smrg        fi
10180ee3e8c14Smrg        case $host_cpu in
10181ee3e8c14Smrg          hppa*64*|ia64*)
10182ee3e8c14Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
10183ee3e8c14Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10184ee3e8c14Smrg            ;;
10185ee3e8c14Smrg          *)
10186ee3e8c14Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
10187ee3e8c14Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10188ee3e8c14Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10189ee3e8c14Smrg					         # but as the default
10190ee3e8c14Smrg					         # location of the library.
10191ee3e8c14Smrg            ;;
10192ee3e8c14Smrg        esac
10193ba064abeSmrg
10194ee3e8c14Smrg        case $cc_basename in
10195ee3e8c14Smrg          CC*)
10196ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10197ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10198ee3e8c14Smrg	    ;;
10199ee3e8c14Smrg          aCC*)
10200ee3e8c14Smrg	    case $host_cpu in
10201ee3e8c14Smrg	      hppa*64*)
10202ee3e8c14Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10203ee3e8c14Smrg	        ;;
10204ee3e8c14Smrg	      ia64*)
10205ee3e8c14Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10206ee3e8c14Smrg	        ;;
10207ee3e8c14Smrg	      *)
10208ee3e8c14Smrg	        _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'
10209ee3e8c14Smrg	        ;;
10210ee3e8c14Smrg	    esac
10211ee3e8c14Smrg	    # Commands to make compiler produce verbose output that lists
10212ee3e8c14Smrg	    # what "hidden" libraries, object files and flags are used when
10213ee3e8c14Smrg	    # linking a shared library.
10214ee3e8c14Smrg	    #
10215ee3e8c14Smrg	    # There doesn't appear to be a way to prevent this compiler from
10216ee3e8c14Smrg	    # explicitly linking system object files so we need to strip them
10217ee3e8c14Smrg	    # from the output so that they don't get included in the library
10218ee3e8c14Smrg	    # dependencies.
10219ee3e8c14Smrg	    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"'
10220ee3e8c14Smrg	    ;;
10221ee3e8c14Smrg          *)
10222ee3e8c14Smrg	    if test yes = "$GXX"; then
10223ee3e8c14Smrg	      if test no = "$with_gnu_ld"; then
10224ee3e8c14Smrg	        case $host_cpu in
10225ee3e8c14Smrg	          hppa*64*)
10226ee3e8c14Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10227ee3e8c14Smrg	            ;;
10228ee3e8c14Smrg	          ia64*)
10229ee3e8c14Smrg	            _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'
10230ee3e8c14Smrg	            ;;
10231ee3e8c14Smrg	          *)
10232ee3e8c14Smrg	            _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'
10233ee3e8c14Smrg	            ;;
10234ee3e8c14Smrg	        esac
10235ee3e8c14Smrg	      fi
10236ee3e8c14Smrg	    else
10237ee3e8c14Smrg	      # FIXME: insert proper C++ library support
10238ee3e8c14Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
10239ee3e8c14Smrg	    fi
10240ee3e8c14Smrg	    ;;
10241ee3e8c14Smrg        esac
10242ee3e8c14Smrg        ;;
10243ba064abeSmrg
10244ee3e8c14Smrg      interix[[3-9]]*)
10245ee3e8c14Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
10246ee3e8c14Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10247ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10248ee3e8c14Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10249ee3e8c14Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
10250ee3e8c14Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
10251ee3e8c14Smrg	# default) and relocated if they conflict, which is a slow very memory
10252ee3e8c14Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
10253ee3e8c14Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
10254ee3e8c14Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
10255ee3e8c14Smrg	_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'
10256ee3e8c14Smrg	_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'
10257ee3e8c14Smrg	;;
10258ee3e8c14Smrg      irix5* | irix6*)
10259ee3e8c14Smrg        case $cc_basename in
10260ee3e8c14Smrg          CC*)
10261ee3e8c14Smrg	    # SGI C++
10262ee3e8c14Smrg	    _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'
10263191cded7Smrg
10264ee3e8c14Smrg	    # Archives containing C++ object files must be created using
10265ee3e8c14Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
10266ee3e8c14Smrg	    # necessary to make sure instantiated templates are included
10267ee3e8c14Smrg	    # in the archive.
10268ee3e8c14Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
10269ee3e8c14Smrg	    ;;
10270ee3e8c14Smrg          *)
10271ee3e8c14Smrg	    if test yes = "$GXX"; then
10272ee3e8c14Smrg	      if test no = "$with_gnu_ld"; then
10273ee3e8c14Smrg	        _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'
10274ee3e8c14Smrg	      else
10275ee3e8c14Smrg	        _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'
10276ee3e8c14Smrg	      fi
10277ee3e8c14Smrg	    fi
10278ee3e8c14Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
10279ee3e8c14Smrg	    ;;
10280ee3e8c14Smrg        esac
10281ee3e8c14Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10282ee3e8c14Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10283ee3e8c14Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
10284ee3e8c14Smrg        ;;
10285b290cf36Smrg
10286ee3e8c14Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
10287ee3e8c14Smrg        case $cc_basename in
10288ee3e8c14Smrg          KCC*)
10289ee3e8c14Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
10290b290cf36Smrg
10291ee3e8c14Smrg	    # KCC will only create a shared library if the output file
10292ee3e8c14Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
10293ee3e8c14Smrg	    # to its proper name (with version) after linking.
10294ee3e8c14Smrg	    _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'
10295ee3e8c14Smrg	    _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'
10296ee3e8c14Smrg	    # Commands to make compiler produce verbose output that lists
10297ee3e8c14Smrg	    # what "hidden" libraries, object files and flags are used when
10298ee3e8c14Smrg	    # linking a shared library.
10299ee3e8c14Smrg	    #
10300ee3e8c14Smrg	    # There doesn't appear to be a way to prevent this compiler from
10301ee3e8c14Smrg	    # explicitly linking system object files so we need to strip them
10302ee3e8c14Smrg	    # from the output so that they don't get included in the library
10303ee3e8c14Smrg	    # dependencies.
10304ee3e8c14Smrg	    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"'
10305b290cf36Smrg
10306ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10307ee3e8c14Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10308b290cf36Smrg
10309ee3e8c14Smrg	    # Archives containing C++ object files must be created using
10310ee3e8c14Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
10311ee3e8c14Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
10312ee3e8c14Smrg	    ;;
10313ee3e8c14Smrg	  icpc* | ecpc* )
10314ee3e8c14Smrg	    # Intel C++
10315ee3e8c14Smrg	    with_gnu_ld=yes
10316ee3e8c14Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
10317ee3e8c14Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
10318ee3e8c14Smrg	    # earlier do not add the objects themselves.
10319ee3e8c14Smrg	    case `$CC -V 2>&1` in
10320ee3e8c14Smrg	      *"Version 7."*)
10321ee3e8c14Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10322ee3e8c14Smrg		_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'
10323ee3e8c14Smrg		;;
10324ee3e8c14Smrg	      *)  # Version 8.0 or newer
10325ee3e8c14Smrg	        tmp_idyn=
10326ee3e8c14Smrg	        case $host_cpu in
10327ee3e8c14Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
10328ee3e8c14Smrg		esac
10329ee3e8c14Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10330ee3e8c14Smrg		_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'
10331ee3e8c14Smrg		;;
10332ee3e8c14Smrg	    esac
10333ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10334ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10335ee3e8c14Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10336ee3e8c14Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
10337ee3e8c14Smrg	    ;;
10338ee3e8c14Smrg          pgCC* | pgcpp*)
10339ee3e8c14Smrg            # Portland Group C++ compiler
10340ee3e8c14Smrg	    case `$CC -V` in
10341ee3e8c14Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
10342ee3e8c14Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
10343ee3e8c14Smrg               rm -rf $tpldir~
10344ee3e8c14Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
10345ee3e8c14Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
10346ee3e8c14Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
10347ee3e8c14Smrg                rm -rf $tpldir~
10348ee3e8c14Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
10349ee3e8c14Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
10350ee3e8c14Smrg                $RANLIB $oldlib'
10351ee3e8c14Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
10352ee3e8c14Smrg                rm -rf $tpldir~
10353ee3e8c14Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
10354ee3e8c14Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10355ee3e8c14Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
10356ee3e8c14Smrg                rm -rf $tpldir~
10357ee3e8c14Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
10358ee3e8c14Smrg                $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'
10359ee3e8c14Smrg	      ;;
10360ee3e8c14Smrg	    *) # Version 6 and above use weak symbols
10361ee3e8c14Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10362ee3e8c14Smrg	      _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'
10363ee3e8c14Smrg	      ;;
10364ee3e8c14Smrg	    esac
10365b290cf36Smrg
10366ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
10367ee3e8c14Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10368ee3e8c14Smrg	    _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'
10369ee3e8c14Smrg            ;;
10370ee3e8c14Smrg	  cxx*)
10371ee3e8c14Smrg	    # Compaq C++
10372ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10373ee3e8c14Smrg	    _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'
10374b290cf36Smrg
10375ee3e8c14Smrg	    runpath_var=LD_RUN_PATH
10376ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10377ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10378b290cf36Smrg
10379ee3e8c14Smrg	    # Commands to make compiler produce verbose output that lists
10380ee3e8c14Smrg	    # what "hidden" libraries, object files and flags are used when
10381ee3e8c14Smrg	    # linking a shared library.
10382ee3e8c14Smrg	    #
10383ee3e8c14Smrg	    # There doesn't appear to be a way to prevent this compiler from
10384ee3e8c14Smrg	    # explicitly linking system object files so we need to strip them
10385ee3e8c14Smrg	    # from the output so that they don't get included in the library
10386ee3e8c14Smrg	    # dependencies.
10387ee3e8c14Smrg	    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'
10388ee3e8c14Smrg	    ;;
10389ee3e8c14Smrg	  xl* | mpixl* | bgxl*)
10390ee3e8c14Smrg	    # IBM XL 8.0 on PPC, with GNU ld
10391ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10392ee3e8c14Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10393ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10394ee3e8c14Smrg	    if test yes = "$supports_anon_versioning"; then
10395ee3e8c14Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
10396ee3e8c14Smrg                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
10397ee3e8c14Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
10398ee3e8c14Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
10399ee3e8c14Smrg	    fi
10400ee3e8c14Smrg	    ;;
10401ee3e8c14Smrg	  *)
10402ee3e8c14Smrg	    case `$CC -V 2>&1 | $SED 5q` in
10403ee3e8c14Smrg	    *Sun\ C*)
10404ee3e8c14Smrg	      # Sun C++ 5.9
10405ee3e8c14Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10406ee3e8c14Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10407ee3e8c14Smrg	      _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'
10408ee3e8c14Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10409ee3e8c14Smrg	      _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'
10410ee3e8c14Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
10411b290cf36Smrg
10412ee3e8c14Smrg	      # Not sure whether something based on
10413ee3e8c14Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
10414ee3e8c14Smrg	      # would be better.
10415ee3e8c14Smrg	      output_verbose_link_cmd='func_echo_all'
10416b290cf36Smrg
10417ee3e8c14Smrg	      # Archives containing C++ object files must be created using
10418ee3e8c14Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
10419ee3e8c14Smrg	      # necessary to make sure instantiated templates are included
10420ee3e8c14Smrg	      # in the archive.
10421ee3e8c14Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10422ee3e8c14Smrg	      ;;
10423ee3e8c14Smrg	    esac
10424ee3e8c14Smrg	    ;;
10425ee3e8c14Smrg	esac
10426ee3e8c14Smrg	;;
10427b290cf36Smrg
10428ee3e8c14Smrg      lynxos*)
10429ee3e8c14Smrg        # FIXME: insert proper C++ library support
10430ee3e8c14Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
10431ee3e8c14Smrg	;;
10432b290cf36Smrg
10433ee3e8c14Smrg      m88k*)
10434ee3e8c14Smrg        # FIXME: insert proper C++ library support
10435ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10436ee3e8c14Smrg	;;
10437b290cf36Smrg
10438ee3e8c14Smrg      mvs*)
10439ee3e8c14Smrg        case $cc_basename in
10440ee3e8c14Smrg          cxx*)
10441ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10442ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10443ee3e8c14Smrg	    ;;
10444ee3e8c14Smrg	  *)
10445ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10446ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10447ee3e8c14Smrg	    ;;
10448ee3e8c14Smrg	esac
10449ee3e8c14Smrg	;;
10450b290cf36Smrg
10451ee3e8c14Smrg      netbsd*)
10452ee3e8c14Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10453ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
10454ee3e8c14Smrg	  wlarc=
10455ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10456ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
10457ee3e8c14Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10458d9dcd5aeSmrg	fi
10459ee3e8c14Smrg	# Workaround some broken pre-1.5 toolchains
10460ee3e8c14Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
10461ee3e8c14Smrg	;;
10462b290cf36Smrg
10463ee3e8c14Smrg      *nto* | *qnx*)
10464ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
10465ee3e8c14Smrg	;;
10466ba064abeSmrg
10467ee3e8c14Smrg      openbsd* | bitrig*)
10468ee3e8c14Smrg	if test -f /usr/libexec/ld.so; then
10469ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
10470ee3e8c14Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10471ee3e8c14Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10472ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
10473ee3e8c14Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10474ee3e8c14Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
10475ee3e8c14Smrg	    _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'
10476ee3e8c14Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10477ee3e8c14Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
10478ee3e8c14Smrg	  fi
10479ee3e8c14Smrg	  output_verbose_link_cmd=func_echo_all
10480ee3e8c14Smrg	else
10481ee3e8c14Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
10482ee3e8c14Smrg	fi
10483ee3e8c14Smrg	;;
10484b290cf36Smrg
10485ee3e8c14Smrg      osf3* | osf4* | osf5*)
10486ee3e8c14Smrg        case $cc_basename in
10487ee3e8c14Smrg          KCC*)
10488ee3e8c14Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
10489b290cf36Smrg
10490ee3e8c14Smrg	    # KCC will only create a shared library if the output file
10491ee3e8c14Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
10492ee3e8c14Smrg	    # to its proper name (with version) after linking.
10493ee3e8c14Smrg	    _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'
10494b290cf36Smrg
10495ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10496ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10497b290cf36Smrg
10498ee3e8c14Smrg	    # Archives containing C++ object files must be created using
10499ee3e8c14Smrg	    # the KAI C++ compiler.
10500ee3e8c14Smrg	    case $host in
10501ee3e8c14Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
10502ee3e8c14Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
10503ee3e8c14Smrg	    esac
10504ee3e8c14Smrg	    ;;
10505ee3e8c14Smrg          RCC*)
10506ee3e8c14Smrg	    # Rational C++ 2.4.1
10507ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10508ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10509ee3e8c14Smrg	    ;;
10510ee3e8c14Smrg          cxx*)
10511ee3e8c14Smrg	    case $host in
10512ee3e8c14Smrg	      osf3*)
10513ee3e8c14Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10514ee3e8c14Smrg	        _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'
10515ee3e8c14Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10516ee3e8c14Smrg		;;
10517ee3e8c14Smrg	      *)
10518ee3e8c14Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10519ee3e8c14Smrg	        _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'
10520ee3e8c14Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
10521ee3e8c14Smrg                  echo "-hidden">> $lib.exp~
10522ee3e8c14Smrg                  $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~
10523ee3e8c14Smrg                  $RM $lib.exp'
10524ee3e8c14Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10525ee3e8c14Smrg		;;
10526ee3e8c14Smrg	    esac
10527b290cf36Smrg
10528ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10529b290cf36Smrg
10530ee3e8c14Smrg	    # Commands to make compiler produce verbose output that lists
10531ee3e8c14Smrg	    # what "hidden" libraries, object files and flags are used when
10532ee3e8c14Smrg	    # linking a shared library.
10533ee3e8c14Smrg	    #
10534ee3e8c14Smrg	    # There doesn't appear to be a way to prevent this compiler from
10535ee3e8c14Smrg	    # explicitly linking system object files so we need to strip them
10536ee3e8c14Smrg	    # from the output so that they don't get included in the library
10537ee3e8c14Smrg	    # dependencies.
10538ee3e8c14Smrg	    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"'
10539ee3e8c14Smrg	    ;;
10540ee3e8c14Smrg	  *)
10541ee3e8c14Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
10542ee3e8c14Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10543ee3e8c14Smrg	      case $host in
10544ee3e8c14Smrg	        osf3*)
10545ee3e8c14Smrg	          _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'
10546ee3e8c14Smrg		  ;;
10547ee3e8c14Smrg	        *)
10548ee3e8c14Smrg	          _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'
10549ee3e8c14Smrg		  ;;
10550ee3e8c14Smrg	      esac
10551b290cf36Smrg
10552ee3e8c14Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10553ee3e8c14Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10554b290cf36Smrg
10555ee3e8c14Smrg	      # Commands to make compiler produce verbose output that lists
10556ee3e8c14Smrg	      # what "hidden" libraries, object files and flags are used when
10557ee3e8c14Smrg	      # linking a shared library.
10558ee3e8c14Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10559b290cf36Smrg
10560ee3e8c14Smrg	    else
10561ee3e8c14Smrg	      # FIXME: insert proper C++ library support
10562ee3e8c14Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
10563ee3e8c14Smrg	    fi
10564ee3e8c14Smrg	    ;;
10565ee3e8c14Smrg        esac
10566ee3e8c14Smrg        ;;
10567191cded7Smrg
10568ee3e8c14Smrg      psos*)
10569ee3e8c14Smrg        # FIXME: insert proper C++ library support
10570ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10571ee3e8c14Smrg        ;;
10572191cded7Smrg
10573ee3e8c14Smrg      sunos4*)
10574ee3e8c14Smrg        case $cc_basename in
10575ee3e8c14Smrg          CC*)
10576ee3e8c14Smrg	    # Sun C++ 4.x
10577ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10578ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10579ee3e8c14Smrg	    ;;
10580ee3e8c14Smrg          lcc*)
10581ee3e8c14Smrg	    # Lucid
10582ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10583ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10584ee3e8c14Smrg	    ;;
10585ee3e8c14Smrg          *)
10586ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10587ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10588ee3e8c14Smrg	    ;;
10589ee3e8c14Smrg        esac
10590ee3e8c14Smrg        ;;
10591191cded7Smrg
10592ee3e8c14Smrg      solaris*)
10593ee3e8c14Smrg        case $cc_basename in
10594ee3e8c14Smrg          CC* | sunCC*)
10595ee3e8c14Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
10596ee3e8c14Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
10597ee3e8c14Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10598ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10599ee3e8c14Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10600ee3e8c14Smrg              $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'
10601191cded7Smrg
10602ee3e8c14Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10603ee3e8c14Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10604ee3e8c14Smrg	    case $host_os in
10605ee3e8c14Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10606ee3e8c14Smrg	      *)
10607ee3e8c14Smrg		# The compiler driver will combine and reorder linker options,
10608ee3e8c14Smrg		# but understands '-z linker_flag'.
10609ee3e8c14Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
10610ee3e8c14Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
10611ee3e8c14Smrg	        ;;
10612ee3e8c14Smrg	    esac
10613ee3e8c14Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
10614191cded7Smrg
10615ee3e8c14Smrg	    output_verbose_link_cmd='func_echo_all'
10616b290cf36Smrg
10617ee3e8c14Smrg	    # Archives containing C++ object files must be created using
10618ee3e8c14Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
10619ee3e8c14Smrg	    # necessary to make sure instantiated templates are included
10620ee3e8c14Smrg	    # in the archive.
10621ee3e8c14Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10622ee3e8c14Smrg	    ;;
10623ee3e8c14Smrg          gcx*)
10624ee3e8c14Smrg	    # Green Hills C++ Compiler
10625ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10626b290cf36Smrg
10627ee3e8c14Smrg	    # The C++ compiler must be used to create the archive.
10628ee3e8c14Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
10629ee3e8c14Smrg	    ;;
10630ee3e8c14Smrg          *)
10631ee3e8c14Smrg	    # GNU C++ compiler with Solaris linker
10632ee3e8c14Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
10633ee3e8c14Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
10634ee3e8c14Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
10635ee3e8c14Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10636ee3e8c14Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10637ee3e8c14Smrg                  $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'
10638191cded7Smrg
10639ee3e8c14Smrg	        # Commands to make compiler produce verbose output that lists
10640ee3e8c14Smrg	        # what "hidden" libraries, object files and flags are used when
10641ee3e8c14Smrg	        # linking a shared library.
10642ee3e8c14Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10643ee3e8c14Smrg	      else
10644ee3e8c14Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
10645ee3e8c14Smrg	        # platform.
10646ee3e8c14Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10647ee3e8c14Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10648ee3e8c14Smrg                  $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'
10649191cded7Smrg
10650ee3e8c14Smrg	        # Commands to make compiler produce verbose output that lists
10651ee3e8c14Smrg	        # what "hidden" libraries, object files and flags are used when
10652ee3e8c14Smrg	        # linking a shared library.
10653ee3e8c14Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10654ee3e8c14Smrg	      fi
10655191cded7Smrg
10656ee3e8c14Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
10657ee3e8c14Smrg	      case $host_os in
10658ee3e8c14Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10659ee3e8c14Smrg		*)
10660ee3e8c14Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
10661ee3e8c14Smrg		  ;;
10662ee3e8c14Smrg	      esac
10663ee3e8c14Smrg	    fi
10664ee3e8c14Smrg	    ;;
10665ee3e8c14Smrg        esac
10666ee3e8c14Smrg        ;;
10667191cded7Smrg
10668ee3e8c14Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
10669ee3e8c14Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10670ee3e8c14Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10671ee3e8c14Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10672ee3e8c14Smrg      runpath_var='LD_RUN_PATH'
10673191cded7Smrg
10674ee3e8c14Smrg      case $cc_basename in
10675ee3e8c14Smrg        CC*)
10676ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10677ee3e8c14Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10678ee3e8c14Smrg	  ;;
10679ee3e8c14Smrg	*)
10680ee3e8c14Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10681ee3e8c14Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10682ee3e8c14Smrg	  ;;
10683ee3e8c14Smrg      esac
10684ee3e8c14Smrg      ;;
10685191cded7Smrg
10686ee3e8c14Smrg      sysv5* | sco3.2v5* | sco5v6*)
10687ee3e8c14Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
10688ee3e8c14Smrg	# link with -lc, and that would cause any symbols used from libc to
10689ee3e8c14Smrg	# always be unresolved, which means just about no library would
10690ee3e8c14Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
10691ee3e8c14Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
10692ee3e8c14Smrg	# as -z defs.
10693ee3e8c14Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10694ee3e8c14Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
10695ee3e8c14Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
10696ee3e8c14Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10697ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
10698ee3e8c14Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10699ee3e8c14Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
10700ee3e8c14Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
10701ee3e8c14Smrg	runpath_var='LD_RUN_PATH'
10702191cded7Smrg
10703ee3e8c14Smrg	case $cc_basename in
10704ee3e8c14Smrg          CC*)
10705ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10706ee3e8c14Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10707ee3e8c14Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
10708ee3e8c14Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
10709ee3e8c14Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
10710ee3e8c14Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
10711ee3e8c14Smrg	    ;;
10712ee3e8c14Smrg	  *)
10713ee3e8c14Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10714ee3e8c14Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10715ee3e8c14Smrg	    ;;
10716ee3e8c14Smrg	esac
10717ee3e8c14Smrg      ;;
10718191cded7Smrg
10719ee3e8c14Smrg      tandem*)
10720ee3e8c14Smrg        case $cc_basename in
10721ee3e8c14Smrg          NCC*)
10722ee3e8c14Smrg	    # NonStop-UX NCC 3.20
10723ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10724ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10725ee3e8c14Smrg	    ;;
10726ee3e8c14Smrg          *)
10727ee3e8c14Smrg	    # FIXME: insert proper C++ library support
10728ee3e8c14Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10729ee3e8c14Smrg	    ;;
10730ee3e8c14Smrg        esac
10731ee3e8c14Smrg        ;;
10732b290cf36Smrg
10733ee3e8c14Smrg      vxworks*)
10734ee3e8c14Smrg        # FIXME: insert proper C++ library support
10735ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10736ee3e8c14Smrg        ;;
10737b290cf36Smrg
10738ee3e8c14Smrg      *)
10739ee3e8c14Smrg        # FIXME: insert proper C++ library support
10740ee3e8c14Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
10741ee3e8c14Smrg        ;;
10742ee3e8c14Smrg    esac
10743b290cf36Smrg
10744ee3e8c14Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
10745ee3e8c14Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
10746191cded7Smrg
10747ee3e8c14Smrg    _LT_TAGVAR(GCC, $1)=$GXX
10748ee3e8c14Smrg    _LT_TAGVAR(LD, $1)=$LD
10749191cded7Smrg
10750ee3e8c14Smrg    ## CAVEAT EMPTOR:
10751ee3e8c14Smrg    ## There is no encapsulation within the following macros, do not change
10752ee3e8c14Smrg    ## the running order or otherwise move them around unless you know exactly
10753ee3e8c14Smrg    ## what you are doing...
10754ee3e8c14Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
10755ee3e8c14Smrg    _LT_COMPILER_PIC($1)
10756ee3e8c14Smrg    _LT_COMPILER_C_O($1)
10757ee3e8c14Smrg    _LT_COMPILER_FILE_LOCKS($1)
10758ee3e8c14Smrg    _LT_LINKER_SHLIBS($1)
10759ee3e8c14Smrg    _LT_SYS_DYNAMIC_LINKER($1)
10760ee3e8c14Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
10761191cded7Smrg
10762ee3e8c14Smrg    _LT_CONFIG($1)
10763ee3e8c14Smrg  fi # test -n "$compiler"
10764191cded7Smrg
10765ee3e8c14Smrg  CC=$lt_save_CC
10766ee3e8c14Smrg  CFLAGS=$lt_save_CFLAGS
10767ee3e8c14Smrg  LDCXX=$LD
10768ee3e8c14Smrg  LD=$lt_save_LD
10769ee3e8c14Smrg  GCC=$lt_save_GCC
10770ee3e8c14Smrg  with_gnu_ld=$lt_save_with_gnu_ld
10771ee3e8c14Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
10772ee3e8c14Smrg  lt_cv_path_LD=$lt_save_path_LD
10773ee3e8c14Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
10774ee3e8c14Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
10775ee3e8c14Smrgfi # test yes != "$_lt_caught_CXX_error"
10776191cded7Smrg
10777ee3e8c14SmrgAC_LANG_POP
10778ee3e8c14Smrg])# _LT_LANG_CXX_CONFIG
10779ba064abeSmrg
10780ba064abeSmrg
10781ee3e8c14Smrg# _LT_FUNC_STRIPNAME_CNF
10782ee3e8c14Smrg# ----------------------
10783ee3e8c14Smrg# func_stripname_cnf prefix suffix name
10784ee3e8c14Smrg# strip PREFIX and SUFFIX off of NAME.
10785ee3e8c14Smrg# PREFIX and SUFFIX must not contain globbing or regex special
10786ee3e8c14Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
10787ee3e8c14Smrg# dot (in which case that matches only a dot).
10788ee3e8c14Smrg#
10789ee3e8c14Smrg# This function is identical to the (non-XSI) version of func_stripname,
10790ee3e8c14Smrg# except this one can be used by m4 code that may be executed by configure,
10791ee3e8c14Smrg# rather than the libtool script.
10792ee3e8c14Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
10793ee3e8c14SmrgAC_REQUIRE([_LT_DECL_SED])
10794ee3e8c14SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
10795ee3e8c14Smrgfunc_stripname_cnf ()
10796ee3e8c14Smrg{
10797ee3e8c14Smrg  case @S|@2 in
10798ee3e8c14Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
10799ee3e8c14Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
10800ee3e8c14Smrg  esac
10801ee3e8c14Smrg} # func_stripname_cnf
10802ee3e8c14Smrg])# _LT_FUNC_STRIPNAME_CNF
10803ba064abeSmrg
10804ba064abeSmrg
10805ee3e8c14Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
10806ee3e8c14Smrg# ---------------------------------
10807ee3e8c14Smrg# Figure out "hidden" library dependencies from verbose
10808ee3e8c14Smrg# compiler output when linking a shared library.
10809ee3e8c14Smrg# Parse the compiler output and extract the necessary
10810ee3e8c14Smrg# objects, libraries and library flags.
10811ee3e8c14Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
10812ee3e8c14Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
10813ee3e8c14SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
10814ee3e8c14Smrg# Dependencies to place before and after the object being linked:
10815ee3e8c14Smrg_LT_TAGVAR(predep_objects, $1)=
10816ee3e8c14Smrg_LT_TAGVAR(postdep_objects, $1)=
10817ee3e8c14Smrg_LT_TAGVAR(predeps, $1)=
10818ee3e8c14Smrg_LT_TAGVAR(postdeps, $1)=
10819ee3e8c14Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
10820ba064abeSmrg
10821ee3e8c14Smrgdnl we can't use the lt_simple_compile_test_code here,
10822ee3e8c14Smrgdnl because it contains code intended for an executable,
10823ee3e8c14Smrgdnl not a library.  It's possible we should let each
10824ee3e8c14Smrgdnl tag define a new lt_????_link_test_code variable,
10825ee3e8c14Smrgdnl but it's only used here...
10826ee3e8c14Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
10827ee3e8c14Smrgint a;
10828ee3e8c14Smrgvoid foo (void) { a = 0; }
10829ee3e8c14Smrg_LT_EOF
10830ee3e8c14Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
10831ee3e8c14Smrgclass Foo
10832ee3e8c14Smrg{
10833ee3e8c14Smrgpublic:
10834ee3e8c14Smrg  Foo (void) { a = 0; }
10835ee3e8c14Smrgprivate:
10836ee3e8c14Smrg  int a;
10837ee3e8c14Smrg};
10838ee3e8c14Smrg_LT_EOF
10839ee3e8c14Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
10840ee3e8c14Smrg      subroutine foo
10841ee3e8c14Smrg      implicit none
10842ee3e8c14Smrg      integer*4 a
10843ee3e8c14Smrg      a=0
10844ee3e8c14Smrg      return
10845ee3e8c14Smrg      end
10846ee3e8c14Smrg_LT_EOF
10847ee3e8c14Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
10848ee3e8c14Smrg      subroutine foo
10849ee3e8c14Smrg      implicit none
10850ee3e8c14Smrg      integer a
10851ee3e8c14Smrg      a=0
10852ee3e8c14Smrg      return
10853ee3e8c14Smrg      end
10854ee3e8c14Smrg_LT_EOF
10855ee3e8c14Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
10856ee3e8c14Smrgpublic class foo {
10857ee3e8c14Smrg  private int a;
10858ee3e8c14Smrg  public void bar (void) {
10859ee3e8c14Smrg    a = 0;
10860ee3e8c14Smrg  }
10861ee3e8c14Smrg};
10862ee3e8c14Smrg_LT_EOF
10863ee3e8c14Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
10864ee3e8c14Smrgpackage foo
10865ee3e8c14Smrgfunc foo() {
10866ee3e8c14Smrg}
10867ee3e8c14Smrg_LT_EOF
10868b290cf36Smrg])
10869191cded7Smrg
10870ee3e8c14Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
10871ee3e8c14Smrgcase "$CC $CFLAGS " in #(
10872ee3e8c14Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
10873ee3e8c14Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
10874ee3e8c14Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
10875ee3e8c14Smrgesac
10876191cded7Smrg
10877ee3e8c14Smrgdnl Parse the compiler output and extract the necessary
10878ee3e8c14Smrgdnl objects, libraries and library flags.
10879ee3e8c14Smrgif AC_TRY_EVAL(ac_compile); then
10880ee3e8c14Smrg  # Parse the compiler output and extract the necessary
10881ee3e8c14Smrg  # objects, libraries and library flags.
10882191cded7Smrg
10883ee3e8c14Smrg  # Sentinel used to keep track of whether or not we are before
10884ee3e8c14Smrg  # the conftest object file.
10885ee3e8c14Smrg  pre_test_object_deps_done=no
10886191cded7Smrg
10887ee3e8c14Smrg  for p in `eval "$output_verbose_link_cmd"`; do
10888ee3e8c14Smrg    case $prev$p in
10889191cded7Smrg
10890ee3e8c14Smrg    -L* | -R* | -l*)
10891ee3e8c14Smrg       # Some compilers place space between "-{L,R}" and the path.
10892ee3e8c14Smrg       # Remove the space.
10893ee3e8c14Smrg       if test x-L = "$p" ||
10894ee3e8c14Smrg          test x-R = "$p"; then
10895ee3e8c14Smrg	 prev=$p
10896ee3e8c14Smrg	 continue
10897ee3e8c14Smrg       fi
10898191cded7Smrg
10899ee3e8c14Smrg       # Expand the sysroot to ease extracting the directories later.
10900ee3e8c14Smrg       if test -z "$prev"; then
10901ee3e8c14Smrg         case $p in
10902ee3e8c14Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
10903ee3e8c14Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
10904ee3e8c14Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
10905ee3e8c14Smrg         esac
10906ee3e8c14Smrg       fi
10907ee3e8c14Smrg       case $p in
10908ee3e8c14Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
10909ee3e8c14Smrg       esac
10910ee3e8c14Smrg       if test no = "$pre_test_object_deps_done"; then
10911ee3e8c14Smrg	 case $prev in
10912ee3e8c14Smrg	 -L | -R)
10913ee3e8c14Smrg	   # Internal compiler library paths should come after those
10914ee3e8c14Smrg	   # provided the user.  The postdeps already come after the
10915ee3e8c14Smrg	   # user supplied libs so there is no need to process them.
10916ee3e8c14Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
10917ee3e8c14Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
10918ee3e8c14Smrg	   else
10919ee3e8c14Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
10920ee3e8c14Smrg	   fi
10921ee3e8c14Smrg	   ;;
10922ee3e8c14Smrg	 # The "-l" case would never come before the object being
10923ee3e8c14Smrg	 # linked, so don't bother handling this case.
10924ee3e8c14Smrg	 esac
10925ee3e8c14Smrg       else
10926ee3e8c14Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
10927ee3e8c14Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
10928ee3e8c14Smrg	 else
10929ee3e8c14Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
10930ee3e8c14Smrg	 fi
10931ee3e8c14Smrg       fi
10932ee3e8c14Smrg       prev=
10933ee3e8c14Smrg       ;;
10934191cded7Smrg
10935ee3e8c14Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
10936ee3e8c14Smrg    *.$objext)
10937ee3e8c14Smrg       # This assumes that the test object file only shows up
10938ee3e8c14Smrg       # once in the compiler output.
10939ee3e8c14Smrg       if test "$p" = "conftest.$objext"; then
10940ee3e8c14Smrg	 pre_test_object_deps_done=yes
10941ee3e8c14Smrg	 continue
10942ee3e8c14Smrg       fi
10943191cded7Smrg
10944ee3e8c14Smrg       if test no = "$pre_test_object_deps_done"; then
10945ee3e8c14Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
10946ee3e8c14Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
10947ee3e8c14Smrg	 else
10948ee3e8c14Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
10949ee3e8c14Smrg	 fi
10950ee3e8c14Smrg       else
10951ee3e8c14Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
10952ee3e8c14Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
10953ee3e8c14Smrg	 else
10954ee3e8c14Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
10955ee3e8c14Smrg	 fi
10956ee3e8c14Smrg       fi
10957ee3e8c14Smrg       ;;
10958191cded7Smrg
10959ee3e8c14Smrg    *) ;; # Ignore the rest.
10960191cded7Smrg
10961ee3e8c14Smrg    esac
10962ee3e8c14Smrg  done
10963191cded7Smrg
10964ee3e8c14Smrg  # Clean up.
10965ee3e8c14Smrg  rm -f a.out a.exe
10966ee3e8c14Smrgelse
10967ee3e8c14Smrg  echo "libtool.m4: error: problem compiling $1 test program"
10968d9dcd5aeSmrgfi
10969191cded7Smrg
10970ee3e8c14Smrg$RM -f confest.$objext
10971ee3e8c14SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
10972191cded7Smrg
10973ee3e8c14Smrg# PORTME: override above test on systems where it is broken
10974ee3e8c14Smrgm4_if([$1], [CXX],
10975ee3e8c14Smrg[case $host_os in
10976ee3e8c14Smrginterix[[3-9]]*)
10977ee3e8c14Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
10978ee3e8c14Smrg  # hack all around it, let's just trust "g++" to DTRT.
10979ee3e8c14Smrg  _LT_TAGVAR(predep_objects,$1)=
10980ee3e8c14Smrg  _LT_TAGVAR(postdep_objects,$1)=
10981ee3e8c14Smrg  _LT_TAGVAR(postdeps,$1)=
10982ee3e8c14Smrg  ;;
10983ee3e8c14Smrgesac
10984ee3e8c14Smrg])
10985191cded7Smrg
10986ee3e8c14Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
10987ee3e8c14Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
10988ee3e8c14Smrgesac
10989ee3e8c14Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
10990ee3e8c14Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
10991ee3e8c14Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
10992ee3e8c14Smrgfi
10993ee3e8c14Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
10994ee3e8c14Smrg    [The directories searched by this compiler when creating a shared library])
10995ee3e8c14Smrg_LT_TAGDECL([], [predep_objects], [1],
10996ee3e8c14Smrg    [Dependencies to place before and after the objects being linked to
10997ee3e8c14Smrg    create a shared library])
10998ee3e8c14Smrg_LT_TAGDECL([], [postdep_objects], [1])
10999ee3e8c14Smrg_LT_TAGDECL([], [predeps], [1])
11000ee3e8c14Smrg_LT_TAGDECL([], [postdeps], [1])
11001ee3e8c14Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
11002ee3e8c14Smrg    [The library search path used internally by the compiler when linking
11003ee3e8c14Smrg    a shared library])
11004ee3e8c14Smrg])# _LT_SYS_HIDDEN_LIBDEPS
11005d9dcd5aeSmrg
11006d9dcd5aeSmrg
11007ee3e8c14Smrg# _LT_LANG_F77_CONFIG([TAG])
11008ee3e8c14Smrg# --------------------------
11009ee3e8c14Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
11010ee3e8c14Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
11011ee3e8c14Smrg# to write the compiler configuration to 'libtool'.
11012ee3e8c14Smrgm4_defun([_LT_LANG_F77_CONFIG],
11013ee3e8c14Smrg[AC_LANG_PUSH(Fortran 77)
11014ee3e8c14Smrgif test -z "$F77" || test no = "$F77"; then
11015ee3e8c14Smrg  _lt_disable_F77=yes
11016ee3e8c14Smrgfi
11017191cded7Smrg
11018ee3e8c14Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11019ee3e8c14Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
11020ee3e8c14Smrg_LT_TAGVAR(always_export_symbols, $1)=no
11021ee3e8c14Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
11022ee3e8c14Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11023ee3e8c14Smrg_LT_TAGVAR(hardcode_direct, $1)=no
11024ee3e8c14Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11025ee3e8c14Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11026ee3e8c14Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
11027ee3e8c14Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
11028ee3e8c14Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
11029ee3e8c14Smrg_LT_TAGVAR(inherit_rpath, $1)=no
11030ee3e8c14Smrg_LT_TAGVAR(module_cmds, $1)=
11031ee3e8c14Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
11032ee3e8c14Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
11033ee3e8c14Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11034ee3e8c14Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11035ee3e8c14Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11036ee3e8c14Smrg_LT_TAGVAR(no_undefined_flag, $1)=
11037ee3e8c14Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
11038ee3e8c14Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11039191cded7Smrg
11040ee3e8c14Smrg# Source file extension for f77 test sources.
11041ee3e8c14Smrgac_ext=f
11042191cded7Smrg
11043ee3e8c14Smrg# Object file extension for compiled f77 test sources.
11044ee3e8c14Smrgobjext=o
11045ee3e8c14Smrg_LT_TAGVAR(objext, $1)=$objext
11046191cded7Smrg
11047ee3e8c14Smrg# No sense in running all these tests if we already determined that
11048ee3e8c14Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
11049ee3e8c14Smrg# are currently assumed to apply to all compilers on this platform,
11050ee3e8c14Smrg# and will be corrupted by setting them based on a non-working compiler.
11051ee3e8c14Smrgif test yes != "$_lt_disable_F77"; then
11052ee3e8c14Smrg  # Code to be used in simple compile tests
11053ee3e8c14Smrg  lt_simple_compile_test_code="\
11054ee3e8c14Smrg      subroutine t
11055ee3e8c14Smrg      return
11056ee3e8c14Smrg      end
11057ee3e8c14Smrg"
11058191cded7Smrg
11059ee3e8c14Smrg  # Code to be used in simple link tests
11060ee3e8c14Smrg  lt_simple_link_test_code="\
11061ee3e8c14Smrg      program t
11062ee3e8c14Smrg      end
11063ee3e8c14Smrg"
11064191cded7Smrg
11065ee3e8c14Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11066ee3e8c14Smrg  _LT_TAG_COMPILER
11067191cded7Smrg
11068ee3e8c14Smrg  # save warnings/boilerplate of simple test code
11069ee3e8c14Smrg  _LT_COMPILER_BOILERPLATE
11070ee3e8c14Smrg  _LT_LINKER_BOILERPLATE
11071191cded7Smrg
11072ee3e8c14Smrg  # Allow CC to be a program name with arguments.
11073ee3e8c14Smrg  lt_save_CC=$CC
11074ee3e8c14Smrg  lt_save_GCC=$GCC
11075ee3e8c14Smrg  lt_save_CFLAGS=$CFLAGS
11076ee3e8c14Smrg  CC=${F77-"f77"}
11077ee3e8c14Smrg  CFLAGS=$FFLAGS
11078ee3e8c14Smrg  compiler=$CC
11079ee3e8c14Smrg  _LT_TAGVAR(compiler, $1)=$CC
11080ee3e8c14Smrg  _LT_CC_BASENAME([$compiler])
11081ee3e8c14Smrg  GCC=$G77
11082ee3e8c14Smrg  if test -n "$compiler"; then
11083ee3e8c14Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
11084ee3e8c14Smrg    AC_MSG_RESULT([$can_build_shared])
11085191cded7Smrg
11086ee3e8c14Smrg    AC_MSG_CHECKING([whether to build shared libraries])
11087ee3e8c14Smrg    test no = "$can_build_shared" && enable_shared=no
11088191cded7Smrg
11089ee3e8c14Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
11090ee3e8c14Smrg    # are all built from PIC.
11091ee3e8c14Smrg    case $host_os in
11092ee3e8c14Smrg      aix3*)
11093ee3e8c14Smrg        test yes = "$enable_shared" && enable_static=no
11094ee3e8c14Smrg        if test -n "$RANLIB"; then
11095ee3e8c14Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11096ee3e8c14Smrg          postinstall_cmds='$RANLIB $lib'
11097ee3e8c14Smrg        fi
11098ee3e8c14Smrg        ;;
11099ee3e8c14Smrg      aix[[4-9]]*)
11100ee3e8c14Smrg	if test ia64 != "$host_cpu"; then
11101ee3e8c14Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11102ee3e8c14Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
11103ee3e8c14Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11104ee3e8c14Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11105ee3e8c14Smrg	  esac
11106ee3e8c14Smrg	fi
11107ee3e8c14Smrg        ;;
11108ee3e8c14Smrg    esac
11109ee3e8c14Smrg    AC_MSG_RESULT([$enable_shared])
11110191cded7Smrg
11111ee3e8c14Smrg    AC_MSG_CHECKING([whether to build static libraries])
11112ee3e8c14Smrg    # Make sure either enable_shared or enable_static is yes.
11113ee3e8c14Smrg    test yes = "$enable_shared" || enable_static=yes
11114ee3e8c14Smrg    AC_MSG_RESULT([$enable_static])
11115ba064abeSmrg
11116ee3e8c14Smrg    _LT_TAGVAR(GCC, $1)=$G77
11117ee3e8c14Smrg    _LT_TAGVAR(LD, $1)=$LD
11118ba064abeSmrg
11119ee3e8c14Smrg    ## CAVEAT EMPTOR:
11120ee3e8c14Smrg    ## There is no encapsulation within the following macros, do not change
11121ee3e8c14Smrg    ## the running order or otherwise move them around unless you know exactly
11122ee3e8c14Smrg    ## what you are doing...
11123ee3e8c14Smrg    _LT_COMPILER_PIC($1)
11124ee3e8c14Smrg    _LT_COMPILER_C_O($1)
11125ee3e8c14Smrg    _LT_COMPILER_FILE_LOCKS($1)
11126ee3e8c14Smrg    _LT_LINKER_SHLIBS($1)
11127ee3e8c14Smrg    _LT_SYS_DYNAMIC_LINKER($1)
11128ee3e8c14Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
11129191cded7Smrg
11130ee3e8c14Smrg    _LT_CONFIG($1)
11131ee3e8c14Smrg  fi # test -n "$compiler"
11132191cded7Smrg
11133ee3e8c14Smrg  GCC=$lt_save_GCC
11134ee3e8c14Smrg  CC=$lt_save_CC
11135ee3e8c14Smrg  CFLAGS=$lt_save_CFLAGS
11136ee3e8c14Smrgfi # test yes != "$_lt_disable_F77"
11137191cded7Smrg
11138ee3e8c14SmrgAC_LANG_POP
11139ee3e8c14Smrg])# _LT_LANG_F77_CONFIG
11140191cded7Smrg
11141191cded7Smrg
11142ee3e8c14Smrg# _LT_LANG_FC_CONFIG([TAG])
11143ee3e8c14Smrg# -------------------------
11144ee3e8c14Smrg# Ensure that the configuration variables for a Fortran compiler are
11145ee3e8c14Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
11146ee3e8c14Smrg# to write the compiler configuration to 'libtool'.
11147ee3e8c14Smrgm4_defun([_LT_LANG_FC_CONFIG],
11148ee3e8c14Smrg[AC_LANG_PUSH(Fortran)
11149191cded7Smrg
11150ee3e8c14Smrgif test -z "$FC" || test no = "$FC"; then
11151ee3e8c14Smrg  _lt_disable_FC=yes
11152d9dcd5aeSmrgfi
11153ba064abeSmrg
11154ee3e8c14Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11155ee3e8c14Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
11156ee3e8c14Smrg_LT_TAGVAR(always_export_symbols, $1)=no
11157ee3e8c14Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
11158ee3e8c14Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11159ee3e8c14Smrg_LT_TAGVAR(hardcode_direct, $1)=no
11160ee3e8c14Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11161ee3e8c14Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11162ee3e8c14Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
11163ee3e8c14Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
11164ee3e8c14Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
11165ee3e8c14Smrg_LT_TAGVAR(inherit_rpath, $1)=no
11166ee3e8c14Smrg_LT_TAGVAR(module_cmds, $1)=
11167ee3e8c14Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
11168ee3e8c14Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
11169ee3e8c14Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11170ee3e8c14Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11171ee3e8c14Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11172ee3e8c14Smrg_LT_TAGVAR(no_undefined_flag, $1)=
11173ee3e8c14Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
11174ee3e8c14Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11175ba064abeSmrg
11176ee3e8c14Smrg# Source file extension for fc test sources.
11177ee3e8c14Smrgac_ext=${ac_fc_srcext-f}
11178ee3e8c14Smrg
11179ee3e8c14Smrg# Object file extension for compiled fc test sources.
11180ee3e8c14Smrgobjext=o
11181ee3e8c14Smrg_LT_TAGVAR(objext, $1)=$objext
11182ba064abeSmrg
11183ee3e8c14Smrg# No sense in running all these tests if we already determined that
11184ee3e8c14Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
11185ee3e8c14Smrg# are currently assumed to apply to all compilers on this platform,
11186ee3e8c14Smrg# and will be corrupted by setting them based on a non-working compiler.
11187ee3e8c14Smrgif test yes != "$_lt_disable_FC"; then
11188ee3e8c14Smrg  # Code to be used in simple compile tests
11189ee3e8c14Smrg  lt_simple_compile_test_code="\
11190ee3e8c14Smrg      subroutine t
11191ee3e8c14Smrg      return
11192ee3e8c14Smrg      end
11193ee3e8c14Smrg"
11194ba064abeSmrg
11195ee3e8c14Smrg  # Code to be used in simple link tests
11196ee3e8c14Smrg  lt_simple_link_test_code="\
11197ee3e8c14Smrg      program t
11198ee3e8c14Smrg      end
11199ee3e8c14Smrg"
11200ba064abeSmrg
11201ee3e8c14Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11202ee3e8c14Smrg  _LT_TAG_COMPILER
11203ba064abeSmrg
11204ee3e8c14Smrg  # save warnings/boilerplate of simple test code
11205ee3e8c14Smrg  _LT_COMPILER_BOILERPLATE
11206ee3e8c14Smrg  _LT_LINKER_BOILERPLATE
11207ba064abeSmrg
11208ee3e8c14Smrg  # Allow CC to be a program name with arguments.
11209ee3e8c14Smrg  lt_save_CC=$CC
11210ee3e8c14Smrg  lt_save_GCC=$GCC
11211ee3e8c14Smrg  lt_save_CFLAGS=$CFLAGS
11212ee3e8c14Smrg  CC=${FC-"f95"}
11213ee3e8c14Smrg  CFLAGS=$FCFLAGS
11214ee3e8c14Smrg  compiler=$CC
11215ee3e8c14Smrg  GCC=$ac_cv_fc_compiler_gnu
11216ba064abeSmrg
11217ee3e8c14Smrg  _LT_TAGVAR(compiler, $1)=$CC
11218ee3e8c14Smrg  _LT_CC_BASENAME([$compiler])
11219b290cf36Smrg
11220ee3e8c14Smrg  if test -n "$compiler"; then
11221ee3e8c14Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
11222ee3e8c14Smrg    AC_MSG_RESULT([$can_build_shared])
11223191cded7Smrg
11224ee3e8c14Smrg    AC_MSG_CHECKING([whether to build shared libraries])
11225ee3e8c14Smrg    test no = "$can_build_shared" && enable_shared=no
11226191cded7Smrg
11227ee3e8c14Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
11228ee3e8c14Smrg    # are all built from PIC.
11229ee3e8c14Smrg    case $host_os in
11230ee3e8c14Smrg      aix3*)
11231ee3e8c14Smrg        test yes = "$enable_shared" && enable_static=no
11232ee3e8c14Smrg        if test -n "$RANLIB"; then
11233ee3e8c14Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11234ee3e8c14Smrg          postinstall_cmds='$RANLIB $lib'
11235ee3e8c14Smrg        fi
11236ee3e8c14Smrg        ;;
11237ee3e8c14Smrg      aix[[4-9]]*)
11238ee3e8c14Smrg	if test ia64 != "$host_cpu"; then
11239ee3e8c14Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11240ee3e8c14Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
11241ee3e8c14Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11242ee3e8c14Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11243ee3e8c14Smrg	  esac
11244ee3e8c14Smrg	fi
11245ee3e8c14Smrg        ;;
11246ee3e8c14Smrg    esac
11247ee3e8c14Smrg    AC_MSG_RESULT([$enable_shared])
11248191cded7Smrg
11249ee3e8c14Smrg    AC_MSG_CHECKING([whether to build static libraries])
11250ee3e8c14Smrg    # Make sure either enable_shared or enable_static is yes.
11251ee3e8c14Smrg    test yes = "$enable_shared" || enable_static=yes
11252ee3e8c14Smrg    AC_MSG_RESULT([$enable_static])
11253191cded7Smrg
11254ee3e8c14Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
11255ee3e8c14Smrg    _LT_TAGVAR(LD, $1)=$LD
11256191cded7Smrg
11257ee3e8c14Smrg    ## CAVEAT EMPTOR:
11258ee3e8c14Smrg    ## There is no encapsulation within the following macros, do not change
11259ee3e8c14Smrg    ## the running order or otherwise move them around unless you know exactly
11260ee3e8c14Smrg    ## what you are doing...
11261ee3e8c14Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
11262ee3e8c14Smrg    _LT_COMPILER_PIC($1)
11263ee3e8c14Smrg    _LT_COMPILER_C_O($1)
11264ee3e8c14Smrg    _LT_COMPILER_FILE_LOCKS($1)
11265ee3e8c14Smrg    _LT_LINKER_SHLIBS($1)
11266ee3e8c14Smrg    _LT_SYS_DYNAMIC_LINKER($1)
11267ee3e8c14Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
11268b290cf36Smrg
11269ee3e8c14Smrg    _LT_CONFIG($1)
11270ee3e8c14Smrg  fi # test -n "$compiler"
11271191cded7Smrg
11272ee3e8c14Smrg  GCC=$lt_save_GCC
11273ee3e8c14Smrg  CC=$lt_save_CC
11274ee3e8c14Smrg  CFLAGS=$lt_save_CFLAGS
11275ee3e8c14Smrgfi # test yes != "$_lt_disable_FC"
11276191cded7Smrg
11277ee3e8c14SmrgAC_LANG_POP
11278ee3e8c14Smrg])# _LT_LANG_FC_CONFIG
11279b290cf36Smrg
11280b290cf36Smrg
11281ee3e8c14Smrg# _LT_LANG_GCJ_CONFIG([TAG])
11282ee3e8c14Smrg# --------------------------
11283ee3e8c14Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
11284ee3e8c14Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11285ee3e8c14Smrg# to write the compiler configuration to 'libtool'.
11286ee3e8c14Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
11287ee3e8c14Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
11288ee3e8c14SmrgAC_LANG_SAVE
11289191cded7Smrg
11290ee3e8c14Smrg# Source file extension for Java test sources.
11291ee3e8c14Smrgac_ext=java
11292191cded7Smrg
11293ee3e8c14Smrg# Object file extension for compiled Java test sources.
11294ee3e8c14Smrgobjext=o
11295ee3e8c14Smrg_LT_TAGVAR(objext, $1)=$objext
11296191cded7Smrg
11297ee3e8c14Smrg# Code to be used in simple compile tests
11298ee3e8c14Smrglt_simple_compile_test_code="class foo {}"
11299191cded7Smrg
11300ee3e8c14Smrg# Code to be used in simple link tests
11301ee3e8c14Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
11302191cded7Smrg
11303ee3e8c14Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11304ee3e8c14Smrg_LT_TAG_COMPILER
11305191cded7Smrg
11306ee3e8c14Smrg# save warnings/boilerplate of simple test code
11307ee3e8c14Smrg_LT_COMPILER_BOILERPLATE
11308ee3e8c14Smrg_LT_LINKER_BOILERPLATE
11309191cded7Smrg
11310ee3e8c14Smrg# Allow CC to be a program name with arguments.
11311ee3e8c14Smrglt_save_CC=$CC
11312ee3e8c14Smrglt_save_CFLAGS=$CFLAGS
11313ee3e8c14Smrglt_save_GCC=$GCC
11314ee3e8c14SmrgGCC=yes
11315ee3e8c14SmrgCC=${GCJ-"gcj"}
11316ee3e8c14SmrgCFLAGS=$GCJFLAGS
11317ee3e8c14Smrgcompiler=$CC
11318ee3e8c14Smrg_LT_TAGVAR(compiler, $1)=$CC
11319ee3e8c14Smrg_LT_TAGVAR(LD, $1)=$LD
11320ee3e8c14Smrg_LT_CC_BASENAME([$compiler])
11321b290cf36Smrg
11322ee3e8c14Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
11323ee3e8c14Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11324ba064abeSmrg
11325ee3e8c14Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11326ee3e8c14Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11327ee3e8c14Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11328ee3e8c14Smrg
11329ee3e8c14Smrgif test -n "$compiler"; then
11330ee3e8c14Smrg  _LT_COMPILER_NO_RTTI($1)
11331ee3e8c14Smrg  _LT_COMPILER_PIC($1)
11332ee3e8c14Smrg  _LT_COMPILER_C_O($1)
11333ee3e8c14Smrg  _LT_COMPILER_FILE_LOCKS($1)
11334ee3e8c14Smrg  _LT_LINKER_SHLIBS($1)
11335ee3e8c14Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
11336ba064abeSmrg
11337ee3e8c14Smrg  _LT_CONFIG($1)
11338d9dcd5aeSmrgfi
11339191cded7Smrg
11340ee3e8c14SmrgAC_LANG_RESTORE
11341191cded7Smrg
11342ee3e8c14SmrgGCC=$lt_save_GCC
11343ee3e8c14SmrgCC=$lt_save_CC
11344ee3e8c14SmrgCFLAGS=$lt_save_CFLAGS
11345ee3e8c14Smrg])# _LT_LANG_GCJ_CONFIG
11346191cded7Smrg
11347191cded7Smrg
11348ee3e8c14Smrg# _LT_LANG_GO_CONFIG([TAG])
11349ee3e8c14Smrg# --------------------------
11350ee3e8c14Smrg# Ensure that the configuration variables for the GNU Go compiler
11351ee3e8c14Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11352ee3e8c14Smrg# to write the compiler configuration to 'libtool'.
11353ee3e8c14Smrgm4_defun([_LT_LANG_GO_CONFIG],
11354ee3e8c14Smrg[AC_REQUIRE([LT_PROG_GO])dnl
11355ee3e8c14SmrgAC_LANG_SAVE
11356191cded7Smrg
11357ee3e8c14Smrg# Source file extension for Go test sources.
11358ee3e8c14Smrgac_ext=go
11359191cded7Smrg
11360ee3e8c14Smrg# Object file extension for compiled Go test sources.
11361ee3e8c14Smrgobjext=o
11362ee3e8c14Smrg_LT_TAGVAR(objext, $1)=$objext
11363191cded7Smrg
11364ee3e8c14Smrg# Code to be used in simple compile tests
11365ee3e8c14Smrglt_simple_compile_test_code="package main; func main() { }"
11366191cded7Smrg
11367ee3e8c14Smrg# Code to be used in simple link tests
11368ee3e8c14Smrglt_simple_link_test_code='package main; func main() { }'
11369191cded7Smrg
11370ee3e8c14Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11371ee3e8c14Smrg_LT_TAG_COMPILER
11372191cded7Smrg
11373ee3e8c14Smrg# save warnings/boilerplate of simple test code
11374ee3e8c14Smrg_LT_COMPILER_BOILERPLATE
11375ee3e8c14Smrg_LT_LINKER_BOILERPLATE
11376191cded7Smrg
11377ee3e8c14Smrg# Allow CC to be a program name with arguments.
11378ee3e8c14Smrglt_save_CC=$CC
11379ee3e8c14Smrglt_save_CFLAGS=$CFLAGS
11380ee3e8c14Smrglt_save_GCC=$GCC
11381ee3e8c14SmrgGCC=yes
11382ee3e8c14SmrgCC=${GOC-"gccgo"}
11383ee3e8c14SmrgCFLAGS=$GOFLAGS
11384ee3e8c14Smrgcompiler=$CC
11385ee3e8c14Smrg_LT_TAGVAR(compiler, $1)=$CC
11386ee3e8c14Smrg_LT_TAGVAR(LD, $1)=$LD
11387ee3e8c14Smrg_LT_CC_BASENAME([$compiler])
11388191cded7Smrg
11389ee3e8c14Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
11390ee3e8c14Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11391ee3e8c14Smrg
11392ee3e8c14Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11393ee3e8c14Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11394ee3e8c14Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11395ee3e8c14Smrg
11396ee3e8c14Smrgif test -n "$compiler"; then
11397ee3e8c14Smrg  _LT_COMPILER_NO_RTTI($1)
11398ee3e8c14Smrg  _LT_COMPILER_PIC($1)
11399ee3e8c14Smrg  _LT_COMPILER_C_O($1)
11400ee3e8c14Smrg  _LT_COMPILER_FILE_LOCKS($1)
11401ee3e8c14Smrg  _LT_LINKER_SHLIBS($1)
11402ee3e8c14Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
11403ee3e8c14Smrg
11404ee3e8c14Smrg  _LT_CONFIG($1)
11405d9dcd5aeSmrgfi
11406ba064abeSmrg
11407ee3e8c14SmrgAC_LANG_RESTORE
11408ba064abeSmrg
11409ee3e8c14SmrgGCC=$lt_save_GCC
11410ee3e8c14SmrgCC=$lt_save_CC
11411ee3e8c14SmrgCFLAGS=$lt_save_CFLAGS
11412ee3e8c14Smrg])# _LT_LANG_GO_CONFIG
11413ba064abeSmrg
11414b290cf36Smrg
11415ee3e8c14Smrg# _LT_LANG_RC_CONFIG([TAG])
11416ee3e8c14Smrg# -------------------------
11417ee3e8c14Smrg# Ensure that the configuration variables for the Windows resource compiler
11418ee3e8c14Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11419ee3e8c14Smrg# to write the compiler configuration to 'libtool'.
11420ee3e8c14Smrgm4_defun([_LT_LANG_RC_CONFIG],
11421ee3e8c14Smrg[AC_REQUIRE([LT_PROG_RC])dnl
11422ee3e8c14SmrgAC_LANG_SAVE
11423b290cf36Smrg
11424ee3e8c14Smrg# Source file extension for RC test sources.
11425ee3e8c14Smrgac_ext=rc
1142658deefebSmrg
11427ee3e8c14Smrg# Object file extension for compiled RC test sources.
11428ee3e8c14Smrgobjext=o
11429ee3e8c14Smrg_LT_TAGVAR(objext, $1)=$objext
1143058deefebSmrg
11431ee3e8c14Smrg# Code to be used in simple compile tests
11432ee3e8c14Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
11433b290cf36Smrg
11434ee3e8c14Smrg# Code to be used in simple link tests
11435ee3e8c14Smrglt_simple_link_test_code=$lt_simple_compile_test_code
11436191cded7Smrg
11437ee3e8c14Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11438ee3e8c14Smrg_LT_TAG_COMPILER
11439ee3e8c14Smrg
11440ee3e8c14Smrg# save warnings/boilerplate of simple test code
11441ee3e8c14Smrg_LT_COMPILER_BOILERPLATE
11442ee3e8c14Smrg_LT_LINKER_BOILERPLATE
11443ee3e8c14Smrg
11444ee3e8c14Smrg# Allow CC to be a program name with arguments.
11445ee3e8c14Smrglt_save_CC=$CC
11446ee3e8c14Smrglt_save_CFLAGS=$CFLAGS
11447ee3e8c14Smrglt_save_GCC=$GCC
11448ee3e8c14SmrgGCC=
11449ee3e8c14SmrgCC=${RC-"windres"}
11450ee3e8c14SmrgCFLAGS=
11451ee3e8c14Smrgcompiler=$CC
11452ee3e8c14Smrg_LT_TAGVAR(compiler, $1)=$CC
11453ee3e8c14Smrg_LT_CC_BASENAME([$compiler])
11454ee3e8c14Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
11455191cded7Smrg
11456ee3e8c14Smrgif test -n "$compiler"; then
11457ee3e8c14Smrg  :
11458ee3e8c14Smrg  _LT_CONFIG($1)
11459d9dcd5aeSmrgfi
11460191cded7Smrg
11461ee3e8c14SmrgGCC=$lt_save_GCC
11462ee3e8c14SmrgAC_LANG_RESTORE
11463ee3e8c14SmrgCC=$lt_save_CC
11464ee3e8c14SmrgCFLAGS=$lt_save_CFLAGS
11465ee3e8c14Smrg])# _LT_LANG_RC_CONFIG
11466191cded7Smrg
11467b290cf36Smrg
11468ee3e8c14Smrg# LT_PROG_GCJ
11469ee3e8c14Smrg# -----------
11470ee3e8c14SmrgAC_DEFUN([LT_PROG_GCJ],
11471ee3e8c14Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
11472ee3e8c14Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
11473ee3e8c14Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
11474ee3e8c14Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
11475ee3e8c14Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
11476ee3e8c14Smrg])
11477b290cf36Smrg
11478ee3e8c14Smrg# Old name:
11479ee3e8c14SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
11480ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
11481ee3e8c14Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
11482191cded7Smrg
11483191cded7Smrg
11484ee3e8c14Smrg# LT_PROG_GO
11485ee3e8c14Smrg# ----------
11486ee3e8c14SmrgAC_DEFUN([LT_PROG_GO],
11487ee3e8c14Smrg[AC_CHECK_TOOL(GOC, gccgo,)
11488ee3e8c14Smrg])
11489ee3e8c14Smrg
11490ee3e8c14Smrg
11491ee3e8c14Smrg# LT_PROG_RC
11492ee3e8c14Smrg# ----------
11493ee3e8c14SmrgAC_DEFUN([LT_PROG_RC],
11494ee3e8c14Smrg[AC_CHECK_TOOL(RC, windres,)
11495ee3e8c14Smrg])
11496ee3e8c14Smrg
11497ee3e8c14Smrg# Old name:
11498ee3e8c14SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
11499ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
11500ee3e8c14Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
11501ee3e8c14Smrg
11502ee3e8c14Smrg
11503ee3e8c14Smrg# _LT_DECL_EGREP
11504ee3e8c14Smrg# --------------
11505ee3e8c14Smrg# If we don't have a new enough Autoconf to choose the best grep
11506ee3e8c14Smrg# available, choose the one first in the user's PATH.
11507ee3e8c14Smrgm4_defun([_LT_DECL_EGREP],
11508ee3e8c14Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
11509ee3e8c14SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
11510ee3e8c14Smrgtest -z "$GREP" && GREP=grep
11511ee3e8c14Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
11512ee3e8c14Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
11513ee3e8c14Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
11514ee3e8c14Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
11515ee3e8c14SmrgAC_SUBST([GREP])
11516ee3e8c14Smrg])
11517ee3e8c14Smrg
11518ee3e8c14Smrg
11519ee3e8c14Smrg# _LT_DECL_OBJDUMP
11520ee3e8c14Smrg# --------------
11521ee3e8c14Smrg# If we don't have a new enough Autoconf to choose the best objdump
11522ee3e8c14Smrg# available, choose the one first in the user's PATH.
11523ee3e8c14Smrgm4_defun([_LT_DECL_OBJDUMP],
11524ee3e8c14Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
11525ee3e8c14Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
11526ee3e8c14Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
11527ee3e8c14SmrgAC_SUBST([OBJDUMP])
11528ee3e8c14Smrg])
11529ee3e8c14Smrg
11530ee3e8c14Smrg# _LT_DECL_DLLTOOL
11531ee3e8c14Smrg# ----------------
11532ee3e8c14Smrg# Ensure DLLTOOL variable is set.
11533ee3e8c14Smrgm4_defun([_LT_DECL_DLLTOOL],
11534ee3e8c14Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
11535ee3e8c14Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
11536ee3e8c14Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
11537ee3e8c14SmrgAC_SUBST([DLLTOOL])
11538ee3e8c14Smrg])
11539ee3e8c14Smrg
11540ee3e8c14Smrg# _LT_DECL_FILECMD
11541ee3e8c14Smrg# ----------------
11542ee3e8c14Smrg# Check for a file(cmd) program that can be used to detect file type and magic
11543ee3e8c14Smrgm4_defun([_LT_DECL_FILECMD],
11544ee3e8c14Smrg[AC_CHECK_TOOL([FILECMD], [file], [:])
11545ee3e8c14Smrg_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
11546ee3e8c14Smrg])# _LD_DECL_FILECMD
11547ee3e8c14Smrg
11548ee3e8c14Smrg# _LT_DECL_SED
11549ee3e8c14Smrg# ------------
11550ee3e8c14Smrg# Check for a fully-functional sed program, that truncates
11551ee3e8c14Smrg# as few characters as possible.  Prefer GNU sed if found.
11552ee3e8c14Smrgm4_defun([_LT_DECL_SED],
11553ee3e8c14Smrg[AC_PROG_SED
11554ee3e8c14Smrgtest -z "$SED" && SED=sed
11555ee3e8c14SmrgXsed="$SED -e 1s/^X//"
11556ee3e8c14Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
11557ee3e8c14Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
11558ee3e8c14Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
11559ee3e8c14Smrg])# _LT_DECL_SED
11560ee3e8c14Smrg
11561ee3e8c14Smrgm4_ifndef([AC_PROG_SED], [
11562ee3e8c14Smrg# NOTE: This macro has been submitted for inclusion into   #
11563ee3e8c14Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
11564ee3e8c14Smrg#  a released version of Autoconf we should remove this    #
11565ee3e8c14Smrg#  macro and use it instead.                               #
11566ee3e8c14Smrg
11567ee3e8c14Smrgm4_defun([AC_PROG_SED],
11568ee3e8c14Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
11569ee3e8c14SmrgAC_CACHE_VAL(lt_cv_path_SED,
11570ee3e8c14Smrg[# Loop through the user's path and test for sed and gsed.
11571ee3e8c14Smrg# Then use that list of sed's as ones to test for truncation.
11572ee3e8c14Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11573ee3e8c14Smrgfor as_dir in $PATH
11574ee3e8c14Smrgdo
11575ee3e8c14Smrg  IFS=$as_save_IFS
11576ee3e8c14Smrg  test -z "$as_dir" && as_dir=.
11577ee3e8c14Smrg  for lt_ac_prog in sed gsed; do
11578ee3e8c14Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
11579ee3e8c14Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
11580ee3e8c14Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
11581ee3e8c14Smrg      fi
11582ee3e8c14Smrg    done
11583ee3e8c14Smrg  done
11584ee3e8c14Smrgdone
11585ee3e8c14SmrgIFS=$as_save_IFS
11586ee3e8c14Smrglt_ac_max=0
11587ee3e8c14Smrglt_ac_count=0
11588ee3e8c14Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
11589ee3e8c14Smrg# along with /bin/sed that truncates output.
11590ee3e8c14Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
11591ee3e8c14Smrg  test ! -f "$lt_ac_sed" && continue
11592ee3e8c14Smrg  cat /dev/null > conftest.in
11593ee3e8c14Smrg  lt_ac_count=0
11594ee3e8c14Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
11595ee3e8c14Smrg  # Check for GNU sed and select it if it is found.
11596ee3e8c14Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
11597ee3e8c14Smrg    lt_cv_path_SED=$lt_ac_sed
11598ee3e8c14Smrg    break
11599ee3e8c14Smrg  fi
11600ee3e8c14Smrg  while true; do
11601ee3e8c14Smrg    cat conftest.in conftest.in >conftest.tmp
11602ee3e8c14Smrg    mv conftest.tmp conftest.in
11603ee3e8c14Smrg    cp conftest.in conftest.nl
11604ee3e8c14Smrg    echo >>conftest.nl
11605ee3e8c14Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
11606ee3e8c14Smrg    cmp -s conftest.out conftest.nl || break
11607ee3e8c14Smrg    # 10000 chars as input seems more than enough
11608ee3e8c14Smrg    test 10 -lt "$lt_ac_count" && break
11609ee3e8c14Smrg    lt_ac_count=`expr $lt_ac_count + 1`
11610ee3e8c14Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
11611ee3e8c14Smrg      lt_ac_max=$lt_ac_count
11612ee3e8c14Smrg      lt_cv_path_SED=$lt_ac_sed
11613ee3e8c14Smrg    fi
11614ee3e8c14Smrg  done
11615ee3e8c14Smrgdone
11616ee3e8c14Smrg])
11617ee3e8c14SmrgSED=$lt_cv_path_SED
11618ee3e8c14SmrgAC_SUBST([SED])
11619ee3e8c14SmrgAC_MSG_RESULT([$SED])
11620ee3e8c14Smrg])#AC_PROG_SED
11621ee3e8c14Smrg])#m4_ifndef
1162258deefebSmrg
11623ee3e8c14Smrg# Old name:
11624ee3e8c14SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
11625ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
11626ee3e8c14Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
1162758deefebSmrg
11628b290cf36Smrg
11629ee3e8c14Smrg# _LT_CHECK_SHELL_FEATURES
11630ee3e8c14Smrg# ------------------------
11631ee3e8c14Smrg# Find out whether the shell is Bourne or XSI compatible,
11632ee3e8c14Smrg# or has some other useful features.
11633ee3e8c14Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
11634ee3e8c14Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
11635ee3e8c14Smrg  lt_unset=unset
11636d9dcd5aeSmrgelse
11637ee3e8c14Smrg  lt_unset=false
11638d9dcd5aeSmrgfi
11639ee3e8c14Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
11640191cded7Smrg
11641ee3e8c14Smrg# test EBCDIC or ASCII
11642ee3e8c14Smrgcase `echo X|tr X '\101'` in
11643ee3e8c14Smrg A) # ASCII based system
11644ee3e8c14Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
11645ee3e8c14Smrg  lt_SP2NL='tr \040 \012'
11646ee3e8c14Smrg  lt_NL2SP='tr \015\012 \040\040'
11647ee3e8c14Smrg  ;;
11648ee3e8c14Smrg *) # EBCDIC based system
11649ee3e8c14Smrg  lt_SP2NL='tr \100 \n'
11650ee3e8c14Smrg  lt_NL2SP='tr \r\n \100\100'
11651ee3e8c14Smrg  ;;
11652ee3e8c14Smrgesac
11653ee3e8c14Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
11654ee3e8c14Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
11655ee3e8c14Smrg])# _LT_CHECK_SHELL_FEATURES
11656191cded7Smrg
11657191cded7Smrg
11658ee3e8c14Smrg# _LT_PATH_CONVERSION_FUNCTIONS
11659ee3e8c14Smrg# -----------------------------
11660ee3e8c14Smrg# Determine what file name conversion functions should be used by
11661ee3e8c14Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
11662ee3e8c14Smrg# for certain cross-compile configurations and native mingw.
11663ee3e8c14Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
11664ee3e8c14Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11665ee3e8c14SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
11666ee3e8c14SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
11667ee3e8c14SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
11668ee3e8c14Smrg[case $host in
11669ee3e8c14Smrg  *-*-mingw* )
11670ee3e8c14Smrg    case $build in
11671ee3e8c14Smrg      *-*-mingw* ) # actually msys
11672ee3e8c14Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
11673ee3e8c14Smrg        ;;
11674ee3e8c14Smrg      *-*-cygwin* )
11675ee3e8c14Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
11676ee3e8c14Smrg        ;;
11677ee3e8c14Smrg      * ) # otherwise, assume *nix
11678ee3e8c14Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
11679ee3e8c14Smrg        ;;
11680ee3e8c14Smrg    esac
11681ee3e8c14Smrg    ;;
11682ee3e8c14Smrg  *-*-cygwin* )
11683ee3e8c14Smrg    case $build in
11684ee3e8c14Smrg      *-*-mingw* ) # actually msys
11685ee3e8c14Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
11686ee3e8c14Smrg        ;;
11687ee3e8c14Smrg      *-*-cygwin* )
11688ee3e8c14Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
11689ee3e8c14Smrg        ;;
11690ee3e8c14Smrg      * ) # otherwise, assume *nix
11691ee3e8c14Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
11692ee3e8c14Smrg        ;;
11693ee3e8c14Smrg    esac
11694ee3e8c14Smrg    ;;
11695ee3e8c14Smrg  * ) # unhandled hosts (and "normal" native builds)
11696ee3e8c14Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
11697ee3e8c14Smrg    ;;
11698ee3e8c14Smrgesac
11699ee3e8c14Smrg])
11700ee3e8c14Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
11701ee3e8c14SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
11702ee3e8c14Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
11703ee3e8c14Smrg         [0], [convert $build file names to $host format])dnl
11704ee3e8c14Smrg
11705ee3e8c14SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
11706ee3e8c14SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
11707ee3e8c14Smrg[#assume ordinary cross tools, or native build.
11708ee3e8c14Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
11709ee3e8c14Smrgcase $host in
11710ee3e8c14Smrg  *-*-mingw* )
11711ee3e8c14Smrg    case $build in
11712ee3e8c14Smrg      *-*-mingw* ) # actually msys
11713ee3e8c14Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
11714ee3e8c14Smrg        ;;
11715ee3e8c14Smrg    esac
11716ee3e8c14Smrg    ;;
11717ee3e8c14Smrgesac
11718ee3e8c14Smrg])
11719ee3e8c14Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
11720ee3e8c14SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
11721ee3e8c14Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
11722ee3e8c14Smrg         [0], [convert $build files to toolchain format])dnl
11723ee3e8c14Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
11724ba064abeSmrg
11725ee3e8c14Smrg# Helper functions for option handling.                    -*- Autoconf -*-
11726d9dcd5aeSmrg#
11727ee3e8c14Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
11728ee3e8c14Smrg#   Software Foundation, Inc.
11729ee3e8c14Smrg#   Written by Gary V. Vaughan, 2004
11730d9dcd5aeSmrg#
11731ee3e8c14Smrg# This file is free software; the Free Software Foundation gives
11732ee3e8c14Smrg# unlimited permission to copy and/or distribute it, with or without
11733ee3e8c14Smrg# modifications, as long as this notice is preserved.
11734191cded7Smrg
11735ee3e8c14Smrg# serial 8 ltoptions.m4
11736191cded7Smrg
11737ee3e8c14Smrg# This is to help aclocal find these macros, as it can't see m4_define.
11738ee3e8c14SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
11739ee3e8c14Smrg
11740ee3e8c14Smrg
11741ee3e8c14Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
11742ee3e8c14Smrg# ------------------------------------------
11743ee3e8c14Smrgm4_define([_LT_MANGLE_OPTION],
11744ee3e8c14Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
11745ee3e8c14Smrg
11746ee3e8c14Smrg
11747ee3e8c14Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
11748ee3e8c14Smrg# ---------------------------------------
11749ee3e8c14Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
11750ee3e8c14Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
11751ee3e8c14Smrg# saved as a flag.
11752ee3e8c14Smrgm4_define([_LT_SET_OPTION],
11753ee3e8c14Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
11754ee3e8c14Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
11755ee3e8c14Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
11756ee3e8c14Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
11757ee3e8c14Smrg])
11758ee3e8c14Smrg
11759ee3e8c14Smrg
11760ee3e8c14Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
11761ee3e8c14Smrg# ------------------------------------------------------------
11762ee3e8c14Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11763ee3e8c14Smrgm4_define([_LT_IF_OPTION],
11764ee3e8c14Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
11765ee3e8c14Smrg
11766ee3e8c14Smrg
11767ee3e8c14Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
11768ee3e8c14Smrg# -------------------------------------------------------
11769ee3e8c14Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
11770ee3e8c14Smrg# are set.
11771ee3e8c14Smrgm4_define([_LT_UNLESS_OPTIONS],
11772ee3e8c14Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11773ee3e8c14Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
11774ee3e8c14Smrg		      [m4_define([$0_found])])])[]dnl
11775ee3e8c14Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
11776ee3e8c14Smrg])[]dnl
11777ee3e8c14Smrg])
11778ee3e8c14Smrg
11779ee3e8c14Smrg
11780ee3e8c14Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
11781d9dcd5aeSmrg# ----------------------------------------
11782ee3e8c14Smrg# OPTION-LIST is a space-separated list of Libtool options associated
11783ee3e8c14Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
11784ee3e8c14Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
11785ee3e8c14Smrg# the unknown option and exit.
11786ee3e8c14Smrgm4_defun([_LT_SET_OPTIONS],
11787ee3e8c14Smrg[# Set options
11788ee3e8c14Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11789ee3e8c14Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
11790191cded7Smrg
11791ee3e8c14Smrgm4_if([$1],[LT_INIT],[
11792ee3e8c14Smrg  dnl
11793ee3e8c14Smrg  dnl Simply set some default values (i.e off) if boolean options were not
11794ee3e8c14Smrg  dnl specified:
11795ee3e8c14Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
11796ee3e8c14Smrg  ])
11797ee3e8c14Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
11798ee3e8c14Smrg  ])
11799ee3e8c14Smrg  dnl
11800ee3e8c14Smrg  dnl If no reference was made to various pairs of opposing options, then
11801ee3e8c14Smrg  dnl we run the default mode handler for the pair.  For example, if neither
11802ee3e8c14Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
11803ee3e8c14Smrg  dnl archives by default:
11804ee3e8c14Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
11805ee3e8c14Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
11806ee3e8c14Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
11807ee3e8c14Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
11808ee3e8c14Smrg		   [_LT_ENABLE_FAST_INSTALL])
11809ee3e8c14Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
11810ee3e8c14Smrg		   [_LT_WITH_AIX_SONAME([aix])])
11811ee3e8c14Smrg  ])
11812ee3e8c14Smrg])# _LT_SET_OPTIONS
11813191cded7Smrg
11814191cded7Smrg
11815191cded7Smrg
11816ee3e8c14Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
11817ee3e8c14Smrg# -----------------------------------------
11818ee3e8c14Smrgm4_define([_LT_MANGLE_DEFUN],
11819ee3e8c14Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
11820ee3e8c14Smrg
11821ee3e8c14Smrg
11822ee3e8c14Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
11823ee3e8c14Smrg# -----------------------------------------------
11824ee3e8c14Smrgm4_define([LT_OPTION_DEFINE],
11825ee3e8c14Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
11826ee3e8c14Smrg])# LT_OPTION_DEFINE
11827ee3e8c14Smrg
11828ee3e8c14Smrg
11829ee3e8c14Smrg# dlopen
11830ee3e8c14Smrg# ------
11831ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
11832ee3e8c14Smrg])
11833ee3e8c14Smrg
11834ee3e8c14SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
11835ee3e8c14Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
11836ee3e8c14SmrgAC_DIAGNOSE([obsolete],
11837ee3e8c14Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
11838ee3e8c14Smrgput the 'dlopen' option into LT_INIT's first parameter.])
11839ee3e8c14Smrg])
11840ee3e8c14Smrg
11841ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
11842ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
11843ee3e8c14Smrg
11844ee3e8c14Smrg
11845ee3e8c14Smrg# win32-dll
11846ee3e8c14Smrg# ---------
11847ee3e8c14Smrg# Declare package support for building win32 dll's.
11848ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
11849ee3e8c14Smrg[enable_win32_dll=yes
11850ee3e8c14Smrg
11851ee3e8c14Smrgcase $host in
11852ee3e8c14Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
11853ee3e8c14Smrg  AC_CHECK_TOOL(AS, as, false)
11854ee3e8c14Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
11855ee3e8c14Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
11856ee3e8c14Smrg  ;;
11857ee3e8c14Smrgesac
11858ee3e8c14Smrg
11859ee3e8c14Smrgtest -z "$AS" && AS=as
11860ee3e8c14Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
11861ee3e8c14Smrg
11862ee3e8c14Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
11863ee3e8c14Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
11864ee3e8c14Smrg
11865ee3e8c14Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
11866ee3e8c14Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
11867ee3e8c14Smrg])# win32-dll
11868ee3e8c14Smrg
11869ee3e8c14SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
11870ee3e8c14Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11871ee3e8c14Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
11872ee3e8c14SmrgAC_DIAGNOSE([obsolete],
11873ee3e8c14Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
11874ee3e8c14Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
11875ee3e8c14Smrg])
11876ee3e8c14Smrg
11877ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
11878ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
11879191cded7Smrg
11880191cded7Smrg
11881ee3e8c14Smrg# _LT_ENABLE_SHARED([DEFAULT])
11882ee3e8c14Smrg# ----------------------------
11883ee3e8c14Smrg# implement the --enable-shared flag, and supports the 'shared' and
11884ee3e8c14Smrg# 'disable-shared' LT_INIT options.
11885ee3e8c14Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
11886ee3e8c14Smrgm4_define([_LT_ENABLE_SHARED],
11887ee3e8c14Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
11888ee3e8c14SmrgAC_ARG_ENABLE([shared],
11889ee3e8c14Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
11890ee3e8c14Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
11891ee3e8c14Smrg    [p=${PACKAGE-default}
11892ee3e8c14Smrg    case $enableval in
11893ee3e8c14Smrg    yes) enable_shared=yes ;;
11894ee3e8c14Smrg    no) enable_shared=no ;;
11895ee3e8c14Smrg    *)
11896ee3e8c14Smrg      enable_shared=no
11897ee3e8c14Smrg      # Look at the argument we got.  We use all the common list separators.
11898ee3e8c14Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
11899ee3e8c14Smrg      for pkg in $enableval; do
11900ee3e8c14Smrg	IFS=$lt_save_ifs
11901ee3e8c14Smrg	if test "X$pkg" = "X$p"; then
11902ee3e8c14Smrg	  enable_shared=yes
11903ee3e8c14Smrg	fi
11904ee3e8c14Smrg      done
11905ee3e8c14Smrg      IFS=$lt_save_ifs
11906ee3e8c14Smrg      ;;
11907ee3e8c14Smrg    esac],
11908ee3e8c14Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
11909191cded7Smrg
11910ee3e8c14Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
11911ee3e8c14Smrg	[Whether or not to build shared libraries])
11912ee3e8c14Smrg])# _LT_ENABLE_SHARED
11913191cded7Smrg
11914ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
11915ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
11916191cded7Smrg
11917ee3e8c14Smrg# Old names:
11918ee3e8c14SmrgAC_DEFUN([AC_ENABLE_SHARED],
11919ee3e8c14Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
11920ee3e8c14Smrg])
11921191cded7Smrg
11922ee3e8c14SmrgAC_DEFUN([AC_DISABLE_SHARED],
11923ee3e8c14Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
11924ee3e8c14Smrg])
11925191cded7Smrg
11926ee3e8c14SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
11927ee3e8c14SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
11928191cded7Smrg
11929ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
11930ee3e8c14Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
11931ee3e8c14Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
11932191cded7Smrg
11933b290cf36Smrg
11934b290cf36Smrg
11935ee3e8c14Smrg# _LT_ENABLE_STATIC([DEFAULT])
11936ee3e8c14Smrg# ----------------------------
11937ee3e8c14Smrg# implement the --enable-static flag, and support the 'static' and
11938ee3e8c14Smrg# 'disable-static' LT_INIT options.
11939ee3e8c14Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
11940ee3e8c14Smrgm4_define([_LT_ENABLE_STATIC],
11941ee3e8c14Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
11942ee3e8c14SmrgAC_ARG_ENABLE([static],
11943ee3e8c14Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
11944ee3e8c14Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
11945ee3e8c14Smrg    [p=${PACKAGE-default}
11946ee3e8c14Smrg    case $enableval in
11947ee3e8c14Smrg    yes) enable_static=yes ;;
11948ee3e8c14Smrg    no) enable_static=no ;;
11949ee3e8c14Smrg    *)
11950ee3e8c14Smrg     enable_static=no
11951ee3e8c14Smrg      # Look at the argument we got.  We use all the common list separators.
11952ee3e8c14Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
11953ee3e8c14Smrg      for pkg in $enableval; do
11954ee3e8c14Smrg	IFS=$lt_save_ifs
11955ee3e8c14Smrg	if test "X$pkg" = "X$p"; then
11956ee3e8c14Smrg	  enable_static=yes
11957ee3e8c14Smrg	fi
11958ee3e8c14Smrg      done
11959ee3e8c14Smrg      IFS=$lt_save_ifs
11960ee3e8c14Smrg      ;;
11961ee3e8c14Smrg    esac],
11962ee3e8c14Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
11963191cded7Smrg
11964ee3e8c14Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
11965ee3e8c14Smrg	[Whether or not to build static libraries])
11966ee3e8c14Smrg])# _LT_ENABLE_STATIC
11967191cded7Smrg
11968ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
11969ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
11970191cded7Smrg
11971ee3e8c14Smrg# Old names:
11972ee3e8c14SmrgAC_DEFUN([AC_ENABLE_STATIC],
11973ee3e8c14Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
11974ee3e8c14Smrg])
11975191cded7Smrg
11976ee3e8c14SmrgAC_DEFUN([AC_DISABLE_STATIC],
11977ee3e8c14Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
11978ee3e8c14Smrg])
11979191cded7Smrg
11980ee3e8c14SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
11981ee3e8c14SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
11982191cded7Smrg
11983ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
11984ee3e8c14Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
11985ee3e8c14Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
11986191cded7Smrg
11987b290cf36Smrg
11988191cded7Smrg
11989ee3e8c14Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
11990ee3e8c14Smrg# ----------------------------------
11991ee3e8c14Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
11992ee3e8c14Smrg# and 'disable-fast-install' LT_INIT options.
11993ee3e8c14Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
11994ee3e8c14Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
11995ee3e8c14Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
11996ee3e8c14SmrgAC_ARG_ENABLE([fast-install],
11997ee3e8c14Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
11998ee3e8c14Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
11999ee3e8c14Smrg    [p=${PACKAGE-default}
12000ee3e8c14Smrg    case $enableval in
12001ee3e8c14Smrg    yes) enable_fast_install=yes ;;
12002ee3e8c14Smrg    no) enable_fast_install=no ;;
12003ee3e8c14Smrg    *)
12004ee3e8c14Smrg      enable_fast_install=no
12005ee3e8c14Smrg      # Look at the argument we got.  We use all the common list separators.
12006ee3e8c14Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12007ee3e8c14Smrg      for pkg in $enableval; do
12008ee3e8c14Smrg	IFS=$lt_save_ifs
12009ee3e8c14Smrg	if test "X$pkg" = "X$p"; then
12010ee3e8c14Smrg	  enable_fast_install=yes
12011ee3e8c14Smrg	fi
12012ee3e8c14Smrg      done
12013ee3e8c14Smrg      IFS=$lt_save_ifs
12014ee3e8c14Smrg      ;;
12015ee3e8c14Smrg    esac],
12016ee3e8c14Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
12017191cded7Smrg
12018ee3e8c14Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
12019ee3e8c14Smrg	 [Whether or not to optimize for fast installation])dnl
12020ee3e8c14Smrg])# _LT_ENABLE_FAST_INSTALL
12021b290cf36Smrg
12022ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
12023ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
12024ba064abeSmrg
12025ee3e8c14Smrg# Old names:
12026ee3e8c14SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
12027ee3e8c14Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
12028ee3e8c14SmrgAC_DIAGNOSE([obsolete],
12029ee3e8c14Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
12030ee3e8c14Smrgthe 'fast-install' option into LT_INIT's first parameter.])
12031ee3e8c14Smrg])
12032ba064abeSmrg
12033ee3e8c14SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
12034ee3e8c14Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
12035ee3e8c14SmrgAC_DIAGNOSE([obsolete],
12036ee3e8c14Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
12037ee3e8c14Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
12038ee3e8c14Smrg])
12039d9dcd5aeSmrg
12040ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
12041ee3e8c14Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
12042ee3e8c14Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
12043ba064abeSmrg
12044d9dcd5aeSmrg
12045ee3e8c14Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
12046ee3e8c14Smrg# ----------------------------------
12047ee3e8c14Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
12048ee3e8c14Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
12049ee3e8c14Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
12050ee3e8c14Smrgm4_define([_LT_WITH_AIX_SONAME],
12051ee3e8c14Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
12052ee3e8c14Smrgshared_archive_member_spec=
12053ee3e8c14Smrgcase $host,$enable_shared in
12054ee3e8c14Smrgpower*-*-aix[[5-9]]*,yes)
12055ee3e8c14Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
12056ee3e8c14Smrg  AC_ARG_WITH([aix-soname],
12057ee3e8c14Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
12058ee3e8c14Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
12059ee3e8c14Smrg    [case $withval in
12060ee3e8c14Smrg    aix|svr4|both)
12061ee3e8c14Smrg      ;;
12062ee3e8c14Smrg    *)
12063ee3e8c14Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
12064ee3e8c14Smrg      ;;
12065ee3e8c14Smrg    esac
12066ee3e8c14Smrg    lt_cv_with_aix_soname=$with_aix_soname],
12067ee3e8c14Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
12068ee3e8c14Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
12069ee3e8c14Smrg    with_aix_soname=$lt_cv_with_aix_soname])
12070ee3e8c14Smrg  AC_MSG_RESULT([$with_aix_soname])
12071ee3e8c14Smrg  if test aix != "$with_aix_soname"; then
12072ee3e8c14Smrg    # For the AIX way of multilib, we name the shared archive member
12073ee3e8c14Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
12074ee3e8c14Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
12075ee3e8c14Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
12076ee3e8c14Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
12077ee3e8c14Smrg    if test 64 = "${OBJECT_MODE-32}"; then
12078ee3e8c14Smrg      shared_archive_member_spec=shr_64
12079ee3e8c14Smrg    else
12080ee3e8c14Smrg      shared_archive_member_spec=shr
12081ee3e8c14Smrg    fi
12082ee3e8c14Smrg  fi
12083ee3e8c14Smrg  ;;
12084ee3e8c14Smrg*)
12085ee3e8c14Smrg  with_aix_soname=aix
12086ee3e8c14Smrg  ;;
12087ee3e8c14Smrgesac
12088d9dcd5aeSmrg
12089ee3e8c14Smrg_LT_DECL([], [shared_archive_member_spec], [0],
12090ee3e8c14Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
12091ee3e8c14Smrg])# _LT_WITH_AIX_SONAME
12092191cded7Smrg
12093ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
12094ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
12095ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
12096d9dcd5aeSmrg
12097191cded7Smrg
12098ee3e8c14Smrg# _LT_WITH_PIC([MODE])
12099ee3e8c14Smrg# --------------------
12100ee3e8c14Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
12101ee3e8c14Smrg# LT_INIT options.
12102ee3e8c14Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
12103ee3e8c14Smrgm4_define([_LT_WITH_PIC],
12104ee3e8c14Smrg[AC_ARG_WITH([pic],
12105ee3e8c14Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
12106ee3e8c14Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
12107ee3e8c14Smrg    [lt_p=${PACKAGE-default}
12108ee3e8c14Smrg    case $withval in
12109ee3e8c14Smrg    yes|no) pic_mode=$withval ;;
12110ee3e8c14Smrg    *)
12111ee3e8c14Smrg      pic_mode=default
12112ee3e8c14Smrg      # Look at the argument we got.  We use all the common list separators.
12113ee3e8c14Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12114ee3e8c14Smrg      for lt_pkg in $withval; do
12115ee3e8c14Smrg	IFS=$lt_save_ifs
12116ee3e8c14Smrg	if test "X$lt_pkg" = "X$lt_p"; then
12117ee3e8c14Smrg	  pic_mode=yes
12118ee3e8c14Smrg	fi
12119ee3e8c14Smrg      done
12120ee3e8c14Smrg      IFS=$lt_save_ifs
12121ee3e8c14Smrg      ;;
12122ee3e8c14Smrg    esac],
12123ee3e8c14Smrg    [pic_mode=m4_default([$1], [default])])
12124191cded7Smrg
12125ee3e8c14Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
12126ee3e8c14Smrg])# _LT_WITH_PIC
12127d9dcd5aeSmrg
12128ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
12129ee3e8c14SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
12130d9dcd5aeSmrg
12131ee3e8c14Smrg# Old name:
12132ee3e8c14SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
12133ee3e8c14Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
12134ee3e8c14SmrgAC_DIAGNOSE([obsolete],
12135ee3e8c14Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
12136ee3e8c14Smrgput the 'pic-only' option into LT_INIT's first parameter.])
12137ee3e8c14Smrg])
12138d9dcd5aeSmrg
12139ee3e8c14Smrgdnl aclocal-1.4 backwards compatibility:
12140ee3e8c14Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
12141d9dcd5aeSmrg
12142d9dcd5aeSmrg
12143ee3e8c14Smrgm4_define([_LTDL_MODE], [])
12144ee3e8c14SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
12145ee3e8c14Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
12146ee3e8c14SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
12147ee3e8c14Smrg		 [m4_define([_LTDL_MODE], [recursive])])
12148ee3e8c14SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
12149ee3e8c14Smrg		 [m4_define([_LTDL_MODE], [subproject])])
12150191cded7Smrg
12151ee3e8c14Smrgm4_define([_LTDL_TYPE], [])
12152ee3e8c14SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
12153ee3e8c14Smrg		 [m4_define([_LTDL_TYPE], [installable])])
12154ee3e8c14SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
12155ee3e8c14Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
12156ee3e8c14Smrg
12157ee3e8c14Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
12158d9dcd5aeSmrg#
12159ee3e8c14Smrg# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
12160ee3e8c14Smrg# Foundation, Inc.
12161ee3e8c14Smrg# Written by Gary V. Vaughan, 2004
12162d9dcd5aeSmrg#
12163ee3e8c14Smrg# This file is free software; the Free Software Foundation gives
12164ee3e8c14Smrg# unlimited permission to copy and/or distribute it, with or without
12165ee3e8c14Smrg# modifications, as long as this notice is preserved.
12166d9dcd5aeSmrg
12167ee3e8c14Smrg# serial 6 ltsugar.m4
12168d9dcd5aeSmrg
12169ee3e8c14Smrg# This is to help aclocal find these macros, as it can't see m4_define.
12170ee3e8c14SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
12171191cded7Smrg
12172d9dcd5aeSmrg
12173ee3e8c14Smrg# lt_join(SEP, ARG1, [ARG2...])
12174ee3e8c14Smrg# -----------------------------
12175ee3e8c14Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
12176ee3e8c14Smrg# associated separator.
12177ee3e8c14Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
12178ee3e8c14Smrg# versions in m4sugar had bugs.
12179ee3e8c14Smrgm4_define([lt_join],
12180ee3e8c14Smrg[m4_if([$#], [1], [],
12181ee3e8c14Smrg       [$#], [2], [[$2]],
12182ee3e8c14Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
12183ee3e8c14Smrgm4_define([_lt_join],
12184ee3e8c14Smrg[m4_if([$#$2], [2], [],
12185ee3e8c14Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
12186191cded7Smrg
12187d9dcd5aeSmrg
12188ee3e8c14Smrg# lt_car(LIST)
12189ee3e8c14Smrg# lt_cdr(LIST)
12190ee3e8c14Smrg# ------------
12191ee3e8c14Smrg# Manipulate m4 lists.
12192ee3e8c14Smrg# These macros are necessary as long as will still need to support
12193ee3e8c14Smrg# Autoconf-2.59, which quotes differently.
12194ee3e8c14Smrgm4_define([lt_car], [[$1]])
12195ee3e8c14Smrgm4_define([lt_cdr],
12196ee3e8c14Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
12197ee3e8c14Smrg       [$#], 1, [],
12198ee3e8c14Smrg       [m4_dquote(m4_shift($@))])])
12199ee3e8c14Smrgm4_define([lt_unquote], $1)
12200d9dcd5aeSmrg
12201d9dcd5aeSmrg
12202ee3e8c14Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
12203ee3e8c14Smrg# ------------------------------------------
12204ee3e8c14Smrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
12205ee3e8c14Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
12206ee3e8c14Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
12207ee3e8c14Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
12208ee3e8c14Smrg# than defined and empty).
12209ee3e8c14Smrg#
12210ee3e8c14Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
12211ee3e8c14Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
12212ee3e8c14Smrgm4_define([lt_append],
12213ee3e8c14Smrg[m4_define([$1],
12214ee3e8c14Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
12215ba064abeSmrg
12216ba064abeSmrg
12217191cded7Smrg
12218ee3e8c14Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
12219ee3e8c14Smrg# ----------------------------------------------------------
12220ee3e8c14Smrg# Produce a SEP delimited list of all paired combinations of elements of
12221ee3e8c14Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
12222ee3e8c14Smrg# has the form PREFIXmINFIXSUFFIXn.
12223ee3e8c14Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
12224ee3e8c14Smrgm4_define([lt_combine],
12225ee3e8c14Smrg[m4_if(m4_eval([$# > 3]), [1],
12226ee3e8c14Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
12227ee3e8c14Smrg[[m4_foreach([_Lt_prefix], [$2],
12228ee3e8c14Smrg	     [m4_foreach([_Lt_suffix],
12229ee3e8c14Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
12230ee3e8c14Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
12231ee3e8c14Smrg
12232ee3e8c14Smrg
12233ee3e8c14Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
12234ee3e8c14Smrg# -----------------------------------------------------------------------
12235ee3e8c14Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
12236ee3e8c14Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
12237ee3e8c14Smrgm4_define([lt_if_append_uniq],
12238ee3e8c14Smrg[m4_ifdef([$1],
12239ee3e8c14Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
12240ee3e8c14Smrg		 [lt_append([$1], [$2], [$3])$4],
12241ee3e8c14Smrg		 [$5])],
12242ee3e8c14Smrg	  [lt_append([$1], [$2], [$3])$4])])
12243ee3e8c14Smrg
12244ee3e8c14Smrg
12245ee3e8c14Smrg# lt_dict_add(DICT, KEY, VALUE)
12246ee3e8c14Smrg# -----------------------------
12247ee3e8c14Smrgm4_define([lt_dict_add],
12248ee3e8c14Smrg[m4_define([$1($2)], [$3])])
12249ee3e8c14Smrg
12250b290cf36Smrg
12251ee3e8c14Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
12252ee3e8c14Smrg# --------------------------------------------
12253ee3e8c14Smrgm4_define([lt_dict_add_subkey],
12254ee3e8c14Smrg[m4_define([$1($2:$3)], [$4])])
12255191cded7Smrg
12256ba064abeSmrg
12257ee3e8c14Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
12258ee3e8c14Smrg# ----------------------------------
12259ee3e8c14Smrgm4_define([lt_dict_fetch],
12260ee3e8c14Smrg[m4_ifval([$3],
12261ee3e8c14Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
12262ee3e8c14Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
12263ba064abeSmrg
12264191cded7Smrg
12265ee3e8c14Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
12266ee3e8c14Smrg# -----------------------------------------------------------------
12267ee3e8c14Smrgm4_define([lt_if_dict_fetch],
12268ee3e8c14Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
12269ee3e8c14Smrg	[$5],
12270ee3e8c14Smrg    [$6])])
12271191cded7Smrg
12272d9dcd5aeSmrg
12273ee3e8c14Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
12274ee3e8c14Smrg# --------------------------------------------------------------
12275ee3e8c14Smrgm4_define([lt_dict_filter],
12276ee3e8c14Smrg[m4_if([$5], [], [],
12277ee3e8c14Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
12278ee3e8c14Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
12279ee3e8c14Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
12280ee3e8c14Smrg])
12281ee3e8c14Smrg
12282ee3e8c14Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
12283b290cf36Smrg#
12284ee3e8c14Smrg#   Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
12285ee3e8c14Smrg#   Inc.
12286ee3e8c14Smrg#   Written by Scott James Remnant, 2004
12287ba064abeSmrg#
12288ee3e8c14Smrg# This file is free software; the Free Software Foundation gives
12289ee3e8c14Smrg# unlimited permission to copy and/or distribute it, with or without
12290ee3e8c14Smrg# modifications, as long as this notice is preserved.
12291ba064abeSmrg
12292ee3e8c14Smrg# @configure_input@
1229358deefebSmrg
12294ee3e8c14Smrg# serial 4245 ltversion.m4
12295ee3e8c14Smrg# This file is part of GNU Libtool
12296ee3e8c14Smrg
12297ee3e8c14Smrgm4_define([LT_PACKAGE_VERSION], [2.4.7])
12298ee3e8c14Smrgm4_define([LT_PACKAGE_REVISION], [2.4.7])
12299ee3e8c14Smrg
12300ee3e8c14SmrgAC_DEFUN([LTVERSION_VERSION],
12301ee3e8c14Smrg[macro_version='2.4.7'
12302ee3e8c14Smrgmacro_revision='2.4.7'
12303ee3e8c14Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
12304ee3e8c14Smrg_LT_DECL(, macro_revision, 0)
12305d9dcd5aeSmrg])
12306ba064abeSmrg
12307ee3e8c14Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
12308d9dcd5aeSmrg#
12309ee3e8c14Smrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
12310ee3e8c14Smrg#   Software Foundation, Inc.
12311ee3e8c14Smrg#   Written by Scott James Remnant, 2004.
12312ee3e8c14Smrg#
12313ee3e8c14Smrg# This file is free software; the Free Software Foundation gives
12314ee3e8c14Smrg# unlimited permission to copy and/or distribute it, with or without
12315ee3e8c14Smrg# modifications, as long as this notice is preserved.
12316ee3e8c14Smrg
12317ee3e8c14Smrg# serial 5 lt~obsolete.m4
12318ee3e8c14Smrg
12319ee3e8c14Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
12320d9dcd5aeSmrg#
12321ee3e8c14Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
12322ee3e8c14Smrg# which have later been changed to m4_define as they aren't part of the
12323ee3e8c14Smrg# exported API, or moved to Autoconf or Automake where they belong.
12324d9dcd5aeSmrg#
12325ee3e8c14Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
12326ee3e8c14Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
12327ee3e8c14Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
12328ee3e8c14Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
12329ee3e8c14Smrg# and doesn't know about Autoconf macros at all.)
12330ee3e8c14Smrg#
12331ee3e8c14Smrg# So we provide this file, which has a silly filename so it's always
12332ee3e8c14Smrg# included after everything else.  This provides aclocal with the
12333ee3e8c14Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
12334ee3e8c14Smrg# because those macros already exist, or will be overwritten later.
12335ee3e8c14Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
12336ee3e8c14Smrg#
12337ee3e8c14Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
12338ee3e8c14Smrg# Yes, that means every name once taken will need to remain here until
12339ee3e8c14Smrg# we give up compatibility with versions before 1.7, at which point
12340ee3e8c14Smrg# we need to keep only those names which we still refer to.
12341ee3e8c14Smrg
12342ee3e8c14Smrg# This is to help aclocal find these macros, as it can't see m4_define.
12343ee3e8c14SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
12344ee3e8c14Smrg
12345ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
12346ee3e8c14Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
12347ee3e8c14Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
12348ee3e8c14Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
12349ee3e8c14Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
12350ee3e8c14Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
12351ee3e8c14Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
12352ee3e8c14Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
12353ee3e8c14Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
12354ee3e8c14Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
12355ee3e8c14Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
12356ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
12357ee3e8c14Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
12358ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
12359ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
12360ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
12361ee3e8c14Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
12362ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
12363ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
12364ee3e8c14Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
12365ee3e8c14Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
12366ee3e8c14Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
12367ee3e8c14Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
12368ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
12369ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
12370ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
12371ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
12372ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
12373ee3e8c14Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
12374ee3e8c14Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
12375ee3e8c14Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
12376ee3e8c14Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
12377ee3e8c14Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
12378ee3e8c14Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
12379ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
12380ee3e8c14Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
12381ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
12382ee3e8c14Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
12383ee3e8c14Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
12384ee3e8c14Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
12385ee3e8c14Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
12386ee3e8c14Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
12387ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
12388ee3e8c14Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
12389ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
12390ee3e8c14Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
12391ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
12392ee3e8c14Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
12393ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
12394ee3e8c14Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
12395ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
12396ee3e8c14Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
12397ee3e8c14Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
12398ee3e8c14Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
12399ee3e8c14Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
12400ee3e8c14Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
12401ee3e8c14Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
12402ee3e8c14Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
12403ee3e8c14Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
12404ee3e8c14Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
12405ee3e8c14Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
12406191cded7Smrg
12407