xref: /libev/aclocal.m4 (revision 93823e6c)
1*93823e6cSPaul Bohm# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
2e3a38431SPaul Bohm
3*93823e6cSPaul Bohm# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4*93823e6cSPaul Bohm
5e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
6e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
7e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
8e3a38431SPaul Bohm
9e3a38431SPaul Bohm# This program is distributed in the hope that it will be useful,
10e3a38431SPaul Bohm# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11e3a38431SPaul Bohm# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12e3a38431SPaul Bohm# PARTICULAR PURPOSE.
13e3a38431SPaul Bohm
14*93823e6cSPaul Bohmm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15e3a38431SPaul Bohmm4_ifndef([AC_AUTOCONF_VERSION],
16e3a38431SPaul Bohm  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17*93823e6cSPaul Bohmm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18*93823e6cSPaul Bohm[m4_warning([this file was generated for autoconf 2.69.
19e3a38431SPaul BohmYou have another version of autoconf.  It may work, but is not guaranteed to.
20e3a38431SPaul BohmIf you have problems, you may need to regenerate the build system entirely.
21*93823e6cSPaul BohmTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22e3a38431SPaul Bohm
23e3a38431SPaul Bohm# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24e3a38431SPaul Bohm#
25e3a38431SPaul Bohm#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
26*93823e6cSPaul Bohm#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
27*93823e6cSPaul Bohm#                 Foundation, Inc.
28e3a38431SPaul Bohm#   Written by Gordon Matzigkeit, 1996
29e3a38431SPaul Bohm#
30e3a38431SPaul Bohm# This file is free software; the Free Software Foundation gives
31e3a38431SPaul Bohm# unlimited permission to copy and/or distribute it, with or without
32e3a38431SPaul Bohm# modifications, as long as this notice is preserved.
33e3a38431SPaul Bohm
34e3a38431SPaul Bohmm4_define([_LT_COPYING], [dnl
35e3a38431SPaul Bohm#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
36*93823e6cSPaul Bohm#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
37*93823e6cSPaul Bohm#                 Foundation, Inc.
38e3a38431SPaul Bohm#   Written by Gordon Matzigkeit, 1996
39e3a38431SPaul Bohm#
40e3a38431SPaul Bohm#   This file is part of GNU Libtool.
41e3a38431SPaul Bohm#
42e3a38431SPaul Bohm# GNU Libtool is free software; you can redistribute it and/or
43e3a38431SPaul Bohm# modify it under the terms of the GNU General Public License as
44e3a38431SPaul Bohm# published by the Free Software Foundation; either version 2 of
45e3a38431SPaul Bohm# the License, or (at your option) any later version.
46e3a38431SPaul Bohm#
47e3a38431SPaul Bohm# As a special exception to the GNU General Public License,
48e3a38431SPaul Bohm# if you distribute this file as part of a program or library that
49e3a38431SPaul Bohm# is built using GNU Libtool, you may include this file under the
50e3a38431SPaul Bohm# same distribution terms that you use for the rest of that program.
51e3a38431SPaul Bohm#
52e3a38431SPaul Bohm# GNU Libtool is distributed in the hope that it will be useful,
53e3a38431SPaul Bohm# but WITHOUT ANY WARRANTY; without even the implied warranty of
54e3a38431SPaul Bohm# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
55e3a38431SPaul Bohm# GNU General Public License for more details.
56e3a38431SPaul Bohm#
57e3a38431SPaul Bohm# You should have received a copy of the GNU General Public License
58e3a38431SPaul Bohm# along with GNU Libtool; see the file COPYING.  If not, a copy
59e3a38431SPaul Bohm# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
60e3a38431SPaul Bohm# obtained by writing to the Free Software Foundation, Inc.,
61e3a38431SPaul Bohm# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
62e3a38431SPaul Bohm])
63e3a38431SPaul Bohm
64*93823e6cSPaul Bohm# serial 57 LT_INIT
65e3a38431SPaul Bohm
66e3a38431SPaul Bohm
67e3a38431SPaul Bohm# LT_PREREQ(VERSION)
68e3a38431SPaul Bohm# ------------------
69e3a38431SPaul Bohm# Complain and exit if this libtool version is less that VERSION.
70e3a38431SPaul Bohmm4_defun([LT_PREREQ],
71e3a38431SPaul Bohm[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
72e3a38431SPaul Bohm       [m4_default([$3],
73e3a38431SPaul Bohm		   [m4_fatal([Libtool version $1 or higher is required],
74e3a38431SPaul Bohm		             63)])],
75e3a38431SPaul Bohm       [$2])])
76e3a38431SPaul Bohm
77e3a38431SPaul Bohm
78e3a38431SPaul Bohm# _LT_CHECK_BUILDDIR
79e3a38431SPaul Bohm# ------------------
80e3a38431SPaul Bohm# Complain if the absolute build directory name contains unusual characters
81e3a38431SPaul Bohmm4_defun([_LT_CHECK_BUILDDIR],
82e3a38431SPaul Bohm[case `pwd` in
83e3a38431SPaul Bohm  *\ * | *\	*)
84e3a38431SPaul Bohm    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
85e3a38431SPaul Bohmesac
86e3a38431SPaul Bohm])
87e3a38431SPaul Bohm
88e3a38431SPaul Bohm
89e3a38431SPaul Bohm# LT_INIT([OPTIONS])
90e3a38431SPaul Bohm# ------------------
91e3a38431SPaul BohmAC_DEFUN([LT_INIT],
92e3a38431SPaul Bohm[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
93*93823e6cSPaul BohmAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
94e3a38431SPaul BohmAC_BEFORE([$0], [LT_LANG])dnl
95e3a38431SPaul BohmAC_BEFORE([$0], [LT_OUTPUT])dnl
96e3a38431SPaul BohmAC_BEFORE([$0], [LTDL_INIT])dnl
97e3a38431SPaul Bohmm4_require([_LT_CHECK_BUILDDIR])dnl
98e3a38431SPaul Bohm
99e3a38431SPaul Bohmdnl Autoconf doesn't catch unexpanded LT_ macros by default:
100e3a38431SPaul Bohmm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
101e3a38431SPaul Bohmm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
102e3a38431SPaul Bohmdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
103e3a38431SPaul Bohmdnl unless we require an AC_DEFUNed macro:
104e3a38431SPaul BohmAC_REQUIRE([LTOPTIONS_VERSION])dnl
105e3a38431SPaul BohmAC_REQUIRE([LTSUGAR_VERSION])dnl
106e3a38431SPaul BohmAC_REQUIRE([LTVERSION_VERSION])dnl
107e3a38431SPaul BohmAC_REQUIRE([LTOBSOLETE_VERSION])dnl
108e3a38431SPaul Bohmm4_require([_LT_PROG_LTMAIN])dnl
109e3a38431SPaul Bohm
110*93823e6cSPaul Bohm_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111*93823e6cSPaul Bohm
112e3a38431SPaul Bohmdnl Parse OPTIONS
113e3a38431SPaul Bohm_LT_SET_OPTIONS([$0], [$1])
114e3a38431SPaul Bohm
115e3a38431SPaul Bohm# This can be used to rebuild libtool when needed
116e3a38431SPaul BohmLIBTOOL_DEPS="$ltmain"
117e3a38431SPaul Bohm
118e3a38431SPaul Bohm# Always use our own libtool.
119e3a38431SPaul BohmLIBTOOL='$(SHELL) $(top_builddir)/libtool'
120e3a38431SPaul BohmAC_SUBST(LIBTOOL)dnl
121e3a38431SPaul Bohm
122e3a38431SPaul Bohm_LT_SETUP
123e3a38431SPaul Bohm
124e3a38431SPaul Bohm# Only expand once:
125e3a38431SPaul Bohmm4_define([LT_INIT])
126e3a38431SPaul Bohm])# LT_INIT
127e3a38431SPaul Bohm
128e3a38431SPaul Bohm# Old names:
129e3a38431SPaul BohmAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
130e3a38431SPaul BohmAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
131e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
132e3a38431SPaul Bohmdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
133e3a38431SPaul Bohmdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134e3a38431SPaul Bohm
135e3a38431SPaul Bohm
136e3a38431SPaul Bohm# _LT_CC_BASENAME(CC)
137e3a38431SPaul Bohm# -------------------
138e3a38431SPaul Bohm# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
139e3a38431SPaul Bohmm4_defun([_LT_CC_BASENAME],
140e3a38431SPaul Bohm[for cc_temp in $1""; do
141e3a38431SPaul Bohm  case $cc_temp in
142e3a38431SPaul Bohm    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
143e3a38431SPaul Bohm    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
144e3a38431SPaul Bohm    \-*) ;;
145e3a38431SPaul Bohm    *) break;;
146e3a38431SPaul Bohm  esac
147e3a38431SPaul Bohmdone
148*93823e6cSPaul Bohmcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
149e3a38431SPaul Bohm])
150e3a38431SPaul Bohm
151e3a38431SPaul Bohm
152e3a38431SPaul Bohm# _LT_FILEUTILS_DEFAULTS
153e3a38431SPaul Bohm# ----------------------
154e3a38431SPaul Bohm# It is okay to use these file commands and assume they have been set
155e3a38431SPaul Bohm# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
156e3a38431SPaul Bohmm4_defun([_LT_FILEUTILS_DEFAULTS],
157e3a38431SPaul Bohm[: ${CP="cp -f"}
158e3a38431SPaul Bohm: ${MV="mv -f"}
159e3a38431SPaul Bohm: ${RM="rm -f"}
160e3a38431SPaul Bohm])# _LT_FILEUTILS_DEFAULTS
161e3a38431SPaul Bohm
162e3a38431SPaul Bohm
163e3a38431SPaul Bohm# _LT_SETUP
164e3a38431SPaul Bohm# ---------
165e3a38431SPaul Bohmm4_defun([_LT_SETUP],
166e3a38431SPaul Bohm[AC_REQUIRE([AC_CANONICAL_HOST])dnl
167e3a38431SPaul BohmAC_REQUIRE([AC_CANONICAL_BUILD])dnl
168*93823e6cSPaul BohmAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
169*93823e6cSPaul BohmAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170*93823e6cSPaul Bohm
171*93823e6cSPaul Bohm_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
172*93823e6cSPaul Bohmdnl
173e3a38431SPaul Bohm_LT_DECL([], [host_alias], [0], [The host system])dnl
174e3a38431SPaul Bohm_LT_DECL([], [host], [0])dnl
175e3a38431SPaul Bohm_LT_DECL([], [host_os], [0])dnl
176e3a38431SPaul Bohmdnl
177e3a38431SPaul Bohm_LT_DECL([], [build_alias], [0], [The build system])dnl
178e3a38431SPaul Bohm_LT_DECL([], [build], [0])dnl
179e3a38431SPaul Bohm_LT_DECL([], [build_os], [0])dnl
180e3a38431SPaul Bohmdnl
181e3a38431SPaul BohmAC_REQUIRE([AC_PROG_CC])dnl
182e3a38431SPaul BohmAC_REQUIRE([LT_PATH_LD])dnl
183e3a38431SPaul BohmAC_REQUIRE([LT_PATH_NM])dnl
184e3a38431SPaul Bohmdnl
185e3a38431SPaul BohmAC_REQUIRE([AC_PROG_LN_S])dnl
186e3a38431SPaul Bohmtest -z "$LN_S" && LN_S="ln -s"
187e3a38431SPaul Bohm_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
188e3a38431SPaul Bohmdnl
189e3a38431SPaul BohmAC_REQUIRE([LT_CMD_MAX_LEN])dnl
190e3a38431SPaul Bohm_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
191e3a38431SPaul Bohm_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
192e3a38431SPaul Bohmdnl
193e3a38431SPaul Bohmm4_require([_LT_FILEUTILS_DEFAULTS])dnl
194e3a38431SPaul Bohmm4_require([_LT_CHECK_SHELL_FEATURES])dnl
195*93823e6cSPaul Bohmm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
196e3a38431SPaul Bohmm4_require([_LT_CMD_RELOAD])dnl
197e3a38431SPaul Bohmm4_require([_LT_CHECK_MAGIC_METHOD])dnl
198*93823e6cSPaul Bohmm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
199e3a38431SPaul Bohmm4_require([_LT_CMD_OLD_ARCHIVE])dnl
200e3a38431SPaul Bohmm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
201*93823e6cSPaul Bohmm4_require([_LT_WITH_SYSROOT])dnl
202e3a38431SPaul Bohm
203e3a38431SPaul Bohm_LT_CONFIG_LIBTOOL_INIT([
204e3a38431SPaul Bohm# See if we are running on zsh, and set the options which allow our
205e3a38431SPaul Bohm# commands through without removal of \ escapes INIT.
206e3a38431SPaul Bohmif test -n "\${ZSH_VERSION+set}" ; then
207e3a38431SPaul Bohm   setopt NO_GLOB_SUBST
208e3a38431SPaul Bohmfi
209e3a38431SPaul Bohm])
210e3a38431SPaul Bohmif test -n "${ZSH_VERSION+set}" ; then
211e3a38431SPaul Bohm   setopt NO_GLOB_SUBST
212e3a38431SPaul Bohmfi
213e3a38431SPaul Bohm
214e3a38431SPaul Bohm_LT_CHECK_OBJDIR
215e3a38431SPaul Bohm
216e3a38431SPaul Bohmm4_require([_LT_TAG_COMPILER])dnl
217e3a38431SPaul Bohm
218e3a38431SPaul Bohmcase $host_os in
219e3a38431SPaul Bohmaix3*)
220e3a38431SPaul Bohm  # AIX sometimes has problems with the GCC collect2 program.  For some
221e3a38431SPaul Bohm  # reason, if we set the COLLECT_NAMES environment variable, the problems
222e3a38431SPaul Bohm  # vanish in a puff of smoke.
223e3a38431SPaul Bohm  if test "X${COLLECT_NAMES+set}" != Xset; then
224e3a38431SPaul Bohm    COLLECT_NAMES=
225e3a38431SPaul Bohm    export COLLECT_NAMES
226e3a38431SPaul Bohm  fi
227e3a38431SPaul Bohm  ;;
228e3a38431SPaul Bohmesac
229e3a38431SPaul Bohm
230e3a38431SPaul Bohm# Global variables:
231e3a38431SPaul Bohmofile=libtool
232e3a38431SPaul Bohmcan_build_shared=yes
233e3a38431SPaul Bohm
234e3a38431SPaul Bohm# All known linkers require a `.a' archive for static linking (except MSVC,
235e3a38431SPaul Bohm# which needs '.lib').
236e3a38431SPaul Bohmlibext=a
237e3a38431SPaul Bohm
238e3a38431SPaul Bohmwith_gnu_ld="$lt_cv_prog_gnu_ld"
239e3a38431SPaul Bohm
240e3a38431SPaul Bohmold_CC="$CC"
241e3a38431SPaul Bohmold_CFLAGS="$CFLAGS"
242e3a38431SPaul Bohm
243e3a38431SPaul Bohm# Set sane defaults for various variables
244e3a38431SPaul Bohmtest -z "$CC" && CC=cc
245e3a38431SPaul Bohmtest -z "$LTCC" && LTCC=$CC
246e3a38431SPaul Bohmtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
247e3a38431SPaul Bohmtest -z "$LD" && LD=ld
248e3a38431SPaul Bohmtest -z "$ac_objext" && ac_objext=o
249e3a38431SPaul Bohm
250e3a38431SPaul Bohm_LT_CC_BASENAME([$compiler])
251e3a38431SPaul Bohm
252e3a38431SPaul Bohm# Only perform the check for file, if the check method requires it
253e3a38431SPaul Bohmtest -z "$MAGIC_CMD" && MAGIC_CMD=file
254e3a38431SPaul Bohmcase $deplibs_check_method in
255e3a38431SPaul Bohmfile_magic*)
256e3a38431SPaul Bohm  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
257e3a38431SPaul Bohm    _LT_PATH_MAGIC
258e3a38431SPaul Bohm  fi
259e3a38431SPaul Bohm  ;;
260e3a38431SPaul Bohmesac
261e3a38431SPaul Bohm
262e3a38431SPaul Bohm# Use C for the default configuration in the libtool script
263e3a38431SPaul BohmLT_SUPPORTED_TAG([CC])
264e3a38431SPaul Bohm_LT_LANG_C_CONFIG
265e3a38431SPaul Bohm_LT_LANG_DEFAULT_CONFIG
266e3a38431SPaul Bohm_LT_CONFIG_COMMANDS
267e3a38431SPaul Bohm])# _LT_SETUP
268e3a38431SPaul Bohm
269e3a38431SPaul Bohm
270*93823e6cSPaul Bohm# _LT_PREPARE_SED_QUOTE_VARS
271*93823e6cSPaul Bohm# --------------------------
272*93823e6cSPaul Bohm# Define a few sed substitution that help us do robust quoting.
273*93823e6cSPaul Bohmm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
274*93823e6cSPaul Bohm[# Backslashify metacharacters that are still active within
275*93823e6cSPaul Bohm# double-quoted strings.
276*93823e6cSPaul Bohmsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
277*93823e6cSPaul Bohm
278*93823e6cSPaul Bohm# Same as above, but do not quote variable references.
279*93823e6cSPaul Bohmdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
280*93823e6cSPaul Bohm
281*93823e6cSPaul Bohm# Sed substitution to delay expansion of an escaped shell variable in a
282*93823e6cSPaul Bohm# double_quote_subst'ed string.
283*93823e6cSPaul Bohmdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
284*93823e6cSPaul Bohm
285*93823e6cSPaul Bohm# Sed substitution to delay expansion of an escaped single quote.
286*93823e6cSPaul Bohmdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
287*93823e6cSPaul Bohm
288*93823e6cSPaul Bohm# Sed substitution to avoid accidental globbing in evaled expressions
289*93823e6cSPaul Bohmno_glob_subst='s/\*/\\\*/g'
290*93823e6cSPaul Bohm])
291*93823e6cSPaul Bohm
292e3a38431SPaul Bohm# _LT_PROG_LTMAIN
293e3a38431SPaul Bohm# ---------------
294e3a38431SPaul Bohm# Note that this code is called both from `configure', and `config.status'
295e3a38431SPaul Bohm# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
296e3a38431SPaul Bohm# `config.status' has no value for ac_aux_dir unless we are using Automake,
297e3a38431SPaul Bohm# so we pass a copy along to make sure it has a sensible value anyway.
298e3a38431SPaul Bohmm4_defun([_LT_PROG_LTMAIN],
299e3a38431SPaul Bohm[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
300e3a38431SPaul Bohm_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
301e3a38431SPaul Bohmltmain="$ac_aux_dir/ltmain.sh"
302e3a38431SPaul Bohm])# _LT_PROG_LTMAIN
303e3a38431SPaul Bohm
304e3a38431SPaul Bohm
305e3a38431SPaul Bohm
306e3a38431SPaul Bohm# So that we can recreate a full libtool script including additional
307e3a38431SPaul Bohm# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
308e3a38431SPaul Bohm# in macros and then make a single call at the end using the `libtool'
309e3a38431SPaul Bohm# label.
310e3a38431SPaul Bohm
311e3a38431SPaul Bohm
312e3a38431SPaul Bohm# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
313e3a38431SPaul Bohm# ----------------------------------------
314e3a38431SPaul Bohm# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
315e3a38431SPaul Bohmm4_define([_LT_CONFIG_LIBTOOL_INIT],
316e3a38431SPaul Bohm[m4_ifval([$1],
317e3a38431SPaul Bohm          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
318e3a38431SPaul Bohm                     [$1
319e3a38431SPaul Bohm])])])
320e3a38431SPaul Bohm
321e3a38431SPaul Bohm# Initialize.
322e3a38431SPaul Bohmm4_define([_LT_OUTPUT_LIBTOOL_INIT])
323e3a38431SPaul Bohm
324e3a38431SPaul Bohm
325e3a38431SPaul Bohm# _LT_CONFIG_LIBTOOL([COMMANDS])
326e3a38431SPaul Bohm# ------------------------------
327e3a38431SPaul Bohm# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
328e3a38431SPaul Bohmm4_define([_LT_CONFIG_LIBTOOL],
329e3a38431SPaul Bohm[m4_ifval([$1],
330e3a38431SPaul Bohm          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
331e3a38431SPaul Bohm                     [$1
332e3a38431SPaul Bohm])])])
333e3a38431SPaul Bohm
334e3a38431SPaul Bohm# Initialize.
335e3a38431SPaul Bohmm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
336e3a38431SPaul Bohm
337e3a38431SPaul Bohm
338e3a38431SPaul Bohm# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
339e3a38431SPaul Bohm# -----------------------------------------------------
340e3a38431SPaul Bohmm4_defun([_LT_CONFIG_SAVE_COMMANDS],
341e3a38431SPaul Bohm[_LT_CONFIG_LIBTOOL([$1])
342e3a38431SPaul Bohm_LT_CONFIG_LIBTOOL_INIT([$2])
343e3a38431SPaul Bohm])
344e3a38431SPaul Bohm
345e3a38431SPaul Bohm
346e3a38431SPaul Bohm# _LT_FORMAT_COMMENT([COMMENT])
347e3a38431SPaul Bohm# -----------------------------
348e3a38431SPaul Bohm# Add leading comment marks to the start of each line, and a trailing
349e3a38431SPaul Bohm# full-stop to the whole comment if one is not present already.
350e3a38431SPaul Bohmm4_define([_LT_FORMAT_COMMENT],
351e3a38431SPaul Bohm[m4_ifval([$1], [
352e3a38431SPaul Bohmm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
353e3a38431SPaul Bohm              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
354e3a38431SPaul Bohm)])
355e3a38431SPaul Bohm
356e3a38431SPaul Bohm
357e3a38431SPaul Bohm
358e3a38431SPaul Bohm
359e3a38431SPaul Bohm
360e3a38431SPaul Bohm# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
361e3a38431SPaul Bohm# -------------------------------------------------------------------
362e3a38431SPaul Bohm# CONFIGNAME is the name given to the value in the libtool script.
363e3a38431SPaul Bohm# VARNAME is the (base) name used in the configure script.
364e3a38431SPaul Bohm# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
365e3a38431SPaul Bohm# VARNAME.  Any other value will be used directly.
366e3a38431SPaul Bohmm4_define([_LT_DECL],
367e3a38431SPaul Bohm[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
368e3a38431SPaul Bohm    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
369e3a38431SPaul Bohm	[m4_ifval([$1], [$1], [$2])])
370e3a38431SPaul Bohm    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
371e3a38431SPaul Bohm    m4_ifval([$4],
372e3a38431SPaul Bohm	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
373e3a38431SPaul Bohm    lt_dict_add_subkey([lt_decl_dict], [$2],
374e3a38431SPaul Bohm	[tagged?], [m4_ifval([$5], [yes], [no])])])
375e3a38431SPaul Bohm])
376e3a38431SPaul Bohm
377e3a38431SPaul Bohm
378e3a38431SPaul Bohm# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
379e3a38431SPaul Bohm# --------------------------------------------------------
380e3a38431SPaul Bohmm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381e3a38431SPaul Bohm
382e3a38431SPaul Bohm
383e3a38431SPaul Bohm# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
384e3a38431SPaul Bohm# ------------------------------------------------
385e3a38431SPaul Bohmm4_define([lt_decl_tag_varnames],
386e3a38431SPaul Bohm[_lt_decl_filter([tagged?], [yes], $@)])
387e3a38431SPaul Bohm
388e3a38431SPaul Bohm
389e3a38431SPaul Bohm# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
390e3a38431SPaul Bohm# ---------------------------------------------------------
391e3a38431SPaul Bohmm4_define([_lt_decl_filter],
392e3a38431SPaul Bohm[m4_case([$#],
393e3a38431SPaul Bohm  [0], [m4_fatal([$0: too few arguments: $#])],
394e3a38431SPaul Bohm  [1], [m4_fatal([$0: too few arguments: $#: $1])],
395e3a38431SPaul Bohm  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
396e3a38431SPaul Bohm  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
397e3a38431SPaul Bohm  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
398e3a38431SPaul Bohm])
399e3a38431SPaul Bohm
400e3a38431SPaul Bohm
401e3a38431SPaul Bohm# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
402e3a38431SPaul Bohm# --------------------------------------------------
403e3a38431SPaul Bohmm4_define([lt_decl_quote_varnames],
404e3a38431SPaul Bohm[_lt_decl_filter([value], [1], $@)])
405e3a38431SPaul Bohm
406e3a38431SPaul Bohm
407e3a38431SPaul Bohm# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
408e3a38431SPaul Bohm# ---------------------------------------------------
409e3a38431SPaul Bohmm4_define([lt_decl_dquote_varnames],
410e3a38431SPaul Bohm[_lt_decl_filter([value], [2], $@)])
411e3a38431SPaul Bohm
412e3a38431SPaul Bohm
413e3a38431SPaul Bohm# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
414e3a38431SPaul Bohm# ---------------------------------------------------
415e3a38431SPaul Bohmm4_define([lt_decl_varnames_tagged],
416e3a38431SPaul Bohm[m4_assert([$# <= 2])dnl
417e3a38431SPaul Bohm_$0(m4_quote(m4_default([$1], [[, ]])),
418e3a38431SPaul Bohm    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
419e3a38431SPaul Bohm    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
420e3a38431SPaul Bohmm4_define([_lt_decl_varnames_tagged],
421e3a38431SPaul Bohm[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
422e3a38431SPaul Bohm
423e3a38431SPaul Bohm
424e3a38431SPaul Bohm# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
425e3a38431SPaul Bohm# ------------------------------------------------
426e3a38431SPaul Bohmm4_define([lt_decl_all_varnames],
427e3a38431SPaul Bohm[_$0(m4_quote(m4_default([$1], [[, ]])),
428e3a38431SPaul Bohm     m4_if([$2], [],
429e3a38431SPaul Bohm	   m4_quote(lt_decl_varnames),
430e3a38431SPaul Bohm	m4_quote(m4_shift($@))))[]dnl
431e3a38431SPaul Bohm])
432e3a38431SPaul Bohmm4_define([_lt_decl_all_varnames],
433e3a38431SPaul Bohm[lt_join($@, lt_decl_varnames_tagged([$1],
434e3a38431SPaul Bohm			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
435e3a38431SPaul Bohm])
436e3a38431SPaul Bohm
437e3a38431SPaul Bohm
438e3a38431SPaul Bohm# _LT_CONFIG_STATUS_DECLARE([VARNAME])
439e3a38431SPaul Bohm# ------------------------------------
440e3a38431SPaul Bohm# Quote a variable value, and forward it to `config.status' so that its
441e3a38431SPaul Bohm# declaration there will have the same value as in `configure'.  VARNAME
442e3a38431SPaul Bohm# must have a single quote delimited value for this to work.
443e3a38431SPaul Bohmm4_define([_LT_CONFIG_STATUS_DECLARE],
444*93823e6cSPaul Bohm[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445e3a38431SPaul Bohm
446e3a38431SPaul Bohm
447e3a38431SPaul Bohm# _LT_CONFIG_STATUS_DECLARATIONS
448e3a38431SPaul Bohm# ------------------------------
449e3a38431SPaul Bohm# We delimit libtool config variables with single quotes, so when
450e3a38431SPaul Bohm# we write them to config.status, we have to be sure to quote all
451e3a38431SPaul Bohm# embedded single quotes properly.  In configure, this macro expands
452e3a38431SPaul Bohm# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
453e3a38431SPaul Bohm#
454*93823e6cSPaul Bohm#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
455e3a38431SPaul Bohmm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
456e3a38431SPaul Bohm[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
457e3a38431SPaul Bohm    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458e3a38431SPaul Bohm
459e3a38431SPaul Bohm
460e3a38431SPaul Bohm# _LT_LIBTOOL_TAGS
461e3a38431SPaul Bohm# ----------------
462e3a38431SPaul Bohm# Output comment and list of tags supported by the script
463e3a38431SPaul Bohmm4_defun([_LT_LIBTOOL_TAGS],
464e3a38431SPaul Bohm[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
465e3a38431SPaul Bohmavailable_tags="_LT_TAGS"dnl
466e3a38431SPaul Bohm])
467e3a38431SPaul Bohm
468e3a38431SPaul Bohm
469e3a38431SPaul Bohm# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
470e3a38431SPaul Bohm# -----------------------------------
471e3a38431SPaul Bohm# Extract the dictionary values for VARNAME (optionally with TAG) and
472e3a38431SPaul Bohm# expand to a commented shell variable setting:
473e3a38431SPaul Bohm#
474e3a38431SPaul Bohm#    # Some comment about what VAR is for.
475e3a38431SPaul Bohm#    visible_name=$lt_internal_name
476e3a38431SPaul Bohmm4_define([_LT_LIBTOOL_DECLARE],
477e3a38431SPaul Bohm[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
478e3a38431SPaul Bohm					   [description])))[]dnl
479e3a38431SPaul Bohmm4_pushdef([_libtool_name],
480e3a38431SPaul Bohm    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
481e3a38431SPaul Bohmm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
482e3a38431SPaul Bohm    [0], [_libtool_name=[$]$1],
483e3a38431SPaul Bohm    [1], [_libtool_name=$lt_[]$1],
484e3a38431SPaul Bohm    [2], [_libtool_name=$lt_[]$1],
485e3a38431SPaul Bohm    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
486e3a38431SPaul Bohmm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
487e3a38431SPaul Bohm])
488e3a38431SPaul Bohm
489e3a38431SPaul Bohm
490e3a38431SPaul Bohm# _LT_LIBTOOL_CONFIG_VARS
491e3a38431SPaul Bohm# -----------------------
492e3a38431SPaul Bohm# Produce commented declarations of non-tagged libtool config variables
493e3a38431SPaul Bohm# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
494e3a38431SPaul Bohm# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
495e3a38431SPaul Bohm# section) are produced by _LT_LIBTOOL_TAG_VARS.
496e3a38431SPaul Bohmm4_defun([_LT_LIBTOOL_CONFIG_VARS],
497e3a38431SPaul Bohm[m4_foreach([_lt_var],
498e3a38431SPaul Bohm    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
499e3a38431SPaul Bohm    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
500e3a38431SPaul Bohm
501e3a38431SPaul Bohm
502e3a38431SPaul Bohm# _LT_LIBTOOL_TAG_VARS(TAG)
503e3a38431SPaul Bohm# -------------------------
504e3a38431SPaul Bohmm4_define([_LT_LIBTOOL_TAG_VARS],
505e3a38431SPaul Bohm[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
506e3a38431SPaul Bohm    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507e3a38431SPaul Bohm
508e3a38431SPaul Bohm
509e3a38431SPaul Bohm# _LT_TAGVAR(VARNAME, [TAGNAME])
510e3a38431SPaul Bohm# ------------------------------
511e3a38431SPaul Bohmm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512e3a38431SPaul Bohm
513e3a38431SPaul Bohm
514e3a38431SPaul Bohm# _LT_CONFIG_COMMANDS
515e3a38431SPaul Bohm# -------------------
516e3a38431SPaul Bohm# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
517e3a38431SPaul Bohm# variables for single and double quote escaping we saved from calls
518e3a38431SPaul Bohm# to _LT_DECL, we can put quote escaped variables declarations
519e3a38431SPaul Bohm# into `config.status', and then the shell code to quote escape them in
520e3a38431SPaul Bohm# for loops in `config.status'.  Finally, any additional code accumulated
521e3a38431SPaul Bohm# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
522e3a38431SPaul Bohmm4_defun([_LT_CONFIG_COMMANDS],
523e3a38431SPaul Bohm[AC_PROVIDE_IFELSE([LT_OUTPUT],
524e3a38431SPaul Bohm	dnl If the libtool generation code has been placed in $CONFIG_LT,
525e3a38431SPaul Bohm	dnl instead of duplicating it all over again into config.status,
526e3a38431SPaul Bohm	dnl then we will have config.status run $CONFIG_LT later, so it
527e3a38431SPaul Bohm	dnl needs to know what name is stored there:
528e3a38431SPaul Bohm        [AC_CONFIG_COMMANDS([libtool],
529e3a38431SPaul Bohm            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
530e3a38431SPaul Bohm    dnl If the libtool generation code is destined for config.status,
531e3a38431SPaul Bohm    dnl expand the accumulated commands and init code now:
532e3a38431SPaul Bohm    [AC_CONFIG_COMMANDS([libtool],
533e3a38431SPaul Bohm        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
534e3a38431SPaul Bohm])#_LT_CONFIG_COMMANDS
535e3a38431SPaul Bohm
536e3a38431SPaul Bohm
537e3a38431SPaul Bohm# Initialize.
538e3a38431SPaul Bohmm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
539e3a38431SPaul Bohm[
540e3a38431SPaul Bohm
541e3a38431SPaul Bohm# The HP-UX ksh and POSIX shell print the target directory to stdout
542e3a38431SPaul Bohm# if CDPATH is set.
543e3a38431SPaul Bohm(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544e3a38431SPaul Bohm
545e3a38431SPaul Bohmsed_quote_subst='$sed_quote_subst'
546e3a38431SPaul Bohmdouble_quote_subst='$double_quote_subst'
547e3a38431SPaul Bohmdelay_variable_subst='$delay_variable_subst'
548e3a38431SPaul Bohm_LT_CONFIG_STATUS_DECLARATIONS
549e3a38431SPaul BohmLTCC='$LTCC'
550e3a38431SPaul BohmLTCFLAGS='$LTCFLAGS'
551e3a38431SPaul Bohmcompiler='$compiler_DEFAULT'
552e3a38431SPaul Bohm
553*93823e6cSPaul Bohm# A function that is used when there is no print builtin or printf.
554*93823e6cSPaul Bohmfunc_fallback_echo ()
555*93823e6cSPaul Bohm{
556*93823e6cSPaul Bohm  eval 'cat <<_LTECHO_EOF
557*93823e6cSPaul Bohm\$[]1
558*93823e6cSPaul Bohm_LTECHO_EOF'
559*93823e6cSPaul Bohm}
560*93823e6cSPaul Bohm
561e3a38431SPaul Bohm# Quote evaled strings.
562e3a38431SPaul Bohmfor var in lt_decl_all_varnames([[ \
563e3a38431SPaul Bohm]], lt_decl_quote_varnames); do
564*93823e6cSPaul Bohm    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
565e3a38431SPaul Bohm    *[[\\\\\\\`\\"\\\$]]*)
566*93823e6cSPaul Bohm      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
567e3a38431SPaul Bohm      ;;
568e3a38431SPaul Bohm    *)
569e3a38431SPaul Bohm      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
570e3a38431SPaul Bohm      ;;
571e3a38431SPaul Bohm    esac
572e3a38431SPaul Bohmdone
573e3a38431SPaul Bohm
574e3a38431SPaul Bohm# Double-quote double-evaled strings.
575e3a38431SPaul Bohmfor var in lt_decl_all_varnames([[ \
576e3a38431SPaul Bohm]], lt_decl_dquote_varnames); do
577*93823e6cSPaul Bohm    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
578e3a38431SPaul Bohm    *[[\\\\\\\`\\"\\\$]]*)
579*93823e6cSPaul Bohm      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
580e3a38431SPaul Bohm      ;;
581e3a38431SPaul Bohm    *)
582e3a38431SPaul Bohm      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
583e3a38431SPaul Bohm      ;;
584e3a38431SPaul Bohm    esac
585e3a38431SPaul Bohmdone
586e3a38431SPaul Bohm
587e3a38431SPaul Bohm_LT_OUTPUT_LIBTOOL_INIT
588e3a38431SPaul Bohm])
589e3a38431SPaul Bohm
590*93823e6cSPaul Bohm# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
591*93823e6cSPaul Bohm# ------------------------------------
592*93823e6cSPaul Bohm# Generate a child script FILE with all initialization necessary to
593*93823e6cSPaul Bohm# reuse the environment learned by the parent script, and make the
594*93823e6cSPaul Bohm# file executable.  If COMMENT is supplied, it is inserted after the
595*93823e6cSPaul Bohm# `#!' sequence but before initialization text begins.  After this
596*93823e6cSPaul Bohm# macro, additional text can be appended to FILE to form the body of
597*93823e6cSPaul Bohm# the child script.  The macro ends with non-zero status if the
598*93823e6cSPaul Bohm# file could not be fully written (such as if the disk is full).
599*93823e6cSPaul Bohmm4_ifdef([AS_INIT_GENERATED],
600*93823e6cSPaul Bohm[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
601*93823e6cSPaul Bohm[m4_defun([_LT_GENERATED_FILE_INIT],
602*93823e6cSPaul Bohm[m4_require([AS_PREPARE])]dnl
603*93823e6cSPaul Bohm[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
604*93823e6cSPaul Bohm[lt_write_fail=0
605*93823e6cSPaul Bohmcat >$1 <<_ASEOF || lt_write_fail=1
606*93823e6cSPaul Bohm#! $SHELL
607*93823e6cSPaul Bohm# Generated by $as_me.
608*93823e6cSPaul Bohm$2
609*93823e6cSPaul BohmSHELL=\${CONFIG_SHELL-$SHELL}
610*93823e6cSPaul Bohmexport SHELL
611*93823e6cSPaul Bohm_ASEOF
612*93823e6cSPaul Bohmcat >>$1 <<\_ASEOF || lt_write_fail=1
613*93823e6cSPaul BohmAS_SHELL_SANITIZE
614*93823e6cSPaul Bohm_AS_PREPARE
615*93823e6cSPaul Bohmexec AS_MESSAGE_FD>&1
616*93823e6cSPaul Bohm_ASEOF
617*93823e6cSPaul Bohmtest $lt_write_fail = 0 && chmod +x $1[]dnl
618*93823e6cSPaul Bohmm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619e3a38431SPaul Bohm
620e3a38431SPaul Bohm# LT_OUTPUT
621e3a38431SPaul Bohm# ---------
622e3a38431SPaul Bohm# This macro allows early generation of the libtool script (before
623e3a38431SPaul Bohm# AC_OUTPUT is called), incase it is used in configure for compilation
624e3a38431SPaul Bohm# tests.
625e3a38431SPaul BohmAC_DEFUN([LT_OUTPUT],
626e3a38431SPaul Bohm[: ${CONFIG_LT=./config.lt}
627e3a38431SPaul BohmAC_MSG_NOTICE([creating $CONFIG_LT])
628*93823e6cSPaul Bohm_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
629*93823e6cSPaul Bohm[# Run this file to recreate a libtool stub with the current configuration.])
630e3a38431SPaul Bohm
631e3a38431SPaul Bohmcat >>"$CONFIG_LT" <<\_LTEOF
632*93823e6cSPaul Bohmlt_cl_silent=false
633e3a38431SPaul Bohmexec AS_MESSAGE_LOG_FD>>config.log
634e3a38431SPaul Bohm{
635e3a38431SPaul Bohm  echo
636e3a38431SPaul Bohm  AS_BOX([Running $as_me.])
637e3a38431SPaul Bohm} >&AS_MESSAGE_LOG_FD
638e3a38431SPaul Bohm
639e3a38431SPaul Bohmlt_cl_help="\
640e3a38431SPaul Bohm\`$as_me' creates a local libtool stub from the current configuration,
641e3a38431SPaul Bohmfor use in further configure time tests before the real libtool is
642e3a38431SPaul Bohmgenerated.
643e3a38431SPaul Bohm
644e3a38431SPaul BohmUsage: $[0] [[OPTIONS]]
645e3a38431SPaul Bohm
646e3a38431SPaul Bohm  -h, --help      print this help, then exit
647e3a38431SPaul Bohm  -V, --version   print version number, then exit
648e3a38431SPaul Bohm  -q, --quiet     do not print progress messages
649e3a38431SPaul Bohm  -d, --debug     don't remove temporary files
650e3a38431SPaul Bohm
651e3a38431SPaul BohmReport bugs to <[email protected]>."
652e3a38431SPaul Bohm
653e3a38431SPaul Bohmlt_cl_version="\
654e3a38431SPaul Bohmm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
655e3a38431SPaul Bohmm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
656e3a38431SPaul Bohmconfigured by $[0], generated by m4_PACKAGE_STRING.
657e3a38431SPaul Bohm
658*93823e6cSPaul BohmCopyright (C) 2011 Free Software Foundation, Inc.
659e3a38431SPaul BohmThis config.lt script is free software; the Free Software Foundation
660e3a38431SPaul Bohmgives unlimited permision to copy, distribute and modify it."
661e3a38431SPaul Bohm
662e3a38431SPaul Bohmwhile test $[#] != 0
663e3a38431SPaul Bohmdo
664e3a38431SPaul Bohm  case $[1] in
665e3a38431SPaul Bohm    --version | --v* | -V )
666e3a38431SPaul Bohm      echo "$lt_cl_version"; exit 0 ;;
667e3a38431SPaul Bohm    --help | --h* | -h )
668e3a38431SPaul Bohm      echo "$lt_cl_help"; exit 0 ;;
669e3a38431SPaul Bohm    --debug | --d* | -d )
670e3a38431SPaul Bohm      debug=: ;;
671e3a38431SPaul Bohm    --quiet | --q* | --silent | --s* | -q )
672e3a38431SPaul Bohm      lt_cl_silent=: ;;
673e3a38431SPaul Bohm
674e3a38431SPaul Bohm    -*) AC_MSG_ERROR([unrecognized option: $[1]
675e3a38431SPaul BohmTry \`$[0] --help' for more information.]) ;;
676e3a38431SPaul Bohm
677e3a38431SPaul Bohm    *) AC_MSG_ERROR([unrecognized argument: $[1]
678e3a38431SPaul BohmTry \`$[0] --help' for more information.]) ;;
679e3a38431SPaul Bohm  esac
680e3a38431SPaul Bohm  shift
681e3a38431SPaul Bohmdone
682e3a38431SPaul Bohm
683e3a38431SPaul Bohmif $lt_cl_silent; then
684e3a38431SPaul Bohm  exec AS_MESSAGE_FD>/dev/null
685e3a38431SPaul Bohmfi
686e3a38431SPaul Bohm_LTEOF
687e3a38431SPaul Bohm
688e3a38431SPaul Bohmcat >>"$CONFIG_LT" <<_LTEOF
689e3a38431SPaul Bohm_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
690e3a38431SPaul Bohm_LTEOF
691e3a38431SPaul Bohm
692e3a38431SPaul Bohmcat >>"$CONFIG_LT" <<\_LTEOF
693e3a38431SPaul BohmAC_MSG_NOTICE([creating $ofile])
694e3a38431SPaul Bohm_LT_OUTPUT_LIBTOOL_COMMANDS
695e3a38431SPaul BohmAS_EXIT(0)
696e3a38431SPaul Bohm_LTEOF
697e3a38431SPaul Bohmchmod +x "$CONFIG_LT"
698e3a38431SPaul Bohm
699e3a38431SPaul Bohm# configure is writing to config.log, but config.lt does its own redirection,
700e3a38431SPaul Bohm# appending to config.log, which fails on DOS, as config.log is still kept
701e3a38431SPaul Bohm# open by configure.  Here we exec the FD to /dev/null, effectively closing
702e3a38431SPaul Bohm# config.log, so it can be properly (re)opened and appended to by config.lt.
703e3a38431SPaul Bohmlt_cl_success=:
704e3a38431SPaul Bohmtest "$silent" = yes &&
705e3a38431SPaul Bohm  lt_config_lt_args="$lt_config_lt_args --quiet"
706e3a38431SPaul Bohmexec AS_MESSAGE_LOG_FD>/dev/null
707e3a38431SPaul Bohm$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
708e3a38431SPaul Bohmexec AS_MESSAGE_LOG_FD>>config.log
709e3a38431SPaul Bohm$lt_cl_success || AS_EXIT(1)
710e3a38431SPaul Bohm])# LT_OUTPUT
711e3a38431SPaul Bohm
712e3a38431SPaul Bohm
713e3a38431SPaul Bohm# _LT_CONFIG(TAG)
714e3a38431SPaul Bohm# ---------------
715e3a38431SPaul Bohm# If TAG is the built-in tag, create an initial libtool script with a
716e3a38431SPaul Bohm# default configuration from the untagged config vars.  Otherwise add code
717e3a38431SPaul Bohm# to config.status for appending the configuration named by TAG from the
718e3a38431SPaul Bohm# matching tagged config vars.
719e3a38431SPaul Bohmm4_defun([_LT_CONFIG],
720e3a38431SPaul Bohm[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
721e3a38431SPaul Bohm_LT_CONFIG_SAVE_COMMANDS([
722e3a38431SPaul Bohm  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
723e3a38431SPaul Bohm  m4_if(_LT_TAG, [C], [
724e3a38431SPaul Bohm    # See if we are running on zsh, and set the options which allow our
725e3a38431SPaul Bohm    # commands through without removal of \ escapes.
726e3a38431SPaul Bohm    if test -n "${ZSH_VERSION+set}" ; then
727e3a38431SPaul Bohm      setopt NO_GLOB_SUBST
728e3a38431SPaul Bohm    fi
729e3a38431SPaul Bohm
730e3a38431SPaul Bohm    cfgfile="${ofile}T"
731e3a38431SPaul Bohm    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
732e3a38431SPaul Bohm    $RM "$cfgfile"
733e3a38431SPaul Bohm
734e3a38431SPaul Bohm    cat <<_LT_EOF >> "$cfgfile"
735e3a38431SPaul Bohm#! $SHELL
736e3a38431SPaul Bohm
737e3a38431SPaul Bohm# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
738e3a38431SPaul Bohm# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
739e3a38431SPaul Bohm# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
740e3a38431SPaul Bohm# NOTE: Changes made to this file will be lost: look at ltmain.sh.
741e3a38431SPaul Bohm#
742e3a38431SPaul Bohm_LT_COPYING
743e3a38431SPaul Bohm_LT_LIBTOOL_TAGS
744e3a38431SPaul Bohm
745e3a38431SPaul Bohm# ### BEGIN LIBTOOL CONFIG
746e3a38431SPaul Bohm_LT_LIBTOOL_CONFIG_VARS
747e3a38431SPaul Bohm_LT_LIBTOOL_TAG_VARS
748e3a38431SPaul Bohm# ### END LIBTOOL CONFIG
749e3a38431SPaul Bohm
750e3a38431SPaul Bohm_LT_EOF
751e3a38431SPaul Bohm
752e3a38431SPaul Bohm  case $host_os in
753e3a38431SPaul Bohm  aix3*)
754e3a38431SPaul Bohm    cat <<\_LT_EOF >> "$cfgfile"
755e3a38431SPaul Bohm# AIX sometimes has problems with the GCC collect2 program.  For some
756e3a38431SPaul Bohm# reason, if we set the COLLECT_NAMES environment variable, the problems
757e3a38431SPaul Bohm# vanish in a puff of smoke.
758e3a38431SPaul Bohmif test "X${COLLECT_NAMES+set}" != Xset; then
759e3a38431SPaul Bohm  COLLECT_NAMES=
760e3a38431SPaul Bohm  export COLLECT_NAMES
761e3a38431SPaul Bohmfi
762e3a38431SPaul Bohm_LT_EOF
763e3a38431SPaul Bohm    ;;
764e3a38431SPaul Bohm  esac
765e3a38431SPaul Bohm
766e3a38431SPaul Bohm  _LT_PROG_LTMAIN
767e3a38431SPaul Bohm
768e3a38431SPaul Bohm  # We use sed instead of cat because bash on DJGPP gets confused if
769e3a38431SPaul Bohm  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
770e3a38431SPaul Bohm  # text mode, it properly converts lines to CR/LF.  This bash problem
771e3a38431SPaul Bohm  # is reportedly fixed, but why not run on old versions too?
772*93823e6cSPaul Bohm  sed '$q' "$ltmain" >> "$cfgfile" \
773e3a38431SPaul Bohm     || (rm -f "$cfgfile"; exit 1)
774e3a38431SPaul Bohm
775*93823e6cSPaul Bohm  _LT_PROG_REPLACE_SHELLFNS
776e3a38431SPaul Bohm
777e3a38431SPaul Bohm   mv -f "$cfgfile" "$ofile" ||
778e3a38431SPaul Bohm    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
779e3a38431SPaul Bohm  chmod +x "$ofile"
780e3a38431SPaul Bohm],
781e3a38431SPaul Bohm[cat <<_LT_EOF >> "$ofile"
782e3a38431SPaul Bohm
783e3a38431SPaul Bohmdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
784e3a38431SPaul Bohmdnl in a comment (ie after a #).
785e3a38431SPaul Bohm# ### BEGIN LIBTOOL TAG CONFIG: $1
786e3a38431SPaul Bohm_LT_LIBTOOL_TAG_VARS(_LT_TAG)
787e3a38431SPaul Bohm# ### END LIBTOOL TAG CONFIG: $1
788e3a38431SPaul Bohm_LT_EOF
789e3a38431SPaul Bohm])dnl /m4_if
790e3a38431SPaul Bohm],
791e3a38431SPaul Bohm[m4_if([$1], [], [
792e3a38431SPaul Bohm    PACKAGE='$PACKAGE'
793e3a38431SPaul Bohm    VERSION='$VERSION'
794e3a38431SPaul Bohm    TIMESTAMP='$TIMESTAMP'
795e3a38431SPaul Bohm    RM='$RM'
796e3a38431SPaul Bohm    ofile='$ofile'], [])
797e3a38431SPaul Bohm])dnl /_LT_CONFIG_SAVE_COMMANDS
798e3a38431SPaul Bohm])# _LT_CONFIG
799e3a38431SPaul Bohm
800e3a38431SPaul Bohm
801e3a38431SPaul Bohm# LT_SUPPORTED_TAG(TAG)
802e3a38431SPaul Bohm# ---------------------
803e3a38431SPaul Bohm# Trace this macro to discover what tags are supported by the libtool
804e3a38431SPaul Bohm# --tag option, using:
805e3a38431SPaul Bohm#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
806e3a38431SPaul BohmAC_DEFUN([LT_SUPPORTED_TAG], [])
807e3a38431SPaul Bohm
808e3a38431SPaul Bohm
809e3a38431SPaul Bohm# C support is built-in for now
810e3a38431SPaul Bohmm4_define([_LT_LANG_C_enabled], [])
811e3a38431SPaul Bohmm4_define([_LT_TAGS], [])
812e3a38431SPaul Bohm
813e3a38431SPaul Bohm
814e3a38431SPaul Bohm# LT_LANG(LANG)
815e3a38431SPaul Bohm# -------------
816e3a38431SPaul Bohm# Enable libtool support for the given language if not already enabled.
817e3a38431SPaul BohmAC_DEFUN([LT_LANG],
818e3a38431SPaul Bohm[AC_BEFORE([$0], [LT_OUTPUT])dnl
819e3a38431SPaul Bohmm4_case([$1],
820e3a38431SPaul Bohm  [C],			[_LT_LANG(C)],
821e3a38431SPaul Bohm  [C++],		[_LT_LANG(CXX)],
822*93823e6cSPaul Bohm  [Go],			[_LT_LANG(GO)],
823e3a38431SPaul Bohm  [Java],		[_LT_LANG(GCJ)],
824e3a38431SPaul Bohm  [Fortran 77],		[_LT_LANG(F77)],
825e3a38431SPaul Bohm  [Fortran],		[_LT_LANG(FC)],
826e3a38431SPaul Bohm  [Windows Resource],	[_LT_LANG(RC)],
827e3a38431SPaul Bohm  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
828e3a38431SPaul Bohm    [_LT_LANG($1)],
829e3a38431SPaul Bohm    [m4_fatal([$0: unsupported language: "$1"])])])dnl
830e3a38431SPaul Bohm])# LT_LANG
831e3a38431SPaul Bohm
832e3a38431SPaul Bohm
833e3a38431SPaul Bohm# _LT_LANG(LANGNAME)
834e3a38431SPaul Bohm# ------------------
835e3a38431SPaul Bohmm4_defun([_LT_LANG],
836e3a38431SPaul Bohm[m4_ifdef([_LT_LANG_]$1[_enabled], [],
837e3a38431SPaul Bohm  [LT_SUPPORTED_TAG([$1])dnl
838e3a38431SPaul Bohm  m4_append([_LT_TAGS], [$1 ])dnl
839e3a38431SPaul Bohm  m4_define([_LT_LANG_]$1[_enabled], [])dnl
840e3a38431SPaul Bohm  _LT_LANG_$1_CONFIG($1)])dnl
841e3a38431SPaul Bohm])# _LT_LANG
842e3a38431SPaul Bohm
843e3a38431SPaul Bohm
844*93823e6cSPaul Bohmm4_ifndef([AC_PROG_GO], [
845*93823e6cSPaul Bohm# NOTE: This macro has been submitted for inclusion into   #
846*93823e6cSPaul Bohm#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
847*93823e6cSPaul Bohm#  a released version of Autoconf we should remove this    #
848*93823e6cSPaul Bohm#  macro and use it instead.                               #
849*93823e6cSPaul Bohmm4_defun([AC_PROG_GO],
850*93823e6cSPaul Bohm[AC_LANG_PUSH(Go)dnl
851*93823e6cSPaul BohmAC_ARG_VAR([GOC],     [Go compiler command])dnl
852*93823e6cSPaul BohmAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
853*93823e6cSPaul Bohm_AC_ARG_VAR_LDFLAGS()dnl
854*93823e6cSPaul BohmAC_CHECK_TOOL(GOC, gccgo)
855*93823e6cSPaul Bohmif test -z "$GOC"; then
856*93823e6cSPaul Bohm  if test -n "$ac_tool_prefix"; then
857*93823e6cSPaul Bohm    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
858*93823e6cSPaul Bohm  fi
859*93823e6cSPaul Bohmfi
860*93823e6cSPaul Bohmif test -z "$GOC"; then
861*93823e6cSPaul Bohm  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
862*93823e6cSPaul Bohmfi
863*93823e6cSPaul Bohm])#m4_defun
864*93823e6cSPaul Bohm])#m4_ifndef
865*93823e6cSPaul Bohm
866*93823e6cSPaul Bohm
867e3a38431SPaul Bohm# _LT_LANG_DEFAULT_CONFIG
868e3a38431SPaul Bohm# -----------------------
869e3a38431SPaul Bohmm4_defun([_LT_LANG_DEFAULT_CONFIG],
870e3a38431SPaul Bohm[AC_PROVIDE_IFELSE([AC_PROG_CXX],
871e3a38431SPaul Bohm  [LT_LANG(CXX)],
872e3a38431SPaul Bohm  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873e3a38431SPaul Bohm
874e3a38431SPaul BohmAC_PROVIDE_IFELSE([AC_PROG_F77],
875e3a38431SPaul Bohm  [LT_LANG(F77)],
876e3a38431SPaul Bohm  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877e3a38431SPaul Bohm
878e3a38431SPaul BohmAC_PROVIDE_IFELSE([AC_PROG_FC],
879e3a38431SPaul Bohm  [LT_LANG(FC)],
880e3a38431SPaul Bohm  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881e3a38431SPaul Bohm
882e3a38431SPaul Bohmdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
883e3a38431SPaul Bohmdnl pulling things in needlessly.
884e3a38431SPaul BohmAC_PROVIDE_IFELSE([AC_PROG_GCJ],
885e3a38431SPaul Bohm  [LT_LANG(GCJ)],
886e3a38431SPaul Bohm  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
887e3a38431SPaul Bohm    [LT_LANG(GCJ)],
888e3a38431SPaul Bohm    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
889e3a38431SPaul Bohm      [LT_LANG(GCJ)],
890e3a38431SPaul Bohm      [m4_ifdef([AC_PROG_GCJ],
891e3a38431SPaul Bohm	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
892e3a38431SPaul Bohm       m4_ifdef([A][M_PROG_GCJ],
893e3a38431SPaul Bohm	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
894e3a38431SPaul Bohm       m4_ifdef([LT_PROG_GCJ],
895e3a38431SPaul Bohm	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896e3a38431SPaul Bohm
897*93823e6cSPaul BohmAC_PROVIDE_IFELSE([AC_PROG_GO],
898*93823e6cSPaul Bohm  [LT_LANG(GO)],
899*93823e6cSPaul Bohm  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900*93823e6cSPaul Bohm
901e3a38431SPaul BohmAC_PROVIDE_IFELSE([LT_PROG_RC],
902e3a38431SPaul Bohm  [LT_LANG(RC)],
903e3a38431SPaul Bohm  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
904e3a38431SPaul Bohm])# _LT_LANG_DEFAULT_CONFIG
905e3a38431SPaul Bohm
906e3a38431SPaul Bohm# Obsolete macros:
907e3a38431SPaul BohmAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
908e3a38431SPaul BohmAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
909e3a38431SPaul BohmAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
910e3a38431SPaul BohmAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
911*93823e6cSPaul BohmAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
912e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
913e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
914e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_F77], [])
915e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_FC], [])
916e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
917*93823e6cSPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_RC], [])
918e3a38431SPaul Bohm
919e3a38431SPaul Bohm
920e3a38431SPaul Bohm# _LT_TAG_COMPILER
921e3a38431SPaul Bohm# ----------------
922e3a38431SPaul Bohmm4_defun([_LT_TAG_COMPILER],
923e3a38431SPaul Bohm[AC_REQUIRE([AC_PROG_CC])dnl
924e3a38431SPaul Bohm
925e3a38431SPaul Bohm_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
926e3a38431SPaul Bohm_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
927e3a38431SPaul Bohm_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
928e3a38431SPaul Bohm_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929e3a38431SPaul Bohm
930e3a38431SPaul Bohm# If no C compiler was specified, use CC.
931e3a38431SPaul BohmLTCC=${LTCC-"$CC"}
932e3a38431SPaul Bohm
933e3a38431SPaul Bohm# If no C compiler flags were specified, use CFLAGS.
934e3a38431SPaul BohmLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935e3a38431SPaul Bohm
936e3a38431SPaul Bohm# Allow CC to be a program name with arguments.
937e3a38431SPaul Bohmcompiler=$CC
938e3a38431SPaul Bohm])# _LT_TAG_COMPILER
939e3a38431SPaul Bohm
940e3a38431SPaul Bohm
941e3a38431SPaul Bohm# _LT_COMPILER_BOILERPLATE
942e3a38431SPaul Bohm# ------------------------
943e3a38431SPaul Bohm# Check for compiler boilerplate output or warnings with
944e3a38431SPaul Bohm# the simple compiler test code.
945e3a38431SPaul Bohmm4_defun([_LT_COMPILER_BOILERPLATE],
946e3a38431SPaul Bohm[m4_require([_LT_DECL_SED])dnl
947e3a38431SPaul Bohmac_outfile=conftest.$ac_objext
948e3a38431SPaul Bohmecho "$lt_simple_compile_test_code" >conftest.$ac_ext
949e3a38431SPaul Bohmeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
950e3a38431SPaul Bohm_lt_compiler_boilerplate=`cat conftest.err`
951e3a38431SPaul Bohm$RM conftest*
952e3a38431SPaul Bohm])# _LT_COMPILER_BOILERPLATE
953e3a38431SPaul Bohm
954e3a38431SPaul Bohm
955e3a38431SPaul Bohm# _LT_LINKER_BOILERPLATE
956e3a38431SPaul Bohm# ----------------------
957e3a38431SPaul Bohm# Check for linker boilerplate output or warnings with
958e3a38431SPaul Bohm# the simple link test code.
959e3a38431SPaul Bohmm4_defun([_LT_LINKER_BOILERPLATE],
960e3a38431SPaul Bohm[m4_require([_LT_DECL_SED])dnl
961e3a38431SPaul Bohmac_outfile=conftest.$ac_objext
962e3a38431SPaul Bohmecho "$lt_simple_link_test_code" >conftest.$ac_ext
963e3a38431SPaul Bohmeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
964e3a38431SPaul Bohm_lt_linker_boilerplate=`cat conftest.err`
965e3a38431SPaul Bohm$RM -r conftest*
966e3a38431SPaul Bohm])# _LT_LINKER_BOILERPLATE
967e3a38431SPaul Bohm
968e3a38431SPaul Bohm# _LT_REQUIRED_DARWIN_CHECKS
969e3a38431SPaul Bohm# -------------------------
970e3a38431SPaul Bohmm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
971e3a38431SPaul Bohm  case $host_os in
972e3a38431SPaul Bohm    rhapsody* | darwin*)
973e3a38431SPaul Bohm    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
974e3a38431SPaul Bohm    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
975e3a38431SPaul Bohm    AC_CHECK_TOOL([LIPO], [lipo], [:])
976e3a38431SPaul Bohm    AC_CHECK_TOOL([OTOOL], [otool], [:])
977e3a38431SPaul Bohm    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
978e3a38431SPaul Bohm    _LT_DECL([], [DSYMUTIL], [1],
979e3a38431SPaul Bohm      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
980e3a38431SPaul Bohm    _LT_DECL([], [NMEDIT], [1],
981e3a38431SPaul Bohm      [Tool to change global to local symbols on Mac OS X])
982e3a38431SPaul Bohm    _LT_DECL([], [LIPO], [1],
983e3a38431SPaul Bohm      [Tool to manipulate fat objects and archives on Mac OS X])
984e3a38431SPaul Bohm    _LT_DECL([], [OTOOL], [1],
985e3a38431SPaul Bohm      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
986e3a38431SPaul Bohm    _LT_DECL([], [OTOOL64], [1],
987e3a38431SPaul Bohm      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988e3a38431SPaul Bohm
989e3a38431SPaul Bohm    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
990e3a38431SPaul Bohm      [lt_cv_apple_cc_single_mod=no
991e3a38431SPaul Bohm      if test -z "${LT_MULTI_MODULE}"; then
992e3a38431SPaul Bohm	# By default we will add the -single_module flag. You can override
993e3a38431SPaul Bohm	# by either setting the environment variable LT_MULTI_MODULE
994e3a38431SPaul Bohm	# non-empty at configure time, or by adding -multi_module to the
995e3a38431SPaul Bohm	# link flags.
996e3a38431SPaul Bohm	rm -rf libconftest.dylib*
997e3a38431SPaul Bohm	echo "int foo(void){return 1;}" > conftest.c
998e3a38431SPaul Bohm	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
999e3a38431SPaul Bohm-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1000e3a38431SPaul Bohm	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1001e3a38431SPaul Bohm	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1002e3a38431SPaul Bohm        _lt_result=$?
1003*93823e6cSPaul Bohm	# If there is a non-empty error log, and "single_module"
1004*93823e6cSPaul Bohm	# appears in it, assume the flag caused a linker warning
1005*93823e6cSPaul Bohm        if test -s conftest.err && $GREP single_module conftest.err; then
1006*93823e6cSPaul Bohm	  cat conftest.err >&AS_MESSAGE_LOG_FD
1007*93823e6cSPaul Bohm	# Otherwise, if the output was created with a 0 exit code from
1008*93823e6cSPaul Bohm	# the compiler, it worked.
1009*93823e6cSPaul Bohm	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1010e3a38431SPaul Bohm	  lt_cv_apple_cc_single_mod=yes
1011e3a38431SPaul Bohm	else
1012e3a38431SPaul Bohm	  cat conftest.err >&AS_MESSAGE_LOG_FD
1013e3a38431SPaul Bohm	fi
1014e3a38431SPaul Bohm	rm -rf libconftest.dylib*
1015e3a38431SPaul Bohm	rm -f conftest.*
1016e3a38431SPaul Bohm      fi])
1017*93823e6cSPaul Bohm
1018e3a38431SPaul Bohm    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1019e3a38431SPaul Bohm      [lt_cv_ld_exported_symbols_list],
1020e3a38431SPaul Bohm      [lt_cv_ld_exported_symbols_list=no
1021e3a38431SPaul Bohm      save_LDFLAGS=$LDFLAGS
1022e3a38431SPaul Bohm      echo "_main" > conftest.sym
1023e3a38431SPaul Bohm      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1024e3a38431SPaul Bohm      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1025e3a38431SPaul Bohm	[lt_cv_ld_exported_symbols_list=yes],
1026e3a38431SPaul Bohm	[lt_cv_ld_exported_symbols_list=no])
1027e3a38431SPaul Bohm	LDFLAGS="$save_LDFLAGS"
1028e3a38431SPaul Bohm    ])
1029*93823e6cSPaul Bohm
1030*93823e6cSPaul Bohm    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1031*93823e6cSPaul Bohm      [lt_cv_ld_force_load=no
1032*93823e6cSPaul Bohm      cat > conftest.c << _LT_EOF
1033*93823e6cSPaul Bohmint forced_loaded() { return 2;}
1034*93823e6cSPaul Bohm_LT_EOF
1035*93823e6cSPaul Bohm      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1036*93823e6cSPaul Bohm      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1037*93823e6cSPaul Bohm      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1038*93823e6cSPaul Bohm      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1039*93823e6cSPaul Bohm      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1040*93823e6cSPaul Bohm      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1041*93823e6cSPaul Bohm      cat > conftest.c << _LT_EOF
1042*93823e6cSPaul Bohmint main() { return 0;}
1043*93823e6cSPaul Bohm_LT_EOF
1044*93823e6cSPaul Bohm      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1045*93823e6cSPaul Bohm      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1046*93823e6cSPaul Bohm      _lt_result=$?
1047*93823e6cSPaul Bohm      if test -s conftest.err && $GREP force_load conftest.err; then
1048*93823e6cSPaul Bohm	cat conftest.err >&AS_MESSAGE_LOG_FD
1049*93823e6cSPaul Bohm      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
1050*93823e6cSPaul Bohm	lt_cv_ld_force_load=yes
1051*93823e6cSPaul Bohm      else
1052*93823e6cSPaul Bohm	cat conftest.err >&AS_MESSAGE_LOG_FD
1053*93823e6cSPaul Bohm      fi
1054*93823e6cSPaul Bohm        rm -f conftest.err libconftest.a conftest conftest.c
1055*93823e6cSPaul Bohm        rm -rf conftest.dSYM
1056*93823e6cSPaul Bohm    ])
1057e3a38431SPaul Bohm    case $host_os in
1058e3a38431SPaul Bohm    rhapsody* | darwin1.[[012]])
1059e3a38431SPaul Bohm      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1060e3a38431SPaul Bohm    darwin1.*)
1061e3a38431SPaul Bohm      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1062e3a38431SPaul Bohm    darwin*) # darwin 5.x on
1063e3a38431SPaul Bohm      # if running on 10.5 or later, the deployment target defaults
1064e3a38431SPaul Bohm      # to the OS version, if on x86, and 10.4, the deployment
1065e3a38431SPaul Bohm      # target defaults to 10.4. Don't you love it?
1066e3a38431SPaul Bohm      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1067e3a38431SPaul Bohm	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1068e3a38431SPaul Bohm	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1069e3a38431SPaul Bohm	10.[[012]]*)
1070e3a38431SPaul Bohm	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1071e3a38431SPaul Bohm	10.*)
1072e3a38431SPaul Bohm	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1073e3a38431SPaul Bohm      esac
1074e3a38431SPaul Bohm    ;;
1075e3a38431SPaul Bohm  esac
1076e3a38431SPaul Bohm    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1077e3a38431SPaul Bohm      _lt_dar_single_mod='$single_module'
1078e3a38431SPaul Bohm    fi
1079e3a38431SPaul Bohm    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1080e3a38431SPaul Bohm      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1081e3a38431SPaul Bohm    else
1082e3a38431SPaul Bohm      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1083e3a38431SPaul Bohm    fi
1084*93823e6cSPaul Bohm    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1085e3a38431SPaul Bohm      _lt_dsymutil='~$DSYMUTIL $lib || :'
1086e3a38431SPaul Bohm    else
1087e3a38431SPaul Bohm      _lt_dsymutil=
1088e3a38431SPaul Bohm    fi
1089e3a38431SPaul Bohm    ;;
1090e3a38431SPaul Bohm  esac
1091e3a38431SPaul Bohm])
1092e3a38431SPaul Bohm
1093e3a38431SPaul Bohm
1094*93823e6cSPaul Bohm# _LT_DARWIN_LINKER_FEATURES([TAG])
1095*93823e6cSPaul Bohm# ---------------------------------
1096e3a38431SPaul Bohm# Checks for linker and compiler features on darwin
1097e3a38431SPaul Bohmm4_defun([_LT_DARWIN_LINKER_FEATURES],
1098e3a38431SPaul Bohm[
1099e3a38431SPaul Bohm  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1100e3a38431SPaul Bohm  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1101e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_direct, $1)=no
1102e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_automatic, $1)=yes
1103e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1104*93823e6cSPaul Bohm  if test "$lt_cv_ld_force_load" = "yes"; then
1105*93823e6cSPaul Bohm    _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\"`'
1106*93823e6cSPaul Bohm    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1107*93823e6cSPaul Bohm                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1108*93823e6cSPaul Bohm  else
1109e3a38431SPaul Bohm    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1110*93823e6cSPaul Bohm  fi
1111e3a38431SPaul Bohm  _LT_TAGVAR(link_all_deplibs, $1)=yes
1112e3a38431SPaul Bohm  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1113e3a38431SPaul Bohm  case $cc_basename in
1114e3a38431SPaul Bohm     ifort*) _lt_dar_can_shared=yes ;;
1115e3a38431SPaul Bohm     *) _lt_dar_can_shared=$GCC ;;
1116e3a38431SPaul Bohm  esac
1117e3a38431SPaul Bohm  if test "$_lt_dar_can_shared" = "yes"; then
1118*93823e6cSPaul Bohm    output_verbose_link_cmd=func_echo_all
1119e3a38431SPaul Bohm    _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}"
1120e3a38431SPaul Bohm    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1121e3a38431SPaul Bohm    _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}"
1122e3a38431SPaul Bohm    _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}"
1123e3a38431SPaul Bohm    m4_if([$1], [CXX],
1124e3a38431SPaul Bohm[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1125e3a38431SPaul Bohm      _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}"
1126e3a38431SPaul Bohm      _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}"
1127e3a38431SPaul Bohm    fi
1128e3a38431SPaul Bohm],[])
1129e3a38431SPaul Bohm  else
1130e3a38431SPaul Bohm  _LT_TAGVAR(ld_shlibs, $1)=no
1131e3a38431SPaul Bohm  fi
1132e3a38431SPaul Bohm])
1133e3a38431SPaul Bohm
1134*93823e6cSPaul Bohm# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1135*93823e6cSPaul Bohm# ----------------------------------
1136e3a38431SPaul Bohm# Links a minimal program and checks the executable
1137e3a38431SPaul Bohm# for the system default hardcoded library path. In most cases,
1138e3a38431SPaul Bohm# this is /usr/lib:/lib, but when the MPI compilers are used
1139e3a38431SPaul Bohm# the location of the communication and MPI libs are included too.
1140e3a38431SPaul Bohm# If we don't find anything, use the default library path according
1141e3a38431SPaul Bohm# to the aix ld manual.
1142*93823e6cSPaul Bohm# Store the results from the different compilers for each TAGNAME.
1143*93823e6cSPaul Bohm# Allow to override them for all tags through lt_cv_aix_libpath.
1144e3a38431SPaul Bohmm4_defun([_LT_SYS_MODULE_PATH_AIX],
1145e3a38431SPaul Bohm[m4_require([_LT_DECL_SED])dnl
1146*93823e6cSPaul Bohmif test "${lt_cv_aix_libpath+set}" = set; then
1147*93823e6cSPaul Bohm  aix_libpath=$lt_cv_aix_libpath
1148*93823e6cSPaul Bohmelse
1149*93823e6cSPaul Bohm  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1150*93823e6cSPaul Bohm  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1151*93823e6cSPaul Bohm  lt_aix_libpath_sed='[
1152e3a38431SPaul Bohm      /Import File Strings/,/^$/ {
1153e3a38431SPaul Bohm	  /^0/ {
1154*93823e6cSPaul Bohm	      s/^0  *\([^ ]*\) *$/\1/
1155e3a38431SPaul Bohm	      p
1156e3a38431SPaul Bohm	  }
1157*93823e6cSPaul Bohm      }]'
1158*93823e6cSPaul Bohm  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1159e3a38431SPaul Bohm  # Check for a 64-bit object if we didn't find anything.
1160*93823e6cSPaul Bohm  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1161*93823e6cSPaul Bohm    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1162e3a38431SPaul Bohm  fi],[])
1163*93823e6cSPaul Bohm  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1164*93823e6cSPaul Bohm    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1165*93823e6cSPaul Bohm  fi
1166*93823e6cSPaul Bohm  ])
1167*93823e6cSPaul Bohm  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1168*93823e6cSPaul Bohmfi
1169e3a38431SPaul Bohm])# _LT_SYS_MODULE_PATH_AIX
1170e3a38431SPaul Bohm
1171e3a38431SPaul Bohm
1172e3a38431SPaul Bohm# _LT_SHELL_INIT(ARG)
1173e3a38431SPaul Bohm# -------------------
1174e3a38431SPaul Bohmm4_define([_LT_SHELL_INIT],
1175*93823e6cSPaul Bohm[m4_divert_text([M4SH-INIT], [$1
1176*93823e6cSPaul Bohm])])# _LT_SHELL_INIT
1177*93823e6cSPaul Bohm
1178e3a38431SPaul Bohm
1179e3a38431SPaul Bohm
1180e3a38431SPaul Bohm# _LT_PROG_ECHO_BACKSLASH
1181e3a38431SPaul Bohm# -----------------------
1182*93823e6cSPaul Bohm# Find how we can fake an echo command that does not interpret backslash.
1183*93823e6cSPaul Bohm# In particular, with Autoconf 2.60 or later we add some code to the start
1184*93823e6cSPaul Bohm# of the generated configure script which will find a shell with a builtin
1185*93823e6cSPaul Bohm# printf (which we can use as an echo command).
1186e3a38431SPaul Bohmm4_defun([_LT_PROG_ECHO_BACKSLASH],
1187*93823e6cSPaul Bohm[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1188*93823e6cSPaul BohmECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1189*93823e6cSPaul BohmECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1190e3a38431SPaul Bohm
1191*93823e6cSPaul BohmAC_MSG_CHECKING([how to print strings])
1192*93823e6cSPaul Bohm# Test print first, because it will be a builtin if present.
1193*93823e6cSPaul Bohmif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1194*93823e6cSPaul Bohm   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1195*93823e6cSPaul Bohm  ECHO='print -r --'
1196*93823e6cSPaul Bohmelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1197*93823e6cSPaul Bohm  ECHO='printf %s\n'
1198*93823e6cSPaul Bohmelse
1199*93823e6cSPaul Bohm  # Use this function as a fallback that always works.
1200*93823e6cSPaul Bohm  func_fallback_echo ()
1201*93823e6cSPaul Bohm  {
1202*93823e6cSPaul Bohm    eval 'cat <<_LTECHO_EOF
1203*93823e6cSPaul Bohm$[]1
1204*93823e6cSPaul Bohm_LTECHO_EOF'
1205*93823e6cSPaul Bohm  }
1206*93823e6cSPaul Bohm  ECHO='func_fallback_echo'
1207*93823e6cSPaul Bohmfi
1208*93823e6cSPaul Bohm
1209*93823e6cSPaul Bohm# func_echo_all arg...
1210*93823e6cSPaul Bohm# Invoke $ECHO with all args, space-separated.
1211*93823e6cSPaul Bohmfunc_echo_all ()
1212*93823e6cSPaul Bohm{
1213*93823e6cSPaul Bohm    $ECHO "$*"
1214*93823e6cSPaul Bohm}
1215*93823e6cSPaul Bohm
1216*93823e6cSPaul Bohmcase "$ECHO" in
1217*93823e6cSPaul Bohm  printf*) AC_MSG_RESULT([printf]) ;;
1218*93823e6cSPaul Bohm  print*) AC_MSG_RESULT([print -r]) ;;
1219*93823e6cSPaul Bohm  *) AC_MSG_RESULT([cat]) ;;
1220*93823e6cSPaul Bohmesac
1221*93823e6cSPaul Bohm
1222*93823e6cSPaul Bohmm4_ifdef([_AS_DETECT_SUGGESTED],
1223*93823e6cSPaul Bohm[_AS_DETECT_SUGGESTED([
1224*93823e6cSPaul Bohm  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1225*93823e6cSPaul Bohm    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1226*93823e6cSPaul Bohm    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1227*93823e6cSPaul Bohm    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1228*93823e6cSPaul Bohm    PATH=/empty FPATH=/empty; export PATH FPATH
1229*93823e6cSPaul Bohm    test "X`printf %s $ECHO`" = "X$ECHO" \
1230*93823e6cSPaul Bohm      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231*93823e6cSPaul Bohm
1232*93823e6cSPaul Bohm_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1233*93823e6cSPaul Bohm_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1234*93823e6cSPaul Bohm])# _LT_PROG_ECHO_BACKSLASH
1235*93823e6cSPaul Bohm
1236*93823e6cSPaul Bohm
1237*93823e6cSPaul Bohm# _LT_WITH_SYSROOT
1238*93823e6cSPaul Bohm# ----------------
1239*93823e6cSPaul BohmAC_DEFUN([_LT_WITH_SYSROOT],
1240*93823e6cSPaul Bohm[AC_MSG_CHECKING([for sysroot])
1241*93823e6cSPaul BohmAC_ARG_WITH([sysroot],
1242*93823e6cSPaul Bohm[  --with-sysroot[=DIR] Search for dependent libraries within DIR
1243*93823e6cSPaul Bohm                        (or the compiler's sysroot if not specified).],
1244*93823e6cSPaul Bohm[], [with_sysroot=no])
1245*93823e6cSPaul Bohm
1246*93823e6cSPaul Bohmdnl lt_sysroot will always be passed unquoted.  We quote it here
1247*93823e6cSPaul Bohmdnl in case the user passed a directory name.
1248*93823e6cSPaul Bohmlt_sysroot=
1249*93823e6cSPaul Bohmcase ${with_sysroot} in #(
1250*93823e6cSPaul Bohm yes)
1251*93823e6cSPaul Bohm   if test "$GCC" = yes; then
1252*93823e6cSPaul Bohm     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1253*93823e6cSPaul Bohm   fi
1254*93823e6cSPaul Bohm   ;; #(
1255*93823e6cSPaul Bohm /*)
1256*93823e6cSPaul Bohm   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1257*93823e6cSPaul Bohm   ;; #(
1258*93823e6cSPaul Bohm no|'')
1259*93823e6cSPaul Bohm   ;; #(
1260*93823e6cSPaul Bohm *)
1261*93823e6cSPaul Bohm   AC_MSG_RESULT([${with_sysroot}])
1262*93823e6cSPaul Bohm   AC_MSG_ERROR([The sysroot must be an absolute path.])
1263e3a38431SPaul Bohm   ;;
1264e3a38431SPaul Bohmesac
1265e3a38431SPaul Bohm
1266*93823e6cSPaul Bohm AC_MSG_RESULT([${lt_sysroot:-no}])
1267*93823e6cSPaul Bohm_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1268*93823e6cSPaul Bohm[dependent libraries, and in which our libraries should be installed.])])
1269e3a38431SPaul Bohm
1270e3a38431SPaul Bohm# _LT_ENABLE_LOCK
1271e3a38431SPaul Bohm# ---------------
1272e3a38431SPaul Bohmm4_defun([_LT_ENABLE_LOCK],
1273e3a38431SPaul Bohm[AC_ARG_ENABLE([libtool-lock],
1274e3a38431SPaul Bohm  [AS_HELP_STRING([--disable-libtool-lock],
1275e3a38431SPaul Bohm    [avoid locking (might break parallel builds)])])
1276e3a38431SPaul Bohmtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1277e3a38431SPaul Bohm
1278e3a38431SPaul Bohm# Some flags need to be propagated to the compiler or linker for good
1279e3a38431SPaul Bohm# libtool support.
1280e3a38431SPaul Bohmcase $host in
1281e3a38431SPaul Bohmia64-*-hpux*)
1282e3a38431SPaul Bohm  # Find out which ABI we are using.
1283e3a38431SPaul Bohm  echo 'int i;' > conftest.$ac_ext
1284e3a38431SPaul Bohm  if AC_TRY_EVAL(ac_compile); then
1285e3a38431SPaul Bohm    case `/usr/bin/file conftest.$ac_objext` in
1286e3a38431SPaul Bohm      *ELF-32*)
1287e3a38431SPaul Bohm	HPUX_IA64_MODE="32"
1288e3a38431SPaul Bohm	;;
1289e3a38431SPaul Bohm      *ELF-64*)
1290e3a38431SPaul Bohm	HPUX_IA64_MODE="64"
1291e3a38431SPaul Bohm	;;
1292e3a38431SPaul Bohm    esac
1293e3a38431SPaul Bohm  fi
1294e3a38431SPaul Bohm  rm -rf conftest*
1295e3a38431SPaul Bohm  ;;
1296e3a38431SPaul Bohm*-*-irix6*)
1297e3a38431SPaul Bohm  # Find out which ABI we are using.
1298*93823e6cSPaul Bohm  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1299e3a38431SPaul Bohm  if AC_TRY_EVAL(ac_compile); then
1300e3a38431SPaul Bohm    if test "$lt_cv_prog_gnu_ld" = yes; then
1301e3a38431SPaul Bohm      case `/usr/bin/file conftest.$ac_objext` in
1302e3a38431SPaul Bohm	*32-bit*)
1303e3a38431SPaul Bohm	  LD="${LD-ld} -melf32bsmip"
1304e3a38431SPaul Bohm	  ;;
1305e3a38431SPaul Bohm	*N32*)
1306e3a38431SPaul Bohm	  LD="${LD-ld} -melf32bmipn32"
1307e3a38431SPaul Bohm	  ;;
1308e3a38431SPaul Bohm	*64-bit*)
1309e3a38431SPaul Bohm	  LD="${LD-ld} -melf64bmip"
1310e3a38431SPaul Bohm	;;
1311e3a38431SPaul Bohm      esac
1312e3a38431SPaul Bohm    else
1313e3a38431SPaul Bohm      case `/usr/bin/file conftest.$ac_objext` in
1314e3a38431SPaul Bohm	*32-bit*)
1315e3a38431SPaul Bohm	  LD="${LD-ld} -32"
1316e3a38431SPaul Bohm	  ;;
1317e3a38431SPaul Bohm	*N32*)
1318e3a38431SPaul Bohm	  LD="${LD-ld} -n32"
1319e3a38431SPaul Bohm	  ;;
1320e3a38431SPaul Bohm	*64-bit*)
1321e3a38431SPaul Bohm	  LD="${LD-ld} -64"
1322e3a38431SPaul Bohm	  ;;
1323e3a38431SPaul Bohm      esac
1324e3a38431SPaul Bohm    fi
1325e3a38431SPaul Bohm  fi
1326e3a38431SPaul Bohm  rm -rf conftest*
1327e3a38431SPaul Bohm  ;;
1328e3a38431SPaul Bohm
1329*93823e6cSPaul Bohmx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1330e3a38431SPaul Bohms390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1331e3a38431SPaul Bohm  # Find out which ABI we are using.
1332e3a38431SPaul Bohm  echo 'int i;' > conftest.$ac_ext
1333e3a38431SPaul Bohm  if AC_TRY_EVAL(ac_compile); then
1334e3a38431SPaul Bohm    case `/usr/bin/file conftest.o` in
1335e3a38431SPaul Bohm      *32-bit*)
1336e3a38431SPaul Bohm	case $host in
1337e3a38431SPaul Bohm	  x86_64-*kfreebsd*-gnu)
1338e3a38431SPaul Bohm	    LD="${LD-ld} -m elf_i386_fbsd"
1339e3a38431SPaul Bohm	    ;;
1340e3a38431SPaul Bohm	  x86_64-*linux*)
1341*93823e6cSPaul Bohm	    case `/usr/bin/file conftest.o` in
1342*93823e6cSPaul Bohm	      *x86-64*)
1343*93823e6cSPaul Bohm		LD="${LD-ld} -m elf32_x86_64"
1344*93823e6cSPaul Bohm		;;
1345*93823e6cSPaul Bohm	      *)
1346e3a38431SPaul Bohm		LD="${LD-ld} -m elf_i386"
1347e3a38431SPaul Bohm		;;
1348*93823e6cSPaul Bohm	    esac
1349*93823e6cSPaul Bohm	    ;;
1350*93823e6cSPaul Bohm	  powerpc64le-*)
1351*93823e6cSPaul Bohm	    LD="${LD-ld} -m elf32lppclinux"
1352*93823e6cSPaul Bohm	    ;;
1353*93823e6cSPaul Bohm	  powerpc64-*)
1354e3a38431SPaul Bohm	    LD="${LD-ld} -m elf32ppclinux"
1355e3a38431SPaul Bohm	    ;;
1356e3a38431SPaul Bohm	  s390x-*linux*)
1357e3a38431SPaul Bohm	    LD="${LD-ld} -m elf_s390"
1358e3a38431SPaul Bohm	    ;;
1359e3a38431SPaul Bohm	  sparc64-*linux*)
1360e3a38431SPaul Bohm	    LD="${LD-ld} -m elf32_sparc"
1361e3a38431SPaul Bohm	    ;;
1362e3a38431SPaul Bohm	esac
1363e3a38431SPaul Bohm	;;
1364e3a38431SPaul Bohm      *64-bit*)
1365e3a38431SPaul Bohm	case $host in
1366e3a38431SPaul Bohm	  x86_64-*kfreebsd*-gnu)
1367e3a38431SPaul Bohm	    LD="${LD-ld} -m elf_x86_64_fbsd"
1368e3a38431SPaul Bohm	    ;;
1369e3a38431SPaul Bohm	  x86_64-*linux*)
1370e3a38431SPaul Bohm	    LD="${LD-ld} -m elf_x86_64"
1371e3a38431SPaul Bohm	    ;;
1372*93823e6cSPaul Bohm	  powerpcle-*)
1373*93823e6cSPaul Bohm	    LD="${LD-ld} -m elf64lppc"
1374*93823e6cSPaul Bohm	    ;;
1375*93823e6cSPaul Bohm	  powerpc-*)
1376e3a38431SPaul Bohm	    LD="${LD-ld} -m elf64ppc"
1377e3a38431SPaul Bohm	    ;;
1378e3a38431SPaul Bohm	  s390*-*linux*|s390*-*tpf*)
1379e3a38431SPaul Bohm	    LD="${LD-ld} -m elf64_s390"
1380e3a38431SPaul Bohm	    ;;
1381e3a38431SPaul Bohm	  sparc*-*linux*)
1382e3a38431SPaul Bohm	    LD="${LD-ld} -m elf64_sparc"
1383e3a38431SPaul Bohm	    ;;
1384e3a38431SPaul Bohm	esac
1385e3a38431SPaul Bohm	;;
1386e3a38431SPaul Bohm    esac
1387e3a38431SPaul Bohm  fi
1388e3a38431SPaul Bohm  rm -rf conftest*
1389e3a38431SPaul Bohm  ;;
1390e3a38431SPaul Bohm
1391e3a38431SPaul Bohm*-*-sco3.2v5*)
1392e3a38431SPaul Bohm  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1393e3a38431SPaul Bohm  SAVE_CFLAGS="$CFLAGS"
1394e3a38431SPaul Bohm  CFLAGS="$CFLAGS -belf"
1395e3a38431SPaul Bohm  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1396e3a38431SPaul Bohm    [AC_LANG_PUSH(C)
1397e3a38431SPaul Bohm     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1398e3a38431SPaul Bohm     AC_LANG_POP])
1399e3a38431SPaul Bohm  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1400e3a38431SPaul Bohm    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1401e3a38431SPaul Bohm    CFLAGS="$SAVE_CFLAGS"
1402e3a38431SPaul Bohm  fi
1403e3a38431SPaul Bohm  ;;
1404*93823e6cSPaul Bohm*-*solaris*)
1405e3a38431SPaul Bohm  # Find out which ABI we are using.
1406e3a38431SPaul Bohm  echo 'int i;' > conftest.$ac_ext
1407e3a38431SPaul Bohm  if AC_TRY_EVAL(ac_compile); then
1408e3a38431SPaul Bohm    case `/usr/bin/file conftest.o` in
1409e3a38431SPaul Bohm    *64-bit*)
1410e3a38431SPaul Bohm      case $lt_cv_prog_gnu_ld in
1411*93823e6cSPaul Bohm      yes*)
1412*93823e6cSPaul Bohm        case $host in
1413*93823e6cSPaul Bohm        i?86-*-solaris*)
1414*93823e6cSPaul Bohm          LD="${LD-ld} -m elf_x86_64"
1415*93823e6cSPaul Bohm          ;;
1416*93823e6cSPaul Bohm        sparc*-*-solaris*)
1417*93823e6cSPaul Bohm          LD="${LD-ld} -m elf64_sparc"
1418*93823e6cSPaul Bohm          ;;
1419*93823e6cSPaul Bohm        esac
1420*93823e6cSPaul Bohm        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1421*93823e6cSPaul Bohm        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1422*93823e6cSPaul Bohm          LD="${LD-ld}_sol2"
1423*93823e6cSPaul Bohm        fi
1424*93823e6cSPaul Bohm        ;;
1425e3a38431SPaul Bohm      *)
1426e3a38431SPaul Bohm	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1427e3a38431SPaul Bohm	  LD="${LD-ld} -64"
1428e3a38431SPaul Bohm	fi
1429e3a38431SPaul Bohm	;;
1430e3a38431SPaul Bohm      esac
1431e3a38431SPaul Bohm      ;;
1432e3a38431SPaul Bohm    esac
1433e3a38431SPaul Bohm  fi
1434e3a38431SPaul Bohm  rm -rf conftest*
1435e3a38431SPaul Bohm  ;;
1436e3a38431SPaul Bohmesac
1437e3a38431SPaul Bohm
1438e3a38431SPaul Bohmneed_locks="$enable_libtool_lock"
1439e3a38431SPaul Bohm])# _LT_ENABLE_LOCK
1440e3a38431SPaul Bohm
1441e3a38431SPaul Bohm
1442*93823e6cSPaul Bohm# _LT_PROG_AR
1443*93823e6cSPaul Bohm# -----------
1444*93823e6cSPaul Bohmm4_defun([_LT_PROG_AR],
1445*93823e6cSPaul Bohm[AC_CHECK_TOOLS(AR, [ar], false)
1446*93823e6cSPaul Bohm: ${AR=ar}
1447*93823e6cSPaul Bohm: ${AR_FLAGS=cru}
1448*93823e6cSPaul Bohm_LT_DECL([], [AR], [1], [The archiver])
1449*93823e6cSPaul Bohm_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1450*93823e6cSPaul Bohm
1451*93823e6cSPaul BohmAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1452*93823e6cSPaul Bohm  [lt_cv_ar_at_file=no
1453*93823e6cSPaul Bohm   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1454*93823e6cSPaul Bohm     [echo conftest.$ac_objext > conftest.lst
1455*93823e6cSPaul Bohm      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1456*93823e6cSPaul Bohm      AC_TRY_EVAL([lt_ar_try])
1457*93823e6cSPaul Bohm      if test "$ac_status" -eq 0; then
1458*93823e6cSPaul Bohm	# Ensure the archiver fails upon bogus file names.
1459*93823e6cSPaul Bohm	rm -f conftest.$ac_objext libconftest.a
1460*93823e6cSPaul Bohm	AC_TRY_EVAL([lt_ar_try])
1461*93823e6cSPaul Bohm	if test "$ac_status" -ne 0; then
1462*93823e6cSPaul Bohm          lt_cv_ar_at_file=@
1463*93823e6cSPaul Bohm        fi
1464*93823e6cSPaul Bohm      fi
1465*93823e6cSPaul Bohm      rm -f conftest.* libconftest.a
1466*93823e6cSPaul Bohm     ])
1467*93823e6cSPaul Bohm  ])
1468*93823e6cSPaul Bohm
1469*93823e6cSPaul Bohmif test "x$lt_cv_ar_at_file" = xno; then
1470*93823e6cSPaul Bohm  archiver_list_spec=
1471*93823e6cSPaul Bohmelse
1472*93823e6cSPaul Bohm  archiver_list_spec=$lt_cv_ar_at_file
1473*93823e6cSPaul Bohmfi
1474*93823e6cSPaul Bohm_LT_DECL([], [archiver_list_spec], [1],
1475*93823e6cSPaul Bohm  [How to feed a file listing to the archiver])
1476*93823e6cSPaul Bohm])# _LT_PROG_AR
1477*93823e6cSPaul Bohm
1478*93823e6cSPaul Bohm
1479e3a38431SPaul Bohm# _LT_CMD_OLD_ARCHIVE
1480e3a38431SPaul Bohm# -------------------
1481e3a38431SPaul Bohmm4_defun([_LT_CMD_OLD_ARCHIVE],
1482*93823e6cSPaul Bohm[_LT_PROG_AR
1483e3a38431SPaul Bohm
1484e3a38431SPaul BohmAC_CHECK_TOOL(STRIP, strip, :)
1485e3a38431SPaul Bohmtest -z "$STRIP" && STRIP=:
1486e3a38431SPaul Bohm_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1487e3a38431SPaul Bohm
1488e3a38431SPaul BohmAC_CHECK_TOOL(RANLIB, ranlib, :)
1489e3a38431SPaul Bohmtest -z "$RANLIB" && RANLIB=:
1490e3a38431SPaul Bohm_LT_DECL([], [RANLIB], [1],
1491e3a38431SPaul Bohm    [Commands used to install an old-style archive])
1492e3a38431SPaul Bohm
1493e3a38431SPaul Bohm# Determine commands to create old-style static archives.
1494e3a38431SPaul Bohmold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1495e3a38431SPaul Bohmold_postinstall_cmds='chmod 644 $oldlib'
1496e3a38431SPaul Bohmold_postuninstall_cmds=
1497e3a38431SPaul Bohm
1498e3a38431SPaul Bohmif test -n "$RANLIB"; then
1499e3a38431SPaul Bohm  case $host_os in
1500e3a38431SPaul Bohm  openbsd*)
1501*93823e6cSPaul Bohm    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1502e3a38431SPaul Bohm    ;;
1503e3a38431SPaul Bohm  *)
1504*93823e6cSPaul Bohm    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1505e3a38431SPaul Bohm    ;;
1506e3a38431SPaul Bohm  esac
1507*93823e6cSPaul Bohm  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1508e3a38431SPaul Bohmfi
1509*93823e6cSPaul Bohm
1510*93823e6cSPaul Bohmcase $host_os in
1511*93823e6cSPaul Bohm  darwin*)
1512*93823e6cSPaul Bohm    lock_old_archive_extraction=yes ;;
1513*93823e6cSPaul Bohm  *)
1514*93823e6cSPaul Bohm    lock_old_archive_extraction=no ;;
1515*93823e6cSPaul Bohmesac
1516e3a38431SPaul Bohm_LT_DECL([], [old_postinstall_cmds], [2])
1517e3a38431SPaul Bohm_LT_DECL([], [old_postuninstall_cmds], [2])
1518e3a38431SPaul Bohm_LT_TAGDECL([], [old_archive_cmds], [2],
1519e3a38431SPaul Bohm    [Commands used to build an old-style archive])
1520*93823e6cSPaul Bohm_LT_DECL([], [lock_old_archive_extraction], [0],
1521*93823e6cSPaul Bohm    [Whether to use a lock for old archive extraction])
1522e3a38431SPaul Bohm])# _LT_CMD_OLD_ARCHIVE
1523e3a38431SPaul Bohm
1524e3a38431SPaul Bohm
1525e3a38431SPaul Bohm# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1526e3a38431SPaul Bohm#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1527e3a38431SPaul Bohm# ----------------------------------------------------------------
1528e3a38431SPaul Bohm# Check whether the given compiler option works
1529e3a38431SPaul BohmAC_DEFUN([_LT_COMPILER_OPTION],
1530e3a38431SPaul Bohm[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1531e3a38431SPaul Bohmm4_require([_LT_DECL_SED])dnl
1532e3a38431SPaul BohmAC_CACHE_CHECK([$1], [$2],
1533e3a38431SPaul Bohm  [$2=no
1534e3a38431SPaul Bohm   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1535e3a38431SPaul Bohm   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1536e3a38431SPaul Bohm   lt_compiler_flag="$3"
1537e3a38431SPaul Bohm   # Insert the option either (1) after the last *FLAGS variable, or
1538e3a38431SPaul Bohm   # (2) before a word containing "conftest.", or (3) at the end.
1539e3a38431SPaul Bohm   # Note that $ac_compile itself does not contain backslashes and begins
1540e3a38431SPaul Bohm   # with a dollar sign (not a hyphen), so the echo should work correctly.
1541e3a38431SPaul Bohm   # The option is referenced via a variable to avoid confusing sed.
1542e3a38431SPaul Bohm   lt_compile=`echo "$ac_compile" | $SED \
1543e3a38431SPaul Bohm   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1544e3a38431SPaul Bohm   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1545e3a38431SPaul Bohm   -e 's:$: $lt_compiler_flag:'`
1546*93823e6cSPaul Bohm   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1547e3a38431SPaul Bohm   (eval "$lt_compile" 2>conftest.err)
1548e3a38431SPaul Bohm   ac_status=$?
1549e3a38431SPaul Bohm   cat conftest.err >&AS_MESSAGE_LOG_FD
1550*93823e6cSPaul Bohm   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1551e3a38431SPaul Bohm   if (exit $ac_status) && test -s "$ac_outfile"; then
1552e3a38431SPaul Bohm     # The compiler can only warn and ignore the option if not recognized
1553e3a38431SPaul Bohm     # So say no if there are warnings other than the usual output.
1554*93823e6cSPaul Bohm     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1555e3a38431SPaul Bohm     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1556e3a38431SPaul Bohm     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1557e3a38431SPaul Bohm       $2=yes
1558e3a38431SPaul Bohm     fi
1559e3a38431SPaul Bohm   fi
1560e3a38431SPaul Bohm   $RM conftest*
1561e3a38431SPaul Bohm])
1562e3a38431SPaul Bohm
1563e3a38431SPaul Bohmif test x"[$]$2" = xyes; then
1564e3a38431SPaul Bohm    m4_if([$5], , :, [$5])
1565e3a38431SPaul Bohmelse
1566e3a38431SPaul Bohm    m4_if([$6], , :, [$6])
1567e3a38431SPaul Bohmfi
1568e3a38431SPaul Bohm])# _LT_COMPILER_OPTION
1569e3a38431SPaul Bohm
1570e3a38431SPaul Bohm# Old name:
1571e3a38431SPaul BohmAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1572e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
1573e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1574e3a38431SPaul Bohm
1575e3a38431SPaul Bohm
1576e3a38431SPaul Bohm# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1577e3a38431SPaul Bohm#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1578e3a38431SPaul Bohm# ----------------------------------------------------
1579e3a38431SPaul Bohm# Check whether the given linker option works
1580e3a38431SPaul BohmAC_DEFUN([_LT_LINKER_OPTION],
1581e3a38431SPaul Bohm[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1582e3a38431SPaul Bohmm4_require([_LT_DECL_SED])dnl
1583e3a38431SPaul BohmAC_CACHE_CHECK([$1], [$2],
1584e3a38431SPaul Bohm  [$2=no
1585e3a38431SPaul Bohm   save_LDFLAGS="$LDFLAGS"
1586e3a38431SPaul Bohm   LDFLAGS="$LDFLAGS $3"
1587e3a38431SPaul Bohm   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1588e3a38431SPaul Bohm   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1589e3a38431SPaul Bohm     # The linker can only warn and ignore the option if not recognized
1590e3a38431SPaul Bohm     # So say no if there are warnings
1591e3a38431SPaul Bohm     if test -s conftest.err; then
1592e3a38431SPaul Bohm       # Append any errors to the config.log.
1593e3a38431SPaul Bohm       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1594*93823e6cSPaul Bohm       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1595e3a38431SPaul Bohm       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1596e3a38431SPaul Bohm       if diff conftest.exp conftest.er2 >/dev/null; then
1597e3a38431SPaul Bohm         $2=yes
1598e3a38431SPaul Bohm       fi
1599e3a38431SPaul Bohm     else
1600e3a38431SPaul Bohm       $2=yes
1601e3a38431SPaul Bohm     fi
1602e3a38431SPaul Bohm   fi
1603e3a38431SPaul Bohm   $RM -r conftest*
1604e3a38431SPaul Bohm   LDFLAGS="$save_LDFLAGS"
1605e3a38431SPaul Bohm])
1606e3a38431SPaul Bohm
1607e3a38431SPaul Bohmif test x"[$]$2" = xyes; then
1608e3a38431SPaul Bohm    m4_if([$4], , :, [$4])
1609e3a38431SPaul Bohmelse
1610e3a38431SPaul Bohm    m4_if([$5], , :, [$5])
1611e3a38431SPaul Bohmfi
1612e3a38431SPaul Bohm])# _LT_LINKER_OPTION
1613e3a38431SPaul Bohm
1614e3a38431SPaul Bohm# Old name:
1615e3a38431SPaul BohmAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1616e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
1617e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1618e3a38431SPaul Bohm
1619e3a38431SPaul Bohm
1620e3a38431SPaul Bohm# LT_CMD_MAX_LEN
1621e3a38431SPaul Bohm#---------------
1622e3a38431SPaul BohmAC_DEFUN([LT_CMD_MAX_LEN],
1623e3a38431SPaul Bohm[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1624e3a38431SPaul Bohm# find the maximum length of command line arguments
1625e3a38431SPaul BohmAC_MSG_CHECKING([the maximum length of command line arguments])
1626e3a38431SPaul BohmAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1627e3a38431SPaul Bohm  i=0
1628e3a38431SPaul Bohm  teststring="ABCD"
1629e3a38431SPaul Bohm
1630e3a38431SPaul Bohm  case $build_os in
1631e3a38431SPaul Bohm  msdosdjgpp*)
1632e3a38431SPaul Bohm    # On DJGPP, this test can blow up pretty badly due to problems in libc
1633e3a38431SPaul Bohm    # (any single argument exceeding 2000 bytes causes a buffer overrun
1634e3a38431SPaul Bohm    # during glob expansion).  Even if it were fixed, the result of this
1635e3a38431SPaul Bohm    # check would be larger than it should be.
1636e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1637e3a38431SPaul Bohm    ;;
1638e3a38431SPaul Bohm
1639e3a38431SPaul Bohm  gnu*)
1640e3a38431SPaul Bohm    # Under GNU Hurd, this test is not required because there is
1641e3a38431SPaul Bohm    # no limit to the length of command line arguments.
1642e3a38431SPaul Bohm    # Libtool will interpret -1 as no limit whatsoever
1643e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=-1;
1644e3a38431SPaul Bohm    ;;
1645e3a38431SPaul Bohm
1646e3a38431SPaul Bohm  cygwin* | mingw* | cegcc*)
1647e3a38431SPaul Bohm    # On Win9x/ME, this test blows up -- it succeeds, but takes
1648e3a38431SPaul Bohm    # about 5 minutes as the teststring grows exponentially.
1649e3a38431SPaul Bohm    # Worse, since 9x/ME are not pre-emptively multitasking,
1650e3a38431SPaul Bohm    # you end up with a "frozen" computer, even though with patience
1651e3a38431SPaul Bohm    # the test eventually succeeds (with a max line length of 256k).
1652e3a38431SPaul Bohm    # Instead, let's just punt: use the minimum linelength reported by
1653e3a38431SPaul Bohm    # all of the supported platforms: 8192 (on NT/2K/XP).
1654e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=8192;
1655e3a38431SPaul Bohm    ;;
1656e3a38431SPaul Bohm
1657*93823e6cSPaul Bohm  mint*)
1658*93823e6cSPaul Bohm    # On MiNT this can take a long time and run out of memory.
1659*93823e6cSPaul Bohm    lt_cv_sys_max_cmd_len=8192;
1660*93823e6cSPaul Bohm    ;;
1661*93823e6cSPaul Bohm
1662e3a38431SPaul Bohm  amigaos*)
1663e3a38431SPaul Bohm    # On AmigaOS with pdksh, this test takes hours, literally.
1664e3a38431SPaul Bohm    # So we just punt and use a minimum line length of 8192.
1665e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=8192;
1666e3a38431SPaul Bohm    ;;
1667e3a38431SPaul Bohm
1668e3a38431SPaul Bohm  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1669e3a38431SPaul Bohm    # This has been around since 386BSD, at least.  Likely further.
1670e3a38431SPaul Bohm    if test -x /sbin/sysctl; then
1671e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1672e3a38431SPaul Bohm    elif test -x /usr/sbin/sysctl; then
1673e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1674e3a38431SPaul Bohm    else
1675e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1676e3a38431SPaul Bohm    fi
1677e3a38431SPaul Bohm    # And add a safety zone
1678e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1679e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1680e3a38431SPaul Bohm    ;;
1681e3a38431SPaul Bohm
1682e3a38431SPaul Bohm  interix*)
1683e3a38431SPaul Bohm    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1684e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=196608
1685e3a38431SPaul Bohm    ;;
1686e3a38431SPaul Bohm
1687*93823e6cSPaul Bohm  os2*)
1688*93823e6cSPaul Bohm    # The test takes a long time on OS/2.
1689*93823e6cSPaul Bohm    lt_cv_sys_max_cmd_len=8192
1690*93823e6cSPaul Bohm    ;;
1691*93823e6cSPaul Bohm
1692e3a38431SPaul Bohm  osf*)
1693e3a38431SPaul Bohm    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1694e3a38431SPaul Bohm    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1695e3a38431SPaul Bohm    # nice to cause kernel panics so lets avoid the loop below.
1696e3a38431SPaul Bohm    # First set a reasonable default.
1697e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=16384
1698e3a38431SPaul Bohm    #
1699e3a38431SPaul Bohm    if test -x /sbin/sysconfig; then
1700e3a38431SPaul Bohm      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1701e3a38431SPaul Bohm        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1702e3a38431SPaul Bohm      esac
1703e3a38431SPaul Bohm    fi
1704e3a38431SPaul Bohm    ;;
1705e3a38431SPaul Bohm  sco3.2v5*)
1706e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=102400
1707e3a38431SPaul Bohm    ;;
1708e3a38431SPaul Bohm  sysv5* | sco5v6* | sysv4.2uw2*)
1709e3a38431SPaul Bohm    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1710e3a38431SPaul Bohm    if test -n "$kargmax"; then
1711e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1712e3a38431SPaul Bohm    else
1713e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=32768
1714e3a38431SPaul Bohm    fi
1715e3a38431SPaul Bohm    ;;
1716e3a38431SPaul Bohm  *)
1717e3a38431SPaul Bohm    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1718*93823e6cSPaul Bohm    if test -n "$lt_cv_sys_max_cmd_len" && \
1719*93823e6cSPaul Bohm	test undefined != "$lt_cv_sys_max_cmd_len"; then
1720e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1721e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1722e3a38431SPaul Bohm    else
1723e3a38431SPaul Bohm      # Make teststring a little bigger before we do anything with it.
1724e3a38431SPaul Bohm      # a 1K string should be a reasonable start.
1725e3a38431SPaul Bohm      for i in 1 2 3 4 5 6 7 8 ; do
1726e3a38431SPaul Bohm        teststring=$teststring$teststring
1727e3a38431SPaul Bohm      done
1728e3a38431SPaul Bohm      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1729e3a38431SPaul Bohm      # If test is not a shell built-in, we'll probably end up computing a
1730e3a38431SPaul Bohm      # maximum length that is only half of the actual maximum length, but
1731e3a38431SPaul Bohm      # we can't tell.
1732*93823e6cSPaul Bohm      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
1733*93823e6cSPaul Bohm	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1734e3a38431SPaul Bohm	      test $i != 17 # 1/2 MB should be enough
1735e3a38431SPaul Bohm      do
1736e3a38431SPaul Bohm        i=`expr $i + 1`
1737e3a38431SPaul Bohm        teststring=$teststring$teststring
1738e3a38431SPaul Bohm      done
1739e3a38431SPaul Bohm      # Only check the string length outside the loop.
1740e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1741e3a38431SPaul Bohm      teststring=
1742e3a38431SPaul Bohm      # Add a significant safety factor because C++ compilers can tack on
1743e3a38431SPaul Bohm      # massive amounts of additional arguments before passing them to the
1744e3a38431SPaul Bohm      # linker.  It appears as though 1/2 is a usable value.
1745e3a38431SPaul Bohm      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1746e3a38431SPaul Bohm    fi
1747e3a38431SPaul Bohm    ;;
1748e3a38431SPaul Bohm  esac
1749e3a38431SPaul Bohm])
1750e3a38431SPaul Bohmif test -n $lt_cv_sys_max_cmd_len ; then
1751e3a38431SPaul Bohm  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1752e3a38431SPaul Bohmelse
1753e3a38431SPaul Bohm  AC_MSG_RESULT(none)
1754e3a38431SPaul Bohmfi
1755e3a38431SPaul Bohmmax_cmd_len=$lt_cv_sys_max_cmd_len
1756e3a38431SPaul Bohm_LT_DECL([], [max_cmd_len], [0],
1757e3a38431SPaul Bohm    [What is the maximum length of a command?])
1758e3a38431SPaul Bohm])# LT_CMD_MAX_LEN
1759e3a38431SPaul Bohm
1760e3a38431SPaul Bohm# Old name:
1761e3a38431SPaul BohmAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1762e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
1763e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1764e3a38431SPaul Bohm
1765e3a38431SPaul Bohm
1766e3a38431SPaul Bohm# _LT_HEADER_DLFCN
1767e3a38431SPaul Bohm# ----------------
1768e3a38431SPaul Bohmm4_defun([_LT_HEADER_DLFCN],
1769e3a38431SPaul Bohm[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1770e3a38431SPaul Bohm])# _LT_HEADER_DLFCN
1771e3a38431SPaul Bohm
1772e3a38431SPaul Bohm
1773e3a38431SPaul Bohm# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1774e3a38431SPaul Bohm#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1775e3a38431SPaul Bohm# ----------------------------------------------------------------
1776e3a38431SPaul Bohmm4_defun([_LT_TRY_DLOPEN_SELF],
1777e3a38431SPaul Bohm[m4_require([_LT_HEADER_DLFCN])dnl
1778e3a38431SPaul Bohmif test "$cross_compiling" = yes; then :
1779e3a38431SPaul Bohm  [$4]
1780e3a38431SPaul Bohmelse
1781e3a38431SPaul Bohm  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1782e3a38431SPaul Bohm  lt_status=$lt_dlunknown
1783e3a38431SPaul Bohm  cat > conftest.$ac_ext <<_LT_EOF
1784*93823e6cSPaul Bohm[#line $LINENO "configure"
1785e3a38431SPaul Bohm#include "confdefs.h"
1786e3a38431SPaul Bohm
1787e3a38431SPaul Bohm#if HAVE_DLFCN_H
1788e3a38431SPaul Bohm#include <dlfcn.h>
1789e3a38431SPaul Bohm#endif
1790e3a38431SPaul Bohm
1791e3a38431SPaul Bohm#include <stdio.h>
1792e3a38431SPaul Bohm
1793e3a38431SPaul Bohm#ifdef RTLD_GLOBAL
1794e3a38431SPaul Bohm#  define LT_DLGLOBAL		RTLD_GLOBAL
1795e3a38431SPaul Bohm#else
1796e3a38431SPaul Bohm#  ifdef DL_GLOBAL
1797e3a38431SPaul Bohm#    define LT_DLGLOBAL		DL_GLOBAL
1798e3a38431SPaul Bohm#  else
1799e3a38431SPaul Bohm#    define LT_DLGLOBAL		0
1800e3a38431SPaul Bohm#  endif
1801e3a38431SPaul Bohm#endif
1802e3a38431SPaul Bohm
1803e3a38431SPaul Bohm/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1804e3a38431SPaul Bohm   find out it does not work in some platform. */
1805e3a38431SPaul Bohm#ifndef LT_DLLAZY_OR_NOW
1806e3a38431SPaul Bohm#  ifdef RTLD_LAZY
1807e3a38431SPaul Bohm#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1808e3a38431SPaul Bohm#  else
1809e3a38431SPaul Bohm#    ifdef DL_LAZY
1810e3a38431SPaul Bohm#      define LT_DLLAZY_OR_NOW		DL_LAZY
1811e3a38431SPaul Bohm#    else
1812e3a38431SPaul Bohm#      ifdef RTLD_NOW
1813e3a38431SPaul Bohm#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1814e3a38431SPaul Bohm#      else
1815e3a38431SPaul Bohm#        ifdef DL_NOW
1816e3a38431SPaul Bohm#          define LT_DLLAZY_OR_NOW	DL_NOW
1817e3a38431SPaul Bohm#        else
1818e3a38431SPaul Bohm#          define LT_DLLAZY_OR_NOW	0
1819e3a38431SPaul Bohm#        endif
1820e3a38431SPaul Bohm#      endif
1821e3a38431SPaul Bohm#    endif
1822e3a38431SPaul Bohm#  endif
1823e3a38431SPaul Bohm#endif
1824e3a38431SPaul Bohm
1825*93823e6cSPaul Bohm/* When -fvisbility=hidden is used, assume the code has been annotated
1826*93823e6cSPaul Bohm   correspondingly for the symbols needed.  */
1827*93823e6cSPaul Bohm#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1828*93823e6cSPaul Bohmint fnord () __attribute__((visibility("default")));
1829*93823e6cSPaul Bohm#endif
1830*93823e6cSPaul Bohm
1831*93823e6cSPaul Bohmint fnord () { return 42; }
1832e3a38431SPaul Bohmint main ()
1833e3a38431SPaul Bohm{
1834e3a38431SPaul Bohm  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1835e3a38431SPaul Bohm  int status = $lt_dlunknown;
1836e3a38431SPaul Bohm
1837e3a38431SPaul Bohm  if (self)
1838e3a38431SPaul Bohm    {
1839e3a38431SPaul Bohm      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1840*93823e6cSPaul Bohm      else
1841*93823e6cSPaul Bohm        {
1842*93823e6cSPaul Bohm	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1843*93823e6cSPaul Bohm          else puts (dlerror ());
1844*93823e6cSPaul Bohm	}
1845e3a38431SPaul Bohm      /* dlclose (self); */
1846e3a38431SPaul Bohm    }
1847e3a38431SPaul Bohm  else
1848e3a38431SPaul Bohm    puts (dlerror ());
1849e3a38431SPaul Bohm
1850e3a38431SPaul Bohm  return status;
1851e3a38431SPaul Bohm}]
1852e3a38431SPaul Bohm_LT_EOF
1853e3a38431SPaul Bohm  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1854e3a38431SPaul Bohm    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1855e3a38431SPaul Bohm    lt_status=$?
1856e3a38431SPaul Bohm    case x$lt_status in
1857e3a38431SPaul Bohm      x$lt_dlno_uscore) $1 ;;
1858e3a38431SPaul Bohm      x$lt_dlneed_uscore) $2 ;;
1859e3a38431SPaul Bohm      x$lt_dlunknown|x*) $3 ;;
1860e3a38431SPaul Bohm    esac
1861e3a38431SPaul Bohm  else :
1862e3a38431SPaul Bohm    # compilation failed
1863e3a38431SPaul Bohm    $3
1864e3a38431SPaul Bohm  fi
1865e3a38431SPaul Bohmfi
1866e3a38431SPaul Bohmrm -fr conftest*
1867e3a38431SPaul Bohm])# _LT_TRY_DLOPEN_SELF
1868e3a38431SPaul Bohm
1869e3a38431SPaul Bohm
1870e3a38431SPaul Bohm# LT_SYS_DLOPEN_SELF
1871e3a38431SPaul Bohm# ------------------
1872e3a38431SPaul BohmAC_DEFUN([LT_SYS_DLOPEN_SELF],
1873e3a38431SPaul Bohm[m4_require([_LT_HEADER_DLFCN])dnl
1874e3a38431SPaul Bohmif test "x$enable_dlopen" != xyes; then
1875e3a38431SPaul Bohm  enable_dlopen=unknown
1876e3a38431SPaul Bohm  enable_dlopen_self=unknown
1877e3a38431SPaul Bohm  enable_dlopen_self_static=unknown
1878e3a38431SPaul Bohmelse
1879e3a38431SPaul Bohm  lt_cv_dlopen=no
1880e3a38431SPaul Bohm  lt_cv_dlopen_libs=
1881e3a38431SPaul Bohm
1882e3a38431SPaul Bohm  case $host_os in
1883e3a38431SPaul Bohm  beos*)
1884e3a38431SPaul Bohm    lt_cv_dlopen="load_add_on"
1885e3a38431SPaul Bohm    lt_cv_dlopen_libs=
1886e3a38431SPaul Bohm    lt_cv_dlopen_self=yes
1887e3a38431SPaul Bohm    ;;
1888e3a38431SPaul Bohm
1889e3a38431SPaul Bohm  mingw* | pw32* | cegcc*)
1890e3a38431SPaul Bohm    lt_cv_dlopen="LoadLibrary"
1891e3a38431SPaul Bohm    lt_cv_dlopen_libs=
1892e3a38431SPaul Bohm    ;;
1893e3a38431SPaul Bohm
1894e3a38431SPaul Bohm  cygwin*)
1895e3a38431SPaul Bohm    lt_cv_dlopen="dlopen"
1896e3a38431SPaul Bohm    lt_cv_dlopen_libs=
1897e3a38431SPaul Bohm    ;;
1898e3a38431SPaul Bohm
1899e3a38431SPaul Bohm  darwin*)
1900e3a38431SPaul Bohm  # if libdl is installed we need to link against it
1901e3a38431SPaul Bohm    AC_CHECK_LIB([dl], [dlopen],
1902e3a38431SPaul Bohm		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1903e3a38431SPaul Bohm    lt_cv_dlopen="dyld"
1904e3a38431SPaul Bohm    lt_cv_dlopen_libs=
1905e3a38431SPaul Bohm    lt_cv_dlopen_self=yes
1906e3a38431SPaul Bohm    ])
1907e3a38431SPaul Bohm    ;;
1908e3a38431SPaul Bohm
1909e3a38431SPaul Bohm  *)
1910e3a38431SPaul Bohm    AC_CHECK_FUNC([shl_load],
1911e3a38431SPaul Bohm	  [lt_cv_dlopen="shl_load"],
1912e3a38431SPaul Bohm      [AC_CHECK_LIB([dld], [shl_load],
1913e3a38431SPaul Bohm	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1914e3a38431SPaul Bohm	[AC_CHECK_FUNC([dlopen],
1915e3a38431SPaul Bohm	      [lt_cv_dlopen="dlopen"],
1916e3a38431SPaul Bohm	  [AC_CHECK_LIB([dl], [dlopen],
1917e3a38431SPaul Bohm		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1918e3a38431SPaul Bohm	    [AC_CHECK_LIB([svld], [dlopen],
1919e3a38431SPaul Bohm		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1920e3a38431SPaul Bohm	      [AC_CHECK_LIB([dld], [dld_link],
1921e3a38431SPaul Bohm		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1922e3a38431SPaul Bohm	      ])
1923e3a38431SPaul Bohm	    ])
1924e3a38431SPaul Bohm	  ])
1925e3a38431SPaul Bohm	])
1926e3a38431SPaul Bohm      ])
1927e3a38431SPaul Bohm    ;;
1928e3a38431SPaul Bohm  esac
1929e3a38431SPaul Bohm
1930e3a38431SPaul Bohm  if test "x$lt_cv_dlopen" != xno; then
1931e3a38431SPaul Bohm    enable_dlopen=yes
1932e3a38431SPaul Bohm  else
1933e3a38431SPaul Bohm    enable_dlopen=no
1934e3a38431SPaul Bohm  fi
1935e3a38431SPaul Bohm
1936e3a38431SPaul Bohm  case $lt_cv_dlopen in
1937e3a38431SPaul Bohm  dlopen)
1938e3a38431SPaul Bohm    save_CPPFLAGS="$CPPFLAGS"
1939e3a38431SPaul Bohm    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1940e3a38431SPaul Bohm
1941e3a38431SPaul Bohm    save_LDFLAGS="$LDFLAGS"
1942e3a38431SPaul Bohm    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1943e3a38431SPaul Bohm
1944e3a38431SPaul Bohm    save_LIBS="$LIBS"
1945e3a38431SPaul Bohm    LIBS="$lt_cv_dlopen_libs $LIBS"
1946e3a38431SPaul Bohm
1947e3a38431SPaul Bohm    AC_CACHE_CHECK([whether a program can dlopen itself],
1948e3a38431SPaul Bohm	  lt_cv_dlopen_self, [dnl
1949e3a38431SPaul Bohm	  _LT_TRY_DLOPEN_SELF(
1950e3a38431SPaul Bohm	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1951e3a38431SPaul Bohm	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1952e3a38431SPaul Bohm    ])
1953e3a38431SPaul Bohm
1954e3a38431SPaul Bohm    if test "x$lt_cv_dlopen_self" = xyes; then
1955e3a38431SPaul Bohm      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1956e3a38431SPaul Bohm      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1957e3a38431SPaul Bohm	  lt_cv_dlopen_self_static, [dnl
1958e3a38431SPaul Bohm	  _LT_TRY_DLOPEN_SELF(
1959e3a38431SPaul Bohm	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1960e3a38431SPaul Bohm	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1961e3a38431SPaul Bohm      ])
1962e3a38431SPaul Bohm    fi
1963e3a38431SPaul Bohm
1964e3a38431SPaul Bohm    CPPFLAGS="$save_CPPFLAGS"
1965e3a38431SPaul Bohm    LDFLAGS="$save_LDFLAGS"
1966e3a38431SPaul Bohm    LIBS="$save_LIBS"
1967e3a38431SPaul Bohm    ;;
1968e3a38431SPaul Bohm  esac
1969e3a38431SPaul Bohm
1970e3a38431SPaul Bohm  case $lt_cv_dlopen_self in
1971e3a38431SPaul Bohm  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1972e3a38431SPaul Bohm  *) enable_dlopen_self=unknown ;;
1973e3a38431SPaul Bohm  esac
1974e3a38431SPaul Bohm
1975e3a38431SPaul Bohm  case $lt_cv_dlopen_self_static in
1976e3a38431SPaul Bohm  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1977e3a38431SPaul Bohm  *) enable_dlopen_self_static=unknown ;;
1978e3a38431SPaul Bohm  esac
1979e3a38431SPaul Bohmfi
1980e3a38431SPaul Bohm_LT_DECL([dlopen_support], [enable_dlopen], [0],
1981e3a38431SPaul Bohm	 [Whether dlopen is supported])
1982e3a38431SPaul Bohm_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1983e3a38431SPaul Bohm	 [Whether dlopen of programs is supported])
1984e3a38431SPaul Bohm_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1985e3a38431SPaul Bohm	 [Whether dlopen of statically linked programs is supported])
1986e3a38431SPaul Bohm])# LT_SYS_DLOPEN_SELF
1987e3a38431SPaul Bohm
1988e3a38431SPaul Bohm# Old name:
1989e3a38431SPaul BohmAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1990e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
1991e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1992e3a38431SPaul Bohm
1993e3a38431SPaul Bohm
1994e3a38431SPaul Bohm# _LT_COMPILER_C_O([TAGNAME])
1995e3a38431SPaul Bohm# ---------------------------
1996e3a38431SPaul Bohm# Check to see if options -c and -o are simultaneously supported by compiler.
1997e3a38431SPaul Bohm# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1998e3a38431SPaul Bohmm4_defun([_LT_COMPILER_C_O],
1999e3a38431SPaul Bohm[m4_require([_LT_DECL_SED])dnl
2000e3a38431SPaul Bohmm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2001e3a38431SPaul Bohmm4_require([_LT_TAG_COMPILER])dnl
2002e3a38431SPaul BohmAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2003e3a38431SPaul Bohm  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2004e3a38431SPaul Bohm  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2005e3a38431SPaul Bohm   $RM -r conftest 2>/dev/null
2006e3a38431SPaul Bohm   mkdir conftest
2007e3a38431SPaul Bohm   cd conftest
2008e3a38431SPaul Bohm   mkdir out
2009e3a38431SPaul Bohm   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2010e3a38431SPaul Bohm
2011e3a38431SPaul Bohm   lt_compiler_flag="-o out/conftest2.$ac_objext"
2012e3a38431SPaul Bohm   # Insert the option either (1) after the last *FLAGS variable, or
2013e3a38431SPaul Bohm   # (2) before a word containing "conftest.", or (3) at the end.
2014e3a38431SPaul Bohm   # Note that $ac_compile itself does not contain backslashes and begins
2015e3a38431SPaul Bohm   # with a dollar sign (not a hyphen), so the echo should work correctly.
2016e3a38431SPaul Bohm   lt_compile=`echo "$ac_compile" | $SED \
2017e3a38431SPaul Bohm   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2018e3a38431SPaul Bohm   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2019e3a38431SPaul Bohm   -e 's:$: $lt_compiler_flag:'`
2020*93823e6cSPaul Bohm   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2021e3a38431SPaul Bohm   (eval "$lt_compile" 2>out/conftest.err)
2022e3a38431SPaul Bohm   ac_status=$?
2023e3a38431SPaul Bohm   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2024*93823e6cSPaul Bohm   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2025e3a38431SPaul Bohm   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2026e3a38431SPaul Bohm   then
2027e3a38431SPaul Bohm     # The compiler can only warn and ignore the option if not recognized
2028e3a38431SPaul Bohm     # So say no if there are warnings
2029*93823e6cSPaul Bohm     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2030e3a38431SPaul Bohm     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2031e3a38431SPaul Bohm     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2032e3a38431SPaul Bohm       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2033e3a38431SPaul Bohm     fi
2034e3a38431SPaul Bohm   fi
2035e3a38431SPaul Bohm   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2036e3a38431SPaul Bohm   $RM conftest*
2037e3a38431SPaul Bohm   # SGI C++ compiler will create directory out/ii_files/ for
2038e3a38431SPaul Bohm   # template instantiation
2039e3a38431SPaul Bohm   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2040e3a38431SPaul Bohm   $RM out/* && rmdir out
2041e3a38431SPaul Bohm   cd ..
2042e3a38431SPaul Bohm   $RM -r conftest
2043e3a38431SPaul Bohm   $RM conftest*
2044e3a38431SPaul Bohm])
2045e3a38431SPaul Bohm_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2046e3a38431SPaul Bohm	[Does compiler simultaneously support -c and -o options?])
2047e3a38431SPaul Bohm])# _LT_COMPILER_C_O
2048e3a38431SPaul Bohm
2049e3a38431SPaul Bohm
2050e3a38431SPaul Bohm# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2051e3a38431SPaul Bohm# ----------------------------------
2052e3a38431SPaul Bohm# Check to see if we can do hard links to lock some files if needed
2053e3a38431SPaul Bohmm4_defun([_LT_COMPILER_FILE_LOCKS],
2054e3a38431SPaul Bohm[m4_require([_LT_ENABLE_LOCK])dnl
2055e3a38431SPaul Bohmm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2056e3a38431SPaul Bohm_LT_COMPILER_C_O([$1])
2057e3a38431SPaul Bohm
2058e3a38431SPaul Bohmhard_links="nottested"
2059e3a38431SPaul Bohmif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2060e3a38431SPaul Bohm  # do not overwrite the value of need_locks provided by the user
2061e3a38431SPaul Bohm  AC_MSG_CHECKING([if we can lock with hard links])
2062e3a38431SPaul Bohm  hard_links=yes
2063e3a38431SPaul Bohm  $RM conftest*
2064e3a38431SPaul Bohm  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2065e3a38431SPaul Bohm  touch conftest.a
2066e3a38431SPaul Bohm  ln conftest.a conftest.b 2>&5 || hard_links=no
2067e3a38431SPaul Bohm  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2068e3a38431SPaul Bohm  AC_MSG_RESULT([$hard_links])
2069e3a38431SPaul Bohm  if test "$hard_links" = no; then
2070e3a38431SPaul Bohm    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2071e3a38431SPaul Bohm    need_locks=warn
2072e3a38431SPaul Bohm  fi
2073e3a38431SPaul Bohmelse
2074e3a38431SPaul Bohm  need_locks=no
2075e3a38431SPaul Bohmfi
2076e3a38431SPaul Bohm_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2077e3a38431SPaul Bohm])# _LT_COMPILER_FILE_LOCKS
2078e3a38431SPaul Bohm
2079e3a38431SPaul Bohm
2080e3a38431SPaul Bohm# _LT_CHECK_OBJDIR
2081e3a38431SPaul Bohm# ----------------
2082e3a38431SPaul Bohmm4_defun([_LT_CHECK_OBJDIR],
2083e3a38431SPaul Bohm[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2084e3a38431SPaul Bohm[rm -f .libs 2>/dev/null
2085e3a38431SPaul Bohmmkdir .libs 2>/dev/null
2086e3a38431SPaul Bohmif test -d .libs; then
2087e3a38431SPaul Bohm  lt_cv_objdir=.libs
2088e3a38431SPaul Bohmelse
2089e3a38431SPaul Bohm  # MS-DOS does not allow filenames that begin with a dot.
2090e3a38431SPaul Bohm  lt_cv_objdir=_libs
2091e3a38431SPaul Bohmfi
2092e3a38431SPaul Bohmrmdir .libs 2>/dev/null])
2093e3a38431SPaul Bohmobjdir=$lt_cv_objdir
2094e3a38431SPaul Bohm_LT_DECL([], [objdir], [0],
2095e3a38431SPaul Bohm         [The name of the directory that contains temporary libtool files])dnl
2096e3a38431SPaul Bohmm4_pattern_allow([LT_OBJDIR])dnl
2097e3a38431SPaul BohmAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2098e3a38431SPaul Bohm  [Define to the sub-directory in which libtool stores uninstalled libraries.])
2099e3a38431SPaul Bohm])# _LT_CHECK_OBJDIR
2100e3a38431SPaul Bohm
2101e3a38431SPaul Bohm
2102e3a38431SPaul Bohm# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2103e3a38431SPaul Bohm# --------------------------------------
2104e3a38431SPaul Bohm# Check hardcoding attributes.
2105e3a38431SPaul Bohmm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2106e3a38431SPaul Bohm[AC_MSG_CHECKING([how to hardcode library paths into programs])
2107e3a38431SPaul Bohm_LT_TAGVAR(hardcode_action, $1)=
2108e3a38431SPaul Bohmif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2109e3a38431SPaul Bohm   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2110e3a38431SPaul Bohm   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2111e3a38431SPaul Bohm
2112e3a38431SPaul Bohm  # We can hardcode non-existent directories.
2113e3a38431SPaul Bohm  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
2114e3a38431SPaul Bohm     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2115e3a38431SPaul Bohm     # have to relink, otherwise we might link with an installed library
2116e3a38431SPaul Bohm     # when we should be linking with a yet-to-be-installed one
2117e3a38431SPaul Bohm     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2118e3a38431SPaul Bohm     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
2119e3a38431SPaul Bohm    # Linking always hardcodes the temporary library directory.
2120e3a38431SPaul Bohm    _LT_TAGVAR(hardcode_action, $1)=relink
2121e3a38431SPaul Bohm  else
2122e3a38431SPaul Bohm    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2123e3a38431SPaul Bohm    _LT_TAGVAR(hardcode_action, $1)=immediate
2124e3a38431SPaul Bohm  fi
2125e3a38431SPaul Bohmelse
2126e3a38431SPaul Bohm  # We cannot hardcode anything, or else we can only hardcode existing
2127e3a38431SPaul Bohm  # directories.
2128e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_action, $1)=unsupported
2129e3a38431SPaul Bohmfi
2130e3a38431SPaul BohmAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2131e3a38431SPaul Bohm
2132e3a38431SPaul Bohmif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2133e3a38431SPaul Bohm   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2134e3a38431SPaul Bohm  # Fast installation is not supported
2135e3a38431SPaul Bohm  enable_fast_install=no
2136e3a38431SPaul Bohmelif test "$shlibpath_overrides_runpath" = yes ||
2137e3a38431SPaul Bohm     test "$enable_shared" = no; then
2138e3a38431SPaul Bohm  # Fast installation is not necessary
2139e3a38431SPaul Bohm  enable_fast_install=needless
2140e3a38431SPaul Bohmfi
2141e3a38431SPaul Bohm_LT_TAGDECL([], [hardcode_action], [0],
2142e3a38431SPaul Bohm    [How to hardcode a shared library path into an executable])
2143e3a38431SPaul Bohm])# _LT_LINKER_HARDCODE_LIBPATH
2144e3a38431SPaul Bohm
2145e3a38431SPaul Bohm
2146e3a38431SPaul Bohm# _LT_CMD_STRIPLIB
2147e3a38431SPaul Bohm# ----------------
2148e3a38431SPaul Bohmm4_defun([_LT_CMD_STRIPLIB],
2149e3a38431SPaul Bohm[m4_require([_LT_DECL_EGREP])
2150e3a38431SPaul Bohmstriplib=
2151e3a38431SPaul Bohmold_striplib=
2152e3a38431SPaul BohmAC_MSG_CHECKING([whether stripping libraries is possible])
2153e3a38431SPaul Bohmif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2154e3a38431SPaul Bohm  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2155e3a38431SPaul Bohm  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2156e3a38431SPaul Bohm  AC_MSG_RESULT([yes])
2157e3a38431SPaul Bohmelse
2158e3a38431SPaul Bohm# FIXME - insert some real tests, host_os isn't really good enough
2159e3a38431SPaul Bohm  case $host_os in
2160e3a38431SPaul Bohm  darwin*)
2161e3a38431SPaul Bohm    if test -n "$STRIP" ; then
2162e3a38431SPaul Bohm      striplib="$STRIP -x"
2163e3a38431SPaul Bohm      old_striplib="$STRIP -S"
2164e3a38431SPaul Bohm      AC_MSG_RESULT([yes])
2165e3a38431SPaul Bohm    else
2166e3a38431SPaul Bohm      AC_MSG_RESULT([no])
2167e3a38431SPaul Bohm    fi
2168e3a38431SPaul Bohm    ;;
2169e3a38431SPaul Bohm  *)
2170e3a38431SPaul Bohm    AC_MSG_RESULT([no])
2171e3a38431SPaul Bohm    ;;
2172e3a38431SPaul Bohm  esac
2173e3a38431SPaul Bohmfi
2174e3a38431SPaul Bohm_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2175e3a38431SPaul Bohm_LT_DECL([], [striplib], [1])
2176e3a38431SPaul Bohm])# _LT_CMD_STRIPLIB
2177e3a38431SPaul Bohm
2178e3a38431SPaul Bohm
2179e3a38431SPaul Bohm# _LT_SYS_DYNAMIC_LINKER([TAG])
2180e3a38431SPaul Bohm# -----------------------------
2181e3a38431SPaul Bohm# PORTME Fill in your ld.so characteristics
2182e3a38431SPaul Bohmm4_defun([_LT_SYS_DYNAMIC_LINKER],
2183e3a38431SPaul Bohm[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2184e3a38431SPaul Bohmm4_require([_LT_DECL_EGREP])dnl
2185e3a38431SPaul Bohmm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2186e3a38431SPaul Bohmm4_require([_LT_DECL_OBJDUMP])dnl
2187e3a38431SPaul Bohmm4_require([_LT_DECL_SED])dnl
2188*93823e6cSPaul Bohmm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2189e3a38431SPaul BohmAC_MSG_CHECKING([dynamic linker characteristics])
2190e3a38431SPaul Bohmm4_if([$1],
2191e3a38431SPaul Bohm	[], [
2192e3a38431SPaul Bohmif test "$GCC" = yes; then
2193e3a38431SPaul Bohm  case $host_os in
2194e3a38431SPaul Bohm    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2195e3a38431SPaul Bohm    *) lt_awk_arg="/^libraries:/" ;;
2196e3a38431SPaul Bohm  esac
2197*93823e6cSPaul Bohm  case $host_os in
2198*93823e6cSPaul Bohm    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2199*93823e6cSPaul Bohm    *) lt_sed_strip_eq="s,=/,/,g" ;;
2200*93823e6cSPaul Bohm  esac
2201*93823e6cSPaul Bohm  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2202*93823e6cSPaul Bohm  case $lt_search_path_spec in
2203*93823e6cSPaul Bohm  *\;*)
2204e3a38431SPaul Bohm    # if the path contains ";" then we assume it to be the separator
2205e3a38431SPaul Bohm    # otherwise default to the standard path separator (i.e. ":") - it is
2206e3a38431SPaul Bohm    # assumed that no part of a normal pathname contains ";" but that should
2207e3a38431SPaul Bohm    # okay in the real world where ";" in dirpaths is itself problematic.
2208*93823e6cSPaul Bohm    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2209*93823e6cSPaul Bohm    ;;
2210*93823e6cSPaul Bohm  *)
2211*93823e6cSPaul Bohm    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2212*93823e6cSPaul Bohm    ;;
2213*93823e6cSPaul Bohm  esac
2214e3a38431SPaul Bohm  # Ok, now we have the path, separated by spaces, we can step through it
2215e3a38431SPaul Bohm  # and add multilib dir if necessary.
2216e3a38431SPaul Bohm  lt_tmp_lt_search_path_spec=
2217e3a38431SPaul Bohm  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2218e3a38431SPaul Bohm  for lt_sys_path in $lt_search_path_spec; do
2219e3a38431SPaul Bohm    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2220e3a38431SPaul Bohm      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2221e3a38431SPaul Bohm    else
2222e3a38431SPaul Bohm      test -d "$lt_sys_path" && \
2223e3a38431SPaul Bohm	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2224e3a38431SPaul Bohm    fi
2225e3a38431SPaul Bohm  done
2226*93823e6cSPaul Bohm  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2227e3a38431SPaul BohmBEGIN {RS=" "; FS="/|\n";} {
2228e3a38431SPaul Bohm  lt_foo="";
2229e3a38431SPaul Bohm  lt_count=0;
2230e3a38431SPaul Bohm  for (lt_i = NF; lt_i > 0; lt_i--) {
2231e3a38431SPaul Bohm    if ($lt_i != "" && $lt_i != ".") {
2232e3a38431SPaul Bohm      if ($lt_i == "..") {
2233e3a38431SPaul Bohm        lt_count++;
2234e3a38431SPaul Bohm      } else {
2235e3a38431SPaul Bohm        if (lt_count == 0) {
2236e3a38431SPaul Bohm          lt_foo="/" $lt_i lt_foo;
2237e3a38431SPaul Bohm        } else {
2238e3a38431SPaul Bohm          lt_count--;
2239e3a38431SPaul Bohm        }
2240e3a38431SPaul Bohm      }
2241e3a38431SPaul Bohm    }
2242e3a38431SPaul Bohm  }
2243e3a38431SPaul Bohm  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2244e3a38431SPaul Bohm  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2245e3a38431SPaul Bohm}'`
2246*93823e6cSPaul Bohm  # AWK program above erroneously prepends '/' to C:/dos/paths
2247*93823e6cSPaul Bohm  # for these hosts.
2248*93823e6cSPaul Bohm  case $host_os in
2249*93823e6cSPaul Bohm    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2250*93823e6cSPaul Bohm      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2251*93823e6cSPaul Bohm  esac
2252*93823e6cSPaul Bohm  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2253e3a38431SPaul Bohmelse
2254e3a38431SPaul Bohm  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2255e3a38431SPaul Bohmfi])
2256e3a38431SPaul Bohmlibrary_names_spec=
2257e3a38431SPaul Bohmlibname_spec='lib$name'
2258e3a38431SPaul Bohmsoname_spec=
2259e3a38431SPaul Bohmshrext_cmds=".so"
2260e3a38431SPaul Bohmpostinstall_cmds=
2261e3a38431SPaul Bohmpostuninstall_cmds=
2262e3a38431SPaul Bohmfinish_cmds=
2263e3a38431SPaul Bohmfinish_eval=
2264e3a38431SPaul Bohmshlibpath_var=
2265e3a38431SPaul Bohmshlibpath_overrides_runpath=unknown
2266e3a38431SPaul Bohmversion_type=none
2267e3a38431SPaul Bohmdynamic_linker="$host_os ld.so"
2268e3a38431SPaul Bohmsys_lib_dlsearch_path_spec="/lib /usr/lib"
2269e3a38431SPaul Bohmneed_lib_prefix=unknown
2270e3a38431SPaul Bohmhardcode_into_libs=no
2271e3a38431SPaul Bohm
2272e3a38431SPaul Bohm# when you set need_version to no, make sure it does not cause -set_version
2273e3a38431SPaul Bohm# flags to be left without arguments
2274e3a38431SPaul Bohmneed_version=unknown
2275e3a38431SPaul Bohm
2276e3a38431SPaul Bohmcase $host_os in
2277e3a38431SPaul Bohmaix3*)
2278*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2279e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2280e3a38431SPaul Bohm  shlibpath_var=LIBPATH
2281e3a38431SPaul Bohm
2282e3a38431SPaul Bohm  # AIX 3 has no versioning support, so we append a major version to the name.
2283e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2284e3a38431SPaul Bohm  ;;
2285e3a38431SPaul Bohm
2286e3a38431SPaul Bohmaix[[4-9]]*)
2287*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2288e3a38431SPaul Bohm  need_lib_prefix=no
2289e3a38431SPaul Bohm  need_version=no
2290e3a38431SPaul Bohm  hardcode_into_libs=yes
2291e3a38431SPaul Bohm  if test "$host_cpu" = ia64; then
2292e3a38431SPaul Bohm    # AIX 5 supports IA64
2293e3a38431SPaul Bohm    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2294e3a38431SPaul Bohm    shlibpath_var=LD_LIBRARY_PATH
2295e3a38431SPaul Bohm  else
2296e3a38431SPaul Bohm    # With GCC up to 2.95.x, collect2 would create an import file
2297e3a38431SPaul Bohm    # for dependence libraries.  The import file would start with
2298e3a38431SPaul Bohm    # the line `#! .'.  This would cause the generated library to
2299e3a38431SPaul Bohm    # depend on `.', always an invalid library.  This was fixed in
2300e3a38431SPaul Bohm    # development snapshots of GCC prior to 3.0.
2301e3a38431SPaul Bohm    case $host_os in
2302e3a38431SPaul Bohm      aix4 | aix4.[[01]] | aix4.[[01]].*)
2303e3a38431SPaul Bohm      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2304e3a38431SPaul Bohm	   echo ' yes '
2305e3a38431SPaul Bohm	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2306e3a38431SPaul Bohm	:
2307e3a38431SPaul Bohm      else
2308e3a38431SPaul Bohm	can_build_shared=no
2309e3a38431SPaul Bohm      fi
2310e3a38431SPaul Bohm      ;;
2311e3a38431SPaul Bohm    esac
2312e3a38431SPaul Bohm    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2313e3a38431SPaul Bohm    # soname into executable. Probably we can add versioning support to
2314e3a38431SPaul Bohm    # collect2, so additional links can be useful in future.
2315e3a38431SPaul Bohm    if test "$aix_use_runtimelinking" = yes; then
2316e3a38431SPaul Bohm      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2317e3a38431SPaul Bohm      # instead of lib<name>.a to let people know that these are not
2318e3a38431SPaul Bohm      # typical AIX shared libraries.
2319e3a38431SPaul Bohm      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2320e3a38431SPaul Bohm    else
2321e3a38431SPaul Bohm      # We preserve .a as extension for shared libraries through AIX4.2
2322e3a38431SPaul Bohm      # and later when we are not doing run time linking.
2323e3a38431SPaul Bohm      library_names_spec='${libname}${release}.a $libname.a'
2324e3a38431SPaul Bohm      soname_spec='${libname}${release}${shared_ext}$major'
2325e3a38431SPaul Bohm    fi
2326e3a38431SPaul Bohm    shlibpath_var=LIBPATH
2327e3a38431SPaul Bohm  fi
2328e3a38431SPaul Bohm  ;;
2329e3a38431SPaul Bohm
2330e3a38431SPaul Bohmamigaos*)
2331e3a38431SPaul Bohm  case $host_cpu in
2332e3a38431SPaul Bohm  powerpc)
2333e3a38431SPaul Bohm    # Since July 2007 AmigaOS4 officially supports .so libraries.
2334e3a38431SPaul Bohm    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2335e3a38431SPaul Bohm    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2336e3a38431SPaul Bohm    ;;
2337e3a38431SPaul Bohm  m68k)
2338e3a38431SPaul Bohm    library_names_spec='$libname.ixlibrary $libname.a'
2339e3a38431SPaul Bohm    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2340*93823e6cSPaul Bohm    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2341e3a38431SPaul Bohm    ;;
2342e3a38431SPaul Bohm  esac
2343e3a38431SPaul Bohm  ;;
2344e3a38431SPaul Bohm
2345e3a38431SPaul Bohmbeos*)
2346e3a38431SPaul Bohm  library_names_spec='${libname}${shared_ext}'
2347e3a38431SPaul Bohm  dynamic_linker="$host_os ld.so"
2348e3a38431SPaul Bohm  shlibpath_var=LIBRARY_PATH
2349e3a38431SPaul Bohm  ;;
2350e3a38431SPaul Bohm
2351e3a38431SPaul Bohmbsdi[[45]]*)
2352*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2353e3a38431SPaul Bohm  need_version=no
2354e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2355e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2356e3a38431SPaul Bohm  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2357e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2358e3a38431SPaul Bohm  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2359e3a38431SPaul Bohm  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2360e3a38431SPaul Bohm  # the default ld.so.conf also contains /usr/contrib/lib and
2361e3a38431SPaul Bohm  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2362e3a38431SPaul Bohm  # libtool to hard-code these into programs
2363e3a38431SPaul Bohm  ;;
2364e3a38431SPaul Bohm
2365e3a38431SPaul Bohmcygwin* | mingw* | pw32* | cegcc*)
2366e3a38431SPaul Bohm  version_type=windows
2367e3a38431SPaul Bohm  shrext_cmds=".dll"
2368e3a38431SPaul Bohm  need_version=no
2369e3a38431SPaul Bohm  need_lib_prefix=no
2370e3a38431SPaul Bohm
2371*93823e6cSPaul Bohm  case $GCC,$cc_basename in
2372*93823e6cSPaul Bohm  yes,*)
2373*93823e6cSPaul Bohm    # gcc
2374e3a38431SPaul Bohm    library_names_spec='$libname.dll.a'
2375e3a38431SPaul Bohm    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2376e3a38431SPaul Bohm    postinstall_cmds='base_file=`basename \${file}`~
2377e3a38431SPaul Bohm      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2378e3a38431SPaul Bohm      dldir=$destdir/`dirname \$dlpath`~
2379e3a38431SPaul Bohm      test -d \$dldir || mkdir -p \$dldir~
2380e3a38431SPaul Bohm      $install_prog $dir/$dlname \$dldir/$dlname~
2381e3a38431SPaul Bohm      chmod a+x \$dldir/$dlname~
2382e3a38431SPaul Bohm      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2383e3a38431SPaul Bohm        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2384e3a38431SPaul Bohm      fi'
2385e3a38431SPaul Bohm    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2386e3a38431SPaul Bohm      dlpath=$dir/\$dldll~
2387e3a38431SPaul Bohm       $RM \$dlpath'
2388e3a38431SPaul Bohm    shlibpath_overrides_runpath=yes
2389e3a38431SPaul Bohm
2390e3a38431SPaul Bohm    case $host_os in
2391e3a38431SPaul Bohm    cygwin*)
2392e3a38431SPaul Bohm      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2393e3a38431SPaul Bohm      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2394*93823e6cSPaul Bohmm4_if([$1], [],[
2395*93823e6cSPaul Bohm      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2396e3a38431SPaul Bohm      ;;
2397e3a38431SPaul Bohm    mingw* | cegcc*)
2398e3a38431SPaul Bohm      # MinGW DLLs use traditional 'lib' prefix
2399e3a38431SPaul Bohm      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2400e3a38431SPaul Bohm      ;;
2401e3a38431SPaul Bohm    pw32*)
2402e3a38431SPaul Bohm      # pw32 DLLs use 'pw' prefix rather than 'lib'
2403e3a38431SPaul Bohm      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2404e3a38431SPaul Bohm      ;;
2405e3a38431SPaul Bohm    esac
2406*93823e6cSPaul Bohm    dynamic_linker='Win32 ld.exe'
2407*93823e6cSPaul Bohm    ;;
2408*93823e6cSPaul Bohm
2409*93823e6cSPaul Bohm  *,cl*)
2410*93823e6cSPaul Bohm    # Native MSVC
2411*93823e6cSPaul Bohm    libname_spec='$name'
2412*93823e6cSPaul Bohm    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2413*93823e6cSPaul Bohm    library_names_spec='${libname}.dll.lib'
2414*93823e6cSPaul Bohm
2415*93823e6cSPaul Bohm    case $build_os in
2416*93823e6cSPaul Bohm    mingw*)
2417*93823e6cSPaul Bohm      sys_lib_search_path_spec=
2418*93823e6cSPaul Bohm      lt_save_ifs=$IFS
2419*93823e6cSPaul Bohm      IFS=';'
2420*93823e6cSPaul Bohm      for lt_path in $LIB
2421*93823e6cSPaul Bohm      do
2422*93823e6cSPaul Bohm        IFS=$lt_save_ifs
2423*93823e6cSPaul Bohm        # Let DOS variable expansion print the short 8.3 style file name.
2424*93823e6cSPaul Bohm        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2425*93823e6cSPaul Bohm        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2426*93823e6cSPaul Bohm      done
2427*93823e6cSPaul Bohm      IFS=$lt_save_ifs
2428*93823e6cSPaul Bohm      # Convert to MSYS style.
2429*93823e6cSPaul Bohm      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2430*93823e6cSPaul Bohm      ;;
2431*93823e6cSPaul Bohm    cygwin*)
2432*93823e6cSPaul Bohm      # Convert to unix form, then to dos form, then back to unix form
2433*93823e6cSPaul Bohm      # but this time dos style (no spaces!) so that the unix form looks
2434*93823e6cSPaul Bohm      # like /cygdrive/c/PROGRA~1:/cygdr...
2435*93823e6cSPaul Bohm      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2436*93823e6cSPaul Bohm      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2437*93823e6cSPaul Bohm      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2438*93823e6cSPaul Bohm      ;;
2439*93823e6cSPaul Bohm    *)
2440*93823e6cSPaul Bohm      sys_lib_search_path_spec="$LIB"
2441*93823e6cSPaul Bohm      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2442*93823e6cSPaul Bohm        # It is most probably a Windows format PATH.
2443*93823e6cSPaul Bohm        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2444*93823e6cSPaul Bohm      else
2445*93823e6cSPaul Bohm        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2446*93823e6cSPaul Bohm      fi
2447*93823e6cSPaul Bohm      # FIXME: find the short name or the path components, as spaces are
2448*93823e6cSPaul Bohm      # common. (e.g. "Program Files" -> "PROGRA~1")
2449*93823e6cSPaul Bohm      ;;
2450*93823e6cSPaul Bohm    esac
2451*93823e6cSPaul Bohm
2452*93823e6cSPaul Bohm    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2453*93823e6cSPaul Bohm    postinstall_cmds='base_file=`basename \${file}`~
2454*93823e6cSPaul Bohm      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2455*93823e6cSPaul Bohm      dldir=$destdir/`dirname \$dlpath`~
2456*93823e6cSPaul Bohm      test -d \$dldir || mkdir -p \$dldir~
2457*93823e6cSPaul Bohm      $install_prog $dir/$dlname \$dldir/$dlname'
2458*93823e6cSPaul Bohm    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2459*93823e6cSPaul Bohm      dlpath=$dir/\$dldll~
2460*93823e6cSPaul Bohm       $RM \$dlpath'
2461*93823e6cSPaul Bohm    shlibpath_overrides_runpath=yes
2462*93823e6cSPaul Bohm    dynamic_linker='Win32 link.exe'
2463e3a38431SPaul Bohm    ;;
2464e3a38431SPaul Bohm
2465e3a38431SPaul Bohm  *)
2466*93823e6cSPaul Bohm    # Assume MSVC wrapper
2467e3a38431SPaul Bohm    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2468*93823e6cSPaul Bohm    dynamic_linker='Win32 ld.exe'
2469e3a38431SPaul Bohm    ;;
2470e3a38431SPaul Bohm  esac
2471e3a38431SPaul Bohm  # FIXME: first we should search . and the directory the executable is in
2472e3a38431SPaul Bohm  shlibpath_var=PATH
2473e3a38431SPaul Bohm  ;;
2474e3a38431SPaul Bohm
2475e3a38431SPaul Bohmdarwin* | rhapsody*)
2476e3a38431SPaul Bohm  dynamic_linker="$host_os dyld"
2477e3a38431SPaul Bohm  version_type=darwin
2478e3a38431SPaul Bohm  need_lib_prefix=no
2479e3a38431SPaul Bohm  need_version=no
2480e3a38431SPaul Bohm  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2481e3a38431SPaul Bohm  soname_spec='${libname}${release}${major}$shared_ext'
2482e3a38431SPaul Bohm  shlibpath_overrides_runpath=yes
2483e3a38431SPaul Bohm  shlibpath_var=DYLD_LIBRARY_PATH
2484e3a38431SPaul Bohm  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2485e3a38431SPaul Bohmm4_if([$1], [],[
2486e3a38431SPaul Bohm  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2487e3a38431SPaul Bohm  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2488e3a38431SPaul Bohm  ;;
2489e3a38431SPaul Bohm
2490e3a38431SPaul Bohmdgux*)
2491*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2492e3a38431SPaul Bohm  need_lib_prefix=no
2493e3a38431SPaul Bohm  need_version=no
2494e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2495e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2496e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2497e3a38431SPaul Bohm  ;;
2498e3a38431SPaul Bohm
2499e3a38431SPaul Bohmfreebsd* | dragonfly*)
2500e3a38431SPaul Bohm  # DragonFly does not have aout.  When/if they implement a new
2501e3a38431SPaul Bohm  # versioning mechanism, adjust this.
2502e3a38431SPaul Bohm  if test -x /usr/bin/objformat; then
2503e3a38431SPaul Bohm    objformat=`/usr/bin/objformat`
2504e3a38431SPaul Bohm  else
2505e3a38431SPaul Bohm    case $host_os in
2506*93823e6cSPaul Bohm    freebsd[[23]].*) objformat=aout ;;
2507e3a38431SPaul Bohm    *) objformat=elf ;;
2508e3a38431SPaul Bohm    esac
2509e3a38431SPaul Bohm  fi
2510e3a38431SPaul Bohm  version_type=freebsd-$objformat
2511e3a38431SPaul Bohm  case $version_type in
2512e3a38431SPaul Bohm    freebsd-elf*)
2513e3a38431SPaul Bohm      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2514e3a38431SPaul Bohm      need_version=no
2515e3a38431SPaul Bohm      need_lib_prefix=no
2516e3a38431SPaul Bohm      ;;
2517e3a38431SPaul Bohm    freebsd-*)
2518e3a38431SPaul Bohm      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2519e3a38431SPaul Bohm      need_version=yes
2520e3a38431SPaul Bohm      ;;
2521e3a38431SPaul Bohm  esac
2522e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2523e3a38431SPaul Bohm  case $host_os in
2524*93823e6cSPaul Bohm  freebsd2.*)
2525e3a38431SPaul Bohm    shlibpath_overrides_runpath=yes
2526e3a38431SPaul Bohm    ;;
2527e3a38431SPaul Bohm  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2528e3a38431SPaul Bohm    shlibpath_overrides_runpath=yes
2529e3a38431SPaul Bohm    hardcode_into_libs=yes
2530e3a38431SPaul Bohm    ;;
2531e3a38431SPaul Bohm  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2532e3a38431SPaul Bohm  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2533e3a38431SPaul Bohm    shlibpath_overrides_runpath=no
2534e3a38431SPaul Bohm    hardcode_into_libs=yes
2535e3a38431SPaul Bohm    ;;
2536e3a38431SPaul Bohm  *) # from 4.6 on, and DragonFly
2537e3a38431SPaul Bohm    shlibpath_overrides_runpath=yes
2538e3a38431SPaul Bohm    hardcode_into_libs=yes
2539e3a38431SPaul Bohm    ;;
2540e3a38431SPaul Bohm  esac
2541e3a38431SPaul Bohm  ;;
2542e3a38431SPaul Bohm
2543*93823e6cSPaul Bohmhaiku*)
2544*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2545e3a38431SPaul Bohm  need_lib_prefix=no
2546e3a38431SPaul Bohm  need_version=no
2547*93823e6cSPaul Bohm  dynamic_linker="$host_os runtime_loader"
2548e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2549e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2550*93823e6cSPaul Bohm  shlibpath_var=LIBRARY_PATH
2551*93823e6cSPaul Bohm  shlibpath_overrides_runpath=yes
2552*93823e6cSPaul Bohm  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2553e3a38431SPaul Bohm  hardcode_into_libs=yes
2554e3a38431SPaul Bohm  ;;
2555e3a38431SPaul Bohm
2556e3a38431SPaul Bohmhpux9* | hpux10* | hpux11*)
2557e3a38431SPaul Bohm  # Give a soname corresponding to the major version so that dld.sl refuses to
2558e3a38431SPaul Bohm  # link against other versions.
2559e3a38431SPaul Bohm  version_type=sunos
2560e3a38431SPaul Bohm  need_lib_prefix=no
2561e3a38431SPaul Bohm  need_version=no
2562e3a38431SPaul Bohm  case $host_cpu in
2563e3a38431SPaul Bohm  ia64*)
2564e3a38431SPaul Bohm    shrext_cmds='.so'
2565e3a38431SPaul Bohm    hardcode_into_libs=yes
2566e3a38431SPaul Bohm    dynamic_linker="$host_os dld.so"
2567e3a38431SPaul Bohm    shlibpath_var=LD_LIBRARY_PATH
2568e3a38431SPaul Bohm    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2569e3a38431SPaul Bohm    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2570e3a38431SPaul Bohm    soname_spec='${libname}${release}${shared_ext}$major'
2571e3a38431SPaul Bohm    if test "X$HPUX_IA64_MODE" = X32; then
2572e3a38431SPaul Bohm      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2573e3a38431SPaul Bohm    else
2574e3a38431SPaul Bohm      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2575e3a38431SPaul Bohm    fi
2576e3a38431SPaul Bohm    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2577e3a38431SPaul Bohm    ;;
2578e3a38431SPaul Bohm  hppa*64*)
2579e3a38431SPaul Bohm    shrext_cmds='.sl'
2580e3a38431SPaul Bohm    hardcode_into_libs=yes
2581e3a38431SPaul Bohm    dynamic_linker="$host_os dld.sl"
2582e3a38431SPaul Bohm    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2583e3a38431SPaul Bohm    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2584e3a38431SPaul Bohm    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2585e3a38431SPaul Bohm    soname_spec='${libname}${release}${shared_ext}$major'
2586e3a38431SPaul Bohm    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2587e3a38431SPaul Bohm    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2588e3a38431SPaul Bohm    ;;
2589e3a38431SPaul Bohm  *)
2590e3a38431SPaul Bohm    shrext_cmds='.sl'
2591e3a38431SPaul Bohm    dynamic_linker="$host_os dld.sl"
2592e3a38431SPaul Bohm    shlibpath_var=SHLIB_PATH
2593e3a38431SPaul Bohm    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2594e3a38431SPaul Bohm    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2595e3a38431SPaul Bohm    soname_spec='${libname}${release}${shared_ext}$major'
2596e3a38431SPaul Bohm    ;;
2597e3a38431SPaul Bohm  esac
2598*93823e6cSPaul Bohm  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2599e3a38431SPaul Bohm  postinstall_cmds='chmod 555 $lib'
2600*93823e6cSPaul Bohm  # or fails outright, so override atomically:
2601*93823e6cSPaul Bohm  install_override_mode=555
2602e3a38431SPaul Bohm  ;;
2603e3a38431SPaul Bohm
2604e3a38431SPaul Bohminterix[[3-9]]*)
2605*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2606e3a38431SPaul Bohm  need_lib_prefix=no
2607e3a38431SPaul Bohm  need_version=no
2608e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2609e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2610e3a38431SPaul Bohm  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2611e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2612e3a38431SPaul Bohm  shlibpath_overrides_runpath=no
2613e3a38431SPaul Bohm  hardcode_into_libs=yes
2614e3a38431SPaul Bohm  ;;
2615e3a38431SPaul Bohm
2616e3a38431SPaul Bohmirix5* | irix6* | nonstopux*)
2617e3a38431SPaul Bohm  case $host_os in
2618e3a38431SPaul Bohm    nonstopux*) version_type=nonstopux ;;
2619e3a38431SPaul Bohm    *)
2620e3a38431SPaul Bohm	if test "$lt_cv_prog_gnu_ld" = yes; then
2621*93823e6cSPaul Bohm		version_type=linux # correct to gnu/linux during the next big refactor
2622e3a38431SPaul Bohm	else
2623e3a38431SPaul Bohm		version_type=irix
2624e3a38431SPaul Bohm	fi ;;
2625e3a38431SPaul Bohm  esac
2626e3a38431SPaul Bohm  need_lib_prefix=no
2627e3a38431SPaul Bohm  need_version=no
2628e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2629e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2630e3a38431SPaul Bohm  case $host_os in
2631e3a38431SPaul Bohm  irix5* | nonstopux*)
2632e3a38431SPaul Bohm    libsuff= shlibsuff=
2633e3a38431SPaul Bohm    ;;
2634e3a38431SPaul Bohm  *)
2635e3a38431SPaul Bohm    case $LD in # libtool.m4 will add one of these switches to LD
2636e3a38431SPaul Bohm    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2637e3a38431SPaul Bohm      libsuff= shlibsuff= libmagic=32-bit;;
2638e3a38431SPaul Bohm    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2639e3a38431SPaul Bohm      libsuff=32 shlibsuff=N32 libmagic=N32;;
2640e3a38431SPaul Bohm    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2641e3a38431SPaul Bohm      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2642e3a38431SPaul Bohm    *) libsuff= shlibsuff= libmagic=never-match;;
2643e3a38431SPaul Bohm    esac
2644e3a38431SPaul Bohm    ;;
2645e3a38431SPaul Bohm  esac
2646e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2647e3a38431SPaul Bohm  shlibpath_overrides_runpath=no
2648e3a38431SPaul Bohm  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2649e3a38431SPaul Bohm  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2650e3a38431SPaul Bohm  hardcode_into_libs=yes
2651e3a38431SPaul Bohm  ;;
2652e3a38431SPaul Bohm
2653e3a38431SPaul Bohm# No shared lib support for Linux oldld, aout, or coff.
2654e3a38431SPaul Bohmlinux*oldld* | linux*aout* | linux*coff*)
2655e3a38431SPaul Bohm  dynamic_linker=no
2656e3a38431SPaul Bohm  ;;
2657e3a38431SPaul Bohm
2658*93823e6cSPaul Bohm# This must be glibc/ELF.
2659*93823e6cSPaul Bohmlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2660*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2661e3a38431SPaul Bohm  need_lib_prefix=no
2662e3a38431SPaul Bohm  need_version=no
2663e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2664e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2665e3a38431SPaul Bohm  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2666e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2667e3a38431SPaul Bohm  shlibpath_overrides_runpath=no
2668*93823e6cSPaul Bohm
2669e3a38431SPaul Bohm  # Some binutils ld are patched to set DT_RUNPATH
2670*93823e6cSPaul Bohm  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2671*93823e6cSPaul Bohm    [lt_cv_shlibpath_overrides_runpath=no
2672e3a38431SPaul Bohm    save_LDFLAGS=$LDFLAGS
2673e3a38431SPaul Bohm    save_libdir=$libdir
2674e3a38431SPaul Bohm    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2675e3a38431SPaul Bohm	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2676e3a38431SPaul Bohm    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2677e3a38431SPaul Bohm      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2678*93823e6cSPaul Bohm	 [lt_cv_shlibpath_overrides_runpath=yes])])
2679e3a38431SPaul Bohm    LDFLAGS=$save_LDFLAGS
2680e3a38431SPaul Bohm    libdir=$save_libdir
2681*93823e6cSPaul Bohm    ])
2682*93823e6cSPaul Bohm  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2683e3a38431SPaul Bohm
2684e3a38431SPaul Bohm  # This implies no fast_install, which is unacceptable.
2685e3a38431SPaul Bohm  # Some rework will be needed to allow for fast_install
2686e3a38431SPaul Bohm  # before this can be enabled.
2687e3a38431SPaul Bohm  hardcode_into_libs=yes
2688e3a38431SPaul Bohm
2689e3a38431SPaul Bohm  # Append ld.so.conf contents to the search path
2690e3a38431SPaul Bohm  if test -f /etc/ld.so.conf; then
2691*93823e6cSPaul Bohm    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' ' '`
2692e3a38431SPaul Bohm    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2693e3a38431SPaul Bohm  fi
2694e3a38431SPaul Bohm
2695e3a38431SPaul Bohm  # We used to test for /lib/ld.so.1 and disable shared libraries on
2696e3a38431SPaul Bohm  # powerpc, because MkLinux only supported shared libraries with the
2697e3a38431SPaul Bohm  # GNU dynamic linker.  Since this was broken with cross compilers,
2698e3a38431SPaul Bohm  # most powerpc-linux boxes support dynamic linking these days and
2699e3a38431SPaul Bohm  # people can always --disable-shared, the test was removed, and we
2700e3a38431SPaul Bohm  # assume the GNU/Linux dynamic linker is in use.
2701e3a38431SPaul Bohm  dynamic_linker='GNU/Linux ld.so'
2702e3a38431SPaul Bohm  ;;
2703e3a38431SPaul Bohm
2704e3a38431SPaul Bohmnetbsdelf*-gnu)
2705e3a38431SPaul Bohm  version_type=linux
2706e3a38431SPaul Bohm  need_lib_prefix=no
2707e3a38431SPaul Bohm  need_version=no
2708e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2709e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2710e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2711e3a38431SPaul Bohm  shlibpath_overrides_runpath=no
2712e3a38431SPaul Bohm  hardcode_into_libs=yes
2713e3a38431SPaul Bohm  dynamic_linker='NetBSD ld.elf_so'
2714e3a38431SPaul Bohm  ;;
2715e3a38431SPaul Bohm
2716e3a38431SPaul Bohmnetbsd*)
2717e3a38431SPaul Bohm  version_type=sunos
2718e3a38431SPaul Bohm  need_lib_prefix=no
2719e3a38431SPaul Bohm  need_version=no
2720e3a38431SPaul Bohm  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2721e3a38431SPaul Bohm    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2722e3a38431SPaul Bohm    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2723e3a38431SPaul Bohm    dynamic_linker='NetBSD (a.out) ld.so'
2724e3a38431SPaul Bohm  else
2725e3a38431SPaul Bohm    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2726e3a38431SPaul Bohm    soname_spec='${libname}${release}${shared_ext}$major'
2727e3a38431SPaul Bohm    dynamic_linker='NetBSD ld.elf_so'
2728e3a38431SPaul Bohm  fi
2729e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2730e3a38431SPaul Bohm  shlibpath_overrides_runpath=yes
2731e3a38431SPaul Bohm  hardcode_into_libs=yes
2732e3a38431SPaul Bohm  ;;
2733e3a38431SPaul Bohm
2734e3a38431SPaul Bohmnewsos6)
2735*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2736e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2737e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2738e3a38431SPaul Bohm  shlibpath_overrides_runpath=yes
2739e3a38431SPaul Bohm  ;;
2740e3a38431SPaul Bohm
2741e3a38431SPaul Bohm*nto* | *qnx*)
2742e3a38431SPaul Bohm  version_type=qnx
2743e3a38431SPaul Bohm  need_lib_prefix=no
2744e3a38431SPaul Bohm  need_version=no
2745e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2746e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2747e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2748e3a38431SPaul Bohm  shlibpath_overrides_runpath=no
2749e3a38431SPaul Bohm  hardcode_into_libs=yes
2750e3a38431SPaul Bohm  dynamic_linker='ldqnx.so'
2751e3a38431SPaul Bohm  ;;
2752e3a38431SPaul Bohm
2753e3a38431SPaul Bohmopenbsd*)
2754e3a38431SPaul Bohm  version_type=sunos
2755e3a38431SPaul Bohm  sys_lib_dlsearch_path_spec="/usr/lib"
2756e3a38431SPaul Bohm  need_lib_prefix=no
2757e3a38431SPaul Bohm  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2758e3a38431SPaul Bohm  case $host_os in
2759e3a38431SPaul Bohm    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2760e3a38431SPaul Bohm    *)				need_version=no  ;;
2761e3a38431SPaul Bohm  esac
2762e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2763e3a38431SPaul Bohm  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2764e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2765e3a38431SPaul Bohm  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2766e3a38431SPaul Bohm    case $host_os in
2767e3a38431SPaul Bohm      openbsd2.[[89]] | openbsd2.[[89]].*)
2768e3a38431SPaul Bohm	shlibpath_overrides_runpath=no
2769e3a38431SPaul Bohm	;;
2770e3a38431SPaul Bohm      *)
2771e3a38431SPaul Bohm	shlibpath_overrides_runpath=yes
2772e3a38431SPaul Bohm	;;
2773e3a38431SPaul Bohm      esac
2774e3a38431SPaul Bohm  else
2775e3a38431SPaul Bohm    shlibpath_overrides_runpath=yes
2776e3a38431SPaul Bohm  fi
2777e3a38431SPaul Bohm  ;;
2778e3a38431SPaul Bohm
2779e3a38431SPaul Bohmos2*)
2780e3a38431SPaul Bohm  libname_spec='$name'
2781e3a38431SPaul Bohm  shrext_cmds=".dll"
2782e3a38431SPaul Bohm  need_lib_prefix=no
2783e3a38431SPaul Bohm  library_names_spec='$libname${shared_ext} $libname.a'
2784e3a38431SPaul Bohm  dynamic_linker='OS/2 ld.exe'
2785e3a38431SPaul Bohm  shlibpath_var=LIBPATH
2786e3a38431SPaul Bohm  ;;
2787e3a38431SPaul Bohm
2788e3a38431SPaul Bohmosf3* | osf4* | osf5*)
2789e3a38431SPaul Bohm  version_type=osf
2790e3a38431SPaul Bohm  need_lib_prefix=no
2791e3a38431SPaul Bohm  need_version=no
2792e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2793e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2794e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2795e3a38431SPaul Bohm  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2796e3a38431SPaul Bohm  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2797e3a38431SPaul Bohm  ;;
2798e3a38431SPaul Bohm
2799e3a38431SPaul Bohmrdos*)
2800e3a38431SPaul Bohm  dynamic_linker=no
2801e3a38431SPaul Bohm  ;;
2802e3a38431SPaul Bohm
2803e3a38431SPaul Bohmsolaris*)
2804*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2805e3a38431SPaul Bohm  need_lib_prefix=no
2806e3a38431SPaul Bohm  need_version=no
2807e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2808e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2809e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2810e3a38431SPaul Bohm  shlibpath_overrides_runpath=yes
2811e3a38431SPaul Bohm  hardcode_into_libs=yes
2812e3a38431SPaul Bohm  # ldd complains unless libraries are executable
2813e3a38431SPaul Bohm  postinstall_cmds='chmod +x $lib'
2814e3a38431SPaul Bohm  ;;
2815e3a38431SPaul Bohm
2816e3a38431SPaul Bohmsunos4*)
2817e3a38431SPaul Bohm  version_type=sunos
2818e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2819e3a38431SPaul Bohm  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2820e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2821e3a38431SPaul Bohm  shlibpath_overrides_runpath=yes
2822e3a38431SPaul Bohm  if test "$with_gnu_ld" = yes; then
2823e3a38431SPaul Bohm    need_lib_prefix=no
2824e3a38431SPaul Bohm  fi
2825e3a38431SPaul Bohm  need_version=yes
2826e3a38431SPaul Bohm  ;;
2827e3a38431SPaul Bohm
2828e3a38431SPaul Bohmsysv4 | sysv4.3*)
2829*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2830e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2831e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2832e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2833e3a38431SPaul Bohm  case $host_vendor in
2834e3a38431SPaul Bohm    sni)
2835e3a38431SPaul Bohm      shlibpath_overrides_runpath=no
2836e3a38431SPaul Bohm      need_lib_prefix=no
2837e3a38431SPaul Bohm      runpath_var=LD_RUN_PATH
2838e3a38431SPaul Bohm      ;;
2839e3a38431SPaul Bohm    siemens)
2840e3a38431SPaul Bohm      need_lib_prefix=no
2841e3a38431SPaul Bohm      ;;
2842e3a38431SPaul Bohm    motorola)
2843e3a38431SPaul Bohm      need_lib_prefix=no
2844e3a38431SPaul Bohm      need_version=no
2845e3a38431SPaul Bohm      shlibpath_overrides_runpath=no
2846e3a38431SPaul Bohm      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2847e3a38431SPaul Bohm      ;;
2848e3a38431SPaul Bohm  esac
2849e3a38431SPaul Bohm  ;;
2850e3a38431SPaul Bohm
2851e3a38431SPaul Bohmsysv4*MP*)
2852e3a38431SPaul Bohm  if test -d /usr/nec ;then
2853*93823e6cSPaul Bohm    version_type=linux # correct to gnu/linux during the next big refactor
2854e3a38431SPaul Bohm    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2855e3a38431SPaul Bohm    soname_spec='$libname${shared_ext}.$major'
2856e3a38431SPaul Bohm    shlibpath_var=LD_LIBRARY_PATH
2857e3a38431SPaul Bohm  fi
2858e3a38431SPaul Bohm  ;;
2859e3a38431SPaul Bohm
2860e3a38431SPaul Bohmsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2861e3a38431SPaul Bohm  version_type=freebsd-elf
2862e3a38431SPaul Bohm  need_lib_prefix=no
2863e3a38431SPaul Bohm  need_version=no
2864e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2865e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2866e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2867e3a38431SPaul Bohm  shlibpath_overrides_runpath=yes
2868e3a38431SPaul Bohm  hardcode_into_libs=yes
2869e3a38431SPaul Bohm  if test "$with_gnu_ld" = yes; then
2870e3a38431SPaul Bohm    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2871e3a38431SPaul Bohm  else
2872e3a38431SPaul Bohm    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2873e3a38431SPaul Bohm    case $host_os in
2874e3a38431SPaul Bohm      sco3.2v5*)
2875e3a38431SPaul Bohm        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2876e3a38431SPaul Bohm	;;
2877e3a38431SPaul Bohm    esac
2878e3a38431SPaul Bohm  fi
2879e3a38431SPaul Bohm  sys_lib_dlsearch_path_spec='/usr/lib'
2880e3a38431SPaul Bohm  ;;
2881e3a38431SPaul Bohm
2882e3a38431SPaul Bohmtpf*)
2883e3a38431SPaul Bohm  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2884*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2885e3a38431SPaul Bohm  need_lib_prefix=no
2886e3a38431SPaul Bohm  need_version=no
2887e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2888e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2889e3a38431SPaul Bohm  shlibpath_overrides_runpath=no
2890e3a38431SPaul Bohm  hardcode_into_libs=yes
2891e3a38431SPaul Bohm  ;;
2892e3a38431SPaul Bohm
2893e3a38431SPaul Bohmuts4*)
2894*93823e6cSPaul Bohm  version_type=linux # correct to gnu/linux during the next big refactor
2895e3a38431SPaul Bohm  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2896e3a38431SPaul Bohm  soname_spec='${libname}${release}${shared_ext}$major'
2897e3a38431SPaul Bohm  shlibpath_var=LD_LIBRARY_PATH
2898e3a38431SPaul Bohm  ;;
2899e3a38431SPaul Bohm
2900e3a38431SPaul Bohm*)
2901e3a38431SPaul Bohm  dynamic_linker=no
2902e3a38431SPaul Bohm  ;;
2903e3a38431SPaul Bohmesac
2904e3a38431SPaul BohmAC_MSG_RESULT([$dynamic_linker])
2905e3a38431SPaul Bohmtest "$dynamic_linker" = no && can_build_shared=no
2906e3a38431SPaul Bohm
2907e3a38431SPaul Bohmvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2908e3a38431SPaul Bohmif test "$GCC" = yes; then
2909e3a38431SPaul Bohm  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2910e3a38431SPaul Bohmfi
2911e3a38431SPaul Bohm
2912e3a38431SPaul Bohmif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2913e3a38431SPaul Bohm  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2914e3a38431SPaul Bohmfi
2915e3a38431SPaul Bohmif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2916e3a38431SPaul Bohm  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2917e3a38431SPaul Bohmfi
2918e3a38431SPaul Bohm
2919e3a38431SPaul Bohm_LT_DECL([], [variables_saved_for_relink], [1],
2920e3a38431SPaul Bohm    [Variables whose values should be saved in libtool wrapper scripts and
2921e3a38431SPaul Bohm    restored at link time])
2922e3a38431SPaul Bohm_LT_DECL([], [need_lib_prefix], [0],
2923e3a38431SPaul Bohm    [Do we need the "lib" prefix for modules?])
2924e3a38431SPaul Bohm_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2925e3a38431SPaul Bohm_LT_DECL([], [version_type], [0], [Library versioning type])
2926e3a38431SPaul Bohm_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2927e3a38431SPaul Bohm_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2928e3a38431SPaul Bohm_LT_DECL([], [shlibpath_overrides_runpath], [0],
2929e3a38431SPaul Bohm    [Is shlibpath searched before the hard-coded library search path?])
2930e3a38431SPaul Bohm_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2931e3a38431SPaul Bohm_LT_DECL([], [library_names_spec], [1],
2932e3a38431SPaul Bohm    [[List of archive names.  First name is the real one, the rest are links.
2933e3a38431SPaul Bohm    The last name is the one that the linker finds with -lNAME]])
2934e3a38431SPaul Bohm_LT_DECL([], [soname_spec], [1],
2935e3a38431SPaul Bohm    [[The coded name of the library, if different from the real name]])
2936*93823e6cSPaul Bohm_LT_DECL([], [install_override_mode], [1],
2937*93823e6cSPaul Bohm    [Permission mode override for installation of shared libraries])
2938e3a38431SPaul Bohm_LT_DECL([], [postinstall_cmds], [2],
2939e3a38431SPaul Bohm    [Command to use after installation of a shared archive])
2940e3a38431SPaul Bohm_LT_DECL([], [postuninstall_cmds], [2],
2941e3a38431SPaul Bohm    [Command to use after uninstallation of a shared archive])
2942e3a38431SPaul Bohm_LT_DECL([], [finish_cmds], [2],
2943e3a38431SPaul Bohm    [Commands used to finish a libtool library installation in a directory])
2944e3a38431SPaul Bohm_LT_DECL([], [finish_eval], [1],
2945e3a38431SPaul Bohm    [[As "finish_cmds", except a single script fragment to be evaled but
2946e3a38431SPaul Bohm    not shown]])
2947e3a38431SPaul Bohm_LT_DECL([], [hardcode_into_libs], [0],
2948e3a38431SPaul Bohm    [Whether we should hardcode library paths into libraries])
2949e3a38431SPaul Bohm_LT_DECL([], [sys_lib_search_path_spec], [2],
2950e3a38431SPaul Bohm    [Compile-time system search path for libraries])
2951e3a38431SPaul Bohm_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2952e3a38431SPaul Bohm    [Run-time system search path for libraries])
2953e3a38431SPaul Bohm])# _LT_SYS_DYNAMIC_LINKER
2954e3a38431SPaul Bohm
2955e3a38431SPaul Bohm
2956e3a38431SPaul Bohm# _LT_PATH_TOOL_PREFIX(TOOL)
2957e3a38431SPaul Bohm# --------------------------
2958e3a38431SPaul Bohm# find a file program which can recognize shared library
2959e3a38431SPaul BohmAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2960e3a38431SPaul Bohm[m4_require([_LT_DECL_EGREP])dnl
2961e3a38431SPaul BohmAC_MSG_CHECKING([for $1])
2962e3a38431SPaul BohmAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2963e3a38431SPaul Bohm[case $MAGIC_CMD in
2964e3a38431SPaul Bohm[[\\/*] |  ?:[\\/]*])
2965e3a38431SPaul Bohm  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2966e3a38431SPaul Bohm  ;;
2967e3a38431SPaul Bohm*)
2968e3a38431SPaul Bohm  lt_save_MAGIC_CMD="$MAGIC_CMD"
2969e3a38431SPaul Bohm  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2970e3a38431SPaul Bohmdnl $ac_dummy forces splitting on constant user-supplied paths.
2971e3a38431SPaul Bohmdnl POSIX.2 word splitting is done only on the output of word expansions,
2972e3a38431SPaul Bohmdnl not every word.  This closes a longstanding sh security hole.
2973e3a38431SPaul Bohm  ac_dummy="m4_if([$2], , $PATH, [$2])"
2974e3a38431SPaul Bohm  for ac_dir in $ac_dummy; do
2975e3a38431SPaul Bohm    IFS="$lt_save_ifs"
2976e3a38431SPaul Bohm    test -z "$ac_dir" && ac_dir=.
2977e3a38431SPaul Bohm    if test -f $ac_dir/$1; then
2978e3a38431SPaul Bohm      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2979e3a38431SPaul Bohm      if test -n "$file_magic_test_file"; then
2980e3a38431SPaul Bohm	case $deplibs_check_method in
2981e3a38431SPaul Bohm	"file_magic "*)
2982e3a38431SPaul Bohm	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2983e3a38431SPaul Bohm	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2984e3a38431SPaul Bohm	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2985e3a38431SPaul Bohm	    $EGREP "$file_magic_regex" > /dev/null; then
2986e3a38431SPaul Bohm	    :
2987e3a38431SPaul Bohm	  else
2988e3a38431SPaul Bohm	    cat <<_LT_EOF 1>&2
2989e3a38431SPaul Bohm
2990e3a38431SPaul Bohm*** Warning: the command libtool uses to detect shared libraries,
2991e3a38431SPaul Bohm*** $file_magic_cmd, produces output that libtool cannot recognize.
2992e3a38431SPaul Bohm*** The result is that libtool may fail to recognize shared libraries
2993e3a38431SPaul Bohm*** as such.  This will affect the creation of libtool libraries that
2994e3a38431SPaul Bohm*** depend on shared libraries, but programs linked with such libtool
2995e3a38431SPaul Bohm*** libraries will work regardless of this problem.  Nevertheless, you
2996e3a38431SPaul Bohm*** may want to report the problem to your system manager and/or to
2997e3a38431SPaul Bohm*** [email protected]
2998e3a38431SPaul Bohm
2999e3a38431SPaul Bohm_LT_EOF
3000e3a38431SPaul Bohm	  fi ;;
3001e3a38431SPaul Bohm	esac
3002e3a38431SPaul Bohm      fi
3003e3a38431SPaul Bohm      break
3004e3a38431SPaul Bohm    fi
3005e3a38431SPaul Bohm  done
3006e3a38431SPaul Bohm  IFS="$lt_save_ifs"
3007e3a38431SPaul Bohm  MAGIC_CMD="$lt_save_MAGIC_CMD"
3008e3a38431SPaul Bohm  ;;
3009e3a38431SPaul Bohmesac])
3010e3a38431SPaul BohmMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3011e3a38431SPaul Bohmif test -n "$MAGIC_CMD"; then
3012e3a38431SPaul Bohm  AC_MSG_RESULT($MAGIC_CMD)
3013e3a38431SPaul Bohmelse
3014e3a38431SPaul Bohm  AC_MSG_RESULT(no)
3015e3a38431SPaul Bohmfi
3016e3a38431SPaul Bohm_LT_DECL([], [MAGIC_CMD], [0],
3017e3a38431SPaul Bohm	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3018e3a38431SPaul Bohm])# _LT_PATH_TOOL_PREFIX
3019e3a38431SPaul Bohm
3020e3a38431SPaul Bohm# Old name:
3021e3a38431SPaul BohmAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3022e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
3023e3a38431SPaul Bohmdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3024e3a38431SPaul Bohm
3025e3a38431SPaul Bohm
3026e3a38431SPaul Bohm# _LT_PATH_MAGIC
3027e3a38431SPaul Bohm# --------------
3028e3a38431SPaul Bohm# find a file program which can recognize a shared library
3029e3a38431SPaul Bohmm4_defun([_LT_PATH_MAGIC],
3030e3a38431SPaul Bohm[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3031e3a38431SPaul Bohmif test -z "$lt_cv_path_MAGIC_CMD"; then
3032e3a38431SPaul Bohm  if test -n "$ac_tool_prefix"; then
3033e3a38431SPaul Bohm    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3034e3a38431SPaul Bohm  else
3035e3a38431SPaul Bohm    MAGIC_CMD=:
3036e3a38431SPaul Bohm  fi
3037e3a38431SPaul Bohmfi
3038e3a38431SPaul Bohm])# _LT_PATH_MAGIC
3039e3a38431SPaul Bohm
3040e3a38431SPaul Bohm
3041e3a38431SPaul Bohm# LT_PATH_LD
3042e3a38431SPaul Bohm# ----------
3043e3a38431SPaul Bohm# find the pathname to the GNU or non-GNU linker
3044e3a38431SPaul BohmAC_DEFUN([LT_PATH_LD],
3045e3a38431SPaul Bohm[AC_REQUIRE([AC_PROG_CC])dnl
3046e3a38431SPaul BohmAC_REQUIRE([AC_CANONICAL_HOST])dnl
3047e3a38431SPaul BohmAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3048e3a38431SPaul Bohmm4_require([_LT_DECL_SED])dnl
3049e3a38431SPaul Bohmm4_require([_LT_DECL_EGREP])dnl
3050*93823e6cSPaul Bohmm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3051e3a38431SPaul Bohm
3052e3a38431SPaul BohmAC_ARG_WITH([gnu-ld],
3053e3a38431SPaul Bohm    [AS_HELP_STRING([--with-gnu-ld],
3054e3a38431SPaul Bohm	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3055e3a38431SPaul Bohm    [test "$withval" = no || with_gnu_ld=yes],
3056e3a38431SPaul Bohm    [with_gnu_ld=no])dnl
3057e3a38431SPaul Bohm
3058e3a38431SPaul Bohmac_prog=ld
3059e3a38431SPaul Bohmif test "$GCC" = yes; then
3060e3a38431SPaul Bohm  # Check if gcc -print-prog-name=ld gives a path.
3061e3a38431SPaul Bohm  AC_MSG_CHECKING([for ld used by $CC])
3062e3a38431SPaul Bohm  case $host in
3063e3a38431SPaul Bohm  *-*-mingw*)
3064e3a38431SPaul Bohm    # gcc leaves a trailing carriage return which upsets mingw
3065e3a38431SPaul Bohm    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3066e3a38431SPaul Bohm  *)
3067e3a38431SPaul Bohm    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3068e3a38431SPaul Bohm  esac
3069e3a38431SPaul Bohm  case $ac_prog in
3070e3a38431SPaul Bohm    # Accept absolute paths.
3071e3a38431SPaul Bohm    [[\\/]]* | ?:[[\\/]]*)
3072e3a38431SPaul Bohm      re_direlt='/[[^/]][[^/]]*/\.\./'
3073e3a38431SPaul Bohm      # Canonicalize the pathname of ld
3074e3a38431SPaul Bohm      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3075e3a38431SPaul Bohm      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3076e3a38431SPaul Bohm	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3077e3a38431SPaul Bohm      done
3078e3a38431SPaul Bohm      test -z "$LD" && LD="$ac_prog"
3079e3a38431SPaul Bohm      ;;
3080e3a38431SPaul Bohm  "")
3081e3a38431SPaul Bohm    # If it fails, then pretend we aren't using GCC.
3082e3a38431SPaul Bohm    ac_prog=ld
3083e3a38431SPaul Bohm    ;;
3084e3a38431SPaul Bohm  *)
3085e3a38431SPaul Bohm    # If it is relative, then search for the first ld in PATH.
3086e3a38431SPaul Bohm    with_gnu_ld=unknown
3087e3a38431SPaul Bohm    ;;
3088e3a38431SPaul Bohm  esac
3089e3a38431SPaul Bohmelif test "$with_gnu_ld" = yes; then
3090e3a38431SPaul Bohm  AC_MSG_CHECKING([for GNU ld])
3091e3a38431SPaul Bohmelse
3092e3a38431SPaul Bohm  AC_MSG_CHECKING([for non-GNU ld])
3093e3a38431SPaul Bohmfi
3094e3a38431SPaul BohmAC_CACHE_VAL(lt_cv_path_LD,
3095e3a38431SPaul Bohm[if test -z "$LD"; then
3096e3a38431SPaul Bohm  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3097e3a38431SPaul Bohm  for ac_dir in $PATH; do
3098e3a38431SPaul Bohm    IFS="$lt_save_ifs"
3099e3a38431SPaul Bohm    test -z "$ac_dir" && ac_dir=.
3100e3a38431SPaul Bohm    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3101e3a38431SPaul Bohm      lt_cv_path_LD="$ac_dir/$ac_prog"
3102e3a38431SPaul Bohm      # Check to see if the program is GNU ld.  I'd rather use --version,
3103e3a38431SPaul Bohm      # but apparently some variants of GNU ld only accept -v.
3104e3a38431SPaul Bohm      # Break only if it was the GNU/non-GNU ld that we prefer.
3105e3a38431SPaul Bohm      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3106e3a38431SPaul Bohm      *GNU* | *'with BFD'*)
3107e3a38431SPaul Bohm	test "$with_gnu_ld" != no && break
3108e3a38431SPaul Bohm	;;
3109e3a38431SPaul Bohm      *)
3110e3a38431SPaul Bohm	test "$with_gnu_ld" != yes && break
3111e3a38431SPaul Bohm	;;
3112e3a38431SPaul Bohm      esac
3113e3a38431SPaul Bohm    fi
3114e3a38431SPaul Bohm  done
3115e3a38431SPaul Bohm  IFS="$lt_save_ifs"
3116e3a38431SPaul Bohmelse
3117e3a38431SPaul Bohm  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3118e3a38431SPaul Bohmfi])
3119e3a38431SPaul BohmLD="$lt_cv_path_LD"
3120e3a38431SPaul Bohmif test -n "$LD"; then
3121e3a38431SPaul Bohm  AC_MSG_RESULT($LD)
3122e3a38431SPaul Bohmelse
3123e3a38431SPaul Bohm  AC_MSG_RESULT(no)
3124e3a38431SPaul Bohmfi
3125e3a38431SPaul Bohmtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3126e3a38431SPaul Bohm_LT_PATH_LD_GNU
3127e3a38431SPaul BohmAC_SUBST([LD])
3128e3a38431SPaul Bohm
3129e3a38431SPaul Bohm_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3130e3a38431SPaul Bohm])# LT_PATH_LD
3131e3a38431SPaul Bohm
3132e3a38431SPaul Bohm# Old names:
3133e3a38431SPaul BohmAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3134e3a38431SPaul BohmAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3135e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
3136e3a38431SPaul Bohmdnl AC_DEFUN([AM_PROG_LD], [])
3137e3a38431SPaul Bohmdnl AC_DEFUN([AC_PROG_LD], [])
3138e3a38431SPaul Bohm
3139e3a38431SPaul Bohm
3140e3a38431SPaul Bohm# _LT_PATH_LD_GNU
3141e3a38431SPaul Bohm#- --------------
3142e3a38431SPaul Bohmm4_defun([_LT_PATH_LD_GNU],
3143e3a38431SPaul Bohm[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3144e3a38431SPaul Bohm[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3145e3a38431SPaul Bohmcase `$LD -v 2>&1 </dev/null` in
3146e3a38431SPaul Bohm*GNU* | *'with BFD'*)
3147e3a38431SPaul Bohm  lt_cv_prog_gnu_ld=yes
3148e3a38431SPaul Bohm  ;;
3149e3a38431SPaul Bohm*)
3150e3a38431SPaul Bohm  lt_cv_prog_gnu_ld=no
3151e3a38431SPaul Bohm  ;;
3152e3a38431SPaul Bohmesac])
3153e3a38431SPaul Bohmwith_gnu_ld=$lt_cv_prog_gnu_ld
3154e3a38431SPaul Bohm])# _LT_PATH_LD_GNU
3155e3a38431SPaul Bohm
3156e3a38431SPaul Bohm
3157e3a38431SPaul Bohm# _LT_CMD_RELOAD
3158e3a38431SPaul Bohm# --------------
3159e3a38431SPaul Bohm# find reload flag for linker
3160e3a38431SPaul Bohm#   -- PORTME Some linkers may need a different reload flag.
3161e3a38431SPaul Bohmm4_defun([_LT_CMD_RELOAD],
3162e3a38431SPaul Bohm[AC_CACHE_CHECK([for $LD option to reload object files],
3163e3a38431SPaul Bohm  lt_cv_ld_reload_flag,
3164e3a38431SPaul Bohm  [lt_cv_ld_reload_flag='-r'])
3165e3a38431SPaul Bohmreload_flag=$lt_cv_ld_reload_flag
3166e3a38431SPaul Bohmcase $reload_flag in
3167e3a38431SPaul Bohm"" | " "*) ;;
3168e3a38431SPaul Bohm*) reload_flag=" $reload_flag" ;;
3169e3a38431SPaul Bohmesac
3170e3a38431SPaul Bohmreload_cmds='$LD$reload_flag -o $output$reload_objs'
3171e3a38431SPaul Bohmcase $host_os in
3172*93823e6cSPaul Bohm  cygwin* | mingw* | pw32* | cegcc*)
3173*93823e6cSPaul Bohm    if test "$GCC" != yes; then
3174*93823e6cSPaul Bohm      reload_cmds=false
3175*93823e6cSPaul Bohm    fi
3176*93823e6cSPaul Bohm    ;;
3177e3a38431SPaul Bohm  darwin*)
3178e3a38431SPaul Bohm    if test "$GCC" = yes; then
3179e3a38431SPaul Bohm      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3180e3a38431SPaul Bohm    else
3181e3a38431SPaul Bohm      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3182e3a38431SPaul Bohm    fi
3183e3a38431SPaul Bohm    ;;
3184e3a38431SPaul Bohmesac
3185*93823e6cSPaul Bohm_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3186*93823e6cSPaul Bohm_LT_TAGDECL([], [reload_cmds], [2])dnl
3187e3a38431SPaul Bohm])# _LT_CMD_RELOAD
3188e3a38431SPaul Bohm
3189e3a38431SPaul Bohm
3190e3a38431SPaul Bohm# _LT_CHECK_MAGIC_METHOD
3191e3a38431SPaul Bohm# ----------------------
3192e3a38431SPaul Bohm# how to check for library dependencies
3193e3a38431SPaul Bohm#  -- PORTME fill in with the dynamic library characteristics
3194e3a38431SPaul Bohmm4_defun([_LT_CHECK_MAGIC_METHOD],
3195e3a38431SPaul Bohm[m4_require([_LT_DECL_EGREP])
3196e3a38431SPaul Bohmm4_require([_LT_DECL_OBJDUMP])
3197e3a38431SPaul BohmAC_CACHE_CHECK([how to recognize dependent libraries],
3198e3a38431SPaul Bohmlt_cv_deplibs_check_method,
3199e3a38431SPaul Bohm[lt_cv_file_magic_cmd='$MAGIC_CMD'
3200e3a38431SPaul Bohmlt_cv_file_magic_test_file=
3201e3a38431SPaul Bohmlt_cv_deplibs_check_method='unknown'
3202e3a38431SPaul Bohm# Need to set the preceding variable on all platforms that support
3203e3a38431SPaul Bohm# interlibrary dependencies.
3204e3a38431SPaul Bohm# 'none' -- dependencies not supported.
3205e3a38431SPaul Bohm# `unknown' -- same as none, but documents that we really don't know.
3206e3a38431SPaul Bohm# 'pass_all' -- all dependencies passed with no checks.
3207e3a38431SPaul Bohm# 'test_compile' -- check by making test program.
3208e3a38431SPaul Bohm# 'file_magic [[regex]]' -- check by looking for files in library path
3209e3a38431SPaul Bohm# which responds to the $file_magic_cmd with a given extended regex.
3210e3a38431SPaul Bohm# If you have `file' or equivalent on your system and you're not sure
3211e3a38431SPaul Bohm# whether `pass_all' will *always* work, you probably want this one.
3212e3a38431SPaul Bohm
3213e3a38431SPaul Bohmcase $host_os in
3214e3a38431SPaul Bohmaix[[4-9]]*)
3215e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3216e3a38431SPaul Bohm  ;;
3217e3a38431SPaul Bohm
3218e3a38431SPaul Bohmbeos*)
3219e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3220e3a38431SPaul Bohm  ;;
3221e3a38431SPaul Bohm
3222e3a38431SPaul Bohmbsdi[[45]]*)
3223e3a38431SPaul Bohm  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3224e3a38431SPaul Bohm  lt_cv_file_magic_cmd='/usr/bin/file -L'
3225e3a38431SPaul Bohm  lt_cv_file_magic_test_file=/shlib/libc.so
3226e3a38431SPaul Bohm  ;;
3227e3a38431SPaul Bohm
3228e3a38431SPaul Bohmcygwin*)
3229e3a38431SPaul Bohm  # func_win32_libid is a shell function defined in ltmain.sh
3230e3a38431SPaul Bohm  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3231e3a38431SPaul Bohm  lt_cv_file_magic_cmd='func_win32_libid'
3232e3a38431SPaul Bohm  ;;
3233e3a38431SPaul Bohm
3234e3a38431SPaul Bohmmingw* | pw32*)
3235e3a38431SPaul Bohm  # Base MSYS/MinGW do not provide the 'file' command needed by
3236e3a38431SPaul Bohm  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3237e3a38431SPaul Bohm  # unless we find 'file', for example because we are cross-compiling.
3238*93823e6cSPaul Bohm  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3239*93823e6cSPaul Bohm  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3240e3a38431SPaul Bohm    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3241e3a38431SPaul Bohm    lt_cv_file_magic_cmd='func_win32_libid'
3242e3a38431SPaul Bohm  else
3243*93823e6cSPaul Bohm    # Keep this pattern in sync with the one in func_win32_libid.
3244*93823e6cSPaul Bohm    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3245e3a38431SPaul Bohm    lt_cv_file_magic_cmd='$OBJDUMP -f'
3246e3a38431SPaul Bohm  fi
3247e3a38431SPaul Bohm  ;;
3248e3a38431SPaul Bohm
3249*93823e6cSPaul Bohmcegcc*)
3250e3a38431SPaul Bohm  # use the weaker test based on 'objdump'. See mingw*.
3251e3a38431SPaul Bohm  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3252e3a38431SPaul Bohm  lt_cv_file_magic_cmd='$OBJDUMP -f'
3253e3a38431SPaul Bohm  ;;
3254e3a38431SPaul Bohm
3255e3a38431SPaul Bohmdarwin* | rhapsody*)
3256e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3257e3a38431SPaul Bohm  ;;
3258e3a38431SPaul Bohm
3259e3a38431SPaul Bohmfreebsd* | dragonfly*)
3260e3a38431SPaul Bohm  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3261e3a38431SPaul Bohm    case $host_cpu in
3262e3a38431SPaul Bohm    i*86 )
3263e3a38431SPaul Bohm      # Not sure whether the presence of OpenBSD here was a mistake.
3264e3a38431SPaul Bohm      # Let's accept both of them until this is cleared up.
3265e3a38431SPaul Bohm      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3266e3a38431SPaul Bohm      lt_cv_file_magic_cmd=/usr/bin/file
3267e3a38431SPaul Bohm      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3268e3a38431SPaul Bohm      ;;
3269e3a38431SPaul Bohm    esac
3270e3a38431SPaul Bohm  else
3271e3a38431SPaul Bohm    lt_cv_deplibs_check_method=pass_all
3272e3a38431SPaul Bohm  fi
3273e3a38431SPaul Bohm  ;;
3274e3a38431SPaul Bohm
3275*93823e6cSPaul Bohmhaiku*)
3276e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3277e3a38431SPaul Bohm  ;;
3278e3a38431SPaul Bohm
3279e3a38431SPaul Bohmhpux10.20* | hpux11*)
3280e3a38431SPaul Bohm  lt_cv_file_magic_cmd=/usr/bin/file
3281e3a38431SPaul Bohm  case $host_cpu in
3282e3a38431SPaul Bohm  ia64*)
3283e3a38431SPaul Bohm    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3284e3a38431SPaul Bohm    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3285e3a38431SPaul Bohm    ;;
3286e3a38431SPaul Bohm  hppa*64*)
3287*93823e6cSPaul Bohm    [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]']
3288e3a38431SPaul Bohm    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3289e3a38431SPaul Bohm    ;;
3290e3a38431SPaul Bohm  *)
3291*93823e6cSPaul Bohm    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3292e3a38431SPaul Bohm    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3293e3a38431SPaul Bohm    ;;
3294e3a38431SPaul Bohm  esac
3295e3a38431SPaul Bohm  ;;
3296e3a38431SPaul Bohm
3297e3a38431SPaul Bohminterix[[3-9]]*)
3298e3a38431SPaul Bohm  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3299e3a38431SPaul Bohm  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3300e3a38431SPaul Bohm  ;;
3301e3a38431SPaul Bohm
3302e3a38431SPaul Bohmirix5* | irix6* | nonstopux*)
3303e3a38431SPaul Bohm  case $LD in
3304e3a38431SPaul Bohm  *-32|*"-32 ") libmagic=32-bit;;
3305e3a38431SPaul Bohm  *-n32|*"-n32 ") libmagic=N32;;
3306e3a38431SPaul Bohm  *-64|*"-64 ") libmagic=64-bit;;
3307e3a38431SPaul Bohm  *) libmagic=never-match;;
3308e3a38431SPaul Bohm  esac
3309e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3310e3a38431SPaul Bohm  ;;
3311e3a38431SPaul Bohm
3312*93823e6cSPaul Bohm# This must be glibc/ELF.
3313*93823e6cSPaul Bohmlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3314e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3315e3a38431SPaul Bohm  ;;
3316e3a38431SPaul Bohm
3317e3a38431SPaul Bohmnetbsd* | netbsdelf*-gnu)
3318e3a38431SPaul Bohm  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3319e3a38431SPaul Bohm    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3320e3a38431SPaul Bohm  else
3321e3a38431SPaul Bohm    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3322e3a38431SPaul Bohm  fi
3323e3a38431SPaul Bohm  ;;
3324e3a38431SPaul Bohm
3325e3a38431SPaul Bohmnewos6*)
3326e3a38431SPaul Bohm  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3327e3a38431SPaul Bohm  lt_cv_file_magic_cmd=/usr/bin/file
3328e3a38431SPaul Bohm  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3329e3a38431SPaul Bohm  ;;
3330e3a38431SPaul Bohm
3331e3a38431SPaul Bohm*nto* | *qnx*)
3332e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3333e3a38431SPaul Bohm  ;;
3334e3a38431SPaul Bohm
3335e3a38431SPaul Bohmopenbsd*)
3336e3a38431SPaul Bohm  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3337e3a38431SPaul Bohm    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3338e3a38431SPaul Bohm  else
3339e3a38431SPaul Bohm    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3340e3a38431SPaul Bohm  fi
3341e3a38431SPaul Bohm  ;;
3342e3a38431SPaul Bohm
3343e3a38431SPaul Bohmosf3* | osf4* | osf5*)
3344e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3345e3a38431SPaul Bohm  ;;
3346e3a38431SPaul Bohm
3347e3a38431SPaul Bohmrdos*)
3348e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3349e3a38431SPaul Bohm  ;;
3350e3a38431SPaul Bohm
3351e3a38431SPaul Bohmsolaris*)
3352e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3353e3a38431SPaul Bohm  ;;
3354e3a38431SPaul Bohm
3355e3a38431SPaul Bohmsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3356e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3357e3a38431SPaul Bohm  ;;
3358e3a38431SPaul Bohm
3359e3a38431SPaul Bohmsysv4 | sysv4.3*)
3360e3a38431SPaul Bohm  case $host_vendor in
3361e3a38431SPaul Bohm  motorola)
3362e3a38431SPaul Bohm    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]]'
3363e3a38431SPaul Bohm    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3364e3a38431SPaul Bohm    ;;
3365e3a38431SPaul Bohm  ncr)
3366e3a38431SPaul Bohm    lt_cv_deplibs_check_method=pass_all
3367e3a38431SPaul Bohm    ;;
3368e3a38431SPaul Bohm  sequent)
3369e3a38431SPaul Bohm    lt_cv_file_magic_cmd='/bin/file'
3370e3a38431SPaul Bohm    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3371e3a38431SPaul Bohm    ;;
3372e3a38431SPaul Bohm  sni)
3373e3a38431SPaul Bohm    lt_cv_file_magic_cmd='/bin/file'
3374e3a38431SPaul Bohm    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3375e3a38431SPaul Bohm    lt_cv_file_magic_test_file=/lib/libc.so
3376e3a38431SPaul Bohm    ;;
3377e3a38431SPaul Bohm  siemens)
3378e3a38431SPaul Bohm    lt_cv_deplibs_check_method=pass_all
3379e3a38431SPaul Bohm    ;;
3380e3a38431SPaul Bohm  pc)
3381e3a38431SPaul Bohm    lt_cv_deplibs_check_method=pass_all
3382e3a38431SPaul Bohm    ;;
3383e3a38431SPaul Bohm  esac
3384e3a38431SPaul Bohm  ;;
3385e3a38431SPaul Bohm
3386e3a38431SPaul Bohmtpf*)
3387e3a38431SPaul Bohm  lt_cv_deplibs_check_method=pass_all
3388e3a38431SPaul Bohm  ;;
3389e3a38431SPaul Bohmesac
3390e3a38431SPaul Bohm])
3391*93823e6cSPaul Bohm
3392*93823e6cSPaul Bohmfile_magic_glob=
3393*93823e6cSPaul Bohmwant_nocaseglob=no
3394*93823e6cSPaul Bohmif test "$build" = "$host"; then
3395*93823e6cSPaul Bohm  case $host_os in
3396*93823e6cSPaul Bohm  mingw* | pw32*)
3397*93823e6cSPaul Bohm    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3398*93823e6cSPaul Bohm      want_nocaseglob=yes
3399*93823e6cSPaul Bohm    else
3400*93823e6cSPaul Bohm      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3401*93823e6cSPaul Bohm    fi
3402*93823e6cSPaul Bohm    ;;
3403*93823e6cSPaul Bohm  esac
3404*93823e6cSPaul Bohmfi
3405*93823e6cSPaul Bohm
3406e3a38431SPaul Bohmfile_magic_cmd=$lt_cv_file_magic_cmd
3407e3a38431SPaul Bohmdeplibs_check_method=$lt_cv_deplibs_check_method
3408e3a38431SPaul Bohmtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3409e3a38431SPaul Bohm
3410e3a38431SPaul Bohm_LT_DECL([], [deplibs_check_method], [1],
3411e3a38431SPaul Bohm    [Method to check whether dependent libraries are shared objects])
3412e3a38431SPaul Bohm_LT_DECL([], [file_magic_cmd], [1],
3413*93823e6cSPaul Bohm    [Command to use when deplibs_check_method = "file_magic"])
3414*93823e6cSPaul Bohm_LT_DECL([], [file_magic_glob], [1],
3415*93823e6cSPaul Bohm    [How to find potential files when deplibs_check_method = "file_magic"])
3416*93823e6cSPaul Bohm_LT_DECL([], [want_nocaseglob], [1],
3417*93823e6cSPaul Bohm    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3418e3a38431SPaul Bohm])# _LT_CHECK_MAGIC_METHOD
3419e3a38431SPaul Bohm
3420e3a38431SPaul Bohm
3421e3a38431SPaul Bohm# LT_PATH_NM
3422e3a38431SPaul Bohm# ----------
3423e3a38431SPaul Bohm# find the pathname to a BSD- or MS-compatible name lister
3424e3a38431SPaul BohmAC_DEFUN([LT_PATH_NM],
3425e3a38431SPaul Bohm[AC_REQUIRE([AC_PROG_CC])dnl
3426e3a38431SPaul BohmAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3427e3a38431SPaul Bohm[if test -n "$NM"; then
3428e3a38431SPaul Bohm  # Let the user override the test.
3429e3a38431SPaul Bohm  lt_cv_path_NM="$NM"
3430e3a38431SPaul Bohmelse
3431e3a38431SPaul Bohm  lt_nm_to_check="${ac_tool_prefix}nm"
3432e3a38431SPaul Bohm  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3433e3a38431SPaul Bohm    lt_nm_to_check="$lt_nm_to_check nm"
3434e3a38431SPaul Bohm  fi
3435e3a38431SPaul Bohm  for lt_tmp_nm in $lt_nm_to_check; do
3436e3a38431SPaul Bohm    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3437e3a38431SPaul Bohm    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3438e3a38431SPaul Bohm      IFS="$lt_save_ifs"
3439e3a38431SPaul Bohm      test -z "$ac_dir" && ac_dir=.
3440e3a38431SPaul Bohm      tmp_nm="$ac_dir/$lt_tmp_nm"
3441e3a38431SPaul Bohm      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3442e3a38431SPaul Bohm	# Check to see if the nm accepts a BSD-compat flag.
3443e3a38431SPaul Bohm	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3444e3a38431SPaul Bohm	#   nm: unknown option "B" ignored
3445e3a38431SPaul Bohm	# Tru64's nm complains that /dev/null is an invalid object file
3446e3a38431SPaul Bohm	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3447e3a38431SPaul Bohm	*/dev/null* | *'Invalid file or object type'*)
3448e3a38431SPaul Bohm	  lt_cv_path_NM="$tmp_nm -B"
3449e3a38431SPaul Bohm	  break
3450e3a38431SPaul Bohm	  ;;
3451e3a38431SPaul Bohm	*)
3452e3a38431SPaul Bohm	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3453e3a38431SPaul Bohm	  */dev/null*)
3454e3a38431SPaul Bohm	    lt_cv_path_NM="$tmp_nm -p"
3455e3a38431SPaul Bohm	    break
3456e3a38431SPaul Bohm	    ;;
3457e3a38431SPaul Bohm	  *)
3458e3a38431SPaul Bohm	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3459e3a38431SPaul Bohm	    continue # so that we can try to find one that supports BSD flags
3460e3a38431SPaul Bohm	    ;;
3461e3a38431SPaul Bohm	  esac
3462e3a38431SPaul Bohm	  ;;
3463e3a38431SPaul Bohm	esac
3464e3a38431SPaul Bohm      fi
3465e3a38431SPaul Bohm    done
3466e3a38431SPaul Bohm    IFS="$lt_save_ifs"
3467e3a38431SPaul Bohm  done
3468e3a38431SPaul Bohm  : ${lt_cv_path_NM=no}
3469e3a38431SPaul Bohmfi])
3470e3a38431SPaul Bohmif test "$lt_cv_path_NM" != "no"; then
3471e3a38431SPaul Bohm  NM="$lt_cv_path_NM"
3472e3a38431SPaul Bohmelse
3473e3a38431SPaul Bohm  # Didn't find any BSD compatible name lister, look for dumpbin.
3474*93823e6cSPaul Bohm  if test -n "$DUMPBIN"; then :
3475*93823e6cSPaul Bohm    # Let the user override the test.
3476*93823e6cSPaul Bohm  else
3477*93823e6cSPaul Bohm    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3478*93823e6cSPaul Bohm    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
3479*93823e6cSPaul Bohm    *COFF*)
3480*93823e6cSPaul Bohm      DUMPBIN="$DUMPBIN -symbols"
3481*93823e6cSPaul Bohm      ;;
3482*93823e6cSPaul Bohm    *)
3483*93823e6cSPaul Bohm      DUMPBIN=:
3484*93823e6cSPaul Bohm      ;;
3485*93823e6cSPaul Bohm    esac
3486*93823e6cSPaul Bohm  fi
3487e3a38431SPaul Bohm  AC_SUBST([DUMPBIN])
3488e3a38431SPaul Bohm  if test "$DUMPBIN" != ":"; then
3489e3a38431SPaul Bohm    NM="$DUMPBIN"
3490e3a38431SPaul Bohm  fi
3491e3a38431SPaul Bohmfi
3492e3a38431SPaul Bohmtest -z "$NM" && NM=nm
3493e3a38431SPaul BohmAC_SUBST([NM])
3494e3a38431SPaul Bohm_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3495e3a38431SPaul Bohm
3496e3a38431SPaul BohmAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3497e3a38431SPaul Bohm  [lt_cv_nm_interface="BSD nm"
3498e3a38431SPaul Bohm  echo "int some_variable = 0;" > conftest.$ac_ext
3499*93823e6cSPaul Bohm  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3500e3a38431SPaul Bohm  (eval "$ac_compile" 2>conftest.err)
3501e3a38431SPaul Bohm  cat conftest.err >&AS_MESSAGE_LOG_FD
3502*93823e6cSPaul Bohm  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3503e3a38431SPaul Bohm  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3504e3a38431SPaul Bohm  cat conftest.err >&AS_MESSAGE_LOG_FD
3505*93823e6cSPaul Bohm  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3506e3a38431SPaul Bohm  cat conftest.out >&AS_MESSAGE_LOG_FD
3507e3a38431SPaul Bohm  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3508e3a38431SPaul Bohm    lt_cv_nm_interface="MS dumpbin"
3509e3a38431SPaul Bohm  fi
3510e3a38431SPaul Bohm  rm -f conftest*])
3511e3a38431SPaul Bohm])# LT_PATH_NM
3512e3a38431SPaul Bohm
3513e3a38431SPaul Bohm# Old names:
3514e3a38431SPaul BohmAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3515e3a38431SPaul BohmAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3516e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
3517e3a38431SPaul Bohmdnl AC_DEFUN([AM_PROG_NM], [])
3518e3a38431SPaul Bohmdnl AC_DEFUN([AC_PROG_NM], [])
3519e3a38431SPaul Bohm
3520*93823e6cSPaul Bohm# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3521*93823e6cSPaul Bohm# --------------------------------
3522*93823e6cSPaul Bohm# how to determine the name of the shared library
3523*93823e6cSPaul Bohm# associated with a specific link library.
3524*93823e6cSPaul Bohm#  -- PORTME fill in with the dynamic library characteristics
3525*93823e6cSPaul Bohmm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3526*93823e6cSPaul Bohm[m4_require([_LT_DECL_EGREP])
3527*93823e6cSPaul Bohmm4_require([_LT_DECL_OBJDUMP])
3528*93823e6cSPaul Bohmm4_require([_LT_DECL_DLLTOOL])
3529*93823e6cSPaul BohmAC_CACHE_CHECK([how to associate runtime and link libraries],
3530*93823e6cSPaul Bohmlt_cv_sharedlib_from_linklib_cmd,
3531*93823e6cSPaul Bohm[lt_cv_sharedlib_from_linklib_cmd='unknown'
3532*93823e6cSPaul Bohm
3533*93823e6cSPaul Bohmcase $host_os in
3534*93823e6cSPaul Bohmcygwin* | mingw* | pw32* | cegcc*)
3535*93823e6cSPaul Bohm  # two different shell functions defined in ltmain.sh
3536*93823e6cSPaul Bohm  # decide which to use based on capabilities of $DLLTOOL
3537*93823e6cSPaul Bohm  case `$DLLTOOL --help 2>&1` in
3538*93823e6cSPaul Bohm  *--identify-strict*)
3539*93823e6cSPaul Bohm    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3540*93823e6cSPaul Bohm    ;;
3541*93823e6cSPaul Bohm  *)
3542*93823e6cSPaul Bohm    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3543*93823e6cSPaul Bohm    ;;
3544*93823e6cSPaul Bohm  esac
3545*93823e6cSPaul Bohm  ;;
3546*93823e6cSPaul Bohm*)
3547*93823e6cSPaul Bohm  # fallback: assume linklib IS sharedlib
3548*93823e6cSPaul Bohm  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3549*93823e6cSPaul Bohm  ;;
3550*93823e6cSPaul Bohmesac
3551*93823e6cSPaul Bohm])
3552*93823e6cSPaul Bohmsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3553*93823e6cSPaul Bohmtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3554*93823e6cSPaul Bohm
3555*93823e6cSPaul Bohm_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3556*93823e6cSPaul Bohm    [Command to associate shared and link libraries])
3557*93823e6cSPaul Bohm])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3558*93823e6cSPaul Bohm
3559*93823e6cSPaul Bohm
3560*93823e6cSPaul Bohm# _LT_PATH_MANIFEST_TOOL
3561*93823e6cSPaul Bohm# ----------------------
3562*93823e6cSPaul Bohm# locate the manifest tool
3563*93823e6cSPaul Bohmm4_defun([_LT_PATH_MANIFEST_TOOL],
3564*93823e6cSPaul Bohm[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3565*93823e6cSPaul Bohmtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3566*93823e6cSPaul BohmAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3567*93823e6cSPaul Bohm  [lt_cv_path_mainfest_tool=no
3568*93823e6cSPaul Bohm  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3569*93823e6cSPaul Bohm  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3570*93823e6cSPaul Bohm  cat conftest.err >&AS_MESSAGE_LOG_FD
3571*93823e6cSPaul Bohm  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3572*93823e6cSPaul Bohm    lt_cv_path_mainfest_tool=yes
3573*93823e6cSPaul Bohm  fi
3574*93823e6cSPaul Bohm  rm -f conftest*])
3575*93823e6cSPaul Bohmif test "x$lt_cv_path_mainfest_tool" != xyes; then
3576*93823e6cSPaul Bohm  MANIFEST_TOOL=:
3577*93823e6cSPaul Bohmfi
3578*93823e6cSPaul Bohm_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3579*93823e6cSPaul Bohm])# _LT_PATH_MANIFEST_TOOL
3580*93823e6cSPaul Bohm
3581e3a38431SPaul Bohm
3582e3a38431SPaul Bohm# LT_LIB_M
3583e3a38431SPaul Bohm# --------
3584e3a38431SPaul Bohm# check for math library
3585e3a38431SPaul BohmAC_DEFUN([LT_LIB_M],
3586e3a38431SPaul Bohm[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3587e3a38431SPaul BohmLIBM=
3588e3a38431SPaul Bohmcase $host in
3589*93823e6cSPaul Bohm*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3590e3a38431SPaul Bohm  # These system don't have libm, or don't need it
3591e3a38431SPaul Bohm  ;;
3592e3a38431SPaul Bohm*-ncr-sysv4.3*)
3593e3a38431SPaul Bohm  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3594e3a38431SPaul Bohm  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3595e3a38431SPaul Bohm  ;;
3596e3a38431SPaul Bohm*)
3597e3a38431SPaul Bohm  AC_CHECK_LIB(m, cos, LIBM="-lm")
3598e3a38431SPaul Bohm  ;;
3599e3a38431SPaul Bohmesac
3600e3a38431SPaul BohmAC_SUBST([LIBM])
3601e3a38431SPaul Bohm])# LT_LIB_M
3602e3a38431SPaul Bohm
3603e3a38431SPaul Bohm# Old name:
3604e3a38431SPaul BohmAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3605e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
3606e3a38431SPaul Bohmdnl AC_DEFUN([AC_CHECK_LIBM], [])
3607e3a38431SPaul Bohm
3608e3a38431SPaul Bohm
3609e3a38431SPaul Bohm# _LT_COMPILER_NO_RTTI([TAGNAME])
3610e3a38431SPaul Bohm# -------------------------------
3611e3a38431SPaul Bohmm4_defun([_LT_COMPILER_NO_RTTI],
3612e3a38431SPaul Bohm[m4_require([_LT_TAG_COMPILER])dnl
3613e3a38431SPaul Bohm
3614e3a38431SPaul Bohm_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3615e3a38431SPaul Bohm
3616e3a38431SPaul Bohmif test "$GCC" = yes; then
3617*93823e6cSPaul Bohm  case $cc_basename in
3618*93823e6cSPaul Bohm  nvcc*)
3619*93823e6cSPaul Bohm    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3620*93823e6cSPaul Bohm  *)
3621*93823e6cSPaul Bohm    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3622*93823e6cSPaul Bohm  esac
3623e3a38431SPaul Bohm
3624e3a38431SPaul Bohm  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3625e3a38431SPaul Bohm    lt_cv_prog_compiler_rtti_exceptions,
3626e3a38431SPaul Bohm    [-fno-rtti -fno-exceptions], [],
3627e3a38431SPaul Bohm    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3628e3a38431SPaul Bohmfi
3629e3a38431SPaul Bohm_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3630e3a38431SPaul Bohm	[Compiler flag to turn off builtin functions])
3631e3a38431SPaul Bohm])# _LT_COMPILER_NO_RTTI
3632e3a38431SPaul Bohm
3633e3a38431SPaul Bohm
3634e3a38431SPaul Bohm# _LT_CMD_GLOBAL_SYMBOLS
3635e3a38431SPaul Bohm# ----------------------
3636e3a38431SPaul Bohmm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3637e3a38431SPaul Bohm[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3638e3a38431SPaul BohmAC_REQUIRE([AC_PROG_CC])dnl
3639*93823e6cSPaul BohmAC_REQUIRE([AC_PROG_AWK])dnl
3640e3a38431SPaul BohmAC_REQUIRE([LT_PATH_NM])dnl
3641e3a38431SPaul BohmAC_REQUIRE([LT_PATH_LD])dnl
3642e3a38431SPaul Bohmm4_require([_LT_DECL_SED])dnl
3643e3a38431SPaul Bohmm4_require([_LT_DECL_EGREP])dnl
3644e3a38431SPaul Bohmm4_require([_LT_TAG_COMPILER])dnl
3645e3a38431SPaul Bohm
3646e3a38431SPaul Bohm# Check for command to grab the raw symbol name followed by C symbol from nm.
3647e3a38431SPaul BohmAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3648e3a38431SPaul BohmAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3649e3a38431SPaul Bohm[
3650e3a38431SPaul Bohm# These are sane defaults that work on at least a few old systems.
3651e3a38431SPaul Bohm# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3652e3a38431SPaul Bohm
3653e3a38431SPaul Bohm# Character class describing NM global symbol codes.
3654e3a38431SPaul Bohmsymcode='[[BCDEGRST]]'
3655e3a38431SPaul Bohm
3656e3a38431SPaul Bohm# Regexp to match symbols that can be accessed directly from C.
3657e3a38431SPaul Bohmsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3658e3a38431SPaul Bohm
3659e3a38431SPaul Bohm# Define system-specific variables.
3660e3a38431SPaul Bohmcase $host_os in
3661e3a38431SPaul Bohmaix*)
3662e3a38431SPaul Bohm  symcode='[[BCDT]]'
3663e3a38431SPaul Bohm  ;;
3664e3a38431SPaul Bohmcygwin* | mingw* | pw32* | cegcc*)
3665e3a38431SPaul Bohm  symcode='[[ABCDGISTW]]'
3666e3a38431SPaul Bohm  ;;
3667e3a38431SPaul Bohmhpux*)
3668e3a38431SPaul Bohm  if test "$host_cpu" = ia64; then
3669e3a38431SPaul Bohm    symcode='[[ABCDEGRST]]'
3670e3a38431SPaul Bohm  fi
3671e3a38431SPaul Bohm  ;;
3672e3a38431SPaul Bohmirix* | nonstopux*)
3673e3a38431SPaul Bohm  symcode='[[BCDEGRST]]'
3674e3a38431SPaul Bohm  ;;
3675e3a38431SPaul Bohmosf*)
3676e3a38431SPaul Bohm  symcode='[[BCDEGQRST]]'
3677e3a38431SPaul Bohm  ;;
3678e3a38431SPaul Bohmsolaris*)
3679e3a38431SPaul Bohm  symcode='[[BDRT]]'
3680e3a38431SPaul Bohm  ;;
3681e3a38431SPaul Bohmsco3.2v5*)
3682e3a38431SPaul Bohm  symcode='[[DT]]'
3683e3a38431SPaul Bohm  ;;
3684e3a38431SPaul Bohmsysv4.2uw2*)
3685e3a38431SPaul Bohm  symcode='[[DT]]'
3686e3a38431SPaul Bohm  ;;
3687e3a38431SPaul Bohmsysv5* | sco5v6* | unixware* | OpenUNIX*)
3688e3a38431SPaul Bohm  symcode='[[ABDT]]'
3689e3a38431SPaul Bohm  ;;
3690e3a38431SPaul Bohmsysv4)
3691e3a38431SPaul Bohm  symcode='[[DFNSTU]]'
3692e3a38431SPaul Bohm  ;;
3693e3a38431SPaul Bohmesac
3694e3a38431SPaul Bohm
3695e3a38431SPaul Bohm# If we're using GNU nm, then use its standard symbol codes.
3696e3a38431SPaul Bohmcase `$NM -V 2>&1` in
3697e3a38431SPaul Bohm*GNU* | *'with BFD'*)
3698e3a38431SPaul Bohm  symcode='[[ABCDGIRSTW]]' ;;
3699e3a38431SPaul Bohmesac
3700e3a38431SPaul Bohm
3701e3a38431SPaul Bohm# Transform an extracted symbol line into a proper C declaration.
3702e3a38431SPaul Bohm# Some systems (esp. on ia64) link data and code symbols differently,
3703e3a38431SPaul Bohm# so use this general approach.
3704e3a38431SPaul Bohmlt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3705e3a38431SPaul Bohm
3706e3a38431SPaul Bohm# Transform an extracted symbol line into symbol name and symbol address
3707*93823e6cSPaul Bohmlt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3708*93823e6cSPaul Bohmlt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
3709e3a38431SPaul Bohm
3710e3a38431SPaul Bohm# Handle CRLF in mingw tool chain
3711e3a38431SPaul Bohmopt_cr=
3712e3a38431SPaul Bohmcase $build_os in
3713e3a38431SPaul Bohmmingw*)
3714e3a38431SPaul Bohm  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3715e3a38431SPaul Bohm  ;;
3716e3a38431SPaul Bohmesac
3717e3a38431SPaul Bohm
3718e3a38431SPaul Bohm# Try without a prefix underscore, then with it.
3719e3a38431SPaul Bohmfor ac_symprfx in "" "_"; do
3720e3a38431SPaul Bohm
3721e3a38431SPaul Bohm  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3722e3a38431SPaul Bohm  symxfrm="\\1 $ac_symprfx\\2 \\2"
3723e3a38431SPaul Bohm
3724e3a38431SPaul Bohm  # Write the raw and C identifiers.
3725e3a38431SPaul Bohm  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3726e3a38431SPaul Bohm    # Fake it for dumpbin and say T for any non-static function
3727e3a38431SPaul Bohm    # and D for any global variable.
3728e3a38431SPaul Bohm    # Also find C++ and __fastcall symbols from MSVC++,
3729e3a38431SPaul Bohm    # which start with @ or ?.
3730e3a38431SPaul Bohm    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3731e3a38431SPaul Bohm"     {last_section=section; section=\$ 3};"\
3732*93823e6cSPaul Bohm"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
3733e3a38431SPaul Bohm"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3734e3a38431SPaul Bohm"     \$ 0!~/External *\|/{next};"\
3735e3a38431SPaul Bohm"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3736e3a38431SPaul Bohm"     {if(hide[section]) next};"\
3737e3a38431SPaul Bohm"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3738e3a38431SPaul Bohm"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3739e3a38431SPaul Bohm"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3740e3a38431SPaul Bohm"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3741e3a38431SPaul Bohm"     ' prfx=^$ac_symprfx]"
3742e3a38431SPaul Bohm  else
3743e3a38431SPaul Bohm    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3744e3a38431SPaul Bohm  fi
3745*93823e6cSPaul Bohm  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3746e3a38431SPaul Bohm
3747e3a38431SPaul Bohm  # Check to see that the pipe works correctly.
3748e3a38431SPaul Bohm  pipe_works=no
3749e3a38431SPaul Bohm
3750e3a38431SPaul Bohm  rm -f conftest*
3751e3a38431SPaul Bohm  cat > conftest.$ac_ext <<_LT_EOF
3752e3a38431SPaul Bohm#ifdef __cplusplus
3753e3a38431SPaul Bohmextern "C" {
3754e3a38431SPaul Bohm#endif
3755e3a38431SPaul Bohmchar nm_test_var;
3756e3a38431SPaul Bohmvoid nm_test_func(void);
3757e3a38431SPaul Bohmvoid nm_test_func(void){}
3758e3a38431SPaul Bohm#ifdef __cplusplus
3759e3a38431SPaul Bohm}
3760e3a38431SPaul Bohm#endif
3761e3a38431SPaul Bohmint main(){nm_test_var='a';nm_test_func();return(0);}
3762e3a38431SPaul Bohm_LT_EOF
3763e3a38431SPaul Bohm
3764e3a38431SPaul Bohm  if AC_TRY_EVAL(ac_compile); then
3765e3a38431SPaul Bohm    # Now try to grab the symbols.
3766e3a38431SPaul Bohm    nlist=conftest.nm
3767*93823e6cSPaul Bohm    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3768e3a38431SPaul Bohm      # Try sorting and uniquifying the output.
3769e3a38431SPaul Bohm      if sort "$nlist" | uniq > "$nlist"T; then
3770e3a38431SPaul Bohm	mv -f "$nlist"T "$nlist"
3771e3a38431SPaul Bohm      else
3772e3a38431SPaul Bohm	rm -f "$nlist"T
3773e3a38431SPaul Bohm      fi
3774e3a38431SPaul Bohm
3775e3a38431SPaul Bohm      # Make sure that we snagged all the symbols we need.
3776e3a38431SPaul Bohm      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3777e3a38431SPaul Bohm	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3778e3a38431SPaul Bohm	  cat <<_LT_EOF > conftest.$ac_ext
3779*93823e6cSPaul Bohm/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3780*93823e6cSPaul Bohm#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3781*93823e6cSPaul Bohm/* DATA imports from DLLs on WIN32 con't be const, because runtime
3782*93823e6cSPaul Bohm   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3783*93823e6cSPaul Bohm# define LT@&t@_DLSYM_CONST
3784*93823e6cSPaul Bohm#elif defined(__osf__)
3785*93823e6cSPaul Bohm/* This system does not cope well with relocations in const data.  */
3786*93823e6cSPaul Bohm# define LT@&t@_DLSYM_CONST
3787*93823e6cSPaul Bohm#else
3788*93823e6cSPaul Bohm# define LT@&t@_DLSYM_CONST const
3789*93823e6cSPaul Bohm#endif
3790*93823e6cSPaul Bohm
3791e3a38431SPaul Bohm#ifdef __cplusplus
3792e3a38431SPaul Bohmextern "C" {
3793e3a38431SPaul Bohm#endif
3794e3a38431SPaul Bohm
3795e3a38431SPaul Bohm_LT_EOF
3796e3a38431SPaul Bohm	  # Now generate the symbol file.
3797e3a38431SPaul Bohm	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3798e3a38431SPaul Bohm
3799e3a38431SPaul Bohm	  cat <<_LT_EOF >> conftest.$ac_ext
3800e3a38431SPaul Bohm
3801e3a38431SPaul Bohm/* The mapping between symbol names and symbols.  */
3802*93823e6cSPaul BohmLT@&t@_DLSYM_CONST struct {
3803e3a38431SPaul Bohm  const char *name;
3804e3a38431SPaul Bohm  void       *address;
3805e3a38431SPaul Bohm}
3806e3a38431SPaul Bohmlt__PROGRAM__LTX_preloaded_symbols[[]] =
3807e3a38431SPaul Bohm{
3808e3a38431SPaul Bohm  { "@PROGRAM@", (void *) 0 },
3809e3a38431SPaul Bohm_LT_EOF
3810e3a38431SPaul Bohm	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3811e3a38431SPaul Bohm	  cat <<\_LT_EOF >> conftest.$ac_ext
3812e3a38431SPaul Bohm  {0, (void *) 0}
3813e3a38431SPaul Bohm};
3814e3a38431SPaul Bohm
3815e3a38431SPaul Bohm/* This works around a problem in FreeBSD linker */
3816e3a38431SPaul Bohm#ifdef FREEBSD_WORKAROUND
3817e3a38431SPaul Bohmstatic const void *lt_preloaded_setup() {
3818e3a38431SPaul Bohm  return lt__PROGRAM__LTX_preloaded_symbols;
3819e3a38431SPaul Bohm}
3820e3a38431SPaul Bohm#endif
3821e3a38431SPaul Bohm
3822e3a38431SPaul Bohm#ifdef __cplusplus
3823e3a38431SPaul Bohm}
3824e3a38431SPaul Bohm#endif
3825e3a38431SPaul Bohm_LT_EOF
3826e3a38431SPaul Bohm	  # Now try linking the two files.
3827e3a38431SPaul Bohm	  mv conftest.$ac_objext conftstm.$ac_objext
3828*93823e6cSPaul Bohm	  lt_globsym_save_LIBS=$LIBS
3829*93823e6cSPaul Bohm	  lt_globsym_save_CFLAGS=$CFLAGS
3830e3a38431SPaul Bohm	  LIBS="conftstm.$ac_objext"
3831e3a38431SPaul Bohm	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3832e3a38431SPaul Bohm	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3833e3a38431SPaul Bohm	    pipe_works=yes
3834e3a38431SPaul Bohm	  fi
3835*93823e6cSPaul Bohm	  LIBS=$lt_globsym_save_LIBS
3836*93823e6cSPaul Bohm	  CFLAGS=$lt_globsym_save_CFLAGS
3837e3a38431SPaul Bohm	else
3838e3a38431SPaul Bohm	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3839e3a38431SPaul Bohm	fi
3840e3a38431SPaul Bohm      else
3841e3a38431SPaul Bohm	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3842e3a38431SPaul Bohm      fi
3843e3a38431SPaul Bohm    else
3844e3a38431SPaul Bohm      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3845e3a38431SPaul Bohm    fi
3846e3a38431SPaul Bohm  else
3847e3a38431SPaul Bohm    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3848e3a38431SPaul Bohm    cat conftest.$ac_ext >&5
3849e3a38431SPaul Bohm  fi
3850e3a38431SPaul Bohm  rm -rf conftest* conftst*
3851e3a38431SPaul Bohm
3852e3a38431SPaul Bohm  # Do not use the global_symbol_pipe unless it works.
3853e3a38431SPaul Bohm  if test "$pipe_works" = yes; then
3854e3a38431SPaul Bohm    break
3855e3a38431SPaul Bohm  else
3856e3a38431SPaul Bohm    lt_cv_sys_global_symbol_pipe=
3857e3a38431SPaul Bohm  fi
3858e3a38431SPaul Bohmdone
3859e3a38431SPaul Bohm])
3860e3a38431SPaul Bohmif test -z "$lt_cv_sys_global_symbol_pipe"; then
3861e3a38431SPaul Bohm  lt_cv_sys_global_symbol_to_cdecl=
3862e3a38431SPaul Bohmfi
3863e3a38431SPaul Bohmif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3864e3a38431SPaul Bohm  AC_MSG_RESULT(failed)
3865e3a38431SPaul Bohmelse
3866e3a38431SPaul Bohm  AC_MSG_RESULT(ok)
3867e3a38431SPaul Bohmfi
3868e3a38431SPaul Bohm
3869*93823e6cSPaul Bohm# Response file support.
3870*93823e6cSPaul Bohmif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3871*93823e6cSPaul Bohm  nm_file_list_spec='@'
3872*93823e6cSPaul Bohmelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3873*93823e6cSPaul Bohm  nm_file_list_spec='@'
3874*93823e6cSPaul Bohmfi
3875*93823e6cSPaul Bohm
3876e3a38431SPaul Bohm_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3877e3a38431SPaul Bohm    [Take the output of nm and produce a listing of raw symbols and C names])
3878e3a38431SPaul Bohm_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3879e3a38431SPaul Bohm    [Transform the output of nm in a proper C declaration])
3880e3a38431SPaul Bohm_LT_DECL([global_symbol_to_c_name_address],
3881e3a38431SPaul Bohm    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3882e3a38431SPaul Bohm    [Transform the output of nm in a C name address pair])
3883e3a38431SPaul Bohm_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3884e3a38431SPaul Bohm    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3885e3a38431SPaul Bohm    [Transform the output of nm in a C name address pair when lib prefix is needed])
3886*93823e6cSPaul Bohm_LT_DECL([], [nm_file_list_spec], [1],
3887*93823e6cSPaul Bohm    [Specify filename containing input files for $NM])
3888e3a38431SPaul Bohm]) # _LT_CMD_GLOBAL_SYMBOLS
3889e3a38431SPaul Bohm
3890e3a38431SPaul Bohm
3891e3a38431SPaul Bohm# _LT_COMPILER_PIC([TAGNAME])
3892e3a38431SPaul Bohm# ---------------------------
3893e3a38431SPaul Bohmm4_defun([_LT_COMPILER_PIC],
3894e3a38431SPaul Bohm[m4_require([_LT_TAG_COMPILER])dnl
3895e3a38431SPaul Bohm_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3896e3a38431SPaul Bohm_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3897e3a38431SPaul Bohm_LT_TAGVAR(lt_prog_compiler_static, $1)=
3898e3a38431SPaul Bohm
3899e3a38431SPaul Bohmm4_if([$1], [CXX], [
3900e3a38431SPaul Bohm  # C++ specific cases for pic, static, wl, etc.
3901e3a38431SPaul Bohm  if test "$GXX" = yes; then
3902e3a38431SPaul Bohm    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3903e3a38431SPaul Bohm    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3904e3a38431SPaul Bohm
3905e3a38431SPaul Bohm    case $host_os in
3906e3a38431SPaul Bohm    aix*)
3907e3a38431SPaul Bohm      # All AIX code is PIC.
3908e3a38431SPaul Bohm      if test "$host_cpu" = ia64; then
3909e3a38431SPaul Bohm	# AIX 5 now supports IA64 processor
3910e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3911e3a38431SPaul Bohm      fi
3912e3a38431SPaul Bohm      ;;
3913e3a38431SPaul Bohm
3914e3a38431SPaul Bohm    amigaos*)
3915e3a38431SPaul Bohm      case $host_cpu in
3916e3a38431SPaul Bohm      powerpc)
3917e3a38431SPaul Bohm            # see comment about AmigaOS4 .so support
3918e3a38431SPaul Bohm            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3919e3a38431SPaul Bohm        ;;
3920e3a38431SPaul Bohm      m68k)
3921e3a38431SPaul Bohm            # FIXME: we need at least 68020 code to build shared libraries, but
3922e3a38431SPaul Bohm            # adding the `-m68020' flag to GCC prevents building anything better,
3923e3a38431SPaul Bohm            # like `-m68040'.
3924e3a38431SPaul Bohm            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3925e3a38431SPaul Bohm        ;;
3926e3a38431SPaul Bohm      esac
3927e3a38431SPaul Bohm      ;;
3928e3a38431SPaul Bohm
3929e3a38431SPaul Bohm    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3930e3a38431SPaul Bohm      # PIC is the default for these OSes.
3931e3a38431SPaul Bohm      ;;
3932e3a38431SPaul Bohm    mingw* | cygwin* | os2* | pw32* | cegcc*)
3933e3a38431SPaul Bohm      # This hack is so that the source file can tell whether it is being
3934e3a38431SPaul Bohm      # built for inclusion in a dll (and should export symbols for example).
3935e3a38431SPaul Bohm      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3936e3a38431SPaul Bohm      # (--disable-auto-import) libraries
3937e3a38431SPaul Bohm      m4_if([$1], [GCJ], [],
3938e3a38431SPaul Bohm	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3939e3a38431SPaul Bohm      ;;
3940e3a38431SPaul Bohm    darwin* | rhapsody*)
3941e3a38431SPaul Bohm      # PIC is the default on this platform
3942e3a38431SPaul Bohm      # Common symbols not allowed in MH_DYLIB files
3943e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3944e3a38431SPaul Bohm      ;;
3945e3a38431SPaul Bohm    *djgpp*)
3946e3a38431SPaul Bohm      # DJGPP does not support shared libraries at all
3947e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3948e3a38431SPaul Bohm      ;;
3949*93823e6cSPaul Bohm    haiku*)
3950*93823e6cSPaul Bohm      # PIC is the default for Haiku.
3951*93823e6cSPaul Bohm      # The "-static" flag exists, but is broken.
3952*93823e6cSPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)=
3953*93823e6cSPaul Bohm      ;;
3954e3a38431SPaul Bohm    interix[[3-9]]*)
3955e3a38431SPaul Bohm      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3956e3a38431SPaul Bohm      # Instead, we relocate shared libraries at runtime.
3957e3a38431SPaul Bohm      ;;
3958e3a38431SPaul Bohm    sysv4*MP*)
3959e3a38431SPaul Bohm      if test -d /usr/nec; then
3960e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3961e3a38431SPaul Bohm      fi
3962e3a38431SPaul Bohm      ;;
3963e3a38431SPaul Bohm    hpux*)
3964e3a38431SPaul Bohm      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3965e3a38431SPaul Bohm      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3966e3a38431SPaul Bohm      # sets the default TLS model and affects inlining.
3967e3a38431SPaul Bohm      case $host_cpu in
3968e3a38431SPaul Bohm      hppa*64*)
3969e3a38431SPaul Bohm	;;
3970e3a38431SPaul Bohm      *)
3971e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3972e3a38431SPaul Bohm	;;
3973e3a38431SPaul Bohm      esac
3974e3a38431SPaul Bohm      ;;
3975e3a38431SPaul Bohm    *qnx* | *nto*)
3976e3a38431SPaul Bohm      # QNX uses GNU C++, but need to define -shared option too, otherwise
3977e3a38431SPaul Bohm      # it will coredump.
3978e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3979e3a38431SPaul Bohm      ;;
3980e3a38431SPaul Bohm    *)
3981e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3982e3a38431SPaul Bohm      ;;
3983e3a38431SPaul Bohm    esac
3984e3a38431SPaul Bohm  else
3985e3a38431SPaul Bohm    case $host_os in
3986e3a38431SPaul Bohm      aix[[4-9]]*)
3987e3a38431SPaul Bohm	# All AIX code is PIC.
3988e3a38431SPaul Bohm	if test "$host_cpu" = ia64; then
3989e3a38431SPaul Bohm	  # AIX 5 now supports IA64 processor
3990e3a38431SPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3991e3a38431SPaul Bohm	else
3992e3a38431SPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3993e3a38431SPaul Bohm	fi
3994e3a38431SPaul Bohm	;;
3995e3a38431SPaul Bohm      chorus*)
3996e3a38431SPaul Bohm	case $cc_basename in
3997e3a38431SPaul Bohm	cxch68*)
3998e3a38431SPaul Bohm	  # Green Hills C++ Compiler
3999e3a38431SPaul Bohm	  # _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"
4000e3a38431SPaul Bohm	  ;;
4001e3a38431SPaul Bohm	esac
4002e3a38431SPaul Bohm	;;
4003*93823e6cSPaul Bohm      mingw* | cygwin* | os2* | pw32* | cegcc*)
4004*93823e6cSPaul Bohm	# This hack is so that the source file can tell whether it is being
4005*93823e6cSPaul Bohm	# built for inclusion in a dll (and should export symbols for example).
4006*93823e6cSPaul Bohm	m4_if([$1], [GCJ], [],
4007*93823e6cSPaul Bohm	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4008*93823e6cSPaul Bohm	;;
4009e3a38431SPaul Bohm      dgux*)
4010e3a38431SPaul Bohm	case $cc_basename in
4011e3a38431SPaul Bohm	  ec++*)
4012e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4013e3a38431SPaul Bohm	    ;;
4014e3a38431SPaul Bohm	  ghcx*)
4015e3a38431SPaul Bohm	    # Green Hills C++ Compiler
4016e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4017e3a38431SPaul Bohm	    ;;
4018e3a38431SPaul Bohm	  *)
4019e3a38431SPaul Bohm	    ;;
4020e3a38431SPaul Bohm	esac
4021e3a38431SPaul Bohm	;;
4022e3a38431SPaul Bohm      freebsd* | dragonfly*)
4023e3a38431SPaul Bohm	# FreeBSD uses GNU C++
4024e3a38431SPaul Bohm	;;
4025e3a38431SPaul Bohm      hpux9* | hpux10* | hpux11*)
4026e3a38431SPaul Bohm	case $cc_basename in
4027e3a38431SPaul Bohm	  CC*)
4028e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4029e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4030e3a38431SPaul Bohm	    if test "$host_cpu" != ia64; then
4031e3a38431SPaul Bohm	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4032e3a38431SPaul Bohm	    fi
4033e3a38431SPaul Bohm	    ;;
4034e3a38431SPaul Bohm	  aCC*)
4035e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4036e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4037e3a38431SPaul Bohm	    case $host_cpu in
4038e3a38431SPaul Bohm	    hppa*64*|ia64*)
4039e3a38431SPaul Bohm	      # +Z the default
4040e3a38431SPaul Bohm	      ;;
4041e3a38431SPaul Bohm	    *)
4042e3a38431SPaul Bohm	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4043e3a38431SPaul Bohm	      ;;
4044e3a38431SPaul Bohm	    esac
4045e3a38431SPaul Bohm	    ;;
4046e3a38431SPaul Bohm	  *)
4047e3a38431SPaul Bohm	    ;;
4048e3a38431SPaul Bohm	esac
4049e3a38431SPaul Bohm	;;
4050e3a38431SPaul Bohm      interix*)
4051e3a38431SPaul Bohm	# This is c89, which is MS Visual C++ (no shared libs)
4052e3a38431SPaul Bohm	# Anyone wants to do a port?
4053e3a38431SPaul Bohm	;;
4054e3a38431SPaul Bohm      irix5* | irix6* | nonstopux*)
4055e3a38431SPaul Bohm	case $cc_basename in
4056e3a38431SPaul Bohm	  CC*)
4057e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4058e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4059e3a38431SPaul Bohm	    # CC pic flag -KPIC is the default.
4060e3a38431SPaul Bohm	    ;;
4061e3a38431SPaul Bohm	  *)
4062e3a38431SPaul Bohm	    ;;
4063e3a38431SPaul Bohm	esac
4064e3a38431SPaul Bohm	;;
4065*93823e6cSPaul Bohm      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4066e3a38431SPaul Bohm	case $cc_basename in
4067e3a38431SPaul Bohm	  KCC*)
4068e3a38431SPaul Bohm	    # KAI C++ Compiler
4069e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4070e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4071e3a38431SPaul Bohm	    ;;
4072e3a38431SPaul Bohm	  ecpc* )
4073e3a38431SPaul Bohm	    # old Intel C++ for x86_64 which still supported -KPIC.
4074e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4075e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4076e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4077e3a38431SPaul Bohm	    ;;
4078e3a38431SPaul Bohm	  icpc* )
4079e3a38431SPaul Bohm	    # Intel C++, used to be incompatible with GCC.
4080e3a38431SPaul Bohm	    # ICC 10 doesn't accept -KPIC any more.
4081e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4082e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4083e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4084e3a38431SPaul Bohm	    ;;
4085e3a38431SPaul Bohm	  pgCC* | pgcpp*)
4086e3a38431SPaul Bohm	    # Portland Group C++ compiler
4087e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4088e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4089e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4090e3a38431SPaul Bohm	    ;;
4091e3a38431SPaul Bohm	  cxx*)
4092e3a38431SPaul Bohm	    # Compaq C++
4093e3a38431SPaul Bohm	    # Make sure the PIC flag is empty.  It appears that all Alpha
4094e3a38431SPaul Bohm	    # Linux and Compaq Tru64 Unix objects are PIC.
4095e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4096e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4097e3a38431SPaul Bohm	    ;;
4098*93823e6cSPaul Bohm	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4099*93823e6cSPaul Bohm	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4100e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4101e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4102e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4103e3a38431SPaul Bohm	    ;;
4104e3a38431SPaul Bohm	  *)
4105e3a38431SPaul Bohm	    case `$CC -V 2>&1 | sed 5q` in
4106e3a38431SPaul Bohm	    *Sun\ C*)
4107e3a38431SPaul Bohm	      # Sun C++ 5.9
4108e3a38431SPaul Bohm	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4109e3a38431SPaul Bohm	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4110e3a38431SPaul Bohm	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4111e3a38431SPaul Bohm	      ;;
4112e3a38431SPaul Bohm	    esac
4113e3a38431SPaul Bohm	    ;;
4114e3a38431SPaul Bohm	esac
4115e3a38431SPaul Bohm	;;
4116e3a38431SPaul Bohm      lynxos*)
4117e3a38431SPaul Bohm	;;
4118e3a38431SPaul Bohm      m88k*)
4119e3a38431SPaul Bohm	;;
4120e3a38431SPaul Bohm      mvs*)
4121e3a38431SPaul Bohm	case $cc_basename in
4122e3a38431SPaul Bohm	  cxx*)
4123e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4124e3a38431SPaul Bohm	    ;;
4125e3a38431SPaul Bohm	  *)
4126e3a38431SPaul Bohm	    ;;
4127e3a38431SPaul Bohm	esac
4128e3a38431SPaul Bohm	;;
4129e3a38431SPaul Bohm      netbsd* | netbsdelf*-gnu)
4130e3a38431SPaul Bohm	;;
4131e3a38431SPaul Bohm      *qnx* | *nto*)
4132e3a38431SPaul Bohm        # QNX uses GNU C++, but need to define -shared option too, otherwise
4133e3a38431SPaul Bohm        # it will coredump.
4134e3a38431SPaul Bohm        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4135e3a38431SPaul Bohm        ;;
4136e3a38431SPaul Bohm      osf3* | osf4* | osf5*)
4137e3a38431SPaul Bohm	case $cc_basename in
4138e3a38431SPaul Bohm	  KCC*)
4139e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4140e3a38431SPaul Bohm	    ;;
4141e3a38431SPaul Bohm	  RCC*)
4142e3a38431SPaul Bohm	    # Rational C++ 2.4.1
4143e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4144e3a38431SPaul Bohm	    ;;
4145e3a38431SPaul Bohm	  cxx*)
4146e3a38431SPaul Bohm	    # Digital/Compaq C++
4147e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4148e3a38431SPaul Bohm	    # Make sure the PIC flag is empty.  It appears that all Alpha
4149e3a38431SPaul Bohm	    # Linux and Compaq Tru64 Unix objects are PIC.
4150e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4151e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4152e3a38431SPaul Bohm	    ;;
4153e3a38431SPaul Bohm	  *)
4154e3a38431SPaul Bohm	    ;;
4155e3a38431SPaul Bohm	esac
4156e3a38431SPaul Bohm	;;
4157e3a38431SPaul Bohm      psos*)
4158e3a38431SPaul Bohm	;;
4159e3a38431SPaul Bohm      solaris*)
4160e3a38431SPaul Bohm	case $cc_basename in
4161*93823e6cSPaul Bohm	  CC* | sunCC*)
4162e3a38431SPaul Bohm	    # Sun C++ 4.2, 5.x and Centerline C++
4163e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4164e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4165e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4166e3a38431SPaul Bohm	    ;;
4167e3a38431SPaul Bohm	  gcx*)
4168e3a38431SPaul Bohm	    # Green Hills C++ Compiler
4169e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4170e3a38431SPaul Bohm	    ;;
4171e3a38431SPaul Bohm	  *)
4172e3a38431SPaul Bohm	    ;;
4173e3a38431SPaul Bohm	esac
4174e3a38431SPaul Bohm	;;
4175e3a38431SPaul Bohm      sunos4*)
4176e3a38431SPaul Bohm	case $cc_basename in
4177e3a38431SPaul Bohm	  CC*)
4178e3a38431SPaul Bohm	    # Sun C++ 4.x
4179e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4180e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4181e3a38431SPaul Bohm	    ;;
4182e3a38431SPaul Bohm	  lcc*)
4183e3a38431SPaul Bohm	    # Lucid
4184e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4185e3a38431SPaul Bohm	    ;;
4186e3a38431SPaul Bohm	  *)
4187e3a38431SPaul Bohm	    ;;
4188e3a38431SPaul Bohm	esac
4189e3a38431SPaul Bohm	;;
4190e3a38431SPaul Bohm      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4191e3a38431SPaul Bohm	case $cc_basename in
4192e3a38431SPaul Bohm	  CC*)
4193e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4194e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4195e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4196e3a38431SPaul Bohm	    ;;
4197e3a38431SPaul Bohm	esac
4198e3a38431SPaul Bohm	;;
4199e3a38431SPaul Bohm      tandem*)
4200e3a38431SPaul Bohm	case $cc_basename in
4201e3a38431SPaul Bohm	  NCC*)
4202e3a38431SPaul Bohm	    # NonStop-UX NCC 3.20
4203e3a38431SPaul Bohm	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4204e3a38431SPaul Bohm	    ;;
4205e3a38431SPaul Bohm	  *)
4206e3a38431SPaul Bohm	    ;;
4207e3a38431SPaul Bohm	esac
4208e3a38431SPaul Bohm	;;
4209e3a38431SPaul Bohm      vxworks*)
4210e3a38431SPaul Bohm	;;
4211e3a38431SPaul Bohm      *)
4212e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4213e3a38431SPaul Bohm	;;
4214e3a38431SPaul Bohm    esac
4215e3a38431SPaul Bohm  fi
4216e3a38431SPaul Bohm],
4217e3a38431SPaul Bohm[
4218e3a38431SPaul Bohm  if test "$GCC" = yes; then
4219e3a38431SPaul Bohm    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4220e3a38431SPaul Bohm    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4221e3a38431SPaul Bohm
4222e3a38431SPaul Bohm    case $host_os in
4223e3a38431SPaul Bohm      aix*)
4224e3a38431SPaul Bohm      # All AIX code is PIC.
4225e3a38431SPaul Bohm      if test "$host_cpu" = ia64; then
4226e3a38431SPaul Bohm	# AIX 5 now supports IA64 processor
4227e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4228e3a38431SPaul Bohm      fi
4229e3a38431SPaul Bohm      ;;
4230e3a38431SPaul Bohm
4231e3a38431SPaul Bohm    amigaos*)
4232e3a38431SPaul Bohm      case $host_cpu in
4233e3a38431SPaul Bohm      powerpc)
4234e3a38431SPaul Bohm            # see comment about AmigaOS4 .so support
4235e3a38431SPaul Bohm            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4236e3a38431SPaul Bohm        ;;
4237e3a38431SPaul Bohm      m68k)
4238e3a38431SPaul Bohm            # FIXME: we need at least 68020 code to build shared libraries, but
4239e3a38431SPaul Bohm            # adding the `-m68020' flag to GCC prevents building anything better,
4240e3a38431SPaul Bohm            # like `-m68040'.
4241e3a38431SPaul Bohm            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4242e3a38431SPaul Bohm        ;;
4243e3a38431SPaul Bohm      esac
4244e3a38431SPaul Bohm      ;;
4245e3a38431SPaul Bohm
4246e3a38431SPaul Bohm    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4247e3a38431SPaul Bohm      # PIC is the default for these OSes.
4248e3a38431SPaul Bohm      ;;
4249e3a38431SPaul Bohm
4250e3a38431SPaul Bohm    mingw* | cygwin* | pw32* | os2* | cegcc*)
4251e3a38431SPaul Bohm      # This hack is so that the source file can tell whether it is being
4252e3a38431SPaul Bohm      # built for inclusion in a dll (and should export symbols for example).
4253e3a38431SPaul Bohm      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4254e3a38431SPaul Bohm      # (--disable-auto-import) libraries
4255e3a38431SPaul Bohm      m4_if([$1], [GCJ], [],
4256e3a38431SPaul Bohm	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4257e3a38431SPaul Bohm      ;;
4258e3a38431SPaul Bohm
4259e3a38431SPaul Bohm    darwin* | rhapsody*)
4260e3a38431SPaul Bohm      # PIC is the default on this platform
4261e3a38431SPaul Bohm      # Common symbols not allowed in MH_DYLIB files
4262e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4263e3a38431SPaul Bohm      ;;
4264e3a38431SPaul Bohm
4265*93823e6cSPaul Bohm    haiku*)
4266*93823e6cSPaul Bohm      # PIC is the default for Haiku.
4267*93823e6cSPaul Bohm      # The "-static" flag exists, but is broken.
4268*93823e6cSPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4269*93823e6cSPaul Bohm      ;;
4270*93823e6cSPaul Bohm
4271e3a38431SPaul Bohm    hpux*)
4272e3a38431SPaul Bohm      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4273e3a38431SPaul Bohm      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4274e3a38431SPaul Bohm      # sets the default TLS model and affects inlining.
4275e3a38431SPaul Bohm      case $host_cpu in
4276e3a38431SPaul Bohm      hppa*64*)
4277e3a38431SPaul Bohm	# +Z the default
4278e3a38431SPaul Bohm	;;
4279e3a38431SPaul Bohm      *)
4280e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4281e3a38431SPaul Bohm	;;
4282e3a38431SPaul Bohm      esac
4283e3a38431SPaul Bohm      ;;
4284e3a38431SPaul Bohm
4285e3a38431SPaul Bohm    interix[[3-9]]*)
4286e3a38431SPaul Bohm      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4287e3a38431SPaul Bohm      # Instead, we relocate shared libraries at runtime.
4288e3a38431SPaul Bohm      ;;
4289e3a38431SPaul Bohm
4290e3a38431SPaul Bohm    msdosdjgpp*)
4291e3a38431SPaul Bohm      # Just because we use GCC doesn't mean we suddenly get shared libraries
4292e3a38431SPaul Bohm      # on systems that don't support them.
4293e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4294e3a38431SPaul Bohm      enable_shared=no
4295e3a38431SPaul Bohm      ;;
4296e3a38431SPaul Bohm
4297e3a38431SPaul Bohm    *nto* | *qnx*)
4298e3a38431SPaul Bohm      # QNX uses GNU C++, but need to define -shared option too, otherwise
4299e3a38431SPaul Bohm      # it will coredump.
4300e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4301e3a38431SPaul Bohm      ;;
4302e3a38431SPaul Bohm
4303e3a38431SPaul Bohm    sysv4*MP*)
4304e3a38431SPaul Bohm      if test -d /usr/nec; then
4305e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4306e3a38431SPaul Bohm      fi
4307e3a38431SPaul Bohm      ;;
4308e3a38431SPaul Bohm
4309e3a38431SPaul Bohm    *)
4310e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4311e3a38431SPaul Bohm      ;;
4312e3a38431SPaul Bohm    esac
4313*93823e6cSPaul Bohm
4314*93823e6cSPaul Bohm    case $cc_basename in
4315*93823e6cSPaul Bohm    nvcc*) # Cuda Compiler Driver 2.2
4316*93823e6cSPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4317*93823e6cSPaul Bohm      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4318*93823e6cSPaul Bohm        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4319*93823e6cSPaul Bohm      fi
4320*93823e6cSPaul Bohm      ;;
4321*93823e6cSPaul Bohm    esac
4322e3a38431SPaul Bohm  else
4323e3a38431SPaul Bohm    # PORTME Check for flag to pass linker flags through the system compiler.
4324e3a38431SPaul Bohm    case $host_os in
4325e3a38431SPaul Bohm    aix*)
4326e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4327e3a38431SPaul Bohm      if test "$host_cpu" = ia64; then
4328e3a38431SPaul Bohm	# AIX 5 now supports IA64 processor
4329e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4330e3a38431SPaul Bohm      else
4331e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4332e3a38431SPaul Bohm      fi
4333e3a38431SPaul Bohm      ;;
4334e3a38431SPaul Bohm
4335e3a38431SPaul Bohm    mingw* | cygwin* | pw32* | os2* | cegcc*)
4336e3a38431SPaul Bohm      # This hack is so that the source file can tell whether it is being
4337e3a38431SPaul Bohm      # built for inclusion in a dll (and should export symbols for example).
4338e3a38431SPaul Bohm      m4_if([$1], [GCJ], [],
4339e3a38431SPaul Bohm	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4340e3a38431SPaul Bohm      ;;
4341e3a38431SPaul Bohm
4342e3a38431SPaul Bohm    hpux9* | hpux10* | hpux11*)
4343e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4344e3a38431SPaul Bohm      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4345e3a38431SPaul Bohm      # not for PA HP-UX.
4346e3a38431SPaul Bohm      case $host_cpu in
4347e3a38431SPaul Bohm      hppa*64*|ia64*)
4348e3a38431SPaul Bohm	# +Z the default
4349e3a38431SPaul Bohm	;;
4350e3a38431SPaul Bohm      *)
4351e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4352e3a38431SPaul Bohm	;;
4353e3a38431SPaul Bohm      esac
4354e3a38431SPaul Bohm      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4355e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4356e3a38431SPaul Bohm      ;;
4357e3a38431SPaul Bohm
4358e3a38431SPaul Bohm    irix5* | irix6* | nonstopux*)
4359e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4360e3a38431SPaul Bohm      # PIC (with -KPIC) is the default.
4361e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4362e3a38431SPaul Bohm      ;;
4363e3a38431SPaul Bohm
4364*93823e6cSPaul Bohm    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4365e3a38431SPaul Bohm      case $cc_basename in
4366e3a38431SPaul Bohm      # old Intel for x86_64 which still supported -KPIC.
4367e3a38431SPaul Bohm      ecc*)
4368e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4369e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4370e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4371e3a38431SPaul Bohm        ;;
4372e3a38431SPaul Bohm      # icc used to be incompatible with GCC.
4373e3a38431SPaul Bohm      # ICC 10 doesn't accept -KPIC any more.
4374e3a38431SPaul Bohm      icc* | ifort*)
4375e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4376e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4377e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4378e3a38431SPaul Bohm        ;;
4379e3a38431SPaul Bohm      # Lahey Fortran 8.1.
4380e3a38431SPaul Bohm      lf95*)
4381e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4382e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4383e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4384e3a38431SPaul Bohm	;;
4385*93823e6cSPaul Bohm      nagfor*)
4386*93823e6cSPaul Bohm	# NAG Fortran compiler
4387*93823e6cSPaul Bohm	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4388*93823e6cSPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4389*93823e6cSPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4390*93823e6cSPaul Bohm	;;
4391*93823e6cSPaul Bohm      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4392e3a38431SPaul Bohm        # Portland Group compilers (*not* the Pentium gcc compiler,
4393e3a38431SPaul Bohm	# which looks to be a dead project)
4394e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4395e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4396e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4397e3a38431SPaul Bohm        ;;
4398e3a38431SPaul Bohm      ccc*)
4399e3a38431SPaul Bohm        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4400e3a38431SPaul Bohm        # All Alpha code is PIC.
4401e3a38431SPaul Bohm        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4402e3a38431SPaul Bohm        ;;
4403*93823e6cSPaul Bohm      xl* | bgxl* | bgf* | mpixl*)
4404*93823e6cSPaul Bohm	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4405e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4406e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4407e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4408e3a38431SPaul Bohm	;;
4409e3a38431SPaul Bohm      *)
4410e3a38431SPaul Bohm	case `$CC -V 2>&1 | sed 5q` in
4411*93823e6cSPaul Bohm	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4412*93823e6cSPaul Bohm	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4413*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4414*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4415*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4416*93823e6cSPaul Bohm	  ;;
4417*93823e6cSPaul Bohm	*Sun\ F* | *Sun*Fortran*)
4418*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4419*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4420*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4421*93823e6cSPaul Bohm	  ;;
4422e3a38431SPaul Bohm	*Sun\ C*)
4423e3a38431SPaul Bohm	  # Sun C 5.9
4424e3a38431SPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4425e3a38431SPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4426e3a38431SPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4427e3a38431SPaul Bohm	  ;;
4428*93823e6cSPaul Bohm        *Intel*\ [[CF]]*Compiler*)
4429*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4430*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4431*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4432*93823e6cSPaul Bohm	  ;;
4433*93823e6cSPaul Bohm	*Portland\ Group*)
4434*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4435*93823e6cSPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4436e3a38431SPaul Bohm	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4437e3a38431SPaul Bohm	  ;;
4438e3a38431SPaul Bohm	esac
4439e3a38431SPaul Bohm	;;
4440e3a38431SPaul Bohm      esac
4441e3a38431SPaul Bohm      ;;
4442e3a38431SPaul Bohm
4443e3a38431SPaul Bohm    newsos6)
4444e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4445e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4446e3a38431SPaul Bohm      ;;
4447e3a38431SPaul Bohm
4448e3a38431SPaul Bohm    *nto* | *qnx*)
4449e3a38431SPaul Bohm      # QNX uses GNU C++, but need to define -shared option too, otherwise
4450e3a38431SPaul Bohm      # it will coredump.
4451e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4452e3a38431SPaul Bohm      ;;
4453e3a38431SPaul Bohm
4454e3a38431SPaul Bohm    osf3* | osf4* | osf5*)
4455e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4456e3a38431SPaul Bohm      # All OSF/1 code is PIC.
4457e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4458e3a38431SPaul Bohm      ;;
4459e3a38431SPaul Bohm
4460e3a38431SPaul Bohm    rdos*)
4461e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4462e3a38431SPaul Bohm      ;;
4463e3a38431SPaul Bohm
4464e3a38431SPaul Bohm    solaris*)
4465e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4466e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4467e3a38431SPaul Bohm      case $cc_basename in
4468*93823e6cSPaul Bohm      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4469e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4470e3a38431SPaul Bohm      *)
4471e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4472e3a38431SPaul Bohm      esac
4473e3a38431SPaul Bohm      ;;
4474e3a38431SPaul Bohm
4475e3a38431SPaul Bohm    sunos4*)
4476e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4477e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4478e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4479e3a38431SPaul Bohm      ;;
4480e3a38431SPaul Bohm
4481e3a38431SPaul Bohm    sysv4 | sysv4.2uw2* | sysv4.3*)
4482e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4483e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4484e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4485e3a38431SPaul Bohm      ;;
4486e3a38431SPaul Bohm
4487e3a38431SPaul Bohm    sysv4*MP*)
4488e3a38431SPaul Bohm      if test -d /usr/nec ;then
4489e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4490e3a38431SPaul Bohm	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4491e3a38431SPaul Bohm      fi
4492e3a38431SPaul Bohm      ;;
4493e3a38431SPaul Bohm
4494e3a38431SPaul Bohm    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4495e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4496e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4497e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4498e3a38431SPaul Bohm      ;;
4499e3a38431SPaul Bohm
4500e3a38431SPaul Bohm    unicos*)
4501e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4502e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4503e3a38431SPaul Bohm      ;;
4504e3a38431SPaul Bohm
4505e3a38431SPaul Bohm    uts4*)
4506e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4507e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4508e3a38431SPaul Bohm      ;;
4509e3a38431SPaul Bohm
4510e3a38431SPaul Bohm    *)
4511e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4512e3a38431SPaul Bohm      ;;
4513e3a38431SPaul Bohm    esac
4514e3a38431SPaul Bohm  fi
4515e3a38431SPaul Bohm])
4516e3a38431SPaul Bohmcase $host_os in
4517e3a38431SPaul Bohm  # For platforms which do not support PIC, -DPIC is meaningless:
4518e3a38431SPaul Bohm  *djgpp*)
4519e3a38431SPaul Bohm    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4520e3a38431SPaul Bohm    ;;
4521e3a38431SPaul Bohm  *)
4522e3a38431SPaul Bohm    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4523e3a38431SPaul Bohm    ;;
4524e3a38431SPaul Bohmesac
4525*93823e6cSPaul Bohm
4526*93823e6cSPaul BohmAC_CACHE_CHECK([for $compiler option to produce PIC],
4527*93823e6cSPaul Bohm  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4528*93823e6cSPaul Bohm  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4529*93823e6cSPaul Bohm_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4530e3a38431SPaul Bohm
4531e3a38431SPaul Bohm#
4532e3a38431SPaul Bohm# Check to make sure the PIC flag actually works.
4533e3a38431SPaul Bohm#
4534e3a38431SPaul Bohmif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4535e3a38431SPaul Bohm  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4536e3a38431SPaul Bohm    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4537e3a38431SPaul Bohm    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4538e3a38431SPaul Bohm    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4539e3a38431SPaul Bohm     "" | " "*) ;;
4540e3a38431SPaul Bohm     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4541e3a38431SPaul Bohm     esac],
4542e3a38431SPaul Bohm    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4543e3a38431SPaul Bohm     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4544e3a38431SPaul Bohmfi
4545e3a38431SPaul Bohm_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4546e3a38431SPaul Bohm	[Additional compiler flags for building library objects])
4547e3a38431SPaul Bohm
4548*93823e6cSPaul Bohm_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4549*93823e6cSPaul Bohm	[How to pass a linker flag through the compiler])
4550e3a38431SPaul Bohm#
4551e3a38431SPaul Bohm# Check to make sure the static flag actually works.
4552e3a38431SPaul Bohm#
4553e3a38431SPaul Bohmwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4554e3a38431SPaul Bohm_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4555e3a38431SPaul Bohm  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4556e3a38431SPaul Bohm  $lt_tmp_static_flag,
4557e3a38431SPaul Bohm  [],
4558e3a38431SPaul Bohm  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4559e3a38431SPaul Bohm_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4560e3a38431SPaul Bohm	[Compiler flag to prevent dynamic linking])
4561e3a38431SPaul Bohm])# _LT_COMPILER_PIC
4562e3a38431SPaul Bohm
4563e3a38431SPaul Bohm
4564e3a38431SPaul Bohm# _LT_LINKER_SHLIBS([TAGNAME])
4565e3a38431SPaul Bohm# ----------------------------
4566e3a38431SPaul Bohm# See if the linker supports building shared libraries.
4567e3a38431SPaul Bohmm4_defun([_LT_LINKER_SHLIBS],
4568e3a38431SPaul Bohm[AC_REQUIRE([LT_PATH_LD])dnl
4569e3a38431SPaul BohmAC_REQUIRE([LT_PATH_NM])dnl
4570*93823e6cSPaul Bohmm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4571e3a38431SPaul Bohmm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4572e3a38431SPaul Bohmm4_require([_LT_DECL_EGREP])dnl
4573e3a38431SPaul Bohmm4_require([_LT_DECL_SED])dnl
4574e3a38431SPaul Bohmm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4575e3a38431SPaul Bohmm4_require([_LT_TAG_COMPILER])dnl
4576e3a38431SPaul BohmAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4577e3a38431SPaul Bohmm4_if([$1], [CXX], [
4578e3a38431SPaul Bohm  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4579*93823e6cSPaul Bohm  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4580e3a38431SPaul Bohm  case $host_os in
4581e3a38431SPaul Bohm  aix[[4-9]]*)
4582e3a38431SPaul Bohm    # If we're using GNU nm, then we don't want the "-C" option.
4583e3a38431SPaul Bohm    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4584*93823e6cSPaul Bohm    # Also, AIX nm treats weak defined symbols like other global defined
4585*93823e6cSPaul Bohm    # symbols, whereas GNU nm marks them as "W".
4586e3a38431SPaul Bohm    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4587*93823e6cSPaul Bohm      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4588e3a38431SPaul Bohm    else
4589e3a38431SPaul Bohm      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4590e3a38431SPaul Bohm    fi
4591e3a38431SPaul Bohm    ;;
4592e3a38431SPaul Bohm  pw32*)
4593e3a38431SPaul Bohm    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4594e3a38431SPaul Bohm    ;;
4595e3a38431SPaul Bohm  cygwin* | mingw* | cegcc*)
4596*93823e6cSPaul Bohm    case $cc_basename in
4597*93823e6cSPaul Bohm    cl*)
4598*93823e6cSPaul Bohm      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4599e3a38431SPaul Bohm      ;;
4600*93823e6cSPaul Bohm    *)
4601*93823e6cSPaul Bohm      _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'
4602*93823e6cSPaul Bohm      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4603*93823e6cSPaul Bohm      ;;
4604*93823e6cSPaul Bohm    esac
4605*93823e6cSPaul Bohm    ;;
4606*93823e6cSPaul Bohm  linux* | k*bsd*-gnu | gnu*)
4607e3a38431SPaul Bohm    _LT_TAGVAR(link_all_deplibs, $1)=no
4608e3a38431SPaul Bohm    ;;
4609e3a38431SPaul Bohm  *)
4610e3a38431SPaul Bohm    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4611e3a38431SPaul Bohm    ;;
4612e3a38431SPaul Bohm  esac
4613e3a38431SPaul Bohm], [
4614e3a38431SPaul Bohm  runpath_var=
4615e3a38431SPaul Bohm  _LT_TAGVAR(allow_undefined_flag, $1)=
4616e3a38431SPaul Bohm  _LT_TAGVAR(always_export_symbols, $1)=no
4617e3a38431SPaul Bohm  _LT_TAGVAR(archive_cmds, $1)=
4618e3a38431SPaul Bohm  _LT_TAGVAR(archive_expsym_cmds, $1)=
4619e3a38431SPaul Bohm  _LT_TAGVAR(compiler_needs_object, $1)=no
4620e3a38431SPaul Bohm  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4621e3a38431SPaul Bohm  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4622e3a38431SPaul Bohm  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4623e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_automatic, $1)=no
4624e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_direct, $1)=no
4625e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4626e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4627e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4628e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_minus_L, $1)=no
4629e3a38431SPaul Bohm  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4630e3a38431SPaul Bohm  _LT_TAGVAR(inherit_rpath, $1)=no
4631e3a38431SPaul Bohm  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4632e3a38431SPaul Bohm  _LT_TAGVAR(module_cmds, $1)=
4633e3a38431SPaul Bohm  _LT_TAGVAR(module_expsym_cmds, $1)=
4634e3a38431SPaul Bohm  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4635e3a38431SPaul Bohm  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4636e3a38431SPaul Bohm  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4637e3a38431SPaul Bohm  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4638e3a38431SPaul Bohm  # include_expsyms should be a list of space-separated symbols to be *always*
4639e3a38431SPaul Bohm  # included in the symbol list
4640e3a38431SPaul Bohm  _LT_TAGVAR(include_expsyms, $1)=
4641e3a38431SPaul Bohm  # exclude_expsyms can be an extended regexp of symbols to exclude
4642e3a38431SPaul Bohm  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4643e3a38431SPaul Bohm  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4644e3a38431SPaul Bohm  # as well as any symbol that contains `d'.
4645e3a38431SPaul Bohm  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4646e3a38431SPaul Bohm  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4647e3a38431SPaul Bohm  # platforms (ab)use it in PIC code, but their linkers get confused if
4648e3a38431SPaul Bohm  # the symbol is explicitly referenced.  Since portable code cannot
4649e3a38431SPaul Bohm  # rely on this symbol name, it's probably fine to never include it in
4650e3a38431SPaul Bohm  # preloaded symbol tables.
4651e3a38431SPaul Bohm  # Exclude shared library initialization/finalization symbols.
4652e3a38431SPaul Bohmdnl Note also adjust exclude_expsyms for C++ above.
4653e3a38431SPaul Bohm  extract_expsyms_cmds=
4654e3a38431SPaul Bohm
4655e3a38431SPaul Bohm  case $host_os in
4656e3a38431SPaul Bohm  cygwin* | mingw* | pw32* | cegcc*)
4657e3a38431SPaul Bohm    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4658e3a38431SPaul Bohm    # When not using gcc, we currently assume that we are using
4659e3a38431SPaul Bohm    # Microsoft Visual C++.
4660e3a38431SPaul Bohm    if test "$GCC" != yes; then
4661e3a38431SPaul Bohm      with_gnu_ld=no
4662e3a38431SPaul Bohm    fi
4663e3a38431SPaul Bohm    ;;
4664e3a38431SPaul Bohm  interix*)
4665e3a38431SPaul Bohm    # we just hope/assume this is gcc and not c89 (= MSVC++)
4666e3a38431SPaul Bohm    with_gnu_ld=yes
4667e3a38431SPaul Bohm    ;;
4668e3a38431SPaul Bohm  openbsd*)
4669e3a38431SPaul Bohm    with_gnu_ld=no
4670e3a38431SPaul Bohm    ;;
4671*93823e6cSPaul Bohm  linux* | k*bsd*-gnu | gnu*)
4672e3a38431SPaul Bohm    _LT_TAGVAR(link_all_deplibs, $1)=no
4673e3a38431SPaul Bohm    ;;
4674e3a38431SPaul Bohm  esac
4675e3a38431SPaul Bohm
4676e3a38431SPaul Bohm  _LT_TAGVAR(ld_shlibs, $1)=yes
4677*93823e6cSPaul Bohm
4678*93823e6cSPaul Bohm  # On some targets, GNU ld is compatible enough with the native linker
4679*93823e6cSPaul Bohm  # that we're better off using the native interface for both.
4680*93823e6cSPaul Bohm  lt_use_gnu_ld_interface=no
4681e3a38431SPaul Bohm  if test "$with_gnu_ld" = yes; then
4682*93823e6cSPaul Bohm    case $host_os in
4683*93823e6cSPaul Bohm      aix*)
4684*93823e6cSPaul Bohm	# The AIX port of GNU ld has always aspired to compatibility
4685*93823e6cSPaul Bohm	# with the native linker.  However, as the warning in the GNU ld
4686*93823e6cSPaul Bohm	# block says, versions before 2.19.5* couldn't really create working
4687*93823e6cSPaul Bohm	# shared libraries, regardless of the interface used.
4688*93823e6cSPaul Bohm	case `$LD -v 2>&1` in
4689*93823e6cSPaul Bohm	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
4690*93823e6cSPaul Bohm	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
4691*93823e6cSPaul Bohm	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
4692*93823e6cSPaul Bohm	  *)
4693*93823e6cSPaul Bohm	    lt_use_gnu_ld_interface=yes
4694*93823e6cSPaul Bohm	    ;;
4695*93823e6cSPaul Bohm	esac
4696*93823e6cSPaul Bohm	;;
4697*93823e6cSPaul Bohm      *)
4698*93823e6cSPaul Bohm	lt_use_gnu_ld_interface=yes
4699*93823e6cSPaul Bohm	;;
4700*93823e6cSPaul Bohm    esac
4701*93823e6cSPaul Bohm  fi
4702*93823e6cSPaul Bohm
4703*93823e6cSPaul Bohm  if test "$lt_use_gnu_ld_interface" = yes; then
4704e3a38431SPaul Bohm    # If archive_cmds runs LD, not CC, wlarc should be empty
4705e3a38431SPaul Bohm    wlarc='${wl}'
4706e3a38431SPaul Bohm
4707e3a38431SPaul Bohm    # Set some defaults for GNU ld with shared library support. These
4708e3a38431SPaul Bohm    # are reset later if shared libraries are not supported. Putting them
4709e3a38431SPaul Bohm    # here allows them to be overridden if necessary.
4710e3a38431SPaul Bohm    runpath_var=LD_RUN_PATH
4711e3a38431SPaul Bohm    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4712e3a38431SPaul Bohm    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4713e3a38431SPaul Bohm    # ancient GNU ld didn't support --whole-archive et. al.
4714e3a38431SPaul Bohm    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4715e3a38431SPaul Bohm      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4716e3a38431SPaul Bohm    else
4717e3a38431SPaul Bohm      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4718e3a38431SPaul Bohm    fi
4719e3a38431SPaul Bohm    supports_anon_versioning=no
4720e3a38431SPaul Bohm    case `$LD -v 2>&1` in
4721e3a38431SPaul Bohm      *GNU\ gold*) supports_anon_versioning=yes ;;
4722e3a38431SPaul Bohm      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4723e3a38431SPaul Bohm      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4724e3a38431SPaul Bohm      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4725e3a38431SPaul Bohm      *\ 2.11.*) ;; # other 2.11 versions
4726e3a38431SPaul Bohm      *) supports_anon_versioning=yes ;;
4727e3a38431SPaul Bohm    esac
4728e3a38431SPaul Bohm
4729e3a38431SPaul Bohm    # See if GNU ld supports shared libraries.
4730e3a38431SPaul Bohm    case $host_os in
4731e3a38431SPaul Bohm    aix[[3-9]]*)
4732e3a38431SPaul Bohm      # On AIX/PPC, the GNU linker is very broken
4733e3a38431SPaul Bohm      if test "$host_cpu" != ia64; then
4734e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
4735e3a38431SPaul Bohm	cat <<_LT_EOF 1>&2
4736e3a38431SPaul Bohm
4737*93823e6cSPaul Bohm*** Warning: the GNU linker, at least up to release 2.19, is reported
4738e3a38431SPaul Bohm*** to be unable to reliably create shared libraries on AIX.
4739e3a38431SPaul Bohm*** Therefore, libtool is disabling shared libraries support.  If you
4740*93823e6cSPaul Bohm*** really care for shared libraries, you may want to install binutils
4741*93823e6cSPaul Bohm*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
4742*93823e6cSPaul Bohm*** You will then need to restart the configuration process.
4743e3a38431SPaul Bohm
4744e3a38431SPaul Bohm_LT_EOF
4745e3a38431SPaul Bohm      fi
4746e3a38431SPaul Bohm      ;;
4747e3a38431SPaul Bohm
4748e3a38431SPaul Bohm    amigaos*)
4749e3a38431SPaul Bohm      case $host_cpu in
4750e3a38431SPaul Bohm      powerpc)
4751e3a38431SPaul Bohm            # see comment about AmigaOS4 .so support
4752e3a38431SPaul Bohm            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4753e3a38431SPaul Bohm            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4754e3a38431SPaul Bohm        ;;
4755e3a38431SPaul Bohm      m68k)
4756e3a38431SPaul Bohm            _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)'
4757e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4758e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4759e3a38431SPaul Bohm        ;;
4760e3a38431SPaul Bohm      esac
4761e3a38431SPaul Bohm      ;;
4762e3a38431SPaul Bohm
4763e3a38431SPaul Bohm    beos*)
4764e3a38431SPaul Bohm      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4765e3a38431SPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4766e3a38431SPaul Bohm	# Joseph Beckenbach <[email protected]> says some releases of gcc
4767e3a38431SPaul Bohm	# support --undefined.  This deserves some investigation.  FIXME
4768e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4769e3a38431SPaul Bohm      else
4770e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
4771e3a38431SPaul Bohm      fi
4772e3a38431SPaul Bohm      ;;
4773e3a38431SPaul Bohm
4774e3a38431SPaul Bohm    cygwin* | mingw* | pw32* | cegcc*)
4775e3a38431SPaul Bohm      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4776e3a38431SPaul Bohm      # as there is no search path for DLLs.
4777e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4778*93823e6cSPaul Bohm      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4779e3a38431SPaul Bohm      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4780e3a38431SPaul Bohm      _LT_TAGVAR(always_export_symbols, $1)=no
4781e3a38431SPaul Bohm      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4782*93823e6cSPaul Bohm      _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'
4783*93823e6cSPaul Bohm      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4784e3a38431SPaul Bohm
4785e3a38431SPaul Bohm      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4786e3a38431SPaul Bohm        _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'
4787e3a38431SPaul Bohm	# If the export-symbols file already is a .def file (1st line
4788e3a38431SPaul Bohm	# is EXPORTS), use it as is; otherwise, prepend...
4789e3a38431SPaul Bohm	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4790e3a38431SPaul Bohm	  cp $export_symbols $output_objdir/$soname.def;
4791e3a38431SPaul Bohm	else
4792e3a38431SPaul Bohm	  echo EXPORTS > $output_objdir/$soname.def;
4793e3a38431SPaul Bohm	  cat $export_symbols >> $output_objdir/$soname.def;
4794e3a38431SPaul Bohm	fi~
4795e3a38431SPaul Bohm	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4796e3a38431SPaul Bohm      else
4797e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
4798e3a38431SPaul Bohm      fi
4799e3a38431SPaul Bohm      ;;
4800e3a38431SPaul Bohm
4801*93823e6cSPaul Bohm    haiku*)
4802*93823e6cSPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4803*93823e6cSPaul Bohm      _LT_TAGVAR(link_all_deplibs, $1)=yes
4804*93823e6cSPaul Bohm      ;;
4805*93823e6cSPaul Bohm
4806e3a38431SPaul Bohm    interix[[3-9]]*)
4807e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=no
4808e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4809e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4810e3a38431SPaul Bohm      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4811e3a38431SPaul Bohm      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4812e3a38431SPaul Bohm      # Instead, shared libraries are loaded at an image base (0x10000000 by
4813e3a38431SPaul Bohm      # default) and relocated if they conflict, which is a slow very memory
4814e3a38431SPaul Bohm      # consuming and fragmenting process.  To avoid this, we pick a random,
4815e3a38431SPaul Bohm      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4816e3a38431SPaul Bohm      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4817e3a38431SPaul Bohm      _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'
4818e3a38431SPaul Bohm      _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'
4819e3a38431SPaul Bohm      ;;
4820e3a38431SPaul Bohm
4821e3a38431SPaul Bohm    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4822e3a38431SPaul Bohm      tmp_diet=no
4823e3a38431SPaul Bohm      if test "$host_os" = linux-dietlibc; then
4824e3a38431SPaul Bohm	case $cc_basename in
4825e3a38431SPaul Bohm	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4826e3a38431SPaul Bohm	esac
4827e3a38431SPaul Bohm      fi
4828e3a38431SPaul Bohm      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4829e3a38431SPaul Bohm	 && test "$tmp_diet" = no
4830e3a38431SPaul Bohm      then
4831*93823e6cSPaul Bohm	tmp_addflag=' $pic_flag'
4832e3a38431SPaul Bohm	tmp_sharedflag='-shared'
4833e3a38431SPaul Bohm	case $cc_basename,$host_cpu in
4834e3a38431SPaul Bohm        pgcc*)				# Portland Group C compiler
4835*93823e6cSPaul Bohm	  _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'
4836e3a38431SPaul Bohm	  tmp_addflag=' $pic_flag'
4837e3a38431SPaul Bohm	  ;;
4838*93823e6cSPaul Bohm	pgf77* | pgf90* | pgf95* | pgfortran*)
4839*93823e6cSPaul Bohm					# Portland Group f77 and f90 compilers
4840*93823e6cSPaul Bohm	  _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'
4841e3a38431SPaul Bohm	  tmp_addflag=' $pic_flag -Mnomain' ;;
4842e3a38431SPaul Bohm	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4843e3a38431SPaul Bohm	  tmp_addflag=' -i_dynamic' ;;
4844e3a38431SPaul Bohm	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4845e3a38431SPaul Bohm	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4846e3a38431SPaul Bohm	ifc* | ifort*)			# Intel Fortran compiler
4847e3a38431SPaul Bohm	  tmp_addflag=' -nofor_main' ;;
4848e3a38431SPaul Bohm	lf95*)				# Lahey Fortran 8.1
4849e3a38431SPaul Bohm	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4850e3a38431SPaul Bohm	  tmp_sharedflag='--shared' ;;
4851*93823e6cSPaul Bohm	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4852e3a38431SPaul Bohm	  tmp_sharedflag='-qmkshrobj'
4853e3a38431SPaul Bohm	  tmp_addflag= ;;
4854*93823e6cSPaul Bohm	nvcc*)	# Cuda Compiler Driver 2.2
4855*93823e6cSPaul Bohm	  _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'
4856*93823e6cSPaul Bohm	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4857*93823e6cSPaul Bohm	  ;;
4858e3a38431SPaul Bohm	esac
4859e3a38431SPaul Bohm	case `$CC -V 2>&1 | sed 5q` in
4860e3a38431SPaul Bohm	*Sun\ C*)			# Sun C 5.9
4861*93823e6cSPaul Bohm	  _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'
4862e3a38431SPaul Bohm	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4863e3a38431SPaul Bohm	  tmp_sharedflag='-G' ;;
4864e3a38431SPaul Bohm	*Sun\ F*)			# Sun Fortran 8.3
4865e3a38431SPaul Bohm	  tmp_sharedflag='-G' ;;
4866e3a38431SPaul Bohm	esac
4867e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4868e3a38431SPaul Bohm
4869e3a38431SPaul Bohm        if test "x$supports_anon_versioning" = xyes; then
4870e3a38431SPaul Bohm          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4871e3a38431SPaul Bohm	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4872e3a38431SPaul Bohm	    echo "local: *; };" >> $output_objdir/$libname.ver~
4873e3a38431SPaul Bohm	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4874e3a38431SPaul Bohm        fi
4875e3a38431SPaul Bohm
4876e3a38431SPaul Bohm	case $cc_basename in
4877*93823e6cSPaul Bohm	xlf* | bgf* | bgxlf* | mpixlf*)
4878e3a38431SPaul Bohm	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4879e3a38431SPaul Bohm	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4880*93823e6cSPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4881*93823e6cSPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4882e3a38431SPaul Bohm	  if test "x$supports_anon_versioning" = xyes; then
4883e3a38431SPaul Bohm	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4884e3a38431SPaul Bohm	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4885e3a38431SPaul Bohm	      echo "local: *; };" >> $output_objdir/$libname.ver~
4886*93823e6cSPaul Bohm	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4887e3a38431SPaul Bohm	  fi
4888e3a38431SPaul Bohm	  ;;
4889e3a38431SPaul Bohm	esac
4890e3a38431SPaul Bohm      else
4891e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=no
4892e3a38431SPaul Bohm      fi
4893e3a38431SPaul Bohm      ;;
4894e3a38431SPaul Bohm
4895e3a38431SPaul Bohm    netbsd* | netbsdelf*-gnu)
4896e3a38431SPaul Bohm      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4897e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4898e3a38431SPaul Bohm	wlarc=
4899e3a38431SPaul Bohm      else
4900*93823e6cSPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4901*93823e6cSPaul Bohm	_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'
4902e3a38431SPaul Bohm      fi
4903e3a38431SPaul Bohm      ;;
4904e3a38431SPaul Bohm
4905e3a38431SPaul Bohm    solaris*)
4906e3a38431SPaul Bohm      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4907e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
4908e3a38431SPaul Bohm	cat <<_LT_EOF 1>&2
4909e3a38431SPaul Bohm
4910e3a38431SPaul Bohm*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4911e3a38431SPaul Bohm*** create shared libraries on Solaris systems.  Therefore, libtool
4912e3a38431SPaul Bohm*** is disabling shared libraries support.  We urge you to upgrade GNU
4913e3a38431SPaul Bohm*** binutils to release 2.9.1 or newer.  Another option is to modify
4914e3a38431SPaul Bohm*** your PATH or compiler configuration so that the native linker is
4915e3a38431SPaul Bohm*** used, and then restart.
4916e3a38431SPaul Bohm
4917e3a38431SPaul Bohm_LT_EOF
4918e3a38431SPaul Bohm      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4919*93823e6cSPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4920*93823e6cSPaul Bohm	_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'
4921e3a38431SPaul Bohm      else
4922e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
4923e3a38431SPaul Bohm      fi
4924e3a38431SPaul Bohm      ;;
4925e3a38431SPaul Bohm
4926e3a38431SPaul Bohm    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4927e3a38431SPaul Bohm      case `$LD -v 2>&1` in
4928e3a38431SPaul Bohm        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4929e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
4930e3a38431SPaul Bohm	cat <<_LT_EOF 1>&2
4931e3a38431SPaul Bohm
4932e3a38431SPaul Bohm*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4933e3a38431SPaul Bohm*** reliably create shared libraries on SCO systems.  Therefore, libtool
4934e3a38431SPaul Bohm*** is disabling shared libraries support.  We urge you to upgrade GNU
4935e3a38431SPaul Bohm*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4936e3a38431SPaul Bohm*** your PATH or compiler configuration so that the native linker is
4937e3a38431SPaul Bohm*** used, and then restart.
4938e3a38431SPaul Bohm
4939e3a38431SPaul Bohm_LT_EOF
4940e3a38431SPaul Bohm	;;
4941e3a38431SPaul Bohm	*)
4942e3a38431SPaul Bohm	  # For security reasons, it is highly recommended that you always
4943e3a38431SPaul Bohm	  # use absolute paths for naming shared libraries, and exclude the
4944e3a38431SPaul Bohm	  # DT_RUNPATH tag from executables and libraries.  But doing so
4945e3a38431SPaul Bohm	  # requires that you compile everything twice, which is a pain.
4946e3a38431SPaul Bohm	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4947e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4948e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4949e3a38431SPaul Bohm	    _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'
4950e3a38431SPaul Bohm	  else
4951e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
4952e3a38431SPaul Bohm	  fi
4953e3a38431SPaul Bohm	;;
4954e3a38431SPaul Bohm      esac
4955e3a38431SPaul Bohm      ;;
4956e3a38431SPaul Bohm
4957e3a38431SPaul Bohm    sunos4*)
4958e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4959e3a38431SPaul Bohm      wlarc=
4960e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
4961e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4962e3a38431SPaul Bohm      ;;
4963e3a38431SPaul Bohm
4964e3a38431SPaul Bohm    *)
4965e3a38431SPaul Bohm      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4966*93823e6cSPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4967*93823e6cSPaul Bohm	_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'
4968e3a38431SPaul Bohm      else
4969e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
4970e3a38431SPaul Bohm      fi
4971e3a38431SPaul Bohm      ;;
4972e3a38431SPaul Bohm    esac
4973e3a38431SPaul Bohm
4974e3a38431SPaul Bohm    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4975e3a38431SPaul Bohm      runpath_var=
4976e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4977e3a38431SPaul Bohm      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4978e3a38431SPaul Bohm      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4979e3a38431SPaul Bohm    fi
4980e3a38431SPaul Bohm  else
4981e3a38431SPaul Bohm    # PORTME fill in a description of your system's linker (not GNU ld)
4982e3a38431SPaul Bohm    case $host_os in
4983e3a38431SPaul Bohm    aix3*)
4984e3a38431SPaul Bohm      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4985e3a38431SPaul Bohm      _LT_TAGVAR(always_export_symbols, $1)=yes
4986e3a38431SPaul Bohm      _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'
4987e3a38431SPaul Bohm      # Note: this linker hardcodes the directories in LIBPATH if there
4988e3a38431SPaul Bohm      # are no directories specified by -L.
4989e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4990e3a38431SPaul Bohm      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4991e3a38431SPaul Bohm	# Neither direct hardcoding nor static linking is supported with a
4992e3a38431SPaul Bohm	# broken collect2.
4993e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4994e3a38431SPaul Bohm      fi
4995e3a38431SPaul Bohm      ;;
4996e3a38431SPaul Bohm
4997e3a38431SPaul Bohm    aix[[4-9]]*)
4998e3a38431SPaul Bohm      if test "$host_cpu" = ia64; then
4999e3a38431SPaul Bohm	# On IA64, the linker does run time linking by default, so we don't
5000e3a38431SPaul Bohm	# have to do anything special.
5001e3a38431SPaul Bohm	aix_use_runtimelinking=no
5002e3a38431SPaul Bohm	exp_sym_flag='-Bexport'
5003e3a38431SPaul Bohm	no_entry_flag=""
5004e3a38431SPaul Bohm      else
5005e3a38431SPaul Bohm	# If we're using GNU nm, then we don't want the "-C" option.
5006e3a38431SPaul Bohm	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5007*93823e6cSPaul Bohm	# Also, AIX nm treats weak defined symbols like other global
5008*93823e6cSPaul Bohm	# defined symbols, whereas GNU nm marks them as "W".
5009e3a38431SPaul Bohm	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5010*93823e6cSPaul Bohm	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5011e3a38431SPaul Bohm	else
5012e3a38431SPaul Bohm	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5013e3a38431SPaul Bohm	fi
5014e3a38431SPaul Bohm	aix_use_runtimelinking=no
5015e3a38431SPaul Bohm
5016e3a38431SPaul Bohm	# Test if we are trying to use run time linking or normal
5017e3a38431SPaul Bohm	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5018e3a38431SPaul Bohm	# need to do runtime linking.
5019e3a38431SPaul Bohm	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5020e3a38431SPaul Bohm	  for ld_flag in $LDFLAGS; do
5021e3a38431SPaul Bohm	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5022e3a38431SPaul Bohm	    aix_use_runtimelinking=yes
5023e3a38431SPaul Bohm	    break
5024e3a38431SPaul Bohm	  fi
5025e3a38431SPaul Bohm	  done
5026e3a38431SPaul Bohm	  ;;
5027e3a38431SPaul Bohm	esac
5028e3a38431SPaul Bohm
5029e3a38431SPaul Bohm	exp_sym_flag='-bexport'
5030e3a38431SPaul Bohm	no_entry_flag='-bnoentry'
5031e3a38431SPaul Bohm      fi
5032e3a38431SPaul Bohm
5033e3a38431SPaul Bohm      # When large executables or shared objects are built, AIX ld can
5034e3a38431SPaul Bohm      # have problems creating the table of contents.  If linking a library
5035e3a38431SPaul Bohm      # or program results in "error TOC overflow" add -mminimal-toc to
5036e3a38431SPaul Bohm      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5037e3a38431SPaul Bohm      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5038e3a38431SPaul Bohm
5039e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds, $1)=''
5040e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
5041e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5042e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5043e3a38431SPaul Bohm      _LT_TAGVAR(link_all_deplibs, $1)=yes
5044e3a38431SPaul Bohm      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5045e3a38431SPaul Bohm
5046e3a38431SPaul Bohm      if test "$GCC" = yes; then
5047e3a38431SPaul Bohm	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5048e3a38431SPaul Bohm	# We only want to do this on AIX 4.2 and lower, the check
5049e3a38431SPaul Bohm	# below for broken collect2 doesn't work under 4.3+
5050e3a38431SPaul Bohm	  collect2name=`${CC} -print-prog-name=collect2`
5051e3a38431SPaul Bohm	  if test -f "$collect2name" &&
5052e3a38431SPaul Bohm	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5053e3a38431SPaul Bohm	  then
5054e3a38431SPaul Bohm	  # We have reworked collect2
5055e3a38431SPaul Bohm	  :
5056e3a38431SPaul Bohm	  else
5057e3a38431SPaul Bohm	  # We have old collect2
5058e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5059e3a38431SPaul Bohm	  # It fails to find uninstalled libraries when the uninstalled
5060e3a38431SPaul Bohm	  # path is not listed in the libpath.  Setting hardcode_minus_L
5061e3a38431SPaul Bohm	  # to unsupported forces relinking
5062e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5063e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5064e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5065e3a38431SPaul Bohm	  fi
5066e3a38431SPaul Bohm	  ;;
5067e3a38431SPaul Bohm	esac
5068e3a38431SPaul Bohm	shared_flag='-shared'
5069e3a38431SPaul Bohm	if test "$aix_use_runtimelinking" = yes; then
5070e3a38431SPaul Bohm	  shared_flag="$shared_flag "'${wl}-G'
5071e3a38431SPaul Bohm	fi
5072e3a38431SPaul Bohm	_LT_TAGVAR(link_all_deplibs, $1)=no
5073e3a38431SPaul Bohm      else
5074e3a38431SPaul Bohm	# not using gcc
5075e3a38431SPaul Bohm	if test "$host_cpu" = ia64; then
5076e3a38431SPaul Bohm	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5077e3a38431SPaul Bohm	# chokes on -Wl,-G. The following line is correct:
5078e3a38431SPaul Bohm	  shared_flag='-G'
5079e3a38431SPaul Bohm	else
5080e3a38431SPaul Bohm	  if test "$aix_use_runtimelinking" = yes; then
5081e3a38431SPaul Bohm	    shared_flag='${wl}-G'
5082e3a38431SPaul Bohm	  else
5083e3a38431SPaul Bohm	    shared_flag='${wl}-bM:SRE'
5084e3a38431SPaul Bohm	  fi
5085e3a38431SPaul Bohm	fi
5086e3a38431SPaul Bohm      fi
5087e3a38431SPaul Bohm
5088e3a38431SPaul Bohm      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5089e3a38431SPaul Bohm      # It seems that -bexpall does not export symbols beginning with
5090e3a38431SPaul Bohm      # underscore (_), so it is better to generate a list of symbols to export.
5091e3a38431SPaul Bohm      _LT_TAGVAR(always_export_symbols, $1)=yes
5092e3a38431SPaul Bohm      if test "$aix_use_runtimelinking" = yes; then
5093e3a38431SPaul Bohm	# Warning - without using the other runtime loading flags (-brtl),
5094e3a38431SPaul Bohm	# -berok will link without error, but may produce a broken library.
5095e3a38431SPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5096e3a38431SPaul Bohm        # Determine the default libpath from the value encoded in an
5097e3a38431SPaul Bohm        # empty executable.
5098*93823e6cSPaul Bohm        _LT_SYS_MODULE_PATH_AIX([$1])
5099e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5100*93823e6cSPaul Bohm        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5101e3a38431SPaul Bohm      else
5102e3a38431SPaul Bohm	if test "$host_cpu" = ia64; then
5103e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5104e3a38431SPaul Bohm	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5105e3a38431SPaul Bohm	  _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"
5106e3a38431SPaul Bohm	else
5107e3a38431SPaul Bohm	 # Determine the default libpath from the value encoded in an
5108e3a38431SPaul Bohm	 # empty executable.
5109*93823e6cSPaul Bohm	 _LT_SYS_MODULE_PATH_AIX([$1])
5110e3a38431SPaul Bohm	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5111e3a38431SPaul Bohm	  # Warning - without using the other run time loading flags,
5112e3a38431SPaul Bohm	  # -berok will link without error, but may produce a broken library.
5113e3a38431SPaul Bohm	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5114e3a38431SPaul Bohm	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5115*93823e6cSPaul Bohm	  if test "$with_gnu_ld" = yes; then
5116*93823e6cSPaul Bohm	    # We only use this code for GNU lds that support --whole-archive.
5117*93823e6cSPaul Bohm	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5118*93823e6cSPaul Bohm	  else
5119e3a38431SPaul Bohm	    # Exported symbols can be pulled into shared objects from archives
5120e3a38431SPaul Bohm	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5121*93823e6cSPaul Bohm	  fi
5122e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5123e3a38431SPaul Bohm	  # This is similar to how AIX traditionally builds its shared libraries.
5124e3a38431SPaul Bohm	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5125e3a38431SPaul Bohm	fi
5126e3a38431SPaul Bohm      fi
5127e3a38431SPaul Bohm      ;;
5128e3a38431SPaul Bohm
5129e3a38431SPaul Bohm    amigaos*)
5130e3a38431SPaul Bohm      case $host_cpu in
5131e3a38431SPaul Bohm      powerpc)
5132e3a38431SPaul Bohm            # see comment about AmigaOS4 .so support
5133e3a38431SPaul Bohm            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5134e3a38431SPaul Bohm            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5135e3a38431SPaul Bohm        ;;
5136e3a38431SPaul Bohm      m68k)
5137e3a38431SPaul Bohm            _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)'
5138e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5139e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5140e3a38431SPaul Bohm        ;;
5141e3a38431SPaul Bohm      esac
5142e3a38431SPaul Bohm      ;;
5143e3a38431SPaul Bohm
5144e3a38431SPaul Bohm    bsdi[[45]]*)
5145e3a38431SPaul Bohm      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5146e3a38431SPaul Bohm      ;;
5147e3a38431SPaul Bohm
5148e3a38431SPaul Bohm    cygwin* | mingw* | pw32* | cegcc*)
5149e3a38431SPaul Bohm      # When not using gcc, we currently assume that we are using
5150e3a38431SPaul Bohm      # Microsoft Visual C++.
5151e3a38431SPaul Bohm      # hardcode_libdir_flag_spec is actually meaningless, as there is
5152e3a38431SPaul Bohm      # no search path for DLLs.
5153*93823e6cSPaul Bohm      case $cc_basename in
5154*93823e6cSPaul Bohm      cl*)
5155*93823e6cSPaul Bohm	# Native MSVC
5156*93823e6cSPaul Bohm	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5157*93823e6cSPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5158*93823e6cSPaul Bohm	_LT_TAGVAR(always_export_symbols, $1)=yes
5159*93823e6cSPaul Bohm	_LT_TAGVAR(file_list_spec, $1)='@'
5160*93823e6cSPaul Bohm	# Tell ltmain to make .lib files, not .a files.
5161*93823e6cSPaul Bohm	libext=lib
5162*93823e6cSPaul Bohm	# Tell ltmain to make .dll files, not .so files.
5163*93823e6cSPaul Bohm	shrext_cmds=".dll"
5164*93823e6cSPaul Bohm	# FIXME: Setting linknames here is a bad hack.
5165*93823e6cSPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5166*93823e6cSPaul Bohm	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5167*93823e6cSPaul Bohm	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5168*93823e6cSPaul Bohm	  else
5169*93823e6cSPaul Bohm	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5170*93823e6cSPaul Bohm	  fi~
5171*93823e6cSPaul Bohm	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5172*93823e6cSPaul Bohm	  linknames='
5173*93823e6cSPaul Bohm	# The linker will not automatically build a static lib if we build a DLL.
5174*93823e6cSPaul Bohm	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5175*93823e6cSPaul Bohm	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5176*93823e6cSPaul Bohm	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5177*93823e6cSPaul Bohm	_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'
5178*93823e6cSPaul Bohm	# Don't use ranlib
5179*93823e6cSPaul Bohm	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5180*93823e6cSPaul Bohm	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5181*93823e6cSPaul Bohm	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5182*93823e6cSPaul Bohm	  case $lt_outputfile in
5183*93823e6cSPaul Bohm	    *.exe|*.EXE) ;;
5184*93823e6cSPaul Bohm	    *)
5185*93823e6cSPaul Bohm	      lt_outputfile="$lt_outputfile.exe"
5186*93823e6cSPaul Bohm	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5187*93823e6cSPaul Bohm	      ;;
5188*93823e6cSPaul Bohm	  esac~
5189*93823e6cSPaul Bohm	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5190*93823e6cSPaul Bohm	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5191*93823e6cSPaul Bohm	    $RM "$lt_outputfile.manifest";
5192*93823e6cSPaul Bohm	  fi'
5193*93823e6cSPaul Bohm	;;
5194*93823e6cSPaul Bohm      *)
5195*93823e6cSPaul Bohm	# Assume MSVC wrapper
5196e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5197e3a38431SPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5198e3a38431SPaul Bohm	# Tell ltmain to make .lib files, not .a files.
5199e3a38431SPaul Bohm	libext=lib
5200e3a38431SPaul Bohm	# Tell ltmain to make .dll files, not .so files.
5201e3a38431SPaul Bohm	shrext_cmds=".dll"
5202e3a38431SPaul Bohm	# FIXME: Setting linknames here is a bad hack.
5203*93823e6cSPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5204e3a38431SPaul Bohm	# The linker will automatically build a .lib file if we build a DLL.
5205e3a38431SPaul Bohm	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5206e3a38431SPaul Bohm	# FIXME: Should let the user specify the lib program.
5207e3a38431SPaul Bohm	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5208e3a38431SPaul Bohm	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5209e3a38431SPaul Bohm	;;
5210*93823e6cSPaul Bohm      esac
5211*93823e6cSPaul Bohm      ;;
5212e3a38431SPaul Bohm
5213e3a38431SPaul Bohm    darwin* | rhapsody*)
5214e3a38431SPaul Bohm      _LT_DARWIN_LINKER_FEATURES($1)
5215e3a38431SPaul Bohm      ;;
5216e3a38431SPaul Bohm
5217e3a38431SPaul Bohm    dgux*)
5218e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5219e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5220e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5221e3a38431SPaul Bohm      ;;
5222e3a38431SPaul Bohm
5223e3a38431SPaul Bohm    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5224e3a38431SPaul Bohm    # support.  Future versions do this automatically, but an explicit c++rt0.o
5225e3a38431SPaul Bohm    # does not break anything, and helps significantly (at the cost of a little
5226e3a38431SPaul Bohm    # extra space).
5227e3a38431SPaul Bohm    freebsd2.2*)
5228e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5229e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5230e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
5231e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5232e3a38431SPaul Bohm      ;;
5233e3a38431SPaul Bohm
5234e3a38431SPaul Bohm    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5235*93823e6cSPaul Bohm    freebsd2.*)
5236e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5237e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
5238e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5239e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5240e3a38431SPaul Bohm      ;;
5241e3a38431SPaul Bohm
5242e3a38431SPaul Bohm    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5243e3a38431SPaul Bohm    freebsd* | dragonfly*)
5244*93823e6cSPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5245e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5246e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
5247e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5248e3a38431SPaul Bohm      ;;
5249e3a38431SPaul Bohm
5250e3a38431SPaul Bohm    hpux9*)
5251e3a38431SPaul Bohm      if test "$GCC" = yes; then
5252*93823e6cSPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5253e3a38431SPaul Bohm      else
5254e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5255e3a38431SPaul Bohm      fi
5256e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5257e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5258e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
5259e3a38431SPaul Bohm
5260e3a38431SPaul Bohm      # hardcode_minus_L: Not really in the search PATH,
5261e3a38431SPaul Bohm      # but as the default location of the library.
5262e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5263e3a38431SPaul Bohm      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5264e3a38431SPaul Bohm      ;;
5265e3a38431SPaul Bohm
5266e3a38431SPaul Bohm    hpux10*)
5267*93823e6cSPaul Bohm      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5268*93823e6cSPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5269e3a38431SPaul Bohm      else
5270e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5271e3a38431SPaul Bohm      fi
5272e3a38431SPaul Bohm      if test "$with_gnu_ld" = no; then
5273e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5274e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5275e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_direct, $1)=yes
5276e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5277e3a38431SPaul Bohm	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5278e3a38431SPaul Bohm	# hardcode_minus_L: Not really in the search PATH,
5279e3a38431SPaul Bohm	# but as the default location of the library.
5280e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5281e3a38431SPaul Bohm      fi
5282e3a38431SPaul Bohm      ;;
5283e3a38431SPaul Bohm
5284e3a38431SPaul Bohm    hpux11*)
5285*93823e6cSPaul Bohm      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5286e3a38431SPaul Bohm	case $host_cpu in
5287e3a38431SPaul Bohm	hppa*64*)
5288e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5289e3a38431SPaul Bohm	  ;;
5290e3a38431SPaul Bohm	ia64*)
5291*93823e6cSPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5292e3a38431SPaul Bohm	  ;;
5293e3a38431SPaul Bohm	*)
5294*93823e6cSPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5295e3a38431SPaul Bohm	  ;;
5296e3a38431SPaul Bohm	esac
5297e3a38431SPaul Bohm      else
5298e3a38431SPaul Bohm	case $host_cpu in
5299e3a38431SPaul Bohm	hppa*64*)
5300e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5301e3a38431SPaul Bohm	  ;;
5302e3a38431SPaul Bohm	ia64*)
5303e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5304e3a38431SPaul Bohm	  ;;
5305e3a38431SPaul Bohm	*)
5306*93823e6cSPaul Bohm	m4_if($1, [], [
5307*93823e6cSPaul Bohm	  # Older versions of the 11.00 compiler do not understand -b yet
5308*93823e6cSPaul Bohm	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5309*93823e6cSPaul Bohm	  _LT_LINKER_OPTION([if $CC understands -b],
5310*93823e6cSPaul Bohm	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5311*93823e6cSPaul Bohm	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5312*93823e6cSPaul Bohm	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5313*93823e6cSPaul Bohm	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5314e3a38431SPaul Bohm	  ;;
5315e3a38431SPaul Bohm	esac
5316e3a38431SPaul Bohm      fi
5317e3a38431SPaul Bohm      if test "$with_gnu_ld" = no; then
5318e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5319e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5320e3a38431SPaul Bohm
5321e3a38431SPaul Bohm	case $host_cpu in
5322e3a38431SPaul Bohm	hppa*64*|ia64*)
5323e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct, $1)=no
5324e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5325e3a38431SPaul Bohm	  ;;
5326e3a38431SPaul Bohm	*)
5327e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct, $1)=yes
5328e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5329e3a38431SPaul Bohm	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5330e3a38431SPaul Bohm
5331e3a38431SPaul Bohm	  # hardcode_minus_L: Not really in the search PATH,
5332e3a38431SPaul Bohm	  # but as the default location of the library.
5333e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5334e3a38431SPaul Bohm	  ;;
5335e3a38431SPaul Bohm	esac
5336e3a38431SPaul Bohm      fi
5337e3a38431SPaul Bohm      ;;
5338e3a38431SPaul Bohm
5339e3a38431SPaul Bohm    irix5* | irix6* | nonstopux*)
5340e3a38431SPaul Bohm      if test "$GCC" = yes; then
5341*93823e6cSPaul Bohm	_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'
5342e3a38431SPaul Bohm	# Try to use the -exported_symbol ld option, if it does not
5343e3a38431SPaul Bohm	# work, assume that -exports_file does not work either and
5344e3a38431SPaul Bohm	# implicitly export all symbols.
5345*93823e6cSPaul Bohm	# This should be the same for all languages, so no per-tag cache variable.
5346*93823e6cSPaul Bohm	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5347*93823e6cSPaul Bohm	  [lt_cv_irix_exported_symbol],
5348*93823e6cSPaul Bohm	  [save_LDFLAGS="$LDFLAGS"
5349e3a38431SPaul Bohm	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5350*93823e6cSPaul Bohm	   AC_LINK_IFELSE(
5351*93823e6cSPaul Bohm	     [AC_LANG_SOURCE(
5352*93823e6cSPaul Bohm	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5353*93823e6cSPaul Bohm			      [C++], [[int foo (void) { return 0; }]],
5354*93823e6cSPaul Bohm			      [Fortran 77], [[
5355*93823e6cSPaul Bohm      subroutine foo
5356*93823e6cSPaul Bohm      end]],
5357*93823e6cSPaul Bohm			      [Fortran], [[
5358*93823e6cSPaul Bohm      subroutine foo
5359*93823e6cSPaul Bohm      end]])])],
5360*93823e6cSPaul Bohm	      [lt_cv_irix_exported_symbol=yes],
5361*93823e6cSPaul Bohm	      [lt_cv_irix_exported_symbol=no])
5362*93823e6cSPaul Bohm           LDFLAGS="$save_LDFLAGS"])
5363*93823e6cSPaul Bohm	if test "$lt_cv_irix_exported_symbol" = yes; then
5364*93823e6cSPaul Bohm          _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'
5365*93823e6cSPaul Bohm	fi
5366e3a38431SPaul Bohm      else
5367*93823e6cSPaul Bohm	_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'
5368*93823e6cSPaul Bohm	_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'
5369e3a38431SPaul Bohm      fi
5370e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5371e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5372e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5373e3a38431SPaul Bohm      _LT_TAGVAR(inherit_rpath, $1)=yes
5374e3a38431SPaul Bohm      _LT_TAGVAR(link_all_deplibs, $1)=yes
5375e3a38431SPaul Bohm      ;;
5376e3a38431SPaul Bohm
5377e3a38431SPaul Bohm    netbsd* | netbsdelf*-gnu)
5378e3a38431SPaul Bohm      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5379e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5380e3a38431SPaul Bohm      else
5381e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5382e3a38431SPaul Bohm      fi
5383e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5384e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
5385e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5386e3a38431SPaul Bohm      ;;
5387e3a38431SPaul Bohm
5388e3a38431SPaul Bohm    newsos6)
5389e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5390e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
5391e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5392e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5393e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5394e3a38431SPaul Bohm      ;;
5395e3a38431SPaul Bohm
5396e3a38431SPaul Bohm    *nto* | *qnx*)
5397e3a38431SPaul Bohm      ;;
5398e3a38431SPaul Bohm
5399e3a38431SPaul Bohm    openbsd*)
5400e3a38431SPaul Bohm      if test -f /usr/libexec/ld.so; then
5401e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_direct, $1)=yes
5402e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5403e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5404e3a38431SPaul Bohm	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5405e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5406e3a38431SPaul Bohm	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5407e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5408e3a38431SPaul Bohm	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5409e3a38431SPaul Bohm	else
5410e3a38431SPaul Bohm	  case $host_os in
5411e3a38431SPaul Bohm	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5412e3a38431SPaul Bohm	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5413e3a38431SPaul Bohm	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5414e3a38431SPaul Bohm	     ;;
5415e3a38431SPaul Bohm	   *)
5416e3a38431SPaul Bohm	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5417e3a38431SPaul Bohm	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5418e3a38431SPaul Bohm	     ;;
5419e3a38431SPaul Bohm	  esac
5420e3a38431SPaul Bohm	fi
5421e3a38431SPaul Bohm      else
5422e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
5423e3a38431SPaul Bohm      fi
5424e3a38431SPaul Bohm      ;;
5425e3a38431SPaul Bohm
5426e3a38431SPaul Bohm    os2*)
5427e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5428e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5429e3a38431SPaul Bohm      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5430*93823e6cSPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5431e3a38431SPaul Bohm      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5432e3a38431SPaul Bohm      ;;
5433e3a38431SPaul Bohm
5434e3a38431SPaul Bohm    osf3*)
5435e3a38431SPaul Bohm      if test "$GCC" = yes; then
5436e3a38431SPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5437*93823e6cSPaul Bohm	_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'
5438e3a38431SPaul Bohm      else
5439e3a38431SPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5440*93823e6cSPaul Bohm	_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'
5441e3a38431SPaul Bohm      fi
5442e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5443e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5444e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5445e3a38431SPaul Bohm      ;;
5446e3a38431SPaul Bohm
5447e3a38431SPaul Bohm    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5448e3a38431SPaul Bohm      if test "$GCC" = yes; then
5449e3a38431SPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5450*93823e6cSPaul Bohm	_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'
5451e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5452e3a38431SPaul Bohm      else
5453e3a38431SPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5454*93823e6cSPaul Bohm	_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'
5455e3a38431SPaul Bohm	_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~
5456*93823e6cSPaul Bohm	$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'
5457e3a38431SPaul Bohm
5458e3a38431SPaul Bohm	# Both c and cxx compiler support -rpath directly
5459e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5460e3a38431SPaul Bohm      fi
5461e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5462e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5463e3a38431SPaul Bohm      ;;
5464e3a38431SPaul Bohm
5465e3a38431SPaul Bohm    solaris*)
5466e3a38431SPaul Bohm      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5467e3a38431SPaul Bohm      if test "$GCC" = yes; then
5468e3a38431SPaul Bohm	wlarc='${wl}'
5469*93823e6cSPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5470e3a38431SPaul Bohm	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5471*93823e6cSPaul Bohm	  $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'
5472e3a38431SPaul Bohm      else
5473e3a38431SPaul Bohm	case `$CC -V 2>&1` in
5474e3a38431SPaul Bohm	*"Compilers 5.0"*)
5475e3a38431SPaul Bohm	  wlarc=''
5476e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5477e3a38431SPaul Bohm	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5478e3a38431SPaul Bohm	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5479e3a38431SPaul Bohm	  ;;
5480e3a38431SPaul Bohm	*)
5481e3a38431SPaul Bohm	  wlarc='${wl}'
5482e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5483e3a38431SPaul Bohm	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5484e3a38431SPaul Bohm	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5485e3a38431SPaul Bohm	  ;;
5486e3a38431SPaul Bohm	esac
5487e3a38431SPaul Bohm      fi
5488e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5489e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5490e3a38431SPaul Bohm      case $host_os in
5491e3a38431SPaul Bohm      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5492e3a38431SPaul Bohm      *)
5493e3a38431SPaul Bohm	# The compiler driver will combine and reorder linker options,
5494e3a38431SPaul Bohm	# but understands `-z linker_flag'.  GCC discards it without `$wl',
5495e3a38431SPaul Bohm	# but is careful enough not to reorder.
5496e3a38431SPaul Bohm	# Supported since Solaris 2.6 (maybe 2.5.1?)
5497e3a38431SPaul Bohm	if test "$GCC" = yes; then
5498e3a38431SPaul Bohm	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5499e3a38431SPaul Bohm	else
5500e3a38431SPaul Bohm	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5501e3a38431SPaul Bohm	fi
5502e3a38431SPaul Bohm	;;
5503e3a38431SPaul Bohm      esac
5504e3a38431SPaul Bohm      _LT_TAGVAR(link_all_deplibs, $1)=yes
5505e3a38431SPaul Bohm      ;;
5506e3a38431SPaul Bohm
5507e3a38431SPaul Bohm    sunos4*)
5508e3a38431SPaul Bohm      if test "x$host_vendor" = xsequent; then
5509e3a38431SPaul Bohm	# Use $CC to link under sequent, because it throws in some extra .o
5510e3a38431SPaul Bohm	# files that make .init and .fini sections work.
5511e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5512e3a38431SPaul Bohm      else
5513e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5514e3a38431SPaul Bohm      fi
5515e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5516e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_direct, $1)=yes
5517e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5518e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5519e3a38431SPaul Bohm      ;;
5520e3a38431SPaul Bohm
5521e3a38431SPaul Bohm    sysv4)
5522e3a38431SPaul Bohm      case $host_vendor in
5523e3a38431SPaul Bohm	sni)
5524e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5525e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5526e3a38431SPaul Bohm	;;
5527e3a38431SPaul Bohm	siemens)
5528e3a38431SPaul Bohm	  ## LD is ld it makes a PLAMLIB
5529e3a38431SPaul Bohm	  ## CC just makes a GrossModule.
5530e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5531e3a38431SPaul Bohm	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5532e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct, $1)=no
5533e3a38431SPaul Bohm        ;;
5534e3a38431SPaul Bohm	motorola)
5535e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5536e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5537e3a38431SPaul Bohm	;;
5538e3a38431SPaul Bohm      esac
5539e3a38431SPaul Bohm      runpath_var='LD_RUN_PATH'
5540e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5541e3a38431SPaul Bohm      ;;
5542e3a38431SPaul Bohm
5543e3a38431SPaul Bohm    sysv4.3*)
5544e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5545e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5546e3a38431SPaul Bohm      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5547e3a38431SPaul Bohm      ;;
5548e3a38431SPaul Bohm
5549e3a38431SPaul Bohm    sysv4*MP*)
5550e3a38431SPaul Bohm      if test -d /usr/nec; then
5551e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5552e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5553e3a38431SPaul Bohm	runpath_var=LD_RUN_PATH
5554e3a38431SPaul Bohm	hardcode_runpath_var=yes
5555e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=yes
5556e3a38431SPaul Bohm      fi
5557e3a38431SPaul Bohm      ;;
5558e3a38431SPaul Bohm
5559e3a38431SPaul Bohm    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5560e3a38431SPaul Bohm      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5561e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5562e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5563e3a38431SPaul Bohm      runpath_var='LD_RUN_PATH'
5564e3a38431SPaul Bohm
5565e3a38431SPaul Bohm      if test "$GCC" = yes; then
5566e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5567e3a38431SPaul Bohm	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5568e3a38431SPaul Bohm      else
5569e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5570e3a38431SPaul Bohm	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5571e3a38431SPaul Bohm      fi
5572e3a38431SPaul Bohm      ;;
5573e3a38431SPaul Bohm
5574e3a38431SPaul Bohm    sysv5* | sco3.2v5* | sco5v6*)
5575e3a38431SPaul Bohm      # Note: We can NOT use -z defs as we might desire, because we do not
5576e3a38431SPaul Bohm      # link with -lc, and that would cause any symbols used from libc to
5577e3a38431SPaul Bohm      # always be unresolved, which means just about no library would
5578e3a38431SPaul Bohm      # ever link correctly.  If we're not using GNU ld we use -z text
5579e3a38431SPaul Bohm      # though, which does catch some bad symbols but isn't as heavy-handed
5580e3a38431SPaul Bohm      # as -z defs.
5581e3a38431SPaul Bohm      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5582e3a38431SPaul Bohm      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5583e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5584e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5585e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5586e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5587e3a38431SPaul Bohm      _LT_TAGVAR(link_all_deplibs, $1)=yes
5588e3a38431SPaul Bohm      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5589e3a38431SPaul Bohm      runpath_var='LD_RUN_PATH'
5590e3a38431SPaul Bohm
5591e3a38431SPaul Bohm      if test "$GCC" = yes; then
5592e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5593e3a38431SPaul Bohm	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5594e3a38431SPaul Bohm      else
5595e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5596e3a38431SPaul Bohm	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5597e3a38431SPaul Bohm      fi
5598e3a38431SPaul Bohm      ;;
5599e3a38431SPaul Bohm
5600e3a38431SPaul Bohm    uts4*)
5601e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5602e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5603e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5604e3a38431SPaul Bohm      ;;
5605e3a38431SPaul Bohm
5606e3a38431SPaul Bohm    *)
5607e3a38431SPaul Bohm      _LT_TAGVAR(ld_shlibs, $1)=no
5608e3a38431SPaul Bohm      ;;
5609e3a38431SPaul Bohm    esac
5610e3a38431SPaul Bohm
5611e3a38431SPaul Bohm    if test x$host_vendor = xsni; then
5612e3a38431SPaul Bohm      case $host in
5613e3a38431SPaul Bohm      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5614e3a38431SPaul Bohm	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5615e3a38431SPaul Bohm	;;
5616e3a38431SPaul Bohm      esac
5617e3a38431SPaul Bohm    fi
5618e3a38431SPaul Bohm  fi
5619e3a38431SPaul Bohm])
5620e3a38431SPaul BohmAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5621e3a38431SPaul Bohmtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5622e3a38431SPaul Bohm
5623e3a38431SPaul Bohm_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5624e3a38431SPaul Bohm
5625e3a38431SPaul Bohm_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5626e3a38431SPaul Bohm_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5627e3a38431SPaul Bohm_LT_DECL([], [extract_expsyms_cmds], [2],
5628e3a38431SPaul Bohm    [The commands to extract the exported symbol list from a shared archive])
5629e3a38431SPaul Bohm
5630e3a38431SPaul Bohm#
5631e3a38431SPaul Bohm# Do we need to explicitly link libc?
5632e3a38431SPaul Bohm#
5633e3a38431SPaul Bohmcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5634e3a38431SPaul Bohmx|xyes)
5635e3a38431SPaul Bohm  # Assume -lc should be added
5636e3a38431SPaul Bohm  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5637e3a38431SPaul Bohm
5638e3a38431SPaul Bohm  if test "$enable_shared" = yes && test "$GCC" = yes; then
5639e3a38431SPaul Bohm    case $_LT_TAGVAR(archive_cmds, $1) in
5640e3a38431SPaul Bohm    *'~'*)
5641e3a38431SPaul Bohm      # FIXME: we may have to deal with multi-command sequences.
5642e3a38431SPaul Bohm      ;;
5643e3a38431SPaul Bohm    '$CC '*)
5644e3a38431SPaul Bohm      # Test whether the compiler implicitly links with -lc since on some
5645e3a38431SPaul Bohm      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5646e3a38431SPaul Bohm      # to ld, don't add -lc before -lgcc.
5647*93823e6cSPaul Bohm      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
5648*93823e6cSPaul Bohm	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
5649*93823e6cSPaul Bohm	[$RM conftest*
5650e3a38431SPaul Bohm	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5651e3a38431SPaul Bohm
5652e3a38431SPaul Bohm	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5653e3a38431SPaul Bohm	  soname=conftest
5654e3a38431SPaul Bohm	  lib=conftest
5655e3a38431SPaul Bohm	  libobjs=conftest.$ac_objext
5656e3a38431SPaul Bohm	  deplibs=
5657e3a38431SPaul Bohm	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5658e3a38431SPaul Bohm	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5659e3a38431SPaul Bohm	  compiler_flags=-v
5660e3a38431SPaul Bohm	  linker_flags=-v
5661e3a38431SPaul Bohm	  verstring=
5662e3a38431SPaul Bohm	  output_objdir=.
5663e3a38431SPaul Bohm	  libname=conftest
5664e3a38431SPaul Bohm	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5665e3a38431SPaul Bohm	  _LT_TAGVAR(allow_undefined_flag, $1)=
5666e3a38431SPaul Bohm	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5667e3a38431SPaul Bohm	  then
5668*93823e6cSPaul Bohm	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5669e3a38431SPaul Bohm	  else
5670*93823e6cSPaul Bohm	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5671e3a38431SPaul Bohm	  fi
5672e3a38431SPaul Bohm	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5673e3a38431SPaul Bohm	else
5674e3a38431SPaul Bohm	  cat conftest.err 1>&5
5675e3a38431SPaul Bohm	fi
5676e3a38431SPaul Bohm	$RM conftest*
5677*93823e6cSPaul Bohm	])
5678*93823e6cSPaul Bohm      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5679e3a38431SPaul Bohm      ;;
5680e3a38431SPaul Bohm    esac
5681e3a38431SPaul Bohm  fi
5682e3a38431SPaul Bohm  ;;
5683e3a38431SPaul Bohmesac
5684e3a38431SPaul Bohm
5685e3a38431SPaul Bohm_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5686e3a38431SPaul Bohm    [Whether or not to add -lc for building shared libraries])
5687e3a38431SPaul Bohm_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5688e3a38431SPaul Bohm    [enable_shared_with_static_runtimes], [0],
5689e3a38431SPaul Bohm    [Whether or not to disallow shared libs when runtime libs are static])
5690e3a38431SPaul Bohm_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5691e3a38431SPaul Bohm    [Compiler flag to allow reflexive dlopens])
5692e3a38431SPaul Bohm_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5693e3a38431SPaul Bohm    [Compiler flag to generate shared objects directly from archives])
5694e3a38431SPaul Bohm_LT_TAGDECL([], [compiler_needs_object], [1],
5695e3a38431SPaul Bohm    [Whether the compiler copes with passing no objects directly])
5696e3a38431SPaul Bohm_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5697e3a38431SPaul Bohm    [Create an old-style archive from a shared archive])
5698e3a38431SPaul Bohm_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5699e3a38431SPaul Bohm    [Create a temporary old-style archive to link instead of a shared archive])
5700e3a38431SPaul Bohm_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5701e3a38431SPaul Bohm_LT_TAGDECL([], [archive_expsym_cmds], [2])
5702e3a38431SPaul Bohm_LT_TAGDECL([], [module_cmds], [2],
5703e3a38431SPaul Bohm    [Commands used to build a loadable module if different from building
5704e3a38431SPaul Bohm    a shared archive.])
5705e3a38431SPaul Bohm_LT_TAGDECL([], [module_expsym_cmds], [2])
5706e3a38431SPaul Bohm_LT_TAGDECL([], [with_gnu_ld], [1],
5707e3a38431SPaul Bohm    [Whether we are building with GNU ld or not])
5708e3a38431SPaul Bohm_LT_TAGDECL([], [allow_undefined_flag], [1],
5709e3a38431SPaul Bohm    [Flag that allows shared libraries with undefined symbols to be built])
5710e3a38431SPaul Bohm_LT_TAGDECL([], [no_undefined_flag], [1],
5711e3a38431SPaul Bohm    [Flag that enforces no undefined symbols])
5712e3a38431SPaul Bohm_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5713e3a38431SPaul Bohm    [Flag to hardcode $libdir into a binary during linking.
5714e3a38431SPaul Bohm    This must work even if $libdir does not exist])
5715e3a38431SPaul Bohm_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5716e3a38431SPaul Bohm    [Whether we need a single "-rpath" flag with a separated argument])
5717e3a38431SPaul Bohm_LT_TAGDECL([], [hardcode_direct], [0],
5718e3a38431SPaul Bohm    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5719e3a38431SPaul Bohm    DIR into the resulting binary])
5720e3a38431SPaul Bohm_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5721e3a38431SPaul Bohm    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5722e3a38431SPaul Bohm    DIR into the resulting binary and the resulting library dependency is
5723e3a38431SPaul Bohm    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5724e3a38431SPaul Bohm    library is relocated])
5725e3a38431SPaul Bohm_LT_TAGDECL([], [hardcode_minus_L], [0],
5726e3a38431SPaul Bohm    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5727e3a38431SPaul Bohm    into the resulting binary])
5728e3a38431SPaul Bohm_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5729e3a38431SPaul Bohm    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5730e3a38431SPaul Bohm    into the resulting binary])
5731e3a38431SPaul Bohm_LT_TAGDECL([], [hardcode_automatic], [0],
5732e3a38431SPaul Bohm    [Set to "yes" if building a shared library automatically hardcodes DIR
5733e3a38431SPaul Bohm    into the library and all subsequent libraries and executables linked
5734e3a38431SPaul Bohm    against it])
5735e3a38431SPaul Bohm_LT_TAGDECL([], [inherit_rpath], [0],
5736e3a38431SPaul Bohm    [Set to yes if linker adds runtime paths of dependent libraries
5737e3a38431SPaul Bohm    to runtime path list])
5738e3a38431SPaul Bohm_LT_TAGDECL([], [link_all_deplibs], [0],
5739e3a38431SPaul Bohm    [Whether libtool must link a program against all its dependency libraries])
5740e3a38431SPaul Bohm_LT_TAGDECL([], [always_export_symbols], [0],
5741e3a38431SPaul Bohm    [Set to "yes" if exported symbols are required])
5742e3a38431SPaul Bohm_LT_TAGDECL([], [export_symbols_cmds], [2],
5743e3a38431SPaul Bohm    [The commands to list exported symbols])
5744e3a38431SPaul Bohm_LT_TAGDECL([], [exclude_expsyms], [1],
5745e3a38431SPaul Bohm    [Symbols that should not be listed in the preloaded symbols])
5746e3a38431SPaul Bohm_LT_TAGDECL([], [include_expsyms], [1],
5747e3a38431SPaul Bohm    [Symbols that must always be exported])
5748e3a38431SPaul Bohm_LT_TAGDECL([], [prelink_cmds], [2],
5749e3a38431SPaul Bohm    [Commands necessary for linking programs (against libraries) with templates])
5750*93823e6cSPaul Bohm_LT_TAGDECL([], [postlink_cmds], [2],
5751*93823e6cSPaul Bohm    [Commands necessary for finishing linking programs])
5752e3a38431SPaul Bohm_LT_TAGDECL([], [file_list_spec], [1],
5753e3a38431SPaul Bohm    [Specify filename containing input files])
5754e3a38431SPaul Bohmdnl FIXME: Not yet implemented
5755e3a38431SPaul Bohmdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5756e3a38431SPaul Bohmdnl    [Compiler flag to generate thread safe objects])
5757e3a38431SPaul Bohm])# _LT_LINKER_SHLIBS
5758e3a38431SPaul Bohm
5759e3a38431SPaul Bohm
5760e3a38431SPaul Bohm# _LT_LANG_C_CONFIG([TAG])
5761e3a38431SPaul Bohm# ------------------------
5762e3a38431SPaul Bohm# Ensure that the configuration variables for a C compiler are suitably
5763e3a38431SPaul Bohm# defined.  These variables are subsequently used by _LT_CONFIG to write
5764e3a38431SPaul Bohm# the compiler configuration to `libtool'.
5765e3a38431SPaul Bohmm4_defun([_LT_LANG_C_CONFIG],
5766e3a38431SPaul Bohm[m4_require([_LT_DECL_EGREP])dnl
5767e3a38431SPaul Bohmlt_save_CC="$CC"
5768e3a38431SPaul BohmAC_LANG_PUSH(C)
5769e3a38431SPaul Bohm
5770e3a38431SPaul Bohm# Source file extension for C test sources.
5771e3a38431SPaul Bohmac_ext=c
5772e3a38431SPaul Bohm
5773e3a38431SPaul Bohm# Object file extension for compiled C test sources.
5774e3a38431SPaul Bohmobjext=o
5775e3a38431SPaul Bohm_LT_TAGVAR(objext, $1)=$objext
5776e3a38431SPaul Bohm
5777e3a38431SPaul Bohm# Code to be used in simple compile tests
5778e3a38431SPaul Bohmlt_simple_compile_test_code="int some_variable = 0;"
5779e3a38431SPaul Bohm
5780e3a38431SPaul Bohm# Code to be used in simple link tests
5781e3a38431SPaul Bohmlt_simple_link_test_code='int main(){return(0);}'
5782e3a38431SPaul Bohm
5783e3a38431SPaul Bohm_LT_TAG_COMPILER
5784e3a38431SPaul Bohm# Save the default compiler, since it gets overwritten when the other
5785e3a38431SPaul Bohm# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5786e3a38431SPaul Bohmcompiler_DEFAULT=$CC
5787e3a38431SPaul Bohm
5788e3a38431SPaul Bohm# save warnings/boilerplate of simple test code
5789e3a38431SPaul Bohm_LT_COMPILER_BOILERPLATE
5790e3a38431SPaul Bohm_LT_LINKER_BOILERPLATE
5791e3a38431SPaul Bohm
5792e3a38431SPaul Bohmif test -n "$compiler"; then
5793e3a38431SPaul Bohm  _LT_COMPILER_NO_RTTI($1)
5794e3a38431SPaul Bohm  _LT_COMPILER_PIC($1)
5795e3a38431SPaul Bohm  _LT_COMPILER_C_O($1)
5796e3a38431SPaul Bohm  _LT_COMPILER_FILE_LOCKS($1)
5797e3a38431SPaul Bohm  _LT_LINKER_SHLIBS($1)
5798e3a38431SPaul Bohm  _LT_SYS_DYNAMIC_LINKER($1)
5799e3a38431SPaul Bohm  _LT_LINKER_HARDCODE_LIBPATH($1)
5800e3a38431SPaul Bohm  LT_SYS_DLOPEN_SELF
5801e3a38431SPaul Bohm  _LT_CMD_STRIPLIB
5802e3a38431SPaul Bohm
5803e3a38431SPaul Bohm  # Report which library types will actually be built
5804e3a38431SPaul Bohm  AC_MSG_CHECKING([if libtool supports shared libraries])
5805e3a38431SPaul Bohm  AC_MSG_RESULT([$can_build_shared])
5806e3a38431SPaul Bohm
5807e3a38431SPaul Bohm  AC_MSG_CHECKING([whether to build shared libraries])
5808e3a38431SPaul Bohm  test "$can_build_shared" = "no" && enable_shared=no
5809e3a38431SPaul Bohm
5810e3a38431SPaul Bohm  # On AIX, shared libraries and static libraries use the same namespace, and
5811e3a38431SPaul Bohm  # are all built from PIC.
5812e3a38431SPaul Bohm  case $host_os in
5813e3a38431SPaul Bohm  aix3*)
5814e3a38431SPaul Bohm    test "$enable_shared" = yes && enable_static=no
5815e3a38431SPaul Bohm    if test -n "$RANLIB"; then
5816e3a38431SPaul Bohm      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5817e3a38431SPaul Bohm      postinstall_cmds='$RANLIB $lib'
5818e3a38431SPaul Bohm    fi
5819e3a38431SPaul Bohm    ;;
5820e3a38431SPaul Bohm
5821e3a38431SPaul Bohm  aix[[4-9]]*)
5822e3a38431SPaul Bohm    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5823e3a38431SPaul Bohm      test "$enable_shared" = yes && enable_static=no
5824e3a38431SPaul Bohm    fi
5825e3a38431SPaul Bohm    ;;
5826e3a38431SPaul Bohm  esac
5827e3a38431SPaul Bohm  AC_MSG_RESULT([$enable_shared])
5828e3a38431SPaul Bohm
5829e3a38431SPaul Bohm  AC_MSG_CHECKING([whether to build static libraries])
5830e3a38431SPaul Bohm  # Make sure either enable_shared or enable_static is yes.
5831e3a38431SPaul Bohm  test "$enable_shared" = yes || enable_static=yes
5832e3a38431SPaul Bohm  AC_MSG_RESULT([$enable_static])
5833e3a38431SPaul Bohm
5834e3a38431SPaul Bohm  _LT_CONFIG($1)
5835e3a38431SPaul Bohmfi
5836e3a38431SPaul BohmAC_LANG_POP
5837e3a38431SPaul BohmCC="$lt_save_CC"
5838e3a38431SPaul Bohm])# _LT_LANG_C_CONFIG
5839e3a38431SPaul Bohm
5840e3a38431SPaul Bohm
5841*93823e6cSPaul Bohm# _LT_LANG_CXX_CONFIG([TAG])
5842*93823e6cSPaul Bohm# --------------------------
5843*93823e6cSPaul Bohm# Ensure that the configuration variables for a C++ compiler are suitably
5844*93823e6cSPaul Bohm# defined.  These variables are subsequently used by _LT_CONFIG to write
5845*93823e6cSPaul Bohm# the compiler configuration to `libtool'.
5846*93823e6cSPaul Bohmm4_defun([_LT_LANG_CXX_CONFIG],
5847*93823e6cSPaul Bohm[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5848*93823e6cSPaul Bohmm4_require([_LT_DECL_EGREP])dnl
5849*93823e6cSPaul Bohmm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5850e3a38431SPaul Bohmif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5851e3a38431SPaul Bohm    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5852e3a38431SPaul Bohm    (test "X$CXX" != "Xg++"))) ; then
5853e3a38431SPaul Bohm  AC_PROG_CXXCPP
5854e3a38431SPaul Bohmelse
5855e3a38431SPaul Bohm  _lt_caught_CXX_error=yes
5856e3a38431SPaul Bohmfi
5857e3a38431SPaul Bohm
5858e3a38431SPaul BohmAC_LANG_PUSH(C++)
5859e3a38431SPaul Bohm_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5860e3a38431SPaul Bohm_LT_TAGVAR(allow_undefined_flag, $1)=
5861e3a38431SPaul Bohm_LT_TAGVAR(always_export_symbols, $1)=no
5862e3a38431SPaul Bohm_LT_TAGVAR(archive_expsym_cmds, $1)=
5863e3a38431SPaul Bohm_LT_TAGVAR(compiler_needs_object, $1)=no
5864e3a38431SPaul Bohm_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5865e3a38431SPaul Bohm_LT_TAGVAR(hardcode_direct, $1)=no
5866e3a38431SPaul Bohm_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5867e3a38431SPaul Bohm_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5868e3a38431SPaul Bohm_LT_TAGVAR(hardcode_libdir_separator, $1)=
5869e3a38431SPaul Bohm_LT_TAGVAR(hardcode_minus_L, $1)=no
5870e3a38431SPaul Bohm_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5871e3a38431SPaul Bohm_LT_TAGVAR(hardcode_automatic, $1)=no
5872e3a38431SPaul Bohm_LT_TAGVAR(inherit_rpath, $1)=no
5873e3a38431SPaul Bohm_LT_TAGVAR(module_cmds, $1)=
5874e3a38431SPaul Bohm_LT_TAGVAR(module_expsym_cmds, $1)=
5875e3a38431SPaul Bohm_LT_TAGVAR(link_all_deplibs, $1)=unknown
5876e3a38431SPaul Bohm_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5877*93823e6cSPaul Bohm_LT_TAGVAR(reload_flag, $1)=$reload_flag
5878*93823e6cSPaul Bohm_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5879e3a38431SPaul Bohm_LT_TAGVAR(no_undefined_flag, $1)=
5880e3a38431SPaul Bohm_LT_TAGVAR(whole_archive_flag_spec, $1)=
5881e3a38431SPaul Bohm_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5882e3a38431SPaul Bohm
5883e3a38431SPaul Bohm# Source file extension for C++ test sources.
5884e3a38431SPaul Bohmac_ext=cpp
5885e3a38431SPaul Bohm
5886e3a38431SPaul Bohm# Object file extension for compiled C++ test sources.
5887e3a38431SPaul Bohmobjext=o
5888e3a38431SPaul Bohm_LT_TAGVAR(objext, $1)=$objext
5889e3a38431SPaul Bohm
5890e3a38431SPaul Bohm# No sense in running all these tests if we already determined that
5891e3a38431SPaul Bohm# the CXX compiler isn't working.  Some variables (like enable_shared)
5892e3a38431SPaul Bohm# are currently assumed to apply to all compilers on this platform,
5893e3a38431SPaul Bohm# and will be corrupted by setting them based on a non-working compiler.
5894e3a38431SPaul Bohmif test "$_lt_caught_CXX_error" != yes; then
5895e3a38431SPaul Bohm  # Code to be used in simple compile tests
5896e3a38431SPaul Bohm  lt_simple_compile_test_code="int some_variable = 0;"
5897e3a38431SPaul Bohm
5898e3a38431SPaul Bohm  # Code to be used in simple link tests
5899e3a38431SPaul Bohm  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5900e3a38431SPaul Bohm
5901e3a38431SPaul Bohm  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5902e3a38431SPaul Bohm  _LT_TAG_COMPILER
5903e3a38431SPaul Bohm
5904e3a38431SPaul Bohm  # save warnings/boilerplate of simple test code
5905e3a38431SPaul Bohm  _LT_COMPILER_BOILERPLATE
5906e3a38431SPaul Bohm  _LT_LINKER_BOILERPLATE
5907e3a38431SPaul Bohm
5908e3a38431SPaul Bohm  # Allow CC to be a program name with arguments.
5909e3a38431SPaul Bohm  lt_save_CC=$CC
5910*93823e6cSPaul Bohm  lt_save_CFLAGS=$CFLAGS
5911e3a38431SPaul Bohm  lt_save_LD=$LD
5912e3a38431SPaul Bohm  lt_save_GCC=$GCC
5913e3a38431SPaul Bohm  GCC=$GXX
5914e3a38431SPaul Bohm  lt_save_with_gnu_ld=$with_gnu_ld
5915e3a38431SPaul Bohm  lt_save_path_LD=$lt_cv_path_LD
5916e3a38431SPaul Bohm  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5917e3a38431SPaul Bohm    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5918e3a38431SPaul Bohm  else
5919e3a38431SPaul Bohm    $as_unset lt_cv_prog_gnu_ld
5920e3a38431SPaul Bohm  fi
5921e3a38431SPaul Bohm  if test -n "${lt_cv_path_LDCXX+set}"; then
5922e3a38431SPaul Bohm    lt_cv_path_LD=$lt_cv_path_LDCXX
5923e3a38431SPaul Bohm  else
5924e3a38431SPaul Bohm    $as_unset lt_cv_path_LD
5925e3a38431SPaul Bohm  fi
5926e3a38431SPaul Bohm  test -z "${LDCXX+set}" || LD=$LDCXX
5927e3a38431SPaul Bohm  CC=${CXX-"c++"}
5928*93823e6cSPaul Bohm  CFLAGS=$CXXFLAGS
5929e3a38431SPaul Bohm  compiler=$CC
5930e3a38431SPaul Bohm  _LT_TAGVAR(compiler, $1)=$CC
5931e3a38431SPaul Bohm  _LT_CC_BASENAME([$compiler])
5932e3a38431SPaul Bohm
5933e3a38431SPaul Bohm  if test -n "$compiler"; then
5934e3a38431SPaul Bohm    # We don't want -fno-exception when compiling C++ code, so set the
5935e3a38431SPaul Bohm    # no_builtin_flag separately
5936e3a38431SPaul Bohm    if test "$GXX" = yes; then
5937e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5938e3a38431SPaul Bohm    else
5939e3a38431SPaul Bohm      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5940e3a38431SPaul Bohm    fi
5941e3a38431SPaul Bohm
5942e3a38431SPaul Bohm    if test "$GXX" = yes; then
5943e3a38431SPaul Bohm      # Set up default GNU C++ configuration
5944e3a38431SPaul Bohm
5945e3a38431SPaul Bohm      LT_PATH_LD
5946e3a38431SPaul Bohm
5947e3a38431SPaul Bohm      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5948e3a38431SPaul Bohm      # archiving commands below assume that GNU ld is being used.
5949e3a38431SPaul Bohm      if test "$with_gnu_ld" = yes; then
5950*93823e6cSPaul Bohm        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5951*93823e6cSPaul Bohm        _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'
5952e3a38431SPaul Bohm
5953e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5954e3a38431SPaul Bohm        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5955e3a38431SPaul Bohm
5956e3a38431SPaul Bohm        # If archive_cmds runs LD, not CC, wlarc should be empty
5957e3a38431SPaul Bohm        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5958e3a38431SPaul Bohm        #     investigate it a little bit more. (MM)
5959e3a38431SPaul Bohm        wlarc='${wl}'
5960e3a38431SPaul Bohm
5961e3a38431SPaul Bohm        # ancient GNU ld didn't support --whole-archive et. al.
5962e3a38431SPaul Bohm        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5963e3a38431SPaul Bohm	  $GREP 'no-whole-archive' > /dev/null; then
5964e3a38431SPaul Bohm          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5965e3a38431SPaul Bohm        else
5966e3a38431SPaul Bohm          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5967e3a38431SPaul Bohm        fi
5968e3a38431SPaul Bohm      else
5969e3a38431SPaul Bohm        with_gnu_ld=no
5970e3a38431SPaul Bohm        wlarc=
5971e3a38431SPaul Bohm
5972e3a38431SPaul Bohm        # A generic and very simple default shared library creation
5973e3a38431SPaul Bohm        # command for GNU C++ for the case where it uses the native
5974e3a38431SPaul Bohm        # linker, instead of GNU ld.  If possible, this setting should
5975e3a38431SPaul Bohm        # overridden to take advantage of the native linker features on
5976e3a38431SPaul Bohm        # the platform it is being used on.
5977e3a38431SPaul Bohm        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5978e3a38431SPaul Bohm      fi
5979e3a38431SPaul Bohm
5980e3a38431SPaul Bohm      # Commands to make compiler produce verbose output that lists
5981e3a38431SPaul Bohm      # what "hidden" libraries, object files and flags are used when
5982e3a38431SPaul Bohm      # linking a shared library.
5983*93823e6cSPaul Bohm      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5984e3a38431SPaul Bohm
5985e3a38431SPaul Bohm    else
5986e3a38431SPaul Bohm      GXX=no
5987e3a38431SPaul Bohm      with_gnu_ld=no
5988e3a38431SPaul Bohm      wlarc=
5989e3a38431SPaul Bohm    fi
5990e3a38431SPaul Bohm
5991e3a38431SPaul Bohm    # PORTME: fill in a description of your system's C++ link characteristics
5992e3a38431SPaul Bohm    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5993e3a38431SPaul Bohm    _LT_TAGVAR(ld_shlibs, $1)=yes
5994e3a38431SPaul Bohm    case $host_os in
5995e3a38431SPaul Bohm      aix3*)
5996e3a38431SPaul Bohm        # FIXME: insert proper C++ library support
5997e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=no
5998e3a38431SPaul Bohm        ;;
5999e3a38431SPaul Bohm      aix[[4-9]]*)
6000e3a38431SPaul Bohm        if test "$host_cpu" = ia64; then
6001e3a38431SPaul Bohm          # On IA64, the linker does run time linking by default, so we don't
6002e3a38431SPaul Bohm          # have to do anything special.
6003e3a38431SPaul Bohm          aix_use_runtimelinking=no
6004e3a38431SPaul Bohm          exp_sym_flag='-Bexport'
6005e3a38431SPaul Bohm          no_entry_flag=""
6006e3a38431SPaul Bohm        else
6007e3a38431SPaul Bohm          aix_use_runtimelinking=no
6008e3a38431SPaul Bohm
6009e3a38431SPaul Bohm          # Test if we are trying to use run time linking or normal
6010e3a38431SPaul Bohm          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6011e3a38431SPaul Bohm          # need to do runtime linking.
6012e3a38431SPaul Bohm          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6013e3a38431SPaul Bohm	    for ld_flag in $LDFLAGS; do
6014e3a38431SPaul Bohm	      case $ld_flag in
6015e3a38431SPaul Bohm	      *-brtl*)
6016e3a38431SPaul Bohm	        aix_use_runtimelinking=yes
6017e3a38431SPaul Bohm	        break
6018e3a38431SPaul Bohm	        ;;
6019e3a38431SPaul Bohm	      esac
6020e3a38431SPaul Bohm	    done
6021e3a38431SPaul Bohm	    ;;
6022e3a38431SPaul Bohm          esac
6023e3a38431SPaul Bohm
6024e3a38431SPaul Bohm          exp_sym_flag='-bexport'
6025e3a38431SPaul Bohm          no_entry_flag='-bnoentry'
6026e3a38431SPaul Bohm        fi
6027e3a38431SPaul Bohm
6028e3a38431SPaul Bohm        # When large executables or shared objects are built, AIX ld can
6029e3a38431SPaul Bohm        # have problems creating the table of contents.  If linking a library
6030e3a38431SPaul Bohm        # or program results in "error TOC overflow" add -mminimal-toc to
6031e3a38431SPaul Bohm        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6032e3a38431SPaul Bohm        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6033e3a38431SPaul Bohm
6034e3a38431SPaul Bohm        _LT_TAGVAR(archive_cmds, $1)=''
6035e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_direct, $1)=yes
6036e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6037e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6038e3a38431SPaul Bohm        _LT_TAGVAR(link_all_deplibs, $1)=yes
6039e3a38431SPaul Bohm        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6040e3a38431SPaul Bohm
6041e3a38431SPaul Bohm        if test "$GXX" = yes; then
6042e3a38431SPaul Bohm          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6043e3a38431SPaul Bohm          # We only want to do this on AIX 4.2 and lower, the check
6044e3a38431SPaul Bohm          # below for broken collect2 doesn't work under 4.3+
6045e3a38431SPaul Bohm	  collect2name=`${CC} -print-prog-name=collect2`
6046e3a38431SPaul Bohm	  if test -f "$collect2name" &&
6047e3a38431SPaul Bohm	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6048e3a38431SPaul Bohm	  then
6049e3a38431SPaul Bohm	    # We have reworked collect2
6050e3a38431SPaul Bohm	    :
6051e3a38431SPaul Bohm	  else
6052e3a38431SPaul Bohm	    # We have old collect2
6053e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6054e3a38431SPaul Bohm	    # It fails to find uninstalled libraries when the uninstalled
6055e3a38431SPaul Bohm	    # path is not listed in the libpath.  Setting hardcode_minus_L
6056e3a38431SPaul Bohm	    # to unsupported forces relinking
6057e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6058e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6059e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6060e3a38431SPaul Bohm	  fi
6061e3a38431SPaul Bohm          esac
6062e3a38431SPaul Bohm          shared_flag='-shared'
6063e3a38431SPaul Bohm	  if test "$aix_use_runtimelinking" = yes; then
6064e3a38431SPaul Bohm	    shared_flag="$shared_flag "'${wl}-G'
6065e3a38431SPaul Bohm	  fi
6066e3a38431SPaul Bohm        else
6067e3a38431SPaul Bohm          # not using gcc
6068e3a38431SPaul Bohm          if test "$host_cpu" = ia64; then
6069e3a38431SPaul Bohm	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6070e3a38431SPaul Bohm	  # chokes on -Wl,-G. The following line is correct:
6071e3a38431SPaul Bohm	  shared_flag='-G'
6072e3a38431SPaul Bohm          else
6073e3a38431SPaul Bohm	    if test "$aix_use_runtimelinking" = yes; then
6074e3a38431SPaul Bohm	      shared_flag='${wl}-G'
6075e3a38431SPaul Bohm	    else
6076e3a38431SPaul Bohm	      shared_flag='${wl}-bM:SRE'
6077e3a38431SPaul Bohm	    fi
6078e3a38431SPaul Bohm          fi
6079e3a38431SPaul Bohm        fi
6080e3a38431SPaul Bohm
6081e3a38431SPaul Bohm        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6082e3a38431SPaul Bohm        # It seems that -bexpall does not export symbols beginning with
6083e3a38431SPaul Bohm        # underscore (_), so it is better to generate a list of symbols to
6084e3a38431SPaul Bohm	# export.
6085e3a38431SPaul Bohm        _LT_TAGVAR(always_export_symbols, $1)=yes
6086e3a38431SPaul Bohm        if test "$aix_use_runtimelinking" = yes; then
6087e3a38431SPaul Bohm          # Warning - without using the other runtime loading flags (-brtl),
6088e3a38431SPaul Bohm          # -berok will link without error, but may produce a broken library.
6089e3a38431SPaul Bohm          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6090e3a38431SPaul Bohm          # Determine the default libpath from the value encoded in an empty
6091e3a38431SPaul Bohm          # executable.
6092*93823e6cSPaul Bohm          _LT_SYS_MODULE_PATH_AIX([$1])
6093e3a38431SPaul Bohm          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6094e3a38431SPaul Bohm
6095*93823e6cSPaul Bohm          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6096e3a38431SPaul Bohm        else
6097e3a38431SPaul Bohm          if test "$host_cpu" = ia64; then
6098e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6099e3a38431SPaul Bohm	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6100e3a38431SPaul Bohm	    _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"
6101e3a38431SPaul Bohm          else
6102e3a38431SPaul Bohm	    # Determine the default libpath from the value encoded in an
6103e3a38431SPaul Bohm	    # empty executable.
6104*93823e6cSPaul Bohm	    _LT_SYS_MODULE_PATH_AIX([$1])
6105e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6106e3a38431SPaul Bohm	    # Warning - without using the other run time loading flags,
6107e3a38431SPaul Bohm	    # -berok will link without error, but may produce a broken library.
6108e3a38431SPaul Bohm	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6109e3a38431SPaul Bohm	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6110*93823e6cSPaul Bohm	    if test "$with_gnu_ld" = yes; then
6111*93823e6cSPaul Bohm	      # We only use this code for GNU lds that support --whole-archive.
6112*93823e6cSPaul Bohm	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6113*93823e6cSPaul Bohm	    else
6114e3a38431SPaul Bohm	      # Exported symbols can be pulled into shared objects from archives
6115e3a38431SPaul Bohm	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6116*93823e6cSPaul Bohm	    fi
6117e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6118e3a38431SPaul Bohm	    # This is similar to how AIX traditionally builds its shared
6119e3a38431SPaul Bohm	    # libraries.
6120e3a38431SPaul Bohm	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6121e3a38431SPaul Bohm          fi
6122e3a38431SPaul Bohm        fi
6123e3a38431SPaul Bohm        ;;
6124e3a38431SPaul Bohm
6125e3a38431SPaul Bohm      beos*)
6126e3a38431SPaul Bohm	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6127e3a38431SPaul Bohm	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6128e3a38431SPaul Bohm	  # Joseph Beckenbach <[email protected]> says some releases of gcc
6129e3a38431SPaul Bohm	  # support --undefined.  This deserves some investigation.  FIXME
6130e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6131e3a38431SPaul Bohm	else
6132e3a38431SPaul Bohm	  _LT_TAGVAR(ld_shlibs, $1)=no
6133e3a38431SPaul Bohm	fi
6134e3a38431SPaul Bohm	;;
6135e3a38431SPaul Bohm
6136e3a38431SPaul Bohm      chorus*)
6137e3a38431SPaul Bohm        case $cc_basename in
6138e3a38431SPaul Bohm          *)
6139e3a38431SPaul Bohm	  # FIXME: insert proper C++ library support
6140e3a38431SPaul Bohm	  _LT_TAGVAR(ld_shlibs, $1)=no
6141e3a38431SPaul Bohm	  ;;
6142e3a38431SPaul Bohm        esac
6143e3a38431SPaul Bohm        ;;
6144e3a38431SPaul Bohm
6145e3a38431SPaul Bohm      cygwin* | mingw* | pw32* | cegcc*)
6146*93823e6cSPaul Bohm	case $GXX,$cc_basename in
6147*93823e6cSPaul Bohm	,cl* | no,cl*)
6148*93823e6cSPaul Bohm	  # Native MSVC
6149*93823e6cSPaul Bohm	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6150*93823e6cSPaul Bohm	  # no search path for DLLs.
6151*93823e6cSPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6152*93823e6cSPaul Bohm	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6153*93823e6cSPaul Bohm	  _LT_TAGVAR(always_export_symbols, $1)=yes
6154*93823e6cSPaul Bohm	  _LT_TAGVAR(file_list_spec, $1)='@'
6155*93823e6cSPaul Bohm	  # Tell ltmain to make .lib files, not .a files.
6156*93823e6cSPaul Bohm	  libext=lib
6157*93823e6cSPaul Bohm	  # Tell ltmain to make .dll files, not .so files.
6158*93823e6cSPaul Bohm	  shrext_cmds=".dll"
6159*93823e6cSPaul Bohm	  # FIXME: Setting linknames here is a bad hack.
6160*93823e6cSPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6161*93823e6cSPaul Bohm	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6162*93823e6cSPaul Bohm	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6163*93823e6cSPaul Bohm	    else
6164*93823e6cSPaul Bohm	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6165*93823e6cSPaul Bohm	    fi~
6166*93823e6cSPaul Bohm	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6167*93823e6cSPaul Bohm	    linknames='
6168*93823e6cSPaul Bohm	  # The linker will not automatically build a static lib if we build a DLL.
6169*93823e6cSPaul Bohm	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6170*93823e6cSPaul Bohm	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6171*93823e6cSPaul Bohm	  # Don't use ranlib
6172*93823e6cSPaul Bohm	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6173*93823e6cSPaul Bohm	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6174*93823e6cSPaul Bohm	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6175*93823e6cSPaul Bohm	    case $lt_outputfile in
6176*93823e6cSPaul Bohm	      *.exe|*.EXE) ;;
6177*93823e6cSPaul Bohm	      *)
6178*93823e6cSPaul Bohm		lt_outputfile="$lt_outputfile.exe"
6179*93823e6cSPaul Bohm		lt_tool_outputfile="$lt_tool_outputfile.exe"
6180*93823e6cSPaul Bohm		;;
6181*93823e6cSPaul Bohm	    esac~
6182*93823e6cSPaul Bohm	    func_to_tool_file "$lt_outputfile"~
6183*93823e6cSPaul Bohm	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6184*93823e6cSPaul Bohm	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6185*93823e6cSPaul Bohm	      $RM "$lt_outputfile.manifest";
6186*93823e6cSPaul Bohm	    fi'
6187*93823e6cSPaul Bohm	  ;;
6188*93823e6cSPaul Bohm	*)
6189*93823e6cSPaul Bohm	  # g++
6190e3a38431SPaul Bohm	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6191e3a38431SPaul Bohm	  # as there is no search path for DLLs.
6192e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6193*93823e6cSPaul Bohm	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6194e3a38431SPaul Bohm	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6195e3a38431SPaul Bohm	  _LT_TAGVAR(always_export_symbols, $1)=no
6196e3a38431SPaul Bohm	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6197e3a38431SPaul Bohm
6198e3a38431SPaul Bohm	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6199e3a38431SPaul Bohm	    _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'
6200e3a38431SPaul Bohm	    # If the export-symbols file already is a .def file (1st line
6201e3a38431SPaul Bohm	    # is EXPORTS), use it as is; otherwise, prepend...
6202e3a38431SPaul Bohm	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6203e3a38431SPaul Bohm	      cp $export_symbols $output_objdir/$soname.def;
6204e3a38431SPaul Bohm	    else
6205e3a38431SPaul Bohm	      echo EXPORTS > $output_objdir/$soname.def;
6206e3a38431SPaul Bohm	      cat $export_symbols >> $output_objdir/$soname.def;
6207e3a38431SPaul Bohm	    fi~
6208e3a38431SPaul Bohm	    $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'
6209e3a38431SPaul Bohm	  else
6210e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6211e3a38431SPaul Bohm	  fi
6212e3a38431SPaul Bohm	  ;;
6213*93823e6cSPaul Bohm	esac
6214*93823e6cSPaul Bohm	;;
6215e3a38431SPaul Bohm      darwin* | rhapsody*)
6216e3a38431SPaul Bohm        _LT_DARWIN_LINKER_FEATURES($1)
6217e3a38431SPaul Bohm	;;
6218e3a38431SPaul Bohm
6219e3a38431SPaul Bohm      dgux*)
6220e3a38431SPaul Bohm        case $cc_basename in
6221e3a38431SPaul Bohm          ec++*)
6222e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6223e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6224e3a38431SPaul Bohm	    ;;
6225e3a38431SPaul Bohm          ghcx*)
6226e3a38431SPaul Bohm	    # Green Hills C++ Compiler
6227e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6228e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6229e3a38431SPaul Bohm	    ;;
6230e3a38431SPaul Bohm          *)
6231e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6232e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6233e3a38431SPaul Bohm	    ;;
6234e3a38431SPaul Bohm        esac
6235e3a38431SPaul Bohm        ;;
6236e3a38431SPaul Bohm
6237*93823e6cSPaul Bohm      freebsd2.*)
6238e3a38431SPaul Bohm        # C++ shared libraries reported to be fairly broken before
6239e3a38431SPaul Bohm	# switch to ELF
6240e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=no
6241e3a38431SPaul Bohm        ;;
6242e3a38431SPaul Bohm
6243e3a38431SPaul Bohm      freebsd-elf*)
6244e3a38431SPaul Bohm        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6245e3a38431SPaul Bohm        ;;
6246e3a38431SPaul Bohm
6247e3a38431SPaul Bohm      freebsd* | dragonfly*)
6248e3a38431SPaul Bohm        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6249e3a38431SPaul Bohm        # conventions
6250e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=yes
6251e3a38431SPaul Bohm        ;;
6252e3a38431SPaul Bohm
6253*93823e6cSPaul Bohm      haiku*)
6254*93823e6cSPaul Bohm        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6255*93823e6cSPaul Bohm        _LT_TAGVAR(link_all_deplibs, $1)=yes
6256e3a38431SPaul Bohm        ;;
6257e3a38431SPaul Bohm
6258e3a38431SPaul Bohm      hpux9*)
6259e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6260e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6261e3a38431SPaul Bohm        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6262e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_direct, $1)=yes
6263e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6264e3a38431SPaul Bohm				             # but as the default
6265e3a38431SPaul Bohm				             # location of the library.
6266e3a38431SPaul Bohm
6267e3a38431SPaul Bohm        case $cc_basename in
6268e3a38431SPaul Bohm          CC*)
6269e3a38431SPaul Bohm            # FIXME: insert proper C++ library support
6270e3a38431SPaul Bohm            _LT_TAGVAR(ld_shlibs, $1)=no
6271e3a38431SPaul Bohm            ;;
6272e3a38431SPaul Bohm          aCC*)
6273e3a38431SPaul Bohm            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6274e3a38431SPaul Bohm            # Commands to make compiler produce verbose output that lists
6275e3a38431SPaul Bohm            # what "hidden" libraries, object files and flags are used when
6276e3a38431SPaul Bohm            # linking a shared library.
6277e3a38431SPaul Bohm            #
6278e3a38431SPaul Bohm            # There doesn't appear to be a way to prevent this compiler from
6279e3a38431SPaul Bohm            # explicitly linking system object files so we need to strip them
6280e3a38431SPaul Bohm            # from the output so that they don't get included in the library
6281e3a38431SPaul Bohm            # dependencies.
6282*93823e6cSPaul Bohm            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"'
6283e3a38431SPaul Bohm            ;;
6284e3a38431SPaul Bohm          *)
6285e3a38431SPaul Bohm            if test "$GXX" = yes; then
6286*93823e6cSPaul Bohm              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6287e3a38431SPaul Bohm            else
6288e3a38431SPaul Bohm              # FIXME: insert proper C++ library support
6289e3a38431SPaul Bohm              _LT_TAGVAR(ld_shlibs, $1)=no
6290e3a38431SPaul Bohm            fi
6291e3a38431SPaul Bohm            ;;
6292e3a38431SPaul Bohm        esac
6293e3a38431SPaul Bohm        ;;
6294e3a38431SPaul Bohm
6295e3a38431SPaul Bohm      hpux10*|hpux11*)
6296e3a38431SPaul Bohm        if test $with_gnu_ld = no; then
6297e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6298e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6299e3a38431SPaul Bohm
6300e3a38431SPaul Bohm          case $host_cpu in
6301e3a38431SPaul Bohm            hppa*64*|ia64*)
6302e3a38431SPaul Bohm              ;;
6303e3a38431SPaul Bohm            *)
6304e3a38431SPaul Bohm	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6305e3a38431SPaul Bohm              ;;
6306e3a38431SPaul Bohm          esac
6307e3a38431SPaul Bohm        fi
6308e3a38431SPaul Bohm        case $host_cpu in
6309e3a38431SPaul Bohm          hppa*64*|ia64*)
6310e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_direct, $1)=no
6311e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6312e3a38431SPaul Bohm            ;;
6313e3a38431SPaul Bohm          *)
6314e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_direct, $1)=yes
6315e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6316e3a38431SPaul Bohm            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6317e3a38431SPaul Bohm					         # but as the default
6318e3a38431SPaul Bohm					         # location of the library.
6319e3a38431SPaul Bohm            ;;
6320e3a38431SPaul Bohm        esac
6321e3a38431SPaul Bohm
6322e3a38431SPaul Bohm        case $cc_basename in
6323e3a38431SPaul Bohm          CC*)
6324e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6325e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6326e3a38431SPaul Bohm	    ;;
6327e3a38431SPaul Bohm          aCC*)
6328e3a38431SPaul Bohm	    case $host_cpu in
6329e3a38431SPaul Bohm	      hppa*64*)
6330e3a38431SPaul Bohm	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6331e3a38431SPaul Bohm	        ;;
6332e3a38431SPaul Bohm	      ia64*)
6333e3a38431SPaul Bohm	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6334e3a38431SPaul Bohm	        ;;
6335e3a38431SPaul Bohm	      *)
6336e3a38431SPaul Bohm	        _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'
6337e3a38431SPaul Bohm	        ;;
6338e3a38431SPaul Bohm	    esac
6339e3a38431SPaul Bohm	    # Commands to make compiler produce verbose output that lists
6340e3a38431SPaul Bohm	    # what "hidden" libraries, object files and flags are used when
6341e3a38431SPaul Bohm	    # linking a shared library.
6342e3a38431SPaul Bohm	    #
6343e3a38431SPaul Bohm	    # There doesn't appear to be a way to prevent this compiler from
6344e3a38431SPaul Bohm	    # explicitly linking system object files so we need to strip them
6345e3a38431SPaul Bohm	    # from the output so that they don't get included in the library
6346e3a38431SPaul Bohm	    # dependencies.
6347*93823e6cSPaul Bohm	    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"'
6348e3a38431SPaul Bohm	    ;;
6349e3a38431SPaul Bohm          *)
6350e3a38431SPaul Bohm	    if test "$GXX" = yes; then
6351e3a38431SPaul Bohm	      if test $with_gnu_ld = no; then
6352e3a38431SPaul Bohm	        case $host_cpu in
6353e3a38431SPaul Bohm	          hppa*64*)
6354e3a38431SPaul Bohm	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6355e3a38431SPaul Bohm	            ;;
6356e3a38431SPaul Bohm	          ia64*)
6357*93823e6cSPaul Bohm	            _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'
6358e3a38431SPaul Bohm	            ;;
6359e3a38431SPaul Bohm	          *)
6360*93823e6cSPaul Bohm	            _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'
6361e3a38431SPaul Bohm	            ;;
6362e3a38431SPaul Bohm	        esac
6363e3a38431SPaul Bohm	      fi
6364e3a38431SPaul Bohm	    else
6365e3a38431SPaul Bohm	      # FIXME: insert proper C++ library support
6366e3a38431SPaul Bohm	      _LT_TAGVAR(ld_shlibs, $1)=no
6367e3a38431SPaul Bohm	    fi
6368e3a38431SPaul Bohm	    ;;
6369e3a38431SPaul Bohm        esac
6370e3a38431SPaul Bohm        ;;
6371e3a38431SPaul Bohm
6372e3a38431SPaul Bohm      interix[[3-9]]*)
6373e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_direct, $1)=no
6374e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6375e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6376e3a38431SPaul Bohm	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6377e3a38431SPaul Bohm	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6378e3a38431SPaul Bohm	# Instead, shared libraries are loaded at an image base (0x10000000 by
6379e3a38431SPaul Bohm	# default) and relocated if they conflict, which is a slow very memory
6380e3a38431SPaul Bohm	# consuming and fragmenting process.  To avoid this, we pick a random,
6381e3a38431SPaul Bohm	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6382e3a38431SPaul Bohm	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6383e3a38431SPaul Bohm	_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'
6384e3a38431SPaul Bohm	_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'
6385e3a38431SPaul Bohm	;;
6386e3a38431SPaul Bohm      irix5* | irix6*)
6387e3a38431SPaul Bohm        case $cc_basename in
6388e3a38431SPaul Bohm          CC*)
6389e3a38431SPaul Bohm	    # SGI C++
6390*93823e6cSPaul Bohm	    _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'
6391e3a38431SPaul Bohm
6392e3a38431SPaul Bohm	    # Archives containing C++ object files must be created using
6393e3a38431SPaul Bohm	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6394e3a38431SPaul Bohm	    # necessary to make sure instantiated templates are included
6395e3a38431SPaul Bohm	    # in the archive.
6396e3a38431SPaul Bohm	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6397e3a38431SPaul Bohm	    ;;
6398e3a38431SPaul Bohm          *)
6399e3a38431SPaul Bohm	    if test "$GXX" = yes; then
6400e3a38431SPaul Bohm	      if test "$with_gnu_ld" = no; then
6401*93823e6cSPaul Bohm	        _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'
6402e3a38431SPaul Bohm	      else
6403*93823e6cSPaul Bohm	        _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'
6404e3a38431SPaul Bohm	      fi
6405e3a38431SPaul Bohm	    fi
6406e3a38431SPaul Bohm	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6407e3a38431SPaul Bohm	    ;;
6408e3a38431SPaul Bohm        esac
6409e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6410e3a38431SPaul Bohm        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6411e3a38431SPaul Bohm        _LT_TAGVAR(inherit_rpath, $1)=yes
6412e3a38431SPaul Bohm        ;;
6413e3a38431SPaul Bohm
6414*93823e6cSPaul Bohm      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6415e3a38431SPaul Bohm        case $cc_basename in
6416e3a38431SPaul Bohm          KCC*)
6417e3a38431SPaul Bohm	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6418e3a38431SPaul Bohm
6419e3a38431SPaul Bohm	    # KCC will only create a shared library if the output file
6420e3a38431SPaul Bohm	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6421e3a38431SPaul Bohm	    # to its proper name (with version) after linking.
6422e3a38431SPaul Bohm	    _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'
6423e3a38431SPaul Bohm	    _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'
6424e3a38431SPaul Bohm	    # Commands to make compiler produce verbose output that lists
6425e3a38431SPaul Bohm	    # what "hidden" libraries, object files and flags are used when
6426e3a38431SPaul Bohm	    # linking a shared library.
6427e3a38431SPaul Bohm	    #
6428e3a38431SPaul Bohm	    # There doesn't appear to be a way to prevent this compiler from
6429e3a38431SPaul Bohm	    # explicitly linking system object files so we need to strip them
6430e3a38431SPaul Bohm	    # from the output so that they don't get included in the library
6431e3a38431SPaul Bohm	    # dependencies.
6432*93823e6cSPaul Bohm	    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"'
6433e3a38431SPaul Bohm
6434e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6435e3a38431SPaul Bohm	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6436e3a38431SPaul Bohm
6437e3a38431SPaul Bohm	    # Archives containing C++ object files must be created using
6438e3a38431SPaul Bohm	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6439e3a38431SPaul Bohm	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6440e3a38431SPaul Bohm	    ;;
6441e3a38431SPaul Bohm	  icpc* | ecpc* )
6442e3a38431SPaul Bohm	    # Intel C++
6443e3a38431SPaul Bohm	    with_gnu_ld=yes
6444e3a38431SPaul Bohm	    # version 8.0 and above of icpc choke on multiply defined symbols
6445e3a38431SPaul Bohm	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6446e3a38431SPaul Bohm	    # earlier do not add the objects themselves.
6447e3a38431SPaul Bohm	    case `$CC -V 2>&1` in
6448e3a38431SPaul Bohm	      *"Version 7."*)
6449e3a38431SPaul Bohm	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6450e3a38431SPaul Bohm		_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'
6451e3a38431SPaul Bohm		;;
6452e3a38431SPaul Bohm	      *)  # Version 8.0 or newer
6453e3a38431SPaul Bohm	        tmp_idyn=
6454e3a38431SPaul Bohm	        case $host_cpu in
6455e3a38431SPaul Bohm		  ia64*) tmp_idyn=' -i_dynamic';;
6456e3a38431SPaul Bohm		esac
6457e3a38431SPaul Bohm	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6458e3a38431SPaul Bohm		_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'
6459e3a38431SPaul Bohm		;;
6460e3a38431SPaul Bohm	    esac
6461e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6462e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6463e3a38431SPaul Bohm	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6464e3a38431SPaul Bohm	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6465e3a38431SPaul Bohm	    ;;
6466e3a38431SPaul Bohm          pgCC* | pgcpp*)
6467e3a38431SPaul Bohm            # Portland Group C++ compiler
6468e3a38431SPaul Bohm	    case `$CC -V` in
6469*93823e6cSPaul Bohm	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6470e3a38431SPaul Bohm	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6471e3a38431SPaul Bohm		rm -rf $tpldir~
6472e3a38431SPaul Bohm		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6473*93823e6cSPaul Bohm		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6474e3a38431SPaul Bohm	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6475e3a38431SPaul Bohm		rm -rf $tpldir~
6476e3a38431SPaul Bohm		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6477*93823e6cSPaul Bohm		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6478e3a38431SPaul Bohm		$RANLIB $oldlib'
6479e3a38431SPaul Bohm	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6480e3a38431SPaul Bohm		rm -rf $tpldir~
6481e3a38431SPaul Bohm		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6482*93823e6cSPaul Bohm		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6483e3a38431SPaul Bohm	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6484e3a38431SPaul Bohm		rm -rf $tpldir~
6485e3a38431SPaul Bohm		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6486*93823e6cSPaul Bohm		$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'
6487e3a38431SPaul Bohm	      ;;
6488*93823e6cSPaul Bohm	    *) # Version 6 and above use weak symbols
6489e3a38431SPaul Bohm	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6490e3a38431SPaul Bohm	      _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'
6491e3a38431SPaul Bohm	      ;;
6492e3a38431SPaul Bohm	    esac
6493e3a38431SPaul Bohm
6494e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6495e3a38431SPaul Bohm	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6496*93823e6cSPaul Bohm	    _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'
6497e3a38431SPaul Bohm            ;;
6498e3a38431SPaul Bohm	  cxx*)
6499e3a38431SPaul Bohm	    # Compaq C++
6500e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6501e3a38431SPaul Bohm	    _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'
6502e3a38431SPaul Bohm
6503e3a38431SPaul Bohm	    runpath_var=LD_RUN_PATH
6504e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6505e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6506e3a38431SPaul Bohm
6507e3a38431SPaul Bohm	    # Commands to make compiler produce verbose output that lists
6508e3a38431SPaul Bohm	    # what "hidden" libraries, object files and flags are used when
6509e3a38431SPaul Bohm	    # linking a shared library.
6510e3a38431SPaul Bohm	    #
6511e3a38431SPaul Bohm	    # There doesn't appear to be a way to prevent this compiler from
6512e3a38431SPaul Bohm	    # explicitly linking system object files so we need to strip them
6513e3a38431SPaul Bohm	    # from the output so that they don't get included in the library
6514e3a38431SPaul Bohm	    # dependencies.
6515*93823e6cSPaul Bohm	    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'
6516e3a38431SPaul Bohm	    ;;
6517*93823e6cSPaul Bohm	  xl* | mpixl* | bgxl*)
6518e3a38431SPaul Bohm	    # IBM XL 8.0 on PPC, with GNU ld
6519e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6520e3a38431SPaul Bohm	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6521e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6522e3a38431SPaul Bohm	    if test "x$supports_anon_versioning" = xyes; then
6523e3a38431SPaul Bohm	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6524e3a38431SPaul Bohm		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6525e3a38431SPaul Bohm		echo "local: *; };" >> $output_objdir/$libname.ver~
6526e3a38431SPaul Bohm		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6527e3a38431SPaul Bohm	    fi
6528e3a38431SPaul Bohm	    ;;
6529e3a38431SPaul Bohm	  *)
6530e3a38431SPaul Bohm	    case `$CC -V 2>&1 | sed 5q` in
6531e3a38431SPaul Bohm	    *Sun\ C*)
6532e3a38431SPaul Bohm	      # Sun C++ 5.9
6533e3a38431SPaul Bohm	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6534e3a38431SPaul Bohm	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6535e3a38431SPaul Bohm	      _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'
6536e3a38431SPaul Bohm	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6537*93823e6cSPaul Bohm	      _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'
6538e3a38431SPaul Bohm	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6539e3a38431SPaul Bohm
6540e3a38431SPaul Bohm	      # Not sure whether something based on
6541e3a38431SPaul Bohm	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6542e3a38431SPaul Bohm	      # would be better.
6543*93823e6cSPaul Bohm	      output_verbose_link_cmd='func_echo_all'
6544e3a38431SPaul Bohm
6545e3a38431SPaul Bohm	      # Archives containing C++ object files must be created using
6546e3a38431SPaul Bohm	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6547e3a38431SPaul Bohm	      # necessary to make sure instantiated templates are included
6548e3a38431SPaul Bohm	      # in the archive.
6549e3a38431SPaul Bohm	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6550e3a38431SPaul Bohm	      ;;
6551e3a38431SPaul Bohm	    esac
6552e3a38431SPaul Bohm	    ;;
6553e3a38431SPaul Bohm	esac
6554e3a38431SPaul Bohm	;;
6555e3a38431SPaul Bohm
6556e3a38431SPaul Bohm      lynxos*)
6557e3a38431SPaul Bohm        # FIXME: insert proper C++ library support
6558e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
6559e3a38431SPaul Bohm	;;
6560e3a38431SPaul Bohm
6561e3a38431SPaul Bohm      m88k*)
6562e3a38431SPaul Bohm        # FIXME: insert proper C++ library support
6563e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=no
6564e3a38431SPaul Bohm	;;
6565e3a38431SPaul Bohm
6566e3a38431SPaul Bohm      mvs*)
6567e3a38431SPaul Bohm        case $cc_basename in
6568e3a38431SPaul Bohm          cxx*)
6569e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6570e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6571e3a38431SPaul Bohm	    ;;
6572e3a38431SPaul Bohm	  *)
6573e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6574e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6575e3a38431SPaul Bohm	    ;;
6576e3a38431SPaul Bohm	esac
6577e3a38431SPaul Bohm	;;
6578e3a38431SPaul Bohm
6579e3a38431SPaul Bohm      netbsd*)
6580e3a38431SPaul Bohm        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6581e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6582e3a38431SPaul Bohm	  wlarc=
6583e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6584e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct, $1)=yes
6585e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6586e3a38431SPaul Bohm	fi
6587e3a38431SPaul Bohm	# Workaround some broken pre-1.5 toolchains
6588e3a38431SPaul Bohm	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6589e3a38431SPaul Bohm	;;
6590e3a38431SPaul Bohm
6591e3a38431SPaul Bohm      *nto* | *qnx*)
6592e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=yes
6593e3a38431SPaul Bohm	;;
6594e3a38431SPaul Bohm
6595e3a38431SPaul Bohm      openbsd2*)
6596e3a38431SPaul Bohm        # C++ shared libraries are fairly broken
6597e3a38431SPaul Bohm	_LT_TAGVAR(ld_shlibs, $1)=no
6598e3a38431SPaul Bohm	;;
6599e3a38431SPaul Bohm
6600e3a38431SPaul Bohm      openbsd*)
6601e3a38431SPaul Bohm	if test -f /usr/libexec/ld.so; then
6602e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct, $1)=yes
6603e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6604e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6605e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6606e3a38431SPaul Bohm	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6607e3a38431SPaul Bohm	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6608e3a38431SPaul Bohm	    _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'
6609e3a38431SPaul Bohm	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6610e3a38431SPaul Bohm	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6611e3a38431SPaul Bohm	  fi
6612*93823e6cSPaul Bohm	  output_verbose_link_cmd=func_echo_all
6613e3a38431SPaul Bohm	else
6614e3a38431SPaul Bohm	  _LT_TAGVAR(ld_shlibs, $1)=no
6615e3a38431SPaul Bohm	fi
6616e3a38431SPaul Bohm	;;
6617e3a38431SPaul Bohm
6618e3a38431SPaul Bohm      osf3* | osf4* | osf5*)
6619e3a38431SPaul Bohm        case $cc_basename in
6620e3a38431SPaul Bohm          KCC*)
6621e3a38431SPaul Bohm	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6622e3a38431SPaul Bohm
6623e3a38431SPaul Bohm	    # KCC will only create a shared library if the output file
6624e3a38431SPaul Bohm	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6625e3a38431SPaul Bohm	    # to its proper name (with version) after linking.
6626e3a38431SPaul Bohm	    _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'
6627e3a38431SPaul Bohm
6628e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6629e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6630e3a38431SPaul Bohm
6631e3a38431SPaul Bohm	    # Archives containing C++ object files must be created using
6632e3a38431SPaul Bohm	    # the KAI C++ compiler.
6633e3a38431SPaul Bohm	    case $host in
6634e3a38431SPaul Bohm	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6635e3a38431SPaul Bohm	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6636e3a38431SPaul Bohm	    esac
6637e3a38431SPaul Bohm	    ;;
6638e3a38431SPaul Bohm          RCC*)
6639e3a38431SPaul Bohm	    # Rational C++ 2.4.1
6640e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6641e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6642e3a38431SPaul Bohm	    ;;
6643e3a38431SPaul Bohm          cxx*)
6644e3a38431SPaul Bohm	    case $host in
6645e3a38431SPaul Bohm	      osf3*)
6646e3a38431SPaul Bohm	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6647*93823e6cSPaul Bohm	        _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'
6648e3a38431SPaul Bohm	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6649e3a38431SPaul Bohm		;;
6650e3a38431SPaul Bohm	      *)
6651e3a38431SPaul Bohm	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6652*93823e6cSPaul Bohm	        _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'
6653e3a38431SPaul Bohm	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6654e3a38431SPaul Bohm	          echo "-hidden">> $lib.exp~
6655*93823e6cSPaul Bohm	          $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~
6656e3a38431SPaul Bohm	          $RM $lib.exp'
6657e3a38431SPaul Bohm	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6658e3a38431SPaul Bohm		;;
6659e3a38431SPaul Bohm	    esac
6660e3a38431SPaul Bohm
6661e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6662e3a38431SPaul Bohm
6663e3a38431SPaul Bohm	    # Commands to make compiler produce verbose output that lists
6664e3a38431SPaul Bohm	    # what "hidden" libraries, object files and flags are used when
6665e3a38431SPaul Bohm	    # linking a shared library.
6666e3a38431SPaul Bohm	    #
6667e3a38431SPaul Bohm	    # There doesn't appear to be a way to prevent this compiler from
6668e3a38431SPaul Bohm	    # explicitly linking system object files so we need to strip them
6669e3a38431SPaul Bohm	    # from the output so that they don't get included in the library
6670e3a38431SPaul Bohm	    # dependencies.
6671*93823e6cSPaul Bohm	    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"'
6672e3a38431SPaul Bohm	    ;;
6673e3a38431SPaul Bohm	  *)
6674e3a38431SPaul Bohm	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6675e3a38431SPaul Bohm	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6676e3a38431SPaul Bohm	      case $host in
6677e3a38431SPaul Bohm	        osf3*)
6678*93823e6cSPaul Bohm	          _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'
6679e3a38431SPaul Bohm		  ;;
6680e3a38431SPaul Bohm	        *)
6681*93823e6cSPaul Bohm	          _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'
6682e3a38431SPaul Bohm		  ;;
6683e3a38431SPaul Bohm	      esac
6684e3a38431SPaul Bohm
6685e3a38431SPaul Bohm	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6686e3a38431SPaul Bohm	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6687e3a38431SPaul Bohm
6688e3a38431SPaul Bohm	      # Commands to make compiler produce verbose output that lists
6689e3a38431SPaul Bohm	      # what "hidden" libraries, object files and flags are used when
6690e3a38431SPaul Bohm	      # linking a shared library.
6691*93823e6cSPaul Bohm	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6692e3a38431SPaul Bohm
6693e3a38431SPaul Bohm	    else
6694e3a38431SPaul Bohm	      # FIXME: insert proper C++ library support
6695e3a38431SPaul Bohm	      _LT_TAGVAR(ld_shlibs, $1)=no
6696e3a38431SPaul Bohm	    fi
6697e3a38431SPaul Bohm	    ;;
6698e3a38431SPaul Bohm        esac
6699e3a38431SPaul Bohm        ;;
6700e3a38431SPaul Bohm
6701e3a38431SPaul Bohm      psos*)
6702e3a38431SPaul Bohm        # FIXME: insert proper C++ library support
6703e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=no
6704e3a38431SPaul Bohm        ;;
6705e3a38431SPaul Bohm
6706e3a38431SPaul Bohm      sunos4*)
6707e3a38431SPaul Bohm        case $cc_basename in
6708e3a38431SPaul Bohm          CC*)
6709e3a38431SPaul Bohm	    # Sun C++ 4.x
6710e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6711e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6712e3a38431SPaul Bohm	    ;;
6713e3a38431SPaul Bohm          lcc*)
6714e3a38431SPaul Bohm	    # Lucid
6715e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6716e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6717e3a38431SPaul Bohm	    ;;
6718e3a38431SPaul Bohm          *)
6719e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6720e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6721e3a38431SPaul Bohm	    ;;
6722e3a38431SPaul Bohm        esac
6723e3a38431SPaul Bohm        ;;
6724e3a38431SPaul Bohm
6725e3a38431SPaul Bohm      solaris*)
6726e3a38431SPaul Bohm        case $cc_basename in
6727*93823e6cSPaul Bohm          CC* | sunCC*)
6728e3a38431SPaul Bohm	    # Sun C++ 4.2, 5.x and Centerline C++
6729e3a38431SPaul Bohm            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6730e3a38431SPaul Bohm	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6731e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6732e3a38431SPaul Bohm	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6733e3a38431SPaul Bohm	      $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'
6734e3a38431SPaul Bohm
6735e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6736e3a38431SPaul Bohm	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6737e3a38431SPaul Bohm	    case $host_os in
6738e3a38431SPaul Bohm	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6739e3a38431SPaul Bohm	      *)
6740e3a38431SPaul Bohm		# The compiler driver will combine and reorder linker options,
6741e3a38431SPaul Bohm		# but understands `-z linker_flag'.
6742e3a38431SPaul Bohm	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6743e3a38431SPaul Bohm		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6744e3a38431SPaul Bohm	        ;;
6745e3a38431SPaul Bohm	    esac
6746e3a38431SPaul Bohm	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6747e3a38431SPaul Bohm
6748*93823e6cSPaul Bohm	    output_verbose_link_cmd='func_echo_all'
6749e3a38431SPaul Bohm
6750e3a38431SPaul Bohm	    # Archives containing C++ object files must be created using
6751e3a38431SPaul Bohm	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6752e3a38431SPaul Bohm	    # necessary to make sure instantiated templates are included
6753e3a38431SPaul Bohm	    # in the archive.
6754e3a38431SPaul Bohm	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6755e3a38431SPaul Bohm	    ;;
6756e3a38431SPaul Bohm          gcx*)
6757e3a38431SPaul Bohm	    # Green Hills C++ Compiler
6758e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6759e3a38431SPaul Bohm
6760e3a38431SPaul Bohm	    # The C++ compiler must be used to create the archive.
6761e3a38431SPaul Bohm	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6762e3a38431SPaul Bohm	    ;;
6763e3a38431SPaul Bohm          *)
6764e3a38431SPaul Bohm	    # GNU C++ compiler with Solaris linker
6765e3a38431SPaul Bohm	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6766e3a38431SPaul Bohm	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6767e3a38431SPaul Bohm	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6768*93823e6cSPaul Bohm	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6769e3a38431SPaul Bohm	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6770*93823e6cSPaul Bohm		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6771e3a38431SPaul Bohm
6772e3a38431SPaul Bohm	        # Commands to make compiler produce verbose output that lists
6773e3a38431SPaul Bohm	        # what "hidden" libraries, object files and flags are used when
6774e3a38431SPaul Bohm	        # linking a shared library.
6775*93823e6cSPaul Bohm	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6776e3a38431SPaul Bohm	      else
6777e3a38431SPaul Bohm	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6778e3a38431SPaul Bohm	        # platform.
6779e3a38431SPaul Bohm	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6780e3a38431SPaul Bohm	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6781e3a38431SPaul Bohm		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6782e3a38431SPaul Bohm
6783e3a38431SPaul Bohm	        # Commands to make compiler produce verbose output that lists
6784e3a38431SPaul Bohm	        # what "hidden" libraries, object files and flags are used when
6785e3a38431SPaul Bohm	        # linking a shared library.
6786*93823e6cSPaul Bohm	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6787e3a38431SPaul Bohm	      fi
6788e3a38431SPaul Bohm
6789e3a38431SPaul Bohm	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6790e3a38431SPaul Bohm	      case $host_os in
6791e3a38431SPaul Bohm		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6792e3a38431SPaul Bohm		*)
6793e3a38431SPaul Bohm		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6794e3a38431SPaul Bohm		  ;;
6795e3a38431SPaul Bohm	      esac
6796e3a38431SPaul Bohm	    fi
6797e3a38431SPaul Bohm	    ;;
6798e3a38431SPaul Bohm        esac
6799e3a38431SPaul Bohm        ;;
6800e3a38431SPaul Bohm
6801e3a38431SPaul Bohm    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6802e3a38431SPaul Bohm      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6803e3a38431SPaul Bohm      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6804e3a38431SPaul Bohm      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6805e3a38431SPaul Bohm      runpath_var='LD_RUN_PATH'
6806e3a38431SPaul Bohm
6807e3a38431SPaul Bohm      case $cc_basename in
6808e3a38431SPaul Bohm        CC*)
6809e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6810e3a38431SPaul Bohm	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6811e3a38431SPaul Bohm	  ;;
6812e3a38431SPaul Bohm	*)
6813e3a38431SPaul Bohm	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6814e3a38431SPaul Bohm	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6815e3a38431SPaul Bohm	  ;;
6816e3a38431SPaul Bohm      esac
6817e3a38431SPaul Bohm      ;;
6818e3a38431SPaul Bohm
6819e3a38431SPaul Bohm      sysv5* | sco3.2v5* | sco5v6*)
6820e3a38431SPaul Bohm	# Note: We can NOT use -z defs as we might desire, because we do not
6821e3a38431SPaul Bohm	# link with -lc, and that would cause any symbols used from libc to
6822e3a38431SPaul Bohm	# always be unresolved, which means just about no library would
6823e3a38431SPaul Bohm	# ever link correctly.  If we're not using GNU ld we use -z text
6824e3a38431SPaul Bohm	# though, which does catch some bad symbols but isn't as heavy-handed
6825e3a38431SPaul Bohm	# as -z defs.
6826e3a38431SPaul Bohm	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6827e3a38431SPaul Bohm	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6828e3a38431SPaul Bohm	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6829e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6830e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6831e3a38431SPaul Bohm	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6832e3a38431SPaul Bohm	_LT_TAGVAR(link_all_deplibs, $1)=yes
6833e3a38431SPaul Bohm	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6834e3a38431SPaul Bohm	runpath_var='LD_RUN_PATH'
6835e3a38431SPaul Bohm
6836e3a38431SPaul Bohm	case $cc_basename in
6837e3a38431SPaul Bohm          CC*)
6838e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6839e3a38431SPaul Bohm	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6840*93823e6cSPaul Bohm	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6841*93823e6cSPaul Bohm	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
6842*93823e6cSPaul Bohm	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6843*93823e6cSPaul Bohm	      '"$_LT_TAGVAR(reload_cmds, $1)"
6844e3a38431SPaul Bohm	    ;;
6845e3a38431SPaul Bohm	  *)
6846e3a38431SPaul Bohm	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6847e3a38431SPaul Bohm	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6848e3a38431SPaul Bohm	    ;;
6849e3a38431SPaul Bohm	esac
6850e3a38431SPaul Bohm      ;;
6851e3a38431SPaul Bohm
6852e3a38431SPaul Bohm      tandem*)
6853e3a38431SPaul Bohm        case $cc_basename in
6854e3a38431SPaul Bohm          NCC*)
6855e3a38431SPaul Bohm	    # NonStop-UX NCC 3.20
6856e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6857e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6858e3a38431SPaul Bohm	    ;;
6859e3a38431SPaul Bohm          *)
6860e3a38431SPaul Bohm	    # FIXME: insert proper C++ library support
6861e3a38431SPaul Bohm	    _LT_TAGVAR(ld_shlibs, $1)=no
6862e3a38431SPaul Bohm	    ;;
6863e3a38431SPaul Bohm        esac
6864e3a38431SPaul Bohm        ;;
6865e3a38431SPaul Bohm
6866e3a38431SPaul Bohm      vxworks*)
6867e3a38431SPaul Bohm        # FIXME: insert proper C++ library support
6868e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=no
6869e3a38431SPaul Bohm        ;;
6870e3a38431SPaul Bohm
6871e3a38431SPaul Bohm      *)
6872e3a38431SPaul Bohm        # FIXME: insert proper C++ library support
6873e3a38431SPaul Bohm        _LT_TAGVAR(ld_shlibs, $1)=no
6874e3a38431SPaul Bohm        ;;
6875e3a38431SPaul Bohm    esac
6876e3a38431SPaul Bohm
6877e3a38431SPaul Bohm    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6878e3a38431SPaul Bohm    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6879e3a38431SPaul Bohm
6880e3a38431SPaul Bohm    _LT_TAGVAR(GCC, $1)="$GXX"
6881e3a38431SPaul Bohm    _LT_TAGVAR(LD, $1)="$LD"
6882e3a38431SPaul Bohm
6883e3a38431SPaul Bohm    ## CAVEAT EMPTOR:
6884e3a38431SPaul Bohm    ## There is no encapsulation within the following macros, do not change
6885e3a38431SPaul Bohm    ## the running order or otherwise move them around unless you know exactly
6886e3a38431SPaul Bohm    ## what you are doing...
6887e3a38431SPaul Bohm    _LT_SYS_HIDDEN_LIBDEPS($1)
6888e3a38431SPaul Bohm    _LT_COMPILER_PIC($1)
6889e3a38431SPaul Bohm    _LT_COMPILER_C_O($1)
6890e3a38431SPaul Bohm    _LT_COMPILER_FILE_LOCKS($1)
6891e3a38431SPaul Bohm    _LT_LINKER_SHLIBS($1)
6892e3a38431SPaul Bohm    _LT_SYS_DYNAMIC_LINKER($1)
6893e3a38431SPaul Bohm    _LT_LINKER_HARDCODE_LIBPATH($1)
6894e3a38431SPaul Bohm
6895e3a38431SPaul Bohm    _LT_CONFIG($1)
6896e3a38431SPaul Bohm  fi # test -n "$compiler"
6897e3a38431SPaul Bohm
6898e3a38431SPaul Bohm  CC=$lt_save_CC
6899*93823e6cSPaul Bohm  CFLAGS=$lt_save_CFLAGS
6900e3a38431SPaul Bohm  LDCXX=$LD
6901e3a38431SPaul Bohm  LD=$lt_save_LD
6902e3a38431SPaul Bohm  GCC=$lt_save_GCC
6903e3a38431SPaul Bohm  with_gnu_ld=$lt_save_with_gnu_ld
6904e3a38431SPaul Bohm  lt_cv_path_LDCXX=$lt_cv_path_LD
6905e3a38431SPaul Bohm  lt_cv_path_LD=$lt_save_path_LD
6906e3a38431SPaul Bohm  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6907e3a38431SPaul Bohm  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6908e3a38431SPaul Bohmfi # test "$_lt_caught_CXX_error" != yes
6909e3a38431SPaul Bohm
6910e3a38431SPaul BohmAC_LANG_POP
6911e3a38431SPaul Bohm])# _LT_LANG_CXX_CONFIG
6912e3a38431SPaul Bohm
6913e3a38431SPaul Bohm
6914*93823e6cSPaul Bohm# _LT_FUNC_STRIPNAME_CNF
6915*93823e6cSPaul Bohm# ----------------------
6916*93823e6cSPaul Bohm# func_stripname_cnf prefix suffix name
6917*93823e6cSPaul Bohm# strip PREFIX and SUFFIX off of NAME.
6918*93823e6cSPaul Bohm# PREFIX and SUFFIX must not contain globbing or regex special
6919*93823e6cSPaul Bohm# characters, hashes, percent signs, but SUFFIX may contain a leading
6920*93823e6cSPaul Bohm# dot (in which case that matches only a dot).
6921*93823e6cSPaul Bohm#
6922*93823e6cSPaul Bohm# This function is identical to the (non-XSI) version of func_stripname,
6923*93823e6cSPaul Bohm# except this one can be used by m4 code that may be executed by configure,
6924*93823e6cSPaul Bohm# rather than the libtool script.
6925*93823e6cSPaul Bohmm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6926*93823e6cSPaul BohmAC_REQUIRE([_LT_DECL_SED])
6927*93823e6cSPaul BohmAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6928*93823e6cSPaul Bohmfunc_stripname_cnf ()
6929*93823e6cSPaul Bohm{
6930*93823e6cSPaul Bohm  case ${2} in
6931*93823e6cSPaul Bohm  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6932*93823e6cSPaul Bohm  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6933*93823e6cSPaul Bohm  esac
6934*93823e6cSPaul Bohm} # func_stripname_cnf
6935*93823e6cSPaul Bohm])# _LT_FUNC_STRIPNAME_CNF
6936*93823e6cSPaul Bohm
6937e3a38431SPaul Bohm# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6938e3a38431SPaul Bohm# ---------------------------------
6939e3a38431SPaul Bohm# Figure out "hidden" library dependencies from verbose
6940e3a38431SPaul Bohm# compiler output when linking a shared library.
6941e3a38431SPaul Bohm# Parse the compiler output and extract the necessary
6942e3a38431SPaul Bohm# objects, libraries and library flags.
6943e3a38431SPaul Bohmm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6944e3a38431SPaul Bohm[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6945*93823e6cSPaul BohmAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
6946e3a38431SPaul Bohm# Dependencies to place before and after the object being linked:
6947e3a38431SPaul Bohm_LT_TAGVAR(predep_objects, $1)=
6948e3a38431SPaul Bohm_LT_TAGVAR(postdep_objects, $1)=
6949e3a38431SPaul Bohm_LT_TAGVAR(predeps, $1)=
6950e3a38431SPaul Bohm_LT_TAGVAR(postdeps, $1)=
6951e3a38431SPaul Bohm_LT_TAGVAR(compiler_lib_search_path, $1)=
6952e3a38431SPaul Bohm
6953e3a38431SPaul Bohmdnl we can't use the lt_simple_compile_test_code here,
6954e3a38431SPaul Bohmdnl because it contains code intended for an executable,
6955e3a38431SPaul Bohmdnl not a library.  It's possible we should let each
6956e3a38431SPaul Bohmdnl tag define a new lt_????_link_test_code variable,
6957e3a38431SPaul Bohmdnl but it's only used here...
6958e3a38431SPaul Bohmm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6959e3a38431SPaul Bohmint a;
6960e3a38431SPaul Bohmvoid foo (void) { a = 0; }
6961e3a38431SPaul Bohm_LT_EOF
6962e3a38431SPaul Bohm], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6963e3a38431SPaul Bohmclass Foo
6964e3a38431SPaul Bohm{
6965e3a38431SPaul Bohmpublic:
6966e3a38431SPaul Bohm  Foo (void) { a = 0; }
6967e3a38431SPaul Bohmprivate:
6968e3a38431SPaul Bohm  int a;
6969e3a38431SPaul Bohm};
6970e3a38431SPaul Bohm_LT_EOF
6971e3a38431SPaul Bohm], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6972e3a38431SPaul Bohm      subroutine foo
6973e3a38431SPaul Bohm      implicit none
6974e3a38431SPaul Bohm      integer*4 a
6975e3a38431SPaul Bohm      a=0
6976e3a38431SPaul Bohm      return
6977e3a38431SPaul Bohm      end
6978e3a38431SPaul Bohm_LT_EOF
6979e3a38431SPaul Bohm], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6980e3a38431SPaul Bohm      subroutine foo
6981e3a38431SPaul Bohm      implicit none
6982e3a38431SPaul Bohm      integer a
6983e3a38431SPaul Bohm      a=0
6984e3a38431SPaul Bohm      return
6985e3a38431SPaul Bohm      end
6986e3a38431SPaul Bohm_LT_EOF
6987e3a38431SPaul Bohm], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6988e3a38431SPaul Bohmpublic class foo {
6989e3a38431SPaul Bohm  private int a;
6990e3a38431SPaul Bohm  public void bar (void) {
6991e3a38431SPaul Bohm    a = 0;
6992e3a38431SPaul Bohm  }
6993e3a38431SPaul Bohm};
6994e3a38431SPaul Bohm_LT_EOF
6995*93823e6cSPaul Bohm], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6996*93823e6cSPaul Bohmpackage foo
6997*93823e6cSPaul Bohmfunc foo() {
6998*93823e6cSPaul Bohm}
6999*93823e6cSPaul Bohm_LT_EOF
7000e3a38431SPaul Bohm])
7001*93823e6cSPaul Bohm
7002*93823e6cSPaul Bohm_lt_libdeps_save_CFLAGS=$CFLAGS
7003*93823e6cSPaul Bohmcase "$CC $CFLAGS " in #(
7004*93823e6cSPaul Bohm*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7005*93823e6cSPaul Bohm*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7006*93823e6cSPaul Bohm*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7007*93823e6cSPaul Bohmesac
7008*93823e6cSPaul Bohm
7009e3a38431SPaul Bohmdnl Parse the compiler output and extract the necessary
7010e3a38431SPaul Bohmdnl objects, libraries and library flags.
7011e3a38431SPaul Bohmif AC_TRY_EVAL(ac_compile); then
7012e3a38431SPaul Bohm  # Parse the compiler output and extract the necessary
7013e3a38431SPaul Bohm  # objects, libraries and library flags.
7014e3a38431SPaul Bohm
7015e3a38431SPaul Bohm  # Sentinel used to keep track of whether or not we are before
7016e3a38431SPaul Bohm  # the conftest object file.
7017e3a38431SPaul Bohm  pre_test_object_deps_done=no
7018e3a38431SPaul Bohm
7019e3a38431SPaul Bohm  for p in `eval "$output_verbose_link_cmd"`; do
7020*93823e6cSPaul Bohm    case ${prev}${p} in
7021e3a38431SPaul Bohm
7022e3a38431SPaul Bohm    -L* | -R* | -l*)
7023e3a38431SPaul Bohm       # Some compilers place space between "-{L,R}" and the path.
7024e3a38431SPaul Bohm       # Remove the space.
7025e3a38431SPaul Bohm       if test $p = "-L" ||
7026e3a38431SPaul Bohm          test $p = "-R"; then
7027e3a38431SPaul Bohm	 prev=$p
7028e3a38431SPaul Bohm	 continue
7029e3a38431SPaul Bohm       fi
7030e3a38431SPaul Bohm
7031*93823e6cSPaul Bohm       # Expand the sysroot to ease extracting the directories later.
7032*93823e6cSPaul Bohm       if test -z "$prev"; then
7033e3a38431SPaul Bohm         case $p in
7034*93823e6cSPaul Bohm         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7035*93823e6cSPaul Bohm         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7036*93823e6cSPaul Bohm         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7037*93823e6cSPaul Bohm         esac
7038*93823e6cSPaul Bohm       fi
7039*93823e6cSPaul Bohm       case $p in
7040*93823e6cSPaul Bohm       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7041*93823e6cSPaul Bohm       esac
7042*93823e6cSPaul Bohm       if test "$pre_test_object_deps_done" = no; then
7043*93823e6cSPaul Bohm	 case ${prev} in
7044*93823e6cSPaul Bohm	 -L | -R)
7045e3a38431SPaul Bohm	   # Internal compiler library paths should come after those
7046e3a38431SPaul Bohm	   # provided the user.  The postdeps already come after the
7047e3a38431SPaul Bohm	   # user supplied libs so there is no need to process them.
7048e3a38431SPaul Bohm	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7049e3a38431SPaul Bohm	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7050e3a38431SPaul Bohm	   else
7051e3a38431SPaul Bohm	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7052e3a38431SPaul Bohm	   fi
7053e3a38431SPaul Bohm	   ;;
7054e3a38431SPaul Bohm	 # The "-l" case would never come before the object being
7055e3a38431SPaul Bohm	 # linked, so don't bother handling this case.
7056e3a38431SPaul Bohm	 esac
7057e3a38431SPaul Bohm       else
7058e3a38431SPaul Bohm	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7059e3a38431SPaul Bohm	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
7060e3a38431SPaul Bohm	 else
7061e3a38431SPaul Bohm	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
7062e3a38431SPaul Bohm	 fi
7063e3a38431SPaul Bohm       fi
7064*93823e6cSPaul Bohm       prev=
7065e3a38431SPaul Bohm       ;;
7066e3a38431SPaul Bohm
7067*93823e6cSPaul Bohm    *.lto.$objext) ;; # Ignore GCC LTO objects
7068e3a38431SPaul Bohm    *.$objext)
7069e3a38431SPaul Bohm       # This assumes that the test object file only shows up
7070e3a38431SPaul Bohm       # once in the compiler output.
7071e3a38431SPaul Bohm       if test "$p" = "conftest.$objext"; then
7072e3a38431SPaul Bohm	 pre_test_object_deps_done=yes
7073e3a38431SPaul Bohm	 continue
7074e3a38431SPaul Bohm       fi
7075e3a38431SPaul Bohm
7076e3a38431SPaul Bohm       if test "$pre_test_object_deps_done" = no; then
7077e3a38431SPaul Bohm	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7078e3a38431SPaul Bohm	   _LT_TAGVAR(predep_objects, $1)="$p"
7079e3a38431SPaul Bohm	 else
7080e3a38431SPaul Bohm	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7081e3a38431SPaul Bohm	 fi
7082e3a38431SPaul Bohm       else
7083e3a38431SPaul Bohm	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7084e3a38431SPaul Bohm	   _LT_TAGVAR(postdep_objects, $1)="$p"
7085e3a38431SPaul Bohm	 else
7086e3a38431SPaul Bohm	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7087e3a38431SPaul Bohm	 fi
7088e3a38431SPaul Bohm       fi
7089e3a38431SPaul Bohm       ;;
7090e3a38431SPaul Bohm
7091e3a38431SPaul Bohm    *) ;; # Ignore the rest.
7092e3a38431SPaul Bohm
7093e3a38431SPaul Bohm    esac
7094e3a38431SPaul Bohm  done
7095e3a38431SPaul Bohm
7096e3a38431SPaul Bohm  # Clean up.
7097e3a38431SPaul Bohm  rm -f a.out a.exe
7098e3a38431SPaul Bohmelse
7099e3a38431SPaul Bohm  echo "libtool.m4: error: problem compiling $1 test program"
7100e3a38431SPaul Bohmfi
7101e3a38431SPaul Bohm
7102e3a38431SPaul Bohm$RM -f confest.$objext
7103*93823e6cSPaul BohmCFLAGS=$_lt_libdeps_save_CFLAGS
7104e3a38431SPaul Bohm
7105e3a38431SPaul Bohm# PORTME: override above test on systems where it is broken
7106e3a38431SPaul Bohmm4_if([$1], [CXX],
7107e3a38431SPaul Bohm[case $host_os in
7108e3a38431SPaul Bohminterix[[3-9]]*)
7109e3a38431SPaul Bohm  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7110e3a38431SPaul Bohm  # hack all around it, let's just trust "g++" to DTRT.
7111e3a38431SPaul Bohm  _LT_TAGVAR(predep_objects,$1)=
7112e3a38431SPaul Bohm  _LT_TAGVAR(postdep_objects,$1)=
7113e3a38431SPaul Bohm  _LT_TAGVAR(postdeps,$1)=
7114e3a38431SPaul Bohm  ;;
7115e3a38431SPaul Bohm
7116e3a38431SPaul Bohmlinux*)
7117e3a38431SPaul Bohm  case `$CC -V 2>&1 | sed 5q` in
7118e3a38431SPaul Bohm  *Sun\ C*)
7119e3a38431SPaul Bohm    # Sun C++ 5.9
7120e3a38431SPaul Bohm
7121e3a38431SPaul Bohm    # The more standards-conforming stlport4 library is
7122e3a38431SPaul Bohm    # incompatible with the Cstd library. Avoid specifying
7123e3a38431SPaul Bohm    # it if it's in CXXFLAGS. Ignore libCrun as
7124e3a38431SPaul Bohm    # -library=stlport4 depends on it.
7125e3a38431SPaul Bohm    case " $CXX $CXXFLAGS " in
7126e3a38431SPaul Bohm    *" -library=stlport4 "*)
7127e3a38431SPaul Bohm      solaris_use_stlport4=yes
7128e3a38431SPaul Bohm      ;;
7129e3a38431SPaul Bohm    esac
7130e3a38431SPaul Bohm
7131e3a38431SPaul Bohm    if test "$solaris_use_stlport4" != yes; then
7132e3a38431SPaul Bohm      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7133e3a38431SPaul Bohm    fi
7134e3a38431SPaul Bohm    ;;
7135e3a38431SPaul Bohm  esac
7136e3a38431SPaul Bohm  ;;
7137e3a38431SPaul Bohm
7138e3a38431SPaul Bohmsolaris*)
7139e3a38431SPaul Bohm  case $cc_basename in
7140*93823e6cSPaul Bohm  CC* | sunCC*)
7141e3a38431SPaul Bohm    # The more standards-conforming stlport4 library is
7142e3a38431SPaul Bohm    # incompatible with the Cstd library. Avoid specifying
7143e3a38431SPaul Bohm    # it if it's in CXXFLAGS. Ignore libCrun as
7144e3a38431SPaul Bohm    # -library=stlport4 depends on it.
7145e3a38431SPaul Bohm    case " $CXX $CXXFLAGS " in
7146e3a38431SPaul Bohm    *" -library=stlport4 "*)
7147e3a38431SPaul Bohm      solaris_use_stlport4=yes
7148e3a38431SPaul Bohm      ;;
7149e3a38431SPaul Bohm    esac
7150e3a38431SPaul Bohm
7151e3a38431SPaul Bohm    # Adding this requires a known-good setup of shared libraries for
7152e3a38431SPaul Bohm    # Sun compiler versions before 5.6, else PIC objects from an old
7153e3a38431SPaul Bohm    # archive will be linked into the output, leading to subtle bugs.
7154e3a38431SPaul Bohm    if test "$solaris_use_stlport4" != yes; then
7155e3a38431SPaul Bohm      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7156e3a38431SPaul Bohm    fi
7157e3a38431SPaul Bohm    ;;
7158e3a38431SPaul Bohm  esac
7159e3a38431SPaul Bohm  ;;
7160e3a38431SPaul Bohmesac
7161e3a38431SPaul Bohm])
7162e3a38431SPaul Bohm
7163e3a38431SPaul Bohmcase " $_LT_TAGVAR(postdeps, $1) " in
7164e3a38431SPaul Bohm*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7165e3a38431SPaul Bohmesac
7166e3a38431SPaul Bohm _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7167e3a38431SPaul Bohmif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7168e3a38431SPaul Bohm _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7169e3a38431SPaul Bohmfi
7170e3a38431SPaul Bohm_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7171e3a38431SPaul Bohm    [The directories searched by this compiler when creating a shared library])
7172e3a38431SPaul Bohm_LT_TAGDECL([], [predep_objects], [1],
7173e3a38431SPaul Bohm    [Dependencies to place before and after the objects being linked to
7174e3a38431SPaul Bohm    create a shared library])
7175e3a38431SPaul Bohm_LT_TAGDECL([], [postdep_objects], [1])
7176e3a38431SPaul Bohm_LT_TAGDECL([], [predeps], [1])
7177e3a38431SPaul Bohm_LT_TAGDECL([], [postdeps], [1])
7178e3a38431SPaul Bohm_LT_TAGDECL([], [compiler_lib_search_path], [1],
7179e3a38431SPaul Bohm    [The library search path used internally by the compiler when linking
7180e3a38431SPaul Bohm    a shared library])
7181e3a38431SPaul Bohm])# _LT_SYS_HIDDEN_LIBDEPS
7182e3a38431SPaul Bohm
7183e3a38431SPaul Bohm
7184e3a38431SPaul Bohm# _LT_LANG_F77_CONFIG([TAG])
7185e3a38431SPaul Bohm# --------------------------
7186e3a38431SPaul Bohm# Ensure that the configuration variables for a Fortran 77 compiler are
7187e3a38431SPaul Bohm# suitably defined.  These variables are subsequently used by _LT_CONFIG
7188e3a38431SPaul Bohm# to write the compiler configuration to `libtool'.
7189e3a38431SPaul Bohmm4_defun([_LT_LANG_F77_CONFIG],
7190*93823e6cSPaul Bohm[AC_LANG_PUSH(Fortran 77)
7191*93823e6cSPaul Bohmif test -z "$F77" || test "X$F77" = "Xno"; then
7192*93823e6cSPaul Bohm  _lt_disable_F77=yes
7193*93823e6cSPaul Bohmfi
7194e3a38431SPaul Bohm
7195e3a38431SPaul Bohm_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7196e3a38431SPaul Bohm_LT_TAGVAR(allow_undefined_flag, $1)=
7197e3a38431SPaul Bohm_LT_TAGVAR(always_export_symbols, $1)=no
7198e3a38431SPaul Bohm_LT_TAGVAR(archive_expsym_cmds, $1)=
7199e3a38431SPaul Bohm_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7200e3a38431SPaul Bohm_LT_TAGVAR(hardcode_direct, $1)=no
7201e3a38431SPaul Bohm_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7202e3a38431SPaul Bohm_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7203e3a38431SPaul Bohm_LT_TAGVAR(hardcode_libdir_separator, $1)=
7204e3a38431SPaul Bohm_LT_TAGVAR(hardcode_minus_L, $1)=no
7205e3a38431SPaul Bohm_LT_TAGVAR(hardcode_automatic, $1)=no
7206e3a38431SPaul Bohm_LT_TAGVAR(inherit_rpath, $1)=no
7207e3a38431SPaul Bohm_LT_TAGVAR(module_cmds, $1)=
7208e3a38431SPaul Bohm_LT_TAGVAR(module_expsym_cmds, $1)=
7209e3a38431SPaul Bohm_LT_TAGVAR(link_all_deplibs, $1)=unknown
7210e3a38431SPaul Bohm_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7211*93823e6cSPaul Bohm_LT_TAGVAR(reload_flag, $1)=$reload_flag
7212*93823e6cSPaul Bohm_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7213e3a38431SPaul Bohm_LT_TAGVAR(no_undefined_flag, $1)=
7214e3a38431SPaul Bohm_LT_TAGVAR(whole_archive_flag_spec, $1)=
7215e3a38431SPaul Bohm_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7216e3a38431SPaul Bohm
7217e3a38431SPaul Bohm# Source file extension for f77 test sources.
7218e3a38431SPaul Bohmac_ext=f
7219e3a38431SPaul Bohm
7220e3a38431SPaul Bohm# Object file extension for compiled f77 test sources.
7221e3a38431SPaul Bohmobjext=o
7222e3a38431SPaul Bohm_LT_TAGVAR(objext, $1)=$objext
7223e3a38431SPaul Bohm
7224e3a38431SPaul Bohm# No sense in running all these tests if we already determined that
7225e3a38431SPaul Bohm# the F77 compiler isn't working.  Some variables (like enable_shared)
7226e3a38431SPaul Bohm# are currently assumed to apply to all compilers on this platform,
7227e3a38431SPaul Bohm# and will be corrupted by setting them based on a non-working compiler.
7228e3a38431SPaul Bohmif test "$_lt_disable_F77" != yes; then
7229e3a38431SPaul Bohm  # Code to be used in simple compile tests
7230e3a38431SPaul Bohm  lt_simple_compile_test_code="\
7231e3a38431SPaul Bohm      subroutine t
7232e3a38431SPaul Bohm      return
7233e3a38431SPaul Bohm      end
7234e3a38431SPaul Bohm"
7235e3a38431SPaul Bohm
7236e3a38431SPaul Bohm  # Code to be used in simple link tests
7237e3a38431SPaul Bohm  lt_simple_link_test_code="\
7238e3a38431SPaul Bohm      program t
7239e3a38431SPaul Bohm      end
7240e3a38431SPaul Bohm"
7241e3a38431SPaul Bohm
7242e3a38431SPaul Bohm  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7243e3a38431SPaul Bohm  _LT_TAG_COMPILER
7244e3a38431SPaul Bohm
7245e3a38431SPaul Bohm  # save warnings/boilerplate of simple test code
7246e3a38431SPaul Bohm  _LT_COMPILER_BOILERPLATE
7247e3a38431SPaul Bohm  _LT_LINKER_BOILERPLATE
7248e3a38431SPaul Bohm
7249e3a38431SPaul Bohm  # Allow CC to be a program name with arguments.
7250e3a38431SPaul Bohm  lt_save_CC="$CC"
7251e3a38431SPaul Bohm  lt_save_GCC=$GCC
7252*93823e6cSPaul Bohm  lt_save_CFLAGS=$CFLAGS
7253e3a38431SPaul Bohm  CC=${F77-"f77"}
7254*93823e6cSPaul Bohm  CFLAGS=$FFLAGS
7255e3a38431SPaul Bohm  compiler=$CC
7256e3a38431SPaul Bohm  _LT_TAGVAR(compiler, $1)=$CC
7257e3a38431SPaul Bohm  _LT_CC_BASENAME([$compiler])
7258e3a38431SPaul Bohm  GCC=$G77
7259e3a38431SPaul Bohm  if test -n "$compiler"; then
7260e3a38431SPaul Bohm    AC_MSG_CHECKING([if libtool supports shared libraries])
7261e3a38431SPaul Bohm    AC_MSG_RESULT([$can_build_shared])
7262e3a38431SPaul Bohm
7263e3a38431SPaul Bohm    AC_MSG_CHECKING([whether to build shared libraries])
7264e3a38431SPaul Bohm    test "$can_build_shared" = "no" && enable_shared=no
7265e3a38431SPaul Bohm
7266e3a38431SPaul Bohm    # On AIX, shared libraries and static libraries use the same namespace, and
7267e3a38431SPaul Bohm    # are all built from PIC.
7268e3a38431SPaul Bohm    case $host_os in
7269e3a38431SPaul Bohm      aix3*)
7270e3a38431SPaul Bohm        test "$enable_shared" = yes && enable_static=no
7271e3a38431SPaul Bohm        if test -n "$RANLIB"; then
7272e3a38431SPaul Bohm          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7273e3a38431SPaul Bohm          postinstall_cmds='$RANLIB $lib'
7274e3a38431SPaul Bohm        fi
7275e3a38431SPaul Bohm        ;;
7276e3a38431SPaul Bohm      aix[[4-9]]*)
7277e3a38431SPaul Bohm	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7278e3a38431SPaul Bohm	  test "$enable_shared" = yes && enable_static=no
7279e3a38431SPaul Bohm	fi
7280e3a38431SPaul Bohm        ;;
7281e3a38431SPaul Bohm    esac
7282e3a38431SPaul Bohm    AC_MSG_RESULT([$enable_shared])
7283e3a38431SPaul Bohm
7284e3a38431SPaul Bohm    AC_MSG_CHECKING([whether to build static libraries])
7285e3a38431SPaul Bohm    # Make sure either enable_shared or enable_static is yes.
7286e3a38431SPaul Bohm    test "$enable_shared" = yes || enable_static=yes
7287e3a38431SPaul Bohm    AC_MSG_RESULT([$enable_static])
7288e3a38431SPaul Bohm
7289e3a38431SPaul Bohm    _LT_TAGVAR(GCC, $1)="$G77"
7290e3a38431SPaul Bohm    _LT_TAGVAR(LD, $1)="$LD"
7291e3a38431SPaul Bohm
7292e3a38431SPaul Bohm    ## CAVEAT EMPTOR:
7293e3a38431SPaul Bohm    ## There is no encapsulation within the following macros, do not change
7294e3a38431SPaul Bohm    ## the running order or otherwise move them around unless you know exactly
7295e3a38431SPaul Bohm    ## what you are doing...
7296e3a38431SPaul Bohm    _LT_COMPILER_PIC($1)
7297e3a38431SPaul Bohm    _LT_COMPILER_C_O($1)
7298e3a38431SPaul Bohm    _LT_COMPILER_FILE_LOCKS($1)
7299e3a38431SPaul Bohm    _LT_LINKER_SHLIBS($1)
7300e3a38431SPaul Bohm    _LT_SYS_DYNAMIC_LINKER($1)
7301e3a38431SPaul Bohm    _LT_LINKER_HARDCODE_LIBPATH($1)
7302e3a38431SPaul Bohm
7303e3a38431SPaul Bohm    _LT_CONFIG($1)
7304e3a38431SPaul Bohm  fi # test -n "$compiler"
7305e3a38431SPaul Bohm
7306e3a38431SPaul Bohm  GCC=$lt_save_GCC
7307e3a38431SPaul Bohm  CC="$lt_save_CC"
7308*93823e6cSPaul Bohm  CFLAGS="$lt_save_CFLAGS"
7309e3a38431SPaul Bohmfi # test "$_lt_disable_F77" != yes
7310e3a38431SPaul Bohm
7311e3a38431SPaul BohmAC_LANG_POP
7312e3a38431SPaul Bohm])# _LT_LANG_F77_CONFIG
7313e3a38431SPaul Bohm
7314e3a38431SPaul Bohm
7315e3a38431SPaul Bohm# _LT_LANG_FC_CONFIG([TAG])
7316e3a38431SPaul Bohm# -------------------------
7317e3a38431SPaul Bohm# Ensure that the configuration variables for a Fortran compiler are
7318e3a38431SPaul Bohm# suitably defined.  These variables are subsequently used by _LT_CONFIG
7319e3a38431SPaul Bohm# to write the compiler configuration to `libtool'.
7320e3a38431SPaul Bohmm4_defun([_LT_LANG_FC_CONFIG],
7321*93823e6cSPaul Bohm[AC_LANG_PUSH(Fortran)
7322*93823e6cSPaul Bohm
7323*93823e6cSPaul Bohmif test -z "$FC" || test "X$FC" = "Xno"; then
7324*93823e6cSPaul Bohm  _lt_disable_FC=yes
7325*93823e6cSPaul Bohmfi
7326e3a38431SPaul Bohm
7327e3a38431SPaul Bohm_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7328e3a38431SPaul Bohm_LT_TAGVAR(allow_undefined_flag, $1)=
7329e3a38431SPaul Bohm_LT_TAGVAR(always_export_symbols, $1)=no
7330e3a38431SPaul Bohm_LT_TAGVAR(archive_expsym_cmds, $1)=
7331e3a38431SPaul Bohm_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7332e3a38431SPaul Bohm_LT_TAGVAR(hardcode_direct, $1)=no
7333e3a38431SPaul Bohm_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7334e3a38431SPaul Bohm_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7335e3a38431SPaul Bohm_LT_TAGVAR(hardcode_libdir_separator, $1)=
7336e3a38431SPaul Bohm_LT_TAGVAR(hardcode_minus_L, $1)=no
7337e3a38431SPaul Bohm_LT_TAGVAR(hardcode_automatic, $1)=no
7338e3a38431SPaul Bohm_LT_TAGVAR(inherit_rpath, $1)=no
7339e3a38431SPaul Bohm_LT_TAGVAR(module_cmds, $1)=
7340e3a38431SPaul Bohm_LT_TAGVAR(module_expsym_cmds, $1)=
7341e3a38431SPaul Bohm_LT_TAGVAR(link_all_deplibs, $1)=unknown
7342e3a38431SPaul Bohm_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7343*93823e6cSPaul Bohm_LT_TAGVAR(reload_flag, $1)=$reload_flag
7344*93823e6cSPaul Bohm_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7345e3a38431SPaul Bohm_LT_TAGVAR(no_undefined_flag, $1)=
7346e3a38431SPaul Bohm_LT_TAGVAR(whole_archive_flag_spec, $1)=
7347e3a38431SPaul Bohm_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7348e3a38431SPaul Bohm
7349e3a38431SPaul Bohm# Source file extension for fc test sources.
7350e3a38431SPaul Bohmac_ext=${ac_fc_srcext-f}
7351e3a38431SPaul Bohm
7352e3a38431SPaul Bohm# Object file extension for compiled fc test sources.
7353e3a38431SPaul Bohmobjext=o
7354e3a38431SPaul Bohm_LT_TAGVAR(objext, $1)=$objext
7355e3a38431SPaul Bohm
7356e3a38431SPaul Bohm# No sense in running all these tests if we already determined that
7357e3a38431SPaul Bohm# the FC compiler isn't working.  Some variables (like enable_shared)
7358e3a38431SPaul Bohm# are currently assumed to apply to all compilers on this platform,
7359e3a38431SPaul Bohm# and will be corrupted by setting them based on a non-working compiler.
7360e3a38431SPaul Bohmif test "$_lt_disable_FC" != yes; then
7361e3a38431SPaul Bohm  # Code to be used in simple compile tests
7362e3a38431SPaul Bohm  lt_simple_compile_test_code="\
7363e3a38431SPaul Bohm      subroutine t
7364e3a38431SPaul Bohm      return
7365e3a38431SPaul Bohm      end
7366e3a38431SPaul Bohm"
7367e3a38431SPaul Bohm
7368e3a38431SPaul Bohm  # Code to be used in simple link tests
7369e3a38431SPaul Bohm  lt_simple_link_test_code="\
7370e3a38431SPaul Bohm      program t
7371e3a38431SPaul Bohm      end
7372e3a38431SPaul Bohm"
7373e3a38431SPaul Bohm
7374e3a38431SPaul Bohm  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7375e3a38431SPaul Bohm  _LT_TAG_COMPILER
7376e3a38431SPaul Bohm
7377e3a38431SPaul Bohm  # save warnings/boilerplate of simple test code
7378e3a38431SPaul Bohm  _LT_COMPILER_BOILERPLATE
7379e3a38431SPaul Bohm  _LT_LINKER_BOILERPLATE
7380e3a38431SPaul Bohm
7381e3a38431SPaul Bohm  # Allow CC to be a program name with arguments.
7382e3a38431SPaul Bohm  lt_save_CC="$CC"
7383e3a38431SPaul Bohm  lt_save_GCC=$GCC
7384*93823e6cSPaul Bohm  lt_save_CFLAGS=$CFLAGS
7385e3a38431SPaul Bohm  CC=${FC-"f95"}
7386*93823e6cSPaul Bohm  CFLAGS=$FCFLAGS
7387e3a38431SPaul Bohm  compiler=$CC
7388e3a38431SPaul Bohm  GCC=$ac_cv_fc_compiler_gnu
7389e3a38431SPaul Bohm
7390e3a38431SPaul Bohm  _LT_TAGVAR(compiler, $1)=$CC
7391e3a38431SPaul Bohm  _LT_CC_BASENAME([$compiler])
7392e3a38431SPaul Bohm
7393e3a38431SPaul Bohm  if test -n "$compiler"; then
7394e3a38431SPaul Bohm    AC_MSG_CHECKING([if libtool supports shared libraries])
7395e3a38431SPaul Bohm    AC_MSG_RESULT([$can_build_shared])
7396e3a38431SPaul Bohm
7397e3a38431SPaul Bohm    AC_MSG_CHECKING([whether to build shared libraries])
7398e3a38431SPaul Bohm    test "$can_build_shared" = "no" && enable_shared=no
7399e3a38431SPaul Bohm
7400e3a38431SPaul Bohm    # On AIX, shared libraries and static libraries use the same namespace, and
7401e3a38431SPaul Bohm    # are all built from PIC.
7402e3a38431SPaul Bohm    case $host_os in
7403e3a38431SPaul Bohm      aix3*)
7404e3a38431SPaul Bohm        test "$enable_shared" = yes && enable_static=no
7405e3a38431SPaul Bohm        if test -n "$RANLIB"; then
7406e3a38431SPaul Bohm          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7407e3a38431SPaul Bohm          postinstall_cmds='$RANLIB $lib'
7408e3a38431SPaul Bohm        fi
7409e3a38431SPaul Bohm        ;;
7410e3a38431SPaul Bohm      aix[[4-9]]*)
7411e3a38431SPaul Bohm	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7412e3a38431SPaul Bohm	  test "$enable_shared" = yes && enable_static=no
7413e3a38431SPaul Bohm	fi
7414e3a38431SPaul Bohm        ;;
7415e3a38431SPaul Bohm    esac
7416e3a38431SPaul Bohm    AC_MSG_RESULT([$enable_shared])
7417e3a38431SPaul Bohm
7418e3a38431SPaul Bohm    AC_MSG_CHECKING([whether to build static libraries])
7419e3a38431SPaul Bohm    # Make sure either enable_shared or enable_static is yes.
7420e3a38431SPaul Bohm    test "$enable_shared" = yes || enable_static=yes
7421e3a38431SPaul Bohm    AC_MSG_RESULT([$enable_static])
7422e3a38431SPaul Bohm
7423e3a38431SPaul Bohm    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7424e3a38431SPaul Bohm    _LT_TAGVAR(LD, $1)="$LD"
7425e3a38431SPaul Bohm
7426e3a38431SPaul Bohm    ## CAVEAT EMPTOR:
7427e3a38431SPaul Bohm    ## There is no encapsulation within the following macros, do not change
7428e3a38431SPaul Bohm    ## the running order or otherwise move them around unless you know exactly
7429e3a38431SPaul Bohm    ## what you are doing...
7430e3a38431SPaul Bohm    _LT_SYS_HIDDEN_LIBDEPS($1)
7431e3a38431SPaul Bohm    _LT_COMPILER_PIC($1)
7432e3a38431SPaul Bohm    _LT_COMPILER_C_O($1)
7433e3a38431SPaul Bohm    _LT_COMPILER_FILE_LOCKS($1)
7434e3a38431SPaul Bohm    _LT_LINKER_SHLIBS($1)
7435e3a38431SPaul Bohm    _LT_SYS_DYNAMIC_LINKER($1)
7436e3a38431SPaul Bohm    _LT_LINKER_HARDCODE_LIBPATH($1)
7437e3a38431SPaul Bohm
7438e3a38431SPaul Bohm    _LT_CONFIG($1)
7439e3a38431SPaul Bohm  fi # test -n "$compiler"
7440e3a38431SPaul Bohm
7441e3a38431SPaul Bohm  GCC=$lt_save_GCC
7442*93823e6cSPaul Bohm  CC=$lt_save_CC
7443*93823e6cSPaul Bohm  CFLAGS=$lt_save_CFLAGS
7444e3a38431SPaul Bohmfi # test "$_lt_disable_FC" != yes
7445e3a38431SPaul Bohm
7446e3a38431SPaul BohmAC_LANG_POP
7447e3a38431SPaul Bohm])# _LT_LANG_FC_CONFIG
7448e3a38431SPaul Bohm
7449e3a38431SPaul Bohm
7450e3a38431SPaul Bohm# _LT_LANG_GCJ_CONFIG([TAG])
7451e3a38431SPaul Bohm# --------------------------
7452e3a38431SPaul Bohm# Ensure that the configuration variables for the GNU Java Compiler compiler
7453e3a38431SPaul Bohm# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7454e3a38431SPaul Bohm# to write the compiler configuration to `libtool'.
7455e3a38431SPaul Bohmm4_defun([_LT_LANG_GCJ_CONFIG],
7456e3a38431SPaul Bohm[AC_REQUIRE([LT_PROG_GCJ])dnl
7457e3a38431SPaul BohmAC_LANG_SAVE
7458e3a38431SPaul Bohm
7459e3a38431SPaul Bohm# Source file extension for Java test sources.
7460e3a38431SPaul Bohmac_ext=java
7461e3a38431SPaul Bohm
7462e3a38431SPaul Bohm# Object file extension for compiled Java test sources.
7463e3a38431SPaul Bohmobjext=o
7464e3a38431SPaul Bohm_LT_TAGVAR(objext, $1)=$objext
7465e3a38431SPaul Bohm
7466e3a38431SPaul Bohm# Code to be used in simple compile tests
7467e3a38431SPaul Bohmlt_simple_compile_test_code="class foo {}"
7468e3a38431SPaul Bohm
7469e3a38431SPaul Bohm# Code to be used in simple link tests
7470e3a38431SPaul Bohmlt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7471e3a38431SPaul Bohm
7472e3a38431SPaul Bohm# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7473e3a38431SPaul Bohm_LT_TAG_COMPILER
7474e3a38431SPaul Bohm
7475e3a38431SPaul Bohm# save warnings/boilerplate of simple test code
7476e3a38431SPaul Bohm_LT_COMPILER_BOILERPLATE
7477e3a38431SPaul Bohm_LT_LINKER_BOILERPLATE
7478e3a38431SPaul Bohm
7479e3a38431SPaul Bohm# Allow CC to be a program name with arguments.
7480*93823e6cSPaul Bohmlt_save_CC=$CC
7481*93823e6cSPaul Bohmlt_save_CFLAGS=$CFLAGS
7482e3a38431SPaul Bohmlt_save_GCC=$GCC
7483e3a38431SPaul BohmGCC=yes
7484e3a38431SPaul BohmCC=${GCJ-"gcj"}
7485*93823e6cSPaul BohmCFLAGS=$GCJFLAGS
7486e3a38431SPaul Bohmcompiler=$CC
7487e3a38431SPaul Bohm_LT_TAGVAR(compiler, $1)=$CC
7488e3a38431SPaul Bohm_LT_TAGVAR(LD, $1)="$LD"
7489e3a38431SPaul Bohm_LT_CC_BASENAME([$compiler])
7490e3a38431SPaul Bohm
7491e3a38431SPaul Bohm# GCJ did not exist at the time GCC didn't implicitly link libc in.
7492e3a38431SPaul Bohm_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7493e3a38431SPaul Bohm
7494e3a38431SPaul Bohm_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7495*93823e6cSPaul Bohm_LT_TAGVAR(reload_flag, $1)=$reload_flag
7496*93823e6cSPaul Bohm_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7497e3a38431SPaul Bohm
7498e3a38431SPaul Bohmif test -n "$compiler"; then
7499e3a38431SPaul Bohm  _LT_COMPILER_NO_RTTI($1)
7500e3a38431SPaul Bohm  _LT_COMPILER_PIC($1)
7501e3a38431SPaul Bohm  _LT_COMPILER_C_O($1)
7502e3a38431SPaul Bohm  _LT_COMPILER_FILE_LOCKS($1)
7503e3a38431SPaul Bohm  _LT_LINKER_SHLIBS($1)
7504e3a38431SPaul Bohm  _LT_LINKER_HARDCODE_LIBPATH($1)
7505e3a38431SPaul Bohm
7506e3a38431SPaul Bohm  _LT_CONFIG($1)
7507e3a38431SPaul Bohmfi
7508e3a38431SPaul Bohm
7509e3a38431SPaul BohmAC_LANG_RESTORE
7510e3a38431SPaul Bohm
7511e3a38431SPaul BohmGCC=$lt_save_GCC
7512*93823e6cSPaul BohmCC=$lt_save_CC
7513*93823e6cSPaul BohmCFLAGS=$lt_save_CFLAGS
7514e3a38431SPaul Bohm])# _LT_LANG_GCJ_CONFIG
7515e3a38431SPaul Bohm
7516e3a38431SPaul Bohm
7517*93823e6cSPaul Bohm# _LT_LANG_GO_CONFIG([TAG])
7518*93823e6cSPaul Bohm# --------------------------
7519*93823e6cSPaul Bohm# Ensure that the configuration variables for the GNU Go compiler
7520*93823e6cSPaul Bohm# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7521*93823e6cSPaul Bohm# to write the compiler configuration to `libtool'.
7522*93823e6cSPaul Bohmm4_defun([_LT_LANG_GO_CONFIG],
7523*93823e6cSPaul Bohm[AC_REQUIRE([LT_PROG_GO])dnl
7524*93823e6cSPaul BohmAC_LANG_SAVE
7525*93823e6cSPaul Bohm
7526*93823e6cSPaul Bohm# Source file extension for Go test sources.
7527*93823e6cSPaul Bohmac_ext=go
7528*93823e6cSPaul Bohm
7529*93823e6cSPaul Bohm# Object file extension for compiled Go test sources.
7530*93823e6cSPaul Bohmobjext=o
7531*93823e6cSPaul Bohm_LT_TAGVAR(objext, $1)=$objext
7532*93823e6cSPaul Bohm
7533*93823e6cSPaul Bohm# Code to be used in simple compile tests
7534*93823e6cSPaul Bohmlt_simple_compile_test_code="package main; func main() { }"
7535*93823e6cSPaul Bohm
7536*93823e6cSPaul Bohm# Code to be used in simple link tests
7537*93823e6cSPaul Bohmlt_simple_link_test_code='package main; func main() { }'
7538*93823e6cSPaul Bohm
7539*93823e6cSPaul Bohm# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7540*93823e6cSPaul Bohm_LT_TAG_COMPILER
7541*93823e6cSPaul Bohm
7542*93823e6cSPaul Bohm# save warnings/boilerplate of simple test code
7543*93823e6cSPaul Bohm_LT_COMPILER_BOILERPLATE
7544*93823e6cSPaul Bohm_LT_LINKER_BOILERPLATE
7545*93823e6cSPaul Bohm
7546*93823e6cSPaul Bohm# Allow CC to be a program name with arguments.
7547*93823e6cSPaul Bohmlt_save_CC=$CC
7548*93823e6cSPaul Bohmlt_save_CFLAGS=$CFLAGS
7549*93823e6cSPaul Bohmlt_save_GCC=$GCC
7550*93823e6cSPaul BohmGCC=yes
7551*93823e6cSPaul BohmCC=${GOC-"gccgo"}
7552*93823e6cSPaul BohmCFLAGS=$GOFLAGS
7553*93823e6cSPaul Bohmcompiler=$CC
7554*93823e6cSPaul Bohm_LT_TAGVAR(compiler, $1)=$CC
7555*93823e6cSPaul Bohm_LT_TAGVAR(LD, $1)="$LD"
7556*93823e6cSPaul Bohm_LT_CC_BASENAME([$compiler])
7557*93823e6cSPaul Bohm
7558*93823e6cSPaul Bohm# Go did not exist at the time GCC didn't implicitly link libc in.
7559*93823e6cSPaul Bohm_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7560*93823e6cSPaul Bohm
7561*93823e6cSPaul Bohm_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7562*93823e6cSPaul Bohm_LT_TAGVAR(reload_flag, $1)=$reload_flag
7563*93823e6cSPaul Bohm_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7564*93823e6cSPaul Bohm
7565*93823e6cSPaul Bohmif test -n "$compiler"; then
7566*93823e6cSPaul Bohm  _LT_COMPILER_NO_RTTI($1)
7567*93823e6cSPaul Bohm  _LT_COMPILER_PIC($1)
7568*93823e6cSPaul Bohm  _LT_COMPILER_C_O($1)
7569*93823e6cSPaul Bohm  _LT_COMPILER_FILE_LOCKS($1)
7570*93823e6cSPaul Bohm  _LT_LINKER_SHLIBS($1)
7571*93823e6cSPaul Bohm  _LT_LINKER_HARDCODE_LIBPATH($1)
7572*93823e6cSPaul Bohm
7573*93823e6cSPaul Bohm  _LT_CONFIG($1)
7574*93823e6cSPaul Bohmfi
7575*93823e6cSPaul Bohm
7576*93823e6cSPaul BohmAC_LANG_RESTORE
7577*93823e6cSPaul Bohm
7578*93823e6cSPaul BohmGCC=$lt_save_GCC
7579*93823e6cSPaul BohmCC=$lt_save_CC
7580*93823e6cSPaul BohmCFLAGS=$lt_save_CFLAGS
7581*93823e6cSPaul Bohm])# _LT_LANG_GO_CONFIG
7582*93823e6cSPaul Bohm
7583*93823e6cSPaul Bohm
7584e3a38431SPaul Bohm# _LT_LANG_RC_CONFIG([TAG])
7585e3a38431SPaul Bohm# -------------------------
7586e3a38431SPaul Bohm# Ensure that the configuration variables for the Windows resource compiler
7587e3a38431SPaul Bohm# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7588e3a38431SPaul Bohm# to write the compiler configuration to `libtool'.
7589e3a38431SPaul Bohmm4_defun([_LT_LANG_RC_CONFIG],
7590e3a38431SPaul Bohm[AC_REQUIRE([LT_PROG_RC])dnl
7591e3a38431SPaul BohmAC_LANG_SAVE
7592e3a38431SPaul Bohm
7593e3a38431SPaul Bohm# Source file extension for RC test sources.
7594e3a38431SPaul Bohmac_ext=rc
7595e3a38431SPaul Bohm
7596e3a38431SPaul Bohm# Object file extension for compiled RC test sources.
7597e3a38431SPaul Bohmobjext=o
7598e3a38431SPaul Bohm_LT_TAGVAR(objext, $1)=$objext
7599e3a38431SPaul Bohm
7600e3a38431SPaul Bohm# Code to be used in simple compile tests
7601e3a38431SPaul Bohmlt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7602e3a38431SPaul Bohm
7603e3a38431SPaul Bohm# Code to be used in simple link tests
7604e3a38431SPaul Bohmlt_simple_link_test_code="$lt_simple_compile_test_code"
7605e3a38431SPaul Bohm
7606e3a38431SPaul Bohm# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7607e3a38431SPaul Bohm_LT_TAG_COMPILER
7608e3a38431SPaul Bohm
7609e3a38431SPaul Bohm# save warnings/boilerplate of simple test code
7610e3a38431SPaul Bohm_LT_COMPILER_BOILERPLATE
7611e3a38431SPaul Bohm_LT_LINKER_BOILERPLATE
7612e3a38431SPaul Bohm
7613e3a38431SPaul Bohm# Allow CC to be a program name with arguments.
7614e3a38431SPaul Bohmlt_save_CC="$CC"
7615*93823e6cSPaul Bohmlt_save_CFLAGS=$CFLAGS
7616e3a38431SPaul Bohmlt_save_GCC=$GCC
7617e3a38431SPaul BohmGCC=
7618e3a38431SPaul BohmCC=${RC-"windres"}
7619*93823e6cSPaul BohmCFLAGS=
7620e3a38431SPaul Bohmcompiler=$CC
7621e3a38431SPaul Bohm_LT_TAGVAR(compiler, $1)=$CC
7622e3a38431SPaul Bohm_LT_CC_BASENAME([$compiler])
7623e3a38431SPaul Bohm_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7624e3a38431SPaul Bohm
7625e3a38431SPaul Bohmif test -n "$compiler"; then
7626e3a38431SPaul Bohm  :
7627e3a38431SPaul Bohm  _LT_CONFIG($1)
7628e3a38431SPaul Bohmfi
7629e3a38431SPaul Bohm
7630e3a38431SPaul BohmGCC=$lt_save_GCC
7631e3a38431SPaul BohmAC_LANG_RESTORE
7632*93823e6cSPaul BohmCC=$lt_save_CC
7633*93823e6cSPaul BohmCFLAGS=$lt_save_CFLAGS
7634e3a38431SPaul Bohm])# _LT_LANG_RC_CONFIG
7635e3a38431SPaul Bohm
7636e3a38431SPaul Bohm
7637e3a38431SPaul Bohm# LT_PROG_GCJ
7638e3a38431SPaul Bohm# -----------
7639e3a38431SPaul BohmAC_DEFUN([LT_PROG_GCJ],
7640e3a38431SPaul Bohm[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7641e3a38431SPaul Bohm  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7642e3a38431SPaul Bohm    [AC_CHECK_TOOL(GCJ, gcj,)
7643e3a38431SPaul Bohm      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7644e3a38431SPaul Bohm      AC_SUBST(GCJFLAGS)])])[]dnl
7645e3a38431SPaul Bohm])
7646e3a38431SPaul Bohm
7647e3a38431SPaul Bohm# Old name:
7648e3a38431SPaul BohmAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7649e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
7650e3a38431SPaul Bohmdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7651e3a38431SPaul Bohm
7652e3a38431SPaul Bohm
7653*93823e6cSPaul Bohm# LT_PROG_GO
7654*93823e6cSPaul Bohm# ----------
7655*93823e6cSPaul BohmAC_DEFUN([LT_PROG_GO],
7656*93823e6cSPaul Bohm[AC_CHECK_TOOL(GOC, gccgo,)
7657*93823e6cSPaul Bohm])
7658*93823e6cSPaul Bohm
7659*93823e6cSPaul Bohm
7660e3a38431SPaul Bohm# LT_PROG_RC
7661e3a38431SPaul Bohm# ----------
7662e3a38431SPaul BohmAC_DEFUN([LT_PROG_RC],
7663e3a38431SPaul Bohm[AC_CHECK_TOOL(RC, windres,)
7664e3a38431SPaul Bohm])
7665e3a38431SPaul Bohm
7666e3a38431SPaul Bohm# Old name:
7667e3a38431SPaul BohmAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7668e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
7669e3a38431SPaul Bohmdnl AC_DEFUN([LT_AC_PROG_RC], [])
7670e3a38431SPaul Bohm
7671e3a38431SPaul Bohm
7672e3a38431SPaul Bohm# _LT_DECL_EGREP
7673e3a38431SPaul Bohm# --------------
7674e3a38431SPaul Bohm# If we don't have a new enough Autoconf to choose the best grep
7675e3a38431SPaul Bohm# available, choose the one first in the user's PATH.
7676e3a38431SPaul Bohmm4_defun([_LT_DECL_EGREP],
7677e3a38431SPaul Bohm[AC_REQUIRE([AC_PROG_EGREP])dnl
7678e3a38431SPaul BohmAC_REQUIRE([AC_PROG_FGREP])dnl
7679e3a38431SPaul Bohmtest -z "$GREP" && GREP=grep
7680e3a38431SPaul Bohm_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7681e3a38431SPaul Bohm_LT_DECL([], [EGREP], [1], [An ERE matcher])
7682e3a38431SPaul Bohm_LT_DECL([], [FGREP], [1], [A literal string matcher])
7683e3a38431SPaul Bohmdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7684e3a38431SPaul BohmAC_SUBST([GREP])
7685e3a38431SPaul Bohm])
7686e3a38431SPaul Bohm
7687e3a38431SPaul Bohm
7688e3a38431SPaul Bohm# _LT_DECL_OBJDUMP
7689e3a38431SPaul Bohm# --------------
7690e3a38431SPaul Bohm# If we don't have a new enough Autoconf to choose the best objdump
7691e3a38431SPaul Bohm# available, choose the one first in the user's PATH.
7692e3a38431SPaul Bohmm4_defun([_LT_DECL_OBJDUMP],
7693e3a38431SPaul Bohm[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7694e3a38431SPaul Bohmtest -z "$OBJDUMP" && OBJDUMP=objdump
7695e3a38431SPaul Bohm_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7696e3a38431SPaul BohmAC_SUBST([OBJDUMP])
7697e3a38431SPaul Bohm])
7698e3a38431SPaul Bohm
7699*93823e6cSPaul Bohm# _LT_DECL_DLLTOOL
7700*93823e6cSPaul Bohm# ----------------
7701*93823e6cSPaul Bohm# Ensure DLLTOOL variable is set.
7702*93823e6cSPaul Bohmm4_defun([_LT_DECL_DLLTOOL],
7703*93823e6cSPaul Bohm[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7704*93823e6cSPaul Bohmtest -z "$DLLTOOL" && DLLTOOL=dlltool
7705*93823e6cSPaul Bohm_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7706*93823e6cSPaul BohmAC_SUBST([DLLTOOL])
7707*93823e6cSPaul Bohm])
7708e3a38431SPaul Bohm
7709e3a38431SPaul Bohm# _LT_DECL_SED
7710e3a38431SPaul Bohm# ------------
7711e3a38431SPaul Bohm# Check for a fully-functional sed program, that truncates
7712e3a38431SPaul Bohm# as few characters as possible.  Prefer GNU sed if found.
7713e3a38431SPaul Bohmm4_defun([_LT_DECL_SED],
7714e3a38431SPaul Bohm[AC_PROG_SED
7715e3a38431SPaul Bohmtest -z "$SED" && SED=sed
7716e3a38431SPaul BohmXsed="$SED -e 1s/^X//"
7717e3a38431SPaul Bohm_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7718e3a38431SPaul Bohm_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7719e3a38431SPaul Bohm    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7720e3a38431SPaul Bohm])# _LT_DECL_SED
7721e3a38431SPaul Bohm
7722e3a38431SPaul Bohmm4_ifndef([AC_PROG_SED], [
7723e3a38431SPaul Bohm# NOTE: This macro has been submitted for inclusion into   #
7724e3a38431SPaul Bohm#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7725e3a38431SPaul Bohm#  a released version of Autoconf we should remove this    #
7726e3a38431SPaul Bohm#  macro and use it instead.                               #
7727e3a38431SPaul Bohm
7728e3a38431SPaul Bohmm4_defun([AC_PROG_SED],
7729e3a38431SPaul Bohm[AC_MSG_CHECKING([for a sed that does not truncate output])
7730e3a38431SPaul BohmAC_CACHE_VAL(lt_cv_path_SED,
7731e3a38431SPaul Bohm[# Loop through the user's path and test for sed and gsed.
7732e3a38431SPaul Bohm# Then use that list of sed's as ones to test for truncation.
7733e3a38431SPaul Bohmas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7734e3a38431SPaul Bohmfor as_dir in $PATH
7735e3a38431SPaul Bohmdo
7736e3a38431SPaul Bohm  IFS=$as_save_IFS
7737e3a38431SPaul Bohm  test -z "$as_dir" && as_dir=.
7738e3a38431SPaul Bohm  for lt_ac_prog in sed gsed; do
7739e3a38431SPaul Bohm    for ac_exec_ext in '' $ac_executable_extensions; do
7740e3a38431SPaul Bohm      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7741e3a38431SPaul Bohm        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7742e3a38431SPaul Bohm      fi
7743e3a38431SPaul Bohm    done
7744e3a38431SPaul Bohm  done
7745e3a38431SPaul Bohmdone
7746e3a38431SPaul BohmIFS=$as_save_IFS
7747e3a38431SPaul Bohmlt_ac_max=0
7748e3a38431SPaul Bohmlt_ac_count=0
7749e3a38431SPaul Bohm# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7750e3a38431SPaul Bohm# along with /bin/sed that truncates output.
7751e3a38431SPaul Bohmfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7752e3a38431SPaul Bohm  test ! -f $lt_ac_sed && continue
7753e3a38431SPaul Bohm  cat /dev/null > conftest.in
7754e3a38431SPaul Bohm  lt_ac_count=0
7755e3a38431SPaul Bohm  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7756e3a38431SPaul Bohm  # Check for GNU sed and select it if it is found.
7757e3a38431SPaul Bohm  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7758e3a38431SPaul Bohm    lt_cv_path_SED=$lt_ac_sed
7759e3a38431SPaul Bohm    break
7760e3a38431SPaul Bohm  fi
7761e3a38431SPaul Bohm  while true; do
7762e3a38431SPaul Bohm    cat conftest.in conftest.in >conftest.tmp
7763e3a38431SPaul Bohm    mv conftest.tmp conftest.in
7764e3a38431SPaul Bohm    cp conftest.in conftest.nl
7765e3a38431SPaul Bohm    echo >>conftest.nl
7766e3a38431SPaul Bohm    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7767e3a38431SPaul Bohm    cmp -s conftest.out conftest.nl || break
7768e3a38431SPaul Bohm    # 10000 chars as input seems more than enough
7769e3a38431SPaul Bohm    test $lt_ac_count -gt 10 && break
7770e3a38431SPaul Bohm    lt_ac_count=`expr $lt_ac_count + 1`
7771e3a38431SPaul Bohm    if test $lt_ac_count -gt $lt_ac_max; then
7772e3a38431SPaul Bohm      lt_ac_max=$lt_ac_count
7773e3a38431SPaul Bohm      lt_cv_path_SED=$lt_ac_sed
7774e3a38431SPaul Bohm    fi
7775e3a38431SPaul Bohm  done
7776e3a38431SPaul Bohmdone
7777e3a38431SPaul Bohm])
7778e3a38431SPaul BohmSED=$lt_cv_path_SED
7779e3a38431SPaul BohmAC_SUBST([SED])
7780e3a38431SPaul BohmAC_MSG_RESULT([$SED])
7781e3a38431SPaul Bohm])#AC_PROG_SED
7782e3a38431SPaul Bohm])#m4_ifndef
7783e3a38431SPaul Bohm
7784e3a38431SPaul Bohm# Old name:
7785e3a38431SPaul BohmAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7786e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
7787e3a38431SPaul Bohmdnl AC_DEFUN([LT_AC_PROG_SED], [])
7788e3a38431SPaul Bohm
7789e3a38431SPaul Bohm
7790e3a38431SPaul Bohm# _LT_CHECK_SHELL_FEATURES
7791e3a38431SPaul Bohm# ------------------------
7792e3a38431SPaul Bohm# Find out whether the shell is Bourne or XSI compatible,
7793e3a38431SPaul Bohm# or has some other useful features.
7794e3a38431SPaul Bohmm4_defun([_LT_CHECK_SHELL_FEATURES],
7795e3a38431SPaul Bohm[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7796e3a38431SPaul Bohm# Try some XSI features
7797e3a38431SPaul Bohmxsi_shell=no
7798e3a38431SPaul Bohm( _lt_dummy="a/b/c"
7799*93823e6cSPaul Bohm  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7800*93823e6cSPaul Bohm      = c,a/b,b/c, \
7801e3a38431SPaul Bohm    && eval 'test $(( 1 + 1 )) -eq 2 \
7802e3a38431SPaul Bohm    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7803e3a38431SPaul Bohm  && xsi_shell=yes
7804e3a38431SPaul BohmAC_MSG_RESULT([$xsi_shell])
7805e3a38431SPaul Bohm_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7806e3a38431SPaul Bohm
7807e3a38431SPaul BohmAC_MSG_CHECKING([whether the shell understands "+="])
7808e3a38431SPaul Bohmlt_shell_append=no
7809e3a38431SPaul Bohm( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7810e3a38431SPaul Bohm    >/dev/null 2>&1 \
7811e3a38431SPaul Bohm  && lt_shell_append=yes
7812e3a38431SPaul BohmAC_MSG_RESULT([$lt_shell_append])
7813e3a38431SPaul Bohm_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7814e3a38431SPaul Bohm
7815e3a38431SPaul Bohmif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7816e3a38431SPaul Bohm  lt_unset=unset
7817e3a38431SPaul Bohmelse
7818e3a38431SPaul Bohm  lt_unset=false
7819e3a38431SPaul Bohmfi
7820e3a38431SPaul Bohm_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7821e3a38431SPaul Bohm
7822e3a38431SPaul Bohm# test EBCDIC or ASCII
7823e3a38431SPaul Bohmcase `echo X|tr X '\101'` in
7824e3a38431SPaul Bohm A) # ASCII based system
7825e3a38431SPaul Bohm    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7826e3a38431SPaul Bohm  lt_SP2NL='tr \040 \012'
7827e3a38431SPaul Bohm  lt_NL2SP='tr \015\012 \040\040'
7828e3a38431SPaul Bohm  ;;
7829e3a38431SPaul Bohm *) # EBCDIC based system
7830e3a38431SPaul Bohm  lt_SP2NL='tr \100 \n'
7831e3a38431SPaul Bohm  lt_NL2SP='tr \r\n \100\100'
7832e3a38431SPaul Bohm  ;;
7833e3a38431SPaul Bohmesac
7834e3a38431SPaul Bohm_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7835e3a38431SPaul Bohm_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7836e3a38431SPaul Bohm])# _LT_CHECK_SHELL_FEATURES
7837e3a38431SPaul Bohm
7838e3a38431SPaul Bohm
7839*93823e6cSPaul Bohm# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7840*93823e6cSPaul Bohm# ------------------------------------------------------
7841*93823e6cSPaul Bohm# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7842*93823e6cSPaul Bohm# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7843*93823e6cSPaul Bohmm4_defun([_LT_PROG_FUNCTION_REPLACE],
7844*93823e6cSPaul Bohm[dnl {
7845*93823e6cSPaul Bohmsed -e '/^$1 ()$/,/^} # $1 /c\
7846*93823e6cSPaul Bohm$1 ()\
7847*93823e6cSPaul Bohm{\
7848*93823e6cSPaul Bohmm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7849*93823e6cSPaul Bohm} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7850*93823e6cSPaul Bohm  && mv -f "$cfgfile.tmp" "$cfgfile" \
7851*93823e6cSPaul Bohm    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7852*93823e6cSPaul Bohmtest 0 -eq $? || _lt_function_replace_fail=:
7853*93823e6cSPaul Bohm])
7854e3a38431SPaul Bohm
7855*93823e6cSPaul Bohm
7856*93823e6cSPaul Bohm# _LT_PROG_REPLACE_SHELLFNS
7857*93823e6cSPaul Bohm# -------------------------
7858*93823e6cSPaul Bohm# Replace existing portable implementations of several shell functions with
7859*93823e6cSPaul Bohm# equivalent extended shell implementations where those features are available..
7860*93823e6cSPaul Bohmm4_defun([_LT_PROG_REPLACE_SHELLFNS],
7861*93823e6cSPaul Bohm[if test x"$xsi_shell" = xyes; then
7862*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7863*93823e6cSPaul Bohm    case ${1} in
7864*93823e6cSPaul Bohm      */*) func_dirname_result="${1%/*}${2}" ;;
7865*93823e6cSPaul Bohm      *  ) func_dirname_result="${3}" ;;
7866*93823e6cSPaul Bohm    esac])
7867*93823e6cSPaul Bohm
7868*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7869*93823e6cSPaul Bohm    func_basename_result="${1##*/}"])
7870*93823e6cSPaul Bohm
7871*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7872e3a38431SPaul Bohm    case ${1} in
7873e3a38431SPaul Bohm      */*) func_dirname_result="${1%/*}${2}" ;;
7874e3a38431SPaul Bohm      *  ) func_dirname_result="${3}" ;;
7875e3a38431SPaul Bohm    esac
7876*93823e6cSPaul Bohm    func_basename_result="${1##*/}"])
7877e3a38431SPaul Bohm
7878*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7879e3a38431SPaul Bohm    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7880e3a38431SPaul Bohm    # positional parameters, so assign one to ordinary parameter first.
7881e3a38431SPaul Bohm    func_stripname_result=${3}
7882e3a38431SPaul Bohm    func_stripname_result=${func_stripname_result#"${1}"}
7883*93823e6cSPaul Bohm    func_stripname_result=${func_stripname_result%"${2}"}])
7884e3a38431SPaul Bohm
7885*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7886*93823e6cSPaul Bohm    func_split_long_opt_name=${1%%=*}
7887*93823e6cSPaul Bohm    func_split_long_opt_arg=${1#*=}])
7888e3a38431SPaul Bohm
7889*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7890*93823e6cSPaul Bohm    func_split_short_opt_arg=${1#??}
7891*93823e6cSPaul Bohm    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7892*93823e6cSPaul Bohm
7893*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7894e3a38431SPaul Bohm    case ${1} in
7895e3a38431SPaul Bohm      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7896e3a38431SPaul Bohm      *)    func_lo2o_result=${1} ;;
7897*93823e6cSPaul Bohm    esac])
7898e3a38431SPaul Bohm
7899*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7900e3a38431SPaul Bohm
7901*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7902e3a38431SPaul Bohm
7903*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7904e3a38431SPaul Bohmfi
7905e3a38431SPaul Bohm
7906*93823e6cSPaul Bohmif test x"$lt_shell_append" = xyes; then
7907*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7908e3a38431SPaul Bohm
7909*93823e6cSPaul Bohm  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7910*93823e6cSPaul Bohm    func_quote_for_eval "${2}"
7911*93823e6cSPaul Bohmdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7912*93823e6cSPaul Bohm    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7913e3a38431SPaul Bohm
7914*93823e6cSPaul Bohm  # Save a `func_append' function call where possible by direct use of '+='
7915*93823e6cSPaul Bohm  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7916*93823e6cSPaul Bohm    && mv -f "$cfgfile.tmp" "$cfgfile" \
7917*93823e6cSPaul Bohm      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7918*93823e6cSPaul Bohm  test 0 -eq $? || _lt_function_replace_fail=:
7919*93823e6cSPaul Bohmelse
7920*93823e6cSPaul Bohm  # Save a `func_append' function call even when '+=' is not available
7921*93823e6cSPaul Bohm  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7922*93823e6cSPaul Bohm    && mv -f "$cfgfile.tmp" "$cfgfile" \
7923*93823e6cSPaul Bohm      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7924*93823e6cSPaul Bohm  test 0 -eq $? || _lt_function_replace_fail=:
7925*93823e6cSPaul Bohmfi
7926e3a38431SPaul Bohm
7927*93823e6cSPaul Bohmif test x"$_lt_function_replace_fail" = x":"; then
7928*93823e6cSPaul Bohm  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7929*93823e6cSPaul Bohmfi
7930*93823e6cSPaul Bohm])
7931e3a38431SPaul Bohm
7932*93823e6cSPaul Bohm# _LT_PATH_CONVERSION_FUNCTIONS
7933*93823e6cSPaul Bohm# -----------------------------
7934*93823e6cSPaul Bohm# Determine which file name conversion functions should be used by
7935*93823e6cSPaul Bohm# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
7936*93823e6cSPaul Bohm# for certain cross-compile configurations and native mingw.
7937*93823e6cSPaul Bohmm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7938*93823e6cSPaul Bohm[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7939*93823e6cSPaul BohmAC_REQUIRE([AC_CANONICAL_BUILD])dnl
7940*93823e6cSPaul BohmAC_MSG_CHECKING([how to convert $build file names to $host format])
7941*93823e6cSPaul BohmAC_CACHE_VAL(lt_cv_to_host_file_cmd,
7942*93823e6cSPaul Bohm[case $host in
7943*93823e6cSPaul Bohm  *-*-mingw* )
7944*93823e6cSPaul Bohm    case $build in
7945*93823e6cSPaul Bohm      *-*-mingw* ) # actually msys
7946*93823e6cSPaul Bohm        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7947e3a38431SPaul Bohm        ;;
7948*93823e6cSPaul Bohm      *-*-cygwin* )
7949*93823e6cSPaul Bohm        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7950*93823e6cSPaul Bohm        ;;
7951*93823e6cSPaul Bohm      * ) # otherwise, assume *nix
7952*93823e6cSPaul Bohm        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7953*93823e6cSPaul Bohm        ;;
7954*93823e6cSPaul Bohm    esac
7955*93823e6cSPaul Bohm    ;;
7956*93823e6cSPaul Bohm  *-*-cygwin* )
7957*93823e6cSPaul Bohm    case $build in
7958*93823e6cSPaul Bohm      *-*-mingw* ) # actually msys
7959*93823e6cSPaul Bohm        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7960*93823e6cSPaul Bohm        ;;
7961*93823e6cSPaul Bohm      *-*-cygwin* )
7962*93823e6cSPaul Bohm        lt_cv_to_host_file_cmd=func_convert_file_noop
7963*93823e6cSPaul Bohm        ;;
7964*93823e6cSPaul Bohm      * ) # otherwise, assume *nix
7965*93823e6cSPaul Bohm        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7966*93823e6cSPaul Bohm        ;;
7967*93823e6cSPaul Bohm    esac
7968*93823e6cSPaul Bohm    ;;
7969*93823e6cSPaul Bohm  * ) # unhandled hosts (and "normal" native builds)
7970*93823e6cSPaul Bohm    lt_cv_to_host_file_cmd=func_convert_file_noop
7971e3a38431SPaul Bohm    ;;
7972e3a38431SPaul Bohmesac
7973e3a38431SPaul Bohm])
7974*93823e6cSPaul Bohmto_host_file_cmd=$lt_cv_to_host_file_cmd
7975*93823e6cSPaul BohmAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7976*93823e6cSPaul Bohm_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7977*93823e6cSPaul Bohm         [0], [convert $build file names to $host format])dnl
7978*93823e6cSPaul Bohm
7979*93823e6cSPaul BohmAC_MSG_CHECKING([how to convert $build file names to toolchain format])
7980*93823e6cSPaul BohmAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7981*93823e6cSPaul Bohm[#assume ordinary cross tools, or native build.
7982*93823e6cSPaul Bohmlt_cv_to_tool_file_cmd=func_convert_file_noop
7983*93823e6cSPaul Bohmcase $host in
7984*93823e6cSPaul Bohm  *-*-mingw* )
7985*93823e6cSPaul Bohm    case $build in
7986*93823e6cSPaul Bohm      *-*-mingw* ) # actually msys
7987*93823e6cSPaul Bohm        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7988*93823e6cSPaul Bohm        ;;
7989*93823e6cSPaul Bohm    esac
7990*93823e6cSPaul Bohm    ;;
7991*93823e6cSPaul Bohmesac
7992*93823e6cSPaul Bohm])
7993*93823e6cSPaul Bohmto_tool_file_cmd=$lt_cv_to_tool_file_cmd
7994*93823e6cSPaul BohmAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7995*93823e6cSPaul Bohm_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7996*93823e6cSPaul Bohm         [0], [convert $build files to toolchain format])dnl
7997*93823e6cSPaul Bohm])# _LT_PATH_CONVERSION_FUNCTIONS
7998e3a38431SPaul Bohm
7999e3a38431SPaul Bohm# Helper functions for option handling.                    -*- Autoconf -*-
8000e3a38431SPaul Bohm#
8001*93823e6cSPaul Bohm#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
8002*93823e6cSPaul Bohm#   Inc.
8003e3a38431SPaul Bohm#   Written by Gary V. Vaughan, 2004
8004e3a38431SPaul Bohm#
8005e3a38431SPaul Bohm# This file is free software; the Free Software Foundation gives
8006e3a38431SPaul Bohm# unlimited permission to copy and/or distribute it, with or without
8007e3a38431SPaul Bohm# modifications, as long as this notice is preserved.
8008e3a38431SPaul Bohm
8009*93823e6cSPaul Bohm# serial 7 ltoptions.m4
8010e3a38431SPaul Bohm
8011e3a38431SPaul Bohm# This is to help aclocal find these macros, as it can't see m4_define.
8012e3a38431SPaul BohmAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8013e3a38431SPaul Bohm
8014e3a38431SPaul Bohm
8015e3a38431SPaul Bohm# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8016e3a38431SPaul Bohm# ------------------------------------------
8017e3a38431SPaul Bohmm4_define([_LT_MANGLE_OPTION],
8018e3a38431SPaul Bohm[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8019e3a38431SPaul Bohm
8020e3a38431SPaul Bohm
8021e3a38431SPaul Bohm# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8022e3a38431SPaul Bohm# ---------------------------------------
8023e3a38431SPaul Bohm# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8024e3a38431SPaul Bohm# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8025e3a38431SPaul Bohm# saved as a flag.
8026e3a38431SPaul Bohmm4_define([_LT_SET_OPTION],
8027e3a38431SPaul Bohm[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8028e3a38431SPaul Bohmm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8029e3a38431SPaul Bohm        _LT_MANGLE_DEFUN([$1], [$2]),
8030e3a38431SPaul Bohm    [m4_warning([Unknown $1 option `$2'])])[]dnl
8031e3a38431SPaul Bohm])
8032e3a38431SPaul Bohm
8033e3a38431SPaul Bohm
8034e3a38431SPaul Bohm# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8035e3a38431SPaul Bohm# ------------------------------------------------------------
8036e3a38431SPaul Bohm# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8037e3a38431SPaul Bohmm4_define([_LT_IF_OPTION],
8038e3a38431SPaul Bohm[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8039e3a38431SPaul Bohm
8040e3a38431SPaul Bohm
8041e3a38431SPaul Bohm# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8042e3a38431SPaul Bohm# -------------------------------------------------------
8043e3a38431SPaul Bohm# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8044e3a38431SPaul Bohm# are set.
8045e3a38431SPaul Bohmm4_define([_LT_UNLESS_OPTIONS],
8046e3a38431SPaul Bohm[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8047e3a38431SPaul Bohm	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8048e3a38431SPaul Bohm		      [m4_define([$0_found])])])[]dnl
8049e3a38431SPaul Bohmm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8050e3a38431SPaul Bohm])[]dnl
8051e3a38431SPaul Bohm])
8052e3a38431SPaul Bohm
8053e3a38431SPaul Bohm
8054e3a38431SPaul Bohm# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8055e3a38431SPaul Bohm# ----------------------------------------
8056e3a38431SPaul Bohm# OPTION-LIST is a space-separated list of Libtool options associated
8057e3a38431SPaul Bohm# with MACRO-NAME.  If any OPTION has a matching handler declared with
8058e3a38431SPaul Bohm# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8059e3a38431SPaul Bohm# the unknown option and exit.
8060e3a38431SPaul Bohmm4_defun([_LT_SET_OPTIONS],
8061e3a38431SPaul Bohm[# Set options
8062e3a38431SPaul Bohmm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8063e3a38431SPaul Bohm    [_LT_SET_OPTION([$1], _LT_Option)])
8064e3a38431SPaul Bohm
8065e3a38431SPaul Bohmm4_if([$1],[LT_INIT],[
8066e3a38431SPaul Bohm  dnl
8067e3a38431SPaul Bohm  dnl Simply set some default values (i.e off) if boolean options were not
8068e3a38431SPaul Bohm  dnl specified:
8069e3a38431SPaul Bohm  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8070e3a38431SPaul Bohm  ])
8071e3a38431SPaul Bohm  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8072e3a38431SPaul Bohm  ])
8073e3a38431SPaul Bohm  dnl
8074e3a38431SPaul Bohm  dnl If no reference was made to various pairs of opposing options, then
8075e3a38431SPaul Bohm  dnl we run the default mode handler for the pair.  For example, if neither
8076e3a38431SPaul Bohm  dnl `shared' nor `disable-shared' was passed, we enable building of shared
8077e3a38431SPaul Bohm  dnl archives by default:
8078e3a38431SPaul Bohm  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8079e3a38431SPaul Bohm  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8080e3a38431SPaul Bohm  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8081e3a38431SPaul Bohm  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8082e3a38431SPaul Bohm  		   [_LT_ENABLE_FAST_INSTALL])
8083e3a38431SPaul Bohm  ])
8084e3a38431SPaul Bohm])# _LT_SET_OPTIONS
8085e3a38431SPaul Bohm
8086e3a38431SPaul Bohm
8087e3a38431SPaul Bohm
8088e3a38431SPaul Bohm# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8089e3a38431SPaul Bohm# -----------------------------------------
8090e3a38431SPaul Bohmm4_define([_LT_MANGLE_DEFUN],
8091e3a38431SPaul Bohm[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8092e3a38431SPaul Bohm
8093e3a38431SPaul Bohm
8094e3a38431SPaul Bohm# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8095e3a38431SPaul Bohm# -----------------------------------------------
8096e3a38431SPaul Bohmm4_define([LT_OPTION_DEFINE],
8097e3a38431SPaul Bohm[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8098e3a38431SPaul Bohm])# LT_OPTION_DEFINE
8099e3a38431SPaul Bohm
8100e3a38431SPaul Bohm
8101e3a38431SPaul Bohm# dlopen
8102e3a38431SPaul Bohm# ------
8103e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8104e3a38431SPaul Bohm])
8105e3a38431SPaul Bohm
8106e3a38431SPaul BohmAU_DEFUN([AC_LIBTOOL_DLOPEN],
8107e3a38431SPaul Bohm[_LT_SET_OPTION([LT_INIT], [dlopen])
8108e3a38431SPaul BohmAC_DIAGNOSE([obsolete],
8109e3a38431SPaul Bohm[$0: Remove this warning and the call to _LT_SET_OPTION when you
8110e3a38431SPaul Bohmput the `dlopen' option into LT_INIT's first parameter.])
8111e3a38431SPaul Bohm])
8112e3a38431SPaul Bohm
8113e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
8114e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8115e3a38431SPaul Bohm
8116e3a38431SPaul Bohm
8117e3a38431SPaul Bohm# win32-dll
8118e3a38431SPaul Bohm# ---------
8119e3a38431SPaul Bohm# Declare package support for building win32 dll's.
8120e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8121e3a38431SPaul Bohm[enable_win32_dll=yes
8122e3a38431SPaul Bohm
8123e3a38431SPaul Bohmcase $host in
8124*93823e6cSPaul Bohm*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8125e3a38431SPaul Bohm  AC_CHECK_TOOL(AS, as, false)
8126e3a38431SPaul Bohm  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8127e3a38431SPaul Bohm  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8128e3a38431SPaul Bohm  ;;
8129e3a38431SPaul Bohmesac
8130e3a38431SPaul Bohm
8131e3a38431SPaul Bohmtest -z "$AS" && AS=as
8132*93823e6cSPaul Bohm_LT_DECL([], [AS],      [1], [Assembler program])dnl
8133e3a38431SPaul Bohm
8134e3a38431SPaul Bohmtest -z "$DLLTOOL" && DLLTOOL=dlltool
8135*93823e6cSPaul Bohm_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8136e3a38431SPaul Bohm
8137e3a38431SPaul Bohmtest -z "$OBJDUMP" && OBJDUMP=objdump
8138*93823e6cSPaul Bohm_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8139e3a38431SPaul Bohm])# win32-dll
8140e3a38431SPaul Bohm
8141e3a38431SPaul BohmAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8142e3a38431SPaul Bohm[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8143e3a38431SPaul Bohm_LT_SET_OPTION([LT_INIT], [win32-dll])
8144e3a38431SPaul BohmAC_DIAGNOSE([obsolete],
8145e3a38431SPaul Bohm[$0: Remove this warning and the call to _LT_SET_OPTION when you
8146e3a38431SPaul Bohmput the `win32-dll' option into LT_INIT's first parameter.])
8147e3a38431SPaul Bohm])
8148e3a38431SPaul Bohm
8149e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
8150e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8151e3a38431SPaul Bohm
8152e3a38431SPaul Bohm
8153e3a38431SPaul Bohm# _LT_ENABLE_SHARED([DEFAULT])
8154e3a38431SPaul Bohm# ----------------------------
8155e3a38431SPaul Bohm# implement the --enable-shared flag, and supports the `shared' and
8156e3a38431SPaul Bohm# `disable-shared' LT_INIT options.
8157e3a38431SPaul Bohm# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8158e3a38431SPaul Bohmm4_define([_LT_ENABLE_SHARED],
8159e3a38431SPaul Bohm[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8160e3a38431SPaul BohmAC_ARG_ENABLE([shared],
8161e3a38431SPaul Bohm    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8162e3a38431SPaul Bohm	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8163e3a38431SPaul Bohm    [p=${PACKAGE-default}
8164e3a38431SPaul Bohm    case $enableval in
8165e3a38431SPaul Bohm    yes) enable_shared=yes ;;
8166e3a38431SPaul Bohm    no) enable_shared=no ;;
8167e3a38431SPaul Bohm    *)
8168e3a38431SPaul Bohm      enable_shared=no
8169e3a38431SPaul Bohm      # Look at the argument we got.  We use all the common list separators.
8170e3a38431SPaul Bohm      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8171e3a38431SPaul Bohm      for pkg in $enableval; do
8172e3a38431SPaul Bohm	IFS="$lt_save_ifs"
8173e3a38431SPaul Bohm	if test "X$pkg" = "X$p"; then
8174e3a38431SPaul Bohm	  enable_shared=yes
8175e3a38431SPaul Bohm	fi
8176e3a38431SPaul Bohm      done
8177e3a38431SPaul Bohm      IFS="$lt_save_ifs"
8178e3a38431SPaul Bohm      ;;
8179e3a38431SPaul Bohm    esac],
8180e3a38431SPaul Bohm    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8181e3a38431SPaul Bohm
8182e3a38431SPaul Bohm    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8183e3a38431SPaul Bohm	[Whether or not to build shared libraries])
8184e3a38431SPaul Bohm])# _LT_ENABLE_SHARED
8185e3a38431SPaul Bohm
8186e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8187e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8188e3a38431SPaul Bohm
8189e3a38431SPaul Bohm# Old names:
8190e3a38431SPaul BohmAC_DEFUN([AC_ENABLE_SHARED],
8191e3a38431SPaul Bohm[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8192e3a38431SPaul Bohm])
8193e3a38431SPaul Bohm
8194e3a38431SPaul BohmAC_DEFUN([AC_DISABLE_SHARED],
8195e3a38431SPaul Bohm[_LT_SET_OPTION([LT_INIT], [disable-shared])
8196e3a38431SPaul Bohm])
8197e3a38431SPaul Bohm
8198e3a38431SPaul BohmAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8199e3a38431SPaul BohmAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8200e3a38431SPaul Bohm
8201e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
8202e3a38431SPaul Bohmdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8203e3a38431SPaul Bohmdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8204e3a38431SPaul Bohm
8205e3a38431SPaul Bohm
8206e3a38431SPaul Bohm
8207e3a38431SPaul Bohm# _LT_ENABLE_STATIC([DEFAULT])
8208e3a38431SPaul Bohm# ----------------------------
8209e3a38431SPaul Bohm# implement the --enable-static flag, and support the `static' and
8210e3a38431SPaul Bohm# `disable-static' LT_INIT options.
8211e3a38431SPaul Bohm# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8212e3a38431SPaul Bohmm4_define([_LT_ENABLE_STATIC],
8213e3a38431SPaul Bohm[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8214e3a38431SPaul BohmAC_ARG_ENABLE([static],
8215e3a38431SPaul Bohm    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8216e3a38431SPaul Bohm	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8217e3a38431SPaul Bohm    [p=${PACKAGE-default}
8218e3a38431SPaul Bohm    case $enableval in
8219e3a38431SPaul Bohm    yes) enable_static=yes ;;
8220e3a38431SPaul Bohm    no) enable_static=no ;;
8221e3a38431SPaul Bohm    *)
8222e3a38431SPaul Bohm     enable_static=no
8223e3a38431SPaul Bohm      # Look at the argument we got.  We use all the common list separators.
8224e3a38431SPaul Bohm      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8225e3a38431SPaul Bohm      for pkg in $enableval; do
8226e3a38431SPaul Bohm	IFS="$lt_save_ifs"
8227e3a38431SPaul Bohm	if test "X$pkg" = "X$p"; then
8228e3a38431SPaul Bohm	  enable_static=yes
8229e3a38431SPaul Bohm	fi
8230e3a38431SPaul Bohm      done
8231e3a38431SPaul Bohm      IFS="$lt_save_ifs"
8232e3a38431SPaul Bohm      ;;
8233e3a38431SPaul Bohm    esac],
8234e3a38431SPaul Bohm    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8235e3a38431SPaul Bohm
8236e3a38431SPaul Bohm    _LT_DECL([build_old_libs], [enable_static], [0],
8237e3a38431SPaul Bohm	[Whether or not to build static libraries])
8238e3a38431SPaul Bohm])# _LT_ENABLE_STATIC
8239e3a38431SPaul Bohm
8240e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8241e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8242e3a38431SPaul Bohm
8243e3a38431SPaul Bohm# Old names:
8244e3a38431SPaul BohmAC_DEFUN([AC_ENABLE_STATIC],
8245e3a38431SPaul Bohm[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8246e3a38431SPaul Bohm])
8247e3a38431SPaul Bohm
8248e3a38431SPaul BohmAC_DEFUN([AC_DISABLE_STATIC],
8249e3a38431SPaul Bohm[_LT_SET_OPTION([LT_INIT], [disable-static])
8250e3a38431SPaul Bohm])
8251e3a38431SPaul Bohm
8252e3a38431SPaul BohmAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8253e3a38431SPaul BohmAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8254e3a38431SPaul Bohm
8255e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
8256e3a38431SPaul Bohmdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8257e3a38431SPaul Bohmdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8258e3a38431SPaul Bohm
8259e3a38431SPaul Bohm
8260e3a38431SPaul Bohm
8261e3a38431SPaul Bohm# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8262e3a38431SPaul Bohm# ----------------------------------
8263e3a38431SPaul Bohm# implement the --enable-fast-install flag, and support the `fast-install'
8264e3a38431SPaul Bohm# and `disable-fast-install' LT_INIT options.
8265e3a38431SPaul Bohm# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8266e3a38431SPaul Bohmm4_define([_LT_ENABLE_FAST_INSTALL],
8267e3a38431SPaul Bohm[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8268e3a38431SPaul BohmAC_ARG_ENABLE([fast-install],
8269e3a38431SPaul Bohm    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8270e3a38431SPaul Bohm    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8271e3a38431SPaul Bohm    [p=${PACKAGE-default}
8272e3a38431SPaul Bohm    case $enableval in
8273e3a38431SPaul Bohm    yes) enable_fast_install=yes ;;
8274e3a38431SPaul Bohm    no) enable_fast_install=no ;;
8275e3a38431SPaul Bohm    *)
8276e3a38431SPaul Bohm      enable_fast_install=no
8277e3a38431SPaul Bohm      # Look at the argument we got.  We use all the common list separators.
8278e3a38431SPaul Bohm      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8279e3a38431SPaul Bohm      for pkg in $enableval; do
8280e3a38431SPaul Bohm	IFS="$lt_save_ifs"
8281e3a38431SPaul Bohm	if test "X$pkg" = "X$p"; then
8282e3a38431SPaul Bohm	  enable_fast_install=yes
8283e3a38431SPaul Bohm	fi
8284e3a38431SPaul Bohm      done
8285e3a38431SPaul Bohm      IFS="$lt_save_ifs"
8286e3a38431SPaul Bohm      ;;
8287e3a38431SPaul Bohm    esac],
8288e3a38431SPaul Bohm    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8289e3a38431SPaul Bohm
8290e3a38431SPaul Bohm_LT_DECL([fast_install], [enable_fast_install], [0],
8291e3a38431SPaul Bohm	 [Whether or not to optimize for fast installation])dnl
8292e3a38431SPaul Bohm])# _LT_ENABLE_FAST_INSTALL
8293e3a38431SPaul Bohm
8294e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8295e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8296e3a38431SPaul Bohm
8297e3a38431SPaul Bohm# Old names:
8298e3a38431SPaul BohmAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8299e3a38431SPaul Bohm[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8300e3a38431SPaul BohmAC_DIAGNOSE([obsolete],
8301e3a38431SPaul Bohm[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8302e3a38431SPaul Bohmthe `fast-install' option into LT_INIT's first parameter.])
8303e3a38431SPaul Bohm])
8304e3a38431SPaul Bohm
8305e3a38431SPaul BohmAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8306e3a38431SPaul Bohm[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8307e3a38431SPaul BohmAC_DIAGNOSE([obsolete],
8308e3a38431SPaul Bohm[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8309e3a38431SPaul Bohmthe `disable-fast-install' option into LT_INIT's first parameter.])
8310e3a38431SPaul Bohm])
8311e3a38431SPaul Bohm
8312e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
8313e3a38431SPaul Bohmdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8314e3a38431SPaul Bohmdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8315e3a38431SPaul Bohm
8316e3a38431SPaul Bohm
8317e3a38431SPaul Bohm# _LT_WITH_PIC([MODE])
8318e3a38431SPaul Bohm# --------------------
8319e3a38431SPaul Bohm# implement the --with-pic flag, and support the `pic-only' and `no-pic'
8320e3a38431SPaul Bohm# LT_INIT options.
8321e3a38431SPaul Bohm# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
8322e3a38431SPaul Bohmm4_define([_LT_WITH_PIC],
8323e3a38431SPaul Bohm[AC_ARG_WITH([pic],
8324*93823e6cSPaul Bohm    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8325e3a38431SPaul Bohm	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8326*93823e6cSPaul Bohm    [lt_p=${PACKAGE-default}
8327*93823e6cSPaul Bohm    case $withval in
8328*93823e6cSPaul Bohm    yes|no) pic_mode=$withval ;;
8329*93823e6cSPaul Bohm    *)
8330*93823e6cSPaul Bohm      pic_mode=default
8331*93823e6cSPaul Bohm      # Look at the argument we got.  We use all the common list separators.
8332*93823e6cSPaul Bohm      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8333*93823e6cSPaul Bohm      for lt_pkg in $withval; do
8334*93823e6cSPaul Bohm	IFS="$lt_save_ifs"
8335*93823e6cSPaul Bohm	if test "X$lt_pkg" = "X$lt_p"; then
8336*93823e6cSPaul Bohm	  pic_mode=yes
8337*93823e6cSPaul Bohm	fi
8338*93823e6cSPaul Bohm      done
8339*93823e6cSPaul Bohm      IFS="$lt_save_ifs"
8340*93823e6cSPaul Bohm      ;;
8341*93823e6cSPaul Bohm    esac],
8342e3a38431SPaul Bohm    [pic_mode=default])
8343e3a38431SPaul Bohm
8344e3a38431SPaul Bohmtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8345e3a38431SPaul Bohm
8346e3a38431SPaul Bohm_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8347e3a38431SPaul Bohm])# _LT_WITH_PIC
8348e3a38431SPaul Bohm
8349e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8350e3a38431SPaul BohmLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8351e3a38431SPaul Bohm
8352e3a38431SPaul Bohm# Old name:
8353e3a38431SPaul BohmAU_DEFUN([AC_LIBTOOL_PICMODE],
8354e3a38431SPaul Bohm[_LT_SET_OPTION([LT_INIT], [pic-only])
8355e3a38431SPaul BohmAC_DIAGNOSE([obsolete],
8356e3a38431SPaul Bohm[$0: Remove this warning and the call to _LT_SET_OPTION when you
8357e3a38431SPaul Bohmput the `pic-only' option into LT_INIT's first parameter.])
8358e3a38431SPaul Bohm])
8359e3a38431SPaul Bohm
8360e3a38431SPaul Bohmdnl aclocal-1.4 backwards compatibility:
8361e3a38431SPaul Bohmdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8362e3a38431SPaul Bohm
8363e3a38431SPaul Bohm
8364e3a38431SPaul Bohmm4_define([_LTDL_MODE], [])
8365e3a38431SPaul BohmLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8366e3a38431SPaul Bohm		 [m4_define([_LTDL_MODE], [nonrecursive])])
8367e3a38431SPaul BohmLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8368e3a38431SPaul Bohm		 [m4_define([_LTDL_MODE], [recursive])])
8369e3a38431SPaul BohmLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8370e3a38431SPaul Bohm		 [m4_define([_LTDL_MODE], [subproject])])
8371e3a38431SPaul Bohm
8372e3a38431SPaul Bohmm4_define([_LTDL_TYPE], [])
8373e3a38431SPaul BohmLT_OPTION_DEFINE([LTDL_INIT], [installable],
8374e3a38431SPaul Bohm		 [m4_define([_LTDL_TYPE], [installable])])
8375e3a38431SPaul BohmLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8376e3a38431SPaul Bohm		 [m4_define([_LTDL_TYPE], [convenience])])
8377e3a38431SPaul Bohm
8378e3a38431SPaul Bohm# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8379e3a38431SPaul Bohm#
8380e3a38431SPaul Bohm# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8381e3a38431SPaul Bohm# Written by Gary V. Vaughan, 2004
8382e3a38431SPaul Bohm#
8383e3a38431SPaul Bohm# This file is free software; the Free Software Foundation gives
8384e3a38431SPaul Bohm# unlimited permission to copy and/or distribute it, with or without
8385e3a38431SPaul Bohm# modifications, as long as this notice is preserved.
8386e3a38431SPaul Bohm
8387e3a38431SPaul Bohm# serial 6 ltsugar.m4
8388e3a38431SPaul Bohm
8389e3a38431SPaul Bohm# This is to help aclocal find these macros, as it can't see m4_define.
8390e3a38431SPaul BohmAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8391e3a38431SPaul Bohm
8392e3a38431SPaul Bohm
8393e3a38431SPaul Bohm# lt_join(SEP, ARG1, [ARG2...])
8394e3a38431SPaul Bohm# -----------------------------
8395e3a38431SPaul Bohm# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8396e3a38431SPaul Bohm# associated separator.
8397e3a38431SPaul Bohm# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8398e3a38431SPaul Bohm# versions in m4sugar had bugs.
8399e3a38431SPaul Bohmm4_define([lt_join],
8400e3a38431SPaul Bohm[m4_if([$#], [1], [],
8401e3a38431SPaul Bohm       [$#], [2], [[$2]],
8402e3a38431SPaul Bohm       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8403e3a38431SPaul Bohmm4_define([_lt_join],
8404e3a38431SPaul Bohm[m4_if([$#$2], [2], [],
8405e3a38431SPaul Bohm       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8406e3a38431SPaul Bohm
8407e3a38431SPaul Bohm
8408e3a38431SPaul Bohm# lt_car(LIST)
8409e3a38431SPaul Bohm# lt_cdr(LIST)
8410e3a38431SPaul Bohm# ------------
8411e3a38431SPaul Bohm# Manipulate m4 lists.
8412e3a38431SPaul Bohm# These macros are necessary as long as will still need to support
8413e3a38431SPaul Bohm# Autoconf-2.59 which quotes differently.
8414e3a38431SPaul Bohmm4_define([lt_car], [[$1]])
8415e3a38431SPaul Bohmm4_define([lt_cdr],
8416e3a38431SPaul Bohm[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8417e3a38431SPaul Bohm       [$#], 1, [],
8418e3a38431SPaul Bohm       [m4_dquote(m4_shift($@))])])
8419e3a38431SPaul Bohmm4_define([lt_unquote], $1)
8420e3a38431SPaul Bohm
8421e3a38431SPaul Bohm
8422e3a38431SPaul Bohm# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8423e3a38431SPaul Bohm# ------------------------------------------
8424e3a38431SPaul Bohm# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8425e3a38431SPaul Bohm# Note that neither SEPARATOR nor STRING are expanded; they are appended
8426e3a38431SPaul Bohm# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8427e3a38431SPaul Bohm# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8428e3a38431SPaul Bohm# than defined and empty).
8429e3a38431SPaul Bohm#
8430e3a38431SPaul Bohm# This macro is needed until we can rely on Autoconf 2.62, since earlier
8431e3a38431SPaul Bohm# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8432e3a38431SPaul Bohmm4_define([lt_append],
8433e3a38431SPaul Bohm[m4_define([$1],
8434e3a38431SPaul Bohm	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8435e3a38431SPaul Bohm
8436e3a38431SPaul Bohm
8437e3a38431SPaul Bohm
8438e3a38431SPaul Bohm# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8439e3a38431SPaul Bohm# ----------------------------------------------------------
8440e3a38431SPaul Bohm# Produce a SEP delimited list of all paired combinations of elements of
8441e3a38431SPaul Bohm# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8442e3a38431SPaul Bohm# has the form PREFIXmINFIXSUFFIXn.
8443e3a38431SPaul Bohm# Needed until we can rely on m4_combine added in Autoconf 2.62.
8444e3a38431SPaul Bohmm4_define([lt_combine],
8445e3a38431SPaul Bohm[m4_if(m4_eval([$# > 3]), [1],
8446e3a38431SPaul Bohm       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8447e3a38431SPaul Bohm[[m4_foreach([_Lt_prefix], [$2],
8448e3a38431SPaul Bohm	     [m4_foreach([_Lt_suffix],
8449e3a38431SPaul Bohm		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8450e3a38431SPaul Bohm	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8451e3a38431SPaul Bohm
8452e3a38431SPaul Bohm
8453e3a38431SPaul Bohm# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8454e3a38431SPaul Bohm# -----------------------------------------------------------------------
8455e3a38431SPaul Bohm# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8456e3a38431SPaul Bohm# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8457e3a38431SPaul Bohmm4_define([lt_if_append_uniq],
8458e3a38431SPaul Bohm[m4_ifdef([$1],
8459e3a38431SPaul Bohm	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8460e3a38431SPaul Bohm		 [lt_append([$1], [$2], [$3])$4],
8461e3a38431SPaul Bohm		 [$5])],
8462e3a38431SPaul Bohm	  [lt_append([$1], [$2], [$3])$4])])
8463e3a38431SPaul Bohm
8464e3a38431SPaul Bohm
8465e3a38431SPaul Bohm# lt_dict_add(DICT, KEY, VALUE)
8466e3a38431SPaul Bohm# -----------------------------
8467e3a38431SPaul Bohmm4_define([lt_dict_add],
8468e3a38431SPaul Bohm[m4_define([$1($2)], [$3])])
8469e3a38431SPaul Bohm
8470e3a38431SPaul Bohm
8471e3a38431SPaul Bohm# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8472e3a38431SPaul Bohm# --------------------------------------------
8473e3a38431SPaul Bohmm4_define([lt_dict_add_subkey],
8474e3a38431SPaul Bohm[m4_define([$1($2:$3)], [$4])])
8475e3a38431SPaul Bohm
8476e3a38431SPaul Bohm
8477e3a38431SPaul Bohm# lt_dict_fetch(DICT, KEY, [SUBKEY])
8478e3a38431SPaul Bohm# ----------------------------------
8479e3a38431SPaul Bohmm4_define([lt_dict_fetch],
8480e3a38431SPaul Bohm[m4_ifval([$3],
8481e3a38431SPaul Bohm	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8482e3a38431SPaul Bohm    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8483e3a38431SPaul Bohm
8484e3a38431SPaul Bohm
8485e3a38431SPaul Bohm# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8486e3a38431SPaul Bohm# -----------------------------------------------------------------
8487e3a38431SPaul Bohmm4_define([lt_if_dict_fetch],
8488e3a38431SPaul Bohm[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8489e3a38431SPaul Bohm	[$5],
8490e3a38431SPaul Bohm    [$6])])
8491e3a38431SPaul Bohm
8492e3a38431SPaul Bohm
8493e3a38431SPaul Bohm# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8494e3a38431SPaul Bohm# --------------------------------------------------------------
8495e3a38431SPaul Bohmm4_define([lt_dict_filter],
8496e3a38431SPaul Bohm[m4_if([$5], [], [],
8497e3a38431SPaul Bohm  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8498e3a38431SPaul Bohm           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8499e3a38431SPaul Bohm		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8500e3a38431SPaul Bohm])
8501e3a38431SPaul Bohm
8502e3a38431SPaul Bohm# ltversion.m4 -- version numbers			-*- Autoconf -*-
8503e3a38431SPaul Bohm#
8504e3a38431SPaul Bohm#   Copyright (C) 2004 Free Software Foundation, Inc.
8505e3a38431SPaul Bohm#   Written by Scott James Remnant, 2004
8506e3a38431SPaul Bohm#
8507e3a38431SPaul Bohm# This file is free software; the Free Software Foundation gives
8508e3a38431SPaul Bohm# unlimited permission to copy and/or distribute it, with or without
8509e3a38431SPaul Bohm# modifications, as long as this notice is preserved.
8510e3a38431SPaul Bohm
8511*93823e6cSPaul Bohm# @configure_input@
8512e3a38431SPaul Bohm
8513*93823e6cSPaul Bohm# serial 3337 ltversion.m4
8514e3a38431SPaul Bohm# This file is part of GNU Libtool
8515e3a38431SPaul Bohm
8516*93823e6cSPaul Bohmm4_define([LT_PACKAGE_VERSION], [2.4.2])
8517*93823e6cSPaul Bohmm4_define([LT_PACKAGE_REVISION], [1.3337])
8518e3a38431SPaul Bohm
8519e3a38431SPaul BohmAC_DEFUN([LTVERSION_VERSION],
8520*93823e6cSPaul Bohm[macro_version='2.4.2'
8521*93823e6cSPaul Bohmmacro_revision='1.3337'
8522e3a38431SPaul Bohm_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8523e3a38431SPaul Bohm_LT_DECL(, macro_revision, 0)
8524e3a38431SPaul Bohm])
8525e3a38431SPaul Bohm
8526e3a38431SPaul Bohm# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8527e3a38431SPaul Bohm#
8528*93823e6cSPaul Bohm#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
8529e3a38431SPaul Bohm#   Written by Scott James Remnant, 2004.
8530e3a38431SPaul Bohm#
8531e3a38431SPaul Bohm# This file is free software; the Free Software Foundation gives
8532e3a38431SPaul Bohm# unlimited permission to copy and/or distribute it, with or without
8533e3a38431SPaul Bohm# modifications, as long as this notice is preserved.
8534e3a38431SPaul Bohm
8535*93823e6cSPaul Bohm# serial 5 lt~obsolete.m4
8536e3a38431SPaul Bohm
8537e3a38431SPaul Bohm# These exist entirely to fool aclocal when bootstrapping libtool.
8538e3a38431SPaul Bohm#
8539e3a38431SPaul Bohm# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8540e3a38431SPaul Bohm# which have later been changed to m4_define as they aren't part of the
8541e3a38431SPaul Bohm# exported API, or moved to Autoconf or Automake where they belong.
8542e3a38431SPaul Bohm#
8543e3a38431SPaul Bohm# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8544e3a38431SPaul Bohm# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8545e3a38431SPaul Bohm# using a macro with the same name in our local m4/libtool.m4 it'll
8546e3a38431SPaul Bohm# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8547e3a38431SPaul Bohm# and doesn't know about Autoconf macros at all.)
8548e3a38431SPaul Bohm#
8549e3a38431SPaul Bohm# So we provide this file, which has a silly filename so it's always
8550e3a38431SPaul Bohm# included after everything else.  This provides aclocal with the
8551e3a38431SPaul Bohm# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8552e3a38431SPaul Bohm# because those macros already exist, or will be overwritten later.
8553e3a38431SPaul Bohm# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8554e3a38431SPaul Bohm#
8555e3a38431SPaul Bohm# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8556e3a38431SPaul Bohm# Yes, that means every name once taken will need to remain here until
8557e3a38431SPaul Bohm# we give up compatibility with versions before 1.7, at which point
8558e3a38431SPaul Bohm# we need to keep only those names which we still refer to.
8559e3a38431SPaul Bohm
8560e3a38431SPaul Bohm# This is to help aclocal find these macros, as it can't see m4_define.
8561e3a38431SPaul BohmAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8562e3a38431SPaul Bohm
8563e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8564e3a38431SPaul Bohmm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8565e3a38431SPaul Bohmm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8566e3a38431SPaul Bohmm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8567e3a38431SPaul Bohmm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8568e3a38431SPaul Bohmm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8569e3a38431SPaul Bohmm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
8570e3a38431SPaul Bohmm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8571e3a38431SPaul Bohmm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
8572e3a38431SPaul Bohmm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
8573e3a38431SPaul Bohmm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
8574e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8575e3a38431SPaul Bohmm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8576e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8577e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8578e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8579e3a38431SPaul Bohmm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
8580e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8581e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8582e3a38431SPaul Bohmm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
8583e3a38431SPaul Bohmm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
8584e3a38431SPaul Bohmm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8585e3a38431SPaul Bohmm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8586e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8587e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8588e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8589e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8590e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8591e3a38431SPaul Bohmm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
8592e3a38431SPaul Bohmm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
8593e3a38431SPaul Bohmm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
8594e3a38431SPaul Bohmm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8595e3a38431SPaul Bohmm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8596e3a38431SPaul Bohmm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
8597e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
8598e3a38431SPaul Bohmm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8599e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8600e3a38431SPaul Bohmm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
8601e3a38431SPaul Bohmm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8602e3a38431SPaul Bohmm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
8603e3a38431SPaul Bohmm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
8604e3a38431SPaul Bohmm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
8605e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8606e3a38431SPaul Bohmm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8607e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8608e3a38431SPaul Bohmm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8609e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8610e3a38431SPaul Bohmm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
8611e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
8612e3a38431SPaul Bohmm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
8613e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
8614e3a38431SPaul Bohmm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
8615e3a38431SPaul Bohmm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
8616e3a38431SPaul Bohmm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
8617*93823e6cSPaul Bohmm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
8618*93823e6cSPaul Bohmm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
8619*93823e6cSPaul Bohmm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
8620*93823e6cSPaul Bohmm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
8621*93823e6cSPaul Bohmm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
8622*93823e6cSPaul Bohmm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
8623*93823e6cSPaul Bohmm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
8624e3a38431SPaul Bohm
8625*93823e6cSPaul Bohm# Copyright (C) 2002-2013 Free Software Foundation, Inc.
8626e3a38431SPaul Bohm#
8627e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
8628e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
8629e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
8630e3a38431SPaul Bohm
8631e3a38431SPaul Bohm# AM_AUTOMAKE_VERSION(VERSION)
8632e3a38431SPaul Bohm# ----------------------------
8633e3a38431SPaul Bohm# Automake X.Y traces this macro to ensure aclocal.m4 has been
8634e3a38431SPaul Bohm# generated from the m4 files accompanying Automake X.Y.
8635e3a38431SPaul Bohm# (This private macro should not be called outside this file.)
8636e3a38431SPaul BohmAC_DEFUN([AM_AUTOMAKE_VERSION],
8637*93823e6cSPaul Bohm[am__api_version='1.14'
8638e3a38431SPaul Bohmdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
8639e3a38431SPaul Bohmdnl require some minimum version.  Point them to the right macro.
8640*93823e6cSPaul Bohmm4_if([$1], [1.14.1], [],
8641e3a38431SPaul Bohm      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8642e3a38431SPaul Bohm])
8643e3a38431SPaul Bohm
8644e3a38431SPaul Bohm# _AM_AUTOCONF_VERSION(VERSION)
8645e3a38431SPaul Bohm# -----------------------------
8646e3a38431SPaul Bohm# aclocal traces this macro to find the Autoconf version.
8647e3a38431SPaul Bohm# This is a private macro too.  Using m4_define simplifies
8648e3a38431SPaul Bohm# the logic in aclocal, which can simply ignore this definition.
8649e3a38431SPaul Bohmm4_define([_AM_AUTOCONF_VERSION], [])
8650e3a38431SPaul Bohm
8651e3a38431SPaul Bohm# AM_SET_CURRENT_AUTOMAKE_VERSION
8652e3a38431SPaul Bohm# -------------------------------
8653e3a38431SPaul Bohm# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8654e3a38431SPaul Bohm# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
8655e3a38431SPaul BohmAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8656*93823e6cSPaul Bohm[AM_AUTOMAKE_VERSION([1.14.1])dnl
8657e3a38431SPaul Bohmm4_ifndef([AC_AUTOCONF_VERSION],
8658e3a38431SPaul Bohm  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8659e3a38431SPaul Bohm_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
8660e3a38431SPaul Bohm
8661e3a38431SPaul Bohm# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
8662e3a38431SPaul Bohm
8663*93823e6cSPaul Bohm# Copyright (C) 2001-2013 Free Software Foundation, Inc.
8664e3a38431SPaul Bohm#
8665e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
8666e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
8667e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
8668e3a38431SPaul Bohm
8669e3a38431SPaul Bohm# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
8670*93823e6cSPaul Bohm# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
8671*93823e6cSPaul Bohm# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
8672e3a38431SPaul Bohm#
8673e3a38431SPaul Bohm# Of course, Automake must honor this variable whenever it calls a
8674e3a38431SPaul Bohm# tool from the auxiliary directory.  The problem is that $srcdir (and
8675e3a38431SPaul Bohm# therefore $ac_aux_dir as well) can be either absolute or relative,
8676e3a38431SPaul Bohm# depending on how configure is run.  This is pretty annoying, since
8677e3a38431SPaul Bohm# it makes $ac_aux_dir quite unusable in subdirectories: in the top
8678e3a38431SPaul Bohm# source directory, any form will work fine, but in subdirectories a
8679e3a38431SPaul Bohm# relative path needs to be adjusted first.
8680e3a38431SPaul Bohm#
8681e3a38431SPaul Bohm# $ac_aux_dir/missing
8682e3a38431SPaul Bohm#    fails when called from a subdirectory if $ac_aux_dir is relative
8683e3a38431SPaul Bohm# $top_srcdir/$ac_aux_dir/missing
8684e3a38431SPaul Bohm#    fails if $ac_aux_dir is absolute,
8685e3a38431SPaul Bohm#    fails when called from a subdirectory in a VPATH build with
8686e3a38431SPaul Bohm#          a relative $ac_aux_dir
8687e3a38431SPaul Bohm#
8688e3a38431SPaul Bohm# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8689e3a38431SPaul Bohm# are both prefixed by $srcdir.  In an in-source build this is usually
8690*93823e6cSPaul Bohm# harmless because $srcdir is '.', but things will broke when you
8691e3a38431SPaul Bohm# start a VPATH build or use an absolute $srcdir.
8692e3a38431SPaul Bohm#
8693e3a38431SPaul Bohm# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
8694e3a38431SPaul Bohm# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
8695e3a38431SPaul Bohm#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
8696e3a38431SPaul Bohm# and then we would define $MISSING as
8697e3a38431SPaul Bohm#   MISSING="\${SHELL} $am_aux_dir/missing"
8698e3a38431SPaul Bohm# This will work as long as MISSING is not called from configure, because
8699e3a38431SPaul Bohm# unfortunately $(top_srcdir) has no meaning in configure.
8700e3a38431SPaul Bohm# However there are other variables, like CC, which are often used in
8701e3a38431SPaul Bohm# configure, and could therefore not use this "fixed" $ac_aux_dir.
8702e3a38431SPaul Bohm#
8703e3a38431SPaul Bohm# Another solution, used here, is to always expand $ac_aux_dir to an
8704e3a38431SPaul Bohm# absolute PATH.  The drawback is that using absolute paths prevent a
8705e3a38431SPaul Bohm# configured tree to be moved without reconfiguration.
8706e3a38431SPaul Bohm
8707e3a38431SPaul BohmAC_DEFUN([AM_AUX_DIR_EXPAND],
8708*93823e6cSPaul Bohm[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
8709*93823e6cSPaul Bohm# Expand $ac_aux_dir to an absolute path.
8710*93823e6cSPaul Bohmam_aux_dir=`cd "$ac_aux_dir" && pwd`
8711e3a38431SPaul Bohm])
8712e3a38431SPaul Bohm
8713e3a38431SPaul Bohm# AM_CONDITIONAL                                            -*- Autoconf -*-
8714e3a38431SPaul Bohm
8715*93823e6cSPaul Bohm# Copyright (C) 1997-2013 Free Software Foundation, Inc.
8716e3a38431SPaul Bohm#
8717e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
8718e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
8719e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
8720e3a38431SPaul Bohm
8721e3a38431SPaul Bohm# AM_CONDITIONAL(NAME, SHELL-CONDITION)
8722e3a38431SPaul Bohm# -------------------------------------
8723e3a38431SPaul Bohm# Define a conditional.
8724e3a38431SPaul BohmAC_DEFUN([AM_CONDITIONAL],
8725*93823e6cSPaul Bohm[AC_PREREQ([2.52])dnl
8726*93823e6cSPaul Bohm m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
8727e3a38431SPaul Bohm       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
8728e3a38431SPaul BohmAC_SUBST([$1_TRUE])dnl
8729e3a38431SPaul BohmAC_SUBST([$1_FALSE])dnl
8730e3a38431SPaul Bohm_AM_SUBST_NOTMAKE([$1_TRUE])dnl
8731e3a38431SPaul Bohm_AM_SUBST_NOTMAKE([$1_FALSE])dnl
8732e3a38431SPaul Bohmm4_define([_AM_COND_VALUE_$1], [$2])dnl
8733e3a38431SPaul Bohmif $2; then
8734e3a38431SPaul Bohm  $1_TRUE=
8735e3a38431SPaul Bohm  $1_FALSE='#'
8736e3a38431SPaul Bohmelse
8737e3a38431SPaul Bohm  $1_TRUE='#'
8738e3a38431SPaul Bohm  $1_FALSE=
8739e3a38431SPaul Bohmfi
8740e3a38431SPaul BohmAC_CONFIG_COMMANDS_PRE(
8741e3a38431SPaul Bohm[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
8742e3a38431SPaul Bohm  AC_MSG_ERROR([[conditional "$1" was never defined.
8743e3a38431SPaul BohmUsually this means the macro was only invoked conditionally.]])
8744e3a38431SPaul Bohmfi])])
8745e3a38431SPaul Bohm
8746*93823e6cSPaul Bohm# Copyright (C) 1999-2013 Free Software Foundation, Inc.
8747e3a38431SPaul Bohm#
8748e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
8749e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
8750e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
8751e3a38431SPaul Bohm
8752e3a38431SPaul Bohm
8753*93823e6cSPaul Bohm# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
8754e3a38431SPaul Bohm# written in clear, in which case automake, when reading aclocal.m4,
8755e3a38431SPaul Bohm# will think it sees a *use*, and therefore will trigger all it's
8756e3a38431SPaul Bohm# C support machinery.  Also note that it means that autoscan, seeing
8757e3a38431SPaul Bohm# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8758e3a38431SPaul Bohm
8759e3a38431SPaul Bohm
8760e3a38431SPaul Bohm# _AM_DEPENDENCIES(NAME)
8761e3a38431SPaul Bohm# ----------------------
8762e3a38431SPaul Bohm# See how the compiler implements dependency checking.
8763*93823e6cSPaul Bohm# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
8764e3a38431SPaul Bohm# We try a few techniques and use that to set a single cache variable.
8765e3a38431SPaul Bohm#
8766e3a38431SPaul Bohm# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
8767e3a38431SPaul Bohm# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
8768e3a38431SPaul Bohm# dependency, and given that the user is not expected to run this macro,
8769e3a38431SPaul Bohm# just rely on AC_PROG_CC.
8770e3a38431SPaul BohmAC_DEFUN([_AM_DEPENDENCIES],
8771e3a38431SPaul Bohm[AC_REQUIRE([AM_SET_DEPDIR])dnl
8772e3a38431SPaul BohmAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
8773e3a38431SPaul BohmAC_REQUIRE([AM_MAKE_INCLUDE])dnl
8774e3a38431SPaul BohmAC_REQUIRE([AM_DEP_TRACK])dnl
8775e3a38431SPaul Bohm
8776*93823e6cSPaul Bohmm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
8777*93823e6cSPaul Bohm      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
8778*93823e6cSPaul Bohm      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8779*93823e6cSPaul Bohm      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
8780*93823e6cSPaul Bohm      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
8781*93823e6cSPaul Bohm      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
8782e3a38431SPaul Bohm                    [depcc="$$1"   am_compiler_list=])
8783e3a38431SPaul Bohm
8784e3a38431SPaul BohmAC_CACHE_CHECK([dependency style of $depcc],
8785e3a38431SPaul Bohm               [am_cv_$1_dependencies_compiler_type],
8786e3a38431SPaul Bohm[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8787e3a38431SPaul Bohm  # We make a subdir and do the tests there.  Otherwise we can end up
8788e3a38431SPaul Bohm  # making bogus files that we don't know about and never remove.  For
8789e3a38431SPaul Bohm  # instance it was reported that on HP-UX the gcc test will end up
8790*93823e6cSPaul Bohm  # making a dummy file named 'D' -- because '-MD' means "put the output
8791*93823e6cSPaul Bohm  # in D".
8792*93823e6cSPaul Bohm  rm -rf conftest.dir
8793e3a38431SPaul Bohm  mkdir conftest.dir
8794e3a38431SPaul Bohm  # Copy depcomp to subdir because otherwise we won't find it if we're
8795e3a38431SPaul Bohm  # using a relative directory.
8796e3a38431SPaul Bohm  cp "$am_depcomp" conftest.dir
8797e3a38431SPaul Bohm  cd conftest.dir
8798e3a38431SPaul Bohm  # We will build objects and dependencies in a subdirectory because
8799e3a38431SPaul Bohm  # it helps to detect inapplicable dependency modes.  For instance
8800e3a38431SPaul Bohm  # both Tru64's cc and ICC support -MD to output dependencies as a
8801e3a38431SPaul Bohm  # side effect of compilation, but ICC will put the dependencies in
8802e3a38431SPaul Bohm  # the current directory while Tru64 will put them in the object
8803e3a38431SPaul Bohm  # directory.
8804e3a38431SPaul Bohm  mkdir sub
8805e3a38431SPaul Bohm
8806e3a38431SPaul Bohm  am_cv_$1_dependencies_compiler_type=none
8807e3a38431SPaul Bohm  if test "$am_compiler_list" = ""; then
8808e3a38431SPaul Bohm     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
8809e3a38431SPaul Bohm  fi
8810e3a38431SPaul Bohm  am__universal=false
8811e3a38431SPaul Bohm  m4_case([$1], [CC],
8812e3a38431SPaul Bohm    [case " $depcc " in #(
8813e3a38431SPaul Bohm     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8814e3a38431SPaul Bohm     esac],
8815e3a38431SPaul Bohm    [CXX],
8816e3a38431SPaul Bohm    [case " $depcc " in #(
8817e3a38431SPaul Bohm     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8818e3a38431SPaul Bohm     esac])
8819e3a38431SPaul Bohm
8820e3a38431SPaul Bohm  for depmode in $am_compiler_list; do
8821e3a38431SPaul Bohm    # Setup a source with many dependencies, because some compilers
8822e3a38431SPaul Bohm    # like to wrap large dependency lists on column 80 (with \), and
8823e3a38431SPaul Bohm    # we should not choose a depcomp mode which is confused by this.
8824e3a38431SPaul Bohm    #
8825e3a38431SPaul Bohm    # We need to recreate these files for each test, as the compiler may
8826e3a38431SPaul Bohm    # overwrite some of them when testing with obscure command lines.
8827e3a38431SPaul Bohm    # This happens at least with the AIX C compiler.
8828e3a38431SPaul Bohm    : > sub/conftest.c
8829e3a38431SPaul Bohm    for i in 1 2 3 4 5 6; do
8830e3a38431SPaul Bohm      echo '#include "conftst'$i'.h"' >> sub/conftest.c
8831*93823e6cSPaul Bohm      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
8832*93823e6cSPaul Bohm      # Solaris 10 /bin/sh.
8833*93823e6cSPaul Bohm      echo '/* dummy */' > sub/conftst$i.h
8834e3a38431SPaul Bohm    done
8835e3a38431SPaul Bohm    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
8836e3a38431SPaul Bohm
8837*93823e6cSPaul Bohm    # We check with '-c' and '-o' for the sake of the "dashmstdout"
8838e3a38431SPaul Bohm    # mode.  It turns out that the SunPro C++ compiler does not properly
8839*93823e6cSPaul Bohm    # handle '-M -o', and we need to detect this.  Also, some Intel
8840*93823e6cSPaul Bohm    # versions had trouble with output in subdirs.
8841e3a38431SPaul Bohm    am__obj=sub/conftest.${OBJEXT-o}
8842e3a38431SPaul Bohm    am__minus_obj="-o $am__obj"
8843e3a38431SPaul Bohm    case $depmode in
8844e3a38431SPaul Bohm    gcc)
8845e3a38431SPaul Bohm      # This depmode causes a compiler race in universal mode.
8846e3a38431SPaul Bohm      test "$am__universal" = false || continue
8847e3a38431SPaul Bohm      ;;
8848e3a38431SPaul Bohm    nosideeffect)
8849*93823e6cSPaul Bohm      # After this tag, mechanisms are not by side-effect, so they'll
8850*93823e6cSPaul Bohm      # only be used when explicitly requested.
8851e3a38431SPaul Bohm      if test "x$enable_dependency_tracking" = xyes; then
8852e3a38431SPaul Bohm	continue
8853e3a38431SPaul Bohm      else
8854e3a38431SPaul Bohm	break
8855e3a38431SPaul Bohm      fi
8856e3a38431SPaul Bohm      ;;
8857*93823e6cSPaul Bohm    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
8858*93823e6cSPaul Bohm      # This compiler won't grok '-c -o', but also, the minuso test has
8859e3a38431SPaul Bohm      # not run yet.  These depmodes are late enough in the game, and
8860e3a38431SPaul Bohm      # so weak that their functioning should not be impacted.
8861e3a38431SPaul Bohm      am__obj=conftest.${OBJEXT-o}
8862e3a38431SPaul Bohm      am__minus_obj=
8863e3a38431SPaul Bohm      ;;
8864e3a38431SPaul Bohm    none) break ;;
8865e3a38431SPaul Bohm    esac
8866e3a38431SPaul Bohm    if depmode=$depmode \
8867e3a38431SPaul Bohm       source=sub/conftest.c object=$am__obj \
8868e3a38431SPaul Bohm       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
8869e3a38431SPaul Bohm       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
8870e3a38431SPaul Bohm         >/dev/null 2>conftest.err &&
8871e3a38431SPaul Bohm       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
8872e3a38431SPaul Bohm       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
8873e3a38431SPaul Bohm       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
8874e3a38431SPaul Bohm       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
8875e3a38431SPaul Bohm      # icc doesn't choke on unknown options, it will just issue warnings
8876e3a38431SPaul Bohm      # or remarks (even with -Werror).  So we grep stderr for any message
8877e3a38431SPaul Bohm      # that says an option was ignored or not supported.
8878e3a38431SPaul Bohm      # When given -MP, icc 7.0 and 7.1 complain thusly:
8879e3a38431SPaul Bohm      #   icc: Command line warning: ignoring option '-M'; no argument required
8880e3a38431SPaul Bohm      # The diagnosis changed in icc 8.0:
8881e3a38431SPaul Bohm      #   icc: Command line remark: option '-MP' not supported
8882e3a38431SPaul Bohm      if (grep 'ignoring option' conftest.err ||
8883e3a38431SPaul Bohm          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
8884e3a38431SPaul Bohm        am_cv_$1_dependencies_compiler_type=$depmode
8885e3a38431SPaul Bohm        break
8886e3a38431SPaul Bohm      fi
8887e3a38431SPaul Bohm    fi
8888e3a38431SPaul Bohm  done
8889e3a38431SPaul Bohm
8890e3a38431SPaul Bohm  cd ..
8891e3a38431SPaul Bohm  rm -rf conftest.dir
8892e3a38431SPaul Bohmelse
8893e3a38431SPaul Bohm  am_cv_$1_dependencies_compiler_type=none
8894e3a38431SPaul Bohmfi
8895e3a38431SPaul Bohm])
8896e3a38431SPaul BohmAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
8897e3a38431SPaul BohmAM_CONDITIONAL([am__fastdep$1], [
8898e3a38431SPaul Bohm  test "x$enable_dependency_tracking" != xno \
8899e3a38431SPaul Bohm  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
8900e3a38431SPaul Bohm])
8901e3a38431SPaul Bohm
8902e3a38431SPaul Bohm
8903e3a38431SPaul Bohm# AM_SET_DEPDIR
8904e3a38431SPaul Bohm# -------------
8905e3a38431SPaul Bohm# Choose a directory name for dependency files.
8906*93823e6cSPaul Bohm# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
8907e3a38431SPaul BohmAC_DEFUN([AM_SET_DEPDIR],
8908e3a38431SPaul Bohm[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
8909e3a38431SPaul BohmAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
8910e3a38431SPaul Bohm])
8911e3a38431SPaul Bohm
8912e3a38431SPaul Bohm
8913e3a38431SPaul Bohm# AM_DEP_TRACK
8914e3a38431SPaul Bohm# ------------
8915e3a38431SPaul BohmAC_DEFUN([AM_DEP_TRACK],
8916*93823e6cSPaul Bohm[AC_ARG_ENABLE([dependency-tracking], [dnl
8917*93823e6cSPaul BohmAS_HELP_STRING(
8918*93823e6cSPaul Bohm  [--enable-dependency-tracking],
8919*93823e6cSPaul Bohm  [do not reject slow dependency extractors])
8920*93823e6cSPaul BohmAS_HELP_STRING(
8921*93823e6cSPaul Bohm  [--disable-dependency-tracking],
8922*93823e6cSPaul Bohm  [speeds up one-time build])])
8923e3a38431SPaul Bohmif test "x$enable_dependency_tracking" != xno; then
8924e3a38431SPaul Bohm  am_depcomp="$ac_aux_dir/depcomp"
8925e3a38431SPaul Bohm  AMDEPBACKSLASH='\'
8926*93823e6cSPaul Bohm  am__nodep='_no'
8927e3a38431SPaul Bohmfi
8928e3a38431SPaul BohmAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
8929e3a38431SPaul BohmAC_SUBST([AMDEPBACKSLASH])dnl
8930e3a38431SPaul Bohm_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
8931*93823e6cSPaul BohmAC_SUBST([am__nodep])dnl
8932*93823e6cSPaul Bohm_AM_SUBST_NOTMAKE([am__nodep])dnl
8933e3a38431SPaul Bohm])
8934e3a38431SPaul Bohm
8935e3a38431SPaul Bohm# Generate code to set up dependency tracking.              -*- Autoconf -*-
8936e3a38431SPaul Bohm
8937*93823e6cSPaul Bohm# Copyright (C) 1999-2013 Free Software Foundation, Inc.
8938e3a38431SPaul Bohm#
8939e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
8940e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
8941e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
8942e3a38431SPaul Bohm
8943e3a38431SPaul Bohm
8944e3a38431SPaul Bohm# _AM_OUTPUT_DEPENDENCY_COMMANDS
8945e3a38431SPaul Bohm# ------------------------------
8946e3a38431SPaul BohmAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
8947e3a38431SPaul Bohm[{
8948*93823e6cSPaul Bohm  # Older Autoconf quotes --file arguments for eval, but not when files
8949e3a38431SPaul Bohm  # are listed without --file.  Let's play safe and only enable the eval
8950e3a38431SPaul Bohm  # if we detect the quoting.
8951e3a38431SPaul Bohm  case $CONFIG_FILES in
8952e3a38431SPaul Bohm  *\'*) eval set x "$CONFIG_FILES" ;;
8953e3a38431SPaul Bohm  *)   set x $CONFIG_FILES ;;
8954e3a38431SPaul Bohm  esac
8955e3a38431SPaul Bohm  shift
8956e3a38431SPaul Bohm  for mf
8957e3a38431SPaul Bohm  do
8958e3a38431SPaul Bohm    # Strip MF so we end up with the name of the file.
8959e3a38431SPaul Bohm    mf=`echo "$mf" | sed -e 's/:.*$//'`
8960e3a38431SPaul Bohm    # Check whether this is an Automake generated Makefile or not.
8961*93823e6cSPaul Bohm    # We used to match only the files named 'Makefile.in', but
8962e3a38431SPaul Bohm    # some people rename them; so instead we look at the file content.
8963e3a38431SPaul Bohm    # Grep'ing the first line is not enough: some people post-process
8964e3a38431SPaul Bohm    # each Makefile.in and add a new line on top of each file to say so.
8965e3a38431SPaul Bohm    # Grep'ing the whole file is not good either: AIX grep has a line
8966e3a38431SPaul Bohm    # limit of 2048, but all sed's we know have understand at least 4000.
8967e3a38431SPaul Bohm    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
8968e3a38431SPaul Bohm      dirpart=`AS_DIRNAME("$mf")`
8969e3a38431SPaul Bohm    else
8970e3a38431SPaul Bohm      continue
8971e3a38431SPaul Bohm    fi
8972e3a38431SPaul Bohm    # Extract the definition of DEPDIR, am__include, and am__quote
8973*93823e6cSPaul Bohm    # from the Makefile without running 'make'.
8974e3a38431SPaul Bohm    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
8975e3a38431SPaul Bohm    test -z "$DEPDIR" && continue
8976e3a38431SPaul Bohm    am__include=`sed -n 's/^am__include = //p' < "$mf"`
8977*93823e6cSPaul Bohm    test -z "$am__include" && continue
8978e3a38431SPaul Bohm    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
8979e3a38431SPaul Bohm    # Find all dependency output files, they are included files with
8980e3a38431SPaul Bohm    # $(DEPDIR) in their names.  We invoke sed twice because it is the
8981e3a38431SPaul Bohm    # simplest approach to changing $(DEPDIR) to its actual value in the
8982e3a38431SPaul Bohm    # expansion.
8983e3a38431SPaul Bohm    for file in `sed -n "
8984e3a38431SPaul Bohm      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
8985*93823e6cSPaul Bohm	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
8986e3a38431SPaul Bohm      # Make sure the directory exists.
8987e3a38431SPaul Bohm      test -f "$dirpart/$file" && continue
8988e3a38431SPaul Bohm      fdir=`AS_DIRNAME(["$file"])`
8989e3a38431SPaul Bohm      AS_MKDIR_P([$dirpart/$fdir])
8990e3a38431SPaul Bohm      # echo "creating $dirpart/$file"
8991e3a38431SPaul Bohm      echo '# dummy' > "$dirpart/$file"
8992e3a38431SPaul Bohm    done
8993e3a38431SPaul Bohm  done
8994e3a38431SPaul Bohm}
8995e3a38431SPaul Bohm])# _AM_OUTPUT_DEPENDENCY_COMMANDS
8996e3a38431SPaul Bohm
8997e3a38431SPaul Bohm
8998e3a38431SPaul Bohm# AM_OUTPUT_DEPENDENCY_COMMANDS
8999e3a38431SPaul Bohm# -----------------------------
9000e3a38431SPaul Bohm# This macro should only be invoked once -- use via AC_REQUIRE.
9001e3a38431SPaul Bohm#
9002e3a38431SPaul Bohm# This code is only required when automatic dependency tracking
9003*93823e6cSPaul Bohm# is enabled.  FIXME.  This creates each '.P' file that we will
9004e3a38431SPaul Bohm# need in order to bootstrap the dependency handling code.
9005e3a38431SPaul BohmAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
9006e3a38431SPaul Bohm[AC_CONFIG_COMMANDS([depfiles],
9007e3a38431SPaul Bohm     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9008e3a38431SPaul Bohm     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
9009e3a38431SPaul Bohm])
9010e3a38431SPaul Bohm
9011e3a38431SPaul Bohm# Do all the work for Automake.                             -*- Autoconf -*-
9012e3a38431SPaul Bohm
9013*93823e6cSPaul Bohm# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9014e3a38431SPaul Bohm#
9015e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9016e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9017e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9018e3a38431SPaul Bohm
9019e3a38431SPaul Bohm# This macro actually does too much.  Some checks are only needed if
9020e3a38431SPaul Bohm# your package does certain things.  But this isn't really a big deal.
9021e3a38431SPaul Bohm
9022*93823e6cSPaul Bohmdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
9023*93823e6cSPaul Bohmm4_define([AC_PROG_CC],
9024*93823e6cSPaul Bohmm4_defn([AC_PROG_CC])
9025*93823e6cSPaul Bohm[_AM_PROG_CC_C_O
9026*93823e6cSPaul Bohm])
9027*93823e6cSPaul Bohm
9028e3a38431SPaul Bohm# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
9029e3a38431SPaul Bohm# AM_INIT_AUTOMAKE([OPTIONS])
9030e3a38431SPaul Bohm# -----------------------------------------------
9031e3a38431SPaul Bohm# The call with PACKAGE and VERSION arguments is the old style
9032e3a38431SPaul Bohm# call (pre autoconf-2.50), which is being phased out.  PACKAGE
9033e3a38431SPaul Bohm# and VERSION should now be passed to AC_INIT and removed from
9034e3a38431SPaul Bohm# the call to AM_INIT_AUTOMAKE.
9035e3a38431SPaul Bohm# We support both call styles for the transition.  After
9036e3a38431SPaul Bohm# the next Automake release, Autoconf can make the AC_INIT
9037e3a38431SPaul Bohm# arguments mandatory, and then we can depend on a new Autoconf
9038e3a38431SPaul Bohm# release and drop the old call support.
9039e3a38431SPaul BohmAC_DEFUN([AM_INIT_AUTOMAKE],
9040*93823e6cSPaul Bohm[AC_PREREQ([2.65])dnl
9041e3a38431SPaul Bohmdnl Autoconf wants to disallow AM_ names.  We explicitly allow
9042e3a38431SPaul Bohmdnl the ones we care about.
9043e3a38431SPaul Bohmm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
9044e3a38431SPaul BohmAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
9045e3a38431SPaul BohmAC_REQUIRE([AC_PROG_INSTALL])dnl
9046e3a38431SPaul Bohmif test "`cd $srcdir && pwd`" != "`pwd`"; then
9047e3a38431SPaul Bohm  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
9048e3a38431SPaul Bohm  # is not polluted with repeated "-I."
9049e3a38431SPaul Bohm  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
9050e3a38431SPaul Bohm  # test to see if srcdir already configured
9051e3a38431SPaul Bohm  if test -f $srcdir/config.status; then
9052e3a38431SPaul Bohm    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
9053e3a38431SPaul Bohm  fi
9054e3a38431SPaul Bohmfi
9055e3a38431SPaul Bohm
9056e3a38431SPaul Bohm# test whether we have cygpath
9057e3a38431SPaul Bohmif test -z "$CYGPATH_W"; then
9058e3a38431SPaul Bohm  if (cygpath --version) >/dev/null 2>/dev/null; then
9059e3a38431SPaul Bohm    CYGPATH_W='cygpath -w'
9060e3a38431SPaul Bohm  else
9061e3a38431SPaul Bohm    CYGPATH_W=echo
9062e3a38431SPaul Bohm  fi
9063e3a38431SPaul Bohmfi
9064e3a38431SPaul BohmAC_SUBST([CYGPATH_W])
9065e3a38431SPaul Bohm
9066e3a38431SPaul Bohm# Define the identity of the package.
9067e3a38431SPaul Bohmdnl Distinguish between old-style and new-style calls.
9068e3a38431SPaul Bohmm4_ifval([$2],
9069*93823e6cSPaul Bohm[AC_DIAGNOSE([obsolete],
9070*93823e6cSPaul Bohm             [$0: two- and three-arguments forms are deprecated.])
9071*93823e6cSPaul Bohmm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
9072e3a38431SPaul Bohm AC_SUBST([PACKAGE], [$1])dnl
9073e3a38431SPaul Bohm AC_SUBST([VERSION], [$2])],
9074e3a38431SPaul Bohm[_AM_SET_OPTIONS([$1])dnl
9075e3a38431SPaul Bohmdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
9076*93823e6cSPaul Bohmm4_if(
9077*93823e6cSPaul Bohm  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
9078*93823e6cSPaul Bohm  [ok:ok],,
9079e3a38431SPaul Bohm  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
9080e3a38431SPaul Bohm AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
9081e3a38431SPaul Bohm AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
9082e3a38431SPaul Bohm
9083e3a38431SPaul Bohm_AM_IF_OPTION([no-define],,
9084*93823e6cSPaul Bohm[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
9085*93823e6cSPaul Bohm AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
9086e3a38431SPaul Bohm
9087e3a38431SPaul Bohm# Some tools Automake needs.
9088e3a38431SPaul BohmAC_REQUIRE([AM_SANITY_CHECK])dnl
9089e3a38431SPaul BohmAC_REQUIRE([AC_ARG_PROGRAM])dnl
9090*93823e6cSPaul BohmAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
9091*93823e6cSPaul BohmAM_MISSING_PROG([AUTOCONF], [autoconf])
9092*93823e6cSPaul BohmAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
9093*93823e6cSPaul BohmAM_MISSING_PROG([AUTOHEADER], [autoheader])
9094*93823e6cSPaul BohmAM_MISSING_PROG([MAKEINFO], [makeinfo])
9095e3a38431SPaul BohmAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9096e3a38431SPaul BohmAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9097*93823e6cSPaul BohmAC_REQUIRE([AC_PROG_MKDIR_P])dnl
9098*93823e6cSPaul Bohm# For better backward compatibility.  To be removed once Automake 1.9.x
9099*93823e6cSPaul Bohm# dies out for good.  For more background, see:
9100*93823e6cSPaul Bohm# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
9101*93823e6cSPaul Bohm# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
9102*93823e6cSPaul BohmAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
9103e3a38431SPaul Bohm# We need awk for the "check" target.  The system "awk" is bad on
9104e3a38431SPaul Bohm# some platforms.
9105e3a38431SPaul BohmAC_REQUIRE([AC_PROG_AWK])dnl
9106e3a38431SPaul BohmAC_REQUIRE([AC_PROG_MAKE_SET])dnl
9107e3a38431SPaul BohmAC_REQUIRE([AM_SET_LEADING_DOT])dnl
9108e3a38431SPaul Bohm_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
9109e3a38431SPaul Bohm	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
9110e3a38431SPaul Bohm			     [_AM_PROG_TAR([v7])])])
9111e3a38431SPaul Bohm_AM_IF_OPTION([no-dependencies],,
9112e3a38431SPaul Bohm[AC_PROVIDE_IFELSE([AC_PROG_CC],
9113*93823e6cSPaul Bohm		  [_AM_DEPENDENCIES([CC])],
9114*93823e6cSPaul Bohm		  [m4_define([AC_PROG_CC],
9115*93823e6cSPaul Bohm			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
9116e3a38431SPaul BohmAC_PROVIDE_IFELSE([AC_PROG_CXX],
9117*93823e6cSPaul Bohm		  [_AM_DEPENDENCIES([CXX])],
9118*93823e6cSPaul Bohm		  [m4_define([AC_PROG_CXX],
9119*93823e6cSPaul Bohm			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
9120e3a38431SPaul BohmAC_PROVIDE_IFELSE([AC_PROG_OBJC],
9121*93823e6cSPaul Bohm		  [_AM_DEPENDENCIES([OBJC])],
9122*93823e6cSPaul Bohm		  [m4_define([AC_PROG_OBJC],
9123*93823e6cSPaul Bohm			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
9124*93823e6cSPaul BohmAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
9125*93823e6cSPaul Bohm		  [_AM_DEPENDENCIES([OBJCXX])],
9126*93823e6cSPaul Bohm		  [m4_define([AC_PROG_OBJCXX],
9127*93823e6cSPaul Bohm			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
9128e3a38431SPaul Bohm])
9129*93823e6cSPaul BohmAC_REQUIRE([AM_SILENT_RULES])dnl
9130*93823e6cSPaul Bohmdnl The testsuite driver may need to know about EXEEXT, so add the
9131*93823e6cSPaul Bohmdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
9132*93823e6cSPaul Bohmdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
9133e3a38431SPaul BohmAC_CONFIG_COMMANDS_PRE(dnl
9134e3a38431SPaul Bohm[m4_provide_if([_AM_COMPILER_EXEEXT],
9135e3a38431SPaul Bohm  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
9136*93823e6cSPaul Bohm
9137*93823e6cSPaul Bohm# POSIX will say in a future version that running "rm -f" with no argument
9138*93823e6cSPaul Bohm# is OK; and we want to be able to make that assumption in our Makefile
9139*93823e6cSPaul Bohm# recipes.  So use an aggressive probe to check that the usage we want is
9140*93823e6cSPaul Bohm# actually supported "in the wild" to an acceptable degree.
9141*93823e6cSPaul Bohm# See automake bug#10828.
9142*93823e6cSPaul Bohm# To make any issue more visible, cause the running configure to be aborted
9143*93823e6cSPaul Bohm# by default if the 'rm' program in use doesn't match our expectations; the
9144*93823e6cSPaul Bohm# user can still override this though.
9145*93823e6cSPaul Bohmif rm -f && rm -fr && rm -rf; then : OK; else
9146*93823e6cSPaul Bohm  cat >&2 <<'END'
9147*93823e6cSPaul BohmOops!
9148*93823e6cSPaul Bohm
9149*93823e6cSPaul BohmYour 'rm' program seems unable to run without file operands specified
9150*93823e6cSPaul Bohmon the command line, even when the '-f' option is present.  This is contrary
9151*93823e6cSPaul Bohmto the behaviour of most rm programs out there, and not conforming with
9152*93823e6cSPaul Bohmthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
9153*93823e6cSPaul Bohm
9154*93823e6cSPaul BohmPlease tell [email protected] about your system, including the value
9155*93823e6cSPaul Bohmof your $PATH and any error possibly output before this message.  This
9156*93823e6cSPaul Bohmcan help us improve future automake versions.
9157*93823e6cSPaul Bohm
9158*93823e6cSPaul BohmEND
9159*93823e6cSPaul Bohm  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
9160*93823e6cSPaul Bohm    echo 'Configuration will proceed anyway, since you have set the' >&2
9161*93823e6cSPaul Bohm    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
9162*93823e6cSPaul Bohm    echo >&2
9163*93823e6cSPaul Bohm  else
9164*93823e6cSPaul Bohm    cat >&2 <<'END'
9165*93823e6cSPaul BohmAborting the configuration process, to ensure you take notice of the issue.
9166*93823e6cSPaul Bohm
9167*93823e6cSPaul BohmYou can download and install GNU coreutils to get an 'rm' implementation
9168*93823e6cSPaul Bohmthat behaves properly: <http://www.gnu.org/software/coreutils/>.
9169*93823e6cSPaul Bohm
9170*93823e6cSPaul BohmIf you want to complete the configuration process using your problematic
9171*93823e6cSPaul Bohm'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
9172*93823e6cSPaul Bohmto "yes", and re-run configure.
9173*93823e6cSPaul Bohm
9174*93823e6cSPaul BohmEND
9175*93823e6cSPaul Bohm    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
9176*93823e6cSPaul Bohm  fi
9177*93823e6cSPaul Bohmfi
9178e3a38431SPaul Bohm])
9179e3a38431SPaul Bohm
9180*93823e6cSPaul Bohmdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
9181e3a38431SPaul Bohmdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
9182e3a38431SPaul Bohmdnl mangled by Autoconf and run in a shell conditional statement.
9183e3a38431SPaul Bohmm4_define([_AC_COMPILER_EXEEXT],
9184e3a38431SPaul Bohmm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
9185e3a38431SPaul Bohm
9186e3a38431SPaul Bohm# When config.status generates a header, we must update the stamp-h file.
9187e3a38431SPaul Bohm# This file resides in the same directory as the config header
9188e3a38431SPaul Bohm# that is generated.  The stamp files are numbered to have different names.
9189e3a38431SPaul Bohm
9190e3a38431SPaul Bohm# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
9191e3a38431SPaul Bohm# loop where config.status creates the headers, so we can generate
9192e3a38431SPaul Bohm# our stamp files there.
9193e3a38431SPaul BohmAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
9194e3a38431SPaul Bohm[# Compute $1's index in $config_headers.
9195e3a38431SPaul Bohm_am_arg=$1
9196e3a38431SPaul Bohm_am_stamp_count=1
9197e3a38431SPaul Bohmfor _am_header in $config_headers :; do
9198e3a38431SPaul Bohm  case $_am_header in
9199e3a38431SPaul Bohm    $_am_arg | $_am_arg:* )
9200e3a38431SPaul Bohm      break ;;
9201e3a38431SPaul Bohm    * )
9202e3a38431SPaul Bohm      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
9203e3a38431SPaul Bohm  esac
9204e3a38431SPaul Bohmdone
9205e3a38431SPaul Bohmecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
9206e3a38431SPaul Bohm
9207*93823e6cSPaul Bohm# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9208e3a38431SPaul Bohm#
9209e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9210e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9211e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9212e3a38431SPaul Bohm
9213e3a38431SPaul Bohm# AM_PROG_INSTALL_SH
9214e3a38431SPaul Bohm# ------------------
9215e3a38431SPaul Bohm# Define $install_sh.
9216e3a38431SPaul BohmAC_DEFUN([AM_PROG_INSTALL_SH],
9217e3a38431SPaul Bohm[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9218e3a38431SPaul Bohmif test x"${install_sh}" != xset; then
9219e3a38431SPaul Bohm  case $am_aux_dir in
9220e3a38431SPaul Bohm  *\ * | *\	*)
9221e3a38431SPaul Bohm    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
9222e3a38431SPaul Bohm  *)
9223e3a38431SPaul Bohm    install_sh="\${SHELL} $am_aux_dir/install-sh"
9224e3a38431SPaul Bohm  esac
9225e3a38431SPaul Bohmfi
9226*93823e6cSPaul BohmAC_SUBST([install_sh])])
9227e3a38431SPaul Bohm
9228*93823e6cSPaul Bohm# Copyright (C) 2003-2013 Free Software Foundation, Inc.
9229e3a38431SPaul Bohm#
9230e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9231e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9232e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9233e3a38431SPaul Bohm
9234e3a38431SPaul Bohm# Check whether the underlying file-system supports filenames
9235e3a38431SPaul Bohm# with a leading dot.  For instance MS-DOS doesn't.
9236e3a38431SPaul BohmAC_DEFUN([AM_SET_LEADING_DOT],
9237e3a38431SPaul Bohm[rm -rf .tst 2>/dev/null
9238e3a38431SPaul Bohmmkdir .tst 2>/dev/null
9239e3a38431SPaul Bohmif test -d .tst; then
9240e3a38431SPaul Bohm  am__leading_dot=.
9241e3a38431SPaul Bohmelse
9242e3a38431SPaul Bohm  am__leading_dot=_
9243e3a38431SPaul Bohmfi
9244e3a38431SPaul Bohmrmdir .tst 2>/dev/null
9245e3a38431SPaul BohmAC_SUBST([am__leading_dot])])
9246e3a38431SPaul Bohm
9247e3a38431SPaul Bohm# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
9248e3a38431SPaul Bohm# From Jim Meyering
9249e3a38431SPaul Bohm
9250*93823e6cSPaul Bohm# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9251e3a38431SPaul Bohm#
9252e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9253e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9254e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9255e3a38431SPaul Bohm
9256e3a38431SPaul Bohm# AM_MAINTAINER_MODE([DEFAULT-MODE])
9257e3a38431SPaul Bohm# ----------------------------------
9258e3a38431SPaul Bohm# Control maintainer-specific portions of Makefiles.
9259*93823e6cSPaul Bohm# Default is to disable them, unless 'enable' is passed literally.
9260*93823e6cSPaul Bohm# For symmetry, 'disable' may be passed as well.  Anyway, the user
9261e3a38431SPaul Bohm# can override the default with the --enable/--disable switch.
9262e3a38431SPaul BohmAC_DEFUN([AM_MAINTAINER_MODE],
9263e3a38431SPaul Bohm[m4_case(m4_default([$1], [disable]),
9264e3a38431SPaul Bohm       [enable], [m4_define([am_maintainer_other], [disable])],
9265e3a38431SPaul Bohm       [disable], [m4_define([am_maintainer_other], [enable])],
9266e3a38431SPaul Bohm       [m4_define([am_maintainer_other], [enable])
9267e3a38431SPaul Bohm        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
9268*93823e6cSPaul BohmAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
9269e3a38431SPaul Bohm  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
9270e3a38431SPaul Bohm  AC_ARG_ENABLE([maintainer-mode],
9271*93823e6cSPaul Bohm    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
9272*93823e6cSPaul Bohm      am_maintainer_other[ make rules and dependencies not useful
9273*93823e6cSPaul Bohm      (and sometimes confusing) to the casual installer])],
9274e3a38431SPaul Bohm    [USE_MAINTAINER_MODE=$enableval],
9275e3a38431SPaul Bohm    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
9276e3a38431SPaul Bohm  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
9277e3a38431SPaul Bohm  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
9278e3a38431SPaul Bohm  MAINT=$MAINTAINER_MODE_TRUE
9279e3a38431SPaul Bohm  AC_SUBST([MAINT])dnl
9280e3a38431SPaul Bohm]
9281e3a38431SPaul Bohm)
9282e3a38431SPaul Bohm
9283e3a38431SPaul Bohm# Check to see how 'make' treats includes.	            -*- Autoconf -*-
9284e3a38431SPaul Bohm
9285*93823e6cSPaul Bohm# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9286e3a38431SPaul Bohm#
9287e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9288e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9289e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9290e3a38431SPaul Bohm
9291e3a38431SPaul Bohm# AM_MAKE_INCLUDE()
9292e3a38431SPaul Bohm# -----------------
9293e3a38431SPaul Bohm# Check to see how make treats includes.
9294e3a38431SPaul BohmAC_DEFUN([AM_MAKE_INCLUDE],
9295e3a38431SPaul Bohm[am_make=${MAKE-make}
9296e3a38431SPaul Bohmcat > confinc << 'END'
9297e3a38431SPaul Bohmam__doit:
9298e3a38431SPaul Bohm	@echo this is the am__doit target
9299e3a38431SPaul Bohm.PHONY: am__doit
9300e3a38431SPaul BohmEND
9301e3a38431SPaul Bohm# If we don't find an include directive, just comment out the code.
9302e3a38431SPaul BohmAC_MSG_CHECKING([for style of include used by $am_make])
9303e3a38431SPaul Bohmam__include="#"
9304e3a38431SPaul Bohmam__quote=
9305e3a38431SPaul Bohm_am_result=none
9306e3a38431SPaul Bohm# First try GNU make style include.
9307e3a38431SPaul Bohmecho "include confinc" > confmf
9308*93823e6cSPaul Bohm# Ignore all kinds of additional output from 'make'.
9309e3a38431SPaul Bohmcase `$am_make -s -f confmf 2> /dev/null` in #(
9310e3a38431SPaul Bohm*the\ am__doit\ target*)
9311e3a38431SPaul Bohm  am__include=include
9312e3a38431SPaul Bohm  am__quote=
9313e3a38431SPaul Bohm  _am_result=GNU
9314e3a38431SPaul Bohm  ;;
9315e3a38431SPaul Bohmesac
9316e3a38431SPaul Bohm# Now try BSD make style include.
9317e3a38431SPaul Bohmif test "$am__include" = "#"; then
9318e3a38431SPaul Bohm   echo '.include "confinc"' > confmf
9319e3a38431SPaul Bohm   case `$am_make -s -f confmf 2> /dev/null` in #(
9320e3a38431SPaul Bohm   *the\ am__doit\ target*)
9321e3a38431SPaul Bohm     am__include=.include
9322e3a38431SPaul Bohm     am__quote="\""
9323e3a38431SPaul Bohm     _am_result=BSD
9324e3a38431SPaul Bohm     ;;
9325e3a38431SPaul Bohm   esac
9326e3a38431SPaul Bohmfi
9327e3a38431SPaul BohmAC_SUBST([am__include])
9328e3a38431SPaul BohmAC_SUBST([am__quote])
9329e3a38431SPaul BohmAC_MSG_RESULT([$_am_result])
9330e3a38431SPaul Bohmrm -f confinc confmf
9331e3a38431SPaul Bohm])
9332e3a38431SPaul Bohm
9333e3a38431SPaul Bohm# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
9334e3a38431SPaul Bohm
9335*93823e6cSPaul Bohm# Copyright (C) 1997-2013 Free Software Foundation, Inc.
9336e3a38431SPaul Bohm#
9337e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9338e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9339e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9340e3a38431SPaul Bohm
9341e3a38431SPaul Bohm# AM_MISSING_PROG(NAME, PROGRAM)
9342e3a38431SPaul Bohm# ------------------------------
9343e3a38431SPaul BohmAC_DEFUN([AM_MISSING_PROG],
9344e3a38431SPaul Bohm[AC_REQUIRE([AM_MISSING_HAS_RUN])
9345e3a38431SPaul Bohm$1=${$1-"${am_missing_run}$2"}
9346e3a38431SPaul BohmAC_SUBST($1)])
9347e3a38431SPaul Bohm
9348e3a38431SPaul Bohm# AM_MISSING_HAS_RUN
9349e3a38431SPaul Bohm# ------------------
9350*93823e6cSPaul Bohm# Define MISSING if not defined so far and test if it is modern enough.
9351*93823e6cSPaul Bohm# If it is, set am_missing_run to use it, otherwise, to nothing.
9352e3a38431SPaul BohmAC_DEFUN([AM_MISSING_HAS_RUN],
9353e3a38431SPaul Bohm[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9354e3a38431SPaul BohmAC_REQUIRE_AUX_FILE([missing])dnl
9355e3a38431SPaul Bohmif test x"${MISSING+set}" != xset; then
9356e3a38431SPaul Bohm  case $am_aux_dir in
9357e3a38431SPaul Bohm  *\ * | *\	*)
9358e3a38431SPaul Bohm    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
9359e3a38431SPaul Bohm  *)
9360e3a38431SPaul Bohm    MISSING="\${SHELL} $am_aux_dir/missing" ;;
9361e3a38431SPaul Bohm  esac
9362e3a38431SPaul Bohmfi
9363e3a38431SPaul Bohm# Use eval to expand $SHELL
9364*93823e6cSPaul Bohmif eval "$MISSING --is-lightweight"; then
9365*93823e6cSPaul Bohm  am_missing_run="$MISSING "
9366e3a38431SPaul Bohmelse
9367e3a38431SPaul Bohm  am_missing_run=
9368*93823e6cSPaul Bohm  AC_MSG_WARN(['missing' script is too old or missing])
9369e3a38431SPaul Bohmfi
9370e3a38431SPaul Bohm])
9371e3a38431SPaul Bohm
9372e3a38431SPaul Bohm# Helper functions for option handling.                     -*- Autoconf -*-
9373e3a38431SPaul Bohm
9374*93823e6cSPaul Bohm# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9375e3a38431SPaul Bohm#
9376e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9377e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9378e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9379e3a38431SPaul Bohm
9380e3a38431SPaul Bohm# _AM_MANGLE_OPTION(NAME)
9381e3a38431SPaul Bohm# -----------------------
9382e3a38431SPaul BohmAC_DEFUN([_AM_MANGLE_OPTION],
9383e3a38431SPaul Bohm[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
9384e3a38431SPaul Bohm
9385e3a38431SPaul Bohm# _AM_SET_OPTION(NAME)
9386*93823e6cSPaul Bohm# --------------------
9387e3a38431SPaul Bohm# Set option NAME.  Presently that only means defining a flag for this option.
9388e3a38431SPaul BohmAC_DEFUN([_AM_SET_OPTION],
9389*93823e6cSPaul Bohm[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
9390e3a38431SPaul Bohm
9391e3a38431SPaul Bohm# _AM_SET_OPTIONS(OPTIONS)
9392*93823e6cSPaul Bohm# ------------------------
9393e3a38431SPaul Bohm# OPTIONS is a space-separated list of Automake options.
9394e3a38431SPaul BohmAC_DEFUN([_AM_SET_OPTIONS],
9395e3a38431SPaul Bohm[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
9396e3a38431SPaul Bohm
9397e3a38431SPaul Bohm# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
9398e3a38431SPaul Bohm# -------------------------------------------
9399e3a38431SPaul Bohm# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9400e3a38431SPaul BohmAC_DEFUN([_AM_IF_OPTION],
9401e3a38431SPaul Bohm[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
9402e3a38431SPaul Bohm
9403*93823e6cSPaul Bohm# Copyright (C) 1999-2013 Free Software Foundation, Inc.
9404e3a38431SPaul Bohm#
9405e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9406e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9407e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9408e3a38431SPaul Bohm
9409*93823e6cSPaul Bohm# _AM_PROG_CC_C_O
9410*93823e6cSPaul Bohm# ---------------
9411*93823e6cSPaul Bohm# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
9412*93823e6cSPaul Bohm# to automatically call this.
9413*93823e6cSPaul BohmAC_DEFUN([_AM_PROG_CC_C_O],
9414*93823e6cSPaul Bohm[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9415*93823e6cSPaul BohmAC_REQUIRE_AUX_FILE([compile])dnl
9416*93823e6cSPaul BohmAC_LANG_PUSH([C])dnl
9417*93823e6cSPaul BohmAC_CACHE_CHECK(
9418*93823e6cSPaul Bohm  [whether $CC understands -c and -o together],
9419*93823e6cSPaul Bohm  [am_cv_prog_cc_c_o],
9420*93823e6cSPaul Bohm  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
9421*93823e6cSPaul Bohm  # Make sure it works both with $CC and with simple cc.
9422*93823e6cSPaul Bohm  # Following AC_PROG_CC_C_O, we do the test twice because some
9423*93823e6cSPaul Bohm  # compilers refuse to overwrite an existing .o file with -o,
9424*93823e6cSPaul Bohm  # though they will create one.
9425*93823e6cSPaul Bohm  am_cv_prog_cc_c_o=yes
9426*93823e6cSPaul Bohm  for am_i in 1 2; do
9427*93823e6cSPaul Bohm    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
9428*93823e6cSPaul Bohm         && test -f conftest2.$ac_objext; then
9429*93823e6cSPaul Bohm      : OK
9430*93823e6cSPaul Bohm    else
9431*93823e6cSPaul Bohm      am_cv_prog_cc_c_o=no
9432*93823e6cSPaul Bohm      break
9433*93823e6cSPaul Bohm    fi
9434*93823e6cSPaul Bohm  done
9435*93823e6cSPaul Bohm  rm -f core conftest*
9436*93823e6cSPaul Bohm  unset am_i])
9437*93823e6cSPaul Bohmif test "$am_cv_prog_cc_c_o" != yes; then
9438*93823e6cSPaul Bohm   # Losing compiler, so override with the script.
9439*93823e6cSPaul Bohm   # FIXME: It is wrong to rewrite CC.
9440*93823e6cSPaul Bohm   # But if we don't then we get into trouble of one sort or another.
9441*93823e6cSPaul Bohm   # A longer-term fix would be to have automake use am__CC in this case,
9442*93823e6cSPaul Bohm   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
9443*93823e6cSPaul Bohm   CC="$am_aux_dir/compile $CC"
9444*93823e6cSPaul Bohmfi
9445*93823e6cSPaul BohmAC_LANG_POP([C])])
9446*93823e6cSPaul Bohm
9447*93823e6cSPaul Bohm# For backward compatibility.
9448*93823e6cSPaul BohmAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
9449*93823e6cSPaul Bohm
9450*93823e6cSPaul Bohm# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9451*93823e6cSPaul Bohm#
9452*93823e6cSPaul Bohm# This file is free software; the Free Software Foundation
9453*93823e6cSPaul Bohm# gives unlimited permission to copy and/or distribute it,
9454*93823e6cSPaul Bohm# with or without modifications, as long as this notice is preserved.
9455*93823e6cSPaul Bohm
9456*93823e6cSPaul Bohm# AM_RUN_LOG(COMMAND)
9457*93823e6cSPaul Bohm# -------------------
9458*93823e6cSPaul Bohm# Run COMMAND, save the exit status in ac_status, and log it.
9459*93823e6cSPaul Bohm# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
9460*93823e6cSPaul BohmAC_DEFUN([AM_RUN_LOG],
9461*93823e6cSPaul Bohm[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
9462*93823e6cSPaul Bohm   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
9463*93823e6cSPaul Bohm   ac_status=$?
9464*93823e6cSPaul Bohm   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
9465*93823e6cSPaul Bohm   (exit $ac_status); }])
9466*93823e6cSPaul Bohm
9467*93823e6cSPaul Bohm# Check to make sure that the build environment is sane.    -*- Autoconf -*-
9468*93823e6cSPaul Bohm
9469*93823e6cSPaul Bohm# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9470*93823e6cSPaul Bohm#
9471*93823e6cSPaul Bohm# This file is free software; the Free Software Foundation
9472*93823e6cSPaul Bohm# gives unlimited permission to copy and/or distribute it,
9473*93823e6cSPaul Bohm# with or without modifications, as long as this notice is preserved.
9474e3a38431SPaul Bohm
9475e3a38431SPaul Bohm# AM_SANITY_CHECK
9476e3a38431SPaul Bohm# ---------------
9477e3a38431SPaul BohmAC_DEFUN([AM_SANITY_CHECK],
9478e3a38431SPaul Bohm[AC_MSG_CHECKING([whether build environment is sane])
9479e3a38431SPaul Bohm# Reject unsafe characters in $srcdir or the absolute working directory
9480e3a38431SPaul Bohm# name.  Accept space and tab only in the latter.
9481e3a38431SPaul Bohmam_lf='
9482e3a38431SPaul Bohm'
9483e3a38431SPaul Bohmcase `pwd` in
9484e3a38431SPaul Bohm  *[[\\\"\#\$\&\'\`$am_lf]]*)
9485e3a38431SPaul Bohm    AC_MSG_ERROR([unsafe absolute working directory name]);;
9486e3a38431SPaul Bohmesac
9487e3a38431SPaul Bohmcase $srcdir in
9488e3a38431SPaul Bohm  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
9489*93823e6cSPaul Bohm    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
9490e3a38431SPaul Bohmesac
9491e3a38431SPaul Bohm
9492*93823e6cSPaul Bohm# Do 'set' in a subshell so we don't clobber the current shell's
9493e3a38431SPaul Bohm# arguments.  Must try -L first in case configure is actually a
9494e3a38431SPaul Bohm# symlink; some systems play weird games with the mod time of symlinks
9495e3a38431SPaul Bohm# (eg FreeBSD returns the mod time of the symlink's containing
9496e3a38431SPaul Bohm# directory).
9497e3a38431SPaul Bohmif (
9498*93823e6cSPaul Bohm   am_has_slept=no
9499*93823e6cSPaul Bohm   for am_try in 1 2; do
9500*93823e6cSPaul Bohm     echo "timestamp, slept: $am_has_slept" > conftest.file
9501e3a38431SPaul Bohm     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
9502e3a38431SPaul Bohm     if test "$[*]" = "X"; then
9503e3a38431SPaul Bohm	# -L didn't work.
9504e3a38431SPaul Bohm	set X `ls -t "$srcdir/configure" conftest.file`
9505e3a38431SPaul Bohm     fi
9506e3a38431SPaul Bohm     if test "$[*]" != "X $srcdir/configure conftest.file" \
9507e3a38431SPaul Bohm	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
9508e3a38431SPaul Bohm
9509e3a38431SPaul Bohm	# If neither matched, then we have a broken ls.  This can happen
9510e3a38431SPaul Bohm	# if, for instance, CONFIG_SHELL is bash and it inherits a
9511e3a38431SPaul Bohm	# broken ls alias from the environment.  This has actually
9512e3a38431SPaul Bohm	# happened.  Such a system could not be considered "sane".
9513e3a38431SPaul Bohm	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
9514e3a38431SPaul Bohm  alias in your environment])
9515e3a38431SPaul Bohm     fi
9516*93823e6cSPaul Bohm     if test "$[2]" = conftest.file || test $am_try -eq 2; then
9517*93823e6cSPaul Bohm       break
9518*93823e6cSPaul Bohm     fi
9519*93823e6cSPaul Bohm     # Just in case.
9520*93823e6cSPaul Bohm     sleep 1
9521*93823e6cSPaul Bohm     am_has_slept=yes
9522*93823e6cSPaul Bohm   done
9523e3a38431SPaul Bohm   test "$[2]" = conftest.file
9524e3a38431SPaul Bohm   )
9525e3a38431SPaul Bohmthen
9526e3a38431SPaul Bohm   # Ok.
9527e3a38431SPaul Bohm   :
9528e3a38431SPaul Bohmelse
9529e3a38431SPaul Bohm   AC_MSG_ERROR([newly created file is older than distributed files!
9530e3a38431SPaul BohmCheck your system clock])
9531e3a38431SPaul Bohmfi
9532*93823e6cSPaul BohmAC_MSG_RESULT([yes])
9533*93823e6cSPaul Bohm# If we didn't sleep, we still need to ensure time stamps of config.status and
9534*93823e6cSPaul Bohm# generated files are strictly newer.
9535*93823e6cSPaul Bohmam_sleep_pid=
9536*93823e6cSPaul Bohmif grep 'slept: no' conftest.file >/dev/null 2>&1; then
9537*93823e6cSPaul Bohm  ( sleep 1 ) &
9538*93823e6cSPaul Bohm  am_sleep_pid=$!
9539*93823e6cSPaul Bohmfi
9540*93823e6cSPaul BohmAC_CONFIG_COMMANDS_PRE(
9541*93823e6cSPaul Bohm  [AC_MSG_CHECKING([that generated files are newer than configure])
9542*93823e6cSPaul Bohm   if test -n "$am_sleep_pid"; then
9543*93823e6cSPaul Bohm     # Hide warnings about reused PIDs.
9544*93823e6cSPaul Bohm     wait $am_sleep_pid 2>/dev/null
9545*93823e6cSPaul Bohm   fi
9546*93823e6cSPaul Bohm   AC_MSG_RESULT([done])])
9547*93823e6cSPaul Bohmrm -f conftest.file
9548*93823e6cSPaul Bohm])
9549e3a38431SPaul Bohm
9550*93823e6cSPaul Bohm# Copyright (C) 2009-2013 Free Software Foundation, Inc.
9551*93823e6cSPaul Bohm#
9552*93823e6cSPaul Bohm# This file is free software; the Free Software Foundation
9553*93823e6cSPaul Bohm# gives unlimited permission to copy and/or distribute it,
9554*93823e6cSPaul Bohm# with or without modifications, as long as this notice is preserved.
9555*93823e6cSPaul Bohm
9556*93823e6cSPaul Bohm# AM_SILENT_RULES([DEFAULT])
9557*93823e6cSPaul Bohm# --------------------------
9558*93823e6cSPaul Bohm# Enable less verbose build rules; with the default set to DEFAULT
9559*93823e6cSPaul Bohm# ("yes" being less verbose, "no" or empty being verbose).
9560*93823e6cSPaul BohmAC_DEFUN([AM_SILENT_RULES],
9561*93823e6cSPaul Bohm[AC_ARG_ENABLE([silent-rules], [dnl
9562*93823e6cSPaul BohmAS_HELP_STRING(
9563*93823e6cSPaul Bohm  [--enable-silent-rules],
9564*93823e6cSPaul Bohm  [less verbose build output (undo: "make V=1")])
9565*93823e6cSPaul BohmAS_HELP_STRING(
9566*93823e6cSPaul Bohm  [--disable-silent-rules],
9567*93823e6cSPaul Bohm  [verbose build output (undo: "make V=0")])dnl
9568*93823e6cSPaul Bohm])
9569*93823e6cSPaul Bohmcase $enable_silent_rules in @%:@ (((
9570*93823e6cSPaul Bohm  yes) AM_DEFAULT_VERBOSITY=0;;
9571*93823e6cSPaul Bohm   no) AM_DEFAULT_VERBOSITY=1;;
9572*93823e6cSPaul Bohm    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
9573*93823e6cSPaul Bohmesac
9574*93823e6cSPaul Bohmdnl
9575*93823e6cSPaul Bohmdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9576*93823e6cSPaul Bohmdnl do not support nested variable expansions.
9577*93823e6cSPaul Bohmdnl See automake bug#9928 and bug#10237.
9578*93823e6cSPaul Bohmam_make=${MAKE-make}
9579*93823e6cSPaul BohmAC_CACHE_CHECK([whether $am_make supports nested variables],
9580*93823e6cSPaul Bohm   [am_cv_make_support_nested_variables],
9581*93823e6cSPaul Bohm   [if AS_ECHO([['TRUE=$(BAR$(V))
9582*93823e6cSPaul BohmBAR0=false
9583*93823e6cSPaul BohmBAR1=true
9584*93823e6cSPaul BohmV=1
9585*93823e6cSPaul Bohmam__doit:
9586*93823e6cSPaul Bohm	@$(TRUE)
9587*93823e6cSPaul Bohm.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9588*93823e6cSPaul Bohm  am_cv_make_support_nested_variables=yes
9589*93823e6cSPaul Bohmelse
9590*93823e6cSPaul Bohm  am_cv_make_support_nested_variables=no
9591*93823e6cSPaul Bohmfi])
9592*93823e6cSPaul Bohmif test $am_cv_make_support_nested_variables = yes; then
9593*93823e6cSPaul Bohm  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9594*93823e6cSPaul Bohm  AM_V='$(V)'
9595*93823e6cSPaul Bohm  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9596*93823e6cSPaul Bohmelse
9597*93823e6cSPaul Bohm  AM_V=$AM_DEFAULT_VERBOSITY
9598*93823e6cSPaul Bohm  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
9599*93823e6cSPaul Bohmfi
9600*93823e6cSPaul BohmAC_SUBST([AM_V])dnl
9601*93823e6cSPaul BohmAM_SUBST_NOTMAKE([AM_V])dnl
9602*93823e6cSPaul BohmAC_SUBST([AM_DEFAULT_V])dnl
9603*93823e6cSPaul BohmAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
9604*93823e6cSPaul BohmAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
9605*93823e6cSPaul BohmAM_BACKSLASH='\'
9606*93823e6cSPaul BohmAC_SUBST([AM_BACKSLASH])dnl
9607*93823e6cSPaul Bohm_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
9608*93823e6cSPaul Bohm])
9609*93823e6cSPaul Bohm
9610*93823e6cSPaul Bohm# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9611e3a38431SPaul Bohm#
9612e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9613e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9614e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9615e3a38431SPaul Bohm
9616e3a38431SPaul Bohm# AM_PROG_INSTALL_STRIP
9617e3a38431SPaul Bohm# ---------------------
9618*93823e6cSPaul Bohm# One issue with vendor 'install' (even GNU) is that you can't
9619e3a38431SPaul Bohm# specify the program used to strip binaries.  This is especially
9620e3a38431SPaul Bohm# annoying in cross-compiling environments, where the build's strip
9621e3a38431SPaul Bohm# is unlikely to handle the host's binaries.
9622e3a38431SPaul Bohm# Fortunately install-sh will honor a STRIPPROG variable, so we
9623*93823e6cSPaul Bohm# always use install-sh in "make install-strip", and initialize
9624e3a38431SPaul Bohm# STRIPPROG with the value of the STRIP variable (set by the user).
9625e3a38431SPaul BohmAC_DEFUN([AM_PROG_INSTALL_STRIP],
9626e3a38431SPaul Bohm[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9627*93823e6cSPaul Bohm# Installed binaries are usually stripped using 'strip' when the user
9628*93823e6cSPaul Bohm# run "make install-strip".  However 'strip' might not be the right
9629e3a38431SPaul Bohm# tool to use in cross-compilation environments, therefore Automake
9630*93823e6cSPaul Bohm# will honor the 'STRIP' environment variable to overrule this program.
9631*93823e6cSPaul Bohmdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
9632e3a38431SPaul Bohmif test "$cross_compiling" != no; then
9633e3a38431SPaul Bohm  AC_CHECK_TOOL([STRIP], [strip], :)
9634e3a38431SPaul Bohmfi
9635e3a38431SPaul BohmINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9636e3a38431SPaul BohmAC_SUBST([INSTALL_STRIP_PROGRAM])])
9637e3a38431SPaul Bohm
9638*93823e6cSPaul Bohm# Copyright (C) 2006-2013 Free Software Foundation, Inc.
9639e3a38431SPaul Bohm#
9640e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9641e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9642e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9643e3a38431SPaul Bohm
9644e3a38431SPaul Bohm# _AM_SUBST_NOTMAKE(VARIABLE)
9645e3a38431SPaul Bohm# ---------------------------
9646e3a38431SPaul Bohm# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9647e3a38431SPaul Bohm# This macro is traced by Automake.
9648e3a38431SPaul BohmAC_DEFUN([_AM_SUBST_NOTMAKE])
9649e3a38431SPaul Bohm
9650e3a38431SPaul Bohm# AM_SUBST_NOTMAKE(VARIABLE)
9651*93823e6cSPaul Bohm# --------------------------
9652e3a38431SPaul Bohm# Public sister of _AM_SUBST_NOTMAKE.
9653e3a38431SPaul BohmAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9654e3a38431SPaul Bohm
9655e3a38431SPaul Bohm# Check how to create a tarball.                            -*- Autoconf -*-
9656e3a38431SPaul Bohm
9657*93823e6cSPaul Bohm# Copyright (C) 2004-2013 Free Software Foundation, Inc.
9658e3a38431SPaul Bohm#
9659e3a38431SPaul Bohm# This file is free software; the Free Software Foundation
9660e3a38431SPaul Bohm# gives unlimited permission to copy and/or distribute it,
9661e3a38431SPaul Bohm# with or without modifications, as long as this notice is preserved.
9662e3a38431SPaul Bohm
9663e3a38431SPaul Bohm# _AM_PROG_TAR(FORMAT)
9664e3a38431SPaul Bohm# --------------------
9665e3a38431SPaul Bohm# Check how to create a tarball in format FORMAT.
9666*93823e6cSPaul Bohm# FORMAT should be one of 'v7', 'ustar', or 'pax'.
9667e3a38431SPaul Bohm#
9668e3a38431SPaul Bohm# Substitute a variable $(am__tar) that is a command
9669e3a38431SPaul Bohm# writing to stdout a FORMAT-tarball containing the directory
9670e3a38431SPaul Bohm# $tardir.
9671e3a38431SPaul Bohm#     tardir=directory && $(am__tar) > result.tar
9672e3a38431SPaul Bohm#
9673e3a38431SPaul Bohm# Substitute a variable $(am__untar) that extract such
9674e3a38431SPaul Bohm# a tarball read from stdin.
9675e3a38431SPaul Bohm#     $(am__untar) < result.tar
9676*93823e6cSPaul Bohm#
9677e3a38431SPaul BohmAC_DEFUN([_AM_PROG_TAR],
9678*93823e6cSPaul Bohm[# Always define AMTAR for backward compatibility.  Yes, it's still used
9679*93823e6cSPaul Bohm# in the wild :-(  We should find a proper way to deprecate it ...
9680*93823e6cSPaul BohmAC_SUBST([AMTAR], ['$${TAR-tar}'])
9681*93823e6cSPaul Bohm
9682*93823e6cSPaul Bohm# We'll loop over all known methods to create a tar archive until one works.
9683e3a38431SPaul Bohm_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9684*93823e6cSPaul Bohm
9685*93823e6cSPaul Bohmm4_if([$1], [v7],
9686*93823e6cSPaul Bohm  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
9687*93823e6cSPaul Bohm
9688*93823e6cSPaul Bohm  [m4_case([$1],
9689*93823e6cSPaul Bohm    [ustar],
9690*93823e6cSPaul Bohm     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
9691*93823e6cSPaul Bohm      # There is notably a 21 bits limit for the UID and the GID.  In fact,
9692*93823e6cSPaul Bohm      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
9693*93823e6cSPaul Bohm      # and bug#13588).
9694*93823e6cSPaul Bohm      am_max_uid=2097151 # 2^21 - 1
9695*93823e6cSPaul Bohm      am_max_gid=$am_max_uid
9696*93823e6cSPaul Bohm      # The $UID and $GID variables are not portable, so we need to resort
9697*93823e6cSPaul Bohm      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
9698*93823e6cSPaul Bohm      # below are definitely unexpected, so allow the users to see them
9699*93823e6cSPaul Bohm      # (that is, avoid stderr redirection).
9700*93823e6cSPaul Bohm      am_uid=`id -u || echo unknown`
9701*93823e6cSPaul Bohm      am_gid=`id -g || echo unknown`
9702*93823e6cSPaul Bohm      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
9703*93823e6cSPaul Bohm      if test $am_uid -le $am_max_uid; then
9704*93823e6cSPaul Bohm         AC_MSG_RESULT([yes])
9705*93823e6cSPaul Bohm      else
9706*93823e6cSPaul Bohm         AC_MSG_RESULT([no])
9707*93823e6cSPaul Bohm         _am_tools=none
9708*93823e6cSPaul Bohm      fi
9709*93823e6cSPaul Bohm      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
9710*93823e6cSPaul Bohm      if test $am_gid -le $am_max_gid; then
9711*93823e6cSPaul Bohm         AC_MSG_RESULT([yes])
9712*93823e6cSPaul Bohm      else
9713*93823e6cSPaul Bohm        AC_MSG_RESULT([no])
9714*93823e6cSPaul Bohm        _am_tools=none
9715*93823e6cSPaul Bohm      fi],
9716*93823e6cSPaul Bohm
9717*93823e6cSPaul Bohm  [pax],
9718*93823e6cSPaul Bohm    [],
9719*93823e6cSPaul Bohm
9720*93823e6cSPaul Bohm  [m4_fatal([Unknown tar format])])
9721*93823e6cSPaul Bohm
9722*93823e6cSPaul Bohm  AC_MSG_CHECKING([how to create a $1 tar archive])
9723*93823e6cSPaul Bohm
9724*93823e6cSPaul Bohm  # Go ahead even if we have the value already cached.  We do so because we
9725*93823e6cSPaul Bohm  # need to set the values for the 'am__tar' and 'am__untar' variables.
9726e3a38431SPaul Bohm  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
9727*93823e6cSPaul Bohm
9728*93823e6cSPaul Bohm  for _am_tool in $_am_tools; do
9729e3a38431SPaul Bohm    case $_am_tool in
9730e3a38431SPaul Bohm    gnutar)
9731*93823e6cSPaul Bohm      for _am_tar in tar gnutar gtar; do
9732e3a38431SPaul Bohm        AM_RUN_LOG([$_am_tar --version]) && break
9733e3a38431SPaul Bohm      done
9734e3a38431SPaul Bohm      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9735e3a38431SPaul Bohm      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9736e3a38431SPaul Bohm      am__untar="$_am_tar -xf -"
9737e3a38431SPaul Bohm      ;;
9738e3a38431SPaul Bohm    plaintar)
9739e3a38431SPaul Bohm      # Must skip GNU tar: if it does not support --format= it doesn't create
9740e3a38431SPaul Bohm      # ustar tarball either.
9741e3a38431SPaul Bohm      (tar --version) >/dev/null 2>&1 && continue
9742e3a38431SPaul Bohm      am__tar='tar chf - "$$tardir"'
9743e3a38431SPaul Bohm      am__tar_='tar chf - "$tardir"'
9744e3a38431SPaul Bohm      am__untar='tar xf -'
9745e3a38431SPaul Bohm      ;;
9746e3a38431SPaul Bohm    pax)
9747e3a38431SPaul Bohm      am__tar='pax -L -x $1 -w "$$tardir"'
9748e3a38431SPaul Bohm      am__tar_='pax -L -x $1 -w "$tardir"'
9749e3a38431SPaul Bohm      am__untar='pax -r'
9750e3a38431SPaul Bohm      ;;
9751e3a38431SPaul Bohm    cpio)
9752e3a38431SPaul Bohm      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9753e3a38431SPaul Bohm      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9754e3a38431SPaul Bohm      am__untar='cpio -i -H $1 -d'
9755e3a38431SPaul Bohm      ;;
9756e3a38431SPaul Bohm    none)
9757e3a38431SPaul Bohm      am__tar=false
9758e3a38431SPaul Bohm      am__tar_=false
9759e3a38431SPaul Bohm      am__untar=false
9760e3a38431SPaul Bohm      ;;
9761e3a38431SPaul Bohm    esac
9762e3a38431SPaul Bohm
9763e3a38431SPaul Bohm    # If the value was cached, stop now.  We just wanted to have am__tar
9764e3a38431SPaul Bohm    # and am__untar set.
9765e3a38431SPaul Bohm    test -n "${am_cv_prog_tar_$1}" && break
9766e3a38431SPaul Bohm
9767*93823e6cSPaul Bohm    # tar/untar a dummy directory, and stop if the command works.
9768e3a38431SPaul Bohm    rm -rf conftest.dir
9769e3a38431SPaul Bohm    mkdir conftest.dir
9770e3a38431SPaul Bohm    echo GrepMe > conftest.dir/file
9771e3a38431SPaul Bohm    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
9772e3a38431SPaul Bohm    rm -rf conftest.dir
9773e3a38431SPaul Bohm    if test -s conftest.tar; then
9774e3a38431SPaul Bohm      AM_RUN_LOG([$am__untar <conftest.tar])
9775*93823e6cSPaul Bohm      AM_RUN_LOG([cat conftest.dir/file])
9776e3a38431SPaul Bohm      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9777e3a38431SPaul Bohm    fi
9778e3a38431SPaul Bohm  done
9779e3a38431SPaul Bohm  rm -rf conftest.dir
9780e3a38431SPaul Bohm
9781e3a38431SPaul Bohm  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
9782e3a38431SPaul Bohm  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
9783*93823e6cSPaul Bohm
9784e3a38431SPaul BohmAC_SUBST([am__tar])
9785e3a38431SPaul BohmAC_SUBST([am__untar])
9786e3a38431SPaul Bohm]) # _AM_PROG_TAR
9787e3a38431SPaul Bohm
9788