xref: /freebsd/contrib/openpam/m4/libtool.m4 (revision 3ba4c8c81a28de3e00ccf6d7f92c6f8e58bef456)
1f3b0ac34SDag-Erling Smørgrav# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2f3b0ac34SDag-Erling Smørgrav#
3*3ba4c8c8SDag-Erling Smørgrav#   Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
4*3ba4c8c8SDag-Erling Smørgrav#   Foundation, Inc.
5f3b0ac34SDag-Erling Smørgrav#   Written by Gordon Matzigkeit, 1996
6f3b0ac34SDag-Erling Smørgrav#
7f3b0ac34SDag-Erling Smørgrav# This file is free software; the Free Software Foundation gives
8f3b0ac34SDag-Erling Smørgrav# unlimited permission to copy and/or distribute it, with or without
9f3b0ac34SDag-Erling Smørgrav# modifications, as long as this notice is preserved.
10f3b0ac34SDag-Erling Smørgrav
11f3b0ac34SDag-Erling Smørgravm4_define([_LT_COPYING], [dnl
12f3b0ac34SDag-Erling Smørgrav# Copyright (C) 2014 Free Software Foundation, Inc.
13f3b0ac34SDag-Erling Smørgrav# This is free software; see the source for copying conditions.  There is NO
14f3b0ac34SDag-Erling Smørgrav# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15f3b0ac34SDag-Erling Smørgrav
16f3b0ac34SDag-Erling Smørgrav# GNU Libtool is free software; you can redistribute it and/or modify
17f3b0ac34SDag-Erling Smørgrav# it under the terms of the GNU General Public License as published by
18f3b0ac34SDag-Erling Smørgrav# the Free Software Foundation; either version 2 of of the License, or
19f3b0ac34SDag-Erling Smørgrav# (at your option) any later version.
20f3b0ac34SDag-Erling Smørgrav#
21f3b0ac34SDag-Erling Smørgrav# As a special exception to the GNU General Public License, if you
22f3b0ac34SDag-Erling Smørgrav# distribute this file as part of a program or library that is built
23f3b0ac34SDag-Erling Smørgrav# using GNU Libtool, you may include this file under the  same
24f3b0ac34SDag-Erling Smørgrav# distribution terms that you use for the rest of that program.
25f3b0ac34SDag-Erling Smørgrav#
26f3b0ac34SDag-Erling Smørgrav# GNU Libtool is distributed in the hope that it will be useful, but
27f3b0ac34SDag-Erling Smørgrav# WITHOUT ANY WARRANTY; without even the implied warranty of
28f3b0ac34SDag-Erling Smørgrav# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29f3b0ac34SDag-Erling Smørgrav# GNU General Public License for more details.
30f3b0ac34SDag-Erling Smørgrav#
31f3b0ac34SDag-Erling Smørgrav# You should have received a copy of the GNU General Public License
32f3b0ac34SDag-Erling Smørgrav# along with this program.  If not, see <http://www.gnu.org/licenses/>.
33f3b0ac34SDag-Erling Smørgrav])
34f3b0ac34SDag-Erling Smørgrav
35*3ba4c8c8SDag-Erling Smørgrav# serial 59 LT_INIT
36f3b0ac34SDag-Erling Smørgrav
37f3b0ac34SDag-Erling Smørgrav
38f3b0ac34SDag-Erling Smørgrav# LT_PREREQ(VERSION)
39f3b0ac34SDag-Erling Smørgrav# ------------------
40f3b0ac34SDag-Erling Smørgrav# Complain and exit if this libtool version is less that VERSION.
41f3b0ac34SDag-Erling Smørgravm4_defun([LT_PREREQ],
42f3b0ac34SDag-Erling Smørgrav[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
43f3b0ac34SDag-Erling Smørgrav       [m4_default([$3],
44f3b0ac34SDag-Erling Smørgrav		   [m4_fatal([Libtool version $1 or higher is required],
45f3b0ac34SDag-Erling Smørgrav		             63)])],
46f3b0ac34SDag-Erling Smørgrav       [$2])])
47f3b0ac34SDag-Erling Smørgrav
48f3b0ac34SDag-Erling Smørgrav
49f3b0ac34SDag-Erling Smørgrav# _LT_CHECK_BUILDDIR
50f3b0ac34SDag-Erling Smørgrav# ------------------
51f3b0ac34SDag-Erling Smørgrav# Complain if the absolute build directory name contains unusual characters
52f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CHECK_BUILDDIR],
53f3b0ac34SDag-Erling Smørgrav[case `pwd` in
54f3b0ac34SDag-Erling Smørgrav  *\ * | *\	*)
55f3b0ac34SDag-Erling Smørgrav    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
56f3b0ac34SDag-Erling Smørgravesac
57f3b0ac34SDag-Erling Smørgrav])
58f3b0ac34SDag-Erling Smørgrav
59f3b0ac34SDag-Erling Smørgrav
60f3b0ac34SDag-Erling Smørgrav# LT_INIT([OPTIONS])
61f3b0ac34SDag-Erling Smørgrav# ------------------
62f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_INIT],
63f3b0ac34SDag-Erling Smørgrav[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
64f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
65f3b0ac34SDag-Erling SmørgravAC_BEFORE([$0], [LT_LANG])dnl
66f3b0ac34SDag-Erling SmørgravAC_BEFORE([$0], [LT_OUTPUT])dnl
67f3b0ac34SDag-Erling SmørgravAC_BEFORE([$0], [LTDL_INIT])dnl
68f3b0ac34SDag-Erling Smørgravm4_require([_LT_CHECK_BUILDDIR])dnl
69f3b0ac34SDag-Erling Smørgrav
70f3b0ac34SDag-Erling Smørgravdnl Autoconf doesn't catch unexpanded LT_ macros by default:
71f3b0ac34SDag-Erling Smørgravm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
72f3b0ac34SDag-Erling Smørgravm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
73f3b0ac34SDag-Erling Smørgravdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
74f3b0ac34SDag-Erling Smørgravdnl unless we require an AC_DEFUNed macro:
75f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LTOPTIONS_VERSION])dnl
76f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LTSUGAR_VERSION])dnl
77f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LTVERSION_VERSION])dnl
78f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LTOBSOLETE_VERSION])dnl
79f3b0ac34SDag-Erling Smørgravm4_require([_LT_PROG_LTMAIN])dnl
80f3b0ac34SDag-Erling Smørgrav
81f3b0ac34SDag-Erling Smørgrav_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
82f3b0ac34SDag-Erling Smørgrav
83f3b0ac34SDag-Erling Smørgravdnl Parse OPTIONS
84f3b0ac34SDag-Erling Smørgrav_LT_SET_OPTIONS([$0], [$1])
85f3b0ac34SDag-Erling Smørgrav
86f3b0ac34SDag-Erling Smørgrav# This can be used to rebuild libtool when needed
87f3b0ac34SDag-Erling SmørgravLIBTOOL_DEPS=$ltmain
88f3b0ac34SDag-Erling Smørgrav
89f3b0ac34SDag-Erling Smørgrav# Always use our own libtool.
90f3b0ac34SDag-Erling SmørgravLIBTOOL='$(SHELL) $(top_builddir)/libtool'
91f3b0ac34SDag-Erling SmørgravAC_SUBST(LIBTOOL)dnl
92f3b0ac34SDag-Erling Smørgrav
93f3b0ac34SDag-Erling Smørgrav_LT_SETUP
94f3b0ac34SDag-Erling Smørgrav
95f3b0ac34SDag-Erling Smørgrav# Only expand once:
96f3b0ac34SDag-Erling Smørgravm4_define([LT_INIT])
97f3b0ac34SDag-Erling Smørgrav])# LT_INIT
98f3b0ac34SDag-Erling Smørgrav
99f3b0ac34SDag-Erling Smørgrav# Old names:
100f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
101f3b0ac34SDag-Erling SmørgravAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
102f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
103f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
104f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
105f3b0ac34SDag-Erling Smørgrav
106f3b0ac34SDag-Erling Smørgrav
107f3b0ac34SDag-Erling Smørgrav# _LT_PREPARE_CC_BASENAME
108f3b0ac34SDag-Erling Smørgrav# -----------------------
109f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PREPARE_CC_BASENAME], [
110f3b0ac34SDag-Erling Smørgrav# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
111f3b0ac34SDag-Erling Smørgravfunc_cc_basename ()
112f3b0ac34SDag-Erling Smørgrav{
113f3b0ac34SDag-Erling Smørgrav    for cc_temp in @S|@*""; do
114f3b0ac34SDag-Erling Smørgrav      case $cc_temp in
115f3b0ac34SDag-Erling Smørgrav        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
116f3b0ac34SDag-Erling Smørgrav        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
117f3b0ac34SDag-Erling Smørgrav        \-*) ;;
118f3b0ac34SDag-Erling Smørgrav        *) break;;
119f3b0ac34SDag-Erling Smørgrav      esac
120f3b0ac34SDag-Erling Smørgrav    done
121f3b0ac34SDag-Erling Smørgrav    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
122f3b0ac34SDag-Erling Smørgrav}
123f3b0ac34SDag-Erling Smørgrav])# _LT_PREPARE_CC_BASENAME
124f3b0ac34SDag-Erling Smørgrav
125f3b0ac34SDag-Erling Smørgrav
126f3b0ac34SDag-Erling Smørgrav# _LT_CC_BASENAME(CC)
127f3b0ac34SDag-Erling Smørgrav# -------------------
128f3b0ac34SDag-Erling Smørgrav# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
129f3b0ac34SDag-Erling Smørgrav# but that macro is also expanded into generated libtool script, which
130f3b0ac34SDag-Erling Smørgrav# arranges for $SED and $ECHO to be set by different means.
131f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CC_BASENAME],
132f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_PREPARE_CC_BASENAME])dnl
133f3b0ac34SDag-Erling SmørgravAC_REQUIRE([_LT_DECL_SED])dnl
134f3b0ac34SDag-Erling SmørgravAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
135f3b0ac34SDag-Erling Smørgravfunc_cc_basename $1
136f3b0ac34SDag-Erling Smørgravcc_basename=$func_cc_basename_result
137f3b0ac34SDag-Erling Smørgrav])
138f3b0ac34SDag-Erling Smørgrav
139f3b0ac34SDag-Erling Smørgrav
140f3b0ac34SDag-Erling Smørgrav# _LT_FILEUTILS_DEFAULTS
141f3b0ac34SDag-Erling Smørgrav# ----------------------
142f3b0ac34SDag-Erling Smørgrav# It is okay to use these file commands and assume they have been set
143f3b0ac34SDag-Erling Smørgrav# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
144f3b0ac34SDag-Erling Smørgravm4_defun([_LT_FILEUTILS_DEFAULTS],
145f3b0ac34SDag-Erling Smørgrav[: ${CP="cp -f"}
146f3b0ac34SDag-Erling Smørgrav: ${MV="mv -f"}
147f3b0ac34SDag-Erling Smørgrav: ${RM="rm -f"}
148f3b0ac34SDag-Erling Smørgrav])# _LT_FILEUTILS_DEFAULTS
149f3b0ac34SDag-Erling Smørgrav
150f3b0ac34SDag-Erling Smørgrav
151f3b0ac34SDag-Erling Smørgrav# _LT_SETUP
152f3b0ac34SDag-Erling Smørgrav# ---------
153f3b0ac34SDag-Erling Smørgravm4_defun([_LT_SETUP],
154f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_CANONICAL_HOST])dnl
155f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_CANONICAL_BUILD])dnl
156f3b0ac34SDag-Erling SmørgravAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
157f3b0ac34SDag-Erling SmørgravAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
158f3b0ac34SDag-Erling Smørgrav
159f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
160f3b0ac34SDag-Erling Smørgravdnl
161f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [host_alias], [0], [The host system])dnl
162f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [host], [0])dnl
163f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [host_os], [0])dnl
164f3b0ac34SDag-Erling Smørgravdnl
165f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [build_alias], [0], [The build system])dnl
166f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [build], [0])dnl
167f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [build_os], [0])dnl
168f3b0ac34SDag-Erling Smørgravdnl
169f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_PROG_CC])dnl
170f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LT_PATH_LD])dnl
171f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LT_PATH_NM])dnl
172f3b0ac34SDag-Erling Smørgravdnl
173f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_PROG_LN_S])dnl
174f3b0ac34SDag-Erling Smørgravtest -z "$LN_S" && LN_S="ln -s"
175f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
176f3b0ac34SDag-Erling Smørgravdnl
177f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LT_CMD_MAX_LEN])dnl
178f3b0ac34SDag-Erling Smørgrav_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
179f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
180f3b0ac34SDag-Erling Smørgravdnl
181f3b0ac34SDag-Erling Smørgravm4_require([_LT_FILEUTILS_DEFAULTS])dnl
182f3b0ac34SDag-Erling Smørgravm4_require([_LT_CHECK_SHELL_FEATURES])dnl
183f3b0ac34SDag-Erling Smørgravm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
184f3b0ac34SDag-Erling Smørgravm4_require([_LT_CMD_RELOAD])dnl
185*3ba4c8c8SDag-Erling Smørgravm4_require([_LT_DECL_FILECMD])dnl
186f3b0ac34SDag-Erling Smørgravm4_require([_LT_CHECK_MAGIC_METHOD])dnl
187f3b0ac34SDag-Erling Smørgravm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
188f3b0ac34SDag-Erling Smørgravm4_require([_LT_CMD_OLD_ARCHIVE])dnl
189f3b0ac34SDag-Erling Smørgravm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
190f3b0ac34SDag-Erling Smørgravm4_require([_LT_WITH_SYSROOT])dnl
191f3b0ac34SDag-Erling Smørgravm4_require([_LT_CMD_TRUNCATE])dnl
192f3b0ac34SDag-Erling Smørgrav
193f3b0ac34SDag-Erling Smørgrav_LT_CONFIG_LIBTOOL_INIT([
194f3b0ac34SDag-Erling Smørgrav# See if we are running on zsh, and set the options that allow our
195f3b0ac34SDag-Erling Smørgrav# commands through without removal of \ escapes INIT.
196f3b0ac34SDag-Erling Smørgravif test -n "\${ZSH_VERSION+set}"; then
197f3b0ac34SDag-Erling Smørgrav   setopt NO_GLOB_SUBST
198f3b0ac34SDag-Erling Smørgravfi
199f3b0ac34SDag-Erling Smørgrav])
200f3b0ac34SDag-Erling Smørgravif test -n "${ZSH_VERSION+set}"; then
201f3b0ac34SDag-Erling Smørgrav   setopt NO_GLOB_SUBST
202f3b0ac34SDag-Erling Smørgravfi
203f3b0ac34SDag-Erling Smørgrav
204f3b0ac34SDag-Erling Smørgrav_LT_CHECK_OBJDIR
205f3b0ac34SDag-Erling Smørgrav
206f3b0ac34SDag-Erling Smørgravm4_require([_LT_TAG_COMPILER])dnl
207f3b0ac34SDag-Erling Smørgrav
208f3b0ac34SDag-Erling Smørgravcase $host_os in
209f3b0ac34SDag-Erling Smørgravaix3*)
210f3b0ac34SDag-Erling Smørgrav  # AIX sometimes has problems with the GCC collect2 program.  For some
211f3b0ac34SDag-Erling Smørgrav  # reason, if we set the COLLECT_NAMES environment variable, the problems
212f3b0ac34SDag-Erling Smørgrav  # vanish in a puff of smoke.
213f3b0ac34SDag-Erling Smørgrav  if test set != "${COLLECT_NAMES+set}"; then
214f3b0ac34SDag-Erling Smørgrav    COLLECT_NAMES=
215f3b0ac34SDag-Erling Smørgrav    export COLLECT_NAMES
216f3b0ac34SDag-Erling Smørgrav  fi
217f3b0ac34SDag-Erling Smørgrav  ;;
218f3b0ac34SDag-Erling Smørgravesac
219f3b0ac34SDag-Erling Smørgrav
220f3b0ac34SDag-Erling Smørgrav# Global variables:
221f3b0ac34SDag-Erling Smørgravofile=libtool
222f3b0ac34SDag-Erling Smørgravcan_build_shared=yes
223f3b0ac34SDag-Erling Smørgrav
224*3ba4c8c8SDag-Erling Smørgrav# All known linkers require a '.a' archive for static linking (except MSVC and
225*3ba4c8c8SDag-Erling Smørgrav# ICC, which need '.lib').
226f3b0ac34SDag-Erling Smørgravlibext=a
227f3b0ac34SDag-Erling Smørgrav
228f3b0ac34SDag-Erling Smørgravwith_gnu_ld=$lt_cv_prog_gnu_ld
229f3b0ac34SDag-Erling Smørgrav
230f3b0ac34SDag-Erling Smørgravold_CC=$CC
231f3b0ac34SDag-Erling Smørgravold_CFLAGS=$CFLAGS
232f3b0ac34SDag-Erling Smørgrav
233f3b0ac34SDag-Erling Smørgrav# Set sane defaults for various variables
234f3b0ac34SDag-Erling Smørgravtest -z "$CC" && CC=cc
235f3b0ac34SDag-Erling Smørgravtest -z "$LTCC" && LTCC=$CC
236f3b0ac34SDag-Erling Smørgravtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
237f3b0ac34SDag-Erling Smørgravtest -z "$LD" && LD=ld
238f3b0ac34SDag-Erling Smørgravtest -z "$ac_objext" && ac_objext=o
239f3b0ac34SDag-Erling Smørgrav
240f3b0ac34SDag-Erling Smørgrav_LT_CC_BASENAME([$compiler])
241f3b0ac34SDag-Erling Smørgrav
242f3b0ac34SDag-Erling Smørgrav# Only perform the check for file, if the check method requires it
243f3b0ac34SDag-Erling Smørgravtest -z "$MAGIC_CMD" && MAGIC_CMD=file
244f3b0ac34SDag-Erling Smørgravcase $deplibs_check_method in
245f3b0ac34SDag-Erling Smørgravfile_magic*)
246f3b0ac34SDag-Erling Smørgrav  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
247f3b0ac34SDag-Erling Smørgrav    _LT_PATH_MAGIC
248f3b0ac34SDag-Erling Smørgrav  fi
249f3b0ac34SDag-Erling Smørgrav  ;;
250f3b0ac34SDag-Erling Smørgravesac
251f3b0ac34SDag-Erling Smørgrav
252f3b0ac34SDag-Erling Smørgrav# Use C for the default configuration in the libtool script
253f3b0ac34SDag-Erling SmørgravLT_SUPPORTED_TAG([CC])
254f3b0ac34SDag-Erling Smørgrav_LT_LANG_C_CONFIG
255f3b0ac34SDag-Erling Smørgrav_LT_LANG_DEFAULT_CONFIG
256f3b0ac34SDag-Erling Smørgrav_LT_CONFIG_COMMANDS
257f3b0ac34SDag-Erling Smørgrav])# _LT_SETUP
258f3b0ac34SDag-Erling Smørgrav
259f3b0ac34SDag-Erling Smørgrav
260f3b0ac34SDag-Erling Smørgrav# _LT_PREPARE_SED_QUOTE_VARS
261f3b0ac34SDag-Erling Smørgrav# --------------------------
262f3b0ac34SDag-Erling Smørgrav# Define a few sed substitution that help us do robust quoting.
263f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
264f3b0ac34SDag-Erling Smørgrav[# Backslashify metacharacters that are still active within
265f3b0ac34SDag-Erling Smørgrav# double-quoted strings.
266f3b0ac34SDag-Erling Smørgravsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
267f3b0ac34SDag-Erling Smørgrav
268f3b0ac34SDag-Erling Smørgrav# Same as above, but do not quote variable references.
269f3b0ac34SDag-Erling Smørgravdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
270f3b0ac34SDag-Erling Smørgrav
271f3b0ac34SDag-Erling Smørgrav# Sed substitution to delay expansion of an escaped shell variable in a
272f3b0ac34SDag-Erling Smørgrav# double_quote_subst'ed string.
273f3b0ac34SDag-Erling Smørgravdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
274f3b0ac34SDag-Erling Smørgrav
275f3b0ac34SDag-Erling Smørgrav# Sed substitution to delay expansion of an escaped single quote.
276f3b0ac34SDag-Erling Smørgravdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
277f3b0ac34SDag-Erling Smørgrav
278f3b0ac34SDag-Erling Smørgrav# Sed substitution to avoid accidental globbing in evaled expressions
279f3b0ac34SDag-Erling Smørgravno_glob_subst='s/\*/\\\*/g'
280f3b0ac34SDag-Erling Smørgrav])
281f3b0ac34SDag-Erling Smørgrav
282f3b0ac34SDag-Erling Smørgrav# _LT_PROG_LTMAIN
283f3b0ac34SDag-Erling Smørgrav# ---------------
284f3b0ac34SDag-Erling Smørgrav# Note that this code is called both from 'configure', and 'config.status'
285f3b0ac34SDag-Erling Smørgrav# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
286f3b0ac34SDag-Erling Smørgrav# 'config.status' has no value for ac_aux_dir unless we are using Automake,
287f3b0ac34SDag-Erling Smørgrav# so we pass a copy along to make sure it has a sensible value anyway.
288f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PROG_LTMAIN],
289f3b0ac34SDag-Erling Smørgrav[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
290f3b0ac34SDag-Erling Smørgrav_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
291f3b0ac34SDag-Erling Smørgravltmain=$ac_aux_dir/ltmain.sh
292f3b0ac34SDag-Erling Smørgrav])# _LT_PROG_LTMAIN
293f3b0ac34SDag-Erling Smørgrav
294f3b0ac34SDag-Erling Smørgrav
295f3b0ac34SDag-Erling Smørgrav## ------------------------------------- ##
296f3b0ac34SDag-Erling Smørgrav## Accumulate code for creating libtool. ##
297f3b0ac34SDag-Erling Smørgrav## ------------------------------------- ##
298f3b0ac34SDag-Erling Smørgrav
299f3b0ac34SDag-Erling Smørgrav# So that we can recreate a full libtool script including additional
300f3b0ac34SDag-Erling Smørgrav# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
301f3b0ac34SDag-Erling Smørgrav# in macros and then make a single call at the end using the 'libtool'
302f3b0ac34SDag-Erling Smørgrav# label.
303f3b0ac34SDag-Erling Smørgrav
304f3b0ac34SDag-Erling Smørgrav
305f3b0ac34SDag-Erling Smørgrav# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
306f3b0ac34SDag-Erling Smørgrav# ----------------------------------------
307f3b0ac34SDag-Erling Smørgrav# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
308f3b0ac34SDag-Erling Smørgravm4_define([_LT_CONFIG_LIBTOOL_INIT],
309f3b0ac34SDag-Erling Smørgrav[m4_ifval([$1],
310f3b0ac34SDag-Erling Smørgrav          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
311f3b0ac34SDag-Erling Smørgrav                     [$1
312f3b0ac34SDag-Erling Smørgrav])])])
313f3b0ac34SDag-Erling Smørgrav
314f3b0ac34SDag-Erling Smørgrav# Initialize.
315f3b0ac34SDag-Erling Smørgravm4_define([_LT_OUTPUT_LIBTOOL_INIT])
316f3b0ac34SDag-Erling Smørgrav
317f3b0ac34SDag-Erling Smørgrav
318f3b0ac34SDag-Erling Smørgrav# _LT_CONFIG_LIBTOOL([COMMANDS])
319f3b0ac34SDag-Erling Smørgrav# ------------------------------
320f3b0ac34SDag-Erling Smørgrav# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
321f3b0ac34SDag-Erling Smørgravm4_define([_LT_CONFIG_LIBTOOL],
322f3b0ac34SDag-Erling Smørgrav[m4_ifval([$1],
323f3b0ac34SDag-Erling Smørgrav          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
324f3b0ac34SDag-Erling Smørgrav                     [$1
325f3b0ac34SDag-Erling Smørgrav])])])
326f3b0ac34SDag-Erling Smørgrav
327f3b0ac34SDag-Erling Smørgrav# Initialize.
328f3b0ac34SDag-Erling Smørgravm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
329f3b0ac34SDag-Erling Smørgrav
330f3b0ac34SDag-Erling Smørgrav
331f3b0ac34SDag-Erling Smørgrav# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
332f3b0ac34SDag-Erling Smørgrav# -----------------------------------------------------
333f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CONFIG_SAVE_COMMANDS],
334f3b0ac34SDag-Erling Smørgrav[_LT_CONFIG_LIBTOOL([$1])
335f3b0ac34SDag-Erling Smørgrav_LT_CONFIG_LIBTOOL_INIT([$2])
336f3b0ac34SDag-Erling Smørgrav])
337f3b0ac34SDag-Erling Smørgrav
338f3b0ac34SDag-Erling Smørgrav
339f3b0ac34SDag-Erling Smørgrav# _LT_FORMAT_COMMENT([COMMENT])
340f3b0ac34SDag-Erling Smørgrav# -----------------------------
341f3b0ac34SDag-Erling Smørgrav# Add leading comment marks to the start of each line, and a trailing
342f3b0ac34SDag-Erling Smørgrav# full-stop to the whole comment if one is not present already.
343f3b0ac34SDag-Erling Smørgravm4_define([_LT_FORMAT_COMMENT],
344f3b0ac34SDag-Erling Smørgrav[m4_ifval([$1], [
345f3b0ac34SDag-Erling Smørgravm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
346f3b0ac34SDag-Erling Smørgrav              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
347f3b0ac34SDag-Erling Smørgrav)])
348f3b0ac34SDag-Erling Smørgrav
349f3b0ac34SDag-Erling Smørgrav
350f3b0ac34SDag-Erling Smørgrav
351f3b0ac34SDag-Erling Smørgrav## ------------------------ ##
352f3b0ac34SDag-Erling Smørgrav## FIXME: Eliminate VARNAME ##
353f3b0ac34SDag-Erling Smørgrav## ------------------------ ##
354f3b0ac34SDag-Erling Smørgrav
355f3b0ac34SDag-Erling Smørgrav
356f3b0ac34SDag-Erling Smørgrav# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
357f3b0ac34SDag-Erling Smørgrav# -------------------------------------------------------------------
358f3b0ac34SDag-Erling Smørgrav# CONFIGNAME is the name given to the value in the libtool script.
359f3b0ac34SDag-Erling Smørgrav# VARNAME is the (base) name used in the configure script.
360f3b0ac34SDag-Erling Smørgrav# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
361f3b0ac34SDag-Erling Smørgrav# VARNAME.  Any other value will be used directly.
362f3b0ac34SDag-Erling Smørgravm4_define([_LT_DECL],
363f3b0ac34SDag-Erling Smørgrav[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
364f3b0ac34SDag-Erling Smørgrav    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
365f3b0ac34SDag-Erling Smørgrav	[m4_ifval([$1], [$1], [$2])])
366f3b0ac34SDag-Erling Smørgrav    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
367f3b0ac34SDag-Erling Smørgrav    m4_ifval([$4],
368f3b0ac34SDag-Erling Smørgrav	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
369f3b0ac34SDag-Erling Smørgrav    lt_dict_add_subkey([lt_decl_dict], [$2],
370f3b0ac34SDag-Erling Smørgrav	[tagged?], [m4_ifval([$5], [yes], [no])])])
371f3b0ac34SDag-Erling Smørgrav])
372f3b0ac34SDag-Erling Smørgrav
373f3b0ac34SDag-Erling Smørgrav
374f3b0ac34SDag-Erling Smørgrav# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
375f3b0ac34SDag-Erling Smørgrav# --------------------------------------------------------
376f3b0ac34SDag-Erling Smørgravm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
377f3b0ac34SDag-Erling Smørgrav
378f3b0ac34SDag-Erling Smørgrav
379f3b0ac34SDag-Erling Smørgrav# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
380f3b0ac34SDag-Erling Smørgrav# ------------------------------------------------
381f3b0ac34SDag-Erling Smørgravm4_define([lt_decl_tag_varnames],
382f3b0ac34SDag-Erling Smørgrav[_lt_decl_filter([tagged?], [yes], $@)])
383f3b0ac34SDag-Erling Smørgrav
384f3b0ac34SDag-Erling Smørgrav
385f3b0ac34SDag-Erling Smørgrav# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
386f3b0ac34SDag-Erling Smørgrav# ---------------------------------------------------------
387f3b0ac34SDag-Erling Smørgravm4_define([_lt_decl_filter],
388f3b0ac34SDag-Erling Smørgrav[m4_case([$#],
389f3b0ac34SDag-Erling Smørgrav  [0], [m4_fatal([$0: too few arguments: $#])],
390f3b0ac34SDag-Erling Smørgrav  [1], [m4_fatal([$0: too few arguments: $#: $1])],
391f3b0ac34SDag-Erling Smørgrav  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
392f3b0ac34SDag-Erling Smørgrav  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
393f3b0ac34SDag-Erling Smørgrav  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
394f3b0ac34SDag-Erling Smørgrav])
395f3b0ac34SDag-Erling Smørgrav
396f3b0ac34SDag-Erling Smørgrav
397f3b0ac34SDag-Erling Smørgrav# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
398f3b0ac34SDag-Erling Smørgrav# --------------------------------------------------
399f3b0ac34SDag-Erling Smørgravm4_define([lt_decl_quote_varnames],
400f3b0ac34SDag-Erling Smørgrav[_lt_decl_filter([value], [1], $@)])
401f3b0ac34SDag-Erling Smørgrav
402f3b0ac34SDag-Erling Smørgrav
403f3b0ac34SDag-Erling Smørgrav# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
404f3b0ac34SDag-Erling Smørgrav# ---------------------------------------------------
405f3b0ac34SDag-Erling Smørgravm4_define([lt_decl_dquote_varnames],
406f3b0ac34SDag-Erling Smørgrav[_lt_decl_filter([value], [2], $@)])
407f3b0ac34SDag-Erling Smørgrav
408f3b0ac34SDag-Erling Smørgrav
409f3b0ac34SDag-Erling Smørgrav# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
410f3b0ac34SDag-Erling Smørgrav# ---------------------------------------------------
411f3b0ac34SDag-Erling Smørgravm4_define([lt_decl_varnames_tagged],
412f3b0ac34SDag-Erling Smørgrav[m4_assert([$# <= 2])dnl
413f3b0ac34SDag-Erling Smørgrav_$0(m4_quote(m4_default([$1], [[, ]])),
414f3b0ac34SDag-Erling Smørgrav    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
415f3b0ac34SDag-Erling Smørgrav    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
416f3b0ac34SDag-Erling Smørgravm4_define([_lt_decl_varnames_tagged],
417f3b0ac34SDag-Erling Smørgrav[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
418f3b0ac34SDag-Erling Smørgrav
419f3b0ac34SDag-Erling Smørgrav
420f3b0ac34SDag-Erling Smørgrav# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
421f3b0ac34SDag-Erling Smørgrav# ------------------------------------------------
422f3b0ac34SDag-Erling Smørgravm4_define([lt_decl_all_varnames],
423f3b0ac34SDag-Erling Smørgrav[_$0(m4_quote(m4_default([$1], [[, ]])),
424f3b0ac34SDag-Erling Smørgrav     m4_if([$2], [],
425f3b0ac34SDag-Erling Smørgrav	   m4_quote(lt_decl_varnames),
426f3b0ac34SDag-Erling Smørgrav	m4_quote(m4_shift($@))))[]dnl
427f3b0ac34SDag-Erling Smørgrav])
428f3b0ac34SDag-Erling Smørgravm4_define([_lt_decl_all_varnames],
429f3b0ac34SDag-Erling Smørgrav[lt_join($@, lt_decl_varnames_tagged([$1],
430f3b0ac34SDag-Erling Smørgrav			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
431f3b0ac34SDag-Erling Smørgrav])
432f3b0ac34SDag-Erling Smørgrav
433f3b0ac34SDag-Erling Smørgrav
434f3b0ac34SDag-Erling Smørgrav# _LT_CONFIG_STATUS_DECLARE([VARNAME])
435f3b0ac34SDag-Erling Smørgrav# ------------------------------------
436f3b0ac34SDag-Erling Smørgrav# Quote a variable value, and forward it to 'config.status' so that its
437f3b0ac34SDag-Erling Smørgrav# declaration there will have the same value as in 'configure'.  VARNAME
438f3b0ac34SDag-Erling Smørgrav# must have a single quote delimited value for this to work.
439f3b0ac34SDag-Erling Smørgravm4_define([_LT_CONFIG_STATUS_DECLARE],
440f3b0ac34SDag-Erling Smørgrav[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
441f3b0ac34SDag-Erling Smørgrav
442f3b0ac34SDag-Erling Smørgrav
443f3b0ac34SDag-Erling Smørgrav# _LT_CONFIG_STATUS_DECLARATIONS
444f3b0ac34SDag-Erling Smørgrav# ------------------------------
445f3b0ac34SDag-Erling Smørgrav# We delimit libtool config variables with single quotes, so when
446f3b0ac34SDag-Erling Smørgrav# we write them to config.status, we have to be sure to quote all
447f3b0ac34SDag-Erling Smørgrav# embedded single quotes properly.  In configure, this macro expands
448f3b0ac34SDag-Erling Smørgrav# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
449f3b0ac34SDag-Erling Smørgrav#
450f3b0ac34SDag-Erling Smørgrav#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
451f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
452f3b0ac34SDag-Erling Smørgrav[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
453f3b0ac34SDag-Erling Smørgrav    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
454f3b0ac34SDag-Erling Smørgrav
455f3b0ac34SDag-Erling Smørgrav
456f3b0ac34SDag-Erling Smørgrav# _LT_LIBTOOL_TAGS
457f3b0ac34SDag-Erling Smørgrav# ----------------
458f3b0ac34SDag-Erling Smørgrav# Output comment and list of tags supported by the script
459f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LIBTOOL_TAGS],
460f3b0ac34SDag-Erling Smørgrav[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
461f3b0ac34SDag-Erling Smørgravavailable_tags='_LT_TAGS'dnl
462f3b0ac34SDag-Erling Smørgrav])
463f3b0ac34SDag-Erling Smørgrav
464f3b0ac34SDag-Erling Smørgrav
465f3b0ac34SDag-Erling Smørgrav# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
466f3b0ac34SDag-Erling Smørgrav# -----------------------------------
467f3b0ac34SDag-Erling Smørgrav# Extract the dictionary values for VARNAME (optionally with TAG) and
468f3b0ac34SDag-Erling Smørgrav# expand to a commented shell variable setting:
469f3b0ac34SDag-Erling Smørgrav#
470f3b0ac34SDag-Erling Smørgrav#    # Some comment about what VAR is for.
471f3b0ac34SDag-Erling Smørgrav#    visible_name=$lt_internal_name
472f3b0ac34SDag-Erling Smørgravm4_define([_LT_LIBTOOL_DECLARE],
473f3b0ac34SDag-Erling Smørgrav[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
474f3b0ac34SDag-Erling Smørgrav					   [description])))[]dnl
475f3b0ac34SDag-Erling Smørgravm4_pushdef([_libtool_name],
476f3b0ac34SDag-Erling Smørgrav    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
477f3b0ac34SDag-Erling Smørgravm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
478f3b0ac34SDag-Erling Smørgrav    [0], [_libtool_name=[$]$1],
479f3b0ac34SDag-Erling Smørgrav    [1], [_libtool_name=$lt_[]$1],
480f3b0ac34SDag-Erling Smørgrav    [2], [_libtool_name=$lt_[]$1],
481f3b0ac34SDag-Erling Smørgrav    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
482f3b0ac34SDag-Erling Smørgravm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
483f3b0ac34SDag-Erling Smørgrav])
484f3b0ac34SDag-Erling Smørgrav
485f3b0ac34SDag-Erling Smørgrav
486f3b0ac34SDag-Erling Smørgrav# _LT_LIBTOOL_CONFIG_VARS
487f3b0ac34SDag-Erling Smørgrav# -----------------------
488f3b0ac34SDag-Erling Smørgrav# Produce commented declarations of non-tagged libtool config variables
489f3b0ac34SDag-Erling Smørgrav# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
490f3b0ac34SDag-Erling Smørgrav# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
491f3b0ac34SDag-Erling Smørgrav# section) are produced by _LT_LIBTOOL_TAG_VARS.
492f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LIBTOOL_CONFIG_VARS],
493f3b0ac34SDag-Erling Smørgrav[m4_foreach([_lt_var],
494f3b0ac34SDag-Erling Smørgrav    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
495f3b0ac34SDag-Erling Smørgrav    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
496f3b0ac34SDag-Erling Smørgrav
497f3b0ac34SDag-Erling Smørgrav
498f3b0ac34SDag-Erling Smørgrav# _LT_LIBTOOL_TAG_VARS(TAG)
499f3b0ac34SDag-Erling Smørgrav# -------------------------
500f3b0ac34SDag-Erling Smørgravm4_define([_LT_LIBTOOL_TAG_VARS],
501f3b0ac34SDag-Erling Smørgrav[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
502f3b0ac34SDag-Erling Smørgrav    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
503f3b0ac34SDag-Erling Smørgrav
504f3b0ac34SDag-Erling Smørgrav
505f3b0ac34SDag-Erling Smørgrav# _LT_TAGVAR(VARNAME, [TAGNAME])
506f3b0ac34SDag-Erling Smørgrav# ------------------------------
507f3b0ac34SDag-Erling Smørgravm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
508f3b0ac34SDag-Erling Smørgrav
509f3b0ac34SDag-Erling Smørgrav
510f3b0ac34SDag-Erling Smørgrav# _LT_CONFIG_COMMANDS
511f3b0ac34SDag-Erling Smørgrav# -------------------
512f3b0ac34SDag-Erling Smørgrav# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
513f3b0ac34SDag-Erling Smørgrav# variables for single and double quote escaping we saved from calls
514f3b0ac34SDag-Erling Smørgrav# to _LT_DECL, we can put quote escaped variables declarations
515f3b0ac34SDag-Erling Smørgrav# into 'config.status', and then the shell code to quote escape them in
516f3b0ac34SDag-Erling Smørgrav# for loops in 'config.status'.  Finally, any additional code accumulated
517f3b0ac34SDag-Erling Smørgrav# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
518f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CONFIG_COMMANDS],
519f3b0ac34SDag-Erling Smørgrav[AC_PROVIDE_IFELSE([LT_OUTPUT],
520f3b0ac34SDag-Erling Smørgrav	dnl If the libtool generation code has been placed in $CONFIG_LT,
521f3b0ac34SDag-Erling Smørgrav	dnl instead of duplicating it all over again into config.status,
522f3b0ac34SDag-Erling Smørgrav	dnl then we will have config.status run $CONFIG_LT later, so it
523f3b0ac34SDag-Erling Smørgrav	dnl needs to know what name is stored there:
524f3b0ac34SDag-Erling Smørgrav        [AC_CONFIG_COMMANDS([libtool],
525f3b0ac34SDag-Erling Smørgrav            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
526f3b0ac34SDag-Erling Smørgrav    dnl If the libtool generation code is destined for config.status,
527f3b0ac34SDag-Erling Smørgrav    dnl expand the accumulated commands and init code now:
528f3b0ac34SDag-Erling Smørgrav    [AC_CONFIG_COMMANDS([libtool],
529f3b0ac34SDag-Erling Smørgrav        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
530f3b0ac34SDag-Erling Smørgrav])#_LT_CONFIG_COMMANDS
531f3b0ac34SDag-Erling Smørgrav
532f3b0ac34SDag-Erling Smørgrav
533f3b0ac34SDag-Erling Smørgrav# Initialize.
534f3b0ac34SDag-Erling Smørgravm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
535f3b0ac34SDag-Erling Smørgrav[
536f3b0ac34SDag-Erling Smørgrav
537f3b0ac34SDag-Erling Smørgrav# The HP-UX ksh and POSIX shell print the target directory to stdout
538f3b0ac34SDag-Erling Smørgrav# if CDPATH is set.
539f3b0ac34SDag-Erling Smørgrav(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
540f3b0ac34SDag-Erling Smørgrav
541f3b0ac34SDag-Erling Smørgravsed_quote_subst='$sed_quote_subst'
542f3b0ac34SDag-Erling Smørgravdouble_quote_subst='$double_quote_subst'
543f3b0ac34SDag-Erling Smørgravdelay_variable_subst='$delay_variable_subst'
544f3b0ac34SDag-Erling Smørgrav_LT_CONFIG_STATUS_DECLARATIONS
545f3b0ac34SDag-Erling SmørgravLTCC='$LTCC'
546f3b0ac34SDag-Erling SmørgravLTCFLAGS='$LTCFLAGS'
547f3b0ac34SDag-Erling Smørgravcompiler='$compiler_DEFAULT'
548f3b0ac34SDag-Erling Smørgrav
549f3b0ac34SDag-Erling Smørgrav# A function that is used when there is no print builtin or printf.
550f3b0ac34SDag-Erling Smørgravfunc_fallback_echo ()
551f3b0ac34SDag-Erling Smørgrav{
552f3b0ac34SDag-Erling Smørgrav  eval 'cat <<_LTECHO_EOF
553f3b0ac34SDag-Erling Smørgrav\$[]1
554f3b0ac34SDag-Erling Smørgrav_LTECHO_EOF'
555f3b0ac34SDag-Erling Smørgrav}
556f3b0ac34SDag-Erling Smørgrav
557f3b0ac34SDag-Erling Smørgrav# Quote evaled strings.
558f3b0ac34SDag-Erling Smørgravfor var in lt_decl_all_varnames([[ \
559f3b0ac34SDag-Erling Smørgrav]], lt_decl_quote_varnames); do
560f3b0ac34SDag-Erling Smørgrav    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
561f3b0ac34SDag-Erling Smørgrav    *[[\\\\\\\`\\"\\\$]]*)
562f3b0ac34SDag-Erling Smørgrav      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
563f3b0ac34SDag-Erling Smørgrav      ;;
564f3b0ac34SDag-Erling Smørgrav    *)
565f3b0ac34SDag-Erling Smørgrav      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
566f3b0ac34SDag-Erling Smørgrav      ;;
567f3b0ac34SDag-Erling Smørgrav    esac
568f3b0ac34SDag-Erling Smørgravdone
569f3b0ac34SDag-Erling Smørgrav
570f3b0ac34SDag-Erling Smørgrav# Double-quote double-evaled strings.
571f3b0ac34SDag-Erling Smørgravfor var in lt_decl_all_varnames([[ \
572f3b0ac34SDag-Erling Smørgrav]], lt_decl_dquote_varnames); do
573f3b0ac34SDag-Erling Smørgrav    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
574f3b0ac34SDag-Erling Smørgrav    *[[\\\\\\\`\\"\\\$]]*)
575f3b0ac34SDag-Erling Smørgrav      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
576f3b0ac34SDag-Erling Smørgrav      ;;
577f3b0ac34SDag-Erling Smørgrav    *)
578f3b0ac34SDag-Erling Smørgrav      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
579f3b0ac34SDag-Erling Smørgrav      ;;
580f3b0ac34SDag-Erling Smørgrav    esac
581f3b0ac34SDag-Erling Smørgravdone
582f3b0ac34SDag-Erling Smørgrav
583f3b0ac34SDag-Erling Smørgrav_LT_OUTPUT_LIBTOOL_INIT
584f3b0ac34SDag-Erling Smørgrav])
585f3b0ac34SDag-Erling Smørgrav
586f3b0ac34SDag-Erling Smørgrav# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
587f3b0ac34SDag-Erling Smørgrav# ------------------------------------
588f3b0ac34SDag-Erling Smørgrav# Generate a child script FILE with all initialization necessary to
589f3b0ac34SDag-Erling Smørgrav# reuse the environment learned by the parent script, and make the
590f3b0ac34SDag-Erling Smørgrav# file executable.  If COMMENT is supplied, it is inserted after the
591f3b0ac34SDag-Erling Smørgrav# '#!' sequence but before initialization text begins.  After this
592f3b0ac34SDag-Erling Smørgrav# macro, additional text can be appended to FILE to form the body of
593f3b0ac34SDag-Erling Smørgrav# the child script.  The macro ends with non-zero status if the
594f3b0ac34SDag-Erling Smørgrav# file could not be fully written (such as if the disk is full).
595f3b0ac34SDag-Erling Smørgravm4_ifdef([AS_INIT_GENERATED],
596f3b0ac34SDag-Erling Smørgrav[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
597f3b0ac34SDag-Erling Smørgrav[m4_defun([_LT_GENERATED_FILE_INIT],
598f3b0ac34SDag-Erling Smørgrav[m4_require([AS_PREPARE])]dnl
599f3b0ac34SDag-Erling Smørgrav[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
600f3b0ac34SDag-Erling Smørgrav[lt_write_fail=0
601f3b0ac34SDag-Erling Smørgravcat >$1 <<_ASEOF || lt_write_fail=1
602f3b0ac34SDag-Erling Smørgrav#! $SHELL
603f3b0ac34SDag-Erling Smørgrav# Generated by $as_me.
604f3b0ac34SDag-Erling Smørgrav$2
605f3b0ac34SDag-Erling SmørgravSHELL=\${CONFIG_SHELL-$SHELL}
606f3b0ac34SDag-Erling Smørgravexport SHELL
607f3b0ac34SDag-Erling Smørgrav_ASEOF
608f3b0ac34SDag-Erling Smørgravcat >>$1 <<\_ASEOF || lt_write_fail=1
609f3b0ac34SDag-Erling SmørgravAS_SHELL_SANITIZE
610f3b0ac34SDag-Erling Smørgrav_AS_PREPARE
611f3b0ac34SDag-Erling Smørgravexec AS_MESSAGE_FD>&1
612f3b0ac34SDag-Erling Smørgrav_ASEOF
613f3b0ac34SDag-Erling Smørgravtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
614f3b0ac34SDag-Erling Smørgravm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
615f3b0ac34SDag-Erling Smørgrav
616f3b0ac34SDag-Erling Smørgrav# LT_OUTPUT
617f3b0ac34SDag-Erling Smørgrav# ---------
618f3b0ac34SDag-Erling Smørgrav# This macro allows early generation of the libtool script (before
619f3b0ac34SDag-Erling Smørgrav# AC_OUTPUT is called), incase it is used in configure for compilation
620f3b0ac34SDag-Erling Smørgrav# tests.
621f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_OUTPUT],
622f3b0ac34SDag-Erling Smørgrav[: ${CONFIG_LT=./config.lt}
623f3b0ac34SDag-Erling SmørgravAC_MSG_NOTICE([creating $CONFIG_LT])
624f3b0ac34SDag-Erling Smørgrav_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
625f3b0ac34SDag-Erling Smørgrav[# Run this file to recreate a libtool stub with the current configuration.])
626f3b0ac34SDag-Erling Smørgrav
627f3b0ac34SDag-Erling Smørgravcat >>"$CONFIG_LT" <<\_LTEOF
628f3b0ac34SDag-Erling Smørgravlt_cl_silent=false
629f3b0ac34SDag-Erling Smørgravexec AS_MESSAGE_LOG_FD>>config.log
630f3b0ac34SDag-Erling Smørgrav{
631f3b0ac34SDag-Erling Smørgrav  echo
632f3b0ac34SDag-Erling Smørgrav  AS_BOX([Running $as_me.])
633f3b0ac34SDag-Erling Smørgrav} >&AS_MESSAGE_LOG_FD
634f3b0ac34SDag-Erling Smørgrav
635f3b0ac34SDag-Erling Smørgravlt_cl_help="\
636f3b0ac34SDag-Erling Smørgrav'$as_me' creates a local libtool stub from the current configuration,
637f3b0ac34SDag-Erling Smørgravfor use in further configure time tests before the real libtool is
638f3b0ac34SDag-Erling Smørgravgenerated.
639f3b0ac34SDag-Erling Smørgrav
640f3b0ac34SDag-Erling SmørgravUsage: $[0] [[OPTIONS]]
641f3b0ac34SDag-Erling Smørgrav
642f3b0ac34SDag-Erling Smørgrav  -h, --help      print this help, then exit
643f3b0ac34SDag-Erling Smørgrav  -V, --version   print version number, then exit
644f3b0ac34SDag-Erling Smørgrav  -q, --quiet     do not print progress messages
645f3b0ac34SDag-Erling Smørgrav  -d, --debug     don't remove temporary files
646f3b0ac34SDag-Erling Smørgrav
647f3b0ac34SDag-Erling SmørgravReport bugs to <bug-libtool@gnu.org>."
648f3b0ac34SDag-Erling Smørgrav
649f3b0ac34SDag-Erling Smørgravlt_cl_version="\
650f3b0ac34SDag-Erling Smørgravm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
651f3b0ac34SDag-Erling Smørgravm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
652f3b0ac34SDag-Erling Smørgravconfigured by $[0], generated by m4_PACKAGE_STRING.
653f3b0ac34SDag-Erling Smørgrav
654f3b0ac34SDag-Erling SmørgravCopyright (C) 2011 Free Software Foundation, Inc.
655f3b0ac34SDag-Erling SmørgravThis config.lt script is free software; the Free Software Foundation
656f3b0ac34SDag-Erling Smørgravgives unlimited permision to copy, distribute and modify it."
657f3b0ac34SDag-Erling Smørgrav
658f3b0ac34SDag-Erling Smørgravwhile test 0 != $[#]
659f3b0ac34SDag-Erling Smørgravdo
660f3b0ac34SDag-Erling Smørgrav  case $[1] in
661f3b0ac34SDag-Erling Smørgrav    --version | --v* | -V )
662f3b0ac34SDag-Erling Smørgrav      echo "$lt_cl_version"; exit 0 ;;
663f3b0ac34SDag-Erling Smørgrav    --help | --h* | -h )
664f3b0ac34SDag-Erling Smørgrav      echo "$lt_cl_help"; exit 0 ;;
665f3b0ac34SDag-Erling Smørgrav    --debug | --d* | -d )
666f3b0ac34SDag-Erling Smørgrav      debug=: ;;
667f3b0ac34SDag-Erling Smørgrav    --quiet | --q* | --silent | --s* | -q )
668f3b0ac34SDag-Erling Smørgrav      lt_cl_silent=: ;;
669f3b0ac34SDag-Erling Smørgrav
670f3b0ac34SDag-Erling Smørgrav    -*) AC_MSG_ERROR([unrecognized option: $[1]
671f3b0ac34SDag-Erling SmørgravTry '$[0] --help' for more information.]) ;;
672f3b0ac34SDag-Erling Smørgrav
673f3b0ac34SDag-Erling Smørgrav    *) AC_MSG_ERROR([unrecognized argument: $[1]
674f3b0ac34SDag-Erling SmørgravTry '$[0] --help' for more information.]) ;;
675f3b0ac34SDag-Erling Smørgrav  esac
676f3b0ac34SDag-Erling Smørgrav  shift
677f3b0ac34SDag-Erling Smørgravdone
678f3b0ac34SDag-Erling Smørgrav
679f3b0ac34SDag-Erling Smørgravif $lt_cl_silent; then
680f3b0ac34SDag-Erling Smørgrav  exec AS_MESSAGE_FD>/dev/null
681f3b0ac34SDag-Erling Smørgravfi
682f3b0ac34SDag-Erling Smørgrav_LTEOF
683f3b0ac34SDag-Erling Smørgrav
684f3b0ac34SDag-Erling Smørgravcat >>"$CONFIG_LT" <<_LTEOF
685f3b0ac34SDag-Erling Smørgrav_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
686f3b0ac34SDag-Erling Smørgrav_LTEOF
687f3b0ac34SDag-Erling Smørgrav
688f3b0ac34SDag-Erling Smørgravcat >>"$CONFIG_LT" <<\_LTEOF
689f3b0ac34SDag-Erling SmørgravAC_MSG_NOTICE([creating $ofile])
690f3b0ac34SDag-Erling Smørgrav_LT_OUTPUT_LIBTOOL_COMMANDS
691f3b0ac34SDag-Erling SmørgravAS_EXIT(0)
692f3b0ac34SDag-Erling Smørgrav_LTEOF
693f3b0ac34SDag-Erling Smørgravchmod +x "$CONFIG_LT"
694f3b0ac34SDag-Erling Smørgrav
695f3b0ac34SDag-Erling Smørgrav# configure is writing to config.log, but config.lt does its own redirection,
696f3b0ac34SDag-Erling Smørgrav# appending to config.log, which fails on DOS, as config.log is still kept
697f3b0ac34SDag-Erling Smørgrav# open by configure.  Here we exec the FD to /dev/null, effectively closing
698f3b0ac34SDag-Erling Smørgrav# config.log, so it can be properly (re)opened and appended to by config.lt.
699f3b0ac34SDag-Erling Smørgravlt_cl_success=:
700f3b0ac34SDag-Erling Smørgravtest yes = "$silent" &&
701f3b0ac34SDag-Erling Smørgrav  lt_config_lt_args="$lt_config_lt_args --quiet"
702f3b0ac34SDag-Erling Smørgravexec AS_MESSAGE_LOG_FD>/dev/null
703f3b0ac34SDag-Erling Smørgrav$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
704f3b0ac34SDag-Erling Smørgravexec AS_MESSAGE_LOG_FD>>config.log
705f3b0ac34SDag-Erling Smørgrav$lt_cl_success || AS_EXIT(1)
706f3b0ac34SDag-Erling Smørgrav])# LT_OUTPUT
707f3b0ac34SDag-Erling Smørgrav
708f3b0ac34SDag-Erling Smørgrav
709f3b0ac34SDag-Erling Smørgrav# _LT_CONFIG(TAG)
710f3b0ac34SDag-Erling Smørgrav# ---------------
711f3b0ac34SDag-Erling Smørgrav# If TAG is the built-in tag, create an initial libtool script with a
712f3b0ac34SDag-Erling Smørgrav# default configuration from the untagged config vars.  Otherwise add code
713f3b0ac34SDag-Erling Smørgrav# to config.status for appending the configuration named by TAG from the
714f3b0ac34SDag-Erling Smørgrav# matching tagged config vars.
715f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CONFIG],
716f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
717f3b0ac34SDag-Erling Smørgrav_LT_CONFIG_SAVE_COMMANDS([
718f3b0ac34SDag-Erling Smørgrav  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
719f3b0ac34SDag-Erling Smørgrav  m4_if(_LT_TAG, [C], [
720f3b0ac34SDag-Erling Smørgrav    # See if we are running on zsh, and set the options that allow our
721f3b0ac34SDag-Erling Smørgrav    # commands through without removal of \ escapes.
722f3b0ac34SDag-Erling Smørgrav    if test -n "${ZSH_VERSION+set}"; then
723f3b0ac34SDag-Erling Smørgrav      setopt NO_GLOB_SUBST
724f3b0ac34SDag-Erling Smørgrav    fi
725f3b0ac34SDag-Erling Smørgrav
726f3b0ac34SDag-Erling Smørgrav    cfgfile=${ofile}T
727f3b0ac34SDag-Erling Smørgrav    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
728f3b0ac34SDag-Erling Smørgrav    $RM "$cfgfile"
729f3b0ac34SDag-Erling Smørgrav
730f3b0ac34SDag-Erling Smørgrav    cat <<_LT_EOF >> "$cfgfile"
731f3b0ac34SDag-Erling Smørgrav#! $SHELL
732f3b0ac34SDag-Erling Smørgrav# Generated automatically by $as_me ($PACKAGE) $VERSION
733f3b0ac34SDag-Erling Smørgrav# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
734f3b0ac34SDag-Erling Smørgrav# NOTE: Changes made to this file will be lost: look at ltmain.sh.
735f3b0ac34SDag-Erling Smørgrav
736f3b0ac34SDag-Erling Smørgrav# Provide generalized library-building support services.
737f3b0ac34SDag-Erling Smørgrav# Written by Gordon Matzigkeit, 1996
738f3b0ac34SDag-Erling Smørgrav
739f3b0ac34SDag-Erling Smørgrav_LT_COPYING
740f3b0ac34SDag-Erling Smørgrav_LT_LIBTOOL_TAGS
741f3b0ac34SDag-Erling Smørgrav
742f3b0ac34SDag-Erling Smørgrav# Configured defaults for sys_lib_dlsearch_path munging.
743f3b0ac34SDag-Erling Smørgrav: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
744f3b0ac34SDag-Erling Smørgrav
745f3b0ac34SDag-Erling Smørgrav# ### BEGIN LIBTOOL CONFIG
746f3b0ac34SDag-Erling Smørgrav_LT_LIBTOOL_CONFIG_VARS
747f3b0ac34SDag-Erling Smørgrav_LT_LIBTOOL_TAG_VARS
748f3b0ac34SDag-Erling Smørgrav# ### END LIBTOOL CONFIG
749f3b0ac34SDag-Erling Smørgrav
750f3b0ac34SDag-Erling Smørgrav_LT_EOF
751f3b0ac34SDag-Erling Smørgrav
752f3b0ac34SDag-Erling Smørgrav    cat <<'_LT_EOF' >> "$cfgfile"
753f3b0ac34SDag-Erling Smørgrav
754f3b0ac34SDag-Erling Smørgrav# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
755f3b0ac34SDag-Erling Smørgrav
756f3b0ac34SDag-Erling Smørgrav_LT_PREPARE_MUNGE_PATH_LIST
757f3b0ac34SDag-Erling Smørgrav_LT_PREPARE_CC_BASENAME
758f3b0ac34SDag-Erling Smørgrav
759f3b0ac34SDag-Erling Smørgrav# ### END FUNCTIONS SHARED WITH CONFIGURE
760f3b0ac34SDag-Erling Smørgrav
761f3b0ac34SDag-Erling Smørgrav_LT_EOF
762f3b0ac34SDag-Erling Smørgrav
763f3b0ac34SDag-Erling Smørgrav  case $host_os in
764f3b0ac34SDag-Erling Smørgrav  aix3*)
765f3b0ac34SDag-Erling Smørgrav    cat <<\_LT_EOF >> "$cfgfile"
766f3b0ac34SDag-Erling Smørgrav# AIX sometimes has problems with the GCC collect2 program.  For some
767f3b0ac34SDag-Erling Smørgrav# reason, if we set the COLLECT_NAMES environment variable, the problems
768f3b0ac34SDag-Erling Smørgrav# vanish in a puff of smoke.
769f3b0ac34SDag-Erling Smørgravif test set != "${COLLECT_NAMES+set}"; then
770f3b0ac34SDag-Erling Smørgrav  COLLECT_NAMES=
771f3b0ac34SDag-Erling Smørgrav  export COLLECT_NAMES
772f3b0ac34SDag-Erling Smørgravfi
773f3b0ac34SDag-Erling Smørgrav_LT_EOF
774f3b0ac34SDag-Erling Smørgrav    ;;
775f3b0ac34SDag-Erling Smørgrav  esac
776f3b0ac34SDag-Erling Smørgrav
777f3b0ac34SDag-Erling Smørgrav  _LT_PROG_LTMAIN
778f3b0ac34SDag-Erling Smørgrav
779f3b0ac34SDag-Erling Smørgrav  # We use sed instead of cat because bash on DJGPP gets confused if
780f3b0ac34SDag-Erling Smørgrav  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
781f3b0ac34SDag-Erling Smørgrav  # text mode, it properly converts lines to CR/LF.  This bash problem
782f3b0ac34SDag-Erling Smørgrav  # is reportedly fixed, but why not run on old versions too?
783*3ba4c8c8SDag-Erling Smørgrav  $SED '$q' "$ltmain" >> "$cfgfile" \
784f3b0ac34SDag-Erling Smørgrav     || (rm -f "$cfgfile"; exit 1)
785f3b0ac34SDag-Erling Smørgrav
786f3b0ac34SDag-Erling Smørgrav   mv -f "$cfgfile" "$ofile" ||
787f3b0ac34SDag-Erling Smørgrav    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
788f3b0ac34SDag-Erling Smørgrav  chmod +x "$ofile"
789f3b0ac34SDag-Erling Smørgrav],
790f3b0ac34SDag-Erling Smørgrav[cat <<_LT_EOF >> "$ofile"
791f3b0ac34SDag-Erling Smørgrav
792f3b0ac34SDag-Erling Smørgravdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
793f3b0ac34SDag-Erling Smørgravdnl in a comment (ie after a #).
794f3b0ac34SDag-Erling Smørgrav# ### BEGIN LIBTOOL TAG CONFIG: $1
795f3b0ac34SDag-Erling Smørgrav_LT_LIBTOOL_TAG_VARS(_LT_TAG)
796f3b0ac34SDag-Erling Smørgrav# ### END LIBTOOL TAG CONFIG: $1
797f3b0ac34SDag-Erling Smørgrav_LT_EOF
798f3b0ac34SDag-Erling Smørgrav])dnl /m4_if
799f3b0ac34SDag-Erling Smørgrav],
800f3b0ac34SDag-Erling Smørgrav[m4_if([$1], [], [
801f3b0ac34SDag-Erling Smørgrav    PACKAGE='$PACKAGE'
802f3b0ac34SDag-Erling Smørgrav    VERSION='$VERSION'
803f3b0ac34SDag-Erling Smørgrav    RM='$RM'
804f3b0ac34SDag-Erling Smørgrav    ofile='$ofile'], [])
805f3b0ac34SDag-Erling Smørgrav])dnl /_LT_CONFIG_SAVE_COMMANDS
806f3b0ac34SDag-Erling Smørgrav])# _LT_CONFIG
807f3b0ac34SDag-Erling Smørgrav
808f3b0ac34SDag-Erling Smørgrav
809f3b0ac34SDag-Erling Smørgrav# LT_SUPPORTED_TAG(TAG)
810f3b0ac34SDag-Erling Smørgrav# ---------------------
811f3b0ac34SDag-Erling Smørgrav# Trace this macro to discover what tags are supported by the libtool
812f3b0ac34SDag-Erling Smørgrav# --tag option, using:
813f3b0ac34SDag-Erling Smørgrav#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
814f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_SUPPORTED_TAG], [])
815f3b0ac34SDag-Erling Smørgrav
816f3b0ac34SDag-Erling Smørgrav
817f3b0ac34SDag-Erling Smørgrav# C support is built-in for now
818f3b0ac34SDag-Erling Smørgravm4_define([_LT_LANG_C_enabled], [])
819f3b0ac34SDag-Erling Smørgravm4_define([_LT_TAGS], [])
820f3b0ac34SDag-Erling Smørgrav
821f3b0ac34SDag-Erling Smørgrav
822f3b0ac34SDag-Erling Smørgrav# LT_LANG(LANG)
823f3b0ac34SDag-Erling Smørgrav# -------------
824f3b0ac34SDag-Erling Smørgrav# Enable libtool support for the given language if not already enabled.
825f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_LANG],
826f3b0ac34SDag-Erling Smørgrav[AC_BEFORE([$0], [LT_OUTPUT])dnl
827f3b0ac34SDag-Erling Smørgravm4_case([$1],
828f3b0ac34SDag-Erling Smørgrav  [C],			[_LT_LANG(C)],
829f3b0ac34SDag-Erling Smørgrav  [C++],		[_LT_LANG(CXX)],
830f3b0ac34SDag-Erling Smørgrav  [Go],			[_LT_LANG(GO)],
831f3b0ac34SDag-Erling Smørgrav  [Java],		[_LT_LANG(GCJ)],
832f3b0ac34SDag-Erling Smørgrav  [Fortran 77],		[_LT_LANG(F77)],
833f3b0ac34SDag-Erling Smørgrav  [Fortran],		[_LT_LANG(FC)],
834f3b0ac34SDag-Erling Smørgrav  [Windows Resource],	[_LT_LANG(RC)],
835f3b0ac34SDag-Erling Smørgrav  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
836f3b0ac34SDag-Erling Smørgrav    [_LT_LANG($1)],
837f3b0ac34SDag-Erling Smørgrav    [m4_fatal([$0: unsupported language: "$1"])])])dnl
838f3b0ac34SDag-Erling Smørgrav])# LT_LANG
839f3b0ac34SDag-Erling Smørgrav
840f3b0ac34SDag-Erling Smørgrav
841f3b0ac34SDag-Erling Smørgrav# _LT_LANG(LANGNAME)
842f3b0ac34SDag-Erling Smørgrav# ------------------
843f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG],
844f3b0ac34SDag-Erling Smørgrav[m4_ifdef([_LT_LANG_]$1[_enabled], [],
845f3b0ac34SDag-Erling Smørgrav  [LT_SUPPORTED_TAG([$1])dnl
846f3b0ac34SDag-Erling Smørgrav  m4_append([_LT_TAGS], [$1 ])dnl
847f3b0ac34SDag-Erling Smørgrav  m4_define([_LT_LANG_]$1[_enabled], [])dnl
848f3b0ac34SDag-Erling Smørgrav  _LT_LANG_$1_CONFIG($1)])dnl
849f3b0ac34SDag-Erling Smørgrav])# _LT_LANG
850f3b0ac34SDag-Erling Smørgrav
851f3b0ac34SDag-Erling Smørgrav
852f3b0ac34SDag-Erling Smørgravm4_ifndef([AC_PROG_GO], [
853f3b0ac34SDag-Erling Smørgrav############################################################
854f3b0ac34SDag-Erling Smørgrav# NOTE: This macro has been submitted for inclusion into   #
855f3b0ac34SDag-Erling Smørgrav#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
856f3b0ac34SDag-Erling Smørgrav#  a released version of Autoconf we should remove this    #
857f3b0ac34SDag-Erling Smørgrav#  macro and use it instead.                               #
858f3b0ac34SDag-Erling Smørgrav############################################################
859f3b0ac34SDag-Erling Smørgravm4_defun([AC_PROG_GO],
860f3b0ac34SDag-Erling Smørgrav[AC_LANG_PUSH(Go)dnl
861f3b0ac34SDag-Erling SmørgravAC_ARG_VAR([GOC],     [Go compiler command])dnl
862f3b0ac34SDag-Erling SmørgravAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
863f3b0ac34SDag-Erling Smørgrav_AC_ARG_VAR_LDFLAGS()dnl
864f3b0ac34SDag-Erling SmørgravAC_CHECK_TOOL(GOC, gccgo)
865f3b0ac34SDag-Erling Smørgravif test -z "$GOC"; then
866f3b0ac34SDag-Erling Smørgrav  if test -n "$ac_tool_prefix"; then
867f3b0ac34SDag-Erling Smørgrav    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
868f3b0ac34SDag-Erling Smørgrav  fi
869f3b0ac34SDag-Erling Smørgravfi
870f3b0ac34SDag-Erling Smørgravif test -z "$GOC"; then
871f3b0ac34SDag-Erling Smørgrav  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
872f3b0ac34SDag-Erling Smørgravfi
873f3b0ac34SDag-Erling Smørgrav])#m4_defun
874f3b0ac34SDag-Erling Smørgrav])#m4_ifndef
875f3b0ac34SDag-Erling Smørgrav
876f3b0ac34SDag-Erling Smørgrav
877f3b0ac34SDag-Erling Smørgrav# _LT_LANG_DEFAULT_CONFIG
878f3b0ac34SDag-Erling Smørgrav# -----------------------
879f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG_DEFAULT_CONFIG],
880f3b0ac34SDag-Erling Smørgrav[AC_PROVIDE_IFELSE([AC_PROG_CXX],
881f3b0ac34SDag-Erling Smørgrav  [LT_LANG(CXX)],
882f3b0ac34SDag-Erling Smørgrav  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
883f3b0ac34SDag-Erling Smørgrav
884f3b0ac34SDag-Erling SmørgravAC_PROVIDE_IFELSE([AC_PROG_F77],
885f3b0ac34SDag-Erling Smørgrav  [LT_LANG(F77)],
886f3b0ac34SDag-Erling Smørgrav  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
887f3b0ac34SDag-Erling Smørgrav
888f3b0ac34SDag-Erling SmørgravAC_PROVIDE_IFELSE([AC_PROG_FC],
889f3b0ac34SDag-Erling Smørgrav  [LT_LANG(FC)],
890f3b0ac34SDag-Erling Smørgrav  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
891f3b0ac34SDag-Erling Smørgrav
892f3b0ac34SDag-Erling Smørgravdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
893f3b0ac34SDag-Erling Smørgravdnl pulling things in needlessly.
894f3b0ac34SDag-Erling SmørgravAC_PROVIDE_IFELSE([AC_PROG_GCJ],
895f3b0ac34SDag-Erling Smørgrav  [LT_LANG(GCJ)],
896f3b0ac34SDag-Erling Smørgrav  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
897f3b0ac34SDag-Erling Smørgrav    [LT_LANG(GCJ)],
898f3b0ac34SDag-Erling Smørgrav    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
899f3b0ac34SDag-Erling Smørgrav      [LT_LANG(GCJ)],
900f3b0ac34SDag-Erling Smørgrav      [m4_ifdef([AC_PROG_GCJ],
901f3b0ac34SDag-Erling Smørgrav	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
902f3b0ac34SDag-Erling Smørgrav       m4_ifdef([A][M_PROG_GCJ],
903f3b0ac34SDag-Erling Smørgrav	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
904f3b0ac34SDag-Erling Smørgrav       m4_ifdef([LT_PROG_GCJ],
905f3b0ac34SDag-Erling Smørgrav	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
906f3b0ac34SDag-Erling Smørgrav
907f3b0ac34SDag-Erling SmørgravAC_PROVIDE_IFELSE([AC_PROG_GO],
908f3b0ac34SDag-Erling Smørgrav  [LT_LANG(GO)],
909f3b0ac34SDag-Erling Smørgrav  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
910f3b0ac34SDag-Erling Smørgrav
911f3b0ac34SDag-Erling SmørgravAC_PROVIDE_IFELSE([LT_PROG_RC],
912f3b0ac34SDag-Erling Smørgrav  [LT_LANG(RC)],
913f3b0ac34SDag-Erling Smørgrav  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
914f3b0ac34SDag-Erling Smørgrav])# _LT_LANG_DEFAULT_CONFIG
915f3b0ac34SDag-Erling Smørgrav
916f3b0ac34SDag-Erling Smørgrav# Obsolete macros:
917f3b0ac34SDag-Erling SmørgravAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
918f3b0ac34SDag-Erling SmørgravAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
919f3b0ac34SDag-Erling SmørgravAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
920f3b0ac34SDag-Erling SmørgravAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
921f3b0ac34SDag-Erling SmørgravAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
922f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
923f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
924f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_F77], [])
925f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_FC], [])
926f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
927f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_RC], [])
928f3b0ac34SDag-Erling Smørgrav
929f3b0ac34SDag-Erling Smørgrav
930f3b0ac34SDag-Erling Smørgrav# _LT_TAG_COMPILER
931f3b0ac34SDag-Erling Smørgrav# ----------------
932f3b0ac34SDag-Erling Smørgravm4_defun([_LT_TAG_COMPILER],
933f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_PROG_CC])dnl
934f3b0ac34SDag-Erling Smørgrav
935f3b0ac34SDag-Erling Smørgrav_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
936f3b0ac34SDag-Erling Smørgrav_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
937f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
938f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
939f3b0ac34SDag-Erling Smørgrav
940f3b0ac34SDag-Erling Smørgrav# If no C compiler was specified, use CC.
941f3b0ac34SDag-Erling SmørgravLTCC=${LTCC-"$CC"}
942f3b0ac34SDag-Erling Smørgrav
943f3b0ac34SDag-Erling Smørgrav# If no C compiler flags were specified, use CFLAGS.
944f3b0ac34SDag-Erling SmørgravLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
945f3b0ac34SDag-Erling Smørgrav
946f3b0ac34SDag-Erling Smørgrav# Allow CC to be a program name with arguments.
947f3b0ac34SDag-Erling Smørgravcompiler=$CC
948f3b0ac34SDag-Erling Smørgrav])# _LT_TAG_COMPILER
949f3b0ac34SDag-Erling Smørgrav
950f3b0ac34SDag-Erling Smørgrav
951f3b0ac34SDag-Erling Smørgrav# _LT_COMPILER_BOILERPLATE
952f3b0ac34SDag-Erling Smørgrav# ------------------------
953f3b0ac34SDag-Erling Smørgrav# Check for compiler boilerplate output or warnings with
954f3b0ac34SDag-Erling Smørgrav# the simple compiler test code.
955f3b0ac34SDag-Erling Smørgravm4_defun([_LT_COMPILER_BOILERPLATE],
956f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_SED])dnl
957f3b0ac34SDag-Erling Smørgravac_outfile=conftest.$ac_objext
958f3b0ac34SDag-Erling Smørgravecho "$lt_simple_compile_test_code" >conftest.$ac_ext
959f3b0ac34SDag-Erling Smørgraveval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
960f3b0ac34SDag-Erling Smørgrav_lt_compiler_boilerplate=`cat conftest.err`
961f3b0ac34SDag-Erling Smørgrav$RM conftest*
962f3b0ac34SDag-Erling Smørgrav])# _LT_COMPILER_BOILERPLATE
963f3b0ac34SDag-Erling Smørgrav
964f3b0ac34SDag-Erling Smørgrav
965f3b0ac34SDag-Erling Smørgrav# _LT_LINKER_BOILERPLATE
966f3b0ac34SDag-Erling Smørgrav# ----------------------
967f3b0ac34SDag-Erling Smørgrav# Check for linker boilerplate output or warnings with
968f3b0ac34SDag-Erling Smørgrav# the simple link test code.
969f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LINKER_BOILERPLATE],
970f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_SED])dnl
971f3b0ac34SDag-Erling Smørgravac_outfile=conftest.$ac_objext
972f3b0ac34SDag-Erling Smørgravecho "$lt_simple_link_test_code" >conftest.$ac_ext
973f3b0ac34SDag-Erling Smørgraveval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
974f3b0ac34SDag-Erling Smørgrav_lt_linker_boilerplate=`cat conftest.err`
975f3b0ac34SDag-Erling Smørgrav$RM -r conftest*
976f3b0ac34SDag-Erling Smørgrav])# _LT_LINKER_BOILERPLATE
977f3b0ac34SDag-Erling Smørgrav
978f3b0ac34SDag-Erling Smørgrav# _LT_REQUIRED_DARWIN_CHECKS
979f3b0ac34SDag-Erling Smørgrav# -------------------------
980f3b0ac34SDag-Erling Smørgravm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
981f3b0ac34SDag-Erling Smørgrav  case $host_os in
982f3b0ac34SDag-Erling Smørgrav    rhapsody* | darwin*)
983f3b0ac34SDag-Erling Smørgrav    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
984f3b0ac34SDag-Erling Smørgrav    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
985f3b0ac34SDag-Erling Smørgrav    AC_CHECK_TOOL([LIPO], [lipo], [:])
986f3b0ac34SDag-Erling Smørgrav    AC_CHECK_TOOL([OTOOL], [otool], [:])
987f3b0ac34SDag-Erling Smørgrav    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
988f3b0ac34SDag-Erling Smørgrav    _LT_DECL([], [DSYMUTIL], [1],
989f3b0ac34SDag-Erling Smørgrav      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
990f3b0ac34SDag-Erling Smørgrav    _LT_DECL([], [NMEDIT], [1],
991f3b0ac34SDag-Erling Smørgrav      [Tool to change global to local symbols on Mac OS X])
992f3b0ac34SDag-Erling Smørgrav    _LT_DECL([], [LIPO], [1],
993f3b0ac34SDag-Erling Smørgrav      [Tool to manipulate fat objects and archives on Mac OS X])
994f3b0ac34SDag-Erling Smørgrav    _LT_DECL([], [OTOOL], [1],
995f3b0ac34SDag-Erling Smørgrav      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
996f3b0ac34SDag-Erling Smørgrav    _LT_DECL([], [OTOOL64], [1],
997f3b0ac34SDag-Erling Smørgrav      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
998f3b0ac34SDag-Erling Smørgrav
999f3b0ac34SDag-Erling Smørgrav    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1000f3b0ac34SDag-Erling Smørgrav      [lt_cv_apple_cc_single_mod=no
1001f3b0ac34SDag-Erling Smørgrav      if test -z "$LT_MULTI_MODULE"; then
1002f3b0ac34SDag-Erling Smørgrav	# By default we will add the -single_module flag. You can override
1003f3b0ac34SDag-Erling Smørgrav	# by either setting the environment variable LT_MULTI_MODULE
1004f3b0ac34SDag-Erling Smørgrav	# non-empty at configure time, or by adding -multi_module to the
1005f3b0ac34SDag-Erling Smørgrav	# link flags.
1006f3b0ac34SDag-Erling Smørgrav	rm -rf libconftest.dylib*
1007f3b0ac34SDag-Erling Smørgrav	echo "int foo(void){return 1;}" > conftest.c
1008f3b0ac34SDag-Erling Smørgrav	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1009f3b0ac34SDag-Erling Smørgrav-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1010f3b0ac34SDag-Erling Smørgrav	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1011f3b0ac34SDag-Erling Smørgrav	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1012f3b0ac34SDag-Erling Smørgrav        _lt_result=$?
1013f3b0ac34SDag-Erling Smørgrav	# If there is a non-empty error log, and "single_module"
1014f3b0ac34SDag-Erling Smørgrav	# appears in it, assume the flag caused a linker warning
1015f3b0ac34SDag-Erling Smørgrav        if test -s conftest.err && $GREP single_module conftest.err; then
1016f3b0ac34SDag-Erling Smørgrav	  cat conftest.err >&AS_MESSAGE_LOG_FD
1017f3b0ac34SDag-Erling Smørgrav	# Otherwise, if the output was created with a 0 exit code from
1018f3b0ac34SDag-Erling Smørgrav	# the compiler, it worked.
1019f3b0ac34SDag-Erling Smørgrav	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1020f3b0ac34SDag-Erling Smørgrav	  lt_cv_apple_cc_single_mod=yes
1021f3b0ac34SDag-Erling Smørgrav	else
1022f3b0ac34SDag-Erling Smørgrav	  cat conftest.err >&AS_MESSAGE_LOG_FD
1023f3b0ac34SDag-Erling Smørgrav	fi
1024f3b0ac34SDag-Erling Smørgrav	rm -rf libconftest.dylib*
1025f3b0ac34SDag-Erling Smørgrav	rm -f conftest.*
1026f3b0ac34SDag-Erling Smørgrav      fi])
1027f3b0ac34SDag-Erling Smørgrav
1028f3b0ac34SDag-Erling Smørgrav    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1029f3b0ac34SDag-Erling Smørgrav      [lt_cv_ld_exported_symbols_list],
1030f3b0ac34SDag-Erling Smørgrav      [lt_cv_ld_exported_symbols_list=no
1031f3b0ac34SDag-Erling Smørgrav      save_LDFLAGS=$LDFLAGS
1032f3b0ac34SDag-Erling Smørgrav      echo "_main" > conftest.sym
1033f3b0ac34SDag-Erling Smørgrav      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1034f3b0ac34SDag-Erling Smørgrav      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1035f3b0ac34SDag-Erling Smørgrav	[lt_cv_ld_exported_symbols_list=yes],
1036f3b0ac34SDag-Erling Smørgrav	[lt_cv_ld_exported_symbols_list=no])
1037f3b0ac34SDag-Erling Smørgrav	LDFLAGS=$save_LDFLAGS
1038f3b0ac34SDag-Erling Smørgrav    ])
1039f3b0ac34SDag-Erling Smørgrav
1040f3b0ac34SDag-Erling Smørgrav    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1041f3b0ac34SDag-Erling Smørgrav      [lt_cv_ld_force_load=no
1042f3b0ac34SDag-Erling Smørgrav      cat > conftest.c << _LT_EOF
1043f3b0ac34SDag-Erling Smørgravint forced_loaded() { return 2;}
1044f3b0ac34SDag-Erling Smørgrav_LT_EOF
1045f3b0ac34SDag-Erling Smørgrav      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1046f3b0ac34SDag-Erling Smørgrav      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1047*3ba4c8c8SDag-Erling Smørgrav      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1048*3ba4c8c8SDag-Erling Smørgrav      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1049f3b0ac34SDag-Erling Smørgrav      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1050f3b0ac34SDag-Erling Smørgrav      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1051f3b0ac34SDag-Erling Smørgrav      cat > conftest.c << _LT_EOF
1052f3b0ac34SDag-Erling Smørgravint main() { return 0;}
1053f3b0ac34SDag-Erling Smørgrav_LT_EOF
1054f3b0ac34SDag-Erling Smørgrav      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1055f3b0ac34SDag-Erling Smørgrav      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1056f3b0ac34SDag-Erling Smørgrav      _lt_result=$?
1057f3b0ac34SDag-Erling Smørgrav      if test -s conftest.err && $GREP force_load conftest.err; then
1058f3b0ac34SDag-Erling Smørgrav	cat conftest.err >&AS_MESSAGE_LOG_FD
1059f3b0ac34SDag-Erling Smørgrav      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1060f3b0ac34SDag-Erling Smørgrav	lt_cv_ld_force_load=yes
1061f3b0ac34SDag-Erling Smørgrav      else
1062f3b0ac34SDag-Erling Smørgrav	cat conftest.err >&AS_MESSAGE_LOG_FD
1063f3b0ac34SDag-Erling Smørgrav      fi
1064f3b0ac34SDag-Erling Smørgrav        rm -f conftest.err libconftest.a conftest conftest.c
1065f3b0ac34SDag-Erling Smørgrav        rm -rf conftest.dSYM
1066f3b0ac34SDag-Erling Smørgrav    ])
1067f3b0ac34SDag-Erling Smørgrav    case $host_os in
1068f3b0ac34SDag-Erling Smørgrav    rhapsody* | darwin1.[[012]])
1069f3b0ac34SDag-Erling Smørgrav      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1070f3b0ac34SDag-Erling Smørgrav    darwin1.*)
1071f3b0ac34SDag-Erling Smørgrav      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1072*3ba4c8c8SDag-Erling Smørgrav    darwin*)
1073*3ba4c8c8SDag-Erling Smørgrav      case $MACOSX_DEPLOYMENT_TARGET,$host in
1074*3ba4c8c8SDag-Erling Smørgrav        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
1075f3b0ac34SDag-Erling Smørgrav          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1076*3ba4c8c8SDag-Erling Smørgrav        *)
1077f3b0ac34SDag-Erling Smørgrav          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1078f3b0ac34SDag-Erling Smørgrav      esac
1079f3b0ac34SDag-Erling Smørgrav    ;;
1080f3b0ac34SDag-Erling Smørgrav  esac
1081f3b0ac34SDag-Erling Smørgrav    if test yes = "$lt_cv_apple_cc_single_mod"; then
1082f3b0ac34SDag-Erling Smørgrav      _lt_dar_single_mod='$single_module'
1083f3b0ac34SDag-Erling Smørgrav    fi
1084f3b0ac34SDag-Erling Smørgrav    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1085f3b0ac34SDag-Erling Smørgrav      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1086f3b0ac34SDag-Erling Smørgrav    else
1087f3b0ac34SDag-Erling Smørgrav      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1088f3b0ac34SDag-Erling Smørgrav    fi
1089f3b0ac34SDag-Erling Smørgrav    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1090f3b0ac34SDag-Erling Smørgrav      _lt_dsymutil='~$DSYMUTIL $lib || :'
1091f3b0ac34SDag-Erling Smørgrav    else
1092f3b0ac34SDag-Erling Smørgrav      _lt_dsymutil=
1093f3b0ac34SDag-Erling Smørgrav    fi
1094f3b0ac34SDag-Erling Smørgrav    ;;
1095f3b0ac34SDag-Erling Smørgrav  esac
1096f3b0ac34SDag-Erling Smørgrav])
1097f3b0ac34SDag-Erling Smørgrav
1098f3b0ac34SDag-Erling Smørgrav
1099f3b0ac34SDag-Erling Smørgrav# _LT_DARWIN_LINKER_FEATURES([TAG])
1100f3b0ac34SDag-Erling Smørgrav# ---------------------------------
1101f3b0ac34SDag-Erling Smørgrav# Checks for linker and compiler features on darwin
1102f3b0ac34SDag-Erling Smørgravm4_defun([_LT_DARWIN_LINKER_FEATURES],
1103f3b0ac34SDag-Erling Smørgrav[
1104f3b0ac34SDag-Erling Smørgrav  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1105f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1106f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_direct, $1)=no
1107f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_automatic, $1)=yes
1108f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1109f3b0ac34SDag-Erling Smørgrav  if test yes = "$lt_cv_ld_force_load"; then
1110f3b0ac34SDag-Erling Smørgrav    _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\"`'
1111f3b0ac34SDag-Erling Smørgrav    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1112f3b0ac34SDag-Erling Smørgrav                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1113f3b0ac34SDag-Erling Smørgrav  else
1114f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1115f3b0ac34SDag-Erling Smørgrav  fi
1116f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(link_all_deplibs, $1)=yes
1117f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1118f3b0ac34SDag-Erling Smørgrav  case $cc_basename in
1119f3b0ac34SDag-Erling Smørgrav     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1120f3b0ac34SDag-Erling Smørgrav     *) _lt_dar_can_shared=$GCC ;;
1121f3b0ac34SDag-Erling Smørgrav  esac
1122f3b0ac34SDag-Erling Smørgrav  if test yes = "$_lt_dar_can_shared"; then
1123f3b0ac34SDag-Erling Smørgrav    output_verbose_link_cmd=func_echo_all
1124f3b0ac34SDag-Erling Smørgrav    _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"
1125f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1126*3ba4c8c8SDag-Erling Smørgrav    _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"
1127*3ba4c8c8SDag-Erling Smørgrav    _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"
1128f3b0ac34SDag-Erling Smørgrav    m4_if([$1], [CXX],
1129f3b0ac34SDag-Erling Smørgrav[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1130f3b0ac34SDag-Erling Smørgrav      _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"
1131*3ba4c8c8SDag-Erling Smørgrav      _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"
1132f3b0ac34SDag-Erling Smørgrav    fi
1133f3b0ac34SDag-Erling Smørgrav],[])
1134f3b0ac34SDag-Erling Smørgrav  else
1135f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(ld_shlibs, $1)=no
1136f3b0ac34SDag-Erling Smørgrav  fi
1137f3b0ac34SDag-Erling Smørgrav])
1138f3b0ac34SDag-Erling Smørgrav
1139f3b0ac34SDag-Erling Smørgrav# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1140f3b0ac34SDag-Erling Smørgrav# ----------------------------------
1141f3b0ac34SDag-Erling Smørgrav# Links a minimal program and checks the executable
1142f3b0ac34SDag-Erling Smørgrav# for the system default hardcoded library path. In most cases,
1143f3b0ac34SDag-Erling Smørgrav# this is /usr/lib:/lib, but when the MPI compilers are used
1144f3b0ac34SDag-Erling Smørgrav# the location of the communication and MPI libs are included too.
1145f3b0ac34SDag-Erling Smørgrav# If we don't find anything, use the default library path according
1146f3b0ac34SDag-Erling Smørgrav# to the aix ld manual.
1147f3b0ac34SDag-Erling Smørgrav# Store the results from the different compilers for each TAGNAME.
1148f3b0ac34SDag-Erling Smørgrav# Allow to override them for all tags through lt_cv_aix_libpath.
1149f3b0ac34SDag-Erling Smørgravm4_defun([_LT_SYS_MODULE_PATH_AIX],
1150f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_SED])dnl
1151f3b0ac34SDag-Erling Smørgravif test set = "${lt_cv_aix_libpath+set}"; then
1152f3b0ac34SDag-Erling Smørgrav  aix_libpath=$lt_cv_aix_libpath
1153f3b0ac34SDag-Erling Smørgravelse
1154f3b0ac34SDag-Erling Smørgrav  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1155f3b0ac34SDag-Erling Smørgrav  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1156f3b0ac34SDag-Erling Smørgrav  lt_aix_libpath_sed='[
1157f3b0ac34SDag-Erling Smørgrav      /Import File Strings/,/^$/ {
1158f3b0ac34SDag-Erling Smørgrav	  /^0/ {
1159f3b0ac34SDag-Erling Smørgrav	      s/^0  *\([^ ]*\) *$/\1/
1160f3b0ac34SDag-Erling Smørgrav	      p
1161f3b0ac34SDag-Erling Smørgrav	  }
1162f3b0ac34SDag-Erling Smørgrav      }]'
1163f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1164f3b0ac34SDag-Erling Smørgrav  # Check for a 64-bit object if we didn't find anything.
1165f3b0ac34SDag-Erling Smørgrav  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1166f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1167f3b0ac34SDag-Erling Smørgrav  fi],[])
1168f3b0ac34SDag-Erling Smørgrav  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1169f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1170f3b0ac34SDag-Erling Smørgrav  fi
1171f3b0ac34SDag-Erling Smørgrav  ])
1172f3b0ac34SDag-Erling Smørgrav  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1173f3b0ac34SDag-Erling Smørgravfi
1174f3b0ac34SDag-Erling Smørgrav])# _LT_SYS_MODULE_PATH_AIX
1175f3b0ac34SDag-Erling Smørgrav
1176f3b0ac34SDag-Erling Smørgrav
1177f3b0ac34SDag-Erling Smørgrav# _LT_SHELL_INIT(ARG)
1178f3b0ac34SDag-Erling Smørgrav# -------------------
1179f3b0ac34SDag-Erling Smørgravm4_define([_LT_SHELL_INIT],
1180f3b0ac34SDag-Erling Smørgrav[m4_divert_text([M4SH-INIT], [$1
1181f3b0ac34SDag-Erling Smørgrav])])# _LT_SHELL_INIT
1182f3b0ac34SDag-Erling Smørgrav
1183f3b0ac34SDag-Erling Smørgrav
1184f3b0ac34SDag-Erling Smørgrav
1185f3b0ac34SDag-Erling Smørgrav# _LT_PROG_ECHO_BACKSLASH
1186f3b0ac34SDag-Erling Smørgrav# -----------------------
1187f3b0ac34SDag-Erling Smørgrav# Find how we can fake an echo command that does not interpret backslash.
1188f3b0ac34SDag-Erling Smørgrav# In particular, with Autoconf 2.60 or later we add some code to the start
1189f3b0ac34SDag-Erling Smørgrav# of the generated configure script that will find a shell with a builtin
1190f3b0ac34SDag-Erling Smørgrav# printf (that we can use as an echo command).
1191f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PROG_ECHO_BACKSLASH],
1192f3b0ac34SDag-Erling Smørgrav[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1193f3b0ac34SDag-Erling SmørgravECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1194f3b0ac34SDag-Erling SmørgravECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1195f3b0ac34SDag-Erling Smørgrav
1196f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([how to print strings])
1197f3b0ac34SDag-Erling Smørgrav# Test print first, because it will be a builtin if present.
1198f3b0ac34SDag-Erling Smørgravif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1199f3b0ac34SDag-Erling Smørgrav   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1200f3b0ac34SDag-Erling Smørgrav  ECHO='print -r --'
1201f3b0ac34SDag-Erling Smørgravelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1202f3b0ac34SDag-Erling Smørgrav  ECHO='printf %s\n'
1203f3b0ac34SDag-Erling Smørgravelse
1204f3b0ac34SDag-Erling Smørgrav  # Use this function as a fallback that always works.
1205f3b0ac34SDag-Erling Smørgrav  func_fallback_echo ()
1206f3b0ac34SDag-Erling Smørgrav  {
1207f3b0ac34SDag-Erling Smørgrav    eval 'cat <<_LTECHO_EOF
1208f3b0ac34SDag-Erling Smørgrav$[]1
1209f3b0ac34SDag-Erling Smørgrav_LTECHO_EOF'
1210f3b0ac34SDag-Erling Smørgrav  }
1211f3b0ac34SDag-Erling Smørgrav  ECHO='func_fallback_echo'
1212f3b0ac34SDag-Erling Smørgravfi
1213f3b0ac34SDag-Erling Smørgrav
1214f3b0ac34SDag-Erling Smørgrav# func_echo_all arg...
1215f3b0ac34SDag-Erling Smørgrav# Invoke $ECHO with all args, space-separated.
1216f3b0ac34SDag-Erling Smørgravfunc_echo_all ()
1217f3b0ac34SDag-Erling Smørgrav{
1218f3b0ac34SDag-Erling Smørgrav    $ECHO "$*"
1219f3b0ac34SDag-Erling Smørgrav}
1220f3b0ac34SDag-Erling Smørgrav
1221f3b0ac34SDag-Erling Smørgravcase $ECHO in
1222f3b0ac34SDag-Erling Smørgrav  printf*) AC_MSG_RESULT([printf]) ;;
1223f3b0ac34SDag-Erling Smørgrav  print*) AC_MSG_RESULT([print -r]) ;;
1224f3b0ac34SDag-Erling Smørgrav  *) AC_MSG_RESULT([cat]) ;;
1225f3b0ac34SDag-Erling Smørgravesac
1226f3b0ac34SDag-Erling Smørgrav
1227f3b0ac34SDag-Erling Smørgravm4_ifdef([_AS_DETECT_SUGGESTED],
1228f3b0ac34SDag-Erling Smørgrav[_AS_DETECT_SUGGESTED([
1229f3b0ac34SDag-Erling Smørgrav  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1230f3b0ac34SDag-Erling Smørgrav    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1231f3b0ac34SDag-Erling Smørgrav    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1232f3b0ac34SDag-Erling Smørgrav    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1233f3b0ac34SDag-Erling Smørgrav    PATH=/empty FPATH=/empty; export PATH FPATH
1234f3b0ac34SDag-Erling Smørgrav    test "X`printf %s $ECHO`" = "X$ECHO" \
1235f3b0ac34SDag-Erling Smørgrav      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1236f3b0ac34SDag-Erling Smørgrav
1237f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1238f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1239f3b0ac34SDag-Erling Smørgrav])# _LT_PROG_ECHO_BACKSLASH
1240f3b0ac34SDag-Erling Smørgrav
1241f3b0ac34SDag-Erling Smørgrav
1242f3b0ac34SDag-Erling Smørgrav# _LT_WITH_SYSROOT
1243f3b0ac34SDag-Erling Smørgrav# ----------------
1244f3b0ac34SDag-Erling SmørgravAC_DEFUN([_LT_WITH_SYSROOT],
1245*3ba4c8c8SDag-Erling Smørgrav[m4_require([_LT_DECL_SED])dnl
1246*3ba4c8c8SDag-Erling SmørgravAC_MSG_CHECKING([for sysroot])
1247f3b0ac34SDag-Erling SmørgravAC_ARG_WITH([sysroot],
1248f3b0ac34SDag-Erling Smørgrav[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1249f3b0ac34SDag-Erling Smørgrav  [Search for dependent libraries within DIR (or the compiler's sysroot
1250f3b0ac34SDag-Erling Smørgrav   if not specified).])],
1251f3b0ac34SDag-Erling Smørgrav[], [with_sysroot=no])
1252f3b0ac34SDag-Erling Smørgrav
1253f3b0ac34SDag-Erling Smørgravdnl lt_sysroot will always be passed unquoted.  We quote it here
1254f3b0ac34SDag-Erling Smørgravdnl in case the user passed a directory name.
1255f3b0ac34SDag-Erling Smørgravlt_sysroot=
1256f3b0ac34SDag-Erling Smørgravcase $with_sysroot in #(
1257f3b0ac34SDag-Erling Smørgrav yes)
1258f3b0ac34SDag-Erling Smørgrav   if test yes = "$GCC"; then
1259f3b0ac34SDag-Erling Smørgrav     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1260f3b0ac34SDag-Erling Smørgrav   fi
1261f3b0ac34SDag-Erling Smørgrav   ;; #(
1262f3b0ac34SDag-Erling Smørgrav /*)
1263*3ba4c8c8SDag-Erling Smørgrav   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
1264f3b0ac34SDag-Erling Smørgrav   ;; #(
1265f3b0ac34SDag-Erling Smørgrav no|'')
1266f3b0ac34SDag-Erling Smørgrav   ;; #(
1267f3b0ac34SDag-Erling Smørgrav *)
1268f3b0ac34SDag-Erling Smørgrav   AC_MSG_RESULT([$with_sysroot])
1269f3b0ac34SDag-Erling Smørgrav   AC_MSG_ERROR([The sysroot must be an absolute path.])
1270f3b0ac34SDag-Erling Smørgrav   ;;
1271f3b0ac34SDag-Erling Smørgravesac
1272f3b0ac34SDag-Erling Smørgrav
1273f3b0ac34SDag-Erling Smørgrav AC_MSG_RESULT([${lt_sysroot:-no}])
1274f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1275f3b0ac34SDag-Erling Smørgrav[dependent libraries, and where our libraries should be installed.])])
1276f3b0ac34SDag-Erling Smørgrav
1277f3b0ac34SDag-Erling Smørgrav# _LT_ENABLE_LOCK
1278f3b0ac34SDag-Erling Smørgrav# ---------------
1279f3b0ac34SDag-Erling Smørgravm4_defun([_LT_ENABLE_LOCK],
1280f3b0ac34SDag-Erling Smørgrav[AC_ARG_ENABLE([libtool-lock],
1281f3b0ac34SDag-Erling Smørgrav  [AS_HELP_STRING([--disable-libtool-lock],
1282f3b0ac34SDag-Erling Smørgrav    [avoid locking (might break parallel builds)])])
1283f3b0ac34SDag-Erling Smørgravtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1284f3b0ac34SDag-Erling Smørgrav
1285f3b0ac34SDag-Erling Smørgrav# Some flags need to be propagated to the compiler or linker for good
1286f3b0ac34SDag-Erling Smørgrav# libtool support.
1287f3b0ac34SDag-Erling Smørgravcase $host in
1288f3b0ac34SDag-Erling Smørgravia64-*-hpux*)
1289f3b0ac34SDag-Erling Smørgrav  # Find out what ABI is being produced by ac_compile, and set mode
1290f3b0ac34SDag-Erling Smørgrav  # options accordingly.
1291f3b0ac34SDag-Erling Smørgrav  echo 'int i;' > conftest.$ac_ext
1292f3b0ac34SDag-Erling Smørgrav  if AC_TRY_EVAL(ac_compile); then
1293*3ba4c8c8SDag-Erling Smørgrav    case `$FILECMD conftest.$ac_objext` in
1294f3b0ac34SDag-Erling Smørgrav      *ELF-32*)
1295f3b0ac34SDag-Erling Smørgrav	HPUX_IA64_MODE=32
1296f3b0ac34SDag-Erling Smørgrav	;;
1297f3b0ac34SDag-Erling Smørgrav      *ELF-64*)
1298f3b0ac34SDag-Erling Smørgrav	HPUX_IA64_MODE=64
1299f3b0ac34SDag-Erling Smørgrav	;;
1300f3b0ac34SDag-Erling Smørgrav    esac
1301f3b0ac34SDag-Erling Smørgrav  fi
1302f3b0ac34SDag-Erling Smørgrav  rm -rf conftest*
1303f3b0ac34SDag-Erling Smørgrav  ;;
1304f3b0ac34SDag-Erling Smørgrav*-*-irix6*)
1305f3b0ac34SDag-Erling Smørgrav  # Find out what ABI is being produced by ac_compile, and set linker
1306f3b0ac34SDag-Erling Smørgrav  # options accordingly.
1307f3b0ac34SDag-Erling Smørgrav  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1308f3b0ac34SDag-Erling Smørgrav  if AC_TRY_EVAL(ac_compile); then
1309f3b0ac34SDag-Erling Smørgrav    if test yes = "$lt_cv_prog_gnu_ld"; then
1310*3ba4c8c8SDag-Erling Smørgrav      case `$FILECMD conftest.$ac_objext` in
1311f3b0ac34SDag-Erling Smørgrav	*32-bit*)
1312f3b0ac34SDag-Erling Smørgrav	  LD="${LD-ld} -melf32bsmip"
1313f3b0ac34SDag-Erling Smørgrav	  ;;
1314f3b0ac34SDag-Erling Smørgrav	*N32*)
1315f3b0ac34SDag-Erling Smørgrav	  LD="${LD-ld} -melf32bmipn32"
1316f3b0ac34SDag-Erling Smørgrav	  ;;
1317f3b0ac34SDag-Erling Smørgrav	*64-bit*)
1318f3b0ac34SDag-Erling Smørgrav	  LD="${LD-ld} -melf64bmip"
1319f3b0ac34SDag-Erling Smørgrav	;;
1320f3b0ac34SDag-Erling Smørgrav      esac
1321f3b0ac34SDag-Erling Smørgrav    else
1322*3ba4c8c8SDag-Erling Smørgrav      case `$FILECMD conftest.$ac_objext` in
1323f3b0ac34SDag-Erling Smørgrav	*32-bit*)
1324f3b0ac34SDag-Erling Smørgrav	  LD="${LD-ld} -32"
1325f3b0ac34SDag-Erling Smørgrav	  ;;
1326f3b0ac34SDag-Erling Smørgrav	*N32*)
1327f3b0ac34SDag-Erling Smørgrav	  LD="${LD-ld} -n32"
1328f3b0ac34SDag-Erling Smørgrav	  ;;
1329f3b0ac34SDag-Erling Smørgrav	*64-bit*)
1330f3b0ac34SDag-Erling Smørgrav	  LD="${LD-ld} -64"
1331f3b0ac34SDag-Erling Smørgrav	  ;;
1332f3b0ac34SDag-Erling Smørgrav      esac
1333f3b0ac34SDag-Erling Smørgrav    fi
1334f3b0ac34SDag-Erling Smørgrav  fi
1335f3b0ac34SDag-Erling Smørgrav  rm -rf conftest*
1336f3b0ac34SDag-Erling Smørgrav  ;;
1337f3b0ac34SDag-Erling Smørgrav
1338f3b0ac34SDag-Erling Smørgravmips64*-*linux*)
1339f3b0ac34SDag-Erling Smørgrav  # Find out what ABI is being produced by ac_compile, and set linker
1340f3b0ac34SDag-Erling Smørgrav  # options accordingly.
1341f3b0ac34SDag-Erling Smørgrav  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1342f3b0ac34SDag-Erling Smørgrav  if AC_TRY_EVAL(ac_compile); then
1343f3b0ac34SDag-Erling Smørgrav    emul=elf
1344*3ba4c8c8SDag-Erling Smørgrav    case `$FILECMD conftest.$ac_objext` in
1345f3b0ac34SDag-Erling Smørgrav      *32-bit*)
1346f3b0ac34SDag-Erling Smørgrav	emul="${emul}32"
1347f3b0ac34SDag-Erling Smørgrav	;;
1348f3b0ac34SDag-Erling Smørgrav      *64-bit*)
1349f3b0ac34SDag-Erling Smørgrav	emul="${emul}64"
1350f3b0ac34SDag-Erling Smørgrav	;;
1351f3b0ac34SDag-Erling Smørgrav    esac
1352*3ba4c8c8SDag-Erling Smørgrav    case `$FILECMD conftest.$ac_objext` in
1353f3b0ac34SDag-Erling Smørgrav      *MSB*)
1354f3b0ac34SDag-Erling Smørgrav	emul="${emul}btsmip"
1355f3b0ac34SDag-Erling Smørgrav	;;
1356f3b0ac34SDag-Erling Smørgrav      *LSB*)
1357f3b0ac34SDag-Erling Smørgrav	emul="${emul}ltsmip"
1358f3b0ac34SDag-Erling Smørgrav	;;
1359f3b0ac34SDag-Erling Smørgrav    esac
1360*3ba4c8c8SDag-Erling Smørgrav    case `$FILECMD conftest.$ac_objext` in
1361f3b0ac34SDag-Erling Smørgrav      *N32*)
1362f3b0ac34SDag-Erling Smørgrav	emul="${emul}n32"
1363f3b0ac34SDag-Erling Smørgrav	;;
1364f3b0ac34SDag-Erling Smørgrav    esac
1365f3b0ac34SDag-Erling Smørgrav    LD="${LD-ld} -m $emul"
1366f3b0ac34SDag-Erling Smørgrav  fi
1367f3b0ac34SDag-Erling Smørgrav  rm -rf conftest*
1368f3b0ac34SDag-Erling Smørgrav  ;;
1369f3b0ac34SDag-Erling Smørgrav
1370f3b0ac34SDag-Erling Smørgravx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1371f3b0ac34SDag-Erling Smørgravs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1372f3b0ac34SDag-Erling Smørgrav  # Find out what ABI is being produced by ac_compile, and set linker
1373f3b0ac34SDag-Erling Smørgrav  # options accordingly.  Note that the listed cases only cover the
1374f3b0ac34SDag-Erling Smørgrav  # situations where additional linker options are needed (such as when
1375f3b0ac34SDag-Erling Smørgrav  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1376f3b0ac34SDag-Erling Smørgrav  # vice versa); the common cases where no linker options are needed do
1377f3b0ac34SDag-Erling Smørgrav  # not appear in the list.
1378f3b0ac34SDag-Erling Smørgrav  echo 'int i;' > conftest.$ac_ext
1379f3b0ac34SDag-Erling Smørgrav  if AC_TRY_EVAL(ac_compile); then
1380*3ba4c8c8SDag-Erling Smørgrav    case `$FILECMD conftest.o` in
1381f3b0ac34SDag-Erling Smørgrav      *32-bit*)
1382f3b0ac34SDag-Erling Smørgrav	case $host in
1383f3b0ac34SDag-Erling Smørgrav	  x86_64-*kfreebsd*-gnu)
1384f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf_i386_fbsd"
1385f3b0ac34SDag-Erling Smørgrav	    ;;
1386f3b0ac34SDag-Erling Smørgrav	  x86_64-*linux*)
1387*3ba4c8c8SDag-Erling Smørgrav	    case `$FILECMD conftest.o` in
1388f3b0ac34SDag-Erling Smørgrav	      *x86-64*)
1389f3b0ac34SDag-Erling Smørgrav		LD="${LD-ld} -m elf32_x86_64"
1390f3b0ac34SDag-Erling Smørgrav		;;
1391f3b0ac34SDag-Erling Smørgrav	      *)
1392f3b0ac34SDag-Erling Smørgrav		LD="${LD-ld} -m elf_i386"
1393f3b0ac34SDag-Erling Smørgrav		;;
1394f3b0ac34SDag-Erling Smørgrav	    esac
1395f3b0ac34SDag-Erling Smørgrav	    ;;
1396f3b0ac34SDag-Erling Smørgrav	  powerpc64le-*linux*)
1397f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf32lppclinux"
1398f3b0ac34SDag-Erling Smørgrav	    ;;
1399f3b0ac34SDag-Erling Smørgrav	  powerpc64-*linux*)
1400f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf32ppclinux"
1401f3b0ac34SDag-Erling Smørgrav	    ;;
1402f3b0ac34SDag-Erling Smørgrav	  s390x-*linux*)
1403f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf_s390"
1404f3b0ac34SDag-Erling Smørgrav	    ;;
1405f3b0ac34SDag-Erling Smørgrav	  sparc64-*linux*)
1406f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf32_sparc"
1407f3b0ac34SDag-Erling Smørgrav	    ;;
1408f3b0ac34SDag-Erling Smørgrav	esac
1409f3b0ac34SDag-Erling Smørgrav	;;
1410f3b0ac34SDag-Erling Smørgrav      *64-bit*)
1411f3b0ac34SDag-Erling Smørgrav	case $host in
1412f3b0ac34SDag-Erling Smørgrav	  x86_64-*kfreebsd*-gnu)
1413f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf_x86_64_fbsd"
1414f3b0ac34SDag-Erling Smørgrav	    ;;
1415f3b0ac34SDag-Erling Smørgrav	  x86_64-*linux*)
1416f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf_x86_64"
1417f3b0ac34SDag-Erling Smørgrav	    ;;
1418f3b0ac34SDag-Erling Smørgrav	  powerpcle-*linux*)
1419f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf64lppc"
1420f3b0ac34SDag-Erling Smørgrav	    ;;
1421f3b0ac34SDag-Erling Smørgrav	  powerpc-*linux*)
1422f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf64ppc"
1423f3b0ac34SDag-Erling Smørgrav	    ;;
1424f3b0ac34SDag-Erling Smørgrav	  s390*-*linux*|s390*-*tpf*)
1425f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf64_s390"
1426f3b0ac34SDag-Erling Smørgrav	    ;;
1427f3b0ac34SDag-Erling Smørgrav	  sparc*-*linux*)
1428f3b0ac34SDag-Erling Smørgrav	    LD="${LD-ld} -m elf64_sparc"
1429f3b0ac34SDag-Erling Smørgrav	    ;;
1430f3b0ac34SDag-Erling Smørgrav	esac
1431f3b0ac34SDag-Erling Smørgrav	;;
1432f3b0ac34SDag-Erling Smørgrav    esac
1433f3b0ac34SDag-Erling Smørgrav  fi
1434f3b0ac34SDag-Erling Smørgrav  rm -rf conftest*
1435f3b0ac34SDag-Erling Smørgrav  ;;
1436f3b0ac34SDag-Erling Smørgrav
1437f3b0ac34SDag-Erling Smørgrav*-*-sco3.2v5*)
1438f3b0ac34SDag-Erling Smørgrav  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1439f3b0ac34SDag-Erling Smørgrav  SAVE_CFLAGS=$CFLAGS
1440f3b0ac34SDag-Erling Smørgrav  CFLAGS="$CFLAGS -belf"
1441f3b0ac34SDag-Erling Smørgrav  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1442f3b0ac34SDag-Erling Smørgrav    [AC_LANG_PUSH(C)
1443f3b0ac34SDag-Erling Smørgrav     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1444f3b0ac34SDag-Erling Smørgrav     AC_LANG_POP])
1445f3b0ac34SDag-Erling Smørgrav  if test yes != "$lt_cv_cc_needs_belf"; then
1446f3b0ac34SDag-Erling Smørgrav    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1447f3b0ac34SDag-Erling Smørgrav    CFLAGS=$SAVE_CFLAGS
1448f3b0ac34SDag-Erling Smørgrav  fi
1449f3b0ac34SDag-Erling Smørgrav  ;;
1450f3b0ac34SDag-Erling Smørgrav*-*solaris*)
1451f3b0ac34SDag-Erling Smørgrav  # Find out what ABI is being produced by ac_compile, and set linker
1452f3b0ac34SDag-Erling Smørgrav  # options accordingly.
1453f3b0ac34SDag-Erling Smørgrav  echo 'int i;' > conftest.$ac_ext
1454f3b0ac34SDag-Erling Smørgrav  if AC_TRY_EVAL(ac_compile); then
1455*3ba4c8c8SDag-Erling Smørgrav    case `$FILECMD conftest.o` in
1456f3b0ac34SDag-Erling Smørgrav    *64-bit*)
1457f3b0ac34SDag-Erling Smørgrav      case $lt_cv_prog_gnu_ld in
1458f3b0ac34SDag-Erling Smørgrav      yes*)
1459f3b0ac34SDag-Erling Smørgrav        case $host in
1460f3b0ac34SDag-Erling Smørgrav        i?86-*-solaris*|x86_64-*-solaris*)
1461f3b0ac34SDag-Erling Smørgrav          LD="${LD-ld} -m elf_x86_64"
1462f3b0ac34SDag-Erling Smørgrav          ;;
1463f3b0ac34SDag-Erling Smørgrav        sparc*-*-solaris*)
1464f3b0ac34SDag-Erling Smørgrav          LD="${LD-ld} -m elf64_sparc"
1465f3b0ac34SDag-Erling Smørgrav          ;;
1466f3b0ac34SDag-Erling Smørgrav        esac
1467f3b0ac34SDag-Erling Smørgrav        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1468f3b0ac34SDag-Erling Smørgrav        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1469f3b0ac34SDag-Erling Smørgrav          LD=${LD-ld}_sol2
1470f3b0ac34SDag-Erling Smørgrav        fi
1471f3b0ac34SDag-Erling Smørgrav        ;;
1472f3b0ac34SDag-Erling Smørgrav      *)
1473f3b0ac34SDag-Erling Smørgrav	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1474f3b0ac34SDag-Erling Smørgrav	  LD="${LD-ld} -64"
1475f3b0ac34SDag-Erling Smørgrav	fi
1476f3b0ac34SDag-Erling Smørgrav	;;
1477f3b0ac34SDag-Erling Smørgrav      esac
1478f3b0ac34SDag-Erling Smørgrav      ;;
1479f3b0ac34SDag-Erling Smørgrav    esac
1480f3b0ac34SDag-Erling Smørgrav  fi
1481f3b0ac34SDag-Erling Smørgrav  rm -rf conftest*
1482f3b0ac34SDag-Erling Smørgrav  ;;
1483f3b0ac34SDag-Erling Smørgravesac
1484f3b0ac34SDag-Erling Smørgrav
1485f3b0ac34SDag-Erling Smørgravneed_locks=$enable_libtool_lock
1486f3b0ac34SDag-Erling Smørgrav])# _LT_ENABLE_LOCK
1487f3b0ac34SDag-Erling Smørgrav
1488f3b0ac34SDag-Erling Smørgrav
1489f3b0ac34SDag-Erling Smørgrav# _LT_PROG_AR
1490f3b0ac34SDag-Erling Smørgrav# -----------
1491f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PROG_AR],
1492f3b0ac34SDag-Erling Smørgrav[AC_CHECK_TOOLS(AR, [ar], false)
1493f3b0ac34SDag-Erling Smørgrav: ${AR=ar}
1494f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [AR], [1], [The archiver])
1495*3ba4c8c8SDag-Erling Smørgrav
1496*3ba4c8c8SDag-Erling Smørgrav# Use ARFLAGS variable as AR's operation code to sync the variable naming with
1497*3ba4c8c8SDag-Erling Smørgrav# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
1498*3ba4c8c8SDag-Erling Smørgrav# higher priority because thats what people were doing historically (setting
1499*3ba4c8c8SDag-Erling Smørgrav# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
1500*3ba4c8c8SDag-Erling Smørgrav# variable obsoleted/removed.
1501*3ba4c8c8SDag-Erling Smørgrav
1502*3ba4c8c8SDag-Erling Smørgravtest ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
1503*3ba4c8c8SDag-Erling Smørgravlt_ar_flags=$AR_FLAGS
1504*3ba4c8c8SDag-Erling Smørgrav_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
1505*3ba4c8c8SDag-Erling Smørgrav
1506*3ba4c8c8SDag-Erling Smørgrav# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
1507*3ba4c8c8SDag-Erling Smørgrav# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
1508*3ba4c8c8SDag-Erling Smørgrav_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
1509*3ba4c8c8SDag-Erling Smørgrav         [Flags to create an archive])
1510f3b0ac34SDag-Erling Smørgrav
1511f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1512f3b0ac34SDag-Erling Smørgrav  [lt_cv_ar_at_file=no
1513f3b0ac34SDag-Erling Smørgrav   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1514f3b0ac34SDag-Erling Smørgrav     [echo conftest.$ac_objext > conftest.lst
1515f3b0ac34SDag-Erling Smørgrav      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1516f3b0ac34SDag-Erling Smørgrav      AC_TRY_EVAL([lt_ar_try])
1517f3b0ac34SDag-Erling Smørgrav      if test 0 -eq "$ac_status"; then
1518f3b0ac34SDag-Erling Smørgrav	# Ensure the archiver fails upon bogus file names.
1519f3b0ac34SDag-Erling Smørgrav	rm -f conftest.$ac_objext libconftest.a
1520f3b0ac34SDag-Erling Smørgrav	AC_TRY_EVAL([lt_ar_try])
1521f3b0ac34SDag-Erling Smørgrav	if test 0 -ne "$ac_status"; then
1522f3b0ac34SDag-Erling Smørgrav          lt_cv_ar_at_file=@
1523f3b0ac34SDag-Erling Smørgrav        fi
1524f3b0ac34SDag-Erling Smørgrav      fi
1525f3b0ac34SDag-Erling Smørgrav      rm -f conftest.* libconftest.a
1526f3b0ac34SDag-Erling Smørgrav     ])
1527f3b0ac34SDag-Erling Smørgrav  ])
1528f3b0ac34SDag-Erling Smørgrav
1529f3b0ac34SDag-Erling Smørgravif test no = "$lt_cv_ar_at_file"; then
1530f3b0ac34SDag-Erling Smørgrav  archiver_list_spec=
1531f3b0ac34SDag-Erling Smørgravelse
1532f3b0ac34SDag-Erling Smørgrav  archiver_list_spec=$lt_cv_ar_at_file
1533f3b0ac34SDag-Erling Smørgravfi
1534f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [archiver_list_spec], [1],
1535f3b0ac34SDag-Erling Smørgrav  [How to feed a file listing to the archiver])
1536f3b0ac34SDag-Erling Smørgrav])# _LT_PROG_AR
1537f3b0ac34SDag-Erling Smørgrav
1538f3b0ac34SDag-Erling Smørgrav
1539f3b0ac34SDag-Erling Smørgrav# _LT_CMD_OLD_ARCHIVE
1540f3b0ac34SDag-Erling Smørgrav# -------------------
1541f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CMD_OLD_ARCHIVE],
1542f3b0ac34SDag-Erling Smørgrav[_LT_PROG_AR
1543f3b0ac34SDag-Erling Smørgrav
1544f3b0ac34SDag-Erling SmørgravAC_CHECK_TOOL(STRIP, strip, :)
1545f3b0ac34SDag-Erling Smørgravtest -z "$STRIP" && STRIP=:
1546f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1547f3b0ac34SDag-Erling Smørgrav
1548f3b0ac34SDag-Erling SmørgravAC_CHECK_TOOL(RANLIB, ranlib, :)
1549f3b0ac34SDag-Erling Smørgravtest -z "$RANLIB" && RANLIB=:
1550f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [RANLIB], [1],
1551f3b0ac34SDag-Erling Smørgrav    [Commands used to install an old-style archive])
1552f3b0ac34SDag-Erling Smørgrav
1553f3b0ac34SDag-Erling Smørgrav# Determine commands to create old-style static archives.
1554f3b0ac34SDag-Erling Smørgravold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1555f3b0ac34SDag-Erling Smørgravold_postinstall_cmds='chmod 644 $oldlib'
1556f3b0ac34SDag-Erling Smørgravold_postuninstall_cmds=
1557f3b0ac34SDag-Erling Smørgrav
1558f3b0ac34SDag-Erling Smørgravif test -n "$RANLIB"; then
1559f3b0ac34SDag-Erling Smørgrav  case $host_os in
1560f3b0ac34SDag-Erling Smørgrav  bitrig* | openbsd*)
1561f3b0ac34SDag-Erling Smørgrav    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1562f3b0ac34SDag-Erling Smørgrav    ;;
1563f3b0ac34SDag-Erling Smørgrav  *)
1564f3b0ac34SDag-Erling Smørgrav    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1565f3b0ac34SDag-Erling Smørgrav    ;;
1566f3b0ac34SDag-Erling Smørgrav  esac
1567f3b0ac34SDag-Erling Smørgrav  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1568f3b0ac34SDag-Erling Smørgravfi
1569f3b0ac34SDag-Erling Smørgrav
1570f3b0ac34SDag-Erling Smørgravcase $host_os in
1571f3b0ac34SDag-Erling Smørgrav  darwin*)
1572f3b0ac34SDag-Erling Smørgrav    lock_old_archive_extraction=yes ;;
1573f3b0ac34SDag-Erling Smørgrav  *)
1574f3b0ac34SDag-Erling Smørgrav    lock_old_archive_extraction=no ;;
1575f3b0ac34SDag-Erling Smørgravesac
1576f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [old_postinstall_cmds], [2])
1577f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [old_postuninstall_cmds], [2])
1578f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [old_archive_cmds], [2],
1579f3b0ac34SDag-Erling Smørgrav    [Commands used to build an old-style archive])
1580f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [lock_old_archive_extraction], [0],
1581f3b0ac34SDag-Erling Smørgrav    [Whether to use a lock for old archive extraction])
1582f3b0ac34SDag-Erling Smørgrav])# _LT_CMD_OLD_ARCHIVE
1583f3b0ac34SDag-Erling Smørgrav
1584f3b0ac34SDag-Erling Smørgrav
1585f3b0ac34SDag-Erling Smørgrav# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1586f3b0ac34SDag-Erling Smørgrav#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1587f3b0ac34SDag-Erling Smørgrav# ----------------------------------------------------------------
1588f3b0ac34SDag-Erling Smørgrav# Check whether the given compiler option works
1589f3b0ac34SDag-Erling SmørgravAC_DEFUN([_LT_COMPILER_OPTION],
1590f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1591f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_SED])dnl
1592f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([$1], [$2],
1593f3b0ac34SDag-Erling Smørgrav  [$2=no
1594f3b0ac34SDag-Erling Smørgrav   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1595f3b0ac34SDag-Erling Smørgrav   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1596f3b0ac34SDag-Erling Smørgrav   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1597f3b0ac34SDag-Erling Smørgrav   # Insert the option either (1) after the last *FLAGS variable, or
1598f3b0ac34SDag-Erling Smørgrav   # (2) before a word containing "conftest.", or (3) at the end.
1599f3b0ac34SDag-Erling Smørgrav   # Note that $ac_compile itself does not contain backslashes and begins
1600f3b0ac34SDag-Erling Smørgrav   # with a dollar sign (not a hyphen), so the echo should work correctly.
1601f3b0ac34SDag-Erling Smørgrav   # The option is referenced via a variable to avoid confusing sed.
1602f3b0ac34SDag-Erling Smørgrav   lt_compile=`echo "$ac_compile" | $SED \
1603f3b0ac34SDag-Erling Smørgrav   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1604f3b0ac34SDag-Erling Smørgrav   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1605f3b0ac34SDag-Erling Smørgrav   -e 's:$: $lt_compiler_flag:'`
1606f3b0ac34SDag-Erling Smørgrav   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1607f3b0ac34SDag-Erling Smørgrav   (eval "$lt_compile" 2>conftest.err)
1608f3b0ac34SDag-Erling Smørgrav   ac_status=$?
1609f3b0ac34SDag-Erling Smørgrav   cat conftest.err >&AS_MESSAGE_LOG_FD
1610f3b0ac34SDag-Erling Smørgrav   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1611f3b0ac34SDag-Erling Smørgrav   if (exit $ac_status) && test -s "$ac_outfile"; then
1612f3b0ac34SDag-Erling Smørgrav     # The compiler can only warn and ignore the option if not recognized
1613f3b0ac34SDag-Erling Smørgrav     # So say no if there are warnings other than the usual output.
1614f3b0ac34SDag-Erling Smørgrav     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1615f3b0ac34SDag-Erling Smørgrav     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1616f3b0ac34SDag-Erling Smørgrav     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1617f3b0ac34SDag-Erling Smørgrav       $2=yes
1618f3b0ac34SDag-Erling Smørgrav     fi
1619f3b0ac34SDag-Erling Smørgrav   fi
1620f3b0ac34SDag-Erling Smørgrav   $RM conftest*
1621f3b0ac34SDag-Erling Smørgrav])
1622f3b0ac34SDag-Erling Smørgrav
1623f3b0ac34SDag-Erling Smørgravif test yes = "[$]$2"; then
1624f3b0ac34SDag-Erling Smørgrav    m4_if([$5], , :, [$5])
1625f3b0ac34SDag-Erling Smørgravelse
1626f3b0ac34SDag-Erling Smørgrav    m4_if([$6], , :, [$6])
1627f3b0ac34SDag-Erling Smørgravfi
1628f3b0ac34SDag-Erling Smørgrav])# _LT_COMPILER_OPTION
1629f3b0ac34SDag-Erling Smørgrav
1630f3b0ac34SDag-Erling Smørgrav# Old name:
1631f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1632f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
1633f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1634f3b0ac34SDag-Erling Smørgrav
1635f3b0ac34SDag-Erling Smørgrav
1636f3b0ac34SDag-Erling Smørgrav# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1637f3b0ac34SDag-Erling Smørgrav#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1638f3b0ac34SDag-Erling Smørgrav# ----------------------------------------------------
1639f3b0ac34SDag-Erling Smørgrav# Check whether the given linker option works
1640f3b0ac34SDag-Erling SmørgravAC_DEFUN([_LT_LINKER_OPTION],
1641f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1642f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_SED])dnl
1643f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([$1], [$2],
1644f3b0ac34SDag-Erling Smørgrav  [$2=no
1645f3b0ac34SDag-Erling Smørgrav   save_LDFLAGS=$LDFLAGS
1646f3b0ac34SDag-Erling Smørgrav   LDFLAGS="$LDFLAGS $3"
1647f3b0ac34SDag-Erling Smørgrav   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1648f3b0ac34SDag-Erling Smørgrav   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1649f3b0ac34SDag-Erling Smørgrav     # The linker can only warn and ignore the option if not recognized
1650f3b0ac34SDag-Erling Smørgrav     # So say no if there are warnings
1651f3b0ac34SDag-Erling Smørgrav     if test -s conftest.err; then
1652f3b0ac34SDag-Erling Smørgrav       # Append any errors to the config.log.
1653f3b0ac34SDag-Erling Smørgrav       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1654f3b0ac34SDag-Erling Smørgrav       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1655f3b0ac34SDag-Erling Smørgrav       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1656f3b0ac34SDag-Erling Smørgrav       if diff conftest.exp conftest.er2 >/dev/null; then
1657f3b0ac34SDag-Erling Smørgrav         $2=yes
1658f3b0ac34SDag-Erling Smørgrav       fi
1659f3b0ac34SDag-Erling Smørgrav     else
1660f3b0ac34SDag-Erling Smørgrav       $2=yes
1661f3b0ac34SDag-Erling Smørgrav     fi
1662f3b0ac34SDag-Erling Smørgrav   fi
1663f3b0ac34SDag-Erling Smørgrav   $RM -r conftest*
1664f3b0ac34SDag-Erling Smørgrav   LDFLAGS=$save_LDFLAGS
1665f3b0ac34SDag-Erling Smørgrav])
1666f3b0ac34SDag-Erling Smørgrav
1667f3b0ac34SDag-Erling Smørgravif test yes = "[$]$2"; then
1668f3b0ac34SDag-Erling Smørgrav    m4_if([$4], , :, [$4])
1669f3b0ac34SDag-Erling Smørgravelse
1670f3b0ac34SDag-Erling Smørgrav    m4_if([$5], , :, [$5])
1671f3b0ac34SDag-Erling Smørgravfi
1672f3b0ac34SDag-Erling Smørgrav])# _LT_LINKER_OPTION
1673f3b0ac34SDag-Erling Smørgrav
1674f3b0ac34SDag-Erling Smørgrav# Old name:
1675f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1676f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
1677f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1678f3b0ac34SDag-Erling Smørgrav
1679f3b0ac34SDag-Erling Smørgrav
1680f3b0ac34SDag-Erling Smørgrav# LT_CMD_MAX_LEN
1681f3b0ac34SDag-Erling Smørgrav#---------------
1682f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_CMD_MAX_LEN],
1683f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1684f3b0ac34SDag-Erling Smørgrav# find the maximum length of command line arguments
1685f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([the maximum length of command line arguments])
1686f3b0ac34SDag-Erling SmørgravAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1687f3b0ac34SDag-Erling Smørgrav  i=0
1688f3b0ac34SDag-Erling Smørgrav  teststring=ABCD
1689f3b0ac34SDag-Erling Smørgrav
1690f3b0ac34SDag-Erling Smørgrav  case $build_os in
1691f3b0ac34SDag-Erling Smørgrav  msdosdjgpp*)
1692f3b0ac34SDag-Erling Smørgrav    # On DJGPP, this test can blow up pretty badly due to problems in libc
1693f3b0ac34SDag-Erling Smørgrav    # (any single argument exceeding 2000 bytes causes a buffer overrun
1694f3b0ac34SDag-Erling Smørgrav    # during glob expansion).  Even if it were fixed, the result of this
1695f3b0ac34SDag-Erling Smørgrav    # check would be larger than it should be.
1696f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1697f3b0ac34SDag-Erling Smørgrav    ;;
1698f3b0ac34SDag-Erling Smørgrav
1699f3b0ac34SDag-Erling Smørgrav  gnu*)
1700f3b0ac34SDag-Erling Smørgrav    # Under GNU Hurd, this test is not required because there is
1701f3b0ac34SDag-Erling Smørgrav    # no limit to the length of command line arguments.
1702f3b0ac34SDag-Erling Smørgrav    # Libtool will interpret -1 as no limit whatsoever
1703f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=-1;
1704f3b0ac34SDag-Erling Smørgrav    ;;
1705f3b0ac34SDag-Erling Smørgrav
1706f3b0ac34SDag-Erling Smørgrav  cygwin* | mingw* | cegcc*)
1707f3b0ac34SDag-Erling Smørgrav    # On Win9x/ME, this test blows up -- it succeeds, but takes
1708f3b0ac34SDag-Erling Smørgrav    # about 5 minutes as the teststring grows exponentially.
1709f3b0ac34SDag-Erling Smørgrav    # Worse, since 9x/ME are not pre-emptively multitasking,
1710f3b0ac34SDag-Erling Smørgrav    # you end up with a "frozen" computer, even though with patience
1711f3b0ac34SDag-Erling Smørgrav    # the test eventually succeeds (with a max line length of 256k).
1712f3b0ac34SDag-Erling Smørgrav    # Instead, let's just punt: use the minimum linelength reported by
1713f3b0ac34SDag-Erling Smørgrav    # all of the supported platforms: 8192 (on NT/2K/XP).
1714f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=8192;
1715f3b0ac34SDag-Erling Smørgrav    ;;
1716f3b0ac34SDag-Erling Smørgrav
1717f3b0ac34SDag-Erling Smørgrav  mint*)
1718f3b0ac34SDag-Erling Smørgrav    # On MiNT this can take a long time and run out of memory.
1719f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=8192;
1720f3b0ac34SDag-Erling Smørgrav    ;;
1721f3b0ac34SDag-Erling Smørgrav
1722f3b0ac34SDag-Erling Smørgrav  amigaos*)
1723f3b0ac34SDag-Erling Smørgrav    # On AmigaOS with pdksh, this test takes hours, literally.
1724f3b0ac34SDag-Erling Smørgrav    # So we just punt and use a minimum line length of 8192.
1725f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=8192;
1726f3b0ac34SDag-Erling Smørgrav    ;;
1727f3b0ac34SDag-Erling Smørgrav
1728*3ba4c8c8SDag-Erling Smørgrav  bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
1729f3b0ac34SDag-Erling Smørgrav    # This has been around since 386BSD, at least.  Likely further.
1730f3b0ac34SDag-Erling Smørgrav    if test -x /sbin/sysctl; then
1731f3b0ac34SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1732f3b0ac34SDag-Erling Smørgrav    elif test -x /usr/sbin/sysctl; then
1733f3b0ac34SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1734f3b0ac34SDag-Erling Smørgrav    else
1735f3b0ac34SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1736f3b0ac34SDag-Erling Smørgrav    fi
1737f3b0ac34SDag-Erling Smørgrav    # And add a safety zone
1738f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1739f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1740f3b0ac34SDag-Erling Smørgrav    ;;
1741f3b0ac34SDag-Erling Smørgrav
1742f3b0ac34SDag-Erling Smørgrav  interix*)
1743f3b0ac34SDag-Erling Smørgrav    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1744f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=196608
1745f3b0ac34SDag-Erling Smørgrav    ;;
1746f3b0ac34SDag-Erling Smørgrav
1747f3b0ac34SDag-Erling Smørgrav  os2*)
1748f3b0ac34SDag-Erling Smørgrav    # The test takes a long time on OS/2.
1749f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=8192
1750f3b0ac34SDag-Erling Smørgrav    ;;
1751f3b0ac34SDag-Erling Smørgrav
1752f3b0ac34SDag-Erling Smørgrav  osf*)
1753f3b0ac34SDag-Erling Smørgrav    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1754f3b0ac34SDag-Erling Smørgrav    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1755f3b0ac34SDag-Erling Smørgrav    # nice to cause kernel panics so lets avoid the loop below.
1756f3b0ac34SDag-Erling Smørgrav    # First set a reasonable default.
1757f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=16384
1758f3b0ac34SDag-Erling Smørgrav    #
1759f3b0ac34SDag-Erling Smørgrav    if test -x /sbin/sysconfig; then
1760f3b0ac34SDag-Erling Smørgrav      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1761f3b0ac34SDag-Erling Smørgrav        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1762f3b0ac34SDag-Erling Smørgrav      esac
1763f3b0ac34SDag-Erling Smørgrav    fi
1764f3b0ac34SDag-Erling Smørgrav    ;;
1765f3b0ac34SDag-Erling Smørgrav  sco3.2v5*)
1766f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=102400
1767f3b0ac34SDag-Erling Smørgrav    ;;
1768f3b0ac34SDag-Erling Smørgrav  sysv5* | sco5v6* | sysv4.2uw2*)
1769f3b0ac34SDag-Erling Smørgrav    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1770f3b0ac34SDag-Erling Smørgrav    if test -n "$kargmax"; then
1771*3ba4c8c8SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
1772f3b0ac34SDag-Erling Smørgrav    else
1773f3b0ac34SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=32768
1774f3b0ac34SDag-Erling Smørgrav    fi
1775f3b0ac34SDag-Erling Smørgrav    ;;
1776f3b0ac34SDag-Erling Smørgrav  *)
1777f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1778f3b0ac34SDag-Erling Smørgrav    if test -n "$lt_cv_sys_max_cmd_len" && \
1779f3b0ac34SDag-Erling Smørgrav       test undefined != "$lt_cv_sys_max_cmd_len"; then
1780f3b0ac34SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1781f3b0ac34SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1782f3b0ac34SDag-Erling Smørgrav    else
1783f3b0ac34SDag-Erling Smørgrav      # Make teststring a little bigger before we do anything with it.
1784f3b0ac34SDag-Erling Smørgrav      # a 1K string should be a reasonable start.
1785f3b0ac34SDag-Erling Smørgrav      for i in 1 2 3 4 5 6 7 8; do
1786f3b0ac34SDag-Erling Smørgrav        teststring=$teststring$teststring
1787f3b0ac34SDag-Erling Smørgrav      done
1788f3b0ac34SDag-Erling Smørgrav      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1789f3b0ac34SDag-Erling Smørgrav      # If test is not a shell built-in, we'll probably end up computing a
1790f3b0ac34SDag-Erling Smørgrav      # maximum length that is only half of the actual maximum length, but
1791f3b0ac34SDag-Erling Smørgrav      # we can't tell.
1792f3b0ac34SDag-Erling Smørgrav      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1793f3b0ac34SDag-Erling Smørgrav	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1794f3b0ac34SDag-Erling Smørgrav	      test 17 != "$i" # 1/2 MB should be enough
1795f3b0ac34SDag-Erling Smørgrav      do
1796f3b0ac34SDag-Erling Smørgrav        i=`expr $i + 1`
1797f3b0ac34SDag-Erling Smørgrav        teststring=$teststring$teststring
1798f3b0ac34SDag-Erling Smørgrav      done
1799f3b0ac34SDag-Erling Smørgrav      # Only check the string length outside the loop.
1800f3b0ac34SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1801f3b0ac34SDag-Erling Smørgrav      teststring=
1802f3b0ac34SDag-Erling Smørgrav      # Add a significant safety factor because C++ compilers can tack on
1803f3b0ac34SDag-Erling Smørgrav      # massive amounts of additional arguments before passing them to the
1804f3b0ac34SDag-Erling Smørgrav      # linker.  It appears as though 1/2 is a usable value.
1805f3b0ac34SDag-Erling Smørgrav      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1806f3b0ac34SDag-Erling Smørgrav    fi
1807f3b0ac34SDag-Erling Smørgrav    ;;
1808f3b0ac34SDag-Erling Smørgrav  esac
1809f3b0ac34SDag-Erling Smørgrav])
1810f3b0ac34SDag-Erling Smørgravif test -n "$lt_cv_sys_max_cmd_len"; then
1811f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1812f3b0ac34SDag-Erling Smørgravelse
1813f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT(none)
1814f3b0ac34SDag-Erling Smørgravfi
1815f3b0ac34SDag-Erling Smørgravmax_cmd_len=$lt_cv_sys_max_cmd_len
1816f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [max_cmd_len], [0],
1817f3b0ac34SDag-Erling Smørgrav    [What is the maximum length of a command?])
1818f3b0ac34SDag-Erling Smørgrav])# LT_CMD_MAX_LEN
1819f3b0ac34SDag-Erling Smørgrav
1820f3b0ac34SDag-Erling Smørgrav# Old name:
1821f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1822f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
1823f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1824f3b0ac34SDag-Erling Smørgrav
1825f3b0ac34SDag-Erling Smørgrav
1826f3b0ac34SDag-Erling Smørgrav# _LT_HEADER_DLFCN
1827f3b0ac34SDag-Erling Smørgrav# ----------------
1828f3b0ac34SDag-Erling Smørgravm4_defun([_LT_HEADER_DLFCN],
1829f3b0ac34SDag-Erling Smørgrav[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1830f3b0ac34SDag-Erling Smørgrav])# _LT_HEADER_DLFCN
1831f3b0ac34SDag-Erling Smørgrav
1832f3b0ac34SDag-Erling Smørgrav
1833f3b0ac34SDag-Erling Smørgrav# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1834f3b0ac34SDag-Erling Smørgrav#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1835f3b0ac34SDag-Erling Smørgrav# ----------------------------------------------------------------
1836f3b0ac34SDag-Erling Smørgravm4_defun([_LT_TRY_DLOPEN_SELF],
1837f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_HEADER_DLFCN])dnl
1838f3b0ac34SDag-Erling Smørgravif test yes = "$cross_compiling"; then :
1839f3b0ac34SDag-Erling Smørgrav  [$4]
1840f3b0ac34SDag-Erling Smørgravelse
1841f3b0ac34SDag-Erling Smørgrav  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1842f3b0ac34SDag-Erling Smørgrav  lt_status=$lt_dlunknown
1843f3b0ac34SDag-Erling Smørgrav  cat > conftest.$ac_ext <<_LT_EOF
1844f3b0ac34SDag-Erling Smørgrav[#line $LINENO "configure"
1845f3b0ac34SDag-Erling Smørgrav#include "confdefs.h"
1846f3b0ac34SDag-Erling Smørgrav
1847f3b0ac34SDag-Erling Smørgrav#if HAVE_DLFCN_H
1848f3b0ac34SDag-Erling Smørgrav#include <dlfcn.h>
1849f3b0ac34SDag-Erling Smørgrav#endif
1850f3b0ac34SDag-Erling Smørgrav
1851f3b0ac34SDag-Erling Smørgrav#include <stdio.h>
1852f3b0ac34SDag-Erling Smørgrav
1853f3b0ac34SDag-Erling Smørgrav#ifdef RTLD_GLOBAL
1854f3b0ac34SDag-Erling Smørgrav#  define LT_DLGLOBAL		RTLD_GLOBAL
1855f3b0ac34SDag-Erling Smørgrav#else
1856f3b0ac34SDag-Erling Smørgrav#  ifdef DL_GLOBAL
1857f3b0ac34SDag-Erling Smørgrav#    define LT_DLGLOBAL		DL_GLOBAL
1858f3b0ac34SDag-Erling Smørgrav#  else
1859f3b0ac34SDag-Erling Smørgrav#    define LT_DLGLOBAL		0
1860f3b0ac34SDag-Erling Smørgrav#  endif
1861f3b0ac34SDag-Erling Smørgrav#endif
1862f3b0ac34SDag-Erling Smørgrav
1863f3b0ac34SDag-Erling Smørgrav/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1864f3b0ac34SDag-Erling Smørgrav   find out it does not work in some platform. */
1865f3b0ac34SDag-Erling Smørgrav#ifndef LT_DLLAZY_OR_NOW
1866f3b0ac34SDag-Erling Smørgrav#  ifdef RTLD_LAZY
1867f3b0ac34SDag-Erling Smørgrav#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1868f3b0ac34SDag-Erling Smørgrav#  else
1869f3b0ac34SDag-Erling Smørgrav#    ifdef DL_LAZY
1870f3b0ac34SDag-Erling Smørgrav#      define LT_DLLAZY_OR_NOW		DL_LAZY
1871f3b0ac34SDag-Erling Smørgrav#    else
1872f3b0ac34SDag-Erling Smørgrav#      ifdef RTLD_NOW
1873f3b0ac34SDag-Erling Smørgrav#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1874f3b0ac34SDag-Erling Smørgrav#      else
1875f3b0ac34SDag-Erling Smørgrav#        ifdef DL_NOW
1876f3b0ac34SDag-Erling Smørgrav#          define LT_DLLAZY_OR_NOW	DL_NOW
1877f3b0ac34SDag-Erling Smørgrav#        else
1878f3b0ac34SDag-Erling Smørgrav#          define LT_DLLAZY_OR_NOW	0
1879f3b0ac34SDag-Erling Smørgrav#        endif
1880f3b0ac34SDag-Erling Smørgrav#      endif
1881f3b0ac34SDag-Erling Smørgrav#    endif
1882f3b0ac34SDag-Erling Smørgrav#  endif
1883f3b0ac34SDag-Erling Smørgrav#endif
1884f3b0ac34SDag-Erling Smørgrav
1885f3b0ac34SDag-Erling Smørgrav/* When -fvisibility=hidden is used, assume the code has been annotated
1886f3b0ac34SDag-Erling Smørgrav   correspondingly for the symbols needed.  */
1887f3b0ac34SDag-Erling Smørgrav#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1888f3b0ac34SDag-Erling Smørgravint fnord () __attribute__((visibility("default")));
1889f3b0ac34SDag-Erling Smørgrav#endif
1890f3b0ac34SDag-Erling Smørgrav
1891f3b0ac34SDag-Erling Smørgravint fnord () { return 42; }
1892f3b0ac34SDag-Erling Smørgravint main ()
1893f3b0ac34SDag-Erling Smørgrav{
1894f3b0ac34SDag-Erling Smørgrav  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1895f3b0ac34SDag-Erling Smørgrav  int status = $lt_dlunknown;
1896f3b0ac34SDag-Erling Smørgrav
1897f3b0ac34SDag-Erling Smørgrav  if (self)
1898f3b0ac34SDag-Erling Smørgrav    {
1899f3b0ac34SDag-Erling Smørgrav      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1900f3b0ac34SDag-Erling Smørgrav      else
1901f3b0ac34SDag-Erling Smørgrav        {
1902f3b0ac34SDag-Erling Smørgrav	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1903f3b0ac34SDag-Erling Smørgrav          else puts (dlerror ());
1904f3b0ac34SDag-Erling Smørgrav	}
1905f3b0ac34SDag-Erling Smørgrav      /* dlclose (self); */
1906f3b0ac34SDag-Erling Smørgrav    }
1907f3b0ac34SDag-Erling Smørgrav  else
1908f3b0ac34SDag-Erling Smørgrav    puts (dlerror ());
1909f3b0ac34SDag-Erling Smørgrav
1910f3b0ac34SDag-Erling Smørgrav  return status;
1911f3b0ac34SDag-Erling Smørgrav}]
1912f3b0ac34SDag-Erling Smørgrav_LT_EOF
1913f3b0ac34SDag-Erling Smørgrav  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1914f3b0ac34SDag-Erling Smørgrav    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1915f3b0ac34SDag-Erling Smørgrav    lt_status=$?
1916f3b0ac34SDag-Erling Smørgrav    case x$lt_status in
1917f3b0ac34SDag-Erling Smørgrav      x$lt_dlno_uscore) $1 ;;
1918f3b0ac34SDag-Erling Smørgrav      x$lt_dlneed_uscore) $2 ;;
1919f3b0ac34SDag-Erling Smørgrav      x$lt_dlunknown|x*) $3 ;;
1920f3b0ac34SDag-Erling Smørgrav    esac
1921f3b0ac34SDag-Erling Smørgrav  else :
1922f3b0ac34SDag-Erling Smørgrav    # compilation failed
1923f3b0ac34SDag-Erling Smørgrav    $3
1924f3b0ac34SDag-Erling Smørgrav  fi
1925f3b0ac34SDag-Erling Smørgravfi
1926f3b0ac34SDag-Erling Smørgravrm -fr conftest*
1927f3b0ac34SDag-Erling Smørgrav])# _LT_TRY_DLOPEN_SELF
1928f3b0ac34SDag-Erling Smørgrav
1929f3b0ac34SDag-Erling Smørgrav
1930f3b0ac34SDag-Erling Smørgrav# LT_SYS_DLOPEN_SELF
1931f3b0ac34SDag-Erling Smørgrav# ------------------
1932f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_SYS_DLOPEN_SELF],
1933f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_HEADER_DLFCN])dnl
1934f3b0ac34SDag-Erling Smørgravif test yes != "$enable_dlopen"; then
1935f3b0ac34SDag-Erling Smørgrav  enable_dlopen=unknown
1936f3b0ac34SDag-Erling Smørgrav  enable_dlopen_self=unknown
1937f3b0ac34SDag-Erling Smørgrav  enable_dlopen_self_static=unknown
1938f3b0ac34SDag-Erling Smørgravelse
1939f3b0ac34SDag-Erling Smørgrav  lt_cv_dlopen=no
1940f3b0ac34SDag-Erling Smørgrav  lt_cv_dlopen_libs=
1941f3b0ac34SDag-Erling Smørgrav
1942f3b0ac34SDag-Erling Smørgrav  case $host_os in
1943f3b0ac34SDag-Erling Smørgrav  beos*)
1944f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen=load_add_on
1945f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen_libs=
1946f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen_self=yes
1947f3b0ac34SDag-Erling Smørgrav    ;;
1948f3b0ac34SDag-Erling Smørgrav
1949f3b0ac34SDag-Erling Smørgrav  mingw* | pw32* | cegcc*)
1950f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen=LoadLibrary
1951f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen_libs=
1952f3b0ac34SDag-Erling Smørgrav    ;;
1953f3b0ac34SDag-Erling Smørgrav
1954f3b0ac34SDag-Erling Smørgrav  cygwin*)
1955f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen=dlopen
1956f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen_libs=
1957f3b0ac34SDag-Erling Smørgrav    ;;
1958f3b0ac34SDag-Erling Smørgrav
1959f3b0ac34SDag-Erling Smørgrav  darwin*)
1960f3b0ac34SDag-Erling Smørgrav    # if libdl is installed we need to link against it
1961f3b0ac34SDag-Erling Smørgrav    AC_CHECK_LIB([dl], [dlopen],
1962f3b0ac34SDag-Erling Smørgrav		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1963f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen=dyld
1964f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen_libs=
1965f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen_self=yes
1966f3b0ac34SDag-Erling Smørgrav    ])
1967f3b0ac34SDag-Erling Smørgrav    ;;
1968f3b0ac34SDag-Erling Smørgrav
1969f3b0ac34SDag-Erling Smørgrav  tpf*)
1970f3b0ac34SDag-Erling Smørgrav    # Don't try to run any link tests for TPF.  We know it's impossible
1971f3b0ac34SDag-Erling Smørgrav    # because TPF is a cross-compiler, and we know how we open DSOs.
1972f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen=dlopen
1973f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen_libs=
1974f3b0ac34SDag-Erling Smørgrav    lt_cv_dlopen_self=no
1975f3b0ac34SDag-Erling Smørgrav    ;;
1976f3b0ac34SDag-Erling Smørgrav
1977f3b0ac34SDag-Erling Smørgrav  *)
1978f3b0ac34SDag-Erling Smørgrav    AC_CHECK_FUNC([shl_load],
1979f3b0ac34SDag-Erling Smørgrav	  [lt_cv_dlopen=shl_load],
1980f3b0ac34SDag-Erling Smørgrav      [AC_CHECK_LIB([dld], [shl_load],
1981f3b0ac34SDag-Erling Smørgrav	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1982f3b0ac34SDag-Erling Smørgrav	[AC_CHECK_FUNC([dlopen],
1983f3b0ac34SDag-Erling Smørgrav	      [lt_cv_dlopen=dlopen],
1984f3b0ac34SDag-Erling Smørgrav	  [AC_CHECK_LIB([dl], [dlopen],
1985f3b0ac34SDag-Erling Smørgrav		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1986f3b0ac34SDag-Erling Smørgrav	    [AC_CHECK_LIB([svld], [dlopen],
1987f3b0ac34SDag-Erling Smørgrav		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1988f3b0ac34SDag-Erling Smørgrav	      [AC_CHECK_LIB([dld], [dld_link],
1989f3b0ac34SDag-Erling Smørgrav		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1990f3b0ac34SDag-Erling Smørgrav	      ])
1991f3b0ac34SDag-Erling Smørgrav	    ])
1992f3b0ac34SDag-Erling Smørgrav	  ])
1993f3b0ac34SDag-Erling Smørgrav	])
1994f3b0ac34SDag-Erling Smørgrav      ])
1995f3b0ac34SDag-Erling Smørgrav    ;;
1996f3b0ac34SDag-Erling Smørgrav  esac
1997f3b0ac34SDag-Erling Smørgrav
1998f3b0ac34SDag-Erling Smørgrav  if test no = "$lt_cv_dlopen"; then
1999f3b0ac34SDag-Erling Smørgrav    enable_dlopen=no
2000f3b0ac34SDag-Erling Smørgrav  else
2001f3b0ac34SDag-Erling Smørgrav    enable_dlopen=yes
2002f3b0ac34SDag-Erling Smørgrav  fi
2003f3b0ac34SDag-Erling Smørgrav
2004f3b0ac34SDag-Erling Smørgrav  case $lt_cv_dlopen in
2005f3b0ac34SDag-Erling Smørgrav  dlopen)
2006f3b0ac34SDag-Erling Smørgrav    save_CPPFLAGS=$CPPFLAGS
2007f3b0ac34SDag-Erling Smørgrav    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2008f3b0ac34SDag-Erling Smørgrav
2009f3b0ac34SDag-Erling Smørgrav    save_LDFLAGS=$LDFLAGS
2010f3b0ac34SDag-Erling Smørgrav    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2011f3b0ac34SDag-Erling Smørgrav
2012f3b0ac34SDag-Erling Smørgrav    save_LIBS=$LIBS
2013f3b0ac34SDag-Erling Smørgrav    LIBS="$lt_cv_dlopen_libs $LIBS"
2014f3b0ac34SDag-Erling Smørgrav
2015f3b0ac34SDag-Erling Smørgrav    AC_CACHE_CHECK([whether a program can dlopen itself],
2016f3b0ac34SDag-Erling Smørgrav	  lt_cv_dlopen_self, [dnl
2017f3b0ac34SDag-Erling Smørgrav	  _LT_TRY_DLOPEN_SELF(
2018f3b0ac34SDag-Erling Smørgrav	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2019f3b0ac34SDag-Erling Smørgrav	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2020f3b0ac34SDag-Erling Smørgrav    ])
2021f3b0ac34SDag-Erling Smørgrav
2022f3b0ac34SDag-Erling Smørgrav    if test yes = "$lt_cv_dlopen_self"; then
2023f3b0ac34SDag-Erling Smørgrav      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2024f3b0ac34SDag-Erling Smørgrav      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2025f3b0ac34SDag-Erling Smørgrav	  lt_cv_dlopen_self_static, [dnl
2026f3b0ac34SDag-Erling Smørgrav	  _LT_TRY_DLOPEN_SELF(
2027f3b0ac34SDag-Erling Smørgrav	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2028f3b0ac34SDag-Erling Smørgrav	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2029f3b0ac34SDag-Erling Smørgrav      ])
2030f3b0ac34SDag-Erling Smørgrav    fi
2031f3b0ac34SDag-Erling Smørgrav
2032f3b0ac34SDag-Erling Smørgrav    CPPFLAGS=$save_CPPFLAGS
2033f3b0ac34SDag-Erling Smørgrav    LDFLAGS=$save_LDFLAGS
2034f3b0ac34SDag-Erling Smørgrav    LIBS=$save_LIBS
2035f3b0ac34SDag-Erling Smørgrav    ;;
2036f3b0ac34SDag-Erling Smørgrav  esac
2037f3b0ac34SDag-Erling Smørgrav
2038f3b0ac34SDag-Erling Smørgrav  case $lt_cv_dlopen_self in
2039f3b0ac34SDag-Erling Smørgrav  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2040f3b0ac34SDag-Erling Smørgrav  *) enable_dlopen_self=unknown ;;
2041f3b0ac34SDag-Erling Smørgrav  esac
2042f3b0ac34SDag-Erling Smørgrav
2043f3b0ac34SDag-Erling Smørgrav  case $lt_cv_dlopen_self_static in
2044f3b0ac34SDag-Erling Smørgrav  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2045f3b0ac34SDag-Erling Smørgrav  *) enable_dlopen_self_static=unknown ;;
2046f3b0ac34SDag-Erling Smørgrav  esac
2047f3b0ac34SDag-Erling Smørgravfi
2048f3b0ac34SDag-Erling Smørgrav_LT_DECL([dlopen_support], [enable_dlopen], [0],
2049f3b0ac34SDag-Erling Smørgrav	 [Whether dlopen is supported])
2050f3b0ac34SDag-Erling Smørgrav_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2051f3b0ac34SDag-Erling Smørgrav	 [Whether dlopen of programs is supported])
2052f3b0ac34SDag-Erling Smørgrav_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2053f3b0ac34SDag-Erling Smørgrav	 [Whether dlopen of statically linked programs is supported])
2054f3b0ac34SDag-Erling Smørgrav])# LT_SYS_DLOPEN_SELF
2055f3b0ac34SDag-Erling Smørgrav
2056f3b0ac34SDag-Erling Smørgrav# Old name:
2057f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2058f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
2059f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2060f3b0ac34SDag-Erling Smørgrav
2061f3b0ac34SDag-Erling Smørgrav
2062f3b0ac34SDag-Erling Smørgrav# _LT_COMPILER_C_O([TAGNAME])
2063f3b0ac34SDag-Erling Smørgrav# ---------------------------
2064f3b0ac34SDag-Erling Smørgrav# Check to see if options -c and -o are simultaneously supported by compiler.
2065f3b0ac34SDag-Erling Smørgrav# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2066f3b0ac34SDag-Erling Smørgravm4_defun([_LT_COMPILER_C_O],
2067f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_SED])dnl
2068f3b0ac34SDag-Erling Smørgravm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2069f3b0ac34SDag-Erling Smørgravm4_require([_LT_TAG_COMPILER])dnl
2070f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2071f3b0ac34SDag-Erling Smørgrav  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2072f3b0ac34SDag-Erling Smørgrav  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2073f3b0ac34SDag-Erling Smørgrav   $RM -r conftest 2>/dev/null
2074f3b0ac34SDag-Erling Smørgrav   mkdir conftest
2075f3b0ac34SDag-Erling Smørgrav   cd conftest
2076f3b0ac34SDag-Erling Smørgrav   mkdir out
2077f3b0ac34SDag-Erling Smørgrav   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2078f3b0ac34SDag-Erling Smørgrav
2079f3b0ac34SDag-Erling Smørgrav   lt_compiler_flag="-o out/conftest2.$ac_objext"
2080f3b0ac34SDag-Erling Smørgrav   # Insert the option either (1) after the last *FLAGS variable, or
2081f3b0ac34SDag-Erling Smørgrav   # (2) before a word containing "conftest.", or (3) at the end.
2082f3b0ac34SDag-Erling Smørgrav   # Note that $ac_compile itself does not contain backslashes and begins
2083f3b0ac34SDag-Erling Smørgrav   # with a dollar sign (not a hyphen), so the echo should work correctly.
2084f3b0ac34SDag-Erling Smørgrav   lt_compile=`echo "$ac_compile" | $SED \
2085f3b0ac34SDag-Erling Smørgrav   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2086f3b0ac34SDag-Erling Smørgrav   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2087f3b0ac34SDag-Erling Smørgrav   -e 's:$: $lt_compiler_flag:'`
2088f3b0ac34SDag-Erling Smørgrav   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2089f3b0ac34SDag-Erling Smørgrav   (eval "$lt_compile" 2>out/conftest.err)
2090f3b0ac34SDag-Erling Smørgrav   ac_status=$?
2091f3b0ac34SDag-Erling Smørgrav   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2092f3b0ac34SDag-Erling Smørgrav   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2093f3b0ac34SDag-Erling Smørgrav   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2094f3b0ac34SDag-Erling Smørgrav   then
2095f3b0ac34SDag-Erling Smørgrav     # The compiler can only warn and ignore the option if not recognized
2096f3b0ac34SDag-Erling Smørgrav     # So say no if there are warnings
2097f3b0ac34SDag-Erling Smørgrav     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2098f3b0ac34SDag-Erling Smørgrav     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2099f3b0ac34SDag-Erling Smørgrav     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2100f3b0ac34SDag-Erling Smørgrav       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2101f3b0ac34SDag-Erling Smørgrav     fi
2102f3b0ac34SDag-Erling Smørgrav   fi
2103f3b0ac34SDag-Erling Smørgrav   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2104f3b0ac34SDag-Erling Smørgrav   $RM conftest*
2105f3b0ac34SDag-Erling Smørgrav   # SGI C++ compiler will create directory out/ii_files/ for
2106f3b0ac34SDag-Erling Smørgrav   # template instantiation
2107f3b0ac34SDag-Erling Smørgrav   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2108f3b0ac34SDag-Erling Smørgrav   $RM out/* && rmdir out
2109f3b0ac34SDag-Erling Smørgrav   cd ..
2110f3b0ac34SDag-Erling Smørgrav   $RM -r conftest
2111f3b0ac34SDag-Erling Smørgrav   $RM conftest*
2112f3b0ac34SDag-Erling Smørgrav])
2113f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2114f3b0ac34SDag-Erling Smørgrav	[Does compiler simultaneously support -c and -o options?])
2115f3b0ac34SDag-Erling Smørgrav])# _LT_COMPILER_C_O
2116f3b0ac34SDag-Erling Smørgrav
2117f3b0ac34SDag-Erling Smørgrav
2118f3b0ac34SDag-Erling Smørgrav# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2119f3b0ac34SDag-Erling Smørgrav# ----------------------------------
2120f3b0ac34SDag-Erling Smørgrav# Check to see if we can do hard links to lock some files if needed
2121f3b0ac34SDag-Erling Smørgravm4_defun([_LT_COMPILER_FILE_LOCKS],
2122f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_ENABLE_LOCK])dnl
2123f3b0ac34SDag-Erling Smørgravm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2124f3b0ac34SDag-Erling Smørgrav_LT_COMPILER_C_O([$1])
2125f3b0ac34SDag-Erling Smørgrav
2126f3b0ac34SDag-Erling Smørgravhard_links=nottested
2127f3b0ac34SDag-Erling Smørgravif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2128f3b0ac34SDag-Erling Smørgrav  # do not overwrite the value of need_locks provided by the user
2129f3b0ac34SDag-Erling Smørgrav  AC_MSG_CHECKING([if we can lock with hard links])
2130f3b0ac34SDag-Erling Smørgrav  hard_links=yes
2131f3b0ac34SDag-Erling Smørgrav  $RM conftest*
2132f3b0ac34SDag-Erling Smørgrav  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2133f3b0ac34SDag-Erling Smørgrav  touch conftest.a
2134f3b0ac34SDag-Erling Smørgrav  ln conftest.a conftest.b 2>&5 || hard_links=no
2135f3b0ac34SDag-Erling Smørgrav  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2136f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT([$hard_links])
2137f3b0ac34SDag-Erling Smørgrav  if test no = "$hard_links"; then
2138f3b0ac34SDag-Erling Smørgrav    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2139f3b0ac34SDag-Erling Smørgrav    need_locks=warn
2140f3b0ac34SDag-Erling Smørgrav  fi
2141f3b0ac34SDag-Erling Smørgravelse
2142f3b0ac34SDag-Erling Smørgrav  need_locks=no
2143f3b0ac34SDag-Erling Smørgravfi
2144f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2145f3b0ac34SDag-Erling Smørgrav])# _LT_COMPILER_FILE_LOCKS
2146f3b0ac34SDag-Erling Smørgrav
2147f3b0ac34SDag-Erling Smørgrav
2148f3b0ac34SDag-Erling Smørgrav# _LT_CHECK_OBJDIR
2149f3b0ac34SDag-Erling Smørgrav# ----------------
2150f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CHECK_OBJDIR],
2151f3b0ac34SDag-Erling Smørgrav[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2152f3b0ac34SDag-Erling Smørgrav[rm -f .libs 2>/dev/null
2153f3b0ac34SDag-Erling Smørgravmkdir .libs 2>/dev/null
2154f3b0ac34SDag-Erling Smørgravif test -d .libs; then
2155f3b0ac34SDag-Erling Smørgrav  lt_cv_objdir=.libs
2156f3b0ac34SDag-Erling Smørgravelse
2157f3b0ac34SDag-Erling Smørgrav  # MS-DOS does not allow filenames that begin with a dot.
2158f3b0ac34SDag-Erling Smørgrav  lt_cv_objdir=_libs
2159f3b0ac34SDag-Erling Smørgravfi
2160f3b0ac34SDag-Erling Smørgravrmdir .libs 2>/dev/null])
2161f3b0ac34SDag-Erling Smørgravobjdir=$lt_cv_objdir
2162f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [objdir], [0],
2163f3b0ac34SDag-Erling Smørgrav         [The name of the directory that contains temporary libtool files])dnl
2164f3b0ac34SDag-Erling Smørgravm4_pattern_allow([LT_OBJDIR])dnl
2165f3b0ac34SDag-Erling SmørgravAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2166f3b0ac34SDag-Erling Smørgrav  [Define to the sub-directory where libtool stores uninstalled libraries.])
2167f3b0ac34SDag-Erling Smørgrav])# _LT_CHECK_OBJDIR
2168f3b0ac34SDag-Erling Smørgrav
2169f3b0ac34SDag-Erling Smørgrav
2170f3b0ac34SDag-Erling Smørgrav# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2171f3b0ac34SDag-Erling Smørgrav# --------------------------------------
2172f3b0ac34SDag-Erling Smørgrav# Check hardcoding attributes.
2173f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2174f3b0ac34SDag-Erling Smørgrav[AC_MSG_CHECKING([how to hardcode library paths into programs])
2175f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_action, $1)=
2176f3b0ac34SDag-Erling Smørgravif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2177f3b0ac34SDag-Erling Smørgrav   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2178f3b0ac34SDag-Erling Smørgrav   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2179f3b0ac34SDag-Erling Smørgrav
2180f3b0ac34SDag-Erling Smørgrav  # We can hardcode non-existent directories.
2181f3b0ac34SDag-Erling Smørgrav  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2182f3b0ac34SDag-Erling Smørgrav     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2183f3b0ac34SDag-Erling Smørgrav     # have to relink, otherwise we might link with an installed library
2184f3b0ac34SDag-Erling Smørgrav     # when we should be linking with a yet-to-be-installed one
2185f3b0ac34SDag-Erling Smørgrav     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2186f3b0ac34SDag-Erling Smørgrav     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2187f3b0ac34SDag-Erling Smørgrav    # Linking always hardcodes the temporary library directory.
2188f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(hardcode_action, $1)=relink
2189f3b0ac34SDag-Erling Smørgrav  else
2190f3b0ac34SDag-Erling Smørgrav    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2191f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(hardcode_action, $1)=immediate
2192f3b0ac34SDag-Erling Smørgrav  fi
2193f3b0ac34SDag-Erling Smørgravelse
2194f3b0ac34SDag-Erling Smørgrav  # We cannot hardcode anything, or else we can only hardcode existing
2195f3b0ac34SDag-Erling Smørgrav  # directories.
2196f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_action, $1)=unsupported
2197f3b0ac34SDag-Erling Smørgravfi
2198f3b0ac34SDag-Erling SmørgravAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2199f3b0ac34SDag-Erling Smørgrav
2200f3b0ac34SDag-Erling Smørgravif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2201f3b0ac34SDag-Erling Smørgrav   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2202f3b0ac34SDag-Erling Smørgrav  # Fast installation is not supported
2203f3b0ac34SDag-Erling Smørgrav  enable_fast_install=no
2204f3b0ac34SDag-Erling Smørgravelif test yes = "$shlibpath_overrides_runpath" ||
2205f3b0ac34SDag-Erling Smørgrav     test no = "$enable_shared"; then
2206f3b0ac34SDag-Erling Smørgrav  # Fast installation is not necessary
2207f3b0ac34SDag-Erling Smørgrav  enable_fast_install=needless
2208f3b0ac34SDag-Erling Smørgravfi
2209f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [hardcode_action], [0],
2210f3b0ac34SDag-Erling Smørgrav    [How to hardcode a shared library path into an executable])
2211f3b0ac34SDag-Erling Smørgrav])# _LT_LINKER_HARDCODE_LIBPATH
2212f3b0ac34SDag-Erling Smørgrav
2213f3b0ac34SDag-Erling Smørgrav
2214f3b0ac34SDag-Erling Smørgrav# _LT_CMD_STRIPLIB
2215f3b0ac34SDag-Erling Smørgrav# ----------------
2216f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CMD_STRIPLIB],
2217f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_EGREP])
2218f3b0ac34SDag-Erling Smørgravstriplib=
2219f3b0ac34SDag-Erling Smørgravold_striplib=
2220f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([whether stripping libraries is possible])
2221*3ba4c8c8SDag-Erling Smørgravif test -z "$STRIP"; then
2222*3ba4c8c8SDag-Erling Smørgrav  AC_MSG_RESULT([no])
2223*3ba4c8c8SDag-Erling Smørgravelse
2224*3ba4c8c8SDag-Erling Smørgrav  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2225*3ba4c8c8SDag-Erling Smørgrav    old_striplib="$STRIP --strip-debug"
2226*3ba4c8c8SDag-Erling Smørgrav    striplib="$STRIP --strip-unneeded"
2227f3b0ac34SDag-Erling Smørgrav    AC_MSG_RESULT([yes])
2228f3b0ac34SDag-Erling Smørgrav  else
2229f3b0ac34SDag-Erling Smørgrav    case $host_os in
2230f3b0ac34SDag-Erling Smørgrav    darwin*)
2231*3ba4c8c8SDag-Erling Smørgrav      # FIXME - insert some real tests, host_os isn't really good enough
2232f3b0ac34SDag-Erling Smørgrav      striplib="$STRIP -x"
2233f3b0ac34SDag-Erling Smørgrav      old_striplib="$STRIP -S"
2234f3b0ac34SDag-Erling Smørgrav      AC_MSG_RESULT([yes])
2235*3ba4c8c8SDag-Erling Smørgrav      ;;
2236*3ba4c8c8SDag-Erling Smørgrav    freebsd*)
2237*3ba4c8c8SDag-Erling Smørgrav      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
2238*3ba4c8c8SDag-Erling Smørgrav        old_striplib="$STRIP --strip-debug"
2239*3ba4c8c8SDag-Erling Smørgrav        striplib="$STRIP --strip-unneeded"
2240*3ba4c8c8SDag-Erling Smørgrav        AC_MSG_RESULT([yes])
2241f3b0ac34SDag-Erling Smørgrav      else
2242f3b0ac34SDag-Erling Smørgrav        AC_MSG_RESULT([no])
2243f3b0ac34SDag-Erling Smørgrav      fi
2244f3b0ac34SDag-Erling Smørgrav      ;;
2245f3b0ac34SDag-Erling Smørgrav    *)
2246f3b0ac34SDag-Erling Smørgrav      AC_MSG_RESULT([no])
2247f3b0ac34SDag-Erling Smørgrav      ;;
2248f3b0ac34SDag-Erling Smørgrav    esac
2249f3b0ac34SDag-Erling Smørgrav  fi
2250*3ba4c8c8SDag-Erling Smørgravfi
2251f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2252f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [striplib], [1])
2253f3b0ac34SDag-Erling Smørgrav])# _LT_CMD_STRIPLIB
2254f3b0ac34SDag-Erling Smørgrav
2255f3b0ac34SDag-Erling Smørgrav
2256f3b0ac34SDag-Erling Smørgrav# _LT_PREPARE_MUNGE_PATH_LIST
2257f3b0ac34SDag-Erling Smørgrav# ---------------------------
2258f3b0ac34SDag-Erling Smørgrav# Make sure func_munge_path_list() is defined correctly.
2259f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2260f3b0ac34SDag-Erling Smørgrav[[# func_munge_path_list VARIABLE PATH
2261f3b0ac34SDag-Erling Smørgrav# -----------------------------------
2262f3b0ac34SDag-Erling Smørgrav# VARIABLE is name of variable containing _space_ separated list of
2263f3b0ac34SDag-Erling Smørgrav# directories to be munged by the contents of PATH, which is string
2264f3b0ac34SDag-Erling Smørgrav# having a format:
2265f3b0ac34SDag-Erling Smørgrav# "DIR[:DIR]:"
2266f3b0ac34SDag-Erling Smørgrav#       string "DIR[ DIR]" will be prepended to VARIABLE
2267f3b0ac34SDag-Erling Smørgrav# ":DIR[:DIR]"
2268f3b0ac34SDag-Erling Smørgrav#       string "DIR[ DIR]" will be appended to VARIABLE
2269f3b0ac34SDag-Erling Smørgrav# "DIRP[:DIRP]::[DIRA:]DIRA"
2270f3b0ac34SDag-Erling Smørgrav#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2271f3b0ac34SDag-Erling Smørgrav#       "DIRA[ DIRA]" will be appended to VARIABLE
2272f3b0ac34SDag-Erling Smørgrav# "DIR[:DIR]"
2273f3b0ac34SDag-Erling Smørgrav#       VARIABLE will be replaced by "DIR[ DIR]"
2274f3b0ac34SDag-Erling Smørgravfunc_munge_path_list ()
2275f3b0ac34SDag-Erling Smørgrav{
2276f3b0ac34SDag-Erling Smørgrav    case x@S|@2 in
2277f3b0ac34SDag-Erling Smørgrav    x)
2278f3b0ac34SDag-Erling Smørgrav        ;;
2279f3b0ac34SDag-Erling Smørgrav    *:)
2280f3b0ac34SDag-Erling Smørgrav        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2281f3b0ac34SDag-Erling Smørgrav        ;;
2282f3b0ac34SDag-Erling Smørgrav    x:*)
2283f3b0ac34SDag-Erling Smørgrav        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2284f3b0ac34SDag-Erling Smørgrav        ;;
2285f3b0ac34SDag-Erling Smørgrav    *::*)
2286f3b0ac34SDag-Erling Smørgrav        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2287f3b0ac34SDag-Erling Smørgrav        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2288f3b0ac34SDag-Erling Smørgrav        ;;
2289f3b0ac34SDag-Erling Smørgrav    *)
2290f3b0ac34SDag-Erling Smørgrav        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2291f3b0ac34SDag-Erling Smørgrav        ;;
2292f3b0ac34SDag-Erling Smørgrav    esac
2293f3b0ac34SDag-Erling Smørgrav}
2294f3b0ac34SDag-Erling Smørgrav]])# _LT_PREPARE_PATH_LIST
2295f3b0ac34SDag-Erling Smørgrav
2296f3b0ac34SDag-Erling Smørgrav
2297f3b0ac34SDag-Erling Smørgrav# _LT_SYS_DYNAMIC_LINKER([TAG])
2298f3b0ac34SDag-Erling Smørgrav# -----------------------------
2299f3b0ac34SDag-Erling Smørgrav# PORTME Fill in your ld.so characteristics
2300f3b0ac34SDag-Erling Smørgravm4_defun([_LT_SYS_DYNAMIC_LINKER],
2301f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2302f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_EGREP])dnl
2303f3b0ac34SDag-Erling Smørgravm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2304f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_OBJDUMP])dnl
2305f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_SED])dnl
2306f3b0ac34SDag-Erling Smørgravm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2307f3b0ac34SDag-Erling Smørgravm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2308f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([dynamic linker characteristics])
2309f3b0ac34SDag-Erling Smørgravm4_if([$1],
2310f3b0ac34SDag-Erling Smørgrav	[], [
2311f3b0ac34SDag-Erling Smørgravif test yes = "$GCC"; then
2312f3b0ac34SDag-Erling Smørgrav  case $host_os in
2313f3b0ac34SDag-Erling Smørgrav    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2314f3b0ac34SDag-Erling Smørgrav    *) lt_awk_arg='/^libraries:/' ;;
2315f3b0ac34SDag-Erling Smørgrav  esac
2316f3b0ac34SDag-Erling Smørgrav  case $host_os in
2317f3b0ac34SDag-Erling Smørgrav    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2318f3b0ac34SDag-Erling Smørgrav    *) lt_sed_strip_eq='s|=/|/|g' ;;
2319f3b0ac34SDag-Erling Smørgrav  esac
2320f3b0ac34SDag-Erling Smørgrav  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2321f3b0ac34SDag-Erling Smørgrav  case $lt_search_path_spec in
2322f3b0ac34SDag-Erling Smørgrav  *\;*)
2323f3b0ac34SDag-Erling Smørgrav    # if the path contains ";" then we assume it to be the separator
2324f3b0ac34SDag-Erling Smørgrav    # otherwise default to the standard path separator (i.e. ":") - it is
2325f3b0ac34SDag-Erling Smørgrav    # assumed that no part of a normal pathname contains ";" but that should
2326f3b0ac34SDag-Erling Smørgrav    # okay in the real world where ";" in dirpaths is itself problematic.
2327f3b0ac34SDag-Erling Smørgrav    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2328f3b0ac34SDag-Erling Smørgrav    ;;
2329f3b0ac34SDag-Erling Smørgrav  *)
2330f3b0ac34SDag-Erling Smørgrav    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2331f3b0ac34SDag-Erling Smørgrav    ;;
2332f3b0ac34SDag-Erling Smørgrav  esac
2333f3b0ac34SDag-Erling Smørgrav  # Ok, now we have the path, separated by spaces, we can step through it
2334f3b0ac34SDag-Erling Smørgrav  # and add multilib dir if necessary...
2335f3b0ac34SDag-Erling Smørgrav  lt_tmp_lt_search_path_spec=
2336f3b0ac34SDag-Erling Smørgrav  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2337f3b0ac34SDag-Erling Smørgrav  # ...but if some path component already ends with the multilib dir we assume
2338f3b0ac34SDag-Erling Smørgrav  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2339f3b0ac34SDag-Erling Smørgrav  case "$lt_multi_os_dir; $lt_search_path_spec " in
2340f3b0ac34SDag-Erling Smørgrav  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2341f3b0ac34SDag-Erling Smørgrav    lt_multi_os_dir=
2342f3b0ac34SDag-Erling Smørgrav    ;;
2343f3b0ac34SDag-Erling Smørgrav  esac
2344f3b0ac34SDag-Erling Smørgrav  for lt_sys_path in $lt_search_path_spec; do
2345f3b0ac34SDag-Erling Smørgrav    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2346f3b0ac34SDag-Erling Smørgrav      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2347f3b0ac34SDag-Erling Smørgrav    elif test -n "$lt_multi_os_dir"; then
2348f3b0ac34SDag-Erling Smørgrav      test -d "$lt_sys_path" && \
2349f3b0ac34SDag-Erling Smørgrav	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2350f3b0ac34SDag-Erling Smørgrav    fi
2351f3b0ac34SDag-Erling Smørgrav  done
2352f3b0ac34SDag-Erling Smørgrav  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2353f3b0ac34SDag-Erling SmørgravBEGIN {RS = " "; FS = "/|\n";} {
2354f3b0ac34SDag-Erling Smørgrav  lt_foo = "";
2355f3b0ac34SDag-Erling Smørgrav  lt_count = 0;
2356f3b0ac34SDag-Erling Smørgrav  for (lt_i = NF; lt_i > 0; lt_i--) {
2357f3b0ac34SDag-Erling Smørgrav    if ($lt_i != "" && $lt_i != ".") {
2358f3b0ac34SDag-Erling Smørgrav      if ($lt_i == "..") {
2359f3b0ac34SDag-Erling Smørgrav        lt_count++;
2360f3b0ac34SDag-Erling Smørgrav      } else {
2361f3b0ac34SDag-Erling Smørgrav        if (lt_count == 0) {
2362f3b0ac34SDag-Erling Smørgrav          lt_foo = "/" $lt_i lt_foo;
2363f3b0ac34SDag-Erling Smørgrav        } else {
2364f3b0ac34SDag-Erling Smørgrav          lt_count--;
2365f3b0ac34SDag-Erling Smørgrav        }
2366f3b0ac34SDag-Erling Smørgrav      }
2367f3b0ac34SDag-Erling Smørgrav    }
2368f3b0ac34SDag-Erling Smørgrav  }
2369f3b0ac34SDag-Erling Smørgrav  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2370f3b0ac34SDag-Erling Smørgrav  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2371f3b0ac34SDag-Erling Smørgrav}'`
2372f3b0ac34SDag-Erling Smørgrav  # AWK program above erroneously prepends '/' to C:/dos/paths
2373f3b0ac34SDag-Erling Smørgrav  # for these hosts.
2374f3b0ac34SDag-Erling Smørgrav  case $host_os in
2375f3b0ac34SDag-Erling Smørgrav    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2376f3b0ac34SDag-Erling Smørgrav      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2377f3b0ac34SDag-Erling Smørgrav  esac
2378f3b0ac34SDag-Erling Smørgrav  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2379f3b0ac34SDag-Erling Smørgravelse
2380f3b0ac34SDag-Erling Smørgrav  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2381f3b0ac34SDag-Erling Smørgravfi])
2382f3b0ac34SDag-Erling Smørgravlibrary_names_spec=
2383f3b0ac34SDag-Erling Smørgravlibname_spec='lib$name'
2384f3b0ac34SDag-Erling Smørgravsoname_spec=
2385f3b0ac34SDag-Erling Smørgravshrext_cmds=.so
2386f3b0ac34SDag-Erling Smørgravpostinstall_cmds=
2387f3b0ac34SDag-Erling Smørgravpostuninstall_cmds=
2388f3b0ac34SDag-Erling Smørgravfinish_cmds=
2389f3b0ac34SDag-Erling Smørgravfinish_eval=
2390f3b0ac34SDag-Erling Smørgravshlibpath_var=
2391f3b0ac34SDag-Erling Smørgravshlibpath_overrides_runpath=unknown
2392f3b0ac34SDag-Erling Smørgravversion_type=none
2393f3b0ac34SDag-Erling Smørgravdynamic_linker="$host_os ld.so"
2394f3b0ac34SDag-Erling Smørgravsys_lib_dlsearch_path_spec="/lib /usr/lib"
2395f3b0ac34SDag-Erling Smørgravneed_lib_prefix=unknown
2396f3b0ac34SDag-Erling Smørgravhardcode_into_libs=no
2397f3b0ac34SDag-Erling Smørgrav
2398f3b0ac34SDag-Erling Smørgrav# when you set need_version to no, make sure it does not cause -set_version
2399f3b0ac34SDag-Erling Smørgrav# flags to be left without arguments
2400f3b0ac34SDag-Erling Smørgravneed_version=unknown
2401f3b0ac34SDag-Erling Smørgrav
2402f3b0ac34SDag-Erling SmørgravAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2403f3b0ac34SDag-Erling Smørgrav[User-defined run-time library search path.])
2404f3b0ac34SDag-Erling Smørgrav
2405f3b0ac34SDag-Erling Smørgravcase $host_os in
2406f3b0ac34SDag-Erling Smørgravaix3*)
2407f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
2408f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2409f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LIBPATH
2410f3b0ac34SDag-Erling Smørgrav
2411f3b0ac34SDag-Erling Smørgrav  # AIX 3 has no versioning support, so we append a major version to the name.
2412f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2413f3b0ac34SDag-Erling Smørgrav  ;;
2414f3b0ac34SDag-Erling Smørgrav
2415f3b0ac34SDag-Erling Smørgravaix[[4-9]]*)
2416f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
2417f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2418f3b0ac34SDag-Erling Smørgrav  need_version=no
2419f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
2420f3b0ac34SDag-Erling Smørgrav  if test ia64 = "$host_cpu"; then
2421f3b0ac34SDag-Erling Smørgrav    # AIX 5 supports IA64
2422f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2423f3b0ac34SDag-Erling Smørgrav    shlibpath_var=LD_LIBRARY_PATH
2424f3b0ac34SDag-Erling Smørgrav  else
2425f3b0ac34SDag-Erling Smørgrav    # With GCC up to 2.95.x, collect2 would create an import file
2426f3b0ac34SDag-Erling Smørgrav    # for dependence libraries.  The import file would start with
2427f3b0ac34SDag-Erling Smørgrav    # the line '#! .'.  This would cause the generated library to
2428f3b0ac34SDag-Erling Smørgrav    # depend on '.', always an invalid library.  This was fixed in
2429f3b0ac34SDag-Erling Smørgrav    # development snapshots of GCC prior to 3.0.
2430f3b0ac34SDag-Erling Smørgrav    case $host_os in
2431f3b0ac34SDag-Erling Smørgrav      aix4 | aix4.[[01]] | aix4.[[01]].*)
2432f3b0ac34SDag-Erling Smørgrav      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2433f3b0ac34SDag-Erling Smørgrav	   echo ' yes '
2434f3b0ac34SDag-Erling Smørgrav	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2435f3b0ac34SDag-Erling Smørgrav	:
2436f3b0ac34SDag-Erling Smørgrav      else
2437f3b0ac34SDag-Erling Smørgrav	can_build_shared=no
2438f3b0ac34SDag-Erling Smørgrav      fi
2439f3b0ac34SDag-Erling Smørgrav      ;;
2440f3b0ac34SDag-Erling Smørgrav    esac
2441f3b0ac34SDag-Erling Smørgrav    # Using Import Files as archive members, it is possible to support
2442f3b0ac34SDag-Erling Smørgrav    # filename-based versioning of shared library archives on AIX. While
2443f3b0ac34SDag-Erling Smørgrav    # this would work for both with and without runtime linking, it will
2444f3b0ac34SDag-Erling Smørgrav    # prevent static linking of such archives. So we do filename-based
2445f3b0ac34SDag-Erling Smørgrav    # shared library versioning with .so extension only, which is used
2446f3b0ac34SDag-Erling Smørgrav    # when both runtime linking and shared linking is enabled.
2447f3b0ac34SDag-Erling Smørgrav    # Unfortunately, runtime linking may impact performance, so we do
2448f3b0ac34SDag-Erling Smørgrav    # not want this to be the default eventually. Also, we use the
2449f3b0ac34SDag-Erling Smørgrav    # versioned .so libs for executables only if there is the -brtl
2450f3b0ac34SDag-Erling Smørgrav    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2451f3b0ac34SDag-Erling Smørgrav    # To allow for filename-based versioning support, we need to create
2452f3b0ac34SDag-Erling Smørgrav    # libNAME.so.V as an archive file, containing:
2453f3b0ac34SDag-Erling Smørgrav    # *) an Import File, referring to the versioned filename of the
2454f3b0ac34SDag-Erling Smørgrav    #    archive as well as the shared archive member, telling the
2455f3b0ac34SDag-Erling Smørgrav    #    bitwidth (32 or 64) of that shared object, and providing the
2456f3b0ac34SDag-Erling Smørgrav    #    list of exported symbols of that shared object, eventually
2457f3b0ac34SDag-Erling Smørgrav    #    decorated with the 'weak' keyword
2458f3b0ac34SDag-Erling Smørgrav    # *) the shared object with the F_LOADONLY flag set, to really avoid
2459f3b0ac34SDag-Erling Smørgrav    #    it being seen by the linker.
2460f3b0ac34SDag-Erling Smørgrav    # At run time we better use the real file rather than another symlink,
2461f3b0ac34SDag-Erling Smørgrav    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2462f3b0ac34SDag-Erling Smørgrav
2463f3b0ac34SDag-Erling Smørgrav    case $with_aix_soname,$aix_use_runtimelinking in
2464f3b0ac34SDag-Erling Smørgrav    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2465f3b0ac34SDag-Erling Smørgrav    # soname into executable. Probably we can add versioning support to
2466f3b0ac34SDag-Erling Smørgrav    # collect2, so additional links can be useful in future.
2467f3b0ac34SDag-Erling Smørgrav    aix,yes) # traditional libtool
2468f3b0ac34SDag-Erling Smørgrav      dynamic_linker='AIX unversionable lib.so'
2469f3b0ac34SDag-Erling Smørgrav      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2470f3b0ac34SDag-Erling Smørgrav      # instead of lib<name>.a to let people know that these are not
2471f3b0ac34SDag-Erling Smørgrav      # typical AIX shared libraries.
2472f3b0ac34SDag-Erling Smørgrav      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2473f3b0ac34SDag-Erling Smørgrav      ;;
2474f3b0ac34SDag-Erling Smørgrav    aix,no) # traditional AIX only
2475f3b0ac34SDag-Erling Smørgrav      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2476f3b0ac34SDag-Erling Smørgrav      # We preserve .a as extension for shared libraries through AIX4.2
2477f3b0ac34SDag-Erling Smørgrav      # and later when we are not doing run time linking.
2478f3b0ac34SDag-Erling Smørgrav      library_names_spec='$libname$release.a $libname.a'
2479f3b0ac34SDag-Erling Smørgrav      soname_spec='$libname$release$shared_ext$major'
2480f3b0ac34SDag-Erling Smørgrav      ;;
2481f3b0ac34SDag-Erling Smørgrav    svr4,*) # full svr4 only
2482f3b0ac34SDag-Erling Smørgrav      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2483f3b0ac34SDag-Erling Smørgrav      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2484f3b0ac34SDag-Erling Smørgrav      # We do not specify a path in Import Files, so LIBPATH fires.
2485f3b0ac34SDag-Erling Smørgrav      shlibpath_overrides_runpath=yes
2486f3b0ac34SDag-Erling Smørgrav      ;;
2487f3b0ac34SDag-Erling Smørgrav    *,yes) # both, prefer svr4
2488f3b0ac34SDag-Erling Smørgrav      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2489f3b0ac34SDag-Erling Smørgrav      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2490f3b0ac34SDag-Erling Smørgrav      # unpreferred sharedlib libNAME.a needs extra handling
2491f3b0ac34SDag-Erling Smørgrav      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2492f3b0ac34SDag-Erling Smørgrav      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2493f3b0ac34SDag-Erling Smørgrav      # We do not specify a path in Import Files, so LIBPATH fires.
2494f3b0ac34SDag-Erling Smørgrav      shlibpath_overrides_runpath=yes
2495f3b0ac34SDag-Erling Smørgrav      ;;
2496f3b0ac34SDag-Erling Smørgrav    *,no) # both, prefer aix
2497f3b0ac34SDag-Erling Smørgrav      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2498f3b0ac34SDag-Erling Smørgrav      library_names_spec='$libname$release.a $libname.a'
2499f3b0ac34SDag-Erling Smørgrav      soname_spec='$libname$release$shared_ext$major'
2500f3b0ac34SDag-Erling Smørgrav      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2501f3b0ac34SDag-Erling Smørgrav      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2502f3b0ac34SDag-Erling Smørgrav      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2503f3b0ac34SDag-Erling Smørgrav      ;;
2504f3b0ac34SDag-Erling Smørgrav    esac
2505f3b0ac34SDag-Erling Smørgrav    shlibpath_var=LIBPATH
2506f3b0ac34SDag-Erling Smørgrav  fi
2507f3b0ac34SDag-Erling Smørgrav  ;;
2508f3b0ac34SDag-Erling Smørgrav
2509f3b0ac34SDag-Erling Smørgravamigaos*)
2510f3b0ac34SDag-Erling Smørgrav  case $host_cpu in
2511f3b0ac34SDag-Erling Smørgrav  powerpc)
2512f3b0ac34SDag-Erling Smørgrav    # Since July 2007 AmigaOS4 officially supports .so libraries.
2513f3b0ac34SDag-Erling Smørgrav    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2514f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2515f3b0ac34SDag-Erling Smørgrav    ;;
2516f3b0ac34SDag-Erling Smørgrav  m68k)
2517f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname.ixlibrary $libname.a'
2518f3b0ac34SDag-Erling Smørgrav    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2519f3b0ac34SDag-Erling Smørgrav    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2520f3b0ac34SDag-Erling Smørgrav    ;;
2521f3b0ac34SDag-Erling Smørgrav  esac
2522f3b0ac34SDag-Erling Smørgrav  ;;
2523f3b0ac34SDag-Erling Smørgrav
2524f3b0ac34SDag-Erling Smørgravbeos*)
2525f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$shared_ext'
2526f3b0ac34SDag-Erling Smørgrav  dynamic_linker="$host_os ld.so"
2527f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LIBRARY_PATH
2528f3b0ac34SDag-Erling Smørgrav  ;;
2529f3b0ac34SDag-Erling Smørgrav
2530f3b0ac34SDag-Erling Smørgravbsdi[[45]]*)
2531f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
2532f3b0ac34SDag-Erling Smørgrav  need_version=no
2533f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2534f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2535f3b0ac34SDag-Erling Smørgrav  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2536f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2537f3b0ac34SDag-Erling Smørgrav  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2538f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2539f3b0ac34SDag-Erling Smørgrav  # the default ld.so.conf also contains /usr/contrib/lib and
2540f3b0ac34SDag-Erling Smørgrav  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2541f3b0ac34SDag-Erling Smørgrav  # libtool to hard-code these into programs
2542f3b0ac34SDag-Erling Smørgrav  ;;
2543f3b0ac34SDag-Erling Smørgrav
2544f3b0ac34SDag-Erling Smørgravcygwin* | mingw* | pw32* | cegcc*)
2545f3b0ac34SDag-Erling Smørgrav  version_type=windows
2546f3b0ac34SDag-Erling Smørgrav  shrext_cmds=.dll
2547f3b0ac34SDag-Erling Smørgrav  need_version=no
2548f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2549f3b0ac34SDag-Erling Smørgrav
2550f3b0ac34SDag-Erling Smørgrav  case $GCC,$cc_basename in
2551f3b0ac34SDag-Erling Smørgrav  yes,*)
2552f3b0ac34SDag-Erling Smørgrav    # gcc
2553f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname.dll.a'
2554f3b0ac34SDag-Erling Smørgrav    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2555f3b0ac34SDag-Erling Smørgrav    postinstall_cmds='base_file=`basename \$file`~
2556f3b0ac34SDag-Erling Smørgrav      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2557f3b0ac34SDag-Erling Smørgrav      dldir=$destdir/`dirname \$dlpath`~
2558f3b0ac34SDag-Erling Smørgrav      test -d \$dldir || mkdir -p \$dldir~
2559f3b0ac34SDag-Erling Smørgrav      $install_prog $dir/$dlname \$dldir/$dlname~
2560f3b0ac34SDag-Erling Smørgrav      chmod a+x \$dldir/$dlname~
2561f3b0ac34SDag-Erling Smørgrav      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2562f3b0ac34SDag-Erling Smørgrav        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2563f3b0ac34SDag-Erling Smørgrav      fi'
2564f3b0ac34SDag-Erling Smørgrav    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2565f3b0ac34SDag-Erling Smørgrav      dlpath=$dir/\$dldll~
2566f3b0ac34SDag-Erling Smørgrav       $RM \$dlpath'
2567f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=yes
2568f3b0ac34SDag-Erling Smørgrav
2569f3b0ac34SDag-Erling Smørgrav    case $host_os in
2570f3b0ac34SDag-Erling Smørgrav    cygwin*)
2571f3b0ac34SDag-Erling Smørgrav      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2572*3ba4c8c8SDag-Erling Smørgrav      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2573f3b0ac34SDag-Erling Smørgravm4_if([$1], [],[
2574f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2575f3b0ac34SDag-Erling Smørgrav      ;;
2576f3b0ac34SDag-Erling Smørgrav    mingw* | cegcc*)
2577f3b0ac34SDag-Erling Smørgrav      # MinGW DLLs use traditional 'lib' prefix
2578f3b0ac34SDag-Erling Smørgrav      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2579f3b0ac34SDag-Erling Smørgrav      ;;
2580f3b0ac34SDag-Erling Smørgrav    pw32*)
2581f3b0ac34SDag-Erling Smørgrav      # pw32 DLLs use 'pw' prefix rather than 'lib'
2582*3ba4c8c8SDag-Erling Smørgrav      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2583f3b0ac34SDag-Erling Smørgrav      ;;
2584f3b0ac34SDag-Erling Smørgrav    esac
2585f3b0ac34SDag-Erling Smørgrav    dynamic_linker='Win32 ld.exe'
2586f3b0ac34SDag-Erling Smørgrav    ;;
2587f3b0ac34SDag-Erling Smørgrav
2588*3ba4c8c8SDag-Erling Smørgrav  *,cl* | *,icl*)
2589*3ba4c8c8SDag-Erling Smørgrav    # Native MSVC or ICC
2590f3b0ac34SDag-Erling Smørgrav    libname_spec='$name'
2591f3b0ac34SDag-Erling Smørgrav    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2592f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname.dll.lib'
2593f3b0ac34SDag-Erling Smørgrav
2594f3b0ac34SDag-Erling Smørgrav    case $build_os in
2595f3b0ac34SDag-Erling Smørgrav    mingw*)
2596f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec=
2597f3b0ac34SDag-Erling Smørgrav      lt_save_ifs=$IFS
2598f3b0ac34SDag-Erling Smørgrav      IFS=';'
2599f3b0ac34SDag-Erling Smørgrav      for lt_path in $LIB
2600f3b0ac34SDag-Erling Smørgrav      do
2601f3b0ac34SDag-Erling Smørgrav        IFS=$lt_save_ifs
2602f3b0ac34SDag-Erling Smørgrav        # Let DOS variable expansion print the short 8.3 style file name.
2603f3b0ac34SDag-Erling Smørgrav        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2604f3b0ac34SDag-Erling Smørgrav        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2605f3b0ac34SDag-Erling Smørgrav      done
2606f3b0ac34SDag-Erling Smørgrav      IFS=$lt_save_ifs
2607f3b0ac34SDag-Erling Smørgrav      # Convert to MSYS style.
2608*3ba4c8c8SDag-Erling Smørgrav      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2609f3b0ac34SDag-Erling Smørgrav      ;;
2610f3b0ac34SDag-Erling Smørgrav    cygwin*)
2611f3b0ac34SDag-Erling Smørgrav      # Convert to unix form, then to dos form, then back to unix form
2612f3b0ac34SDag-Erling Smørgrav      # but this time dos style (no spaces!) so that the unix form looks
2613f3b0ac34SDag-Erling Smørgrav      # like /cygdrive/c/PROGRA~1:/cygdr...
2614f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2615f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2616f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2617f3b0ac34SDag-Erling Smørgrav      ;;
2618f3b0ac34SDag-Erling Smørgrav    *)
2619f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec=$LIB
2620f3b0ac34SDag-Erling Smørgrav      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2621f3b0ac34SDag-Erling Smørgrav        # It is most probably a Windows format PATH.
2622f3b0ac34SDag-Erling Smørgrav        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2623f3b0ac34SDag-Erling Smørgrav      else
2624f3b0ac34SDag-Erling Smørgrav        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2625f3b0ac34SDag-Erling Smørgrav      fi
2626f3b0ac34SDag-Erling Smørgrav      # FIXME: find the short name or the path components, as spaces are
2627f3b0ac34SDag-Erling Smørgrav      # common. (e.g. "Program Files" -> "PROGRA~1")
2628f3b0ac34SDag-Erling Smørgrav      ;;
2629f3b0ac34SDag-Erling Smørgrav    esac
2630f3b0ac34SDag-Erling Smørgrav
2631f3b0ac34SDag-Erling Smørgrav    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2632f3b0ac34SDag-Erling Smørgrav    postinstall_cmds='base_file=`basename \$file`~
2633f3b0ac34SDag-Erling Smørgrav      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2634f3b0ac34SDag-Erling Smørgrav      dldir=$destdir/`dirname \$dlpath`~
2635f3b0ac34SDag-Erling Smørgrav      test -d \$dldir || mkdir -p \$dldir~
2636f3b0ac34SDag-Erling Smørgrav      $install_prog $dir/$dlname \$dldir/$dlname'
2637f3b0ac34SDag-Erling Smørgrav    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2638f3b0ac34SDag-Erling Smørgrav      dlpath=$dir/\$dldll~
2639f3b0ac34SDag-Erling Smørgrav       $RM \$dlpath'
2640f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=yes
2641f3b0ac34SDag-Erling Smørgrav    dynamic_linker='Win32 link.exe'
2642f3b0ac34SDag-Erling Smørgrav    ;;
2643f3b0ac34SDag-Erling Smørgrav
2644f3b0ac34SDag-Erling Smørgrav  *)
2645*3ba4c8c8SDag-Erling Smørgrav    # Assume MSVC and ICC wrapper
2646f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2647f3b0ac34SDag-Erling Smørgrav    dynamic_linker='Win32 ld.exe'
2648f3b0ac34SDag-Erling Smørgrav    ;;
2649f3b0ac34SDag-Erling Smørgrav  esac
2650f3b0ac34SDag-Erling Smørgrav  # FIXME: first we should search . and the directory the executable is in
2651f3b0ac34SDag-Erling Smørgrav  shlibpath_var=PATH
2652f3b0ac34SDag-Erling Smørgrav  ;;
2653f3b0ac34SDag-Erling Smørgrav
2654f3b0ac34SDag-Erling Smørgravdarwin* | rhapsody*)
2655f3b0ac34SDag-Erling Smørgrav  dynamic_linker="$host_os dyld"
2656f3b0ac34SDag-Erling Smørgrav  version_type=darwin
2657f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2658f3b0ac34SDag-Erling Smørgrav  need_version=no
2659f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2660f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$major$shared_ext'
2661f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=yes
2662f3b0ac34SDag-Erling Smørgrav  shlibpath_var=DYLD_LIBRARY_PATH
2663f3b0ac34SDag-Erling Smørgrav  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2664f3b0ac34SDag-Erling Smørgravm4_if([$1], [],[
2665f3b0ac34SDag-Erling Smørgrav  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2666f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2667f3b0ac34SDag-Erling Smørgrav  ;;
2668f3b0ac34SDag-Erling Smørgrav
2669f3b0ac34SDag-Erling Smørgravdgux*)
2670f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
2671f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2672f3b0ac34SDag-Erling Smørgrav  need_version=no
2673f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2674f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2675f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2676f3b0ac34SDag-Erling Smørgrav  ;;
2677f3b0ac34SDag-Erling Smørgrav
2678*3ba4c8c8SDag-Erling Smørgravfreebsd* | dragonfly* | midnightbsd*)
2679f3b0ac34SDag-Erling Smørgrav  # DragonFly does not have aout.  When/if they implement a new
2680f3b0ac34SDag-Erling Smørgrav  # versioning mechanism, adjust this.
2681f3b0ac34SDag-Erling Smørgrav  if test -x /usr/bin/objformat; then
2682f3b0ac34SDag-Erling Smørgrav    objformat=`/usr/bin/objformat`
2683f3b0ac34SDag-Erling Smørgrav  else
2684f3b0ac34SDag-Erling Smørgrav    case $host_os in
2685f3b0ac34SDag-Erling Smørgrav    freebsd[[23]].*) objformat=aout ;;
2686f3b0ac34SDag-Erling Smørgrav    *) objformat=elf ;;
2687f3b0ac34SDag-Erling Smørgrav    esac
2688f3b0ac34SDag-Erling Smørgrav  fi
2689f3b0ac34SDag-Erling Smørgrav  version_type=freebsd-$objformat
2690f3b0ac34SDag-Erling Smørgrav  case $version_type in
2691f3b0ac34SDag-Erling Smørgrav    freebsd-elf*)
2692f3b0ac34SDag-Erling Smørgrav      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2693f3b0ac34SDag-Erling Smørgrav      soname_spec='$libname$release$shared_ext$major'
2694f3b0ac34SDag-Erling Smørgrav      need_version=no
2695f3b0ac34SDag-Erling Smørgrav      need_lib_prefix=no
2696f3b0ac34SDag-Erling Smørgrav      ;;
2697f3b0ac34SDag-Erling Smørgrav    freebsd-*)
2698f3b0ac34SDag-Erling Smørgrav      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2699f3b0ac34SDag-Erling Smørgrav      need_version=yes
2700f3b0ac34SDag-Erling Smørgrav      ;;
2701f3b0ac34SDag-Erling Smørgrav  esac
2702f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2703f3b0ac34SDag-Erling Smørgrav  case $host_os in
2704f3b0ac34SDag-Erling Smørgrav  freebsd2.*)
2705f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=yes
2706f3b0ac34SDag-Erling Smørgrav    ;;
2707f3b0ac34SDag-Erling Smørgrav  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2708f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=yes
2709f3b0ac34SDag-Erling Smørgrav    hardcode_into_libs=yes
2710f3b0ac34SDag-Erling Smørgrav    ;;
2711f3b0ac34SDag-Erling Smørgrav  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2712f3b0ac34SDag-Erling Smørgrav  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2713f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=no
2714f3b0ac34SDag-Erling Smørgrav    hardcode_into_libs=yes
2715f3b0ac34SDag-Erling Smørgrav    ;;
2716f3b0ac34SDag-Erling Smørgrav  *) # from 4.6 on, and DragonFly
2717f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=yes
2718f3b0ac34SDag-Erling Smørgrav    hardcode_into_libs=yes
2719f3b0ac34SDag-Erling Smørgrav    ;;
2720f3b0ac34SDag-Erling Smørgrav  esac
2721f3b0ac34SDag-Erling Smørgrav  ;;
2722f3b0ac34SDag-Erling Smørgrav
2723f3b0ac34SDag-Erling Smørgravhaiku*)
2724f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
2725f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2726f3b0ac34SDag-Erling Smørgrav  need_version=no
2727f3b0ac34SDag-Erling Smørgrav  dynamic_linker="$host_os runtime_loader"
2728f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2729f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2730f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LIBRARY_PATH
2731f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=no
2732f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2733f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
2734f3b0ac34SDag-Erling Smørgrav  ;;
2735f3b0ac34SDag-Erling Smørgrav
2736f3b0ac34SDag-Erling Smørgravhpux9* | hpux10* | hpux11*)
2737f3b0ac34SDag-Erling Smørgrav  # Give a soname corresponding to the major version so that dld.sl refuses to
2738f3b0ac34SDag-Erling Smørgrav  # link against other versions.
2739f3b0ac34SDag-Erling Smørgrav  version_type=sunos
2740f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2741f3b0ac34SDag-Erling Smørgrav  need_version=no
2742f3b0ac34SDag-Erling Smørgrav  case $host_cpu in
2743f3b0ac34SDag-Erling Smørgrav  ia64*)
2744f3b0ac34SDag-Erling Smørgrav    shrext_cmds='.so'
2745f3b0ac34SDag-Erling Smørgrav    hardcode_into_libs=yes
2746f3b0ac34SDag-Erling Smørgrav    dynamic_linker="$host_os dld.so"
2747f3b0ac34SDag-Erling Smørgrav    shlibpath_var=LD_LIBRARY_PATH
2748f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2749f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2750f3b0ac34SDag-Erling Smørgrav    soname_spec='$libname$release$shared_ext$major'
2751f3b0ac34SDag-Erling Smørgrav    if test 32 = "$HPUX_IA64_MODE"; then
2752f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2753f3b0ac34SDag-Erling Smørgrav      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2754f3b0ac34SDag-Erling Smørgrav    else
2755f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2756f3b0ac34SDag-Erling Smørgrav      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2757f3b0ac34SDag-Erling Smørgrav    fi
2758f3b0ac34SDag-Erling Smørgrav    ;;
2759f3b0ac34SDag-Erling Smørgrav  hppa*64*)
2760f3b0ac34SDag-Erling Smørgrav    shrext_cmds='.sl'
2761f3b0ac34SDag-Erling Smørgrav    hardcode_into_libs=yes
2762f3b0ac34SDag-Erling Smørgrav    dynamic_linker="$host_os dld.sl"
2763f3b0ac34SDag-Erling Smørgrav    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2764f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2765f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2766f3b0ac34SDag-Erling Smørgrav    soname_spec='$libname$release$shared_ext$major'
2767f3b0ac34SDag-Erling Smørgrav    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2768f3b0ac34SDag-Erling Smørgrav    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2769f3b0ac34SDag-Erling Smørgrav    ;;
2770f3b0ac34SDag-Erling Smørgrav  *)
2771f3b0ac34SDag-Erling Smørgrav    shrext_cmds='.sl'
2772f3b0ac34SDag-Erling Smørgrav    dynamic_linker="$host_os dld.sl"
2773f3b0ac34SDag-Erling Smørgrav    shlibpath_var=SHLIB_PATH
2774f3b0ac34SDag-Erling Smørgrav    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2775f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2776f3b0ac34SDag-Erling Smørgrav    soname_spec='$libname$release$shared_ext$major'
2777f3b0ac34SDag-Erling Smørgrav    ;;
2778f3b0ac34SDag-Erling Smørgrav  esac
2779f3b0ac34SDag-Erling Smørgrav  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2780f3b0ac34SDag-Erling Smørgrav  postinstall_cmds='chmod 555 $lib'
2781f3b0ac34SDag-Erling Smørgrav  # or fails outright, so override atomically:
2782f3b0ac34SDag-Erling Smørgrav  install_override_mode=555
2783f3b0ac34SDag-Erling Smørgrav  ;;
2784f3b0ac34SDag-Erling Smørgrav
2785f3b0ac34SDag-Erling Smørgravinterix[[3-9]]*)
2786f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
2787f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2788f3b0ac34SDag-Erling Smørgrav  need_version=no
2789f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2790f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2791f3b0ac34SDag-Erling Smørgrav  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2792f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2793f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=no
2794f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
2795f3b0ac34SDag-Erling Smørgrav  ;;
2796f3b0ac34SDag-Erling Smørgrav
2797f3b0ac34SDag-Erling Smørgravirix5* | irix6* | nonstopux*)
2798f3b0ac34SDag-Erling Smørgrav  case $host_os in
2799f3b0ac34SDag-Erling Smørgrav    nonstopux*) version_type=nonstopux ;;
2800f3b0ac34SDag-Erling Smørgrav    *)
2801f3b0ac34SDag-Erling Smørgrav	if test yes = "$lt_cv_prog_gnu_ld"; then
2802f3b0ac34SDag-Erling Smørgrav		version_type=linux # correct to gnu/linux during the next big refactor
2803f3b0ac34SDag-Erling Smørgrav	else
2804f3b0ac34SDag-Erling Smørgrav		version_type=irix
2805f3b0ac34SDag-Erling Smørgrav	fi ;;
2806f3b0ac34SDag-Erling Smørgrav  esac
2807f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2808f3b0ac34SDag-Erling Smørgrav  need_version=no
2809f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2810f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2811f3b0ac34SDag-Erling Smørgrav  case $host_os in
2812f3b0ac34SDag-Erling Smørgrav  irix5* | nonstopux*)
2813f3b0ac34SDag-Erling Smørgrav    libsuff= shlibsuff=
2814f3b0ac34SDag-Erling Smørgrav    ;;
2815f3b0ac34SDag-Erling Smørgrav  *)
2816f3b0ac34SDag-Erling Smørgrav    case $LD in # libtool.m4 will add one of these switches to LD
2817f3b0ac34SDag-Erling Smørgrav    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2818f3b0ac34SDag-Erling Smørgrav      libsuff= shlibsuff= libmagic=32-bit;;
2819f3b0ac34SDag-Erling Smørgrav    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2820f3b0ac34SDag-Erling Smørgrav      libsuff=32 shlibsuff=N32 libmagic=N32;;
2821f3b0ac34SDag-Erling Smørgrav    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2822f3b0ac34SDag-Erling Smørgrav      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2823f3b0ac34SDag-Erling Smørgrav    *) libsuff= shlibsuff= libmagic=never-match;;
2824f3b0ac34SDag-Erling Smørgrav    esac
2825f3b0ac34SDag-Erling Smørgrav    ;;
2826f3b0ac34SDag-Erling Smørgrav  esac
2827f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2828f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=no
2829f3b0ac34SDag-Erling Smørgrav  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2830f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2831f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
2832f3b0ac34SDag-Erling Smørgrav  ;;
2833f3b0ac34SDag-Erling Smørgrav
2834f3b0ac34SDag-Erling Smørgrav# No shared lib support for Linux oldld, aout, or coff.
2835f3b0ac34SDag-Erling Smørgravlinux*oldld* | linux*aout* | linux*coff*)
2836f3b0ac34SDag-Erling Smørgrav  dynamic_linker=no
2837f3b0ac34SDag-Erling Smørgrav  ;;
2838f3b0ac34SDag-Erling Smørgrav
2839f3b0ac34SDag-Erling Smørgravlinux*android*)
2840f3b0ac34SDag-Erling Smørgrav  version_type=none # Android doesn't support versioned libraries.
2841f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2842f3b0ac34SDag-Erling Smørgrav  need_version=no
2843f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext'
2844f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext'
2845f3b0ac34SDag-Erling Smørgrav  finish_cmds=
2846f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2847f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=yes
2848f3b0ac34SDag-Erling Smørgrav
2849f3b0ac34SDag-Erling Smørgrav  # This implies no fast_install, which is unacceptable.
2850f3b0ac34SDag-Erling Smørgrav  # Some rework will be needed to allow for fast_install
2851f3b0ac34SDag-Erling Smørgrav  # before this can be enabled.
2852f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
2853f3b0ac34SDag-Erling Smørgrav
2854f3b0ac34SDag-Erling Smørgrav  dynamic_linker='Android linker'
2855f3b0ac34SDag-Erling Smørgrav  # Don't embed -rpath directories since the linker doesn't support them.
2856f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2857f3b0ac34SDag-Erling Smørgrav  ;;
2858f3b0ac34SDag-Erling Smørgrav
2859f3b0ac34SDag-Erling Smørgrav# This must be glibc/ELF.
2860f3b0ac34SDag-Erling Smørgravlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2861f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
2862f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2863f3b0ac34SDag-Erling Smørgrav  need_version=no
2864f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2865f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2866f3b0ac34SDag-Erling Smørgrav  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2867f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2868f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=no
2869f3b0ac34SDag-Erling Smørgrav
2870f3b0ac34SDag-Erling Smørgrav  # Some binutils ld are patched to set DT_RUNPATH
2871f3b0ac34SDag-Erling Smørgrav  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2872f3b0ac34SDag-Erling Smørgrav    [lt_cv_shlibpath_overrides_runpath=no
2873f3b0ac34SDag-Erling Smørgrav    save_LDFLAGS=$LDFLAGS
2874f3b0ac34SDag-Erling Smørgrav    save_libdir=$libdir
2875f3b0ac34SDag-Erling Smørgrav    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2876f3b0ac34SDag-Erling Smørgrav	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2877f3b0ac34SDag-Erling Smørgrav    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2878f3b0ac34SDag-Erling Smørgrav      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2879f3b0ac34SDag-Erling Smørgrav	 [lt_cv_shlibpath_overrides_runpath=yes])])
2880f3b0ac34SDag-Erling Smørgrav    LDFLAGS=$save_LDFLAGS
2881f3b0ac34SDag-Erling Smørgrav    libdir=$save_libdir
2882f3b0ac34SDag-Erling Smørgrav    ])
2883f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2884f3b0ac34SDag-Erling Smørgrav
2885f3b0ac34SDag-Erling Smørgrav  # This implies no fast_install, which is unacceptable.
2886f3b0ac34SDag-Erling Smørgrav  # Some rework will be needed to allow for fast_install
2887f3b0ac34SDag-Erling Smørgrav  # before this can be enabled.
2888f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
2889f3b0ac34SDag-Erling Smørgrav
2890f3b0ac34SDag-Erling Smørgrav  # Ideally, we could use ldconfig to report *all* directores which are
2891f3b0ac34SDag-Erling Smørgrav  # searched for libraries, however this is still not possible.  Aside from not
2892f3b0ac34SDag-Erling Smørgrav  # being certain /sbin/ldconfig is available, command
2893f3b0ac34SDag-Erling Smørgrav  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2894f3b0ac34SDag-Erling Smørgrav  # even though it is searched at run-time.  Try to do the best guess by
2895f3b0ac34SDag-Erling Smørgrav  # appending ld.so.conf contents (and includes) to the search path.
2896f3b0ac34SDag-Erling Smørgrav  if test -f /etc/ld.so.conf; then
2897f3b0ac34SDag-Erling Smørgrav    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' ' '`
2898f3b0ac34SDag-Erling Smørgrav    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2899f3b0ac34SDag-Erling Smørgrav  fi
2900f3b0ac34SDag-Erling Smørgrav
2901f3b0ac34SDag-Erling Smørgrav  # We used to test for /lib/ld.so.1 and disable shared libraries on
2902f3b0ac34SDag-Erling Smørgrav  # powerpc, because MkLinux only supported shared libraries with the
2903f3b0ac34SDag-Erling Smørgrav  # GNU dynamic linker.  Since this was broken with cross compilers,
2904f3b0ac34SDag-Erling Smørgrav  # most powerpc-linux boxes support dynamic linking these days and
2905f3b0ac34SDag-Erling Smørgrav  # people can always --disable-shared, the test was removed, and we
2906f3b0ac34SDag-Erling Smørgrav  # assume the GNU/Linux dynamic linker is in use.
2907f3b0ac34SDag-Erling Smørgrav  dynamic_linker='GNU/Linux ld.so'
2908f3b0ac34SDag-Erling Smørgrav  ;;
2909f3b0ac34SDag-Erling Smørgrav
2910f3b0ac34SDag-Erling Smørgravnetbsd*)
2911f3b0ac34SDag-Erling Smørgrav  version_type=sunos
2912f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2913f3b0ac34SDag-Erling Smørgrav  need_version=no
2914f3b0ac34SDag-Erling Smørgrav  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2915f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2916f3b0ac34SDag-Erling Smørgrav    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2917f3b0ac34SDag-Erling Smørgrav    dynamic_linker='NetBSD (a.out) ld.so'
2918f3b0ac34SDag-Erling Smørgrav  else
2919f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2920f3b0ac34SDag-Erling Smørgrav    soname_spec='$libname$release$shared_ext$major'
2921f3b0ac34SDag-Erling Smørgrav    dynamic_linker='NetBSD ld.elf_so'
2922f3b0ac34SDag-Erling Smørgrav  fi
2923f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2924f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=yes
2925f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
2926f3b0ac34SDag-Erling Smørgrav  ;;
2927f3b0ac34SDag-Erling Smørgrav
2928f3b0ac34SDag-Erling Smørgravnewsos6)
2929f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
2930f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2931f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2932f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=yes
2933f3b0ac34SDag-Erling Smørgrav  ;;
2934f3b0ac34SDag-Erling Smørgrav
2935f3b0ac34SDag-Erling Smørgrav*nto* | *qnx*)
2936f3b0ac34SDag-Erling Smørgrav  version_type=qnx
2937f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2938f3b0ac34SDag-Erling Smørgrav  need_version=no
2939f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2940f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2941f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2942f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=no
2943f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
2944f3b0ac34SDag-Erling Smørgrav  dynamic_linker='ldqnx.so'
2945f3b0ac34SDag-Erling Smørgrav  ;;
2946f3b0ac34SDag-Erling Smørgrav
2947f3b0ac34SDag-Erling Smørgravopenbsd* | bitrig*)
2948f3b0ac34SDag-Erling Smørgrav  version_type=sunos
2949f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec=/usr/lib
2950f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2951f3b0ac34SDag-Erling Smørgrav  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2952f3b0ac34SDag-Erling Smørgrav    need_version=no
2953f3b0ac34SDag-Erling Smørgrav  else
2954f3b0ac34SDag-Erling Smørgrav    need_version=yes
2955f3b0ac34SDag-Erling Smørgrav  fi
2956f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2957f3b0ac34SDag-Erling Smørgrav  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2958f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2959f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=yes
2960f3b0ac34SDag-Erling Smørgrav  ;;
2961f3b0ac34SDag-Erling Smørgrav
2962f3b0ac34SDag-Erling Smørgravos2*)
2963f3b0ac34SDag-Erling Smørgrav  libname_spec='$name'
2964f3b0ac34SDag-Erling Smørgrav  version_type=windows
2965f3b0ac34SDag-Erling Smørgrav  shrext_cmds=.dll
2966f3b0ac34SDag-Erling Smørgrav  need_version=no
2967f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2968f3b0ac34SDag-Erling Smørgrav  # OS/2 can only load a DLL with a base name of 8 characters or less.
2969f3b0ac34SDag-Erling Smørgrav  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2970f3b0ac34SDag-Erling Smørgrav    v=$($ECHO $release$versuffix | tr -d .-);
2971f3b0ac34SDag-Erling Smørgrav    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2972f3b0ac34SDag-Erling Smørgrav    $ECHO $n$v`$shared_ext'
2973f3b0ac34SDag-Erling Smørgrav  library_names_spec='${libname}_dll.$libext'
2974f3b0ac34SDag-Erling Smørgrav  dynamic_linker='OS/2 ld.exe'
2975f3b0ac34SDag-Erling Smørgrav  shlibpath_var=BEGINLIBPATH
2976f3b0ac34SDag-Erling Smørgrav  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2977f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2978f3b0ac34SDag-Erling Smørgrav  postinstall_cmds='base_file=`basename \$file`~
2979f3b0ac34SDag-Erling Smørgrav    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2980f3b0ac34SDag-Erling Smørgrav    dldir=$destdir/`dirname \$dlpath`~
2981f3b0ac34SDag-Erling Smørgrav    test -d \$dldir || mkdir -p \$dldir~
2982f3b0ac34SDag-Erling Smørgrav    $install_prog $dir/$dlname \$dldir/$dlname~
2983f3b0ac34SDag-Erling Smørgrav    chmod a+x \$dldir/$dlname~
2984f3b0ac34SDag-Erling Smørgrav    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2985f3b0ac34SDag-Erling Smørgrav      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2986f3b0ac34SDag-Erling Smørgrav    fi'
2987f3b0ac34SDag-Erling Smørgrav  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2988f3b0ac34SDag-Erling Smørgrav    dlpath=$dir/\$dldll~
2989f3b0ac34SDag-Erling Smørgrav    $RM \$dlpath'
2990f3b0ac34SDag-Erling Smørgrav  ;;
2991f3b0ac34SDag-Erling Smørgrav
2992f3b0ac34SDag-Erling Smørgravosf3* | osf4* | osf5*)
2993f3b0ac34SDag-Erling Smørgrav  version_type=osf
2994f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
2995f3b0ac34SDag-Erling Smørgrav  need_version=no
2996f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
2997f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2998f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
2999f3b0ac34SDag-Erling Smørgrav  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3000f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3001f3b0ac34SDag-Erling Smørgrav  ;;
3002f3b0ac34SDag-Erling Smørgrav
3003f3b0ac34SDag-Erling Smørgravrdos*)
3004f3b0ac34SDag-Erling Smørgrav  dynamic_linker=no
3005f3b0ac34SDag-Erling Smørgrav  ;;
3006f3b0ac34SDag-Erling Smørgrav
3007f3b0ac34SDag-Erling Smørgravsolaris*)
3008f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
3009f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
3010f3b0ac34SDag-Erling Smørgrav  need_version=no
3011f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3012f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
3013f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
3014f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=yes
3015f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
3016f3b0ac34SDag-Erling Smørgrav  # ldd complains unless libraries are executable
3017f3b0ac34SDag-Erling Smørgrav  postinstall_cmds='chmod +x $lib'
3018f3b0ac34SDag-Erling Smørgrav  ;;
3019f3b0ac34SDag-Erling Smørgrav
3020f3b0ac34SDag-Erling Smørgravsunos4*)
3021f3b0ac34SDag-Erling Smørgrav  version_type=sunos
3022f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3023f3b0ac34SDag-Erling Smørgrav  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3024f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
3025f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=yes
3026f3b0ac34SDag-Erling Smørgrav  if test yes = "$with_gnu_ld"; then
3027f3b0ac34SDag-Erling Smørgrav    need_lib_prefix=no
3028f3b0ac34SDag-Erling Smørgrav  fi
3029f3b0ac34SDag-Erling Smørgrav  need_version=yes
3030f3b0ac34SDag-Erling Smørgrav  ;;
3031f3b0ac34SDag-Erling Smørgrav
3032f3b0ac34SDag-Erling Smørgravsysv4 | sysv4.3*)
3033f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
3034f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3035f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
3036f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
3037f3b0ac34SDag-Erling Smørgrav  case $host_vendor in
3038f3b0ac34SDag-Erling Smørgrav    sni)
3039f3b0ac34SDag-Erling Smørgrav      shlibpath_overrides_runpath=no
3040f3b0ac34SDag-Erling Smørgrav      need_lib_prefix=no
3041f3b0ac34SDag-Erling Smørgrav      runpath_var=LD_RUN_PATH
3042f3b0ac34SDag-Erling Smørgrav      ;;
3043f3b0ac34SDag-Erling Smørgrav    siemens)
3044f3b0ac34SDag-Erling Smørgrav      need_lib_prefix=no
3045f3b0ac34SDag-Erling Smørgrav      ;;
3046f3b0ac34SDag-Erling Smørgrav    motorola)
3047f3b0ac34SDag-Erling Smørgrav      need_lib_prefix=no
3048f3b0ac34SDag-Erling Smørgrav      need_version=no
3049f3b0ac34SDag-Erling Smørgrav      shlibpath_overrides_runpath=no
3050f3b0ac34SDag-Erling Smørgrav      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3051f3b0ac34SDag-Erling Smørgrav      ;;
3052f3b0ac34SDag-Erling Smørgrav  esac
3053f3b0ac34SDag-Erling Smørgrav  ;;
3054f3b0ac34SDag-Erling Smørgrav
3055f3b0ac34SDag-Erling Smørgravsysv4*MP*)
3056f3b0ac34SDag-Erling Smørgrav  if test -d /usr/nec; then
3057f3b0ac34SDag-Erling Smørgrav    version_type=linux # correct to gnu/linux during the next big refactor
3058f3b0ac34SDag-Erling Smørgrav    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3059f3b0ac34SDag-Erling Smørgrav    soname_spec='$libname$shared_ext.$major'
3060f3b0ac34SDag-Erling Smørgrav    shlibpath_var=LD_LIBRARY_PATH
3061f3b0ac34SDag-Erling Smørgrav  fi
3062f3b0ac34SDag-Erling Smørgrav  ;;
3063f3b0ac34SDag-Erling Smørgrav
3064f3b0ac34SDag-Erling Smørgravsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3065f3b0ac34SDag-Erling Smørgrav  version_type=sco
3066f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
3067f3b0ac34SDag-Erling Smørgrav  need_version=no
3068f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3069f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
3070f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
3071f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=yes
3072f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
3073f3b0ac34SDag-Erling Smørgrav  if test yes = "$with_gnu_ld"; then
3074f3b0ac34SDag-Erling Smørgrav    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3075f3b0ac34SDag-Erling Smørgrav  else
3076f3b0ac34SDag-Erling Smørgrav    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3077f3b0ac34SDag-Erling Smørgrav    case $host_os in
3078f3b0ac34SDag-Erling Smørgrav      sco3.2v5*)
3079f3b0ac34SDag-Erling Smørgrav        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3080f3b0ac34SDag-Erling Smørgrav	;;
3081f3b0ac34SDag-Erling Smørgrav    esac
3082f3b0ac34SDag-Erling Smørgrav  fi
3083f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec='/usr/lib'
3084f3b0ac34SDag-Erling Smørgrav  ;;
3085f3b0ac34SDag-Erling Smørgrav
3086f3b0ac34SDag-Erling Smørgravtpf*)
3087f3b0ac34SDag-Erling Smørgrav  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3088f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
3089f3b0ac34SDag-Erling Smørgrav  need_lib_prefix=no
3090f3b0ac34SDag-Erling Smørgrav  need_version=no
3091f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3092f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
3093f3b0ac34SDag-Erling Smørgrav  shlibpath_overrides_runpath=no
3094f3b0ac34SDag-Erling Smørgrav  hardcode_into_libs=yes
3095f3b0ac34SDag-Erling Smørgrav  ;;
3096f3b0ac34SDag-Erling Smørgrav
3097f3b0ac34SDag-Erling Smørgravuts4*)
3098f3b0ac34SDag-Erling Smørgrav  version_type=linux # correct to gnu/linux during the next big refactor
3099f3b0ac34SDag-Erling Smørgrav  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3100f3b0ac34SDag-Erling Smørgrav  soname_spec='$libname$release$shared_ext$major'
3101f3b0ac34SDag-Erling Smørgrav  shlibpath_var=LD_LIBRARY_PATH
3102f3b0ac34SDag-Erling Smørgrav  ;;
3103f3b0ac34SDag-Erling Smørgrav
3104f3b0ac34SDag-Erling Smørgrav*)
3105f3b0ac34SDag-Erling Smørgrav  dynamic_linker=no
3106f3b0ac34SDag-Erling Smørgrav  ;;
3107f3b0ac34SDag-Erling Smørgravesac
3108f3b0ac34SDag-Erling SmørgravAC_MSG_RESULT([$dynamic_linker])
3109f3b0ac34SDag-Erling Smørgravtest no = "$dynamic_linker" && can_build_shared=no
3110f3b0ac34SDag-Erling Smørgrav
3111f3b0ac34SDag-Erling Smørgravvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3112f3b0ac34SDag-Erling Smørgravif test yes = "$GCC"; then
3113f3b0ac34SDag-Erling Smørgrav  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3114f3b0ac34SDag-Erling Smørgravfi
3115f3b0ac34SDag-Erling Smørgrav
3116f3b0ac34SDag-Erling Smørgravif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3117f3b0ac34SDag-Erling Smørgrav  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3118f3b0ac34SDag-Erling Smørgravfi
3119f3b0ac34SDag-Erling Smørgrav
3120f3b0ac34SDag-Erling Smørgravif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3121f3b0ac34SDag-Erling Smørgrav  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3122f3b0ac34SDag-Erling Smørgravfi
3123f3b0ac34SDag-Erling Smørgrav
3124f3b0ac34SDag-Erling Smørgrav# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3125f3b0ac34SDag-Erling Smørgravconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3126f3b0ac34SDag-Erling Smørgrav
3127f3b0ac34SDag-Erling Smørgrav# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3128f3b0ac34SDag-Erling Smørgravfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3129f3b0ac34SDag-Erling Smørgrav
3130f3b0ac34SDag-Erling Smørgrav# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3131f3b0ac34SDag-Erling Smørgravconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3132f3b0ac34SDag-Erling Smørgrav
3133f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [variables_saved_for_relink], [1],
3134f3b0ac34SDag-Erling Smørgrav    [Variables whose values should be saved in libtool wrapper scripts and
3135f3b0ac34SDag-Erling Smørgrav    restored at link time])
3136f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [need_lib_prefix], [0],
3137f3b0ac34SDag-Erling Smørgrav    [Do we need the "lib" prefix for modules?])
3138f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3139f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [version_type], [0], [Library versioning type])
3140f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3141f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3142f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [shlibpath_overrides_runpath], [0],
3143f3b0ac34SDag-Erling Smørgrav    [Is shlibpath searched before the hard-coded library search path?])
3144f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3145f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [library_names_spec], [1],
3146f3b0ac34SDag-Erling Smørgrav    [[List of archive names.  First name is the real one, the rest are links.
3147f3b0ac34SDag-Erling Smørgrav    The last name is the one that the linker finds with -lNAME]])
3148f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [soname_spec], [1],
3149f3b0ac34SDag-Erling Smørgrav    [[The coded name of the library, if different from the real name]])
3150f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [install_override_mode], [1],
3151f3b0ac34SDag-Erling Smørgrav    [Permission mode override for installation of shared libraries])
3152f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [postinstall_cmds], [2],
3153f3b0ac34SDag-Erling Smørgrav    [Command to use after installation of a shared archive])
3154f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [postuninstall_cmds], [2],
3155f3b0ac34SDag-Erling Smørgrav    [Command to use after uninstallation of a shared archive])
3156f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [finish_cmds], [2],
3157f3b0ac34SDag-Erling Smørgrav    [Commands used to finish a libtool library installation in a directory])
3158f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [finish_eval], [1],
3159f3b0ac34SDag-Erling Smørgrav    [[As "finish_cmds", except a single script fragment to be evaled but
3160f3b0ac34SDag-Erling Smørgrav    not shown]])
3161f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [hardcode_into_libs], [0],
3162f3b0ac34SDag-Erling Smørgrav    [Whether we should hardcode library paths into libraries])
3163f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [sys_lib_search_path_spec], [2],
3164f3b0ac34SDag-Erling Smørgrav    [Compile-time system search path for libraries])
3165f3b0ac34SDag-Erling Smørgrav_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3166f3b0ac34SDag-Erling Smørgrav    [Detected run-time system search path for libraries])
3167f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3168f3b0ac34SDag-Erling Smørgrav    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3169f3b0ac34SDag-Erling Smørgrav])# _LT_SYS_DYNAMIC_LINKER
3170f3b0ac34SDag-Erling Smørgrav
3171f3b0ac34SDag-Erling Smørgrav
3172f3b0ac34SDag-Erling Smørgrav# _LT_PATH_TOOL_PREFIX(TOOL)
3173f3b0ac34SDag-Erling Smørgrav# --------------------------
3174f3b0ac34SDag-Erling Smørgrav# find a file program that can recognize shared library
3175f3b0ac34SDag-Erling SmørgravAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3176f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_EGREP])dnl
3177f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([for $1])
3178f3b0ac34SDag-Erling SmørgravAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3179f3b0ac34SDag-Erling Smørgrav[case $MAGIC_CMD in
3180f3b0ac34SDag-Erling Smørgrav[[\\/*] |  ?:[\\/]*])
3181f3b0ac34SDag-Erling Smørgrav  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3182f3b0ac34SDag-Erling Smørgrav  ;;
3183f3b0ac34SDag-Erling Smørgrav*)
3184f3b0ac34SDag-Erling Smørgrav  lt_save_MAGIC_CMD=$MAGIC_CMD
3185f3b0ac34SDag-Erling Smørgrav  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3186f3b0ac34SDag-Erling Smørgravdnl $ac_dummy forces splitting on constant user-supplied paths.
3187f3b0ac34SDag-Erling Smørgravdnl POSIX.2 word splitting is done only on the output of word expansions,
3188f3b0ac34SDag-Erling Smørgravdnl not every word.  This closes a longstanding sh security hole.
3189f3b0ac34SDag-Erling Smørgrav  ac_dummy="m4_if([$2], , $PATH, [$2])"
3190f3b0ac34SDag-Erling Smørgrav  for ac_dir in $ac_dummy; do
3191f3b0ac34SDag-Erling Smørgrav    IFS=$lt_save_ifs
3192f3b0ac34SDag-Erling Smørgrav    test -z "$ac_dir" && ac_dir=.
3193f3b0ac34SDag-Erling Smørgrav    if test -f "$ac_dir/$1"; then
3194f3b0ac34SDag-Erling Smørgrav      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3195f3b0ac34SDag-Erling Smørgrav      if test -n "$file_magic_test_file"; then
3196f3b0ac34SDag-Erling Smørgrav	case $deplibs_check_method in
3197f3b0ac34SDag-Erling Smørgrav	"file_magic "*)
3198f3b0ac34SDag-Erling Smørgrav	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3199f3b0ac34SDag-Erling Smørgrav	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3200f3b0ac34SDag-Erling Smørgrav	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3201f3b0ac34SDag-Erling Smørgrav	    $EGREP "$file_magic_regex" > /dev/null; then
3202f3b0ac34SDag-Erling Smørgrav	    :
3203f3b0ac34SDag-Erling Smørgrav	  else
3204f3b0ac34SDag-Erling Smørgrav	    cat <<_LT_EOF 1>&2
3205f3b0ac34SDag-Erling Smørgrav
3206f3b0ac34SDag-Erling Smørgrav*** Warning: the command libtool uses to detect shared libraries,
3207f3b0ac34SDag-Erling Smørgrav*** $file_magic_cmd, produces output that libtool cannot recognize.
3208f3b0ac34SDag-Erling Smørgrav*** The result is that libtool may fail to recognize shared libraries
3209f3b0ac34SDag-Erling Smørgrav*** as such.  This will affect the creation of libtool libraries that
3210f3b0ac34SDag-Erling Smørgrav*** depend on shared libraries, but programs linked with such libtool
3211f3b0ac34SDag-Erling Smørgrav*** libraries will work regardless of this problem.  Nevertheless, you
3212f3b0ac34SDag-Erling Smørgrav*** may want to report the problem to your system manager and/or to
3213f3b0ac34SDag-Erling Smørgrav*** bug-libtool@gnu.org
3214f3b0ac34SDag-Erling Smørgrav
3215f3b0ac34SDag-Erling Smørgrav_LT_EOF
3216f3b0ac34SDag-Erling Smørgrav	  fi ;;
3217f3b0ac34SDag-Erling Smørgrav	esac
3218f3b0ac34SDag-Erling Smørgrav      fi
3219f3b0ac34SDag-Erling Smørgrav      break
3220f3b0ac34SDag-Erling Smørgrav    fi
3221f3b0ac34SDag-Erling Smørgrav  done
3222f3b0ac34SDag-Erling Smørgrav  IFS=$lt_save_ifs
3223f3b0ac34SDag-Erling Smørgrav  MAGIC_CMD=$lt_save_MAGIC_CMD
3224f3b0ac34SDag-Erling Smørgrav  ;;
3225f3b0ac34SDag-Erling Smørgravesac])
3226f3b0ac34SDag-Erling SmørgravMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3227f3b0ac34SDag-Erling Smørgravif test -n "$MAGIC_CMD"; then
3228f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT($MAGIC_CMD)
3229f3b0ac34SDag-Erling Smørgravelse
3230f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT(no)
3231f3b0ac34SDag-Erling Smørgravfi
3232f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [MAGIC_CMD], [0],
3233f3b0ac34SDag-Erling Smørgrav	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3234f3b0ac34SDag-Erling Smørgrav])# _LT_PATH_TOOL_PREFIX
3235f3b0ac34SDag-Erling Smørgrav
3236f3b0ac34SDag-Erling Smørgrav# Old name:
3237f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3238f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
3239f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3240f3b0ac34SDag-Erling Smørgrav
3241f3b0ac34SDag-Erling Smørgrav
3242f3b0ac34SDag-Erling Smørgrav# _LT_PATH_MAGIC
3243f3b0ac34SDag-Erling Smørgrav# --------------
3244f3b0ac34SDag-Erling Smørgrav# find a file program that can recognize a shared library
3245f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PATH_MAGIC],
3246f3b0ac34SDag-Erling Smørgrav[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3247f3b0ac34SDag-Erling Smørgravif test -z "$lt_cv_path_MAGIC_CMD"; then
3248f3b0ac34SDag-Erling Smørgrav  if test -n "$ac_tool_prefix"; then
3249f3b0ac34SDag-Erling Smørgrav    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3250f3b0ac34SDag-Erling Smørgrav  else
3251f3b0ac34SDag-Erling Smørgrav    MAGIC_CMD=:
3252f3b0ac34SDag-Erling Smørgrav  fi
3253f3b0ac34SDag-Erling Smørgravfi
3254f3b0ac34SDag-Erling Smørgrav])# _LT_PATH_MAGIC
3255f3b0ac34SDag-Erling Smørgrav
3256f3b0ac34SDag-Erling Smørgrav
3257f3b0ac34SDag-Erling Smørgrav# LT_PATH_LD
3258f3b0ac34SDag-Erling Smørgrav# ----------
3259f3b0ac34SDag-Erling Smørgrav# find the pathname to the GNU or non-GNU linker
3260f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_PATH_LD],
3261f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_PROG_CC])dnl
3262f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_CANONICAL_HOST])dnl
3263f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3264f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_SED])dnl
3265f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_EGREP])dnl
3266f3b0ac34SDag-Erling Smørgravm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3267f3b0ac34SDag-Erling Smørgrav
3268f3b0ac34SDag-Erling SmørgravAC_ARG_WITH([gnu-ld],
3269f3b0ac34SDag-Erling Smørgrav    [AS_HELP_STRING([--with-gnu-ld],
3270f3b0ac34SDag-Erling Smørgrav	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3271f3b0ac34SDag-Erling Smørgrav    [test no = "$withval" || with_gnu_ld=yes],
3272f3b0ac34SDag-Erling Smørgrav    [with_gnu_ld=no])dnl
3273f3b0ac34SDag-Erling Smørgrav
3274f3b0ac34SDag-Erling Smørgravac_prog=ld
3275f3b0ac34SDag-Erling Smørgravif test yes = "$GCC"; then
3276f3b0ac34SDag-Erling Smørgrav  # Check if gcc -print-prog-name=ld gives a path.
3277f3b0ac34SDag-Erling Smørgrav  AC_MSG_CHECKING([for ld used by $CC])
3278f3b0ac34SDag-Erling Smørgrav  case $host in
3279f3b0ac34SDag-Erling Smørgrav  *-*-mingw*)
3280f3b0ac34SDag-Erling Smørgrav    # gcc leaves a trailing carriage return, which upsets mingw
3281f3b0ac34SDag-Erling Smørgrav    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3282f3b0ac34SDag-Erling Smørgrav  *)
3283f3b0ac34SDag-Erling Smørgrav    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3284f3b0ac34SDag-Erling Smørgrav  esac
3285f3b0ac34SDag-Erling Smørgrav  case $ac_prog in
3286f3b0ac34SDag-Erling Smørgrav    # Accept absolute paths.
3287f3b0ac34SDag-Erling Smørgrav    [[\\/]]* | ?:[[\\/]]*)
3288f3b0ac34SDag-Erling Smørgrav      re_direlt='/[[^/]][[^/]]*/\.\./'
3289f3b0ac34SDag-Erling Smørgrav      # Canonicalize the pathname of ld
3290f3b0ac34SDag-Erling Smørgrav      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3291f3b0ac34SDag-Erling Smørgrav      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3292f3b0ac34SDag-Erling Smørgrav	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3293f3b0ac34SDag-Erling Smørgrav      done
3294f3b0ac34SDag-Erling Smørgrav      test -z "$LD" && LD=$ac_prog
3295f3b0ac34SDag-Erling Smørgrav      ;;
3296f3b0ac34SDag-Erling Smørgrav  "")
3297f3b0ac34SDag-Erling Smørgrav    # If it fails, then pretend we aren't using GCC.
3298f3b0ac34SDag-Erling Smørgrav    ac_prog=ld
3299f3b0ac34SDag-Erling Smørgrav    ;;
3300f3b0ac34SDag-Erling Smørgrav  *)
3301f3b0ac34SDag-Erling Smørgrav    # If it is relative, then search for the first ld in PATH.
3302f3b0ac34SDag-Erling Smørgrav    with_gnu_ld=unknown
3303f3b0ac34SDag-Erling Smørgrav    ;;
3304f3b0ac34SDag-Erling Smørgrav  esac
3305f3b0ac34SDag-Erling Smørgravelif test yes = "$with_gnu_ld"; then
3306f3b0ac34SDag-Erling Smørgrav  AC_MSG_CHECKING([for GNU ld])
3307f3b0ac34SDag-Erling Smørgravelse
3308f3b0ac34SDag-Erling Smørgrav  AC_MSG_CHECKING([for non-GNU ld])
3309f3b0ac34SDag-Erling Smørgravfi
3310f3b0ac34SDag-Erling SmørgravAC_CACHE_VAL(lt_cv_path_LD,
3311f3b0ac34SDag-Erling Smørgrav[if test -z "$LD"; then
3312f3b0ac34SDag-Erling Smørgrav  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3313f3b0ac34SDag-Erling Smørgrav  for ac_dir in $PATH; do
3314f3b0ac34SDag-Erling Smørgrav    IFS=$lt_save_ifs
3315f3b0ac34SDag-Erling Smørgrav    test -z "$ac_dir" && ac_dir=.
3316f3b0ac34SDag-Erling Smørgrav    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3317f3b0ac34SDag-Erling Smørgrav      lt_cv_path_LD=$ac_dir/$ac_prog
3318f3b0ac34SDag-Erling Smørgrav      # Check to see if the program is GNU ld.  I'd rather use --version,
3319f3b0ac34SDag-Erling Smørgrav      # but apparently some variants of GNU ld only accept -v.
3320f3b0ac34SDag-Erling Smørgrav      # Break only if it was the GNU/non-GNU ld that we prefer.
3321f3b0ac34SDag-Erling Smørgrav      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3322f3b0ac34SDag-Erling Smørgrav      *GNU* | *'with BFD'*)
3323f3b0ac34SDag-Erling Smørgrav	test no != "$with_gnu_ld" && break
3324f3b0ac34SDag-Erling Smørgrav	;;
3325f3b0ac34SDag-Erling Smørgrav      *)
3326f3b0ac34SDag-Erling Smørgrav	test yes != "$with_gnu_ld" && break
3327f3b0ac34SDag-Erling Smørgrav	;;
3328f3b0ac34SDag-Erling Smørgrav      esac
3329f3b0ac34SDag-Erling Smørgrav    fi
3330f3b0ac34SDag-Erling Smørgrav  done
3331f3b0ac34SDag-Erling Smørgrav  IFS=$lt_save_ifs
3332f3b0ac34SDag-Erling Smørgravelse
3333f3b0ac34SDag-Erling Smørgrav  lt_cv_path_LD=$LD # Let the user override the test with a path.
3334f3b0ac34SDag-Erling Smørgravfi])
3335f3b0ac34SDag-Erling SmørgravLD=$lt_cv_path_LD
3336f3b0ac34SDag-Erling Smørgravif test -n "$LD"; then
3337f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT($LD)
3338f3b0ac34SDag-Erling Smørgravelse
3339f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT(no)
3340f3b0ac34SDag-Erling Smørgravfi
3341f3b0ac34SDag-Erling Smørgravtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3342f3b0ac34SDag-Erling Smørgrav_LT_PATH_LD_GNU
3343f3b0ac34SDag-Erling SmørgravAC_SUBST([LD])
3344f3b0ac34SDag-Erling Smørgrav
3345f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3346f3b0ac34SDag-Erling Smørgrav])# LT_PATH_LD
3347f3b0ac34SDag-Erling Smørgrav
3348f3b0ac34SDag-Erling Smørgrav# Old names:
3349f3b0ac34SDag-Erling SmørgravAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3350f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3351f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
3352f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AM_PROG_LD], [])
3353f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_PROG_LD], [])
3354f3b0ac34SDag-Erling Smørgrav
3355f3b0ac34SDag-Erling Smørgrav
3356f3b0ac34SDag-Erling Smørgrav# _LT_PATH_LD_GNU
3357f3b0ac34SDag-Erling Smørgrav#- --------------
3358f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PATH_LD_GNU],
3359f3b0ac34SDag-Erling Smørgrav[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3360f3b0ac34SDag-Erling Smørgrav[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3361f3b0ac34SDag-Erling Smørgravcase `$LD -v 2>&1 </dev/null` in
3362f3b0ac34SDag-Erling Smørgrav*GNU* | *'with BFD'*)
3363f3b0ac34SDag-Erling Smørgrav  lt_cv_prog_gnu_ld=yes
3364f3b0ac34SDag-Erling Smørgrav  ;;
3365f3b0ac34SDag-Erling Smørgrav*)
3366f3b0ac34SDag-Erling Smørgrav  lt_cv_prog_gnu_ld=no
3367f3b0ac34SDag-Erling Smørgrav  ;;
3368f3b0ac34SDag-Erling Smørgravesac])
3369f3b0ac34SDag-Erling Smørgravwith_gnu_ld=$lt_cv_prog_gnu_ld
3370f3b0ac34SDag-Erling Smørgrav])# _LT_PATH_LD_GNU
3371f3b0ac34SDag-Erling Smørgrav
3372f3b0ac34SDag-Erling Smørgrav
3373f3b0ac34SDag-Erling Smørgrav# _LT_CMD_RELOAD
3374f3b0ac34SDag-Erling Smørgrav# --------------
3375f3b0ac34SDag-Erling Smørgrav# find reload flag for linker
3376f3b0ac34SDag-Erling Smørgrav#   -- PORTME Some linkers may need a different reload flag.
3377f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CMD_RELOAD],
3378f3b0ac34SDag-Erling Smørgrav[AC_CACHE_CHECK([for $LD option to reload object files],
3379f3b0ac34SDag-Erling Smørgrav  lt_cv_ld_reload_flag,
3380f3b0ac34SDag-Erling Smørgrav  [lt_cv_ld_reload_flag='-r'])
3381f3b0ac34SDag-Erling Smørgravreload_flag=$lt_cv_ld_reload_flag
3382f3b0ac34SDag-Erling Smørgravcase $reload_flag in
3383f3b0ac34SDag-Erling Smørgrav"" | " "*) ;;
3384f3b0ac34SDag-Erling Smørgrav*) reload_flag=" $reload_flag" ;;
3385f3b0ac34SDag-Erling Smørgravesac
3386f3b0ac34SDag-Erling Smørgravreload_cmds='$LD$reload_flag -o $output$reload_objs'
3387f3b0ac34SDag-Erling Smørgravcase $host_os in
3388f3b0ac34SDag-Erling Smørgrav  cygwin* | mingw* | pw32* | cegcc*)
3389f3b0ac34SDag-Erling Smørgrav    if test yes != "$GCC"; then
3390f3b0ac34SDag-Erling Smørgrav      reload_cmds=false
3391f3b0ac34SDag-Erling Smørgrav    fi
3392f3b0ac34SDag-Erling Smørgrav    ;;
3393f3b0ac34SDag-Erling Smørgrav  darwin*)
3394f3b0ac34SDag-Erling Smørgrav    if test yes = "$GCC"; then
3395f3b0ac34SDag-Erling Smørgrav      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3396f3b0ac34SDag-Erling Smørgrav    else
3397f3b0ac34SDag-Erling Smørgrav      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3398f3b0ac34SDag-Erling Smørgrav    fi
3399f3b0ac34SDag-Erling Smørgrav    ;;
3400f3b0ac34SDag-Erling Smørgravesac
3401f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3402f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [reload_cmds], [2])dnl
3403f3b0ac34SDag-Erling Smørgrav])# _LT_CMD_RELOAD
3404f3b0ac34SDag-Erling Smørgrav
3405f3b0ac34SDag-Erling Smørgrav
3406f3b0ac34SDag-Erling Smørgrav# _LT_PATH_DD
3407f3b0ac34SDag-Erling Smørgrav# -----------
3408f3b0ac34SDag-Erling Smørgrav# find a working dd
3409f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PATH_DD],
3410f3b0ac34SDag-Erling Smørgrav[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3411f3b0ac34SDag-Erling Smørgrav[printf 0123456789abcdef0123456789abcdef >conftest.i
3412f3b0ac34SDag-Erling Smørgravcat conftest.i conftest.i >conftest2.i
3413f3b0ac34SDag-Erling Smørgrav: ${lt_DD:=$DD}
3414f3b0ac34SDag-Erling SmørgravAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3415f3b0ac34SDag-Erling Smørgrav[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3416f3b0ac34SDag-Erling Smørgrav  cmp -s conftest.i conftest.out \
3417f3b0ac34SDag-Erling Smørgrav  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3418f3b0ac34SDag-Erling Smørgravfi])
3419f3b0ac34SDag-Erling Smørgravrm -f conftest.i conftest2.i conftest.out])
3420f3b0ac34SDag-Erling Smørgrav])# _LT_PATH_DD
3421f3b0ac34SDag-Erling Smørgrav
3422f3b0ac34SDag-Erling Smørgrav
3423f3b0ac34SDag-Erling Smørgrav# _LT_CMD_TRUNCATE
3424f3b0ac34SDag-Erling Smørgrav# ----------------
3425f3b0ac34SDag-Erling Smørgrav# find command to truncate a binary pipe
3426f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CMD_TRUNCATE],
3427f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_PATH_DD])
3428f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3429f3b0ac34SDag-Erling Smørgrav[printf 0123456789abcdef0123456789abcdef >conftest.i
3430f3b0ac34SDag-Erling Smørgravcat conftest.i conftest.i >conftest2.i
3431f3b0ac34SDag-Erling Smørgravlt_cv_truncate_bin=
3432f3b0ac34SDag-Erling Smørgravif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3433f3b0ac34SDag-Erling Smørgrav  cmp -s conftest.i conftest.out \
3434f3b0ac34SDag-Erling Smørgrav  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3435f3b0ac34SDag-Erling Smørgravfi
3436f3b0ac34SDag-Erling Smørgravrm -f conftest.i conftest2.i conftest.out
3437f3b0ac34SDag-Erling Smørgravtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3438f3b0ac34SDag-Erling Smørgrav_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3439f3b0ac34SDag-Erling Smørgrav  [Command to truncate a binary pipe])
3440f3b0ac34SDag-Erling Smørgrav])# _LT_CMD_TRUNCATE
3441f3b0ac34SDag-Erling Smørgrav
3442f3b0ac34SDag-Erling Smørgrav
3443f3b0ac34SDag-Erling Smørgrav# _LT_CHECK_MAGIC_METHOD
3444f3b0ac34SDag-Erling Smørgrav# ----------------------
3445f3b0ac34SDag-Erling Smørgrav# how to check for library dependencies
3446f3b0ac34SDag-Erling Smørgrav#  -- PORTME fill in with the dynamic library characteristics
3447f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CHECK_MAGIC_METHOD],
3448f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_EGREP])
3449f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_OBJDUMP])
3450f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([how to recognize dependent libraries],
3451f3b0ac34SDag-Erling Smørgravlt_cv_deplibs_check_method,
3452f3b0ac34SDag-Erling Smørgrav[lt_cv_file_magic_cmd='$MAGIC_CMD'
3453f3b0ac34SDag-Erling Smørgravlt_cv_file_magic_test_file=
3454f3b0ac34SDag-Erling Smørgravlt_cv_deplibs_check_method='unknown'
3455f3b0ac34SDag-Erling Smørgrav# Need to set the preceding variable on all platforms that support
3456f3b0ac34SDag-Erling Smørgrav# interlibrary dependencies.
3457f3b0ac34SDag-Erling Smørgrav# 'none' -- dependencies not supported.
3458f3b0ac34SDag-Erling Smørgrav# 'unknown' -- same as none, but documents that we really don't know.
3459f3b0ac34SDag-Erling Smørgrav# 'pass_all' -- all dependencies passed with no checks.
3460f3b0ac34SDag-Erling Smørgrav# 'test_compile' -- check by making test program.
3461f3b0ac34SDag-Erling Smørgrav# 'file_magic [[regex]]' -- check by looking for files in library path
3462f3b0ac34SDag-Erling Smørgrav# that responds to the $file_magic_cmd with a given extended regex.
3463f3b0ac34SDag-Erling Smørgrav# If you have 'file' or equivalent on your system and you're not sure
3464f3b0ac34SDag-Erling Smørgrav# whether 'pass_all' will *always* work, you probably want this one.
3465f3b0ac34SDag-Erling Smørgrav
3466f3b0ac34SDag-Erling Smørgravcase $host_os in
3467f3b0ac34SDag-Erling Smørgravaix[[4-9]]*)
3468f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3469f3b0ac34SDag-Erling Smørgrav  ;;
3470f3b0ac34SDag-Erling Smørgrav
3471f3b0ac34SDag-Erling Smørgravbeos*)
3472f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3473f3b0ac34SDag-Erling Smørgrav  ;;
3474f3b0ac34SDag-Erling Smørgrav
3475f3b0ac34SDag-Erling Smørgravbsdi[[45]]*)
3476f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3477*3ba4c8c8SDag-Erling Smørgrav  lt_cv_file_magic_cmd='$FILECMD -L'
3478f3b0ac34SDag-Erling Smørgrav  lt_cv_file_magic_test_file=/shlib/libc.so
3479f3b0ac34SDag-Erling Smørgrav  ;;
3480f3b0ac34SDag-Erling Smørgrav
3481f3b0ac34SDag-Erling Smørgravcygwin*)
3482f3b0ac34SDag-Erling Smørgrav  # func_win32_libid is a shell function defined in ltmain.sh
3483f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3484f3b0ac34SDag-Erling Smørgrav  lt_cv_file_magic_cmd='func_win32_libid'
3485f3b0ac34SDag-Erling Smørgrav  ;;
3486f3b0ac34SDag-Erling Smørgrav
3487f3b0ac34SDag-Erling Smørgravmingw* | pw32*)
3488f3b0ac34SDag-Erling Smørgrav  # Base MSYS/MinGW do not provide the 'file' command needed by
3489f3b0ac34SDag-Erling Smørgrav  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3490f3b0ac34SDag-Erling Smørgrav  # unless we find 'file', for example because we are cross-compiling.
3491f3b0ac34SDag-Erling Smørgrav  if ( file / ) >/dev/null 2>&1; then
3492f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3493f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_cmd='func_win32_libid'
3494f3b0ac34SDag-Erling Smørgrav  else
3495f3b0ac34SDag-Erling Smørgrav    # Keep this pattern in sync with the one in func_win32_libid.
3496f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3497f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_cmd='$OBJDUMP -f'
3498f3b0ac34SDag-Erling Smørgrav  fi
3499f3b0ac34SDag-Erling Smørgrav  ;;
3500f3b0ac34SDag-Erling Smørgrav
3501f3b0ac34SDag-Erling Smørgravcegcc*)
3502f3b0ac34SDag-Erling Smørgrav  # use the weaker test based on 'objdump'. See mingw*.
3503f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3504f3b0ac34SDag-Erling Smørgrav  lt_cv_file_magic_cmd='$OBJDUMP -f'
3505f3b0ac34SDag-Erling Smørgrav  ;;
3506f3b0ac34SDag-Erling Smørgrav
3507f3b0ac34SDag-Erling Smørgravdarwin* | rhapsody*)
3508f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3509f3b0ac34SDag-Erling Smørgrav  ;;
3510f3b0ac34SDag-Erling Smørgrav
3511*3ba4c8c8SDag-Erling Smørgravfreebsd* | dragonfly* | midnightbsd*)
3512f3b0ac34SDag-Erling Smørgrav  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3513f3b0ac34SDag-Erling Smørgrav    case $host_cpu in
3514f3b0ac34SDag-Erling Smørgrav    i*86 )
3515f3b0ac34SDag-Erling Smørgrav      # Not sure whether the presence of OpenBSD here was a mistake.
3516f3b0ac34SDag-Erling Smørgrav      # Let's accept both of them until this is cleared up.
3517f3b0ac34SDag-Erling Smørgrav      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3518*3ba4c8c8SDag-Erling Smørgrav      lt_cv_file_magic_cmd=$FILECMD
3519f3b0ac34SDag-Erling Smørgrav      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3520f3b0ac34SDag-Erling Smørgrav      ;;
3521f3b0ac34SDag-Erling Smørgrav    esac
3522f3b0ac34SDag-Erling Smørgrav  else
3523f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method=pass_all
3524f3b0ac34SDag-Erling Smørgrav  fi
3525f3b0ac34SDag-Erling Smørgrav  ;;
3526f3b0ac34SDag-Erling Smørgrav
3527f3b0ac34SDag-Erling Smørgravhaiku*)
3528f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3529f3b0ac34SDag-Erling Smørgrav  ;;
3530f3b0ac34SDag-Erling Smørgrav
3531f3b0ac34SDag-Erling Smørgravhpux10.20* | hpux11*)
3532*3ba4c8c8SDag-Erling Smørgrav  lt_cv_file_magic_cmd=$FILECMD
3533f3b0ac34SDag-Erling Smørgrav  case $host_cpu in
3534f3b0ac34SDag-Erling Smørgrav  ia64*)
3535f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3536f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3537f3b0ac34SDag-Erling Smørgrav    ;;
3538f3b0ac34SDag-Erling Smørgrav  hppa*64*)
3539f3b0ac34SDag-Erling Smørgrav    [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]']
3540f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3541f3b0ac34SDag-Erling Smørgrav    ;;
3542f3b0ac34SDag-Erling Smørgrav  *)
3543f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3544f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3545f3b0ac34SDag-Erling Smørgrav    ;;
3546f3b0ac34SDag-Erling Smørgrav  esac
3547f3b0ac34SDag-Erling Smørgrav  ;;
3548f3b0ac34SDag-Erling Smørgrav
3549f3b0ac34SDag-Erling Smørgravinterix[[3-9]]*)
3550f3b0ac34SDag-Erling Smørgrav  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3551f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3552f3b0ac34SDag-Erling Smørgrav  ;;
3553f3b0ac34SDag-Erling Smørgrav
3554f3b0ac34SDag-Erling Smørgravirix5* | irix6* | nonstopux*)
3555f3b0ac34SDag-Erling Smørgrav  case $LD in
3556f3b0ac34SDag-Erling Smørgrav  *-32|*"-32 ") libmagic=32-bit;;
3557f3b0ac34SDag-Erling Smørgrav  *-n32|*"-n32 ") libmagic=N32;;
3558f3b0ac34SDag-Erling Smørgrav  *-64|*"-64 ") libmagic=64-bit;;
3559f3b0ac34SDag-Erling Smørgrav  *) libmagic=never-match;;
3560f3b0ac34SDag-Erling Smørgrav  esac
3561f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3562f3b0ac34SDag-Erling Smørgrav  ;;
3563f3b0ac34SDag-Erling Smørgrav
3564f3b0ac34SDag-Erling Smørgrav# This must be glibc/ELF.
3565f3b0ac34SDag-Erling Smørgravlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3566f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3567f3b0ac34SDag-Erling Smørgrav  ;;
3568f3b0ac34SDag-Erling Smørgrav
3569f3b0ac34SDag-Erling Smørgravnetbsd*)
3570f3b0ac34SDag-Erling Smørgrav  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3571f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3572f3b0ac34SDag-Erling Smørgrav  else
3573f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3574f3b0ac34SDag-Erling Smørgrav  fi
3575f3b0ac34SDag-Erling Smørgrav  ;;
3576f3b0ac34SDag-Erling Smørgrav
3577f3b0ac34SDag-Erling Smørgravnewos6*)
3578f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3579*3ba4c8c8SDag-Erling Smørgrav  lt_cv_file_magic_cmd=$FILECMD
3580f3b0ac34SDag-Erling Smørgrav  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3581f3b0ac34SDag-Erling Smørgrav  ;;
3582f3b0ac34SDag-Erling Smørgrav
3583f3b0ac34SDag-Erling Smørgrav*nto* | *qnx*)
3584f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3585f3b0ac34SDag-Erling Smørgrav  ;;
3586f3b0ac34SDag-Erling Smørgrav
3587f3b0ac34SDag-Erling Smørgravopenbsd* | bitrig*)
3588f3b0ac34SDag-Erling Smørgrav  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3589f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3590f3b0ac34SDag-Erling Smørgrav  else
3591f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3592f3b0ac34SDag-Erling Smørgrav  fi
3593f3b0ac34SDag-Erling Smørgrav  ;;
3594f3b0ac34SDag-Erling Smørgrav
3595f3b0ac34SDag-Erling Smørgravosf3* | osf4* | osf5*)
3596f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3597f3b0ac34SDag-Erling Smørgrav  ;;
3598f3b0ac34SDag-Erling Smørgrav
3599f3b0ac34SDag-Erling Smørgravrdos*)
3600f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3601f3b0ac34SDag-Erling Smørgrav  ;;
3602f3b0ac34SDag-Erling Smørgrav
3603f3b0ac34SDag-Erling Smørgravsolaris*)
3604f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3605f3b0ac34SDag-Erling Smørgrav  ;;
3606f3b0ac34SDag-Erling Smørgrav
3607f3b0ac34SDag-Erling Smørgravsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3608f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3609f3b0ac34SDag-Erling Smørgrav  ;;
3610f3b0ac34SDag-Erling Smørgrav
3611f3b0ac34SDag-Erling Smørgravsysv4 | sysv4.3*)
3612f3b0ac34SDag-Erling Smørgrav  case $host_vendor in
3613f3b0ac34SDag-Erling Smørgrav  motorola)
3614f3b0ac34SDag-Erling Smørgrav    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]]'
3615f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3616f3b0ac34SDag-Erling Smørgrav    ;;
3617f3b0ac34SDag-Erling Smørgrav  ncr)
3618f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method=pass_all
3619f3b0ac34SDag-Erling Smørgrav    ;;
3620f3b0ac34SDag-Erling Smørgrav  sequent)
3621f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_cmd='/bin/file'
3622f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3623f3b0ac34SDag-Erling Smørgrav    ;;
3624f3b0ac34SDag-Erling Smørgrav  sni)
3625f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_cmd='/bin/file'
3626f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3627f3b0ac34SDag-Erling Smørgrav    lt_cv_file_magic_test_file=/lib/libc.so
3628f3b0ac34SDag-Erling Smørgrav    ;;
3629f3b0ac34SDag-Erling Smørgrav  siemens)
3630f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method=pass_all
3631f3b0ac34SDag-Erling Smørgrav    ;;
3632f3b0ac34SDag-Erling Smørgrav  pc)
3633f3b0ac34SDag-Erling Smørgrav    lt_cv_deplibs_check_method=pass_all
3634f3b0ac34SDag-Erling Smørgrav    ;;
3635f3b0ac34SDag-Erling Smørgrav  esac
3636f3b0ac34SDag-Erling Smørgrav  ;;
3637f3b0ac34SDag-Erling Smørgrav
3638f3b0ac34SDag-Erling Smørgravtpf*)
3639f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3640f3b0ac34SDag-Erling Smørgrav  ;;
3641f3b0ac34SDag-Erling Smørgravos2*)
3642f3b0ac34SDag-Erling Smørgrav  lt_cv_deplibs_check_method=pass_all
3643f3b0ac34SDag-Erling Smørgrav  ;;
3644f3b0ac34SDag-Erling Smørgravesac
3645f3b0ac34SDag-Erling Smørgrav])
3646f3b0ac34SDag-Erling Smørgrav
3647f3b0ac34SDag-Erling Smørgravfile_magic_glob=
3648f3b0ac34SDag-Erling Smørgravwant_nocaseglob=no
3649f3b0ac34SDag-Erling Smørgravif test "$build" = "$host"; then
3650f3b0ac34SDag-Erling Smørgrav  case $host_os in
3651f3b0ac34SDag-Erling Smørgrav  mingw* | pw32*)
3652f3b0ac34SDag-Erling Smørgrav    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3653f3b0ac34SDag-Erling Smørgrav      want_nocaseglob=yes
3654f3b0ac34SDag-Erling Smørgrav    else
3655f3b0ac34SDag-Erling Smørgrav      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3656f3b0ac34SDag-Erling Smørgrav    fi
3657f3b0ac34SDag-Erling Smørgrav    ;;
3658f3b0ac34SDag-Erling Smørgrav  esac
3659f3b0ac34SDag-Erling Smørgravfi
3660f3b0ac34SDag-Erling Smørgrav
3661f3b0ac34SDag-Erling Smørgravfile_magic_cmd=$lt_cv_file_magic_cmd
3662f3b0ac34SDag-Erling Smørgravdeplibs_check_method=$lt_cv_deplibs_check_method
3663f3b0ac34SDag-Erling Smørgravtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3664f3b0ac34SDag-Erling Smørgrav
3665f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [deplibs_check_method], [1],
3666f3b0ac34SDag-Erling Smørgrav    [Method to check whether dependent libraries are shared objects])
3667f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [file_magic_cmd], [1],
3668f3b0ac34SDag-Erling Smørgrav    [Command to use when deplibs_check_method = "file_magic"])
3669f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [file_magic_glob], [1],
3670f3b0ac34SDag-Erling Smørgrav    [How to find potential files when deplibs_check_method = "file_magic"])
3671f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [want_nocaseglob], [1],
3672f3b0ac34SDag-Erling Smørgrav    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3673f3b0ac34SDag-Erling Smørgrav])# _LT_CHECK_MAGIC_METHOD
3674f3b0ac34SDag-Erling Smørgrav
3675f3b0ac34SDag-Erling Smørgrav
3676f3b0ac34SDag-Erling Smørgrav# LT_PATH_NM
3677f3b0ac34SDag-Erling Smørgrav# ----------
3678f3b0ac34SDag-Erling Smørgrav# find the pathname to a BSD- or MS-compatible name lister
3679f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_PATH_NM],
3680f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_PROG_CC])dnl
3681f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3682f3b0ac34SDag-Erling Smørgrav[if test -n "$NM"; then
3683f3b0ac34SDag-Erling Smørgrav  # Let the user override the test.
3684f3b0ac34SDag-Erling Smørgrav  lt_cv_path_NM=$NM
3685f3b0ac34SDag-Erling Smørgravelse
3686f3b0ac34SDag-Erling Smørgrav  lt_nm_to_check=${ac_tool_prefix}nm
3687f3b0ac34SDag-Erling Smørgrav  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3688f3b0ac34SDag-Erling Smørgrav    lt_nm_to_check="$lt_nm_to_check nm"
3689f3b0ac34SDag-Erling Smørgrav  fi
3690f3b0ac34SDag-Erling Smørgrav  for lt_tmp_nm in $lt_nm_to_check; do
3691f3b0ac34SDag-Erling Smørgrav    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3692f3b0ac34SDag-Erling Smørgrav    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3693f3b0ac34SDag-Erling Smørgrav      IFS=$lt_save_ifs
3694f3b0ac34SDag-Erling Smørgrav      test -z "$ac_dir" && ac_dir=.
3695f3b0ac34SDag-Erling Smørgrav      tmp_nm=$ac_dir/$lt_tmp_nm
3696f3b0ac34SDag-Erling Smørgrav      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3697f3b0ac34SDag-Erling Smørgrav	# Check to see if the nm accepts a BSD-compat flag.
3698f3b0ac34SDag-Erling Smørgrav	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3699f3b0ac34SDag-Erling Smørgrav	#   nm: unknown option "B" ignored
3700f3b0ac34SDag-Erling Smørgrav	# Tru64's nm complains that /dev/null is an invalid object file
3701f3b0ac34SDag-Erling Smørgrav	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3702f3b0ac34SDag-Erling Smørgrav	case $build_os in
3703f3b0ac34SDag-Erling Smørgrav	mingw*) lt_bad_file=conftest.nm/nofile ;;
3704f3b0ac34SDag-Erling Smørgrav	*) lt_bad_file=/dev/null ;;
3705f3b0ac34SDag-Erling Smørgrav	esac
3706*3ba4c8c8SDag-Erling Smørgrav	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
3707f3b0ac34SDag-Erling Smørgrav	*$lt_bad_file* | *'Invalid file or object type'*)
3708f3b0ac34SDag-Erling Smørgrav	  lt_cv_path_NM="$tmp_nm -B"
3709f3b0ac34SDag-Erling Smørgrav	  break 2
3710f3b0ac34SDag-Erling Smørgrav	  ;;
3711f3b0ac34SDag-Erling Smørgrav	*)
3712*3ba4c8c8SDag-Erling Smørgrav	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
3713f3b0ac34SDag-Erling Smørgrav	  */dev/null*)
3714f3b0ac34SDag-Erling Smørgrav	    lt_cv_path_NM="$tmp_nm -p"
3715f3b0ac34SDag-Erling Smørgrav	    break 2
3716f3b0ac34SDag-Erling Smørgrav	    ;;
3717f3b0ac34SDag-Erling Smørgrav	  *)
3718f3b0ac34SDag-Erling Smørgrav	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3719f3b0ac34SDag-Erling Smørgrav	    continue # so that we can try to find one that supports BSD flags
3720f3b0ac34SDag-Erling Smørgrav	    ;;
3721f3b0ac34SDag-Erling Smørgrav	  esac
3722f3b0ac34SDag-Erling Smørgrav	  ;;
3723f3b0ac34SDag-Erling Smørgrav	esac
3724f3b0ac34SDag-Erling Smørgrav      fi
3725f3b0ac34SDag-Erling Smørgrav    done
3726f3b0ac34SDag-Erling Smørgrav    IFS=$lt_save_ifs
3727f3b0ac34SDag-Erling Smørgrav  done
3728f3b0ac34SDag-Erling Smørgrav  : ${lt_cv_path_NM=no}
3729f3b0ac34SDag-Erling Smørgravfi])
3730f3b0ac34SDag-Erling Smørgravif test no != "$lt_cv_path_NM"; then
3731f3b0ac34SDag-Erling Smørgrav  NM=$lt_cv_path_NM
3732f3b0ac34SDag-Erling Smørgravelse
3733f3b0ac34SDag-Erling Smørgrav  # Didn't find any BSD compatible name lister, look for dumpbin.
3734f3b0ac34SDag-Erling Smørgrav  if test -n "$DUMPBIN"; then :
3735f3b0ac34SDag-Erling Smørgrav    # Let the user override the test.
3736f3b0ac34SDag-Erling Smørgrav  else
3737f3b0ac34SDag-Erling Smørgrav    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3738*3ba4c8c8SDag-Erling Smørgrav    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
3739f3b0ac34SDag-Erling Smørgrav    *COFF*)
3740f3b0ac34SDag-Erling Smørgrav      DUMPBIN="$DUMPBIN -symbols -headers"
3741f3b0ac34SDag-Erling Smørgrav      ;;
3742f3b0ac34SDag-Erling Smørgrav    *)
3743f3b0ac34SDag-Erling Smørgrav      DUMPBIN=:
3744f3b0ac34SDag-Erling Smørgrav      ;;
3745f3b0ac34SDag-Erling Smørgrav    esac
3746f3b0ac34SDag-Erling Smørgrav  fi
3747f3b0ac34SDag-Erling Smørgrav  AC_SUBST([DUMPBIN])
3748f3b0ac34SDag-Erling Smørgrav  if test : != "$DUMPBIN"; then
3749f3b0ac34SDag-Erling Smørgrav    NM=$DUMPBIN
3750f3b0ac34SDag-Erling Smørgrav  fi
3751f3b0ac34SDag-Erling Smørgravfi
3752f3b0ac34SDag-Erling Smørgravtest -z "$NM" && NM=nm
3753f3b0ac34SDag-Erling SmørgravAC_SUBST([NM])
3754f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3755f3b0ac34SDag-Erling Smørgrav
3756f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3757f3b0ac34SDag-Erling Smørgrav  [lt_cv_nm_interface="BSD nm"
3758f3b0ac34SDag-Erling Smørgrav  echo "int some_variable = 0;" > conftest.$ac_ext
3759f3b0ac34SDag-Erling Smørgrav  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3760f3b0ac34SDag-Erling Smørgrav  (eval "$ac_compile" 2>conftest.err)
3761f3b0ac34SDag-Erling Smørgrav  cat conftest.err >&AS_MESSAGE_LOG_FD
3762f3b0ac34SDag-Erling Smørgrav  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3763f3b0ac34SDag-Erling Smørgrav  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3764f3b0ac34SDag-Erling Smørgrav  cat conftest.err >&AS_MESSAGE_LOG_FD
3765f3b0ac34SDag-Erling Smørgrav  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3766f3b0ac34SDag-Erling Smørgrav  cat conftest.out >&AS_MESSAGE_LOG_FD
3767f3b0ac34SDag-Erling Smørgrav  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3768f3b0ac34SDag-Erling Smørgrav    lt_cv_nm_interface="MS dumpbin"
3769f3b0ac34SDag-Erling Smørgrav  fi
3770f3b0ac34SDag-Erling Smørgrav  rm -f conftest*])
3771f3b0ac34SDag-Erling Smørgrav])# LT_PATH_NM
3772f3b0ac34SDag-Erling Smørgrav
3773f3b0ac34SDag-Erling Smørgrav# Old names:
3774f3b0ac34SDag-Erling SmørgravAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3775f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3776f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
3777f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AM_PROG_NM], [])
3778f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_PROG_NM], [])
3779f3b0ac34SDag-Erling Smørgrav
3780f3b0ac34SDag-Erling Smørgrav# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3781f3b0ac34SDag-Erling Smørgrav# --------------------------------
3782f3b0ac34SDag-Erling Smørgrav# how to determine the name of the shared library
3783f3b0ac34SDag-Erling Smørgrav# associated with a specific link library.
3784f3b0ac34SDag-Erling Smørgrav#  -- PORTME fill in with the dynamic library characteristics
3785f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3786f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_EGREP])
3787f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_OBJDUMP])
3788f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_DLLTOOL])
3789f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([how to associate runtime and link libraries],
3790f3b0ac34SDag-Erling Smørgravlt_cv_sharedlib_from_linklib_cmd,
3791f3b0ac34SDag-Erling Smørgrav[lt_cv_sharedlib_from_linklib_cmd='unknown'
3792f3b0ac34SDag-Erling Smørgrav
3793f3b0ac34SDag-Erling Smørgravcase $host_os in
3794f3b0ac34SDag-Erling Smørgravcygwin* | mingw* | pw32* | cegcc*)
3795f3b0ac34SDag-Erling Smørgrav  # two different shell functions defined in ltmain.sh;
3796f3b0ac34SDag-Erling Smørgrav  # decide which one to use based on capabilities of $DLLTOOL
3797f3b0ac34SDag-Erling Smørgrav  case `$DLLTOOL --help 2>&1` in
3798f3b0ac34SDag-Erling Smørgrav  *--identify-strict*)
3799f3b0ac34SDag-Erling Smørgrav    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3800f3b0ac34SDag-Erling Smørgrav    ;;
3801f3b0ac34SDag-Erling Smørgrav  *)
3802f3b0ac34SDag-Erling Smørgrav    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3803f3b0ac34SDag-Erling Smørgrav    ;;
3804f3b0ac34SDag-Erling Smørgrav  esac
3805f3b0ac34SDag-Erling Smørgrav  ;;
3806f3b0ac34SDag-Erling Smørgrav*)
3807f3b0ac34SDag-Erling Smørgrav  # fallback: assume linklib IS sharedlib
3808f3b0ac34SDag-Erling Smørgrav  lt_cv_sharedlib_from_linklib_cmd=$ECHO
3809f3b0ac34SDag-Erling Smørgrav  ;;
3810f3b0ac34SDag-Erling Smørgravesac
3811f3b0ac34SDag-Erling Smørgrav])
3812f3b0ac34SDag-Erling Smørgravsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3813f3b0ac34SDag-Erling Smørgravtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3814f3b0ac34SDag-Erling Smørgrav
3815f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3816f3b0ac34SDag-Erling Smørgrav    [Command to associate shared and link libraries])
3817f3b0ac34SDag-Erling Smørgrav])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3818f3b0ac34SDag-Erling Smørgrav
3819f3b0ac34SDag-Erling Smørgrav
3820f3b0ac34SDag-Erling Smørgrav# _LT_PATH_MANIFEST_TOOL
3821f3b0ac34SDag-Erling Smørgrav# ----------------------
3822f3b0ac34SDag-Erling Smørgrav# locate the manifest tool
3823f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PATH_MANIFEST_TOOL],
3824f3b0ac34SDag-Erling Smørgrav[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3825f3b0ac34SDag-Erling Smørgravtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3826f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3827f3b0ac34SDag-Erling Smørgrav  [lt_cv_path_mainfest_tool=no
3828f3b0ac34SDag-Erling Smørgrav  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3829f3b0ac34SDag-Erling Smørgrav  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3830f3b0ac34SDag-Erling Smørgrav  cat conftest.err >&AS_MESSAGE_LOG_FD
3831f3b0ac34SDag-Erling Smørgrav  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3832f3b0ac34SDag-Erling Smørgrav    lt_cv_path_mainfest_tool=yes
3833f3b0ac34SDag-Erling Smørgrav  fi
3834f3b0ac34SDag-Erling Smørgrav  rm -f conftest*])
3835f3b0ac34SDag-Erling Smørgravif test yes != "$lt_cv_path_mainfest_tool"; then
3836f3b0ac34SDag-Erling Smørgrav  MANIFEST_TOOL=:
3837f3b0ac34SDag-Erling Smørgravfi
3838f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3839f3b0ac34SDag-Erling Smørgrav])# _LT_PATH_MANIFEST_TOOL
3840f3b0ac34SDag-Erling Smørgrav
3841f3b0ac34SDag-Erling Smørgrav
3842f3b0ac34SDag-Erling Smørgrav# _LT_DLL_DEF_P([FILE])
3843f3b0ac34SDag-Erling Smørgrav# ---------------------
3844f3b0ac34SDag-Erling Smørgrav# True iff FILE is a Windows DLL '.def' file.
3845f3b0ac34SDag-Erling Smørgrav# Keep in sync with func_dll_def_p in the libtool script
3846f3b0ac34SDag-Erling SmørgravAC_DEFUN([_LT_DLL_DEF_P],
3847f3b0ac34SDag-Erling Smørgrav[dnl
3848f3b0ac34SDag-Erling Smørgrav  test DEF = "`$SED -n dnl
3849f3b0ac34SDag-Erling Smørgrav    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3850f3b0ac34SDag-Erling Smørgrav    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3851f3b0ac34SDag-Erling Smørgrav    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3852f3b0ac34SDag-Erling Smørgrav    -e q dnl                          Only consider the first "real" line
3853f3b0ac34SDag-Erling Smørgrav    $1`" dnl
3854f3b0ac34SDag-Erling Smørgrav])# _LT_DLL_DEF_P
3855f3b0ac34SDag-Erling Smørgrav
3856f3b0ac34SDag-Erling Smørgrav
3857f3b0ac34SDag-Erling Smørgrav# LT_LIB_M
3858f3b0ac34SDag-Erling Smørgrav# --------
3859f3b0ac34SDag-Erling Smørgrav# check for math library
3860f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_LIB_M],
3861f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3862f3b0ac34SDag-Erling SmørgravLIBM=
3863f3b0ac34SDag-Erling Smørgravcase $host in
3864f3b0ac34SDag-Erling Smørgrav*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3865f3b0ac34SDag-Erling Smørgrav  # These system don't have libm, or don't need it
3866f3b0ac34SDag-Erling Smørgrav  ;;
3867f3b0ac34SDag-Erling Smørgrav*-ncr-sysv4.3*)
3868f3b0ac34SDag-Erling Smørgrav  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3869f3b0ac34SDag-Erling Smørgrav  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3870f3b0ac34SDag-Erling Smørgrav  ;;
3871f3b0ac34SDag-Erling Smørgrav*)
3872f3b0ac34SDag-Erling Smørgrav  AC_CHECK_LIB(m, cos, LIBM=-lm)
3873f3b0ac34SDag-Erling Smørgrav  ;;
3874f3b0ac34SDag-Erling Smørgravesac
3875f3b0ac34SDag-Erling SmørgravAC_SUBST([LIBM])
3876f3b0ac34SDag-Erling Smørgrav])# LT_LIB_M
3877f3b0ac34SDag-Erling Smørgrav
3878f3b0ac34SDag-Erling Smørgrav# Old name:
3879f3b0ac34SDag-Erling SmørgravAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3880f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
3881f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([AC_CHECK_LIBM], [])
3882f3b0ac34SDag-Erling Smørgrav
3883f3b0ac34SDag-Erling Smørgrav
3884f3b0ac34SDag-Erling Smørgrav# _LT_COMPILER_NO_RTTI([TAGNAME])
3885f3b0ac34SDag-Erling Smørgrav# -------------------------------
3886f3b0ac34SDag-Erling Smørgravm4_defun([_LT_COMPILER_NO_RTTI],
3887f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_TAG_COMPILER])dnl
3888f3b0ac34SDag-Erling Smørgrav
3889f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3890f3b0ac34SDag-Erling Smørgrav
3891f3b0ac34SDag-Erling Smørgravif test yes = "$GCC"; then
3892f3b0ac34SDag-Erling Smørgrav  case $cc_basename in
3893f3b0ac34SDag-Erling Smørgrav  nvcc*)
3894f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3895f3b0ac34SDag-Erling Smørgrav  *)
3896f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3897f3b0ac34SDag-Erling Smørgrav  esac
3898f3b0ac34SDag-Erling Smørgrav
3899f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3900f3b0ac34SDag-Erling Smørgrav    lt_cv_prog_compiler_rtti_exceptions,
3901f3b0ac34SDag-Erling Smørgrav    [-fno-rtti -fno-exceptions], [],
3902f3b0ac34SDag-Erling Smørgrav    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3903f3b0ac34SDag-Erling Smørgravfi
3904f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3905f3b0ac34SDag-Erling Smørgrav	[Compiler flag to turn off builtin functions])
3906f3b0ac34SDag-Erling Smørgrav])# _LT_COMPILER_NO_RTTI
3907f3b0ac34SDag-Erling Smørgrav
3908f3b0ac34SDag-Erling Smørgrav
3909f3b0ac34SDag-Erling Smørgrav# _LT_CMD_GLOBAL_SYMBOLS
3910f3b0ac34SDag-Erling Smørgrav# ----------------------
3911f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3912f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3913f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_PROG_CC])dnl
3914f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_PROG_AWK])dnl
3915f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LT_PATH_NM])dnl
3916f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LT_PATH_LD])dnl
3917f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_SED])dnl
3918f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_EGREP])dnl
3919f3b0ac34SDag-Erling Smørgravm4_require([_LT_TAG_COMPILER])dnl
3920f3b0ac34SDag-Erling Smørgrav
3921f3b0ac34SDag-Erling Smørgrav# Check for command to grab the raw symbol name followed by C symbol from nm.
3922f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3923f3b0ac34SDag-Erling SmørgravAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3924f3b0ac34SDag-Erling Smørgrav[
3925f3b0ac34SDag-Erling Smørgrav# These are sane defaults that work on at least a few old systems.
3926f3b0ac34SDag-Erling Smørgrav# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3927f3b0ac34SDag-Erling Smørgrav
3928f3b0ac34SDag-Erling Smørgrav# Character class describing NM global symbol codes.
3929f3b0ac34SDag-Erling Smørgravsymcode='[[BCDEGRST]]'
3930f3b0ac34SDag-Erling Smørgrav
3931f3b0ac34SDag-Erling Smørgrav# Regexp to match symbols that can be accessed directly from C.
3932f3b0ac34SDag-Erling Smørgravsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3933f3b0ac34SDag-Erling Smørgrav
3934f3b0ac34SDag-Erling Smørgrav# Define system-specific variables.
3935f3b0ac34SDag-Erling Smørgravcase $host_os in
3936f3b0ac34SDag-Erling Smørgravaix*)
3937f3b0ac34SDag-Erling Smørgrav  symcode='[[BCDT]]'
3938f3b0ac34SDag-Erling Smørgrav  ;;
3939f3b0ac34SDag-Erling Smørgravcygwin* | mingw* | pw32* | cegcc*)
3940f3b0ac34SDag-Erling Smørgrav  symcode='[[ABCDGISTW]]'
3941f3b0ac34SDag-Erling Smørgrav  ;;
3942f3b0ac34SDag-Erling Smørgravhpux*)
3943f3b0ac34SDag-Erling Smørgrav  if test ia64 = "$host_cpu"; then
3944f3b0ac34SDag-Erling Smørgrav    symcode='[[ABCDEGRST]]'
3945f3b0ac34SDag-Erling Smørgrav  fi
3946f3b0ac34SDag-Erling Smørgrav  ;;
3947f3b0ac34SDag-Erling Smørgravirix* | nonstopux*)
3948f3b0ac34SDag-Erling Smørgrav  symcode='[[BCDEGRST]]'
3949f3b0ac34SDag-Erling Smørgrav  ;;
3950f3b0ac34SDag-Erling Smørgravosf*)
3951f3b0ac34SDag-Erling Smørgrav  symcode='[[BCDEGQRST]]'
3952f3b0ac34SDag-Erling Smørgrav  ;;
3953f3b0ac34SDag-Erling Smørgravsolaris*)
3954f3b0ac34SDag-Erling Smørgrav  symcode='[[BDRT]]'
3955f3b0ac34SDag-Erling Smørgrav  ;;
3956f3b0ac34SDag-Erling Smørgravsco3.2v5*)
3957f3b0ac34SDag-Erling Smørgrav  symcode='[[DT]]'
3958f3b0ac34SDag-Erling Smørgrav  ;;
3959f3b0ac34SDag-Erling Smørgravsysv4.2uw2*)
3960f3b0ac34SDag-Erling Smørgrav  symcode='[[DT]]'
3961f3b0ac34SDag-Erling Smørgrav  ;;
3962f3b0ac34SDag-Erling Smørgravsysv5* | sco5v6* | unixware* | OpenUNIX*)
3963f3b0ac34SDag-Erling Smørgrav  symcode='[[ABDT]]'
3964f3b0ac34SDag-Erling Smørgrav  ;;
3965f3b0ac34SDag-Erling Smørgravsysv4)
3966f3b0ac34SDag-Erling Smørgrav  symcode='[[DFNSTU]]'
3967f3b0ac34SDag-Erling Smørgrav  ;;
3968f3b0ac34SDag-Erling Smørgravesac
3969f3b0ac34SDag-Erling Smørgrav
3970f3b0ac34SDag-Erling Smørgrav# If we're using GNU nm, then use its standard symbol codes.
3971f3b0ac34SDag-Erling Smørgravcase `$NM -V 2>&1` in
3972f3b0ac34SDag-Erling Smørgrav*GNU* | *'with BFD'*)
3973f3b0ac34SDag-Erling Smørgrav  symcode='[[ABCDGIRSTW]]' ;;
3974f3b0ac34SDag-Erling Smørgravesac
3975f3b0ac34SDag-Erling Smørgrav
3976f3b0ac34SDag-Erling Smørgravif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3977f3b0ac34SDag-Erling Smørgrav  # Gets list of data symbols to import.
3978*3ba4c8c8SDag-Erling Smørgrav  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
3979f3b0ac34SDag-Erling Smørgrav  # Adjust the below global symbol transforms to fixup imported variables.
3980f3b0ac34SDag-Erling Smørgrav  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3981f3b0ac34SDag-Erling Smørgrav  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3982f3b0ac34SDag-Erling Smørgrav  lt_c_name_lib_hook="\
3983f3b0ac34SDag-Erling Smørgrav  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3984f3b0ac34SDag-Erling Smørgrav  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3985f3b0ac34SDag-Erling Smørgravelse
3986f3b0ac34SDag-Erling Smørgrav  # Disable hooks by default.
3987f3b0ac34SDag-Erling Smørgrav  lt_cv_sys_global_symbol_to_import=
3988f3b0ac34SDag-Erling Smørgrav  lt_cdecl_hook=
3989f3b0ac34SDag-Erling Smørgrav  lt_c_name_hook=
3990f3b0ac34SDag-Erling Smørgrav  lt_c_name_lib_hook=
3991f3b0ac34SDag-Erling Smørgravfi
3992f3b0ac34SDag-Erling Smørgrav
3993f3b0ac34SDag-Erling Smørgrav# Transform an extracted symbol line into a proper C declaration.
3994f3b0ac34SDag-Erling Smørgrav# Some systems (esp. on ia64) link data and code symbols differently,
3995f3b0ac34SDag-Erling Smørgrav# so use this general approach.
3996*3ba4c8c8SDag-Erling Smørgravlt_cv_sys_global_symbol_to_cdecl="$SED -n"\
3997f3b0ac34SDag-Erling Smørgrav$lt_cdecl_hook\
3998f3b0ac34SDag-Erling Smørgrav" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3999f3b0ac34SDag-Erling Smørgrav" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
4000f3b0ac34SDag-Erling Smørgrav
4001f3b0ac34SDag-Erling Smørgrav# Transform an extracted symbol line into symbol name and symbol address
4002*3ba4c8c8SDag-Erling Smørgravlt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
4003f3b0ac34SDag-Erling Smørgrav$lt_c_name_hook\
4004f3b0ac34SDag-Erling Smørgrav" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4005f3b0ac34SDag-Erling Smørgrav" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4006f3b0ac34SDag-Erling Smørgrav
4007f3b0ac34SDag-Erling Smørgrav# Transform an extracted symbol line into symbol name with lib prefix and
4008f3b0ac34SDag-Erling Smørgrav# symbol address.
4009*3ba4c8c8SDag-Erling Smørgravlt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
4010f3b0ac34SDag-Erling Smørgrav$lt_c_name_lib_hook\
4011f3b0ac34SDag-Erling Smørgrav" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4012f3b0ac34SDag-Erling Smørgrav" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4013f3b0ac34SDag-Erling Smørgrav" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4014f3b0ac34SDag-Erling Smørgrav
4015f3b0ac34SDag-Erling Smørgrav# Handle CRLF in mingw tool chain
4016f3b0ac34SDag-Erling Smørgravopt_cr=
4017f3b0ac34SDag-Erling Smørgravcase $build_os in
4018f3b0ac34SDag-Erling Smørgravmingw*)
4019f3b0ac34SDag-Erling Smørgrav  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4020f3b0ac34SDag-Erling Smørgrav  ;;
4021f3b0ac34SDag-Erling Smørgravesac
4022f3b0ac34SDag-Erling Smørgrav
4023f3b0ac34SDag-Erling Smørgrav# Try without a prefix underscore, then with it.
4024f3b0ac34SDag-Erling Smørgravfor ac_symprfx in "" "_"; do
4025f3b0ac34SDag-Erling Smørgrav
4026f3b0ac34SDag-Erling Smørgrav  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4027f3b0ac34SDag-Erling Smørgrav  symxfrm="\\1 $ac_symprfx\\2 \\2"
4028f3b0ac34SDag-Erling Smørgrav
4029f3b0ac34SDag-Erling Smørgrav  # Write the raw and C identifiers.
4030f3b0ac34SDag-Erling Smørgrav  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4031f3b0ac34SDag-Erling Smørgrav    # Fake it for dumpbin and say T for any non-static function,
4032f3b0ac34SDag-Erling Smørgrav    # D for any global variable and I for any imported variable.
4033*3ba4c8c8SDag-Erling Smørgrav    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
4034f3b0ac34SDag-Erling Smørgrav    # which start with @ or ?.
4035f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4036f3b0ac34SDag-Erling Smørgrav"     {last_section=section; section=\$ 3};"\
4037f3b0ac34SDag-Erling Smørgrav"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4038f3b0ac34SDag-Erling Smørgrav"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4039f3b0ac34SDag-Erling Smørgrav"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4040f3b0ac34SDag-Erling Smørgrav"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4041f3b0ac34SDag-Erling Smørgrav"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4042f3b0ac34SDag-Erling Smørgrav"     \$ 0!~/External *\|/{next};"\
4043f3b0ac34SDag-Erling Smørgrav"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4044f3b0ac34SDag-Erling Smørgrav"     {if(hide[section]) next};"\
4045f3b0ac34SDag-Erling Smørgrav"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4046f3b0ac34SDag-Erling Smørgrav"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4047f3b0ac34SDag-Erling Smørgrav"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4048f3b0ac34SDag-Erling Smørgrav"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4049f3b0ac34SDag-Erling Smørgrav"     ' prfx=^$ac_symprfx]"
4050f3b0ac34SDag-Erling Smørgrav  else
4051*3ba4c8c8SDag-Erling Smørgrav    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4052f3b0ac34SDag-Erling Smørgrav  fi
4053*3ba4c8c8SDag-Erling Smørgrav  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
4054f3b0ac34SDag-Erling Smørgrav
4055f3b0ac34SDag-Erling Smørgrav  # Check to see that the pipe works correctly.
4056f3b0ac34SDag-Erling Smørgrav  pipe_works=no
4057f3b0ac34SDag-Erling Smørgrav
4058f3b0ac34SDag-Erling Smørgrav  rm -f conftest*
4059f3b0ac34SDag-Erling Smørgrav  cat > conftest.$ac_ext <<_LT_EOF
4060f3b0ac34SDag-Erling Smørgrav#ifdef __cplusplus
4061f3b0ac34SDag-Erling Smørgravextern "C" {
4062f3b0ac34SDag-Erling Smørgrav#endif
4063f3b0ac34SDag-Erling Smørgravchar nm_test_var;
4064f3b0ac34SDag-Erling Smørgravvoid nm_test_func(void);
4065f3b0ac34SDag-Erling Smørgravvoid nm_test_func(void){}
4066f3b0ac34SDag-Erling Smørgrav#ifdef __cplusplus
4067f3b0ac34SDag-Erling Smørgrav}
4068f3b0ac34SDag-Erling Smørgrav#endif
4069f3b0ac34SDag-Erling Smørgravint main(){nm_test_var='a';nm_test_func();return(0);}
4070f3b0ac34SDag-Erling Smørgrav_LT_EOF
4071f3b0ac34SDag-Erling Smørgrav
4072f3b0ac34SDag-Erling Smørgrav  if AC_TRY_EVAL(ac_compile); then
4073f3b0ac34SDag-Erling Smørgrav    # Now try to grab the symbols.
4074f3b0ac34SDag-Erling Smørgrav    nlist=conftest.nm
4075f3b0ac34SDag-Erling Smørgrav    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4076f3b0ac34SDag-Erling Smørgrav      # Try sorting and uniquifying the output.
4077f3b0ac34SDag-Erling Smørgrav      if sort "$nlist" | uniq > "$nlist"T; then
4078f3b0ac34SDag-Erling Smørgrav	mv -f "$nlist"T "$nlist"
4079f3b0ac34SDag-Erling Smørgrav      else
4080f3b0ac34SDag-Erling Smørgrav	rm -f "$nlist"T
4081f3b0ac34SDag-Erling Smørgrav      fi
4082f3b0ac34SDag-Erling Smørgrav
4083f3b0ac34SDag-Erling Smørgrav      # Make sure that we snagged all the symbols we need.
4084f3b0ac34SDag-Erling Smørgrav      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4085f3b0ac34SDag-Erling Smørgrav	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4086f3b0ac34SDag-Erling Smørgrav	  cat <<_LT_EOF > conftest.$ac_ext
4087f3b0ac34SDag-Erling Smørgrav/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4088f3b0ac34SDag-Erling Smørgrav#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4089f3b0ac34SDag-Erling Smørgrav/* DATA imports from DLLs on WIN32 can't be const, because runtime
4090f3b0ac34SDag-Erling Smørgrav   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4091f3b0ac34SDag-Erling Smørgrav# define LT@&t@_DLSYM_CONST
4092f3b0ac34SDag-Erling Smørgrav#elif defined __osf__
4093f3b0ac34SDag-Erling Smørgrav/* This system does not cope well with relocations in const data.  */
4094f3b0ac34SDag-Erling Smørgrav# define LT@&t@_DLSYM_CONST
4095f3b0ac34SDag-Erling Smørgrav#else
4096f3b0ac34SDag-Erling Smørgrav# define LT@&t@_DLSYM_CONST const
4097f3b0ac34SDag-Erling Smørgrav#endif
4098f3b0ac34SDag-Erling Smørgrav
4099f3b0ac34SDag-Erling Smørgrav#ifdef __cplusplus
4100f3b0ac34SDag-Erling Smørgravextern "C" {
4101f3b0ac34SDag-Erling Smørgrav#endif
4102f3b0ac34SDag-Erling Smørgrav
4103f3b0ac34SDag-Erling Smørgrav_LT_EOF
4104f3b0ac34SDag-Erling Smørgrav	  # Now generate the symbol file.
4105f3b0ac34SDag-Erling Smørgrav	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4106f3b0ac34SDag-Erling Smørgrav
4107f3b0ac34SDag-Erling Smørgrav	  cat <<_LT_EOF >> conftest.$ac_ext
4108f3b0ac34SDag-Erling Smørgrav
4109f3b0ac34SDag-Erling Smørgrav/* The mapping between symbol names and symbols.  */
4110f3b0ac34SDag-Erling SmørgravLT@&t@_DLSYM_CONST struct {
4111f3b0ac34SDag-Erling Smørgrav  const char *name;
4112f3b0ac34SDag-Erling Smørgrav  void       *address;
4113f3b0ac34SDag-Erling Smørgrav}
4114f3b0ac34SDag-Erling Smørgravlt__PROGRAM__LTX_preloaded_symbols[[]] =
4115f3b0ac34SDag-Erling Smørgrav{
4116f3b0ac34SDag-Erling Smørgrav  { "@PROGRAM@", (void *) 0 },
4117f3b0ac34SDag-Erling Smørgrav_LT_EOF
4118f3b0ac34SDag-Erling Smørgrav	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4119f3b0ac34SDag-Erling Smørgrav	  cat <<\_LT_EOF >> conftest.$ac_ext
4120f3b0ac34SDag-Erling Smørgrav  {0, (void *) 0}
4121f3b0ac34SDag-Erling Smørgrav};
4122f3b0ac34SDag-Erling Smørgrav
4123f3b0ac34SDag-Erling Smørgrav/* This works around a problem in FreeBSD linker */
4124f3b0ac34SDag-Erling Smørgrav#ifdef FREEBSD_WORKAROUND
4125f3b0ac34SDag-Erling Smørgravstatic const void *lt_preloaded_setup() {
4126f3b0ac34SDag-Erling Smørgrav  return lt__PROGRAM__LTX_preloaded_symbols;
4127f3b0ac34SDag-Erling Smørgrav}
4128f3b0ac34SDag-Erling Smørgrav#endif
4129f3b0ac34SDag-Erling Smørgrav
4130f3b0ac34SDag-Erling Smørgrav#ifdef __cplusplus
4131f3b0ac34SDag-Erling Smørgrav}
4132f3b0ac34SDag-Erling Smørgrav#endif
4133f3b0ac34SDag-Erling Smørgrav_LT_EOF
4134f3b0ac34SDag-Erling Smørgrav	  # Now try linking the two files.
4135f3b0ac34SDag-Erling Smørgrav	  mv conftest.$ac_objext conftstm.$ac_objext
4136f3b0ac34SDag-Erling Smørgrav	  lt_globsym_save_LIBS=$LIBS
4137f3b0ac34SDag-Erling Smørgrav	  lt_globsym_save_CFLAGS=$CFLAGS
4138f3b0ac34SDag-Erling Smørgrav	  LIBS=conftstm.$ac_objext
4139f3b0ac34SDag-Erling Smørgrav	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4140f3b0ac34SDag-Erling Smørgrav	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4141f3b0ac34SDag-Erling Smørgrav	    pipe_works=yes
4142f3b0ac34SDag-Erling Smørgrav	  fi
4143f3b0ac34SDag-Erling Smørgrav	  LIBS=$lt_globsym_save_LIBS
4144f3b0ac34SDag-Erling Smørgrav	  CFLAGS=$lt_globsym_save_CFLAGS
4145f3b0ac34SDag-Erling Smørgrav	else
4146f3b0ac34SDag-Erling Smørgrav	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4147f3b0ac34SDag-Erling Smørgrav	fi
4148f3b0ac34SDag-Erling Smørgrav      else
4149f3b0ac34SDag-Erling Smørgrav	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4150f3b0ac34SDag-Erling Smørgrav      fi
4151f3b0ac34SDag-Erling Smørgrav    else
4152f3b0ac34SDag-Erling Smørgrav      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4153f3b0ac34SDag-Erling Smørgrav    fi
4154f3b0ac34SDag-Erling Smørgrav  else
4155f3b0ac34SDag-Erling Smørgrav    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4156f3b0ac34SDag-Erling Smørgrav    cat conftest.$ac_ext >&5
4157f3b0ac34SDag-Erling Smørgrav  fi
4158f3b0ac34SDag-Erling Smørgrav  rm -rf conftest* conftst*
4159f3b0ac34SDag-Erling Smørgrav
4160f3b0ac34SDag-Erling Smørgrav  # Do not use the global_symbol_pipe unless it works.
4161f3b0ac34SDag-Erling Smørgrav  if test yes = "$pipe_works"; then
4162f3b0ac34SDag-Erling Smørgrav    break
4163f3b0ac34SDag-Erling Smørgrav  else
4164f3b0ac34SDag-Erling Smørgrav    lt_cv_sys_global_symbol_pipe=
4165f3b0ac34SDag-Erling Smørgrav  fi
4166f3b0ac34SDag-Erling Smørgravdone
4167f3b0ac34SDag-Erling Smørgrav])
4168f3b0ac34SDag-Erling Smørgravif test -z "$lt_cv_sys_global_symbol_pipe"; then
4169f3b0ac34SDag-Erling Smørgrav  lt_cv_sys_global_symbol_to_cdecl=
4170f3b0ac34SDag-Erling Smørgravfi
4171f3b0ac34SDag-Erling Smørgravif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4172f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT(failed)
4173f3b0ac34SDag-Erling Smørgravelse
4174f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT(ok)
4175f3b0ac34SDag-Erling Smørgravfi
4176f3b0ac34SDag-Erling Smørgrav
4177f3b0ac34SDag-Erling Smørgrav# Response file support.
4178f3b0ac34SDag-Erling Smørgravif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4179f3b0ac34SDag-Erling Smørgrav  nm_file_list_spec='@'
4180f3b0ac34SDag-Erling Smørgravelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4181f3b0ac34SDag-Erling Smørgrav  nm_file_list_spec='@'
4182f3b0ac34SDag-Erling Smørgravfi
4183f3b0ac34SDag-Erling Smørgrav
4184f3b0ac34SDag-Erling Smørgrav_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4185f3b0ac34SDag-Erling Smørgrav    [Take the output of nm and produce a listing of raw symbols and C names])
4186f3b0ac34SDag-Erling Smørgrav_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4187f3b0ac34SDag-Erling Smørgrav    [Transform the output of nm in a proper C declaration])
4188f3b0ac34SDag-Erling Smørgrav_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4189f3b0ac34SDag-Erling Smørgrav    [Transform the output of nm into a list of symbols to manually relocate])
4190f3b0ac34SDag-Erling Smørgrav_LT_DECL([global_symbol_to_c_name_address],
4191f3b0ac34SDag-Erling Smørgrav    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4192f3b0ac34SDag-Erling Smørgrav    [Transform the output of nm in a C name address pair])
4193f3b0ac34SDag-Erling Smørgrav_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4194f3b0ac34SDag-Erling Smørgrav    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4195f3b0ac34SDag-Erling Smørgrav    [Transform the output of nm in a C name address pair when lib prefix is needed])
4196f3b0ac34SDag-Erling Smørgrav_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4197f3b0ac34SDag-Erling Smørgrav    [The name lister interface])
4198f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [nm_file_list_spec], [1],
4199f3b0ac34SDag-Erling Smørgrav    [Specify filename containing input files for $NM])
4200f3b0ac34SDag-Erling Smørgrav]) # _LT_CMD_GLOBAL_SYMBOLS
4201f3b0ac34SDag-Erling Smørgrav
4202f3b0ac34SDag-Erling Smørgrav
4203f3b0ac34SDag-Erling Smørgrav# _LT_COMPILER_PIC([TAGNAME])
4204f3b0ac34SDag-Erling Smørgrav# ---------------------------
4205f3b0ac34SDag-Erling Smørgravm4_defun([_LT_COMPILER_PIC],
4206f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_TAG_COMPILER])dnl
4207f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4208f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4209f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(lt_prog_compiler_static, $1)=
4210f3b0ac34SDag-Erling Smørgrav
4211f3b0ac34SDag-Erling Smørgravm4_if([$1], [CXX], [
4212f3b0ac34SDag-Erling Smørgrav  # C++ specific cases for pic, static, wl, etc.
4213f3b0ac34SDag-Erling Smørgrav  if test yes = "$GXX"; then
4214f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4215f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4216f3b0ac34SDag-Erling Smørgrav
4217f3b0ac34SDag-Erling Smørgrav    case $host_os in
4218f3b0ac34SDag-Erling Smørgrav    aix*)
4219f3b0ac34SDag-Erling Smørgrav      # All AIX code is PIC.
4220f3b0ac34SDag-Erling Smørgrav      if test ia64 = "$host_cpu"; then
4221f3b0ac34SDag-Erling Smørgrav	# AIX 5 now supports IA64 processor
4222f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4223f3b0ac34SDag-Erling Smørgrav      fi
4224f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4225f3b0ac34SDag-Erling Smørgrav      ;;
4226f3b0ac34SDag-Erling Smørgrav
4227f3b0ac34SDag-Erling Smørgrav    amigaos*)
4228f3b0ac34SDag-Erling Smørgrav      case $host_cpu in
4229f3b0ac34SDag-Erling Smørgrav      powerpc)
4230f3b0ac34SDag-Erling Smørgrav            # see comment about AmigaOS4 .so support
4231f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4232f3b0ac34SDag-Erling Smørgrav        ;;
4233f3b0ac34SDag-Erling Smørgrav      m68k)
4234f3b0ac34SDag-Erling Smørgrav            # FIXME: we need at least 68020 code to build shared libraries, but
4235f3b0ac34SDag-Erling Smørgrav            # adding the '-m68020' flag to GCC prevents building anything better,
4236f3b0ac34SDag-Erling Smørgrav            # like '-m68040'.
4237f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4238f3b0ac34SDag-Erling Smørgrav        ;;
4239f3b0ac34SDag-Erling Smørgrav      esac
4240f3b0ac34SDag-Erling Smørgrav      ;;
4241f3b0ac34SDag-Erling Smørgrav
4242f3b0ac34SDag-Erling Smørgrav    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4243f3b0ac34SDag-Erling Smørgrav      # PIC is the default for these OSes.
4244f3b0ac34SDag-Erling Smørgrav      ;;
4245f3b0ac34SDag-Erling Smørgrav    mingw* | cygwin* | os2* | pw32* | cegcc*)
4246f3b0ac34SDag-Erling Smørgrav      # This hack is so that the source file can tell whether it is being
4247f3b0ac34SDag-Erling Smørgrav      # built for inclusion in a dll (and should export symbols for example).
4248f3b0ac34SDag-Erling Smørgrav      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4249f3b0ac34SDag-Erling Smørgrav      # (--disable-auto-import) libraries
4250f3b0ac34SDag-Erling Smørgrav      m4_if([$1], [GCJ], [],
4251f3b0ac34SDag-Erling Smørgrav	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4252f3b0ac34SDag-Erling Smørgrav      case $host_os in
4253f3b0ac34SDag-Erling Smørgrav      os2*)
4254f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4255f3b0ac34SDag-Erling Smørgrav	;;
4256f3b0ac34SDag-Erling Smørgrav      esac
4257f3b0ac34SDag-Erling Smørgrav      ;;
4258f3b0ac34SDag-Erling Smørgrav    darwin* | rhapsody*)
4259f3b0ac34SDag-Erling Smørgrav      # PIC is the default on this platform
4260f3b0ac34SDag-Erling Smørgrav      # Common symbols not allowed in MH_DYLIB files
4261f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4262f3b0ac34SDag-Erling Smørgrav      ;;
4263f3b0ac34SDag-Erling Smørgrav    *djgpp*)
4264f3b0ac34SDag-Erling Smørgrav      # DJGPP does not support shared libraries at all
4265f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4266f3b0ac34SDag-Erling Smørgrav      ;;
4267f3b0ac34SDag-Erling Smørgrav    haiku*)
4268f3b0ac34SDag-Erling Smørgrav      # PIC is the default for Haiku.
4269f3b0ac34SDag-Erling Smørgrav      # The "-static" flag exists, but is broken.
4270f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4271f3b0ac34SDag-Erling Smørgrav      ;;
4272f3b0ac34SDag-Erling Smørgrav    interix[[3-9]]*)
4273f3b0ac34SDag-Erling Smørgrav      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4274f3b0ac34SDag-Erling Smørgrav      # Instead, we relocate shared libraries at runtime.
4275f3b0ac34SDag-Erling Smørgrav      ;;
4276f3b0ac34SDag-Erling Smørgrav    sysv4*MP*)
4277f3b0ac34SDag-Erling Smørgrav      if test -d /usr/nec; then
4278f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4279f3b0ac34SDag-Erling Smørgrav      fi
4280f3b0ac34SDag-Erling Smørgrav      ;;
4281f3b0ac34SDag-Erling Smørgrav    hpux*)
4282f3b0ac34SDag-Erling Smørgrav      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4283f3b0ac34SDag-Erling Smørgrav      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4284f3b0ac34SDag-Erling Smørgrav      # sets the default TLS model and affects inlining.
4285f3b0ac34SDag-Erling Smørgrav      case $host_cpu in
4286f3b0ac34SDag-Erling Smørgrav      hppa*64*)
4287f3b0ac34SDag-Erling Smørgrav	;;
4288f3b0ac34SDag-Erling Smørgrav      *)
4289f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4290f3b0ac34SDag-Erling Smørgrav	;;
4291f3b0ac34SDag-Erling Smørgrav      esac
4292f3b0ac34SDag-Erling Smørgrav      ;;
4293f3b0ac34SDag-Erling Smørgrav    *qnx* | *nto*)
4294f3b0ac34SDag-Erling Smørgrav      # QNX uses GNU C++, but need to define -shared option too, otherwise
4295f3b0ac34SDag-Erling Smørgrav      # it will coredump.
4296f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4297f3b0ac34SDag-Erling Smørgrav      ;;
4298f3b0ac34SDag-Erling Smørgrav    *)
4299f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4300f3b0ac34SDag-Erling Smørgrav      ;;
4301f3b0ac34SDag-Erling Smørgrav    esac
4302f3b0ac34SDag-Erling Smørgrav  else
4303f3b0ac34SDag-Erling Smørgrav    case $host_os in
4304f3b0ac34SDag-Erling Smørgrav      aix[[4-9]]*)
4305f3b0ac34SDag-Erling Smørgrav	# All AIX code is PIC.
4306f3b0ac34SDag-Erling Smørgrav	if test ia64 = "$host_cpu"; then
4307f3b0ac34SDag-Erling Smørgrav	  # AIX 5 now supports IA64 processor
4308f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4309f3b0ac34SDag-Erling Smørgrav	else
4310f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4311f3b0ac34SDag-Erling Smørgrav	fi
4312f3b0ac34SDag-Erling Smørgrav	;;
4313f3b0ac34SDag-Erling Smørgrav      chorus*)
4314f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4315f3b0ac34SDag-Erling Smørgrav	cxch68*)
4316f3b0ac34SDag-Erling Smørgrav	  # Green Hills C++ Compiler
4317f3b0ac34SDag-Erling Smørgrav	  # _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"
4318f3b0ac34SDag-Erling Smørgrav	  ;;
4319f3b0ac34SDag-Erling Smørgrav	esac
4320f3b0ac34SDag-Erling Smørgrav	;;
4321f3b0ac34SDag-Erling Smørgrav      mingw* | cygwin* | os2* | pw32* | cegcc*)
4322f3b0ac34SDag-Erling Smørgrav	# This hack is so that the source file can tell whether it is being
4323f3b0ac34SDag-Erling Smørgrav	# built for inclusion in a dll (and should export symbols for example).
4324f3b0ac34SDag-Erling Smørgrav	m4_if([$1], [GCJ], [],
4325f3b0ac34SDag-Erling Smørgrav	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4326f3b0ac34SDag-Erling Smørgrav	;;
4327f3b0ac34SDag-Erling Smørgrav      dgux*)
4328f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4329f3b0ac34SDag-Erling Smørgrav	  ec++*)
4330f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4331f3b0ac34SDag-Erling Smørgrav	    ;;
4332f3b0ac34SDag-Erling Smørgrav	  ghcx*)
4333f3b0ac34SDag-Erling Smørgrav	    # Green Hills C++ Compiler
4334f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4335f3b0ac34SDag-Erling Smørgrav	    ;;
4336f3b0ac34SDag-Erling Smørgrav	  *)
4337f3b0ac34SDag-Erling Smørgrav	    ;;
4338f3b0ac34SDag-Erling Smørgrav	esac
4339f3b0ac34SDag-Erling Smørgrav	;;
4340*3ba4c8c8SDag-Erling Smørgrav      freebsd* | dragonfly* | midnightbsd*)
4341f3b0ac34SDag-Erling Smørgrav	# FreeBSD uses GNU C++
4342f3b0ac34SDag-Erling Smørgrav	;;
4343f3b0ac34SDag-Erling Smørgrav      hpux9* | hpux10* | hpux11*)
4344f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4345f3b0ac34SDag-Erling Smørgrav	  CC*)
4346f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4347f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4348f3b0ac34SDag-Erling Smørgrav	    if test ia64 != "$host_cpu"; then
4349f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4350f3b0ac34SDag-Erling Smørgrav	    fi
4351f3b0ac34SDag-Erling Smørgrav	    ;;
4352f3b0ac34SDag-Erling Smørgrav	  aCC*)
4353f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4354f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4355f3b0ac34SDag-Erling Smørgrav	    case $host_cpu in
4356f3b0ac34SDag-Erling Smørgrav	    hppa*64*|ia64*)
4357f3b0ac34SDag-Erling Smørgrav	      # +Z the default
4358f3b0ac34SDag-Erling Smørgrav	      ;;
4359f3b0ac34SDag-Erling Smørgrav	    *)
4360f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4361f3b0ac34SDag-Erling Smørgrav	      ;;
4362f3b0ac34SDag-Erling Smørgrav	    esac
4363f3b0ac34SDag-Erling Smørgrav	    ;;
4364f3b0ac34SDag-Erling Smørgrav	  *)
4365f3b0ac34SDag-Erling Smørgrav	    ;;
4366f3b0ac34SDag-Erling Smørgrav	esac
4367f3b0ac34SDag-Erling Smørgrav	;;
4368f3b0ac34SDag-Erling Smørgrav      interix*)
4369f3b0ac34SDag-Erling Smørgrav	# This is c89, which is MS Visual C++ (no shared libs)
4370f3b0ac34SDag-Erling Smørgrav	# Anyone wants to do a port?
4371f3b0ac34SDag-Erling Smørgrav	;;
4372f3b0ac34SDag-Erling Smørgrav      irix5* | irix6* | nonstopux*)
4373f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4374f3b0ac34SDag-Erling Smørgrav	  CC*)
4375f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4376f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4377f3b0ac34SDag-Erling Smørgrav	    # CC pic flag -KPIC is the default.
4378f3b0ac34SDag-Erling Smørgrav	    ;;
4379f3b0ac34SDag-Erling Smørgrav	  *)
4380f3b0ac34SDag-Erling Smørgrav	    ;;
4381f3b0ac34SDag-Erling Smørgrav	esac
4382f3b0ac34SDag-Erling Smørgrav	;;
4383f3b0ac34SDag-Erling Smørgrav      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4384f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4385f3b0ac34SDag-Erling Smørgrav	  KCC*)
4386f3b0ac34SDag-Erling Smørgrav	    # KAI C++ Compiler
4387f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4388f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4389f3b0ac34SDag-Erling Smørgrav	    ;;
4390f3b0ac34SDag-Erling Smørgrav	  ecpc* )
4391f3b0ac34SDag-Erling Smørgrav	    # old Intel C++ for x86_64, which still supported -KPIC.
4392f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4393f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4394f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4395f3b0ac34SDag-Erling Smørgrav	    ;;
4396f3b0ac34SDag-Erling Smørgrav	  icpc* )
4397f3b0ac34SDag-Erling Smørgrav	    # Intel C++, used to be incompatible with GCC.
4398f3b0ac34SDag-Erling Smørgrav	    # ICC 10 doesn't accept -KPIC any more.
4399f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4400f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4401f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4402f3b0ac34SDag-Erling Smørgrav	    ;;
4403f3b0ac34SDag-Erling Smørgrav	  pgCC* | pgcpp*)
4404f3b0ac34SDag-Erling Smørgrav	    # Portland Group C++ compiler
4405f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4406f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4407f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4408f3b0ac34SDag-Erling Smørgrav	    ;;
4409f3b0ac34SDag-Erling Smørgrav	  cxx*)
4410f3b0ac34SDag-Erling Smørgrav	    # Compaq C++
4411f3b0ac34SDag-Erling Smørgrav	    # Make sure the PIC flag is empty.  It appears that all Alpha
4412f3b0ac34SDag-Erling Smørgrav	    # Linux and Compaq Tru64 Unix objects are PIC.
4413f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4414f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4415f3b0ac34SDag-Erling Smørgrav	    ;;
4416f3b0ac34SDag-Erling Smørgrav	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4417f3b0ac34SDag-Erling Smørgrav	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4418f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4419f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4420f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4421f3b0ac34SDag-Erling Smørgrav	    ;;
4422f3b0ac34SDag-Erling Smørgrav	  *)
4423*3ba4c8c8SDag-Erling Smørgrav	    case `$CC -V 2>&1 | $SED 5q` in
4424f3b0ac34SDag-Erling Smørgrav	    *Sun\ C*)
4425f3b0ac34SDag-Erling Smørgrav	      # Sun C++ 5.9
4426f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4427f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4428f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4429f3b0ac34SDag-Erling Smørgrav	      ;;
4430f3b0ac34SDag-Erling Smørgrav	    esac
4431f3b0ac34SDag-Erling Smørgrav	    ;;
4432f3b0ac34SDag-Erling Smørgrav	esac
4433f3b0ac34SDag-Erling Smørgrav	;;
4434f3b0ac34SDag-Erling Smørgrav      lynxos*)
4435f3b0ac34SDag-Erling Smørgrav	;;
4436f3b0ac34SDag-Erling Smørgrav      m88k*)
4437f3b0ac34SDag-Erling Smørgrav	;;
4438f3b0ac34SDag-Erling Smørgrav      mvs*)
4439f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4440f3b0ac34SDag-Erling Smørgrav	  cxx*)
4441f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4442f3b0ac34SDag-Erling Smørgrav	    ;;
4443f3b0ac34SDag-Erling Smørgrav	  *)
4444f3b0ac34SDag-Erling Smørgrav	    ;;
4445f3b0ac34SDag-Erling Smørgrav	esac
4446f3b0ac34SDag-Erling Smørgrav	;;
4447f3b0ac34SDag-Erling Smørgrav      netbsd*)
4448f3b0ac34SDag-Erling Smørgrav	;;
4449f3b0ac34SDag-Erling Smørgrav      *qnx* | *nto*)
4450f3b0ac34SDag-Erling Smørgrav        # QNX uses GNU C++, but need to define -shared option too, otherwise
4451f3b0ac34SDag-Erling Smørgrav        # it will coredump.
4452f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4453f3b0ac34SDag-Erling Smørgrav        ;;
4454f3b0ac34SDag-Erling Smørgrav      osf3* | osf4* | osf5*)
4455f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4456f3b0ac34SDag-Erling Smørgrav	  KCC*)
4457f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4458f3b0ac34SDag-Erling Smørgrav	    ;;
4459f3b0ac34SDag-Erling Smørgrav	  RCC*)
4460f3b0ac34SDag-Erling Smørgrav	    # Rational C++ 2.4.1
4461f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4462f3b0ac34SDag-Erling Smørgrav	    ;;
4463f3b0ac34SDag-Erling Smørgrav	  cxx*)
4464f3b0ac34SDag-Erling Smørgrav	    # Digital/Compaq C++
4465f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4466f3b0ac34SDag-Erling Smørgrav	    # Make sure the PIC flag is empty.  It appears that all Alpha
4467f3b0ac34SDag-Erling Smørgrav	    # Linux and Compaq Tru64 Unix objects are PIC.
4468f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4469f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4470f3b0ac34SDag-Erling Smørgrav	    ;;
4471f3b0ac34SDag-Erling Smørgrav	  *)
4472f3b0ac34SDag-Erling Smørgrav	    ;;
4473f3b0ac34SDag-Erling Smørgrav	esac
4474f3b0ac34SDag-Erling Smørgrav	;;
4475f3b0ac34SDag-Erling Smørgrav      psos*)
4476f3b0ac34SDag-Erling Smørgrav	;;
4477f3b0ac34SDag-Erling Smørgrav      solaris*)
4478f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4479f3b0ac34SDag-Erling Smørgrav	  CC* | sunCC*)
4480f3b0ac34SDag-Erling Smørgrav	    # Sun C++ 4.2, 5.x and Centerline C++
4481f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4482f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4483f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4484f3b0ac34SDag-Erling Smørgrav	    ;;
4485f3b0ac34SDag-Erling Smørgrav	  gcx*)
4486f3b0ac34SDag-Erling Smørgrav	    # Green Hills C++ Compiler
4487f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4488f3b0ac34SDag-Erling Smørgrav	    ;;
4489f3b0ac34SDag-Erling Smørgrav	  *)
4490f3b0ac34SDag-Erling Smørgrav	    ;;
4491f3b0ac34SDag-Erling Smørgrav	esac
4492f3b0ac34SDag-Erling Smørgrav	;;
4493f3b0ac34SDag-Erling Smørgrav      sunos4*)
4494f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4495f3b0ac34SDag-Erling Smørgrav	  CC*)
4496f3b0ac34SDag-Erling Smørgrav	    # Sun C++ 4.x
4497f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4498f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4499f3b0ac34SDag-Erling Smørgrav	    ;;
4500f3b0ac34SDag-Erling Smørgrav	  lcc*)
4501f3b0ac34SDag-Erling Smørgrav	    # Lucid
4502f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4503f3b0ac34SDag-Erling Smørgrav	    ;;
4504f3b0ac34SDag-Erling Smørgrav	  *)
4505f3b0ac34SDag-Erling Smørgrav	    ;;
4506f3b0ac34SDag-Erling Smørgrav	esac
4507f3b0ac34SDag-Erling Smørgrav	;;
4508f3b0ac34SDag-Erling Smørgrav      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4509f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4510f3b0ac34SDag-Erling Smørgrav	  CC*)
4511f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4512f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4513f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4514f3b0ac34SDag-Erling Smørgrav	    ;;
4515f3b0ac34SDag-Erling Smørgrav	esac
4516f3b0ac34SDag-Erling Smørgrav	;;
4517f3b0ac34SDag-Erling Smørgrav      tandem*)
4518f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
4519f3b0ac34SDag-Erling Smørgrav	  NCC*)
4520f3b0ac34SDag-Erling Smørgrav	    # NonStop-UX NCC 3.20
4521f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4522f3b0ac34SDag-Erling Smørgrav	    ;;
4523f3b0ac34SDag-Erling Smørgrav	  *)
4524f3b0ac34SDag-Erling Smørgrav	    ;;
4525f3b0ac34SDag-Erling Smørgrav	esac
4526f3b0ac34SDag-Erling Smørgrav	;;
4527f3b0ac34SDag-Erling Smørgrav      vxworks*)
4528f3b0ac34SDag-Erling Smørgrav	;;
4529f3b0ac34SDag-Erling Smørgrav      *)
4530f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4531f3b0ac34SDag-Erling Smørgrav	;;
4532f3b0ac34SDag-Erling Smørgrav    esac
4533f3b0ac34SDag-Erling Smørgrav  fi
4534f3b0ac34SDag-Erling Smørgrav],
4535f3b0ac34SDag-Erling Smørgrav[
4536f3b0ac34SDag-Erling Smørgrav  if test yes = "$GCC"; then
4537f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4538f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4539f3b0ac34SDag-Erling Smørgrav
4540f3b0ac34SDag-Erling Smørgrav    case $host_os in
4541f3b0ac34SDag-Erling Smørgrav      aix*)
4542f3b0ac34SDag-Erling Smørgrav      # All AIX code is PIC.
4543f3b0ac34SDag-Erling Smørgrav      if test ia64 = "$host_cpu"; then
4544f3b0ac34SDag-Erling Smørgrav	# AIX 5 now supports IA64 processor
4545f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4546f3b0ac34SDag-Erling Smørgrav      fi
4547f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4548f3b0ac34SDag-Erling Smørgrav      ;;
4549f3b0ac34SDag-Erling Smørgrav
4550f3b0ac34SDag-Erling Smørgrav    amigaos*)
4551f3b0ac34SDag-Erling Smørgrav      case $host_cpu in
4552f3b0ac34SDag-Erling Smørgrav      powerpc)
4553f3b0ac34SDag-Erling Smørgrav            # see comment about AmigaOS4 .so support
4554f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4555f3b0ac34SDag-Erling Smørgrav        ;;
4556f3b0ac34SDag-Erling Smørgrav      m68k)
4557f3b0ac34SDag-Erling Smørgrav            # FIXME: we need at least 68020 code to build shared libraries, but
4558f3b0ac34SDag-Erling Smørgrav            # adding the '-m68020' flag to GCC prevents building anything better,
4559f3b0ac34SDag-Erling Smørgrav            # like '-m68040'.
4560f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4561f3b0ac34SDag-Erling Smørgrav        ;;
4562f3b0ac34SDag-Erling Smørgrav      esac
4563f3b0ac34SDag-Erling Smørgrav      ;;
4564f3b0ac34SDag-Erling Smørgrav
4565f3b0ac34SDag-Erling Smørgrav    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4566f3b0ac34SDag-Erling Smørgrav      # PIC is the default for these OSes.
4567f3b0ac34SDag-Erling Smørgrav      ;;
4568f3b0ac34SDag-Erling Smørgrav
4569f3b0ac34SDag-Erling Smørgrav    mingw* | cygwin* | pw32* | os2* | cegcc*)
4570f3b0ac34SDag-Erling Smørgrav      # This hack is so that the source file can tell whether it is being
4571f3b0ac34SDag-Erling Smørgrav      # built for inclusion in a dll (and should export symbols for example).
4572f3b0ac34SDag-Erling Smørgrav      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4573f3b0ac34SDag-Erling Smørgrav      # (--disable-auto-import) libraries
4574f3b0ac34SDag-Erling Smørgrav      m4_if([$1], [GCJ], [],
4575f3b0ac34SDag-Erling Smørgrav	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4576f3b0ac34SDag-Erling Smørgrav      case $host_os in
4577f3b0ac34SDag-Erling Smørgrav      os2*)
4578f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4579f3b0ac34SDag-Erling Smørgrav	;;
4580f3b0ac34SDag-Erling Smørgrav      esac
4581f3b0ac34SDag-Erling Smørgrav      ;;
4582f3b0ac34SDag-Erling Smørgrav
4583f3b0ac34SDag-Erling Smørgrav    darwin* | rhapsody*)
4584f3b0ac34SDag-Erling Smørgrav      # PIC is the default on this platform
4585f3b0ac34SDag-Erling Smørgrav      # Common symbols not allowed in MH_DYLIB files
4586f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4587f3b0ac34SDag-Erling Smørgrav      ;;
4588f3b0ac34SDag-Erling Smørgrav
4589f3b0ac34SDag-Erling Smørgrav    haiku*)
4590f3b0ac34SDag-Erling Smørgrav      # PIC is the default for Haiku.
4591f3b0ac34SDag-Erling Smørgrav      # The "-static" flag exists, but is broken.
4592f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4593f3b0ac34SDag-Erling Smørgrav      ;;
4594f3b0ac34SDag-Erling Smørgrav
4595f3b0ac34SDag-Erling Smørgrav    hpux*)
4596f3b0ac34SDag-Erling Smørgrav      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4597f3b0ac34SDag-Erling Smørgrav      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4598f3b0ac34SDag-Erling Smørgrav      # sets the default TLS model and affects inlining.
4599f3b0ac34SDag-Erling Smørgrav      case $host_cpu in
4600f3b0ac34SDag-Erling Smørgrav      hppa*64*)
4601f3b0ac34SDag-Erling Smørgrav	# +Z the default
4602f3b0ac34SDag-Erling Smørgrav	;;
4603f3b0ac34SDag-Erling Smørgrav      *)
4604f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4605f3b0ac34SDag-Erling Smørgrav	;;
4606f3b0ac34SDag-Erling Smørgrav      esac
4607f3b0ac34SDag-Erling Smørgrav      ;;
4608f3b0ac34SDag-Erling Smørgrav
4609f3b0ac34SDag-Erling Smørgrav    interix[[3-9]]*)
4610f3b0ac34SDag-Erling Smørgrav      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4611f3b0ac34SDag-Erling Smørgrav      # Instead, we relocate shared libraries at runtime.
4612f3b0ac34SDag-Erling Smørgrav      ;;
4613f3b0ac34SDag-Erling Smørgrav
4614f3b0ac34SDag-Erling Smørgrav    msdosdjgpp*)
4615f3b0ac34SDag-Erling Smørgrav      # Just because we use GCC doesn't mean we suddenly get shared libraries
4616f3b0ac34SDag-Erling Smørgrav      # on systems that don't support them.
4617f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4618f3b0ac34SDag-Erling Smørgrav      enable_shared=no
4619f3b0ac34SDag-Erling Smørgrav      ;;
4620f3b0ac34SDag-Erling Smørgrav
4621f3b0ac34SDag-Erling Smørgrav    *nto* | *qnx*)
4622f3b0ac34SDag-Erling Smørgrav      # QNX uses GNU C++, but need to define -shared option too, otherwise
4623f3b0ac34SDag-Erling Smørgrav      # it will coredump.
4624f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4625f3b0ac34SDag-Erling Smørgrav      ;;
4626f3b0ac34SDag-Erling Smørgrav
4627f3b0ac34SDag-Erling Smørgrav    sysv4*MP*)
4628f3b0ac34SDag-Erling Smørgrav      if test -d /usr/nec; then
4629f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4630f3b0ac34SDag-Erling Smørgrav      fi
4631f3b0ac34SDag-Erling Smørgrav      ;;
4632f3b0ac34SDag-Erling Smørgrav
4633f3b0ac34SDag-Erling Smørgrav    *)
4634f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4635f3b0ac34SDag-Erling Smørgrav      ;;
4636f3b0ac34SDag-Erling Smørgrav    esac
4637f3b0ac34SDag-Erling Smørgrav
4638f3b0ac34SDag-Erling Smørgrav    case $cc_basename in
4639f3b0ac34SDag-Erling Smørgrav    nvcc*) # Cuda Compiler Driver 2.2
4640f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4641f3b0ac34SDag-Erling Smørgrav      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4642f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4643f3b0ac34SDag-Erling Smørgrav      fi
4644f3b0ac34SDag-Erling Smørgrav      ;;
4645f3b0ac34SDag-Erling Smørgrav    esac
4646f3b0ac34SDag-Erling Smørgrav  else
4647f3b0ac34SDag-Erling Smørgrav    # PORTME Check for flag to pass linker flags through the system compiler.
4648f3b0ac34SDag-Erling Smørgrav    case $host_os in
4649f3b0ac34SDag-Erling Smørgrav    aix*)
4650f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4651f3b0ac34SDag-Erling Smørgrav      if test ia64 = "$host_cpu"; then
4652f3b0ac34SDag-Erling Smørgrav	# AIX 5 now supports IA64 processor
4653f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4654f3b0ac34SDag-Erling Smørgrav      else
4655f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4656f3b0ac34SDag-Erling Smørgrav      fi
4657f3b0ac34SDag-Erling Smørgrav      ;;
4658f3b0ac34SDag-Erling Smørgrav
4659f3b0ac34SDag-Erling Smørgrav    darwin* | rhapsody*)
4660f3b0ac34SDag-Erling Smørgrav      # PIC is the default on this platform
4661f3b0ac34SDag-Erling Smørgrav      # Common symbols not allowed in MH_DYLIB files
4662f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4663f3b0ac34SDag-Erling Smørgrav      case $cc_basename in
4664f3b0ac34SDag-Erling Smørgrav      nagfor*)
4665f3b0ac34SDag-Erling Smørgrav        # NAG Fortran compiler
4666f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4667f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4668f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4669f3b0ac34SDag-Erling Smørgrav        ;;
4670f3b0ac34SDag-Erling Smørgrav      esac
4671f3b0ac34SDag-Erling Smørgrav      ;;
4672f3b0ac34SDag-Erling Smørgrav
4673f3b0ac34SDag-Erling Smørgrav    mingw* | cygwin* | pw32* | os2* | cegcc*)
4674f3b0ac34SDag-Erling Smørgrav      # This hack is so that the source file can tell whether it is being
4675f3b0ac34SDag-Erling Smørgrav      # built for inclusion in a dll (and should export symbols for example).
4676f3b0ac34SDag-Erling Smørgrav      m4_if([$1], [GCJ], [],
4677f3b0ac34SDag-Erling Smørgrav	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4678f3b0ac34SDag-Erling Smørgrav      case $host_os in
4679f3b0ac34SDag-Erling Smørgrav      os2*)
4680f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4681f3b0ac34SDag-Erling Smørgrav	;;
4682f3b0ac34SDag-Erling Smørgrav      esac
4683f3b0ac34SDag-Erling Smørgrav      ;;
4684f3b0ac34SDag-Erling Smørgrav
4685f3b0ac34SDag-Erling Smørgrav    hpux9* | hpux10* | hpux11*)
4686f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4687f3b0ac34SDag-Erling Smørgrav      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4688f3b0ac34SDag-Erling Smørgrav      # not for PA HP-UX.
4689f3b0ac34SDag-Erling Smørgrav      case $host_cpu in
4690f3b0ac34SDag-Erling Smørgrav      hppa*64*|ia64*)
4691f3b0ac34SDag-Erling Smørgrav	# +Z the default
4692f3b0ac34SDag-Erling Smørgrav	;;
4693f3b0ac34SDag-Erling Smørgrav      *)
4694f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4695f3b0ac34SDag-Erling Smørgrav	;;
4696f3b0ac34SDag-Erling Smørgrav      esac
4697f3b0ac34SDag-Erling Smørgrav      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4698f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4699f3b0ac34SDag-Erling Smørgrav      ;;
4700f3b0ac34SDag-Erling Smørgrav
4701f3b0ac34SDag-Erling Smørgrav    irix5* | irix6* | nonstopux*)
4702f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4703f3b0ac34SDag-Erling Smørgrav      # PIC (with -KPIC) is the default.
4704f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4705f3b0ac34SDag-Erling Smørgrav      ;;
4706f3b0ac34SDag-Erling Smørgrav
4707f3b0ac34SDag-Erling Smørgrav    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4708f3b0ac34SDag-Erling Smørgrav      case $cc_basename in
4709f3b0ac34SDag-Erling Smørgrav      # old Intel for x86_64, which still supported -KPIC.
4710f3b0ac34SDag-Erling Smørgrav      ecc*)
4711f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4712f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4713f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4714f3b0ac34SDag-Erling Smørgrav        ;;
4715f3b0ac34SDag-Erling Smørgrav      # icc used to be incompatible with GCC.
4716f3b0ac34SDag-Erling Smørgrav      # ICC 10 doesn't accept -KPIC any more.
4717f3b0ac34SDag-Erling Smørgrav      icc* | ifort*)
4718f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4719f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4720f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4721f3b0ac34SDag-Erling Smørgrav        ;;
4722f3b0ac34SDag-Erling Smørgrav      # Lahey Fortran 8.1.
4723f3b0ac34SDag-Erling Smørgrav      lf95*)
4724f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4725f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4726f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4727f3b0ac34SDag-Erling Smørgrav	;;
4728f3b0ac34SDag-Erling Smørgrav      nagfor*)
4729f3b0ac34SDag-Erling Smørgrav	# NAG Fortran compiler
4730f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4731f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4732f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4733f3b0ac34SDag-Erling Smørgrav	;;
4734f3b0ac34SDag-Erling Smørgrav      tcc*)
4735f3b0ac34SDag-Erling Smørgrav	# Fabrice Bellard et al's Tiny C Compiler
4736f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4737f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4738f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4739f3b0ac34SDag-Erling Smørgrav	;;
4740f3b0ac34SDag-Erling Smørgrav      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4741f3b0ac34SDag-Erling Smørgrav        # Portland Group compilers (*not* the Pentium gcc compiler,
4742f3b0ac34SDag-Erling Smørgrav	# which looks to be a dead project)
4743f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4744f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4745f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4746f3b0ac34SDag-Erling Smørgrav        ;;
4747f3b0ac34SDag-Erling Smørgrav      ccc*)
4748f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4749f3b0ac34SDag-Erling Smørgrav        # All Alpha code is PIC.
4750f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4751f3b0ac34SDag-Erling Smørgrav        ;;
4752f3b0ac34SDag-Erling Smørgrav      xl* | bgxl* | bgf* | mpixl*)
4753f3b0ac34SDag-Erling Smørgrav	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4754f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4755f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4756f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4757f3b0ac34SDag-Erling Smørgrav	;;
4758f3b0ac34SDag-Erling Smørgrav      *)
4759*3ba4c8c8SDag-Erling Smørgrav	case `$CC -V 2>&1 | $SED 5q` in
4760f3b0ac34SDag-Erling Smørgrav	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4761f3b0ac34SDag-Erling Smørgrav	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4762f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4763f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4764f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4765f3b0ac34SDag-Erling Smørgrav	  ;;
4766f3b0ac34SDag-Erling Smørgrav	*Sun\ F* | *Sun*Fortran*)
4767f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4768f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4769f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4770f3b0ac34SDag-Erling Smørgrav	  ;;
4771f3b0ac34SDag-Erling Smørgrav	*Sun\ C*)
4772f3b0ac34SDag-Erling Smørgrav	  # Sun C 5.9
4773f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4774f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4775f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4776f3b0ac34SDag-Erling Smørgrav	  ;;
4777f3b0ac34SDag-Erling Smørgrav        *Intel*\ [[CF]]*Compiler*)
4778f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4779f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4780f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4781f3b0ac34SDag-Erling Smørgrav	  ;;
4782f3b0ac34SDag-Erling Smørgrav	*Portland\ Group*)
4783f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4784f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4785f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4786f3b0ac34SDag-Erling Smørgrav	  ;;
4787f3b0ac34SDag-Erling Smørgrav	esac
4788f3b0ac34SDag-Erling Smørgrav	;;
4789f3b0ac34SDag-Erling Smørgrav      esac
4790f3b0ac34SDag-Erling Smørgrav      ;;
4791f3b0ac34SDag-Erling Smørgrav
4792f3b0ac34SDag-Erling Smørgrav    newsos6)
4793f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4794f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4795f3b0ac34SDag-Erling Smørgrav      ;;
4796f3b0ac34SDag-Erling Smørgrav
4797f3b0ac34SDag-Erling Smørgrav    *nto* | *qnx*)
4798f3b0ac34SDag-Erling Smørgrav      # QNX uses GNU C++, but need to define -shared option too, otherwise
4799f3b0ac34SDag-Erling Smørgrav      # it will coredump.
4800f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4801f3b0ac34SDag-Erling Smørgrav      ;;
4802f3b0ac34SDag-Erling Smørgrav
4803f3b0ac34SDag-Erling Smørgrav    osf3* | osf4* | osf5*)
4804f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4805f3b0ac34SDag-Erling Smørgrav      # All OSF/1 code is PIC.
4806f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4807f3b0ac34SDag-Erling Smørgrav      ;;
4808f3b0ac34SDag-Erling Smørgrav
4809f3b0ac34SDag-Erling Smørgrav    rdos*)
4810f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4811f3b0ac34SDag-Erling Smørgrav      ;;
4812f3b0ac34SDag-Erling Smørgrav
4813f3b0ac34SDag-Erling Smørgrav    solaris*)
4814f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4815f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4816f3b0ac34SDag-Erling Smørgrav      case $cc_basename in
4817f3b0ac34SDag-Erling Smørgrav      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4818f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4819f3b0ac34SDag-Erling Smørgrav      *)
4820f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4821f3b0ac34SDag-Erling Smørgrav      esac
4822f3b0ac34SDag-Erling Smørgrav      ;;
4823f3b0ac34SDag-Erling Smørgrav
4824f3b0ac34SDag-Erling Smørgrav    sunos4*)
4825f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4826f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4827f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4828f3b0ac34SDag-Erling Smørgrav      ;;
4829f3b0ac34SDag-Erling Smørgrav
4830f3b0ac34SDag-Erling Smørgrav    sysv4 | sysv4.2uw2* | sysv4.3*)
4831f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4832f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4833f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4834f3b0ac34SDag-Erling Smørgrav      ;;
4835f3b0ac34SDag-Erling Smørgrav
4836f3b0ac34SDag-Erling Smørgrav    sysv4*MP*)
4837f3b0ac34SDag-Erling Smørgrav      if test -d /usr/nec; then
4838f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4839f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4840f3b0ac34SDag-Erling Smørgrav      fi
4841f3b0ac34SDag-Erling Smørgrav      ;;
4842f3b0ac34SDag-Erling Smørgrav
4843f3b0ac34SDag-Erling Smørgrav    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4844f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4845f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4846f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4847f3b0ac34SDag-Erling Smørgrav      ;;
4848f3b0ac34SDag-Erling Smørgrav
4849f3b0ac34SDag-Erling Smørgrav    unicos*)
4850f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4851f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4852f3b0ac34SDag-Erling Smørgrav      ;;
4853f3b0ac34SDag-Erling Smørgrav
4854f3b0ac34SDag-Erling Smørgrav    uts4*)
4855f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4856f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4857f3b0ac34SDag-Erling Smørgrav      ;;
4858f3b0ac34SDag-Erling Smørgrav
4859f3b0ac34SDag-Erling Smørgrav    *)
4860f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4861f3b0ac34SDag-Erling Smørgrav      ;;
4862f3b0ac34SDag-Erling Smørgrav    esac
4863f3b0ac34SDag-Erling Smørgrav  fi
4864f3b0ac34SDag-Erling Smørgrav])
4865f3b0ac34SDag-Erling Smørgravcase $host_os in
4866f3b0ac34SDag-Erling Smørgrav  # For platforms that do not support PIC, -DPIC is meaningless:
4867f3b0ac34SDag-Erling Smørgrav  *djgpp*)
4868f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4869f3b0ac34SDag-Erling Smørgrav    ;;
4870f3b0ac34SDag-Erling Smørgrav  *)
4871f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4872f3b0ac34SDag-Erling Smørgrav    ;;
4873f3b0ac34SDag-Erling Smørgravesac
4874f3b0ac34SDag-Erling Smørgrav
4875f3b0ac34SDag-Erling SmørgravAC_CACHE_CHECK([for $compiler option to produce PIC],
4876f3b0ac34SDag-Erling Smørgrav  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4877f3b0ac34SDag-Erling Smørgrav  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4878f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4879f3b0ac34SDag-Erling Smørgrav
4880f3b0ac34SDag-Erling Smørgrav#
4881f3b0ac34SDag-Erling Smørgrav# Check to make sure the PIC flag actually works.
4882f3b0ac34SDag-Erling Smørgrav#
4883f3b0ac34SDag-Erling Smørgravif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4884f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4885f3b0ac34SDag-Erling Smørgrav    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4886f3b0ac34SDag-Erling Smørgrav    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4887f3b0ac34SDag-Erling Smørgrav    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4888f3b0ac34SDag-Erling Smørgrav     "" | " "*) ;;
4889f3b0ac34SDag-Erling Smørgrav     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4890f3b0ac34SDag-Erling Smørgrav     esac],
4891f3b0ac34SDag-Erling Smørgrav    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4892f3b0ac34SDag-Erling Smørgrav     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4893f3b0ac34SDag-Erling Smørgravfi
4894f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4895f3b0ac34SDag-Erling Smørgrav	[Additional compiler flags for building library objects])
4896f3b0ac34SDag-Erling Smørgrav
4897f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4898f3b0ac34SDag-Erling Smørgrav	[How to pass a linker flag through the compiler])
4899f3b0ac34SDag-Erling Smørgrav#
4900f3b0ac34SDag-Erling Smørgrav# Check to make sure the static flag actually works.
4901f3b0ac34SDag-Erling Smørgrav#
4902f3b0ac34SDag-Erling Smørgravwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4903f3b0ac34SDag-Erling Smørgrav_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4904f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4905f3b0ac34SDag-Erling Smørgrav  $lt_tmp_static_flag,
4906f3b0ac34SDag-Erling Smørgrav  [],
4907f3b0ac34SDag-Erling Smørgrav  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4908f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4909f3b0ac34SDag-Erling Smørgrav	[Compiler flag to prevent dynamic linking])
4910f3b0ac34SDag-Erling Smørgrav])# _LT_COMPILER_PIC
4911f3b0ac34SDag-Erling Smørgrav
4912f3b0ac34SDag-Erling Smørgrav
4913f3b0ac34SDag-Erling Smørgrav# _LT_LINKER_SHLIBS([TAGNAME])
4914f3b0ac34SDag-Erling Smørgrav# ----------------------------
4915f3b0ac34SDag-Erling Smørgrav# See if the linker supports building shared libraries.
4916f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LINKER_SHLIBS],
4917f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([LT_PATH_LD])dnl
4918f3b0ac34SDag-Erling SmørgravAC_REQUIRE([LT_PATH_NM])dnl
4919f3b0ac34SDag-Erling Smørgravm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4920f3b0ac34SDag-Erling Smørgravm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4921f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_EGREP])dnl
4922f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_SED])dnl
4923f3b0ac34SDag-Erling Smørgravm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4924f3b0ac34SDag-Erling Smørgravm4_require([_LT_TAG_COMPILER])dnl
4925f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4926f3b0ac34SDag-Erling Smørgravm4_if([$1], [CXX], [
4927f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4928f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4929f3b0ac34SDag-Erling Smørgrav  case $host_os in
4930f3b0ac34SDag-Erling Smørgrav  aix[[4-9]]*)
4931f3b0ac34SDag-Erling Smørgrav    # If we're using GNU nm, then we don't want the "-C" option.
4932f3b0ac34SDag-Erling Smørgrav    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4933f3b0ac34SDag-Erling Smørgrav    # Without the "-l" option, or with the "-B" option, AIX nm treats
4934f3b0ac34SDag-Erling Smørgrav    # weak defined symbols like other global defined symbols, whereas
4935f3b0ac34SDag-Erling Smørgrav    # GNU nm marks them as "W".
4936f3b0ac34SDag-Erling Smørgrav    # While the 'weak' keyword is ignored in the Export File, we need
4937f3b0ac34SDag-Erling Smørgrav    # it in the Import File for the 'aix-soname' feature, so we have
4938f3b0ac34SDag-Erling Smørgrav    # to replace the "-B" option with "-P" for AIX nm.
4939f3b0ac34SDag-Erling Smørgrav    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4940f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
4941f3b0ac34SDag-Erling Smørgrav    else
4942*3ba4c8c8SDag-Erling Smørgrav      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
4943f3b0ac34SDag-Erling Smørgrav    fi
4944f3b0ac34SDag-Erling Smørgrav    ;;
4945f3b0ac34SDag-Erling Smørgrav  pw32*)
4946f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4947f3b0ac34SDag-Erling Smørgrav    ;;
4948f3b0ac34SDag-Erling Smørgrav  cygwin* | mingw* | cegcc*)
4949f3b0ac34SDag-Erling Smørgrav    case $cc_basename in
4950*3ba4c8c8SDag-Erling Smørgrav    cl* | icl*)
4951f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4952f3b0ac34SDag-Erling Smørgrav      ;;
4953f3b0ac34SDag-Erling Smørgrav    *)
4954f3b0ac34SDag-Erling Smørgrav      _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'
4955f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4956f3b0ac34SDag-Erling Smørgrav      ;;
4957f3b0ac34SDag-Erling Smørgrav    esac
4958f3b0ac34SDag-Erling Smørgrav    ;;
4959f3b0ac34SDag-Erling Smørgrav  *)
4960f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4961f3b0ac34SDag-Erling Smørgrav    ;;
4962f3b0ac34SDag-Erling Smørgrav  esac
4963f3b0ac34SDag-Erling Smørgrav], [
4964f3b0ac34SDag-Erling Smørgrav  runpath_var=
4965f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(allow_undefined_flag, $1)=
4966f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(always_export_symbols, $1)=no
4967f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(archive_cmds, $1)=
4968f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(archive_expsym_cmds, $1)=
4969f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(compiler_needs_object, $1)=no
4970f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4971f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4972f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4973f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_automatic, $1)=no
4974f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_direct, $1)=no
4975f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4976f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4977f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4978f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_minus_L, $1)=no
4979f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4980f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(inherit_rpath, $1)=no
4981f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4982f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(module_cmds, $1)=
4983f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(module_expsym_cmds, $1)=
4984f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4985f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4986f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4987f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4988f3b0ac34SDag-Erling Smørgrav  # include_expsyms should be a list of space-separated symbols to be *always*
4989f3b0ac34SDag-Erling Smørgrav  # included in the symbol list
4990f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(include_expsyms, $1)=
4991f3b0ac34SDag-Erling Smørgrav  # exclude_expsyms can be an extended regexp of symbols to exclude
4992f3b0ac34SDag-Erling Smørgrav  # it will be wrapped by ' (' and ')$', so one must not match beginning or
4993f3b0ac34SDag-Erling Smørgrav  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4994f3b0ac34SDag-Erling Smørgrav  # as well as any symbol that contains 'd'.
4995f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4996f3b0ac34SDag-Erling Smørgrav  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4997f3b0ac34SDag-Erling Smørgrav  # platforms (ab)use it in PIC code, but their linkers get confused if
4998f3b0ac34SDag-Erling Smørgrav  # the symbol is explicitly referenced.  Since portable code cannot
4999f3b0ac34SDag-Erling Smørgrav  # rely on this symbol name, it's probably fine to never include it in
5000f3b0ac34SDag-Erling Smørgrav  # preloaded symbol tables.
5001f3b0ac34SDag-Erling Smørgrav  # Exclude shared library initialization/finalization symbols.
5002f3b0ac34SDag-Erling Smørgravdnl Note also adjust exclude_expsyms for C++ above.
5003f3b0ac34SDag-Erling Smørgrav  extract_expsyms_cmds=
5004f3b0ac34SDag-Erling Smørgrav
5005f3b0ac34SDag-Erling Smørgrav  case $host_os in
5006f3b0ac34SDag-Erling Smørgrav  cygwin* | mingw* | pw32* | cegcc*)
5007*3ba4c8c8SDag-Erling Smørgrav    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
5008f3b0ac34SDag-Erling Smørgrav    # When not using gcc, we currently assume that we are using
5009*3ba4c8c8SDag-Erling Smørgrav    # Microsoft Visual C++ or Intel C++ Compiler.
5010f3b0ac34SDag-Erling Smørgrav    if test yes != "$GCC"; then
5011f3b0ac34SDag-Erling Smørgrav      with_gnu_ld=no
5012f3b0ac34SDag-Erling Smørgrav    fi
5013f3b0ac34SDag-Erling Smørgrav    ;;
5014f3b0ac34SDag-Erling Smørgrav  interix*)
5015*3ba4c8c8SDag-Erling Smørgrav    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
5016f3b0ac34SDag-Erling Smørgrav    with_gnu_ld=yes
5017f3b0ac34SDag-Erling Smørgrav    ;;
5018f3b0ac34SDag-Erling Smørgrav  openbsd* | bitrig*)
5019f3b0ac34SDag-Erling Smørgrav    with_gnu_ld=no
5020f3b0ac34SDag-Erling Smørgrav    ;;
5021f3b0ac34SDag-Erling Smørgrav  esac
5022f3b0ac34SDag-Erling Smørgrav
5023f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(ld_shlibs, $1)=yes
5024f3b0ac34SDag-Erling Smørgrav
5025f3b0ac34SDag-Erling Smørgrav  # On some targets, GNU ld is compatible enough with the native linker
5026f3b0ac34SDag-Erling Smørgrav  # that we're better off using the native interface for both.
5027f3b0ac34SDag-Erling Smørgrav  lt_use_gnu_ld_interface=no
5028f3b0ac34SDag-Erling Smørgrav  if test yes = "$with_gnu_ld"; then
5029f3b0ac34SDag-Erling Smørgrav    case $host_os in
5030f3b0ac34SDag-Erling Smørgrav      aix*)
5031f3b0ac34SDag-Erling Smørgrav	# The AIX port of GNU ld has always aspired to compatibility
5032f3b0ac34SDag-Erling Smørgrav	# with the native linker.  However, as the warning in the GNU ld
5033f3b0ac34SDag-Erling Smørgrav	# block says, versions before 2.19.5* couldn't really create working
5034f3b0ac34SDag-Erling Smørgrav	# shared libraries, regardless of the interface used.
5035f3b0ac34SDag-Erling Smørgrav	case `$LD -v 2>&1` in
5036f3b0ac34SDag-Erling Smørgrav	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5037f3b0ac34SDag-Erling Smørgrav	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5038f3b0ac34SDag-Erling Smørgrav	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5039f3b0ac34SDag-Erling Smørgrav	  *)
5040f3b0ac34SDag-Erling Smørgrav	    lt_use_gnu_ld_interface=yes
5041f3b0ac34SDag-Erling Smørgrav	    ;;
5042f3b0ac34SDag-Erling Smørgrav	esac
5043f3b0ac34SDag-Erling Smørgrav	;;
5044f3b0ac34SDag-Erling Smørgrav      *)
5045f3b0ac34SDag-Erling Smørgrav	lt_use_gnu_ld_interface=yes
5046f3b0ac34SDag-Erling Smørgrav	;;
5047f3b0ac34SDag-Erling Smørgrav    esac
5048f3b0ac34SDag-Erling Smørgrav  fi
5049f3b0ac34SDag-Erling Smørgrav
5050f3b0ac34SDag-Erling Smørgrav  if test yes = "$lt_use_gnu_ld_interface"; then
5051f3b0ac34SDag-Erling Smørgrav    # If archive_cmds runs LD, not CC, wlarc should be empty
5052f3b0ac34SDag-Erling Smørgrav    wlarc='$wl'
5053f3b0ac34SDag-Erling Smørgrav
5054f3b0ac34SDag-Erling Smørgrav    # Set some defaults for GNU ld with shared library support. These
5055f3b0ac34SDag-Erling Smørgrav    # are reset later if shared libraries are not supported. Putting them
5056f3b0ac34SDag-Erling Smørgrav    # here allows them to be overridden if necessary.
5057f3b0ac34SDag-Erling Smørgrav    runpath_var=LD_RUN_PATH
5058f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5059f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5060f3b0ac34SDag-Erling Smørgrav    # ancient GNU ld didn't support --whole-archive et. al.
5061f3b0ac34SDag-Erling Smørgrav    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5062f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5063f3b0ac34SDag-Erling Smørgrav    else
5064f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5065f3b0ac34SDag-Erling Smørgrav    fi
5066f3b0ac34SDag-Erling Smørgrav    supports_anon_versioning=no
5067*3ba4c8c8SDag-Erling Smørgrav    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
5068f3b0ac34SDag-Erling Smørgrav      *GNU\ gold*) supports_anon_versioning=yes ;;
5069f3b0ac34SDag-Erling Smørgrav      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5070f3b0ac34SDag-Erling Smørgrav      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5071f3b0ac34SDag-Erling Smørgrav      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5072f3b0ac34SDag-Erling Smørgrav      *\ 2.11.*) ;; # other 2.11 versions
5073f3b0ac34SDag-Erling Smørgrav      *) supports_anon_versioning=yes ;;
5074f3b0ac34SDag-Erling Smørgrav    esac
5075f3b0ac34SDag-Erling Smørgrav
5076f3b0ac34SDag-Erling Smørgrav    # See if GNU ld supports shared libraries.
5077f3b0ac34SDag-Erling Smørgrav    case $host_os in
5078f3b0ac34SDag-Erling Smørgrav    aix[[3-9]]*)
5079f3b0ac34SDag-Erling Smørgrav      # On AIX/PPC, the GNU linker is very broken
5080f3b0ac34SDag-Erling Smørgrav      if test ia64 != "$host_cpu"; then
5081f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
5082f3b0ac34SDag-Erling Smørgrav	cat <<_LT_EOF 1>&2
5083f3b0ac34SDag-Erling Smørgrav
5084f3b0ac34SDag-Erling Smørgrav*** Warning: the GNU linker, at least up to release 2.19, is reported
5085f3b0ac34SDag-Erling Smørgrav*** to be unable to reliably create shared libraries on AIX.
5086f3b0ac34SDag-Erling Smørgrav*** Therefore, libtool is disabling shared libraries support.  If you
5087f3b0ac34SDag-Erling Smørgrav*** really care for shared libraries, you may want to install binutils
5088f3b0ac34SDag-Erling Smørgrav*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5089f3b0ac34SDag-Erling Smørgrav*** You will then need to restart the configuration process.
5090f3b0ac34SDag-Erling Smørgrav
5091f3b0ac34SDag-Erling Smørgrav_LT_EOF
5092f3b0ac34SDag-Erling Smørgrav      fi
5093f3b0ac34SDag-Erling Smørgrav      ;;
5094f3b0ac34SDag-Erling Smørgrav
5095f3b0ac34SDag-Erling Smørgrav    amigaos*)
5096f3b0ac34SDag-Erling Smørgrav      case $host_cpu in
5097f3b0ac34SDag-Erling Smørgrav      powerpc)
5098f3b0ac34SDag-Erling Smørgrav            # see comment about AmigaOS4 .so support
5099f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5100f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5101f3b0ac34SDag-Erling Smørgrav        ;;
5102f3b0ac34SDag-Erling Smørgrav      m68k)
5103f3b0ac34SDag-Erling Smørgrav            _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)'
5104f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5105f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5106f3b0ac34SDag-Erling Smørgrav        ;;
5107f3b0ac34SDag-Erling Smørgrav      esac
5108f3b0ac34SDag-Erling Smørgrav      ;;
5109f3b0ac34SDag-Erling Smørgrav
5110f3b0ac34SDag-Erling Smørgrav    beos*)
5111f3b0ac34SDag-Erling Smørgrav      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5112f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5113f3b0ac34SDag-Erling Smørgrav	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5114f3b0ac34SDag-Erling Smørgrav	# support --undefined.  This deserves some investigation.  FIXME
5115f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5116f3b0ac34SDag-Erling Smørgrav      else
5117f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
5118f3b0ac34SDag-Erling Smørgrav      fi
5119f3b0ac34SDag-Erling Smørgrav      ;;
5120f3b0ac34SDag-Erling Smørgrav
5121f3b0ac34SDag-Erling Smørgrav    cygwin* | mingw* | pw32* | cegcc*)
5122f3b0ac34SDag-Erling Smørgrav      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5123f3b0ac34SDag-Erling Smørgrav      # as there is no search path for DLLs.
5124f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5125f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5126f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5127f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(always_export_symbols, $1)=no
5128f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5129f3b0ac34SDag-Erling Smørgrav      _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'
5130f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5131f3b0ac34SDag-Erling Smørgrav
5132f3b0ac34SDag-Erling Smørgrav      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5133f3b0ac34SDag-Erling Smørgrav        _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'
5134f3b0ac34SDag-Erling Smørgrav	# If the export-symbols file already is a .def file, use it as
5135f3b0ac34SDag-Erling Smørgrav	# is; otherwise, prepend EXPORTS...
5136f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5137f3b0ac34SDag-Erling Smørgrav          cp $export_symbols $output_objdir/$soname.def;
5138f3b0ac34SDag-Erling Smørgrav        else
5139f3b0ac34SDag-Erling Smørgrav          echo EXPORTS > $output_objdir/$soname.def;
5140f3b0ac34SDag-Erling Smørgrav          cat $export_symbols >> $output_objdir/$soname.def;
5141f3b0ac34SDag-Erling Smørgrav        fi~
5142f3b0ac34SDag-Erling Smørgrav        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5143f3b0ac34SDag-Erling Smørgrav      else
5144f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
5145f3b0ac34SDag-Erling Smørgrav      fi
5146f3b0ac34SDag-Erling Smørgrav      ;;
5147f3b0ac34SDag-Erling Smørgrav
5148f3b0ac34SDag-Erling Smørgrav    haiku*)
5149f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5150f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(link_all_deplibs, $1)=yes
5151f3b0ac34SDag-Erling Smørgrav      ;;
5152f3b0ac34SDag-Erling Smørgrav
5153f3b0ac34SDag-Erling Smørgrav    os2*)
5154f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5155f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5156f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5157f3b0ac34SDag-Erling Smørgrav      shrext_cmds=.dll
5158f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5159f3b0ac34SDag-Erling Smørgrav	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5160f3b0ac34SDag-Erling Smørgrav	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5161f3b0ac34SDag-Erling Smørgrav	$ECHO EXPORTS >> $output_objdir/$libname.def~
5162f3b0ac34SDag-Erling Smørgrav	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5163f3b0ac34SDag-Erling Smørgrav	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5164f3b0ac34SDag-Erling Smørgrav	emximp -o $lib $output_objdir/$libname.def'
5165f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5166f3b0ac34SDag-Erling Smørgrav	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5167f3b0ac34SDag-Erling Smørgrav	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5168f3b0ac34SDag-Erling Smørgrav	$ECHO EXPORTS >> $output_objdir/$libname.def~
5169f3b0ac34SDag-Erling Smørgrav	prefix_cmds="$SED"~
5170f3b0ac34SDag-Erling Smørgrav	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5171f3b0ac34SDag-Erling Smørgrav	  prefix_cmds="$prefix_cmds -e 1d";
5172f3b0ac34SDag-Erling Smørgrav	fi~
5173f3b0ac34SDag-Erling Smørgrav	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5174f3b0ac34SDag-Erling Smørgrav	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5175f3b0ac34SDag-Erling Smørgrav	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5176f3b0ac34SDag-Erling Smørgrav	emximp -o $lib $output_objdir/$libname.def'
5177f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5178f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5179*3ba4c8c8SDag-Erling Smørgrav      _LT_TAGVAR(file_list_spec, $1)='@'
5180f3b0ac34SDag-Erling Smørgrav      ;;
5181f3b0ac34SDag-Erling Smørgrav
5182f3b0ac34SDag-Erling Smørgrav    interix[[3-9]]*)
5183f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=no
5184f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5185f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5186f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5187f3b0ac34SDag-Erling Smørgrav      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5188f3b0ac34SDag-Erling Smørgrav      # Instead, shared libraries are loaded at an image base (0x10000000 by
5189f3b0ac34SDag-Erling Smørgrav      # default) and relocated if they conflict, which is a slow very memory
5190f3b0ac34SDag-Erling Smørgrav      # consuming and fragmenting process.  To avoid this, we pick a random,
5191f3b0ac34SDag-Erling Smørgrav      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5192f3b0ac34SDag-Erling Smørgrav      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5193f3b0ac34SDag-Erling Smørgrav      _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'
5194*3ba4c8c8SDag-Erling Smørgrav      _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'
5195f3b0ac34SDag-Erling Smørgrav      ;;
5196f3b0ac34SDag-Erling Smørgrav
5197f3b0ac34SDag-Erling Smørgrav    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5198f3b0ac34SDag-Erling Smørgrav      tmp_diet=no
5199f3b0ac34SDag-Erling Smørgrav      if test linux-dietlibc = "$host_os"; then
5200f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
5201f3b0ac34SDag-Erling Smørgrav	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5202f3b0ac34SDag-Erling Smørgrav	esac
5203f3b0ac34SDag-Erling Smørgrav      fi
5204f3b0ac34SDag-Erling Smørgrav      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5205f3b0ac34SDag-Erling Smørgrav	 && test no = "$tmp_diet"
5206f3b0ac34SDag-Erling Smørgrav      then
5207f3b0ac34SDag-Erling Smørgrav	tmp_addflag=' $pic_flag'
5208f3b0ac34SDag-Erling Smørgrav	tmp_sharedflag='-shared'
5209f3b0ac34SDag-Erling Smørgrav	case $cc_basename,$host_cpu in
5210f3b0ac34SDag-Erling Smørgrav        pgcc*)				# Portland Group C compiler
5211f3b0ac34SDag-Erling Smørgrav	  _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'
5212f3b0ac34SDag-Erling Smørgrav	  tmp_addflag=' $pic_flag'
5213f3b0ac34SDag-Erling Smørgrav	  ;;
5214f3b0ac34SDag-Erling Smørgrav	pgf77* | pgf90* | pgf95* | pgfortran*)
5215f3b0ac34SDag-Erling Smørgrav					# Portland Group f77 and f90 compilers
5216f3b0ac34SDag-Erling Smørgrav	  _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'
5217f3b0ac34SDag-Erling Smørgrav	  tmp_addflag=' $pic_flag -Mnomain' ;;
5218f3b0ac34SDag-Erling Smørgrav	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5219f3b0ac34SDag-Erling Smørgrav	  tmp_addflag=' -i_dynamic' ;;
5220f3b0ac34SDag-Erling Smørgrav	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5221f3b0ac34SDag-Erling Smørgrav	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5222f3b0ac34SDag-Erling Smørgrav	ifc* | ifort*)			# Intel Fortran compiler
5223f3b0ac34SDag-Erling Smørgrav	  tmp_addflag=' -nofor_main' ;;
5224f3b0ac34SDag-Erling Smørgrav	lf95*)				# Lahey Fortran 8.1
5225f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5226f3b0ac34SDag-Erling Smørgrav	  tmp_sharedflag='--shared' ;;
5227f3b0ac34SDag-Erling Smørgrav        nagfor*)                        # NAGFOR 5.3
5228f3b0ac34SDag-Erling Smørgrav          tmp_sharedflag='-Wl,-shared' ;;
5229f3b0ac34SDag-Erling Smørgrav	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5230f3b0ac34SDag-Erling Smørgrav	  tmp_sharedflag='-qmkshrobj'
5231f3b0ac34SDag-Erling Smørgrav	  tmp_addflag= ;;
5232f3b0ac34SDag-Erling Smørgrav	nvcc*)	# Cuda Compiler Driver 2.2
5233f3b0ac34SDag-Erling Smørgrav	  _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'
5234f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5235f3b0ac34SDag-Erling Smørgrav	  ;;
5236f3b0ac34SDag-Erling Smørgrav	esac
5237*3ba4c8c8SDag-Erling Smørgrav	case `$CC -V 2>&1 | $SED 5q` in
5238f3b0ac34SDag-Erling Smørgrav	*Sun\ C*)			# Sun C 5.9
5239f3b0ac34SDag-Erling Smørgrav	  _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'
5240f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5241f3b0ac34SDag-Erling Smørgrav	  tmp_sharedflag='-G' ;;
5242f3b0ac34SDag-Erling Smørgrav	*Sun\ F*)			# Sun Fortran 8.3
5243f3b0ac34SDag-Erling Smørgrav	  tmp_sharedflag='-G' ;;
5244f3b0ac34SDag-Erling Smørgrav	esac
5245f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5246f3b0ac34SDag-Erling Smørgrav
5247f3b0ac34SDag-Erling Smørgrav        if test yes = "$supports_anon_versioning"; then
5248f3b0ac34SDag-Erling Smørgrav          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5249*3ba4c8c8SDag-Erling Smørgrav            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5250f3b0ac34SDag-Erling Smørgrav            echo "local: *; };" >> $output_objdir/$libname.ver~
5251f3b0ac34SDag-Erling Smørgrav            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5252f3b0ac34SDag-Erling Smørgrav        fi
5253f3b0ac34SDag-Erling Smørgrav
5254f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
5255f3b0ac34SDag-Erling Smørgrav	tcc*)
5256f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5257f3b0ac34SDag-Erling Smørgrav	  ;;
5258f3b0ac34SDag-Erling Smørgrav	xlf* | bgf* | bgxlf* | mpixlf*)
5259f3b0ac34SDag-Erling Smørgrav	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5260f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5261f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5262f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5263f3b0ac34SDag-Erling Smørgrav	  if test yes = "$supports_anon_versioning"; then
5264f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5265*3ba4c8c8SDag-Erling Smørgrav              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5266f3b0ac34SDag-Erling Smørgrav              echo "local: *; };" >> $output_objdir/$libname.ver~
5267f3b0ac34SDag-Erling Smørgrav              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5268f3b0ac34SDag-Erling Smørgrav	  fi
5269f3b0ac34SDag-Erling Smørgrav	  ;;
5270f3b0ac34SDag-Erling Smørgrav	esac
5271f3b0ac34SDag-Erling Smørgrav      else
5272f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=no
5273f3b0ac34SDag-Erling Smørgrav      fi
5274f3b0ac34SDag-Erling Smørgrav      ;;
5275f3b0ac34SDag-Erling Smørgrav
5276f3b0ac34SDag-Erling Smørgrav    netbsd*)
5277f3b0ac34SDag-Erling Smørgrav      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5278f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5279f3b0ac34SDag-Erling Smørgrav	wlarc=
5280f3b0ac34SDag-Erling Smørgrav      else
5281f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5282f3b0ac34SDag-Erling Smørgrav	_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'
5283f3b0ac34SDag-Erling Smørgrav      fi
5284f3b0ac34SDag-Erling Smørgrav      ;;
5285f3b0ac34SDag-Erling Smørgrav
5286f3b0ac34SDag-Erling Smørgrav    solaris*)
5287f3b0ac34SDag-Erling Smørgrav      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5288f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
5289f3b0ac34SDag-Erling Smørgrav	cat <<_LT_EOF 1>&2
5290f3b0ac34SDag-Erling Smørgrav
5291f3b0ac34SDag-Erling Smørgrav*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5292f3b0ac34SDag-Erling Smørgrav*** create shared libraries on Solaris systems.  Therefore, libtool
5293f3b0ac34SDag-Erling Smørgrav*** is disabling shared libraries support.  We urge you to upgrade GNU
5294f3b0ac34SDag-Erling Smørgrav*** binutils to release 2.9.1 or newer.  Another option is to modify
5295f3b0ac34SDag-Erling Smørgrav*** your PATH or compiler configuration so that the native linker is
5296f3b0ac34SDag-Erling Smørgrav*** used, and then restart.
5297f3b0ac34SDag-Erling Smørgrav
5298f3b0ac34SDag-Erling Smørgrav_LT_EOF
5299f3b0ac34SDag-Erling Smørgrav      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5300f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5301f3b0ac34SDag-Erling Smørgrav	_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'
5302f3b0ac34SDag-Erling Smørgrav      else
5303f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
5304f3b0ac34SDag-Erling Smørgrav      fi
5305f3b0ac34SDag-Erling Smørgrav      ;;
5306f3b0ac34SDag-Erling Smørgrav
5307f3b0ac34SDag-Erling Smørgrav    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5308f3b0ac34SDag-Erling Smørgrav      case `$LD -v 2>&1` in
5309f3b0ac34SDag-Erling Smørgrav        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5310f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
5311f3b0ac34SDag-Erling Smørgrav	cat <<_LT_EOF 1>&2
5312f3b0ac34SDag-Erling Smørgrav
5313f3b0ac34SDag-Erling Smørgrav*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5314f3b0ac34SDag-Erling Smørgrav*** reliably create shared libraries on SCO systems.  Therefore, libtool
5315f3b0ac34SDag-Erling Smørgrav*** is disabling shared libraries support.  We urge you to upgrade GNU
5316f3b0ac34SDag-Erling Smørgrav*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5317f3b0ac34SDag-Erling Smørgrav*** your PATH or compiler configuration so that the native linker is
5318f3b0ac34SDag-Erling Smørgrav*** used, and then restart.
5319f3b0ac34SDag-Erling Smørgrav
5320f3b0ac34SDag-Erling Smørgrav_LT_EOF
5321f3b0ac34SDag-Erling Smørgrav	;;
5322f3b0ac34SDag-Erling Smørgrav	*)
5323f3b0ac34SDag-Erling Smørgrav	  # For security reasons, it is highly recommended that you always
5324f3b0ac34SDag-Erling Smørgrav	  # use absolute paths for naming shared libraries, and exclude the
5325f3b0ac34SDag-Erling Smørgrav	  # DT_RUNPATH tag from executables and libraries.  But doing so
5326f3b0ac34SDag-Erling Smørgrav	  # requires that you compile everything twice, which is a pain.
5327f3b0ac34SDag-Erling Smørgrav	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5328f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5329f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5330f3b0ac34SDag-Erling Smørgrav	    _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'
5331f3b0ac34SDag-Erling Smørgrav	  else
5332f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
5333f3b0ac34SDag-Erling Smørgrav	  fi
5334f3b0ac34SDag-Erling Smørgrav	;;
5335f3b0ac34SDag-Erling Smørgrav      esac
5336f3b0ac34SDag-Erling Smørgrav      ;;
5337f3b0ac34SDag-Erling Smørgrav
5338f3b0ac34SDag-Erling Smørgrav    sunos4*)
5339f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5340f3b0ac34SDag-Erling Smørgrav      wlarc=
5341f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5342f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5343f3b0ac34SDag-Erling Smørgrav      ;;
5344f3b0ac34SDag-Erling Smørgrav
5345f3b0ac34SDag-Erling Smørgrav    *)
5346f3b0ac34SDag-Erling Smørgrav      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5347f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5348f3b0ac34SDag-Erling Smørgrav	_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'
5349f3b0ac34SDag-Erling Smørgrav      else
5350f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
5351f3b0ac34SDag-Erling Smørgrav      fi
5352f3b0ac34SDag-Erling Smørgrav      ;;
5353f3b0ac34SDag-Erling Smørgrav    esac
5354f3b0ac34SDag-Erling Smørgrav
5355f3b0ac34SDag-Erling Smørgrav    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5356f3b0ac34SDag-Erling Smørgrav      runpath_var=
5357f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5358f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5359f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5360f3b0ac34SDag-Erling Smørgrav    fi
5361f3b0ac34SDag-Erling Smørgrav  else
5362f3b0ac34SDag-Erling Smørgrav    # PORTME fill in a description of your system's linker (not GNU ld)
5363f3b0ac34SDag-Erling Smørgrav    case $host_os in
5364f3b0ac34SDag-Erling Smørgrav    aix3*)
5365f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5366f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(always_export_symbols, $1)=yes
5367f3b0ac34SDag-Erling Smørgrav      _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'
5368f3b0ac34SDag-Erling Smørgrav      # Note: this linker hardcodes the directories in LIBPATH if there
5369f3b0ac34SDag-Erling Smørgrav      # are no directories specified by -L.
5370f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5371f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5372f3b0ac34SDag-Erling Smørgrav	# Neither direct hardcoding nor static linking is supported with a
5373f3b0ac34SDag-Erling Smørgrav	# broken collect2.
5374f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5375f3b0ac34SDag-Erling Smørgrav      fi
5376f3b0ac34SDag-Erling Smørgrav      ;;
5377f3b0ac34SDag-Erling Smørgrav
5378f3b0ac34SDag-Erling Smørgrav    aix[[4-9]]*)
5379f3b0ac34SDag-Erling Smørgrav      if test ia64 = "$host_cpu"; then
5380f3b0ac34SDag-Erling Smørgrav	# On IA64, the linker does run time linking by default, so we don't
5381f3b0ac34SDag-Erling Smørgrav	# have to do anything special.
5382f3b0ac34SDag-Erling Smørgrav	aix_use_runtimelinking=no
5383f3b0ac34SDag-Erling Smørgrav	exp_sym_flag='-Bexport'
5384f3b0ac34SDag-Erling Smørgrav	no_entry_flag=
5385f3b0ac34SDag-Erling Smørgrav      else
5386f3b0ac34SDag-Erling Smørgrav	# If we're using GNU nm, then we don't want the "-C" option.
5387f3b0ac34SDag-Erling Smørgrav	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5388f3b0ac34SDag-Erling Smørgrav	# Without the "-l" option, or with the "-B" option, AIX nm treats
5389f3b0ac34SDag-Erling Smørgrav	# weak defined symbols like other global defined symbols, whereas
5390f3b0ac34SDag-Erling Smørgrav	# GNU nm marks them as "W".
5391f3b0ac34SDag-Erling Smørgrav	# While the 'weak' keyword is ignored in the Export File, we need
5392f3b0ac34SDag-Erling Smørgrav	# it in the Import File for the 'aix-soname' feature, so we have
5393f3b0ac34SDag-Erling Smørgrav	# to replace the "-B" option with "-P" for AIX nm.
5394f3b0ac34SDag-Erling Smørgrav	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5395f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
5396f3b0ac34SDag-Erling Smørgrav	else
5397*3ba4c8c8SDag-Erling Smørgrav	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
5398f3b0ac34SDag-Erling Smørgrav	fi
5399f3b0ac34SDag-Erling Smørgrav	aix_use_runtimelinking=no
5400f3b0ac34SDag-Erling Smørgrav
5401f3b0ac34SDag-Erling Smørgrav	# Test if we are trying to use run time linking or normal
5402f3b0ac34SDag-Erling Smørgrav	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5403f3b0ac34SDag-Erling Smørgrav	# have runtime linking enabled, and use it for executables.
5404f3b0ac34SDag-Erling Smørgrav	# For shared libraries, we enable/disable runtime linking
5405f3b0ac34SDag-Erling Smørgrav	# depending on the kind of the shared library created -
5406f3b0ac34SDag-Erling Smørgrav	# when "with_aix_soname,aix_use_runtimelinking" is:
5407f3b0ac34SDag-Erling Smørgrav	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5408f3b0ac34SDag-Erling Smørgrav	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5409f3b0ac34SDag-Erling Smørgrav	#            lib.a           static archive
5410f3b0ac34SDag-Erling Smørgrav	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5411f3b0ac34SDag-Erling Smørgrav	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5412f3b0ac34SDag-Erling Smørgrav	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5413f3b0ac34SDag-Erling Smørgrav	#            lib.a(lib.so.V) shared, rtl:no
5414f3b0ac34SDag-Erling Smørgrav	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5415f3b0ac34SDag-Erling Smørgrav	#            lib.a           static archive
5416f3b0ac34SDag-Erling Smørgrav	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5417f3b0ac34SDag-Erling Smørgrav	  for ld_flag in $LDFLAGS; do
5418f3b0ac34SDag-Erling Smørgrav	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5419f3b0ac34SDag-Erling Smørgrav	    aix_use_runtimelinking=yes
5420f3b0ac34SDag-Erling Smørgrav	    break
5421f3b0ac34SDag-Erling Smørgrav	  fi
5422f3b0ac34SDag-Erling Smørgrav	  done
5423f3b0ac34SDag-Erling Smørgrav	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5424f3b0ac34SDag-Erling Smørgrav	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5425f3b0ac34SDag-Erling Smørgrav	    # so we don't have lib.a shared libs to link our executables.
5426f3b0ac34SDag-Erling Smørgrav	    # We have to force runtime linking in this case.
5427f3b0ac34SDag-Erling Smørgrav	    aix_use_runtimelinking=yes
5428f3b0ac34SDag-Erling Smørgrav	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5429f3b0ac34SDag-Erling Smørgrav	  fi
5430f3b0ac34SDag-Erling Smørgrav	  ;;
5431f3b0ac34SDag-Erling Smørgrav	esac
5432f3b0ac34SDag-Erling Smørgrav
5433f3b0ac34SDag-Erling Smørgrav	exp_sym_flag='-bexport'
5434f3b0ac34SDag-Erling Smørgrav	no_entry_flag='-bnoentry'
5435f3b0ac34SDag-Erling Smørgrav      fi
5436f3b0ac34SDag-Erling Smørgrav
5437f3b0ac34SDag-Erling Smørgrav      # When large executables or shared objects are built, AIX ld can
5438f3b0ac34SDag-Erling Smørgrav      # have problems creating the table of contents.  If linking a library
5439f3b0ac34SDag-Erling Smørgrav      # or program results in "error TOC overflow" add -mminimal-toc to
5440f3b0ac34SDag-Erling Smørgrav      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5441f3b0ac34SDag-Erling Smørgrav      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5442f3b0ac34SDag-Erling Smørgrav
5443f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)=''
5444f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5445f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5446f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5447f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(link_all_deplibs, $1)=yes
5448f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5449f3b0ac34SDag-Erling Smørgrav      case $with_aix_soname,$aix_use_runtimelinking in
5450f3b0ac34SDag-Erling Smørgrav      aix,*) ;; # traditional, no import file
5451f3b0ac34SDag-Erling Smørgrav      svr4,* | *,yes) # use import file
5452f3b0ac34SDag-Erling Smørgrav	# The Import File defines what to hardcode.
5453f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_direct, $1)=no
5454f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5455f3b0ac34SDag-Erling Smørgrav	;;
5456f3b0ac34SDag-Erling Smørgrav      esac
5457f3b0ac34SDag-Erling Smørgrav
5458f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC"; then
5459f3b0ac34SDag-Erling Smørgrav	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5460f3b0ac34SDag-Erling Smørgrav	# We only want to do this on AIX 4.2 and lower, the check
5461f3b0ac34SDag-Erling Smørgrav	# below for broken collect2 doesn't work under 4.3+
5462f3b0ac34SDag-Erling Smørgrav	  collect2name=`$CC -print-prog-name=collect2`
5463f3b0ac34SDag-Erling Smørgrav	  if test -f "$collect2name" &&
5464f3b0ac34SDag-Erling Smørgrav	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5465f3b0ac34SDag-Erling Smørgrav	  then
5466f3b0ac34SDag-Erling Smørgrav	  # We have reworked collect2
5467f3b0ac34SDag-Erling Smørgrav	  :
5468f3b0ac34SDag-Erling Smørgrav	  else
5469f3b0ac34SDag-Erling Smørgrav	  # We have old collect2
5470f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5471f3b0ac34SDag-Erling Smørgrav	  # It fails to find uninstalled libraries when the uninstalled
5472f3b0ac34SDag-Erling Smørgrav	  # path is not listed in the libpath.  Setting hardcode_minus_L
5473f3b0ac34SDag-Erling Smørgrav	  # to unsupported forces relinking
5474f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5475f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5476f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5477f3b0ac34SDag-Erling Smørgrav	  fi
5478f3b0ac34SDag-Erling Smørgrav	  ;;
5479f3b0ac34SDag-Erling Smørgrav	esac
5480f3b0ac34SDag-Erling Smørgrav	shared_flag='-shared'
5481f3b0ac34SDag-Erling Smørgrav	if test yes = "$aix_use_runtimelinking"; then
5482f3b0ac34SDag-Erling Smørgrav	  shared_flag="$shared_flag "'$wl-G'
5483f3b0ac34SDag-Erling Smørgrav	fi
5484f3b0ac34SDag-Erling Smørgrav	# Need to ensure runtime linking is disabled for the traditional
5485f3b0ac34SDag-Erling Smørgrav	# shared library, or the linker may eventually find shared libraries
5486f3b0ac34SDag-Erling Smørgrav	# /with/ Import File - we do not want to mix them.
5487f3b0ac34SDag-Erling Smørgrav	shared_flag_aix='-shared'
5488f3b0ac34SDag-Erling Smørgrav	shared_flag_svr4='-shared $wl-G'
5489f3b0ac34SDag-Erling Smørgrav      else
5490f3b0ac34SDag-Erling Smørgrav	# not using gcc
5491f3b0ac34SDag-Erling Smørgrav	if test ia64 = "$host_cpu"; then
5492f3b0ac34SDag-Erling Smørgrav	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5493f3b0ac34SDag-Erling Smørgrav	# chokes on -Wl,-G. The following line is correct:
5494f3b0ac34SDag-Erling Smørgrav	  shared_flag='-G'
5495f3b0ac34SDag-Erling Smørgrav	else
5496f3b0ac34SDag-Erling Smørgrav	  if test yes = "$aix_use_runtimelinking"; then
5497f3b0ac34SDag-Erling Smørgrav	    shared_flag='$wl-G'
5498f3b0ac34SDag-Erling Smørgrav	  else
5499f3b0ac34SDag-Erling Smørgrav	    shared_flag='$wl-bM:SRE'
5500f3b0ac34SDag-Erling Smørgrav	  fi
5501f3b0ac34SDag-Erling Smørgrav	  shared_flag_aix='$wl-bM:SRE'
5502f3b0ac34SDag-Erling Smørgrav	  shared_flag_svr4='$wl-G'
5503f3b0ac34SDag-Erling Smørgrav	fi
5504f3b0ac34SDag-Erling Smørgrav      fi
5505f3b0ac34SDag-Erling Smørgrav
5506f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5507f3b0ac34SDag-Erling Smørgrav      # It seems that -bexpall does not export symbols beginning with
5508f3b0ac34SDag-Erling Smørgrav      # underscore (_), so it is better to generate a list of symbols to export.
5509f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(always_export_symbols, $1)=yes
5510f3b0ac34SDag-Erling Smørgrav      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5511f3b0ac34SDag-Erling Smørgrav	# Warning - without using the other runtime loading flags (-brtl),
5512f3b0ac34SDag-Erling Smørgrav	# -berok will link without error, but may produce a broken library.
5513f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5514f3b0ac34SDag-Erling Smørgrav        # Determine the default libpath from the value encoded in an
5515f3b0ac34SDag-Erling Smørgrav        # empty executable.
5516f3b0ac34SDag-Erling Smørgrav        _LT_SYS_MODULE_PATH_AIX([$1])
5517f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5518f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
5519f3b0ac34SDag-Erling Smørgrav      else
5520f3b0ac34SDag-Erling Smørgrav	if test ia64 = "$host_cpu"; then
5521f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5522f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5523f3b0ac34SDag-Erling Smørgrav	  _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"
5524f3b0ac34SDag-Erling Smørgrav	else
5525f3b0ac34SDag-Erling Smørgrav	 # Determine the default libpath from the value encoded in an
5526f3b0ac34SDag-Erling Smørgrav	 # empty executable.
5527f3b0ac34SDag-Erling Smørgrav	 _LT_SYS_MODULE_PATH_AIX([$1])
5528f3b0ac34SDag-Erling Smørgrav	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5529f3b0ac34SDag-Erling Smørgrav	  # Warning - without using the other run time loading flags,
5530f3b0ac34SDag-Erling Smørgrav	  # -berok will link without error, but may produce a broken library.
5531f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5532f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5533f3b0ac34SDag-Erling Smørgrav	  if test yes = "$with_gnu_ld"; then
5534f3b0ac34SDag-Erling Smørgrav	    # We only use this code for GNU lds that support --whole-archive.
5535f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5536f3b0ac34SDag-Erling Smørgrav	  else
5537f3b0ac34SDag-Erling Smørgrav	    # Exported symbols can be pulled into shared objects from archives
5538f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5539f3b0ac34SDag-Erling Smørgrav	  fi
5540f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5541f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5542f3b0ac34SDag-Erling Smørgrav	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5543f3b0ac34SDag-Erling Smørgrav	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5544f3b0ac34SDag-Erling Smørgrav	  if test svr4 != "$with_aix_soname"; then
5545f3b0ac34SDag-Erling Smørgrav	    # This is similar to how AIX traditionally builds its shared libraries.
5546f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
5547f3b0ac34SDag-Erling Smørgrav	  fi
5548f3b0ac34SDag-Erling Smørgrav	  if test aix != "$with_aix_soname"; then
5549f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
5550f3b0ac34SDag-Erling Smørgrav	  else
5551f3b0ac34SDag-Erling Smørgrav	    # used by -dlpreopen to get the symbols
5552f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5553f3b0ac34SDag-Erling Smørgrav	  fi
5554f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5555f3b0ac34SDag-Erling Smørgrav	fi
5556f3b0ac34SDag-Erling Smørgrav      fi
5557f3b0ac34SDag-Erling Smørgrav      ;;
5558f3b0ac34SDag-Erling Smørgrav
5559f3b0ac34SDag-Erling Smørgrav    amigaos*)
5560f3b0ac34SDag-Erling Smørgrav      case $host_cpu in
5561f3b0ac34SDag-Erling Smørgrav      powerpc)
5562f3b0ac34SDag-Erling Smørgrav            # see comment about AmigaOS4 .so support
5563f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5564f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5565f3b0ac34SDag-Erling Smørgrav        ;;
5566f3b0ac34SDag-Erling Smørgrav      m68k)
5567f3b0ac34SDag-Erling Smørgrav            _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)'
5568f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5569f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5570f3b0ac34SDag-Erling Smørgrav        ;;
5571f3b0ac34SDag-Erling Smørgrav      esac
5572f3b0ac34SDag-Erling Smørgrav      ;;
5573f3b0ac34SDag-Erling Smørgrav
5574f3b0ac34SDag-Erling Smørgrav    bsdi[[45]]*)
5575f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5576f3b0ac34SDag-Erling Smørgrav      ;;
5577f3b0ac34SDag-Erling Smørgrav
5578f3b0ac34SDag-Erling Smørgrav    cygwin* | mingw* | pw32* | cegcc*)
5579f3b0ac34SDag-Erling Smørgrav      # When not using gcc, we currently assume that we are using
5580*3ba4c8c8SDag-Erling Smørgrav      # Microsoft Visual C++ or Intel C++ Compiler.
5581f3b0ac34SDag-Erling Smørgrav      # hardcode_libdir_flag_spec is actually meaningless, as there is
5582f3b0ac34SDag-Erling Smørgrav      # no search path for DLLs.
5583f3b0ac34SDag-Erling Smørgrav      case $cc_basename in
5584*3ba4c8c8SDag-Erling Smørgrav      cl* | icl*)
5585*3ba4c8c8SDag-Erling Smørgrav	# Native MSVC or ICC
5586f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5587f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5588f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(always_export_symbols, $1)=yes
5589f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(file_list_spec, $1)='@'
5590f3b0ac34SDag-Erling Smørgrav	# Tell ltmain to make .lib files, not .a files.
5591f3b0ac34SDag-Erling Smørgrav	libext=lib
5592f3b0ac34SDag-Erling Smørgrav	# Tell ltmain to make .dll files, not .so files.
5593f3b0ac34SDag-Erling Smørgrav	shrext_cmds=.dll
5594f3b0ac34SDag-Erling Smørgrav	# FIXME: Setting linknames here is a bad hack.
5595f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5596f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5597f3b0ac34SDag-Erling Smørgrav            cp "$export_symbols" "$output_objdir/$soname.def";
5598f3b0ac34SDag-Erling Smørgrav            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5599f3b0ac34SDag-Erling Smørgrav          else
5600f3b0ac34SDag-Erling Smørgrav            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5601f3b0ac34SDag-Erling Smørgrav          fi~
5602f3b0ac34SDag-Erling Smørgrav          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5603f3b0ac34SDag-Erling Smørgrav          linknames='
5604f3b0ac34SDag-Erling Smørgrav	# The linker will not automatically build a static lib if we build a DLL.
5605f3b0ac34SDag-Erling Smørgrav	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5606f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5607f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5608f3b0ac34SDag-Erling Smørgrav	_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'
5609f3b0ac34SDag-Erling Smørgrav	# Don't use ranlib
5610f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5611f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5612f3b0ac34SDag-Erling Smørgrav          lt_tool_outputfile="@TOOL_OUTPUT@"~
5613f3b0ac34SDag-Erling Smørgrav          case $lt_outputfile in
5614f3b0ac34SDag-Erling Smørgrav            *.exe|*.EXE) ;;
5615f3b0ac34SDag-Erling Smørgrav            *)
5616f3b0ac34SDag-Erling Smørgrav              lt_outputfile=$lt_outputfile.exe
5617f3b0ac34SDag-Erling Smørgrav              lt_tool_outputfile=$lt_tool_outputfile.exe
5618f3b0ac34SDag-Erling Smørgrav              ;;
5619f3b0ac34SDag-Erling Smørgrav          esac~
5620f3b0ac34SDag-Erling Smørgrav          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5621f3b0ac34SDag-Erling Smørgrav            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5622f3b0ac34SDag-Erling Smørgrav            $RM "$lt_outputfile.manifest";
5623f3b0ac34SDag-Erling Smørgrav          fi'
5624f3b0ac34SDag-Erling Smørgrav	;;
5625f3b0ac34SDag-Erling Smørgrav      *)
5626*3ba4c8c8SDag-Erling Smørgrav	# Assume MSVC and ICC wrapper
5627f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5628f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5629f3b0ac34SDag-Erling Smørgrav	# Tell ltmain to make .lib files, not .a files.
5630f3b0ac34SDag-Erling Smørgrav	libext=lib
5631f3b0ac34SDag-Erling Smørgrav	# Tell ltmain to make .dll files, not .so files.
5632f3b0ac34SDag-Erling Smørgrav	shrext_cmds=.dll
5633f3b0ac34SDag-Erling Smørgrav	# FIXME: Setting linknames here is a bad hack.
5634f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5635f3b0ac34SDag-Erling Smørgrav	# The linker will automatically build a .lib file if we build a DLL.
5636f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5637f3b0ac34SDag-Erling Smørgrav	# FIXME: Should let the user specify the lib program.
5638f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5639f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5640f3b0ac34SDag-Erling Smørgrav	;;
5641f3b0ac34SDag-Erling Smørgrav      esac
5642f3b0ac34SDag-Erling Smørgrav      ;;
5643f3b0ac34SDag-Erling Smørgrav
5644f3b0ac34SDag-Erling Smørgrav    darwin* | rhapsody*)
5645f3b0ac34SDag-Erling Smørgrav      _LT_DARWIN_LINKER_FEATURES($1)
5646f3b0ac34SDag-Erling Smørgrav      ;;
5647f3b0ac34SDag-Erling Smørgrav
5648f3b0ac34SDag-Erling Smørgrav    dgux*)
5649f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5650f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5651f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5652f3b0ac34SDag-Erling Smørgrav      ;;
5653f3b0ac34SDag-Erling Smørgrav
5654f3b0ac34SDag-Erling Smørgrav    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5655f3b0ac34SDag-Erling Smørgrav    # support.  Future versions do this automatically, but an explicit c++rt0.o
5656f3b0ac34SDag-Erling Smørgrav    # does not break anything, and helps significantly (at the cost of a little
5657f3b0ac34SDag-Erling Smørgrav    # extra space).
5658f3b0ac34SDag-Erling Smørgrav    freebsd2.2*)
5659f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5660f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5661f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5662f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5663f3b0ac34SDag-Erling Smørgrav      ;;
5664f3b0ac34SDag-Erling Smørgrav
5665f3b0ac34SDag-Erling Smørgrav    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5666f3b0ac34SDag-Erling Smørgrav    freebsd2.*)
5667f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5668f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5669f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5670f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5671f3b0ac34SDag-Erling Smørgrav      ;;
5672f3b0ac34SDag-Erling Smørgrav
5673f3b0ac34SDag-Erling Smørgrav    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5674*3ba4c8c8SDag-Erling Smørgrav    freebsd* | dragonfly* | midnightbsd*)
5675f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5676f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5677f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5678f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5679f3b0ac34SDag-Erling Smørgrav      ;;
5680f3b0ac34SDag-Erling Smørgrav
5681f3b0ac34SDag-Erling Smørgrav    hpux9*)
5682f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC"; then
5683f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5684f3b0ac34SDag-Erling Smørgrav      else
5685f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5686f3b0ac34SDag-Erling Smørgrav      fi
5687f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5688f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5689f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5690f3b0ac34SDag-Erling Smørgrav
5691f3b0ac34SDag-Erling Smørgrav      # hardcode_minus_L: Not really in the search PATH,
5692f3b0ac34SDag-Erling Smørgrav      # but as the default location of the library.
5693f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5694f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5695f3b0ac34SDag-Erling Smørgrav      ;;
5696f3b0ac34SDag-Erling Smørgrav
5697f3b0ac34SDag-Erling Smørgrav    hpux10*)
5698f3b0ac34SDag-Erling Smørgrav      if test yes,no = "$GCC,$with_gnu_ld"; then
5699f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5700f3b0ac34SDag-Erling Smørgrav      else
5701f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5702f3b0ac34SDag-Erling Smørgrav      fi
5703f3b0ac34SDag-Erling Smørgrav      if test no = "$with_gnu_ld"; then
5704f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5705f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5706f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_direct, $1)=yes
5707f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5708f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5709f3b0ac34SDag-Erling Smørgrav	# hardcode_minus_L: Not really in the search PATH,
5710f3b0ac34SDag-Erling Smørgrav	# but as the default location of the library.
5711f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5712f3b0ac34SDag-Erling Smørgrav      fi
5713f3b0ac34SDag-Erling Smørgrav      ;;
5714f3b0ac34SDag-Erling Smørgrav
5715f3b0ac34SDag-Erling Smørgrav    hpux11*)
5716f3b0ac34SDag-Erling Smørgrav      if test yes,no = "$GCC,$with_gnu_ld"; then
5717f3b0ac34SDag-Erling Smørgrav	case $host_cpu in
5718f3b0ac34SDag-Erling Smørgrav	hppa*64*)
5719f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5720f3b0ac34SDag-Erling Smørgrav	  ;;
5721f3b0ac34SDag-Erling Smørgrav	ia64*)
5722f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5723f3b0ac34SDag-Erling Smørgrav	  ;;
5724f3b0ac34SDag-Erling Smørgrav	*)
5725f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5726f3b0ac34SDag-Erling Smørgrav	  ;;
5727f3b0ac34SDag-Erling Smørgrav	esac
5728f3b0ac34SDag-Erling Smørgrav      else
5729f3b0ac34SDag-Erling Smørgrav	case $host_cpu in
5730f3b0ac34SDag-Erling Smørgrav	hppa*64*)
5731f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5732f3b0ac34SDag-Erling Smørgrav	  ;;
5733f3b0ac34SDag-Erling Smørgrav	ia64*)
5734f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5735f3b0ac34SDag-Erling Smørgrav	  ;;
5736f3b0ac34SDag-Erling Smørgrav	*)
5737f3b0ac34SDag-Erling Smørgrav	m4_if($1, [], [
5738f3b0ac34SDag-Erling Smørgrav	  # Older versions of the 11.00 compiler do not understand -b yet
5739f3b0ac34SDag-Erling Smørgrav	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5740f3b0ac34SDag-Erling Smørgrav	  _LT_LINKER_OPTION([if $CC understands -b],
5741f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5742f3b0ac34SDag-Erling Smørgrav	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5743f3b0ac34SDag-Erling Smørgrav	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5744f3b0ac34SDag-Erling Smørgrav	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5745f3b0ac34SDag-Erling Smørgrav	  ;;
5746f3b0ac34SDag-Erling Smørgrav	esac
5747f3b0ac34SDag-Erling Smørgrav      fi
5748f3b0ac34SDag-Erling Smørgrav      if test no = "$with_gnu_ld"; then
5749f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5750f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5751f3b0ac34SDag-Erling Smørgrav
5752f3b0ac34SDag-Erling Smørgrav	case $host_cpu in
5753f3b0ac34SDag-Erling Smørgrav	hppa*64*|ia64*)
5754f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct, $1)=no
5755f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5756f3b0ac34SDag-Erling Smørgrav	  ;;
5757f3b0ac34SDag-Erling Smørgrav	*)
5758f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct, $1)=yes
5759f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5760f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5761f3b0ac34SDag-Erling Smørgrav
5762f3b0ac34SDag-Erling Smørgrav	  # hardcode_minus_L: Not really in the search PATH,
5763f3b0ac34SDag-Erling Smørgrav	  # but as the default location of the library.
5764f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5765f3b0ac34SDag-Erling Smørgrav	  ;;
5766f3b0ac34SDag-Erling Smørgrav	esac
5767f3b0ac34SDag-Erling Smørgrav      fi
5768f3b0ac34SDag-Erling Smørgrav      ;;
5769f3b0ac34SDag-Erling Smørgrav
5770f3b0ac34SDag-Erling Smørgrav    irix5* | irix6* | nonstopux*)
5771f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC"; then
5772f3b0ac34SDag-Erling Smørgrav	_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'
5773f3b0ac34SDag-Erling Smørgrav	# Try to use the -exported_symbol ld option, if it does not
5774f3b0ac34SDag-Erling Smørgrav	# work, assume that -exports_file does not work either and
5775f3b0ac34SDag-Erling Smørgrav	# implicitly export all symbols.
5776f3b0ac34SDag-Erling Smørgrav	# This should be the same for all languages, so no per-tag cache variable.
5777f3b0ac34SDag-Erling Smørgrav	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5778f3b0ac34SDag-Erling Smørgrav	  [lt_cv_irix_exported_symbol],
5779f3b0ac34SDag-Erling Smørgrav	  [save_LDFLAGS=$LDFLAGS
5780f3b0ac34SDag-Erling Smørgrav	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5781f3b0ac34SDag-Erling Smørgrav	   AC_LINK_IFELSE(
5782f3b0ac34SDag-Erling Smørgrav	     [AC_LANG_SOURCE(
5783f3b0ac34SDag-Erling Smørgrav	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5784f3b0ac34SDag-Erling Smørgrav			      [C++], [[int foo (void) { return 0; }]],
5785f3b0ac34SDag-Erling Smørgrav			      [Fortran 77], [[
5786f3b0ac34SDag-Erling Smørgrav      subroutine foo
5787f3b0ac34SDag-Erling Smørgrav      end]],
5788f3b0ac34SDag-Erling Smørgrav			      [Fortran], [[
5789f3b0ac34SDag-Erling Smørgrav      subroutine foo
5790f3b0ac34SDag-Erling Smørgrav      end]])])],
5791f3b0ac34SDag-Erling Smørgrav	      [lt_cv_irix_exported_symbol=yes],
5792f3b0ac34SDag-Erling Smørgrav	      [lt_cv_irix_exported_symbol=no])
5793f3b0ac34SDag-Erling Smørgrav           LDFLAGS=$save_LDFLAGS])
5794f3b0ac34SDag-Erling Smørgrav	if test yes = "$lt_cv_irix_exported_symbol"; then
5795f3b0ac34SDag-Erling Smørgrav          _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'
5796f3b0ac34SDag-Erling Smørgrav	fi
5797f3b0ac34SDag-Erling Smørgrav      else
5798f3b0ac34SDag-Erling Smørgrav	_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'
5799f3b0ac34SDag-Erling Smørgrav	_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'
5800f3b0ac34SDag-Erling Smørgrav      fi
5801f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5802f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5803f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5804f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(inherit_rpath, $1)=yes
5805f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(link_all_deplibs, $1)=yes
5806f3b0ac34SDag-Erling Smørgrav      ;;
5807f3b0ac34SDag-Erling Smørgrav
5808f3b0ac34SDag-Erling Smørgrav    linux*)
5809f3b0ac34SDag-Erling Smørgrav      case $cc_basename in
5810f3b0ac34SDag-Erling Smørgrav      tcc*)
5811f3b0ac34SDag-Erling Smørgrav	# Fabrice Bellard et al's Tiny C Compiler
5812f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=yes
5813f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5814f3b0ac34SDag-Erling Smørgrav	;;
5815f3b0ac34SDag-Erling Smørgrav      esac
5816f3b0ac34SDag-Erling Smørgrav      ;;
5817f3b0ac34SDag-Erling Smørgrav
5818f3b0ac34SDag-Erling Smørgrav    netbsd*)
5819f3b0ac34SDag-Erling Smørgrav      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5820f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5821f3b0ac34SDag-Erling Smørgrav      else
5822f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5823f3b0ac34SDag-Erling Smørgrav      fi
5824f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5825f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5826f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5827f3b0ac34SDag-Erling Smørgrav      ;;
5828f3b0ac34SDag-Erling Smørgrav
5829f3b0ac34SDag-Erling Smørgrav    newsos6)
5830f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5831f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5832f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5833f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5834f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5835f3b0ac34SDag-Erling Smørgrav      ;;
5836f3b0ac34SDag-Erling Smørgrav
5837f3b0ac34SDag-Erling Smørgrav    *nto* | *qnx*)
5838f3b0ac34SDag-Erling Smørgrav      ;;
5839f3b0ac34SDag-Erling Smørgrav
5840f3b0ac34SDag-Erling Smørgrav    openbsd* | bitrig*)
5841f3b0ac34SDag-Erling Smørgrav      if test -f /usr/libexec/ld.so; then
5842f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_direct, $1)=yes
5843f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5844f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5845f3b0ac34SDag-Erling Smørgrav	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5846f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5847f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5848f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5849f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5850f3b0ac34SDag-Erling Smørgrav	else
5851f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5852f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5853f3b0ac34SDag-Erling Smørgrav	fi
5854f3b0ac34SDag-Erling Smørgrav      else
5855f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
5856f3b0ac34SDag-Erling Smørgrav      fi
5857f3b0ac34SDag-Erling Smørgrav      ;;
5858f3b0ac34SDag-Erling Smørgrav
5859f3b0ac34SDag-Erling Smørgrav    os2*)
5860f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5861f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5862f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5863f3b0ac34SDag-Erling Smørgrav      shrext_cmds=.dll
5864f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5865f3b0ac34SDag-Erling Smørgrav	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5866f3b0ac34SDag-Erling Smørgrav	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5867f3b0ac34SDag-Erling Smørgrav	$ECHO EXPORTS >> $output_objdir/$libname.def~
5868f3b0ac34SDag-Erling Smørgrav	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5869f3b0ac34SDag-Erling Smørgrav	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5870f3b0ac34SDag-Erling Smørgrav	emximp -o $lib $output_objdir/$libname.def'
5871f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5872f3b0ac34SDag-Erling Smørgrav	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5873f3b0ac34SDag-Erling Smørgrav	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5874f3b0ac34SDag-Erling Smørgrav	$ECHO EXPORTS >> $output_objdir/$libname.def~
5875f3b0ac34SDag-Erling Smørgrav	prefix_cmds="$SED"~
5876f3b0ac34SDag-Erling Smørgrav	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5877f3b0ac34SDag-Erling Smørgrav	  prefix_cmds="$prefix_cmds -e 1d";
5878f3b0ac34SDag-Erling Smørgrav	fi~
5879f3b0ac34SDag-Erling Smørgrav	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5880f3b0ac34SDag-Erling Smørgrav	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5881f3b0ac34SDag-Erling Smørgrav	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5882f3b0ac34SDag-Erling Smørgrav	emximp -o $lib $output_objdir/$libname.def'
5883f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5884f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5885*3ba4c8c8SDag-Erling Smørgrav      _LT_TAGVAR(file_list_spec, $1)='@'
5886f3b0ac34SDag-Erling Smørgrav      ;;
5887f3b0ac34SDag-Erling Smørgrav
5888f3b0ac34SDag-Erling Smørgrav    osf3*)
5889f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC"; then
5890f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5891f3b0ac34SDag-Erling Smørgrav	_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'
5892f3b0ac34SDag-Erling Smørgrav      else
5893f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5894f3b0ac34SDag-Erling Smørgrav	_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'
5895f3b0ac34SDag-Erling Smørgrav      fi
5896f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5897f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5898f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5899f3b0ac34SDag-Erling Smørgrav      ;;
5900f3b0ac34SDag-Erling Smørgrav
5901f3b0ac34SDag-Erling Smørgrav    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5902f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC"; then
5903f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5904f3b0ac34SDag-Erling Smørgrav	_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'
5905f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5906f3b0ac34SDag-Erling Smørgrav      else
5907f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5908f3b0ac34SDag-Erling Smørgrav	_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'
5909f3b0ac34SDag-Erling Smørgrav	_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~
5910f3b0ac34SDag-Erling Smørgrav          $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'
5911f3b0ac34SDag-Erling Smørgrav
5912f3b0ac34SDag-Erling Smørgrav	# Both c and cxx compiler support -rpath directly
5913f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5914f3b0ac34SDag-Erling Smørgrav      fi
5915f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5916f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5917f3b0ac34SDag-Erling Smørgrav      ;;
5918f3b0ac34SDag-Erling Smørgrav
5919f3b0ac34SDag-Erling Smørgrav    solaris*)
5920f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5921f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC"; then
5922f3b0ac34SDag-Erling Smørgrav	wlarc='$wl'
5923f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5924f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5925f3b0ac34SDag-Erling Smørgrav          $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'
5926f3b0ac34SDag-Erling Smørgrav      else
5927f3b0ac34SDag-Erling Smørgrav	case `$CC -V 2>&1` in
5928f3b0ac34SDag-Erling Smørgrav	*"Compilers 5.0"*)
5929f3b0ac34SDag-Erling Smørgrav	  wlarc=''
5930f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5931f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5932f3b0ac34SDag-Erling Smørgrav            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5933f3b0ac34SDag-Erling Smørgrav	  ;;
5934f3b0ac34SDag-Erling Smørgrav	*)
5935f3b0ac34SDag-Erling Smørgrav	  wlarc='$wl'
5936f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5937f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5938f3b0ac34SDag-Erling Smørgrav            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5939f3b0ac34SDag-Erling Smørgrav	  ;;
5940f3b0ac34SDag-Erling Smørgrav	esac
5941f3b0ac34SDag-Erling Smørgrav      fi
5942f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5943f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5944f3b0ac34SDag-Erling Smørgrav      case $host_os in
5945f3b0ac34SDag-Erling Smørgrav      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5946f3b0ac34SDag-Erling Smørgrav      *)
5947f3b0ac34SDag-Erling Smørgrav	# The compiler driver will combine and reorder linker options,
5948f3b0ac34SDag-Erling Smørgrav	# but understands '-z linker_flag'.  GCC discards it without '$wl',
5949f3b0ac34SDag-Erling Smørgrav	# but is careful enough not to reorder.
5950f3b0ac34SDag-Erling Smørgrav	# Supported since Solaris 2.6 (maybe 2.5.1?)
5951f3b0ac34SDag-Erling Smørgrav	if test yes = "$GCC"; then
5952f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5953f3b0ac34SDag-Erling Smørgrav	else
5954f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5955f3b0ac34SDag-Erling Smørgrav	fi
5956f3b0ac34SDag-Erling Smørgrav	;;
5957f3b0ac34SDag-Erling Smørgrav      esac
5958f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(link_all_deplibs, $1)=yes
5959f3b0ac34SDag-Erling Smørgrav      ;;
5960f3b0ac34SDag-Erling Smørgrav
5961f3b0ac34SDag-Erling Smørgrav    sunos4*)
5962f3b0ac34SDag-Erling Smørgrav      if test sequent = "$host_vendor"; then
5963f3b0ac34SDag-Erling Smørgrav	# Use $CC to link under sequent, because it throws in some extra .o
5964f3b0ac34SDag-Erling Smørgrav	# files that make .init and .fini sections work.
5965f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5966f3b0ac34SDag-Erling Smørgrav      else
5967f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5968f3b0ac34SDag-Erling Smørgrav      fi
5969f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5970f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_direct, $1)=yes
5971f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5972f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5973f3b0ac34SDag-Erling Smørgrav      ;;
5974f3b0ac34SDag-Erling Smørgrav
5975f3b0ac34SDag-Erling Smørgrav    sysv4)
5976f3b0ac34SDag-Erling Smørgrav      case $host_vendor in
5977f3b0ac34SDag-Erling Smørgrav	sni)
5978f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5979f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5980f3b0ac34SDag-Erling Smørgrav	;;
5981f3b0ac34SDag-Erling Smørgrav	siemens)
5982f3b0ac34SDag-Erling Smørgrav	  ## LD is ld it makes a PLAMLIB
5983f3b0ac34SDag-Erling Smørgrav	  ## CC just makes a GrossModule.
5984f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5985f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5986f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct, $1)=no
5987f3b0ac34SDag-Erling Smørgrav        ;;
5988f3b0ac34SDag-Erling Smørgrav	motorola)
5989f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5990f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5991f3b0ac34SDag-Erling Smørgrav	;;
5992f3b0ac34SDag-Erling Smørgrav      esac
5993f3b0ac34SDag-Erling Smørgrav      runpath_var='LD_RUN_PATH'
5994f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5995f3b0ac34SDag-Erling Smørgrav      ;;
5996f3b0ac34SDag-Erling Smørgrav
5997f3b0ac34SDag-Erling Smørgrav    sysv4.3*)
5998f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5999f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6000f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6001f3b0ac34SDag-Erling Smørgrav      ;;
6002f3b0ac34SDag-Erling Smørgrav
6003f3b0ac34SDag-Erling Smørgrav    sysv4*MP*)
6004f3b0ac34SDag-Erling Smørgrav      if test -d /usr/nec; then
6005f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6006f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6007f3b0ac34SDag-Erling Smørgrav	runpath_var=LD_RUN_PATH
6008f3b0ac34SDag-Erling Smørgrav	hardcode_runpath_var=yes
6009f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=yes
6010f3b0ac34SDag-Erling Smørgrav      fi
6011f3b0ac34SDag-Erling Smørgrav      ;;
6012f3b0ac34SDag-Erling Smørgrav
6013f3b0ac34SDag-Erling Smørgrav    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6014f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6015f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6016f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6017f3b0ac34SDag-Erling Smørgrav      runpath_var='LD_RUN_PATH'
6018f3b0ac34SDag-Erling Smørgrav
6019f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC"; then
6020f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6021f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6022f3b0ac34SDag-Erling Smørgrav      else
6023f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6024f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6025f3b0ac34SDag-Erling Smørgrav      fi
6026f3b0ac34SDag-Erling Smørgrav      ;;
6027f3b0ac34SDag-Erling Smørgrav
6028f3b0ac34SDag-Erling Smørgrav    sysv5* | sco3.2v5* | sco5v6*)
6029f3b0ac34SDag-Erling Smørgrav      # Note: We CANNOT use -z defs as we might desire, because we do not
6030f3b0ac34SDag-Erling Smørgrav      # link with -lc, and that would cause any symbols used from libc to
6031f3b0ac34SDag-Erling Smørgrav      # always be unresolved, which means just about no library would
6032f3b0ac34SDag-Erling Smørgrav      # ever link correctly.  If we're not using GNU ld we use -z text
6033f3b0ac34SDag-Erling Smørgrav      # though, which does catch some bad symbols but isn't as heavy-handed
6034f3b0ac34SDag-Erling Smørgrav      # as -z defs.
6035f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6036f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6037f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6038f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6039f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6040f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6041f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(link_all_deplibs, $1)=yes
6042f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6043f3b0ac34SDag-Erling Smørgrav      runpath_var='LD_RUN_PATH'
6044f3b0ac34SDag-Erling Smørgrav
6045f3b0ac34SDag-Erling Smørgrav      if test yes = "$GCC"; then
6046f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6047f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6048f3b0ac34SDag-Erling Smørgrav      else
6049f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6050f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6051f3b0ac34SDag-Erling Smørgrav      fi
6052f3b0ac34SDag-Erling Smørgrav      ;;
6053f3b0ac34SDag-Erling Smørgrav
6054f3b0ac34SDag-Erling Smørgrav    uts4*)
6055f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6056f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6057f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6058f3b0ac34SDag-Erling Smørgrav      ;;
6059f3b0ac34SDag-Erling Smørgrav
6060f3b0ac34SDag-Erling Smørgrav    *)
6061f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(ld_shlibs, $1)=no
6062f3b0ac34SDag-Erling Smørgrav      ;;
6063f3b0ac34SDag-Erling Smørgrav    esac
6064f3b0ac34SDag-Erling Smørgrav
6065f3b0ac34SDag-Erling Smørgrav    if test sni = "$host_vendor"; then
6066f3b0ac34SDag-Erling Smørgrav      case $host in
6067f3b0ac34SDag-Erling Smørgrav      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6068f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6069f3b0ac34SDag-Erling Smørgrav	;;
6070f3b0ac34SDag-Erling Smørgrav      esac
6071f3b0ac34SDag-Erling Smørgrav    fi
6072f3b0ac34SDag-Erling Smørgrav  fi
6073f3b0ac34SDag-Erling Smørgrav])
6074f3b0ac34SDag-Erling SmørgravAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6075f3b0ac34SDag-Erling Smørgravtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6076f3b0ac34SDag-Erling Smørgrav
6077f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6078f3b0ac34SDag-Erling Smørgrav
6079f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6080f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6081f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [extract_expsyms_cmds], [2],
6082f3b0ac34SDag-Erling Smørgrav    [The commands to extract the exported symbol list from a shared archive])
6083f3b0ac34SDag-Erling Smørgrav
6084f3b0ac34SDag-Erling Smørgrav#
6085f3b0ac34SDag-Erling Smørgrav# Do we need to explicitly link libc?
6086f3b0ac34SDag-Erling Smørgrav#
6087f3b0ac34SDag-Erling Smørgravcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6088f3b0ac34SDag-Erling Smørgravx|xyes)
6089f3b0ac34SDag-Erling Smørgrav  # Assume -lc should be added
6090f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6091f3b0ac34SDag-Erling Smørgrav
6092f3b0ac34SDag-Erling Smørgrav  if test yes,yes = "$GCC,$enable_shared"; then
6093f3b0ac34SDag-Erling Smørgrav    case $_LT_TAGVAR(archive_cmds, $1) in
6094f3b0ac34SDag-Erling Smørgrav    *'~'*)
6095f3b0ac34SDag-Erling Smørgrav      # FIXME: we may have to deal with multi-command sequences.
6096f3b0ac34SDag-Erling Smørgrav      ;;
6097f3b0ac34SDag-Erling Smørgrav    '$CC '*)
6098f3b0ac34SDag-Erling Smørgrav      # Test whether the compiler implicitly links with -lc since on some
6099f3b0ac34SDag-Erling Smørgrav      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6100f3b0ac34SDag-Erling Smørgrav      # to ld, don't add -lc before -lgcc.
6101f3b0ac34SDag-Erling Smørgrav      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6102f3b0ac34SDag-Erling Smørgrav	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6103f3b0ac34SDag-Erling Smørgrav	[$RM conftest*
6104f3b0ac34SDag-Erling Smørgrav	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6105f3b0ac34SDag-Erling Smørgrav
6106f3b0ac34SDag-Erling Smørgrav	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6107f3b0ac34SDag-Erling Smørgrav	  soname=conftest
6108f3b0ac34SDag-Erling Smørgrav	  lib=conftest
6109f3b0ac34SDag-Erling Smørgrav	  libobjs=conftest.$ac_objext
6110f3b0ac34SDag-Erling Smørgrav	  deplibs=
6111f3b0ac34SDag-Erling Smørgrav	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6112f3b0ac34SDag-Erling Smørgrav	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6113f3b0ac34SDag-Erling Smørgrav	  compiler_flags=-v
6114f3b0ac34SDag-Erling Smørgrav	  linker_flags=-v
6115f3b0ac34SDag-Erling Smørgrav	  verstring=
6116f3b0ac34SDag-Erling Smørgrav	  output_objdir=.
6117f3b0ac34SDag-Erling Smørgrav	  libname=conftest
6118f3b0ac34SDag-Erling Smørgrav	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6119f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(allow_undefined_flag, $1)=
6120f3b0ac34SDag-Erling Smørgrav	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6121f3b0ac34SDag-Erling Smørgrav	  then
6122f3b0ac34SDag-Erling Smørgrav	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6123f3b0ac34SDag-Erling Smørgrav	  else
6124f3b0ac34SDag-Erling Smørgrav	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6125f3b0ac34SDag-Erling Smørgrav	  fi
6126f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6127f3b0ac34SDag-Erling Smørgrav	else
6128f3b0ac34SDag-Erling Smørgrav	  cat conftest.err 1>&5
6129f3b0ac34SDag-Erling Smørgrav	fi
6130f3b0ac34SDag-Erling Smørgrav	$RM conftest*
6131f3b0ac34SDag-Erling Smørgrav	])
6132f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6133f3b0ac34SDag-Erling Smørgrav      ;;
6134f3b0ac34SDag-Erling Smørgrav    esac
6135f3b0ac34SDag-Erling Smørgrav  fi
6136f3b0ac34SDag-Erling Smørgrav  ;;
6137f3b0ac34SDag-Erling Smørgravesac
6138f3b0ac34SDag-Erling Smørgrav
6139f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6140f3b0ac34SDag-Erling Smørgrav    [Whether or not to add -lc for building shared libraries])
6141f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6142f3b0ac34SDag-Erling Smørgrav    [enable_shared_with_static_runtimes], [0],
6143f3b0ac34SDag-Erling Smørgrav    [Whether or not to disallow shared libs when runtime libs are static])
6144f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6145f3b0ac34SDag-Erling Smørgrav    [Compiler flag to allow reflexive dlopens])
6146f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6147f3b0ac34SDag-Erling Smørgrav    [Compiler flag to generate shared objects directly from archives])
6148f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [compiler_needs_object], [1],
6149f3b0ac34SDag-Erling Smørgrav    [Whether the compiler copes with passing no objects directly])
6150f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6151f3b0ac34SDag-Erling Smørgrav    [Create an old-style archive from a shared archive])
6152f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6153f3b0ac34SDag-Erling Smørgrav    [Create a temporary old-style archive to link instead of a shared archive])
6154f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6155f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [archive_expsym_cmds], [2])
6156f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [module_cmds], [2],
6157f3b0ac34SDag-Erling Smørgrav    [Commands used to build a loadable module if different from building
6158f3b0ac34SDag-Erling Smørgrav    a shared archive.])
6159f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [module_expsym_cmds], [2])
6160f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [with_gnu_ld], [1],
6161f3b0ac34SDag-Erling Smørgrav    [Whether we are building with GNU ld or not])
6162f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [allow_undefined_flag], [1],
6163f3b0ac34SDag-Erling Smørgrav    [Flag that allows shared libraries with undefined symbols to be built])
6164f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [no_undefined_flag], [1],
6165f3b0ac34SDag-Erling Smørgrav    [Flag that enforces no undefined symbols])
6166f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6167f3b0ac34SDag-Erling Smørgrav    [Flag to hardcode $libdir into a binary during linking.
6168f3b0ac34SDag-Erling Smørgrav    This must work even if $libdir does not exist])
6169f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6170f3b0ac34SDag-Erling Smørgrav    [Whether we need a single "-rpath" flag with a separated argument])
6171f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [hardcode_direct], [0],
6172f3b0ac34SDag-Erling Smørgrav    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6173f3b0ac34SDag-Erling Smørgrav    DIR into the resulting binary])
6174f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6175f3b0ac34SDag-Erling Smørgrav    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6176f3b0ac34SDag-Erling Smørgrav    DIR into the resulting binary and the resulting library dependency is
6177f3b0ac34SDag-Erling Smørgrav    "absolute", i.e impossible to change by setting $shlibpath_var if the
6178f3b0ac34SDag-Erling Smørgrav    library is relocated])
6179f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [hardcode_minus_L], [0],
6180f3b0ac34SDag-Erling Smørgrav    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6181f3b0ac34SDag-Erling Smørgrav    into the resulting binary])
6182f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6183f3b0ac34SDag-Erling Smørgrav    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6184f3b0ac34SDag-Erling Smørgrav    into the resulting binary])
6185f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [hardcode_automatic], [0],
6186f3b0ac34SDag-Erling Smørgrav    [Set to "yes" if building a shared library automatically hardcodes DIR
6187f3b0ac34SDag-Erling Smørgrav    into the library and all subsequent libraries and executables linked
6188f3b0ac34SDag-Erling Smørgrav    against it])
6189f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [inherit_rpath], [0],
6190f3b0ac34SDag-Erling Smørgrav    [Set to yes if linker adds runtime paths of dependent libraries
6191f3b0ac34SDag-Erling Smørgrav    to runtime path list])
6192f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [link_all_deplibs], [0],
6193f3b0ac34SDag-Erling Smørgrav    [Whether libtool must link a program against all its dependency libraries])
6194f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [always_export_symbols], [0],
6195f3b0ac34SDag-Erling Smørgrav    [Set to "yes" if exported symbols are required])
6196f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [export_symbols_cmds], [2],
6197f3b0ac34SDag-Erling Smørgrav    [The commands to list exported symbols])
6198f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [exclude_expsyms], [1],
6199f3b0ac34SDag-Erling Smørgrav    [Symbols that should not be listed in the preloaded symbols])
6200f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [include_expsyms], [1],
6201f3b0ac34SDag-Erling Smørgrav    [Symbols that must always be exported])
6202f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [prelink_cmds], [2],
6203f3b0ac34SDag-Erling Smørgrav    [Commands necessary for linking programs (against libraries) with templates])
6204f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [postlink_cmds], [2],
6205f3b0ac34SDag-Erling Smørgrav    [Commands necessary for finishing linking programs])
6206f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [file_list_spec], [1],
6207f3b0ac34SDag-Erling Smørgrav    [Specify filename containing input files])
6208f3b0ac34SDag-Erling Smørgravdnl FIXME: Not yet implemented
6209f3b0ac34SDag-Erling Smørgravdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6210f3b0ac34SDag-Erling Smørgravdnl    [Compiler flag to generate thread safe objects])
6211f3b0ac34SDag-Erling Smørgrav])# _LT_LINKER_SHLIBS
6212f3b0ac34SDag-Erling Smørgrav
6213f3b0ac34SDag-Erling Smørgrav
6214f3b0ac34SDag-Erling Smørgrav# _LT_LANG_C_CONFIG([TAG])
6215f3b0ac34SDag-Erling Smørgrav# ------------------------
6216f3b0ac34SDag-Erling Smørgrav# Ensure that the configuration variables for a C compiler are suitably
6217f3b0ac34SDag-Erling Smørgrav# defined.  These variables are subsequently used by _LT_CONFIG to write
6218f3b0ac34SDag-Erling Smørgrav# the compiler configuration to 'libtool'.
6219f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG_C_CONFIG],
6220f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_DECL_EGREP])dnl
6221f3b0ac34SDag-Erling Smørgravlt_save_CC=$CC
6222f3b0ac34SDag-Erling SmørgravAC_LANG_PUSH(C)
6223f3b0ac34SDag-Erling Smørgrav
6224f3b0ac34SDag-Erling Smørgrav# Source file extension for C test sources.
6225f3b0ac34SDag-Erling Smørgravac_ext=c
6226f3b0ac34SDag-Erling Smørgrav
6227f3b0ac34SDag-Erling Smørgrav# Object file extension for compiled C test sources.
6228f3b0ac34SDag-Erling Smørgravobjext=o
6229f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(objext, $1)=$objext
6230f3b0ac34SDag-Erling Smørgrav
6231f3b0ac34SDag-Erling Smørgrav# Code to be used in simple compile tests
6232f3b0ac34SDag-Erling Smørgravlt_simple_compile_test_code="int some_variable = 0;"
6233f3b0ac34SDag-Erling Smørgrav
6234f3b0ac34SDag-Erling Smørgrav# Code to be used in simple link tests
6235f3b0ac34SDag-Erling Smørgravlt_simple_link_test_code='int main(){return(0);}'
6236f3b0ac34SDag-Erling Smørgrav
6237f3b0ac34SDag-Erling Smørgrav_LT_TAG_COMPILER
6238f3b0ac34SDag-Erling Smørgrav# Save the default compiler, since it gets overwritten when the other
6239f3b0ac34SDag-Erling Smørgrav# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6240f3b0ac34SDag-Erling Smørgravcompiler_DEFAULT=$CC
6241f3b0ac34SDag-Erling Smørgrav
6242f3b0ac34SDag-Erling Smørgrav# save warnings/boilerplate of simple test code
6243f3b0ac34SDag-Erling Smørgrav_LT_COMPILER_BOILERPLATE
6244f3b0ac34SDag-Erling Smørgrav_LT_LINKER_BOILERPLATE
6245f3b0ac34SDag-Erling Smørgrav
6246f3b0ac34SDag-Erling Smørgrav## CAVEAT EMPTOR:
6247f3b0ac34SDag-Erling Smørgrav## There is no encapsulation within the following macros, do not change
6248f3b0ac34SDag-Erling Smørgrav## the running order or otherwise move them around unless you know exactly
6249f3b0ac34SDag-Erling Smørgrav## what you are doing...
6250f3b0ac34SDag-Erling Smørgravif test -n "$compiler"; then
6251f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_NO_RTTI($1)
6252f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_PIC($1)
6253f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_C_O($1)
6254f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_FILE_LOCKS($1)
6255f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_SHLIBS($1)
6256f3b0ac34SDag-Erling Smørgrav  _LT_SYS_DYNAMIC_LINKER($1)
6257f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_HARDCODE_LIBPATH($1)
6258f3b0ac34SDag-Erling Smørgrav  LT_SYS_DLOPEN_SELF
6259f3b0ac34SDag-Erling Smørgrav  _LT_CMD_STRIPLIB
6260f3b0ac34SDag-Erling Smørgrav
6261f3b0ac34SDag-Erling Smørgrav  # Report what library types will actually be built
6262f3b0ac34SDag-Erling Smørgrav  AC_MSG_CHECKING([if libtool supports shared libraries])
6263f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT([$can_build_shared])
6264f3b0ac34SDag-Erling Smørgrav
6265f3b0ac34SDag-Erling Smørgrav  AC_MSG_CHECKING([whether to build shared libraries])
6266f3b0ac34SDag-Erling Smørgrav  test no = "$can_build_shared" && enable_shared=no
6267f3b0ac34SDag-Erling Smørgrav
6268f3b0ac34SDag-Erling Smørgrav  # On AIX, shared libraries and static libraries use the same namespace, and
6269f3b0ac34SDag-Erling Smørgrav  # are all built from PIC.
6270f3b0ac34SDag-Erling Smørgrav  case $host_os in
6271f3b0ac34SDag-Erling Smørgrav  aix3*)
6272f3b0ac34SDag-Erling Smørgrav    test yes = "$enable_shared" && enable_static=no
6273f3b0ac34SDag-Erling Smørgrav    if test -n "$RANLIB"; then
6274f3b0ac34SDag-Erling Smørgrav      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6275f3b0ac34SDag-Erling Smørgrav      postinstall_cmds='$RANLIB $lib'
6276f3b0ac34SDag-Erling Smørgrav    fi
6277f3b0ac34SDag-Erling Smørgrav    ;;
6278f3b0ac34SDag-Erling Smørgrav
6279f3b0ac34SDag-Erling Smørgrav  aix[[4-9]]*)
6280f3b0ac34SDag-Erling Smørgrav    if test ia64 != "$host_cpu"; then
6281f3b0ac34SDag-Erling Smørgrav      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6282f3b0ac34SDag-Erling Smørgrav      yes,aix,yes) ;;			# shared object as lib.so file only
6283f3b0ac34SDag-Erling Smørgrav      yes,svr4,*) ;;			# shared object as lib.so archive member only
6284f3b0ac34SDag-Erling Smørgrav      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6285f3b0ac34SDag-Erling Smørgrav      esac
6286f3b0ac34SDag-Erling Smørgrav    fi
6287f3b0ac34SDag-Erling Smørgrav    ;;
6288f3b0ac34SDag-Erling Smørgrav  esac
6289f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT([$enable_shared])
6290f3b0ac34SDag-Erling Smørgrav
6291f3b0ac34SDag-Erling Smørgrav  AC_MSG_CHECKING([whether to build static libraries])
6292f3b0ac34SDag-Erling Smørgrav  # Make sure either enable_shared or enable_static is yes.
6293f3b0ac34SDag-Erling Smørgrav  test yes = "$enable_shared" || enable_static=yes
6294f3b0ac34SDag-Erling Smørgrav  AC_MSG_RESULT([$enable_static])
6295f3b0ac34SDag-Erling Smørgrav
6296f3b0ac34SDag-Erling Smørgrav  _LT_CONFIG($1)
6297f3b0ac34SDag-Erling Smørgravfi
6298f3b0ac34SDag-Erling SmørgravAC_LANG_POP
6299f3b0ac34SDag-Erling SmørgravCC=$lt_save_CC
6300f3b0ac34SDag-Erling Smørgrav])# _LT_LANG_C_CONFIG
6301f3b0ac34SDag-Erling Smørgrav
6302f3b0ac34SDag-Erling Smørgrav
6303f3b0ac34SDag-Erling Smørgrav# _LT_LANG_CXX_CONFIG([TAG])
6304f3b0ac34SDag-Erling Smørgrav# --------------------------
6305f3b0ac34SDag-Erling Smørgrav# Ensure that the configuration variables for a C++ compiler are suitably
6306f3b0ac34SDag-Erling Smørgrav# defined.  These variables are subsequently used by _LT_CONFIG to write
6307f3b0ac34SDag-Erling Smørgrav# the compiler configuration to 'libtool'.
6308f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG_CXX_CONFIG],
6309f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6310f3b0ac34SDag-Erling Smørgravm4_require([_LT_DECL_EGREP])dnl
6311f3b0ac34SDag-Erling Smørgravm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6312f3b0ac34SDag-Erling Smørgravif test -n "$CXX" && ( test no != "$CXX" &&
6313f3b0ac34SDag-Erling Smørgrav    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6314f3b0ac34SDag-Erling Smørgrav    (test g++ != "$CXX"))); then
6315f3b0ac34SDag-Erling Smørgrav  AC_PROG_CXXCPP
6316f3b0ac34SDag-Erling Smørgravelse
6317f3b0ac34SDag-Erling Smørgrav  _lt_caught_CXX_error=yes
6318f3b0ac34SDag-Erling Smørgravfi
6319f3b0ac34SDag-Erling Smørgrav
6320f3b0ac34SDag-Erling SmørgravAC_LANG_PUSH(C++)
6321f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6322f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(allow_undefined_flag, $1)=
6323f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(always_export_symbols, $1)=no
6324f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(archive_expsym_cmds, $1)=
6325f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(compiler_needs_object, $1)=no
6326f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6327f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_direct, $1)=no
6328f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6329f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6330f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_libdir_separator, $1)=
6331f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_minus_L, $1)=no
6332f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6333f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_automatic, $1)=no
6334f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(inherit_rpath, $1)=no
6335f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(module_cmds, $1)=
6336f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(module_expsym_cmds, $1)=
6337f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(link_all_deplibs, $1)=unknown
6338f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6339f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_flag, $1)=$reload_flag
6340f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6341f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(no_undefined_flag, $1)=
6342f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(whole_archive_flag_spec, $1)=
6343f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6344f3b0ac34SDag-Erling Smørgrav
6345f3b0ac34SDag-Erling Smørgrav# Source file extension for C++ test sources.
6346f3b0ac34SDag-Erling Smørgravac_ext=cpp
6347f3b0ac34SDag-Erling Smørgrav
6348f3b0ac34SDag-Erling Smørgrav# Object file extension for compiled C++ test sources.
6349f3b0ac34SDag-Erling Smørgravobjext=o
6350f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(objext, $1)=$objext
6351f3b0ac34SDag-Erling Smørgrav
6352f3b0ac34SDag-Erling Smørgrav# No sense in running all these tests if we already determined that
6353f3b0ac34SDag-Erling Smørgrav# the CXX compiler isn't working.  Some variables (like enable_shared)
6354f3b0ac34SDag-Erling Smørgrav# are currently assumed to apply to all compilers on this platform,
6355f3b0ac34SDag-Erling Smørgrav# and will be corrupted by setting them based on a non-working compiler.
6356f3b0ac34SDag-Erling Smørgravif test yes != "$_lt_caught_CXX_error"; then
6357f3b0ac34SDag-Erling Smørgrav  # Code to be used in simple compile tests
6358f3b0ac34SDag-Erling Smørgrav  lt_simple_compile_test_code="int some_variable = 0;"
6359f3b0ac34SDag-Erling Smørgrav
6360f3b0ac34SDag-Erling Smørgrav  # Code to be used in simple link tests
6361f3b0ac34SDag-Erling Smørgrav  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6362f3b0ac34SDag-Erling Smørgrav
6363f3b0ac34SDag-Erling Smørgrav  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6364f3b0ac34SDag-Erling Smørgrav  _LT_TAG_COMPILER
6365f3b0ac34SDag-Erling Smørgrav
6366f3b0ac34SDag-Erling Smørgrav  # save warnings/boilerplate of simple test code
6367f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_BOILERPLATE
6368f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_BOILERPLATE
6369f3b0ac34SDag-Erling Smørgrav
6370f3b0ac34SDag-Erling Smørgrav  # Allow CC to be a program name with arguments.
6371f3b0ac34SDag-Erling Smørgrav  lt_save_CC=$CC
6372f3b0ac34SDag-Erling Smørgrav  lt_save_CFLAGS=$CFLAGS
6373f3b0ac34SDag-Erling Smørgrav  lt_save_LD=$LD
6374f3b0ac34SDag-Erling Smørgrav  lt_save_GCC=$GCC
6375f3b0ac34SDag-Erling Smørgrav  GCC=$GXX
6376f3b0ac34SDag-Erling Smørgrav  lt_save_with_gnu_ld=$with_gnu_ld
6377f3b0ac34SDag-Erling Smørgrav  lt_save_path_LD=$lt_cv_path_LD
6378f3b0ac34SDag-Erling Smørgrav  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6379f3b0ac34SDag-Erling Smørgrav    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6380f3b0ac34SDag-Erling Smørgrav  else
6381f3b0ac34SDag-Erling Smørgrav    $as_unset lt_cv_prog_gnu_ld
6382f3b0ac34SDag-Erling Smørgrav  fi
6383f3b0ac34SDag-Erling Smørgrav  if test -n "${lt_cv_path_LDCXX+set}"; then
6384f3b0ac34SDag-Erling Smørgrav    lt_cv_path_LD=$lt_cv_path_LDCXX
6385f3b0ac34SDag-Erling Smørgrav  else
6386f3b0ac34SDag-Erling Smørgrav    $as_unset lt_cv_path_LD
6387f3b0ac34SDag-Erling Smørgrav  fi
6388f3b0ac34SDag-Erling Smørgrav  test -z "${LDCXX+set}" || LD=$LDCXX
6389f3b0ac34SDag-Erling Smørgrav  CC=${CXX-"c++"}
6390f3b0ac34SDag-Erling Smørgrav  CFLAGS=$CXXFLAGS
6391f3b0ac34SDag-Erling Smørgrav  compiler=$CC
6392f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(compiler, $1)=$CC
6393f3b0ac34SDag-Erling Smørgrav  _LT_CC_BASENAME([$compiler])
6394f3b0ac34SDag-Erling Smørgrav
6395f3b0ac34SDag-Erling Smørgrav  if test -n "$compiler"; then
6396f3b0ac34SDag-Erling Smørgrav    # We don't want -fno-exception when compiling C++ code, so set the
6397f3b0ac34SDag-Erling Smørgrav    # no_builtin_flag separately
6398f3b0ac34SDag-Erling Smørgrav    if test yes = "$GXX"; then
6399f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6400f3b0ac34SDag-Erling Smørgrav    else
6401f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6402f3b0ac34SDag-Erling Smørgrav    fi
6403f3b0ac34SDag-Erling Smørgrav
6404f3b0ac34SDag-Erling Smørgrav    if test yes = "$GXX"; then
6405f3b0ac34SDag-Erling Smørgrav      # Set up default GNU C++ configuration
6406f3b0ac34SDag-Erling Smørgrav
6407f3b0ac34SDag-Erling Smørgrav      LT_PATH_LD
6408f3b0ac34SDag-Erling Smørgrav
6409f3b0ac34SDag-Erling Smørgrav      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6410f3b0ac34SDag-Erling Smørgrav      # archiving commands below assume that GNU ld is being used.
6411f3b0ac34SDag-Erling Smørgrav      if test yes = "$with_gnu_ld"; then
6412f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6413f3b0ac34SDag-Erling Smørgrav        _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'
6414f3b0ac34SDag-Erling Smørgrav
6415f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6416f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6417f3b0ac34SDag-Erling Smørgrav
6418f3b0ac34SDag-Erling Smørgrav        # If archive_cmds runs LD, not CC, wlarc should be empty
6419f3b0ac34SDag-Erling Smørgrav        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6420f3b0ac34SDag-Erling Smørgrav        #     investigate it a little bit more. (MM)
6421f3b0ac34SDag-Erling Smørgrav        wlarc='$wl'
6422f3b0ac34SDag-Erling Smørgrav
6423f3b0ac34SDag-Erling Smørgrav        # ancient GNU ld didn't support --whole-archive et. al.
6424f3b0ac34SDag-Erling Smørgrav        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6425f3b0ac34SDag-Erling Smørgrav	  $GREP 'no-whole-archive' > /dev/null; then
6426f3b0ac34SDag-Erling Smørgrav          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6427f3b0ac34SDag-Erling Smørgrav        else
6428f3b0ac34SDag-Erling Smørgrav          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6429f3b0ac34SDag-Erling Smørgrav        fi
6430f3b0ac34SDag-Erling Smørgrav      else
6431f3b0ac34SDag-Erling Smørgrav        with_gnu_ld=no
6432f3b0ac34SDag-Erling Smørgrav        wlarc=
6433f3b0ac34SDag-Erling Smørgrav
6434f3b0ac34SDag-Erling Smørgrav        # A generic and very simple default shared library creation
6435f3b0ac34SDag-Erling Smørgrav        # command for GNU C++ for the case where it uses the native
6436f3b0ac34SDag-Erling Smørgrav        # linker, instead of GNU ld.  If possible, this setting should
6437f3b0ac34SDag-Erling Smørgrav        # overridden to take advantage of the native linker features on
6438f3b0ac34SDag-Erling Smørgrav        # the platform it is being used on.
6439f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6440f3b0ac34SDag-Erling Smørgrav      fi
6441f3b0ac34SDag-Erling Smørgrav
6442f3b0ac34SDag-Erling Smørgrav      # Commands to make compiler produce verbose output that lists
6443f3b0ac34SDag-Erling Smørgrav      # what "hidden" libraries, object files and flags are used when
6444f3b0ac34SDag-Erling Smørgrav      # linking a shared library.
6445f3b0ac34SDag-Erling Smørgrav      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6446f3b0ac34SDag-Erling Smørgrav
6447f3b0ac34SDag-Erling Smørgrav    else
6448f3b0ac34SDag-Erling Smørgrav      GXX=no
6449f3b0ac34SDag-Erling Smørgrav      with_gnu_ld=no
6450f3b0ac34SDag-Erling Smørgrav      wlarc=
6451f3b0ac34SDag-Erling Smørgrav    fi
6452f3b0ac34SDag-Erling Smørgrav
6453f3b0ac34SDag-Erling Smørgrav    # PORTME: fill in a description of your system's C++ link characteristics
6454f3b0ac34SDag-Erling Smørgrav    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6455f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(ld_shlibs, $1)=yes
6456f3b0ac34SDag-Erling Smørgrav    case $host_os in
6457f3b0ac34SDag-Erling Smørgrav      aix3*)
6458f3b0ac34SDag-Erling Smørgrav        # FIXME: insert proper C++ library support
6459f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=no
6460f3b0ac34SDag-Erling Smørgrav        ;;
6461f3b0ac34SDag-Erling Smørgrav      aix[[4-9]]*)
6462f3b0ac34SDag-Erling Smørgrav        if test ia64 = "$host_cpu"; then
6463f3b0ac34SDag-Erling Smørgrav          # On IA64, the linker does run time linking by default, so we don't
6464f3b0ac34SDag-Erling Smørgrav          # have to do anything special.
6465f3b0ac34SDag-Erling Smørgrav          aix_use_runtimelinking=no
6466f3b0ac34SDag-Erling Smørgrav          exp_sym_flag='-Bexport'
6467f3b0ac34SDag-Erling Smørgrav          no_entry_flag=
6468f3b0ac34SDag-Erling Smørgrav        else
6469f3b0ac34SDag-Erling Smørgrav          aix_use_runtimelinking=no
6470f3b0ac34SDag-Erling Smørgrav
6471f3b0ac34SDag-Erling Smørgrav          # Test if we are trying to use run time linking or normal
6472f3b0ac34SDag-Erling Smørgrav          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6473f3b0ac34SDag-Erling Smørgrav          # have runtime linking enabled, and use it for executables.
6474f3b0ac34SDag-Erling Smørgrav          # For shared libraries, we enable/disable runtime linking
6475f3b0ac34SDag-Erling Smørgrav          # depending on the kind of the shared library created -
6476f3b0ac34SDag-Erling Smørgrav          # when "with_aix_soname,aix_use_runtimelinking" is:
6477f3b0ac34SDag-Erling Smørgrav          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6478f3b0ac34SDag-Erling Smørgrav          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6479f3b0ac34SDag-Erling Smørgrav          #            lib.a           static archive
6480f3b0ac34SDag-Erling Smørgrav          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6481f3b0ac34SDag-Erling Smørgrav          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6482f3b0ac34SDag-Erling Smørgrav          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6483f3b0ac34SDag-Erling Smørgrav          #            lib.a(lib.so.V) shared, rtl:no
6484f3b0ac34SDag-Erling Smørgrav          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6485f3b0ac34SDag-Erling Smørgrav          #            lib.a           static archive
6486f3b0ac34SDag-Erling Smørgrav          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6487f3b0ac34SDag-Erling Smørgrav	    for ld_flag in $LDFLAGS; do
6488f3b0ac34SDag-Erling Smørgrav	      case $ld_flag in
6489f3b0ac34SDag-Erling Smørgrav	      *-brtl*)
6490f3b0ac34SDag-Erling Smørgrav	        aix_use_runtimelinking=yes
6491f3b0ac34SDag-Erling Smørgrav	        break
6492f3b0ac34SDag-Erling Smørgrav	        ;;
6493f3b0ac34SDag-Erling Smørgrav	      esac
6494f3b0ac34SDag-Erling Smørgrav	    done
6495f3b0ac34SDag-Erling Smørgrav	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6496f3b0ac34SDag-Erling Smørgrav	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6497f3b0ac34SDag-Erling Smørgrav	      # so we don't have lib.a shared libs to link our executables.
6498f3b0ac34SDag-Erling Smørgrav	      # We have to force runtime linking in this case.
6499f3b0ac34SDag-Erling Smørgrav	      aix_use_runtimelinking=yes
6500f3b0ac34SDag-Erling Smørgrav	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6501f3b0ac34SDag-Erling Smørgrav	    fi
6502f3b0ac34SDag-Erling Smørgrav	    ;;
6503f3b0ac34SDag-Erling Smørgrav          esac
6504f3b0ac34SDag-Erling Smørgrav
6505f3b0ac34SDag-Erling Smørgrav          exp_sym_flag='-bexport'
6506f3b0ac34SDag-Erling Smørgrav          no_entry_flag='-bnoentry'
6507f3b0ac34SDag-Erling Smørgrav        fi
6508f3b0ac34SDag-Erling Smørgrav
6509f3b0ac34SDag-Erling Smørgrav        # When large executables or shared objects are built, AIX ld can
6510f3b0ac34SDag-Erling Smørgrav        # have problems creating the table of contents.  If linking a library
6511f3b0ac34SDag-Erling Smørgrav        # or program results in "error TOC overflow" add -mminimal-toc to
6512f3b0ac34SDag-Erling Smørgrav        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6513f3b0ac34SDag-Erling Smørgrav        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6514f3b0ac34SDag-Erling Smørgrav
6515f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(archive_cmds, $1)=''
6516f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_direct, $1)=yes
6517f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6518f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6519f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(link_all_deplibs, $1)=yes
6520f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6521f3b0ac34SDag-Erling Smørgrav        case $with_aix_soname,$aix_use_runtimelinking in
6522f3b0ac34SDag-Erling Smørgrav        aix,*) ;;	# no import file
6523f3b0ac34SDag-Erling Smørgrav        svr4,* | *,yes) # use import file
6524f3b0ac34SDag-Erling Smørgrav          # The Import File defines what to hardcode.
6525f3b0ac34SDag-Erling Smørgrav          _LT_TAGVAR(hardcode_direct, $1)=no
6526f3b0ac34SDag-Erling Smørgrav          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6527f3b0ac34SDag-Erling Smørgrav          ;;
6528f3b0ac34SDag-Erling Smørgrav        esac
6529f3b0ac34SDag-Erling Smørgrav
6530f3b0ac34SDag-Erling Smørgrav        if test yes = "$GXX"; then
6531f3b0ac34SDag-Erling Smørgrav          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6532f3b0ac34SDag-Erling Smørgrav          # We only want to do this on AIX 4.2 and lower, the check
6533f3b0ac34SDag-Erling Smørgrav          # below for broken collect2 doesn't work under 4.3+
6534f3b0ac34SDag-Erling Smørgrav	  collect2name=`$CC -print-prog-name=collect2`
6535f3b0ac34SDag-Erling Smørgrav	  if test -f "$collect2name" &&
6536f3b0ac34SDag-Erling Smørgrav	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6537f3b0ac34SDag-Erling Smørgrav	  then
6538f3b0ac34SDag-Erling Smørgrav	    # We have reworked collect2
6539f3b0ac34SDag-Erling Smørgrav	    :
6540f3b0ac34SDag-Erling Smørgrav	  else
6541f3b0ac34SDag-Erling Smørgrav	    # We have old collect2
6542f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6543f3b0ac34SDag-Erling Smørgrav	    # It fails to find uninstalled libraries when the uninstalled
6544f3b0ac34SDag-Erling Smørgrav	    # path is not listed in the libpath.  Setting hardcode_minus_L
6545f3b0ac34SDag-Erling Smørgrav	    # to unsupported forces relinking
6546f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6547f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6548f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6549f3b0ac34SDag-Erling Smørgrav	  fi
6550f3b0ac34SDag-Erling Smørgrav          esac
6551f3b0ac34SDag-Erling Smørgrav          shared_flag='-shared'
6552f3b0ac34SDag-Erling Smørgrav	  if test yes = "$aix_use_runtimelinking"; then
6553f3b0ac34SDag-Erling Smørgrav	    shared_flag=$shared_flag' $wl-G'
6554f3b0ac34SDag-Erling Smørgrav	  fi
6555f3b0ac34SDag-Erling Smørgrav	  # Need to ensure runtime linking is disabled for the traditional
6556f3b0ac34SDag-Erling Smørgrav	  # shared library, or the linker may eventually find shared libraries
6557f3b0ac34SDag-Erling Smørgrav	  # /with/ Import File - we do not want to mix them.
6558f3b0ac34SDag-Erling Smørgrav	  shared_flag_aix='-shared'
6559f3b0ac34SDag-Erling Smørgrav	  shared_flag_svr4='-shared $wl-G'
6560f3b0ac34SDag-Erling Smørgrav        else
6561f3b0ac34SDag-Erling Smørgrav          # not using gcc
6562f3b0ac34SDag-Erling Smørgrav          if test ia64 = "$host_cpu"; then
6563f3b0ac34SDag-Erling Smørgrav	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6564f3b0ac34SDag-Erling Smørgrav	  # chokes on -Wl,-G. The following line is correct:
6565f3b0ac34SDag-Erling Smørgrav	  shared_flag='-G'
6566f3b0ac34SDag-Erling Smørgrav          else
6567f3b0ac34SDag-Erling Smørgrav	    if test yes = "$aix_use_runtimelinking"; then
6568f3b0ac34SDag-Erling Smørgrav	      shared_flag='$wl-G'
6569f3b0ac34SDag-Erling Smørgrav	    else
6570f3b0ac34SDag-Erling Smørgrav	      shared_flag='$wl-bM:SRE'
6571f3b0ac34SDag-Erling Smørgrav	    fi
6572f3b0ac34SDag-Erling Smørgrav	    shared_flag_aix='$wl-bM:SRE'
6573f3b0ac34SDag-Erling Smørgrav	    shared_flag_svr4='$wl-G'
6574f3b0ac34SDag-Erling Smørgrav          fi
6575f3b0ac34SDag-Erling Smørgrav        fi
6576f3b0ac34SDag-Erling Smørgrav
6577f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6578f3b0ac34SDag-Erling Smørgrav        # It seems that -bexpall does not export symbols beginning with
6579f3b0ac34SDag-Erling Smørgrav        # underscore (_), so it is better to generate a list of symbols to
6580f3b0ac34SDag-Erling Smørgrav	# export.
6581f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(always_export_symbols, $1)=yes
6582f3b0ac34SDag-Erling Smørgrav	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6583f3b0ac34SDag-Erling Smørgrav          # Warning - without using the other runtime loading flags (-brtl),
6584f3b0ac34SDag-Erling Smørgrav          # -berok will link without error, but may produce a broken library.
6585f3b0ac34SDag-Erling Smørgrav          # The "-G" linker flag allows undefined symbols.
6586f3b0ac34SDag-Erling Smørgrav          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6587f3b0ac34SDag-Erling Smørgrav          # Determine the default libpath from the value encoded in an empty
6588f3b0ac34SDag-Erling Smørgrav          # executable.
6589f3b0ac34SDag-Erling Smørgrav          _LT_SYS_MODULE_PATH_AIX([$1])
6590f3b0ac34SDag-Erling Smørgrav          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6591f3b0ac34SDag-Erling Smørgrav
6592f3b0ac34SDag-Erling Smørgrav          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
6593f3b0ac34SDag-Erling Smørgrav        else
6594f3b0ac34SDag-Erling Smørgrav          if test ia64 = "$host_cpu"; then
6595f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6596f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6597f3b0ac34SDag-Erling Smørgrav	    _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"
6598f3b0ac34SDag-Erling Smørgrav          else
6599f3b0ac34SDag-Erling Smørgrav	    # Determine the default libpath from the value encoded in an
6600f3b0ac34SDag-Erling Smørgrav	    # empty executable.
6601f3b0ac34SDag-Erling Smørgrav	    _LT_SYS_MODULE_PATH_AIX([$1])
6602f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6603f3b0ac34SDag-Erling Smørgrav	    # Warning - without using the other run time loading flags,
6604f3b0ac34SDag-Erling Smørgrav	    # -berok will link without error, but may produce a broken library.
6605f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6606f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6607f3b0ac34SDag-Erling Smørgrav	    if test yes = "$with_gnu_ld"; then
6608f3b0ac34SDag-Erling Smørgrav	      # We only use this code for GNU lds that support --whole-archive.
6609f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6610f3b0ac34SDag-Erling Smørgrav	    else
6611f3b0ac34SDag-Erling Smørgrav	      # Exported symbols can be pulled into shared objects from archives
6612f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6613f3b0ac34SDag-Erling Smørgrav	    fi
6614f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6615f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6616f3b0ac34SDag-Erling Smørgrav	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6617f3b0ac34SDag-Erling Smørgrav	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6618f3b0ac34SDag-Erling Smørgrav	    if test svr4 != "$with_aix_soname"; then
6619f3b0ac34SDag-Erling Smørgrav	      # This is similar to how AIX traditionally builds its shared
6620f3b0ac34SDag-Erling Smørgrav	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6621f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
6622f3b0ac34SDag-Erling Smørgrav	    fi
6623f3b0ac34SDag-Erling Smørgrav	    if test aix != "$with_aix_soname"; then
6624f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
6625f3b0ac34SDag-Erling Smørgrav	    else
6626f3b0ac34SDag-Erling Smørgrav	      # used by -dlpreopen to get the symbols
6627f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6628f3b0ac34SDag-Erling Smørgrav	    fi
6629f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6630f3b0ac34SDag-Erling Smørgrav          fi
6631f3b0ac34SDag-Erling Smørgrav        fi
6632f3b0ac34SDag-Erling Smørgrav        ;;
6633f3b0ac34SDag-Erling Smørgrav
6634f3b0ac34SDag-Erling Smørgrav      beos*)
6635f3b0ac34SDag-Erling Smørgrav	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6636f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6637f3b0ac34SDag-Erling Smørgrav	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6638f3b0ac34SDag-Erling Smørgrav	  # support --undefined.  This deserves some investigation.  FIXME
6639f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6640f3b0ac34SDag-Erling Smørgrav	else
6641f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(ld_shlibs, $1)=no
6642f3b0ac34SDag-Erling Smørgrav	fi
6643f3b0ac34SDag-Erling Smørgrav	;;
6644f3b0ac34SDag-Erling Smørgrav
6645f3b0ac34SDag-Erling Smørgrav      chorus*)
6646f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
6647f3b0ac34SDag-Erling Smørgrav          *)
6648f3b0ac34SDag-Erling Smørgrav	  # FIXME: insert proper C++ library support
6649f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(ld_shlibs, $1)=no
6650f3b0ac34SDag-Erling Smørgrav	  ;;
6651f3b0ac34SDag-Erling Smørgrav        esac
6652f3b0ac34SDag-Erling Smørgrav        ;;
6653f3b0ac34SDag-Erling Smørgrav
6654f3b0ac34SDag-Erling Smørgrav      cygwin* | mingw* | pw32* | cegcc*)
6655f3b0ac34SDag-Erling Smørgrav	case $GXX,$cc_basename in
6656*3ba4c8c8SDag-Erling Smørgrav	,cl* | no,cl* | ,icl* | no,icl*)
6657*3ba4c8c8SDag-Erling Smørgrav	  # Native MSVC or ICC
6658f3b0ac34SDag-Erling Smørgrav	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6659f3b0ac34SDag-Erling Smørgrav	  # no search path for DLLs.
6660f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6661f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6662f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(always_export_symbols, $1)=yes
6663f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(file_list_spec, $1)='@'
6664f3b0ac34SDag-Erling Smørgrav	  # Tell ltmain to make .lib files, not .a files.
6665f3b0ac34SDag-Erling Smørgrav	  libext=lib
6666f3b0ac34SDag-Erling Smørgrav	  # Tell ltmain to make .dll files, not .so files.
6667f3b0ac34SDag-Erling Smørgrav	  shrext_cmds=.dll
6668f3b0ac34SDag-Erling Smørgrav	  # FIXME: Setting linknames here is a bad hack.
6669f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6670f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6671f3b0ac34SDag-Erling Smørgrav              cp "$export_symbols" "$output_objdir/$soname.def";
6672f3b0ac34SDag-Erling Smørgrav              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6673f3b0ac34SDag-Erling Smørgrav            else
6674f3b0ac34SDag-Erling Smørgrav              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6675f3b0ac34SDag-Erling Smørgrav            fi~
6676f3b0ac34SDag-Erling Smørgrav            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6677f3b0ac34SDag-Erling Smørgrav            linknames='
6678f3b0ac34SDag-Erling Smørgrav	  # The linker will not automatically build a static lib if we build a DLL.
6679f3b0ac34SDag-Erling Smørgrav	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6680f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6681f3b0ac34SDag-Erling Smørgrav	  # Don't use ranlib
6682f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6683f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6684f3b0ac34SDag-Erling Smørgrav            lt_tool_outputfile="@TOOL_OUTPUT@"~
6685f3b0ac34SDag-Erling Smørgrav            case $lt_outputfile in
6686f3b0ac34SDag-Erling Smørgrav              *.exe|*.EXE) ;;
6687f3b0ac34SDag-Erling Smørgrav              *)
6688f3b0ac34SDag-Erling Smørgrav                lt_outputfile=$lt_outputfile.exe
6689f3b0ac34SDag-Erling Smørgrav                lt_tool_outputfile=$lt_tool_outputfile.exe
6690f3b0ac34SDag-Erling Smørgrav                ;;
6691f3b0ac34SDag-Erling Smørgrav            esac~
6692f3b0ac34SDag-Erling Smørgrav            func_to_tool_file "$lt_outputfile"~
6693f3b0ac34SDag-Erling Smørgrav            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6694f3b0ac34SDag-Erling Smørgrav              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6695f3b0ac34SDag-Erling Smørgrav              $RM "$lt_outputfile.manifest";
6696f3b0ac34SDag-Erling Smørgrav            fi'
6697f3b0ac34SDag-Erling Smørgrav	  ;;
6698f3b0ac34SDag-Erling Smørgrav	*)
6699f3b0ac34SDag-Erling Smørgrav	  # g++
6700f3b0ac34SDag-Erling Smørgrav	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6701f3b0ac34SDag-Erling Smørgrav	  # as there is no search path for DLLs.
6702f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6703f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6704f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6705f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(always_export_symbols, $1)=no
6706f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6707f3b0ac34SDag-Erling Smørgrav
6708f3b0ac34SDag-Erling Smørgrav	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6709f3b0ac34SDag-Erling Smørgrav	    _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'
6710f3b0ac34SDag-Erling Smørgrav	    # If the export-symbols file already is a .def file, use it as
6711f3b0ac34SDag-Erling Smørgrav	    # is; otherwise, prepend EXPORTS...
6712f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6713f3b0ac34SDag-Erling Smørgrav              cp $export_symbols $output_objdir/$soname.def;
6714f3b0ac34SDag-Erling Smørgrav            else
6715f3b0ac34SDag-Erling Smørgrav              echo EXPORTS > $output_objdir/$soname.def;
6716f3b0ac34SDag-Erling Smørgrav              cat $export_symbols >> $output_objdir/$soname.def;
6717f3b0ac34SDag-Erling Smørgrav            fi~
6718f3b0ac34SDag-Erling Smørgrav            $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'
6719f3b0ac34SDag-Erling Smørgrav	  else
6720f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
6721f3b0ac34SDag-Erling Smørgrav	  fi
6722f3b0ac34SDag-Erling Smørgrav	  ;;
6723f3b0ac34SDag-Erling Smørgrav	esac
6724f3b0ac34SDag-Erling Smørgrav	;;
6725f3b0ac34SDag-Erling Smørgrav      darwin* | rhapsody*)
6726f3b0ac34SDag-Erling Smørgrav        _LT_DARWIN_LINKER_FEATURES($1)
6727f3b0ac34SDag-Erling Smørgrav	;;
6728f3b0ac34SDag-Erling Smørgrav
6729f3b0ac34SDag-Erling Smørgrav      os2*)
6730f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6731f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6732f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6733f3b0ac34SDag-Erling Smørgrav	shrext_cmds=.dll
6734f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6735f3b0ac34SDag-Erling Smørgrav	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6736f3b0ac34SDag-Erling Smørgrav	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6737f3b0ac34SDag-Erling Smørgrav	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6738f3b0ac34SDag-Erling Smørgrav	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6739f3b0ac34SDag-Erling Smørgrav	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6740f3b0ac34SDag-Erling Smørgrav	  emximp -o $lib $output_objdir/$libname.def'
6741f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6742f3b0ac34SDag-Erling Smørgrav	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6743f3b0ac34SDag-Erling Smørgrav	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6744f3b0ac34SDag-Erling Smørgrav	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6745f3b0ac34SDag-Erling Smørgrav	  prefix_cmds="$SED"~
6746f3b0ac34SDag-Erling Smørgrav	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6747f3b0ac34SDag-Erling Smørgrav	    prefix_cmds="$prefix_cmds -e 1d";
6748f3b0ac34SDag-Erling Smørgrav	  fi~
6749f3b0ac34SDag-Erling Smørgrav	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6750f3b0ac34SDag-Erling Smørgrav	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6751f3b0ac34SDag-Erling Smørgrav	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6752f3b0ac34SDag-Erling Smørgrav	  emximp -o $lib $output_objdir/$libname.def'
6753f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6754f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6755*3ba4c8c8SDag-Erling Smørgrav	_LT_TAGVAR(file_list_spec, $1)='@'
6756f3b0ac34SDag-Erling Smørgrav	;;
6757f3b0ac34SDag-Erling Smørgrav
6758f3b0ac34SDag-Erling Smørgrav      dgux*)
6759f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
6760f3b0ac34SDag-Erling Smørgrav          ec++*)
6761f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
6762f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
6763f3b0ac34SDag-Erling Smørgrav	    ;;
6764f3b0ac34SDag-Erling Smørgrav          ghcx*)
6765f3b0ac34SDag-Erling Smørgrav	    # Green Hills C++ Compiler
6766f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
6767f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
6768f3b0ac34SDag-Erling Smørgrav	    ;;
6769f3b0ac34SDag-Erling Smørgrav          *)
6770f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
6771f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
6772f3b0ac34SDag-Erling Smørgrav	    ;;
6773f3b0ac34SDag-Erling Smørgrav        esac
6774f3b0ac34SDag-Erling Smørgrav        ;;
6775f3b0ac34SDag-Erling Smørgrav
6776f3b0ac34SDag-Erling Smørgrav      freebsd2.*)
6777f3b0ac34SDag-Erling Smørgrav        # C++ shared libraries reported to be fairly broken before
6778f3b0ac34SDag-Erling Smørgrav	# switch to ELF
6779f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=no
6780f3b0ac34SDag-Erling Smørgrav        ;;
6781f3b0ac34SDag-Erling Smørgrav
6782f3b0ac34SDag-Erling Smørgrav      freebsd-elf*)
6783f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6784f3b0ac34SDag-Erling Smørgrav        ;;
6785f3b0ac34SDag-Erling Smørgrav
6786*3ba4c8c8SDag-Erling Smørgrav      freebsd* | dragonfly* | midnightbsd*)
6787f3b0ac34SDag-Erling Smørgrav        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6788f3b0ac34SDag-Erling Smørgrav        # conventions
6789f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=yes
6790f3b0ac34SDag-Erling Smørgrav        ;;
6791f3b0ac34SDag-Erling Smørgrav
6792f3b0ac34SDag-Erling Smørgrav      haiku*)
6793f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6794f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(link_all_deplibs, $1)=yes
6795f3b0ac34SDag-Erling Smørgrav        ;;
6796f3b0ac34SDag-Erling Smørgrav
6797f3b0ac34SDag-Erling Smørgrav      hpux9*)
6798f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6799f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6800f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6801f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_direct, $1)=yes
6802f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6803f3b0ac34SDag-Erling Smørgrav				             # but as the default
6804f3b0ac34SDag-Erling Smørgrav				             # location of the library.
6805f3b0ac34SDag-Erling Smørgrav
6806f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
6807f3b0ac34SDag-Erling Smørgrav          CC*)
6808f3b0ac34SDag-Erling Smørgrav            # FIXME: insert proper C++ library support
6809f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(ld_shlibs, $1)=no
6810f3b0ac34SDag-Erling Smørgrav            ;;
6811f3b0ac34SDag-Erling Smørgrav          aCC*)
6812f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6813f3b0ac34SDag-Erling Smørgrav            # Commands to make compiler produce verbose output that lists
6814f3b0ac34SDag-Erling Smørgrav            # what "hidden" libraries, object files and flags are used when
6815f3b0ac34SDag-Erling Smørgrav            # linking a shared library.
6816f3b0ac34SDag-Erling Smørgrav            #
6817f3b0ac34SDag-Erling Smørgrav            # There doesn't appear to be a way to prevent this compiler from
6818f3b0ac34SDag-Erling Smørgrav            # explicitly linking system object files so we need to strip them
6819f3b0ac34SDag-Erling Smørgrav            # from the output so that they don't get included in the library
6820f3b0ac34SDag-Erling Smørgrav            # dependencies.
6821f3b0ac34SDag-Erling Smørgrav            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"'
6822f3b0ac34SDag-Erling Smørgrav            ;;
6823f3b0ac34SDag-Erling Smørgrav          *)
6824f3b0ac34SDag-Erling Smørgrav            if test yes = "$GXX"; then
6825f3b0ac34SDag-Erling Smørgrav              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6826f3b0ac34SDag-Erling Smørgrav            else
6827f3b0ac34SDag-Erling Smørgrav              # FIXME: insert proper C++ library support
6828f3b0ac34SDag-Erling Smørgrav              _LT_TAGVAR(ld_shlibs, $1)=no
6829f3b0ac34SDag-Erling Smørgrav            fi
6830f3b0ac34SDag-Erling Smørgrav            ;;
6831f3b0ac34SDag-Erling Smørgrav        esac
6832f3b0ac34SDag-Erling Smørgrav        ;;
6833f3b0ac34SDag-Erling Smørgrav
6834f3b0ac34SDag-Erling Smørgrav      hpux10*|hpux11*)
6835f3b0ac34SDag-Erling Smørgrav        if test no = "$with_gnu_ld"; then
6836f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6837f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6838f3b0ac34SDag-Erling Smørgrav
6839f3b0ac34SDag-Erling Smørgrav          case $host_cpu in
6840f3b0ac34SDag-Erling Smørgrav            hppa*64*|ia64*)
6841f3b0ac34SDag-Erling Smørgrav              ;;
6842f3b0ac34SDag-Erling Smørgrav            *)
6843f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6844f3b0ac34SDag-Erling Smørgrav              ;;
6845f3b0ac34SDag-Erling Smørgrav          esac
6846f3b0ac34SDag-Erling Smørgrav        fi
6847f3b0ac34SDag-Erling Smørgrav        case $host_cpu in
6848f3b0ac34SDag-Erling Smørgrav          hppa*64*|ia64*)
6849f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_direct, $1)=no
6850f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6851f3b0ac34SDag-Erling Smørgrav            ;;
6852f3b0ac34SDag-Erling Smørgrav          *)
6853f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_direct, $1)=yes
6854f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6855f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6856f3b0ac34SDag-Erling Smørgrav					         # but as the default
6857f3b0ac34SDag-Erling Smørgrav					         # location of the library.
6858f3b0ac34SDag-Erling Smørgrav            ;;
6859f3b0ac34SDag-Erling Smørgrav        esac
6860f3b0ac34SDag-Erling Smørgrav
6861f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
6862f3b0ac34SDag-Erling Smørgrav          CC*)
6863f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
6864f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
6865f3b0ac34SDag-Erling Smørgrav	    ;;
6866f3b0ac34SDag-Erling Smørgrav          aCC*)
6867f3b0ac34SDag-Erling Smørgrav	    case $host_cpu in
6868f3b0ac34SDag-Erling Smørgrav	      hppa*64*)
6869f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6870f3b0ac34SDag-Erling Smørgrav	        ;;
6871f3b0ac34SDag-Erling Smørgrav	      ia64*)
6872f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6873f3b0ac34SDag-Erling Smørgrav	        ;;
6874f3b0ac34SDag-Erling Smørgrav	      *)
6875f3b0ac34SDag-Erling Smørgrav	        _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'
6876f3b0ac34SDag-Erling Smørgrav	        ;;
6877f3b0ac34SDag-Erling Smørgrav	    esac
6878f3b0ac34SDag-Erling Smørgrav	    # Commands to make compiler produce verbose output that lists
6879f3b0ac34SDag-Erling Smørgrav	    # what "hidden" libraries, object files and flags are used when
6880f3b0ac34SDag-Erling Smørgrav	    # linking a shared library.
6881f3b0ac34SDag-Erling Smørgrav	    #
6882f3b0ac34SDag-Erling Smørgrav	    # There doesn't appear to be a way to prevent this compiler from
6883f3b0ac34SDag-Erling Smørgrav	    # explicitly linking system object files so we need to strip them
6884f3b0ac34SDag-Erling Smørgrav	    # from the output so that they don't get included in the library
6885f3b0ac34SDag-Erling Smørgrav	    # dependencies.
6886f3b0ac34SDag-Erling Smørgrav	    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"'
6887f3b0ac34SDag-Erling Smørgrav	    ;;
6888f3b0ac34SDag-Erling Smørgrav          *)
6889f3b0ac34SDag-Erling Smørgrav	    if test yes = "$GXX"; then
6890f3b0ac34SDag-Erling Smørgrav	      if test no = "$with_gnu_ld"; then
6891f3b0ac34SDag-Erling Smørgrav	        case $host_cpu in
6892f3b0ac34SDag-Erling Smørgrav	          hppa*64*)
6893f3b0ac34SDag-Erling Smørgrav	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6894f3b0ac34SDag-Erling Smørgrav	            ;;
6895f3b0ac34SDag-Erling Smørgrav	          ia64*)
6896f3b0ac34SDag-Erling Smørgrav	            _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'
6897f3b0ac34SDag-Erling Smørgrav	            ;;
6898f3b0ac34SDag-Erling Smørgrav	          *)
6899f3b0ac34SDag-Erling Smørgrav	            _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'
6900f3b0ac34SDag-Erling Smørgrav	            ;;
6901f3b0ac34SDag-Erling Smørgrav	        esac
6902f3b0ac34SDag-Erling Smørgrav	      fi
6903f3b0ac34SDag-Erling Smørgrav	    else
6904f3b0ac34SDag-Erling Smørgrav	      # FIXME: insert proper C++ library support
6905f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(ld_shlibs, $1)=no
6906f3b0ac34SDag-Erling Smørgrav	    fi
6907f3b0ac34SDag-Erling Smørgrav	    ;;
6908f3b0ac34SDag-Erling Smørgrav        esac
6909f3b0ac34SDag-Erling Smørgrav        ;;
6910f3b0ac34SDag-Erling Smørgrav
6911f3b0ac34SDag-Erling Smørgrav      interix[[3-9]]*)
6912f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_direct, $1)=no
6913f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6914f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6915f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6916f3b0ac34SDag-Erling Smørgrav	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6917f3b0ac34SDag-Erling Smørgrav	# Instead, shared libraries are loaded at an image base (0x10000000 by
6918f3b0ac34SDag-Erling Smørgrav	# default) and relocated if they conflict, which is a slow very memory
6919f3b0ac34SDag-Erling Smørgrav	# consuming and fragmenting process.  To avoid this, we pick a random,
6920f3b0ac34SDag-Erling Smørgrav	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6921f3b0ac34SDag-Erling Smørgrav	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6922f3b0ac34SDag-Erling Smørgrav	_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'
6923*3ba4c8c8SDag-Erling Smørgrav	_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'
6924f3b0ac34SDag-Erling Smørgrav	;;
6925f3b0ac34SDag-Erling Smørgrav      irix5* | irix6*)
6926f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
6927f3b0ac34SDag-Erling Smørgrav          CC*)
6928f3b0ac34SDag-Erling Smørgrav	    # SGI C++
6929f3b0ac34SDag-Erling Smørgrav	    _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'
6930f3b0ac34SDag-Erling Smørgrav
6931f3b0ac34SDag-Erling Smørgrav	    # Archives containing C++ object files must be created using
6932f3b0ac34SDag-Erling Smørgrav	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6933f3b0ac34SDag-Erling Smørgrav	    # necessary to make sure instantiated templates are included
6934f3b0ac34SDag-Erling Smørgrav	    # in the archive.
6935f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6936f3b0ac34SDag-Erling Smørgrav	    ;;
6937f3b0ac34SDag-Erling Smørgrav          *)
6938f3b0ac34SDag-Erling Smørgrav	    if test yes = "$GXX"; then
6939f3b0ac34SDag-Erling Smørgrav	      if test no = "$with_gnu_ld"; then
6940f3b0ac34SDag-Erling Smørgrav	        _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'
6941f3b0ac34SDag-Erling Smørgrav	      else
6942f3b0ac34SDag-Erling Smørgrav	        _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'
6943f3b0ac34SDag-Erling Smørgrav	      fi
6944f3b0ac34SDag-Erling Smørgrav	    fi
6945f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6946f3b0ac34SDag-Erling Smørgrav	    ;;
6947f3b0ac34SDag-Erling Smørgrav        esac
6948f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6949f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6950f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(inherit_rpath, $1)=yes
6951f3b0ac34SDag-Erling Smørgrav        ;;
6952f3b0ac34SDag-Erling Smørgrav
6953f3b0ac34SDag-Erling Smørgrav      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6954f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
6955f3b0ac34SDag-Erling Smørgrav          KCC*)
6956f3b0ac34SDag-Erling Smørgrav	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6957f3b0ac34SDag-Erling Smørgrav
6958f3b0ac34SDag-Erling Smørgrav	    # KCC will only create a shared library if the output file
6959f3b0ac34SDag-Erling Smørgrav	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6960f3b0ac34SDag-Erling Smørgrav	    # to its proper name (with version) after linking.
6961f3b0ac34SDag-Erling Smørgrav	    _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'
6962f3b0ac34SDag-Erling Smørgrav	    _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'
6963f3b0ac34SDag-Erling Smørgrav	    # Commands to make compiler produce verbose output that lists
6964f3b0ac34SDag-Erling Smørgrav	    # what "hidden" libraries, object files and flags are used when
6965f3b0ac34SDag-Erling Smørgrav	    # linking a shared library.
6966f3b0ac34SDag-Erling Smørgrav	    #
6967f3b0ac34SDag-Erling Smørgrav	    # There doesn't appear to be a way to prevent this compiler from
6968f3b0ac34SDag-Erling Smørgrav	    # explicitly linking system object files so we need to strip them
6969f3b0ac34SDag-Erling Smørgrav	    # from the output so that they don't get included in the library
6970f3b0ac34SDag-Erling Smørgrav	    # dependencies.
6971f3b0ac34SDag-Erling Smørgrav	    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"'
6972f3b0ac34SDag-Erling Smørgrav
6973f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6974f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6975f3b0ac34SDag-Erling Smørgrav
6976f3b0ac34SDag-Erling Smørgrav	    # Archives containing C++ object files must be created using
6977f3b0ac34SDag-Erling Smørgrav	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6978f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6979f3b0ac34SDag-Erling Smørgrav	    ;;
6980f3b0ac34SDag-Erling Smørgrav	  icpc* | ecpc* )
6981f3b0ac34SDag-Erling Smørgrav	    # Intel C++
6982f3b0ac34SDag-Erling Smørgrav	    with_gnu_ld=yes
6983f3b0ac34SDag-Erling Smørgrav	    # version 8.0 and above of icpc choke on multiply defined symbols
6984f3b0ac34SDag-Erling Smørgrav	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6985f3b0ac34SDag-Erling Smørgrav	    # earlier do not add the objects themselves.
6986f3b0ac34SDag-Erling Smørgrav	    case `$CC -V 2>&1` in
6987f3b0ac34SDag-Erling Smørgrav	      *"Version 7."*)
6988f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6989f3b0ac34SDag-Erling Smørgrav		_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'
6990f3b0ac34SDag-Erling Smørgrav		;;
6991f3b0ac34SDag-Erling Smørgrav	      *)  # Version 8.0 or newer
6992f3b0ac34SDag-Erling Smørgrav	        tmp_idyn=
6993f3b0ac34SDag-Erling Smørgrav	        case $host_cpu in
6994f3b0ac34SDag-Erling Smørgrav		  ia64*) tmp_idyn=' -i_dynamic';;
6995f3b0ac34SDag-Erling Smørgrav		esac
6996f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6997f3b0ac34SDag-Erling Smørgrav		_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'
6998f3b0ac34SDag-Erling Smørgrav		;;
6999f3b0ac34SDag-Erling Smørgrav	    esac
7000f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7001f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7002f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7003f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
7004f3b0ac34SDag-Erling Smørgrav	    ;;
7005f3b0ac34SDag-Erling Smørgrav          pgCC* | pgcpp*)
7006f3b0ac34SDag-Erling Smørgrav            # Portland Group C++ compiler
7007f3b0ac34SDag-Erling Smørgrav	    case `$CC -V` in
7008f3b0ac34SDag-Erling Smørgrav	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7009f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7010f3b0ac34SDag-Erling Smørgrav               rm -rf $tpldir~
7011f3b0ac34SDag-Erling Smørgrav               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7012f3b0ac34SDag-Erling Smørgrav               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7013f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7014f3b0ac34SDag-Erling Smørgrav                rm -rf $tpldir~
7015f3b0ac34SDag-Erling Smørgrav                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7016f3b0ac34SDag-Erling Smørgrav                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7017f3b0ac34SDag-Erling Smørgrav                $RANLIB $oldlib'
7018f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7019f3b0ac34SDag-Erling Smørgrav                rm -rf $tpldir~
7020f3b0ac34SDag-Erling Smørgrav                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7021f3b0ac34SDag-Erling Smørgrav                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7022f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7023f3b0ac34SDag-Erling Smørgrav                rm -rf $tpldir~
7024f3b0ac34SDag-Erling Smørgrav                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7025f3b0ac34SDag-Erling Smørgrav                $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'
7026f3b0ac34SDag-Erling Smørgrav	      ;;
7027f3b0ac34SDag-Erling Smørgrav	    *) # Version 6 and above use weak symbols
7028f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7029f3b0ac34SDag-Erling Smørgrav	      _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'
7030f3b0ac34SDag-Erling Smørgrav	      ;;
7031f3b0ac34SDag-Erling Smørgrav	    esac
7032f3b0ac34SDag-Erling Smørgrav
7033f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7034f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7035f3b0ac34SDag-Erling Smørgrav	    _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'
7036f3b0ac34SDag-Erling Smørgrav            ;;
7037f3b0ac34SDag-Erling Smørgrav	  cxx*)
7038f3b0ac34SDag-Erling Smørgrav	    # Compaq C++
7039f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7040f3b0ac34SDag-Erling Smørgrav	    _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'
7041f3b0ac34SDag-Erling Smørgrav
7042f3b0ac34SDag-Erling Smørgrav	    runpath_var=LD_RUN_PATH
7043f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7044f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7045f3b0ac34SDag-Erling Smørgrav
7046f3b0ac34SDag-Erling Smørgrav	    # Commands to make compiler produce verbose output that lists
7047f3b0ac34SDag-Erling Smørgrav	    # what "hidden" libraries, object files and flags are used when
7048f3b0ac34SDag-Erling Smørgrav	    # linking a shared library.
7049f3b0ac34SDag-Erling Smørgrav	    #
7050f3b0ac34SDag-Erling Smørgrav	    # There doesn't appear to be a way to prevent this compiler from
7051f3b0ac34SDag-Erling Smørgrav	    # explicitly linking system object files so we need to strip them
7052f3b0ac34SDag-Erling Smørgrav	    # from the output so that they don't get included in the library
7053f3b0ac34SDag-Erling Smørgrav	    # dependencies.
7054f3b0ac34SDag-Erling Smørgrav	    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'
7055f3b0ac34SDag-Erling Smørgrav	    ;;
7056f3b0ac34SDag-Erling Smørgrav	  xl* | mpixl* | bgxl*)
7057f3b0ac34SDag-Erling Smørgrav	    # IBM XL 8.0 on PPC, with GNU ld
7058f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7059f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7060f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7061f3b0ac34SDag-Erling Smørgrav	    if test yes = "$supports_anon_versioning"; then
7062f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7063*3ba4c8c8SDag-Erling Smørgrav                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7064f3b0ac34SDag-Erling Smørgrav                echo "local: *; };" >> $output_objdir/$libname.ver~
7065f3b0ac34SDag-Erling Smørgrav                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7066f3b0ac34SDag-Erling Smørgrav	    fi
7067f3b0ac34SDag-Erling Smørgrav	    ;;
7068f3b0ac34SDag-Erling Smørgrav	  *)
7069*3ba4c8c8SDag-Erling Smørgrav	    case `$CC -V 2>&1 | $SED 5q` in
7070f3b0ac34SDag-Erling Smørgrav	    *Sun\ C*)
7071f3b0ac34SDag-Erling Smørgrav	      # Sun C++ 5.9
7072f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7073f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7074f3b0ac34SDag-Erling Smørgrav	      _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'
7075f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7076f3b0ac34SDag-Erling Smørgrav	      _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'
7077f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7078f3b0ac34SDag-Erling Smørgrav
7079f3b0ac34SDag-Erling Smørgrav	      # Not sure whether something based on
7080f3b0ac34SDag-Erling Smørgrav	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7081f3b0ac34SDag-Erling Smørgrav	      # would be better.
7082f3b0ac34SDag-Erling Smørgrav	      output_verbose_link_cmd='func_echo_all'
7083f3b0ac34SDag-Erling Smørgrav
7084f3b0ac34SDag-Erling Smørgrav	      # Archives containing C++ object files must be created using
7085f3b0ac34SDag-Erling Smørgrav	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7086f3b0ac34SDag-Erling Smørgrav	      # necessary to make sure instantiated templates are included
7087f3b0ac34SDag-Erling Smørgrav	      # in the archive.
7088f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7089f3b0ac34SDag-Erling Smørgrav	      ;;
7090f3b0ac34SDag-Erling Smørgrav	    esac
7091f3b0ac34SDag-Erling Smørgrav	    ;;
7092f3b0ac34SDag-Erling Smørgrav	esac
7093f3b0ac34SDag-Erling Smørgrav	;;
7094f3b0ac34SDag-Erling Smørgrav
7095f3b0ac34SDag-Erling Smørgrav      lynxos*)
7096f3b0ac34SDag-Erling Smørgrav        # FIXME: insert proper C++ library support
7097f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(ld_shlibs, $1)=no
7098f3b0ac34SDag-Erling Smørgrav	;;
7099f3b0ac34SDag-Erling Smørgrav
7100f3b0ac34SDag-Erling Smørgrav      m88k*)
7101f3b0ac34SDag-Erling Smørgrav        # FIXME: insert proper C++ library support
7102f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=no
7103f3b0ac34SDag-Erling Smørgrav	;;
7104f3b0ac34SDag-Erling Smørgrav
7105f3b0ac34SDag-Erling Smørgrav      mvs*)
7106f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
7107f3b0ac34SDag-Erling Smørgrav          cxx*)
7108f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
7109f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
7110f3b0ac34SDag-Erling Smørgrav	    ;;
7111f3b0ac34SDag-Erling Smørgrav	  *)
7112f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
7113f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
7114f3b0ac34SDag-Erling Smørgrav	    ;;
7115f3b0ac34SDag-Erling Smørgrav	esac
7116f3b0ac34SDag-Erling Smørgrav	;;
7117f3b0ac34SDag-Erling Smørgrav
7118f3b0ac34SDag-Erling Smørgrav      netbsd*)
7119f3b0ac34SDag-Erling Smørgrav        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7120f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7121f3b0ac34SDag-Erling Smørgrav	  wlarc=
7122f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7123f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct, $1)=yes
7124f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7125f3b0ac34SDag-Erling Smørgrav	fi
7126f3b0ac34SDag-Erling Smørgrav	# Workaround some broken pre-1.5 toolchains
7127f3b0ac34SDag-Erling Smørgrav	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7128f3b0ac34SDag-Erling Smørgrav	;;
7129f3b0ac34SDag-Erling Smørgrav
7130f3b0ac34SDag-Erling Smørgrav      *nto* | *qnx*)
7131f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=yes
7132f3b0ac34SDag-Erling Smørgrav	;;
7133f3b0ac34SDag-Erling Smørgrav
7134f3b0ac34SDag-Erling Smørgrav      openbsd* | bitrig*)
7135f3b0ac34SDag-Erling Smørgrav	if test -f /usr/libexec/ld.so; then
7136f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct, $1)=yes
7137f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7138f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7139f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7140f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7141f3b0ac34SDag-Erling Smørgrav	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7142f3b0ac34SDag-Erling Smørgrav	    _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'
7143f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7144f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7145f3b0ac34SDag-Erling Smørgrav	  fi
7146f3b0ac34SDag-Erling Smørgrav	  output_verbose_link_cmd=func_echo_all
7147f3b0ac34SDag-Erling Smørgrav	else
7148f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(ld_shlibs, $1)=no
7149f3b0ac34SDag-Erling Smørgrav	fi
7150f3b0ac34SDag-Erling Smørgrav	;;
7151f3b0ac34SDag-Erling Smørgrav
7152f3b0ac34SDag-Erling Smørgrav      osf3* | osf4* | osf5*)
7153f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
7154f3b0ac34SDag-Erling Smørgrav          KCC*)
7155f3b0ac34SDag-Erling Smørgrav	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7156f3b0ac34SDag-Erling Smørgrav
7157f3b0ac34SDag-Erling Smørgrav	    # KCC will only create a shared library if the output file
7158f3b0ac34SDag-Erling Smørgrav	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7159f3b0ac34SDag-Erling Smørgrav	    # to its proper name (with version) after linking.
7160f3b0ac34SDag-Erling Smørgrav	    _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'
7161f3b0ac34SDag-Erling Smørgrav
7162f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7163f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7164f3b0ac34SDag-Erling Smørgrav
7165f3b0ac34SDag-Erling Smørgrav	    # Archives containing C++ object files must be created using
7166f3b0ac34SDag-Erling Smørgrav	    # the KAI C++ compiler.
7167f3b0ac34SDag-Erling Smørgrav	    case $host in
7168f3b0ac34SDag-Erling Smørgrav	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7169f3b0ac34SDag-Erling Smørgrav	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7170f3b0ac34SDag-Erling Smørgrav	    esac
7171f3b0ac34SDag-Erling Smørgrav	    ;;
7172f3b0ac34SDag-Erling Smørgrav          RCC*)
7173f3b0ac34SDag-Erling Smørgrav	    # Rational C++ 2.4.1
7174f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
7175f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
7176f3b0ac34SDag-Erling Smørgrav	    ;;
7177f3b0ac34SDag-Erling Smørgrav          cxx*)
7178f3b0ac34SDag-Erling Smørgrav	    case $host in
7179f3b0ac34SDag-Erling Smørgrav	      osf3*)
7180f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7181f3b0ac34SDag-Erling Smørgrav	        _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'
7182f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7183f3b0ac34SDag-Erling Smørgrav		;;
7184f3b0ac34SDag-Erling Smørgrav	      *)
7185f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7186f3b0ac34SDag-Erling Smørgrav	        _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'
7187f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7188f3b0ac34SDag-Erling Smørgrav                  echo "-hidden">> $lib.exp~
7189f3b0ac34SDag-Erling Smørgrav                  $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~
7190f3b0ac34SDag-Erling Smørgrav                  $RM $lib.exp'
7191f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7192f3b0ac34SDag-Erling Smørgrav		;;
7193f3b0ac34SDag-Erling Smørgrav	    esac
7194f3b0ac34SDag-Erling Smørgrav
7195f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7196f3b0ac34SDag-Erling Smørgrav
7197f3b0ac34SDag-Erling Smørgrav	    # Commands to make compiler produce verbose output that lists
7198f3b0ac34SDag-Erling Smørgrav	    # what "hidden" libraries, object files and flags are used when
7199f3b0ac34SDag-Erling Smørgrav	    # linking a shared library.
7200f3b0ac34SDag-Erling Smørgrav	    #
7201f3b0ac34SDag-Erling Smørgrav	    # There doesn't appear to be a way to prevent this compiler from
7202f3b0ac34SDag-Erling Smørgrav	    # explicitly linking system object files so we need to strip them
7203f3b0ac34SDag-Erling Smørgrav	    # from the output so that they don't get included in the library
7204f3b0ac34SDag-Erling Smørgrav	    # dependencies.
7205f3b0ac34SDag-Erling Smørgrav	    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"'
7206f3b0ac34SDag-Erling Smørgrav	    ;;
7207f3b0ac34SDag-Erling Smørgrav	  *)
7208f3b0ac34SDag-Erling Smørgrav	    if test yes,no = "$GXX,$with_gnu_ld"; then
7209f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7210f3b0ac34SDag-Erling Smørgrav	      case $host in
7211f3b0ac34SDag-Erling Smørgrav	        osf3*)
7212f3b0ac34SDag-Erling Smørgrav	          _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'
7213f3b0ac34SDag-Erling Smørgrav		  ;;
7214f3b0ac34SDag-Erling Smørgrav	        *)
7215f3b0ac34SDag-Erling Smørgrav	          _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'
7216f3b0ac34SDag-Erling Smørgrav		  ;;
7217f3b0ac34SDag-Erling Smørgrav	      esac
7218f3b0ac34SDag-Erling Smørgrav
7219f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7220f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7221f3b0ac34SDag-Erling Smørgrav
7222f3b0ac34SDag-Erling Smørgrav	      # Commands to make compiler produce verbose output that lists
7223f3b0ac34SDag-Erling Smørgrav	      # what "hidden" libraries, object files and flags are used when
7224f3b0ac34SDag-Erling Smørgrav	      # linking a shared library.
7225f3b0ac34SDag-Erling Smørgrav	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7226f3b0ac34SDag-Erling Smørgrav
7227f3b0ac34SDag-Erling Smørgrav	    else
7228f3b0ac34SDag-Erling Smørgrav	      # FIXME: insert proper C++ library support
7229f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(ld_shlibs, $1)=no
7230f3b0ac34SDag-Erling Smørgrav	    fi
7231f3b0ac34SDag-Erling Smørgrav	    ;;
7232f3b0ac34SDag-Erling Smørgrav        esac
7233f3b0ac34SDag-Erling Smørgrav        ;;
7234f3b0ac34SDag-Erling Smørgrav
7235f3b0ac34SDag-Erling Smørgrav      psos*)
7236f3b0ac34SDag-Erling Smørgrav        # FIXME: insert proper C++ library support
7237f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=no
7238f3b0ac34SDag-Erling Smørgrav        ;;
7239f3b0ac34SDag-Erling Smørgrav
7240f3b0ac34SDag-Erling Smørgrav      sunos4*)
7241f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
7242f3b0ac34SDag-Erling Smørgrav          CC*)
7243f3b0ac34SDag-Erling Smørgrav	    # Sun C++ 4.x
7244f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
7245f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
7246f3b0ac34SDag-Erling Smørgrav	    ;;
7247f3b0ac34SDag-Erling Smørgrav          lcc*)
7248f3b0ac34SDag-Erling Smørgrav	    # Lucid
7249f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
7250f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
7251f3b0ac34SDag-Erling Smørgrav	    ;;
7252f3b0ac34SDag-Erling Smørgrav          *)
7253f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
7254f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
7255f3b0ac34SDag-Erling Smørgrav	    ;;
7256f3b0ac34SDag-Erling Smørgrav        esac
7257f3b0ac34SDag-Erling Smørgrav        ;;
7258f3b0ac34SDag-Erling Smørgrav
7259f3b0ac34SDag-Erling Smørgrav      solaris*)
7260f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
7261f3b0ac34SDag-Erling Smørgrav          CC* | sunCC*)
7262f3b0ac34SDag-Erling Smørgrav	    # Sun C++ 4.2, 5.x and Centerline C++
7263f3b0ac34SDag-Erling Smørgrav            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7264f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7265f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7266f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7267f3b0ac34SDag-Erling Smørgrav              $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'
7268f3b0ac34SDag-Erling Smørgrav
7269f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7270f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7271f3b0ac34SDag-Erling Smørgrav	    case $host_os in
7272f3b0ac34SDag-Erling Smørgrav	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7273f3b0ac34SDag-Erling Smørgrav	      *)
7274f3b0ac34SDag-Erling Smørgrav		# The compiler driver will combine and reorder linker options,
7275f3b0ac34SDag-Erling Smørgrav		# but understands '-z linker_flag'.
7276f3b0ac34SDag-Erling Smørgrav	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7277f3b0ac34SDag-Erling Smørgrav		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7278f3b0ac34SDag-Erling Smørgrav	        ;;
7279f3b0ac34SDag-Erling Smørgrav	    esac
7280f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7281f3b0ac34SDag-Erling Smørgrav
7282f3b0ac34SDag-Erling Smørgrav	    output_verbose_link_cmd='func_echo_all'
7283f3b0ac34SDag-Erling Smørgrav
7284f3b0ac34SDag-Erling Smørgrav	    # Archives containing C++ object files must be created using
7285f3b0ac34SDag-Erling Smørgrav	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7286f3b0ac34SDag-Erling Smørgrav	    # necessary to make sure instantiated templates are included
7287f3b0ac34SDag-Erling Smørgrav	    # in the archive.
7288f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7289f3b0ac34SDag-Erling Smørgrav	    ;;
7290f3b0ac34SDag-Erling Smørgrav          gcx*)
7291f3b0ac34SDag-Erling Smørgrav	    # Green Hills C++ Compiler
7292f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7293f3b0ac34SDag-Erling Smørgrav
7294f3b0ac34SDag-Erling Smørgrav	    # The C++ compiler must be used to create the archive.
7295f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7296f3b0ac34SDag-Erling Smørgrav	    ;;
7297f3b0ac34SDag-Erling Smørgrav          *)
7298f3b0ac34SDag-Erling Smørgrav	    # GNU C++ compiler with Solaris linker
7299f3b0ac34SDag-Erling Smørgrav	    if test yes,no = "$GXX,$with_gnu_ld"; then
7300f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7301f3b0ac34SDag-Erling Smørgrav	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7302f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7303f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7304f3b0ac34SDag-Erling Smørgrav                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7305f3b0ac34SDag-Erling Smørgrav
7306f3b0ac34SDag-Erling Smørgrav	        # Commands to make compiler produce verbose output that lists
7307f3b0ac34SDag-Erling Smørgrav	        # what "hidden" libraries, object files and flags are used when
7308f3b0ac34SDag-Erling Smørgrav	        # linking a shared library.
7309f3b0ac34SDag-Erling Smørgrav	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7310f3b0ac34SDag-Erling Smørgrav	      else
7311f3b0ac34SDag-Erling Smørgrav	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7312f3b0ac34SDag-Erling Smørgrav	        # platform.
7313f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7314f3b0ac34SDag-Erling Smørgrav	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7315f3b0ac34SDag-Erling Smørgrav                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7316f3b0ac34SDag-Erling Smørgrav
7317f3b0ac34SDag-Erling Smørgrav	        # Commands to make compiler produce verbose output that lists
7318f3b0ac34SDag-Erling Smørgrav	        # what "hidden" libraries, object files and flags are used when
7319f3b0ac34SDag-Erling Smørgrav	        # linking a shared library.
7320f3b0ac34SDag-Erling Smørgrav	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7321f3b0ac34SDag-Erling Smørgrav	      fi
7322f3b0ac34SDag-Erling Smørgrav
7323f3b0ac34SDag-Erling Smørgrav	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7324f3b0ac34SDag-Erling Smørgrav	      case $host_os in
7325f3b0ac34SDag-Erling Smørgrav		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7326f3b0ac34SDag-Erling Smørgrav		*)
7327f3b0ac34SDag-Erling Smørgrav		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7328f3b0ac34SDag-Erling Smørgrav		  ;;
7329f3b0ac34SDag-Erling Smørgrav	      esac
7330f3b0ac34SDag-Erling Smørgrav	    fi
7331f3b0ac34SDag-Erling Smørgrav	    ;;
7332f3b0ac34SDag-Erling Smørgrav        esac
7333f3b0ac34SDag-Erling Smørgrav        ;;
7334f3b0ac34SDag-Erling Smørgrav
7335f3b0ac34SDag-Erling Smørgrav    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7336f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7337f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7338f3b0ac34SDag-Erling Smørgrav      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7339f3b0ac34SDag-Erling Smørgrav      runpath_var='LD_RUN_PATH'
7340f3b0ac34SDag-Erling Smørgrav
7341f3b0ac34SDag-Erling Smørgrav      case $cc_basename in
7342f3b0ac34SDag-Erling Smørgrav        CC*)
7343f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7344f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7345f3b0ac34SDag-Erling Smørgrav	  ;;
7346f3b0ac34SDag-Erling Smørgrav	*)
7347f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7348f3b0ac34SDag-Erling Smørgrav	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7349f3b0ac34SDag-Erling Smørgrav	  ;;
7350f3b0ac34SDag-Erling Smørgrav      esac
7351f3b0ac34SDag-Erling Smørgrav      ;;
7352f3b0ac34SDag-Erling Smørgrav
7353f3b0ac34SDag-Erling Smørgrav      sysv5* | sco3.2v5* | sco5v6*)
7354f3b0ac34SDag-Erling Smørgrav	# Note: We CANNOT use -z defs as we might desire, because we do not
7355f3b0ac34SDag-Erling Smørgrav	# link with -lc, and that would cause any symbols used from libc to
7356f3b0ac34SDag-Erling Smørgrav	# always be unresolved, which means just about no library would
7357f3b0ac34SDag-Erling Smørgrav	# ever link correctly.  If we're not using GNU ld we use -z text
7358f3b0ac34SDag-Erling Smørgrav	# though, which does catch some bad symbols but isn't as heavy-handed
7359f3b0ac34SDag-Erling Smørgrav	# as -z defs.
7360f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7361f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7362f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7363f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7364f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7365f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7366f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(link_all_deplibs, $1)=yes
7367f3b0ac34SDag-Erling Smørgrav	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7368f3b0ac34SDag-Erling Smørgrav	runpath_var='LD_RUN_PATH'
7369f3b0ac34SDag-Erling Smørgrav
7370f3b0ac34SDag-Erling Smørgrav	case $cc_basename in
7371f3b0ac34SDag-Erling Smørgrav          CC*)
7372f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7373f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7374f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7375f3b0ac34SDag-Erling Smørgrav              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7376f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7377f3b0ac34SDag-Erling Smørgrav              '"$_LT_TAGVAR(reload_cmds, $1)"
7378f3b0ac34SDag-Erling Smørgrav	    ;;
7379f3b0ac34SDag-Erling Smørgrav	  *)
7380f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7381f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7382f3b0ac34SDag-Erling Smørgrav	    ;;
7383f3b0ac34SDag-Erling Smørgrav	esac
7384f3b0ac34SDag-Erling Smørgrav      ;;
7385f3b0ac34SDag-Erling Smørgrav
7386f3b0ac34SDag-Erling Smørgrav      tandem*)
7387f3b0ac34SDag-Erling Smørgrav        case $cc_basename in
7388f3b0ac34SDag-Erling Smørgrav          NCC*)
7389f3b0ac34SDag-Erling Smørgrav	    # NonStop-UX NCC 3.20
7390f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
7391f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
7392f3b0ac34SDag-Erling Smørgrav	    ;;
7393f3b0ac34SDag-Erling Smørgrav          *)
7394f3b0ac34SDag-Erling Smørgrav	    # FIXME: insert proper C++ library support
7395f3b0ac34SDag-Erling Smørgrav	    _LT_TAGVAR(ld_shlibs, $1)=no
7396f3b0ac34SDag-Erling Smørgrav	    ;;
7397f3b0ac34SDag-Erling Smørgrav        esac
7398f3b0ac34SDag-Erling Smørgrav        ;;
7399f3b0ac34SDag-Erling Smørgrav
7400f3b0ac34SDag-Erling Smørgrav      vxworks*)
7401f3b0ac34SDag-Erling Smørgrav        # FIXME: insert proper C++ library support
7402f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=no
7403f3b0ac34SDag-Erling Smørgrav        ;;
7404f3b0ac34SDag-Erling Smørgrav
7405f3b0ac34SDag-Erling Smørgrav      *)
7406f3b0ac34SDag-Erling Smørgrav        # FIXME: insert proper C++ library support
7407f3b0ac34SDag-Erling Smørgrav        _LT_TAGVAR(ld_shlibs, $1)=no
7408f3b0ac34SDag-Erling Smørgrav        ;;
7409f3b0ac34SDag-Erling Smørgrav    esac
7410f3b0ac34SDag-Erling Smørgrav
7411f3b0ac34SDag-Erling Smørgrav    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7412f3b0ac34SDag-Erling Smørgrav    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7413f3b0ac34SDag-Erling Smørgrav
7414f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(GCC, $1)=$GXX
7415f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(LD, $1)=$LD
7416f3b0ac34SDag-Erling Smørgrav
7417f3b0ac34SDag-Erling Smørgrav    ## CAVEAT EMPTOR:
7418f3b0ac34SDag-Erling Smørgrav    ## There is no encapsulation within the following macros, do not change
7419f3b0ac34SDag-Erling Smørgrav    ## the running order or otherwise move them around unless you know exactly
7420f3b0ac34SDag-Erling Smørgrav    ## what you are doing...
7421f3b0ac34SDag-Erling Smørgrav    _LT_SYS_HIDDEN_LIBDEPS($1)
7422f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_PIC($1)
7423f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_C_O($1)
7424f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_FILE_LOCKS($1)
7425f3b0ac34SDag-Erling Smørgrav    _LT_LINKER_SHLIBS($1)
7426f3b0ac34SDag-Erling Smørgrav    _LT_SYS_DYNAMIC_LINKER($1)
7427f3b0ac34SDag-Erling Smørgrav    _LT_LINKER_HARDCODE_LIBPATH($1)
7428f3b0ac34SDag-Erling Smørgrav
7429f3b0ac34SDag-Erling Smørgrav    _LT_CONFIG($1)
7430f3b0ac34SDag-Erling Smørgrav  fi # test -n "$compiler"
7431f3b0ac34SDag-Erling Smørgrav
7432f3b0ac34SDag-Erling Smørgrav  CC=$lt_save_CC
7433f3b0ac34SDag-Erling Smørgrav  CFLAGS=$lt_save_CFLAGS
7434f3b0ac34SDag-Erling Smørgrav  LDCXX=$LD
7435f3b0ac34SDag-Erling Smørgrav  LD=$lt_save_LD
7436f3b0ac34SDag-Erling Smørgrav  GCC=$lt_save_GCC
7437f3b0ac34SDag-Erling Smørgrav  with_gnu_ld=$lt_save_with_gnu_ld
7438f3b0ac34SDag-Erling Smørgrav  lt_cv_path_LDCXX=$lt_cv_path_LD
7439f3b0ac34SDag-Erling Smørgrav  lt_cv_path_LD=$lt_save_path_LD
7440f3b0ac34SDag-Erling Smørgrav  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7441f3b0ac34SDag-Erling Smørgrav  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7442f3b0ac34SDag-Erling Smørgravfi # test yes != "$_lt_caught_CXX_error"
7443f3b0ac34SDag-Erling Smørgrav
7444f3b0ac34SDag-Erling SmørgravAC_LANG_POP
7445f3b0ac34SDag-Erling Smørgrav])# _LT_LANG_CXX_CONFIG
7446f3b0ac34SDag-Erling Smørgrav
7447f3b0ac34SDag-Erling Smørgrav
7448f3b0ac34SDag-Erling Smørgrav# _LT_FUNC_STRIPNAME_CNF
7449f3b0ac34SDag-Erling Smørgrav# ----------------------
7450f3b0ac34SDag-Erling Smørgrav# func_stripname_cnf prefix suffix name
7451f3b0ac34SDag-Erling Smørgrav# strip PREFIX and SUFFIX off of NAME.
7452f3b0ac34SDag-Erling Smørgrav# PREFIX and SUFFIX must not contain globbing or regex special
7453f3b0ac34SDag-Erling Smørgrav# characters, hashes, percent signs, but SUFFIX may contain a leading
7454f3b0ac34SDag-Erling Smørgrav# dot (in which case that matches only a dot).
7455f3b0ac34SDag-Erling Smørgrav#
7456f3b0ac34SDag-Erling Smørgrav# This function is identical to the (non-XSI) version of func_stripname,
7457f3b0ac34SDag-Erling Smørgrav# except this one can be used by m4 code that may be executed by configure,
7458f3b0ac34SDag-Erling Smørgrav# rather than the libtool script.
7459f3b0ac34SDag-Erling Smørgravm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7460f3b0ac34SDag-Erling SmørgravAC_REQUIRE([_LT_DECL_SED])
7461f3b0ac34SDag-Erling SmørgravAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7462f3b0ac34SDag-Erling Smørgravfunc_stripname_cnf ()
7463f3b0ac34SDag-Erling Smørgrav{
7464f3b0ac34SDag-Erling Smørgrav  case @S|@2 in
7465f3b0ac34SDag-Erling Smørgrav  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7466f3b0ac34SDag-Erling Smørgrav  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7467f3b0ac34SDag-Erling Smørgrav  esac
7468f3b0ac34SDag-Erling Smørgrav} # func_stripname_cnf
7469f3b0ac34SDag-Erling Smørgrav])# _LT_FUNC_STRIPNAME_CNF
7470f3b0ac34SDag-Erling Smørgrav
7471f3b0ac34SDag-Erling Smørgrav
7472f3b0ac34SDag-Erling Smørgrav# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7473f3b0ac34SDag-Erling Smørgrav# ---------------------------------
7474f3b0ac34SDag-Erling Smørgrav# Figure out "hidden" library dependencies from verbose
7475f3b0ac34SDag-Erling Smørgrav# compiler output when linking a shared library.
7476f3b0ac34SDag-Erling Smørgrav# Parse the compiler output and extract the necessary
7477f3b0ac34SDag-Erling Smørgrav# objects, libraries and library flags.
7478f3b0ac34SDag-Erling Smørgravm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7479f3b0ac34SDag-Erling Smørgrav[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7480f3b0ac34SDag-Erling SmørgravAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7481f3b0ac34SDag-Erling Smørgrav# Dependencies to place before and after the object being linked:
7482f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(predep_objects, $1)=
7483f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(postdep_objects, $1)=
7484f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(predeps, $1)=
7485f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(postdeps, $1)=
7486f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(compiler_lib_search_path, $1)=
7487f3b0ac34SDag-Erling Smørgrav
7488f3b0ac34SDag-Erling Smørgravdnl we can't use the lt_simple_compile_test_code here,
7489f3b0ac34SDag-Erling Smørgravdnl because it contains code intended for an executable,
7490f3b0ac34SDag-Erling Smørgravdnl not a library.  It's possible we should let each
7491f3b0ac34SDag-Erling Smørgravdnl tag define a new lt_????_link_test_code variable,
7492f3b0ac34SDag-Erling Smørgravdnl but it's only used here...
7493f3b0ac34SDag-Erling Smørgravm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7494f3b0ac34SDag-Erling Smørgravint a;
7495f3b0ac34SDag-Erling Smørgravvoid foo (void) { a = 0; }
7496f3b0ac34SDag-Erling Smørgrav_LT_EOF
7497f3b0ac34SDag-Erling Smørgrav], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7498f3b0ac34SDag-Erling Smørgravclass Foo
7499f3b0ac34SDag-Erling Smørgrav{
7500f3b0ac34SDag-Erling Smørgravpublic:
7501f3b0ac34SDag-Erling Smørgrav  Foo (void) { a = 0; }
7502f3b0ac34SDag-Erling Smørgravprivate:
7503f3b0ac34SDag-Erling Smørgrav  int a;
7504f3b0ac34SDag-Erling Smørgrav};
7505f3b0ac34SDag-Erling Smørgrav_LT_EOF
7506f3b0ac34SDag-Erling Smørgrav], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7507f3b0ac34SDag-Erling Smørgrav      subroutine foo
7508f3b0ac34SDag-Erling Smørgrav      implicit none
7509f3b0ac34SDag-Erling Smørgrav      integer*4 a
7510f3b0ac34SDag-Erling Smørgrav      a=0
7511f3b0ac34SDag-Erling Smørgrav      return
7512f3b0ac34SDag-Erling Smørgrav      end
7513f3b0ac34SDag-Erling Smørgrav_LT_EOF
7514f3b0ac34SDag-Erling Smørgrav], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7515f3b0ac34SDag-Erling Smørgrav      subroutine foo
7516f3b0ac34SDag-Erling Smørgrav      implicit none
7517f3b0ac34SDag-Erling Smørgrav      integer a
7518f3b0ac34SDag-Erling Smørgrav      a=0
7519f3b0ac34SDag-Erling Smørgrav      return
7520f3b0ac34SDag-Erling Smørgrav      end
7521f3b0ac34SDag-Erling Smørgrav_LT_EOF
7522f3b0ac34SDag-Erling Smørgrav], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7523f3b0ac34SDag-Erling Smørgravpublic class foo {
7524f3b0ac34SDag-Erling Smørgrav  private int a;
7525f3b0ac34SDag-Erling Smørgrav  public void bar (void) {
7526f3b0ac34SDag-Erling Smørgrav    a = 0;
7527f3b0ac34SDag-Erling Smørgrav  }
7528f3b0ac34SDag-Erling Smørgrav};
7529f3b0ac34SDag-Erling Smørgrav_LT_EOF
7530f3b0ac34SDag-Erling Smørgrav], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7531f3b0ac34SDag-Erling Smørgravpackage foo
7532f3b0ac34SDag-Erling Smørgravfunc foo() {
7533f3b0ac34SDag-Erling Smørgrav}
7534f3b0ac34SDag-Erling Smørgrav_LT_EOF
7535f3b0ac34SDag-Erling Smørgrav])
7536f3b0ac34SDag-Erling Smørgrav
7537f3b0ac34SDag-Erling Smørgrav_lt_libdeps_save_CFLAGS=$CFLAGS
7538f3b0ac34SDag-Erling Smørgravcase "$CC $CFLAGS " in #(
7539f3b0ac34SDag-Erling Smørgrav*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7540f3b0ac34SDag-Erling Smørgrav*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7541f3b0ac34SDag-Erling Smørgrav*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7542f3b0ac34SDag-Erling Smørgravesac
7543f3b0ac34SDag-Erling Smørgrav
7544f3b0ac34SDag-Erling Smørgravdnl Parse the compiler output and extract the necessary
7545f3b0ac34SDag-Erling Smørgravdnl objects, libraries and library flags.
7546f3b0ac34SDag-Erling Smørgravif AC_TRY_EVAL(ac_compile); then
7547f3b0ac34SDag-Erling Smørgrav  # Parse the compiler output and extract the necessary
7548f3b0ac34SDag-Erling Smørgrav  # objects, libraries and library flags.
7549f3b0ac34SDag-Erling Smørgrav
7550f3b0ac34SDag-Erling Smørgrav  # Sentinel used to keep track of whether or not we are before
7551f3b0ac34SDag-Erling Smørgrav  # the conftest object file.
7552f3b0ac34SDag-Erling Smørgrav  pre_test_object_deps_done=no
7553f3b0ac34SDag-Erling Smørgrav
7554f3b0ac34SDag-Erling Smørgrav  for p in `eval "$output_verbose_link_cmd"`; do
7555f3b0ac34SDag-Erling Smørgrav    case $prev$p in
7556f3b0ac34SDag-Erling Smørgrav
7557f3b0ac34SDag-Erling Smørgrav    -L* | -R* | -l*)
7558f3b0ac34SDag-Erling Smørgrav       # Some compilers place space between "-{L,R}" and the path.
7559f3b0ac34SDag-Erling Smørgrav       # Remove the space.
7560f3b0ac34SDag-Erling Smørgrav       if test x-L = "$p" ||
7561f3b0ac34SDag-Erling Smørgrav          test x-R = "$p"; then
7562f3b0ac34SDag-Erling Smørgrav	 prev=$p
7563f3b0ac34SDag-Erling Smørgrav	 continue
7564f3b0ac34SDag-Erling Smørgrav       fi
7565f3b0ac34SDag-Erling Smørgrav
7566f3b0ac34SDag-Erling Smørgrav       # Expand the sysroot to ease extracting the directories later.
7567f3b0ac34SDag-Erling Smørgrav       if test -z "$prev"; then
7568f3b0ac34SDag-Erling Smørgrav         case $p in
7569f3b0ac34SDag-Erling Smørgrav         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7570f3b0ac34SDag-Erling Smørgrav         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7571f3b0ac34SDag-Erling Smørgrav         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7572f3b0ac34SDag-Erling Smørgrav         esac
7573f3b0ac34SDag-Erling Smørgrav       fi
7574f3b0ac34SDag-Erling Smørgrav       case $p in
7575f3b0ac34SDag-Erling Smørgrav       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7576f3b0ac34SDag-Erling Smørgrav       esac
7577f3b0ac34SDag-Erling Smørgrav       if test no = "$pre_test_object_deps_done"; then
7578f3b0ac34SDag-Erling Smørgrav	 case $prev in
7579f3b0ac34SDag-Erling Smørgrav	 -L | -R)
7580f3b0ac34SDag-Erling Smørgrav	   # Internal compiler library paths should come after those
7581f3b0ac34SDag-Erling Smørgrav	   # provided the user.  The postdeps already come after the
7582f3b0ac34SDag-Erling Smørgrav	   # user supplied libs so there is no need to process them.
7583f3b0ac34SDag-Erling Smørgrav	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7584f3b0ac34SDag-Erling Smørgrav	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7585f3b0ac34SDag-Erling Smørgrav	   else
7586f3b0ac34SDag-Erling Smørgrav	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7587f3b0ac34SDag-Erling Smørgrav	   fi
7588f3b0ac34SDag-Erling Smørgrav	   ;;
7589f3b0ac34SDag-Erling Smørgrav	 # The "-l" case would never come before the object being
7590f3b0ac34SDag-Erling Smørgrav	 # linked, so don't bother handling this case.
7591f3b0ac34SDag-Erling Smørgrav	 esac
7592f3b0ac34SDag-Erling Smørgrav       else
7593f3b0ac34SDag-Erling Smørgrav	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7594f3b0ac34SDag-Erling Smørgrav	   _LT_TAGVAR(postdeps, $1)=$prev$p
7595f3b0ac34SDag-Erling Smørgrav	 else
7596f3b0ac34SDag-Erling Smørgrav	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7597f3b0ac34SDag-Erling Smørgrav	 fi
7598f3b0ac34SDag-Erling Smørgrav       fi
7599f3b0ac34SDag-Erling Smørgrav       prev=
7600f3b0ac34SDag-Erling Smørgrav       ;;
7601f3b0ac34SDag-Erling Smørgrav
7602f3b0ac34SDag-Erling Smørgrav    *.lto.$objext) ;; # Ignore GCC LTO objects
7603f3b0ac34SDag-Erling Smørgrav    *.$objext)
7604f3b0ac34SDag-Erling Smørgrav       # This assumes that the test object file only shows up
7605f3b0ac34SDag-Erling Smørgrav       # once in the compiler output.
7606f3b0ac34SDag-Erling Smørgrav       if test "$p" = "conftest.$objext"; then
7607f3b0ac34SDag-Erling Smørgrav	 pre_test_object_deps_done=yes
7608f3b0ac34SDag-Erling Smørgrav	 continue
7609f3b0ac34SDag-Erling Smørgrav       fi
7610f3b0ac34SDag-Erling Smørgrav
7611f3b0ac34SDag-Erling Smørgrav       if test no = "$pre_test_object_deps_done"; then
7612f3b0ac34SDag-Erling Smørgrav	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7613f3b0ac34SDag-Erling Smørgrav	   _LT_TAGVAR(predep_objects, $1)=$p
7614f3b0ac34SDag-Erling Smørgrav	 else
7615f3b0ac34SDag-Erling Smørgrav	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7616f3b0ac34SDag-Erling Smørgrav	 fi
7617f3b0ac34SDag-Erling Smørgrav       else
7618f3b0ac34SDag-Erling Smørgrav	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7619f3b0ac34SDag-Erling Smørgrav	   _LT_TAGVAR(postdep_objects, $1)=$p
7620f3b0ac34SDag-Erling Smørgrav	 else
7621f3b0ac34SDag-Erling Smørgrav	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7622f3b0ac34SDag-Erling Smørgrav	 fi
7623f3b0ac34SDag-Erling Smørgrav       fi
7624f3b0ac34SDag-Erling Smørgrav       ;;
7625f3b0ac34SDag-Erling Smørgrav
7626f3b0ac34SDag-Erling Smørgrav    *) ;; # Ignore the rest.
7627f3b0ac34SDag-Erling Smørgrav
7628f3b0ac34SDag-Erling Smørgrav    esac
7629f3b0ac34SDag-Erling Smørgrav  done
7630f3b0ac34SDag-Erling Smørgrav
7631f3b0ac34SDag-Erling Smørgrav  # Clean up.
7632f3b0ac34SDag-Erling Smørgrav  rm -f a.out a.exe
7633f3b0ac34SDag-Erling Smørgravelse
7634f3b0ac34SDag-Erling Smørgrav  echo "libtool.m4: error: problem compiling $1 test program"
7635f3b0ac34SDag-Erling Smørgravfi
7636f3b0ac34SDag-Erling Smørgrav
7637f3b0ac34SDag-Erling Smørgrav$RM -f confest.$objext
7638f3b0ac34SDag-Erling SmørgravCFLAGS=$_lt_libdeps_save_CFLAGS
7639f3b0ac34SDag-Erling Smørgrav
7640f3b0ac34SDag-Erling Smørgrav# PORTME: override above test on systems where it is broken
7641f3b0ac34SDag-Erling Smørgravm4_if([$1], [CXX],
7642f3b0ac34SDag-Erling Smørgrav[case $host_os in
7643f3b0ac34SDag-Erling Smørgravinterix[[3-9]]*)
7644f3b0ac34SDag-Erling Smørgrav  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7645f3b0ac34SDag-Erling Smørgrav  # hack all around it, let's just trust "g++" to DTRT.
7646f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(predep_objects,$1)=
7647f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(postdep_objects,$1)=
7648f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(postdeps,$1)=
7649f3b0ac34SDag-Erling Smørgrav  ;;
7650f3b0ac34SDag-Erling Smørgravesac
7651f3b0ac34SDag-Erling Smørgrav])
7652f3b0ac34SDag-Erling Smørgrav
7653f3b0ac34SDag-Erling Smørgravcase " $_LT_TAGVAR(postdeps, $1) " in
7654f3b0ac34SDag-Erling Smørgrav*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7655f3b0ac34SDag-Erling Smørgravesac
7656f3b0ac34SDag-Erling Smørgrav _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7657f3b0ac34SDag-Erling Smørgravif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7658f3b0ac34SDag-Erling Smørgrav _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7659f3b0ac34SDag-Erling Smørgravfi
7660f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7661f3b0ac34SDag-Erling Smørgrav    [The directories searched by this compiler when creating a shared library])
7662f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [predep_objects], [1],
7663f3b0ac34SDag-Erling Smørgrav    [Dependencies to place before and after the objects being linked to
7664f3b0ac34SDag-Erling Smørgrav    create a shared library])
7665f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [postdep_objects], [1])
7666f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [predeps], [1])
7667f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [postdeps], [1])
7668f3b0ac34SDag-Erling Smørgrav_LT_TAGDECL([], [compiler_lib_search_path], [1],
7669f3b0ac34SDag-Erling Smørgrav    [The library search path used internally by the compiler when linking
7670f3b0ac34SDag-Erling Smørgrav    a shared library])
7671f3b0ac34SDag-Erling Smørgrav])# _LT_SYS_HIDDEN_LIBDEPS
7672f3b0ac34SDag-Erling Smørgrav
7673f3b0ac34SDag-Erling Smørgrav
7674f3b0ac34SDag-Erling Smørgrav# _LT_LANG_F77_CONFIG([TAG])
7675f3b0ac34SDag-Erling Smørgrav# --------------------------
7676f3b0ac34SDag-Erling Smørgrav# Ensure that the configuration variables for a Fortran 77 compiler are
7677f3b0ac34SDag-Erling Smørgrav# suitably defined.  These variables are subsequently used by _LT_CONFIG
7678f3b0ac34SDag-Erling Smørgrav# to write the compiler configuration to 'libtool'.
7679f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG_F77_CONFIG],
7680f3b0ac34SDag-Erling Smørgrav[AC_LANG_PUSH(Fortran 77)
7681f3b0ac34SDag-Erling Smørgravif test -z "$F77" || test no = "$F77"; then
7682f3b0ac34SDag-Erling Smørgrav  _lt_disable_F77=yes
7683f3b0ac34SDag-Erling Smørgravfi
7684f3b0ac34SDag-Erling Smørgrav
7685f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7686f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(allow_undefined_flag, $1)=
7687f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(always_export_symbols, $1)=no
7688f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(archive_expsym_cmds, $1)=
7689f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7690f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_direct, $1)=no
7691f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7692f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7693f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_libdir_separator, $1)=
7694f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_minus_L, $1)=no
7695f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_automatic, $1)=no
7696f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(inherit_rpath, $1)=no
7697f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(module_cmds, $1)=
7698f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(module_expsym_cmds, $1)=
7699f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(link_all_deplibs, $1)=unknown
7700f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7701f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_flag, $1)=$reload_flag
7702f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7703f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(no_undefined_flag, $1)=
7704f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(whole_archive_flag_spec, $1)=
7705f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7706f3b0ac34SDag-Erling Smørgrav
7707f3b0ac34SDag-Erling Smørgrav# Source file extension for f77 test sources.
7708f3b0ac34SDag-Erling Smørgravac_ext=f
7709f3b0ac34SDag-Erling Smørgrav
7710f3b0ac34SDag-Erling Smørgrav# Object file extension for compiled f77 test sources.
7711f3b0ac34SDag-Erling Smørgravobjext=o
7712f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(objext, $1)=$objext
7713f3b0ac34SDag-Erling Smørgrav
7714f3b0ac34SDag-Erling Smørgrav# No sense in running all these tests if we already determined that
7715f3b0ac34SDag-Erling Smørgrav# the F77 compiler isn't working.  Some variables (like enable_shared)
7716f3b0ac34SDag-Erling Smørgrav# are currently assumed to apply to all compilers on this platform,
7717f3b0ac34SDag-Erling Smørgrav# and will be corrupted by setting them based on a non-working compiler.
7718f3b0ac34SDag-Erling Smørgravif test yes != "$_lt_disable_F77"; then
7719f3b0ac34SDag-Erling Smørgrav  # Code to be used in simple compile tests
7720f3b0ac34SDag-Erling Smørgrav  lt_simple_compile_test_code="\
7721f3b0ac34SDag-Erling Smørgrav      subroutine t
7722f3b0ac34SDag-Erling Smørgrav      return
7723f3b0ac34SDag-Erling Smørgrav      end
7724f3b0ac34SDag-Erling Smørgrav"
7725f3b0ac34SDag-Erling Smørgrav
7726f3b0ac34SDag-Erling Smørgrav  # Code to be used in simple link tests
7727f3b0ac34SDag-Erling Smørgrav  lt_simple_link_test_code="\
7728f3b0ac34SDag-Erling Smørgrav      program t
7729f3b0ac34SDag-Erling Smørgrav      end
7730f3b0ac34SDag-Erling Smørgrav"
7731f3b0ac34SDag-Erling Smørgrav
7732f3b0ac34SDag-Erling Smørgrav  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7733f3b0ac34SDag-Erling Smørgrav  _LT_TAG_COMPILER
7734f3b0ac34SDag-Erling Smørgrav
7735f3b0ac34SDag-Erling Smørgrav  # save warnings/boilerplate of simple test code
7736f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_BOILERPLATE
7737f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_BOILERPLATE
7738f3b0ac34SDag-Erling Smørgrav
7739f3b0ac34SDag-Erling Smørgrav  # Allow CC to be a program name with arguments.
7740f3b0ac34SDag-Erling Smørgrav  lt_save_CC=$CC
7741f3b0ac34SDag-Erling Smørgrav  lt_save_GCC=$GCC
7742f3b0ac34SDag-Erling Smørgrav  lt_save_CFLAGS=$CFLAGS
7743f3b0ac34SDag-Erling Smørgrav  CC=${F77-"f77"}
7744f3b0ac34SDag-Erling Smørgrav  CFLAGS=$FFLAGS
7745f3b0ac34SDag-Erling Smørgrav  compiler=$CC
7746f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(compiler, $1)=$CC
7747f3b0ac34SDag-Erling Smørgrav  _LT_CC_BASENAME([$compiler])
7748f3b0ac34SDag-Erling Smørgrav  GCC=$G77
7749f3b0ac34SDag-Erling Smørgrav  if test -n "$compiler"; then
7750f3b0ac34SDag-Erling Smørgrav    AC_MSG_CHECKING([if libtool supports shared libraries])
7751f3b0ac34SDag-Erling Smørgrav    AC_MSG_RESULT([$can_build_shared])
7752f3b0ac34SDag-Erling Smørgrav
7753f3b0ac34SDag-Erling Smørgrav    AC_MSG_CHECKING([whether to build shared libraries])
7754f3b0ac34SDag-Erling Smørgrav    test no = "$can_build_shared" && enable_shared=no
7755f3b0ac34SDag-Erling Smørgrav
7756f3b0ac34SDag-Erling Smørgrav    # On AIX, shared libraries and static libraries use the same namespace, and
7757f3b0ac34SDag-Erling Smørgrav    # are all built from PIC.
7758f3b0ac34SDag-Erling Smørgrav    case $host_os in
7759f3b0ac34SDag-Erling Smørgrav      aix3*)
7760f3b0ac34SDag-Erling Smørgrav        test yes = "$enable_shared" && enable_static=no
7761f3b0ac34SDag-Erling Smørgrav        if test -n "$RANLIB"; then
7762f3b0ac34SDag-Erling Smørgrav          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7763f3b0ac34SDag-Erling Smørgrav          postinstall_cmds='$RANLIB $lib'
7764f3b0ac34SDag-Erling Smørgrav        fi
7765f3b0ac34SDag-Erling Smørgrav        ;;
7766f3b0ac34SDag-Erling Smørgrav      aix[[4-9]]*)
7767f3b0ac34SDag-Erling Smørgrav	if test ia64 != "$host_cpu"; then
7768f3b0ac34SDag-Erling Smørgrav	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7769f3b0ac34SDag-Erling Smørgrav	  yes,aix,yes) ;;		# shared object as lib.so file only
7770f3b0ac34SDag-Erling Smørgrav	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7771f3b0ac34SDag-Erling Smørgrav	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7772f3b0ac34SDag-Erling Smørgrav	  esac
7773f3b0ac34SDag-Erling Smørgrav	fi
7774f3b0ac34SDag-Erling Smørgrav        ;;
7775f3b0ac34SDag-Erling Smørgrav    esac
7776f3b0ac34SDag-Erling Smørgrav    AC_MSG_RESULT([$enable_shared])
7777f3b0ac34SDag-Erling Smørgrav
7778f3b0ac34SDag-Erling Smørgrav    AC_MSG_CHECKING([whether to build static libraries])
7779f3b0ac34SDag-Erling Smørgrav    # Make sure either enable_shared or enable_static is yes.
7780f3b0ac34SDag-Erling Smørgrav    test yes = "$enable_shared" || enable_static=yes
7781f3b0ac34SDag-Erling Smørgrav    AC_MSG_RESULT([$enable_static])
7782f3b0ac34SDag-Erling Smørgrav
7783f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(GCC, $1)=$G77
7784f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(LD, $1)=$LD
7785f3b0ac34SDag-Erling Smørgrav
7786f3b0ac34SDag-Erling Smørgrav    ## CAVEAT EMPTOR:
7787f3b0ac34SDag-Erling Smørgrav    ## There is no encapsulation within the following macros, do not change
7788f3b0ac34SDag-Erling Smørgrav    ## the running order or otherwise move them around unless you know exactly
7789f3b0ac34SDag-Erling Smørgrav    ## what you are doing...
7790f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_PIC($1)
7791f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_C_O($1)
7792f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_FILE_LOCKS($1)
7793f3b0ac34SDag-Erling Smørgrav    _LT_LINKER_SHLIBS($1)
7794f3b0ac34SDag-Erling Smørgrav    _LT_SYS_DYNAMIC_LINKER($1)
7795f3b0ac34SDag-Erling Smørgrav    _LT_LINKER_HARDCODE_LIBPATH($1)
7796f3b0ac34SDag-Erling Smørgrav
7797f3b0ac34SDag-Erling Smørgrav    _LT_CONFIG($1)
7798f3b0ac34SDag-Erling Smørgrav  fi # test -n "$compiler"
7799f3b0ac34SDag-Erling Smørgrav
7800f3b0ac34SDag-Erling Smørgrav  GCC=$lt_save_GCC
7801f3b0ac34SDag-Erling Smørgrav  CC=$lt_save_CC
7802f3b0ac34SDag-Erling Smørgrav  CFLAGS=$lt_save_CFLAGS
7803f3b0ac34SDag-Erling Smørgravfi # test yes != "$_lt_disable_F77"
7804f3b0ac34SDag-Erling Smørgrav
7805f3b0ac34SDag-Erling SmørgravAC_LANG_POP
7806f3b0ac34SDag-Erling Smørgrav])# _LT_LANG_F77_CONFIG
7807f3b0ac34SDag-Erling Smørgrav
7808f3b0ac34SDag-Erling Smørgrav
7809f3b0ac34SDag-Erling Smørgrav# _LT_LANG_FC_CONFIG([TAG])
7810f3b0ac34SDag-Erling Smørgrav# -------------------------
7811f3b0ac34SDag-Erling Smørgrav# Ensure that the configuration variables for a Fortran compiler are
7812f3b0ac34SDag-Erling Smørgrav# suitably defined.  These variables are subsequently used by _LT_CONFIG
7813f3b0ac34SDag-Erling Smørgrav# to write the compiler configuration to 'libtool'.
7814f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG_FC_CONFIG],
7815f3b0ac34SDag-Erling Smørgrav[AC_LANG_PUSH(Fortran)
7816f3b0ac34SDag-Erling Smørgrav
7817f3b0ac34SDag-Erling Smørgravif test -z "$FC" || test no = "$FC"; then
7818f3b0ac34SDag-Erling Smørgrav  _lt_disable_FC=yes
7819f3b0ac34SDag-Erling Smørgravfi
7820f3b0ac34SDag-Erling Smørgrav
7821f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7822f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(allow_undefined_flag, $1)=
7823f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(always_export_symbols, $1)=no
7824f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(archive_expsym_cmds, $1)=
7825f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7826f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_direct, $1)=no
7827f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7828f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7829f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_libdir_separator, $1)=
7830f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_minus_L, $1)=no
7831f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(hardcode_automatic, $1)=no
7832f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(inherit_rpath, $1)=no
7833f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(module_cmds, $1)=
7834f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(module_expsym_cmds, $1)=
7835f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(link_all_deplibs, $1)=unknown
7836f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7837f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_flag, $1)=$reload_flag
7838f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7839f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(no_undefined_flag, $1)=
7840f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(whole_archive_flag_spec, $1)=
7841f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7842f3b0ac34SDag-Erling Smørgrav
7843f3b0ac34SDag-Erling Smørgrav# Source file extension for fc test sources.
7844f3b0ac34SDag-Erling Smørgravac_ext=${ac_fc_srcext-f}
7845f3b0ac34SDag-Erling Smørgrav
7846f3b0ac34SDag-Erling Smørgrav# Object file extension for compiled fc test sources.
7847f3b0ac34SDag-Erling Smørgravobjext=o
7848f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(objext, $1)=$objext
7849f3b0ac34SDag-Erling Smørgrav
7850f3b0ac34SDag-Erling Smørgrav# No sense in running all these tests if we already determined that
7851f3b0ac34SDag-Erling Smørgrav# the FC compiler isn't working.  Some variables (like enable_shared)
7852f3b0ac34SDag-Erling Smørgrav# are currently assumed to apply to all compilers on this platform,
7853f3b0ac34SDag-Erling Smørgrav# and will be corrupted by setting them based on a non-working compiler.
7854f3b0ac34SDag-Erling Smørgravif test yes != "$_lt_disable_FC"; then
7855f3b0ac34SDag-Erling Smørgrav  # Code to be used in simple compile tests
7856f3b0ac34SDag-Erling Smørgrav  lt_simple_compile_test_code="\
7857f3b0ac34SDag-Erling Smørgrav      subroutine t
7858f3b0ac34SDag-Erling Smørgrav      return
7859f3b0ac34SDag-Erling Smørgrav      end
7860f3b0ac34SDag-Erling Smørgrav"
7861f3b0ac34SDag-Erling Smørgrav
7862f3b0ac34SDag-Erling Smørgrav  # Code to be used in simple link tests
7863f3b0ac34SDag-Erling Smørgrav  lt_simple_link_test_code="\
7864f3b0ac34SDag-Erling Smørgrav      program t
7865f3b0ac34SDag-Erling Smørgrav      end
7866f3b0ac34SDag-Erling Smørgrav"
7867f3b0ac34SDag-Erling Smørgrav
7868f3b0ac34SDag-Erling Smørgrav  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7869f3b0ac34SDag-Erling Smørgrav  _LT_TAG_COMPILER
7870f3b0ac34SDag-Erling Smørgrav
7871f3b0ac34SDag-Erling Smørgrav  # save warnings/boilerplate of simple test code
7872f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_BOILERPLATE
7873f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_BOILERPLATE
7874f3b0ac34SDag-Erling Smørgrav
7875f3b0ac34SDag-Erling Smørgrav  # Allow CC to be a program name with arguments.
7876f3b0ac34SDag-Erling Smørgrav  lt_save_CC=$CC
7877f3b0ac34SDag-Erling Smørgrav  lt_save_GCC=$GCC
7878f3b0ac34SDag-Erling Smørgrav  lt_save_CFLAGS=$CFLAGS
7879f3b0ac34SDag-Erling Smørgrav  CC=${FC-"f95"}
7880f3b0ac34SDag-Erling Smørgrav  CFLAGS=$FCFLAGS
7881f3b0ac34SDag-Erling Smørgrav  compiler=$CC
7882f3b0ac34SDag-Erling Smørgrav  GCC=$ac_cv_fc_compiler_gnu
7883f3b0ac34SDag-Erling Smørgrav
7884f3b0ac34SDag-Erling Smørgrav  _LT_TAGVAR(compiler, $1)=$CC
7885f3b0ac34SDag-Erling Smørgrav  _LT_CC_BASENAME([$compiler])
7886f3b0ac34SDag-Erling Smørgrav
7887f3b0ac34SDag-Erling Smørgrav  if test -n "$compiler"; then
7888f3b0ac34SDag-Erling Smørgrav    AC_MSG_CHECKING([if libtool supports shared libraries])
7889f3b0ac34SDag-Erling Smørgrav    AC_MSG_RESULT([$can_build_shared])
7890f3b0ac34SDag-Erling Smørgrav
7891f3b0ac34SDag-Erling Smørgrav    AC_MSG_CHECKING([whether to build shared libraries])
7892f3b0ac34SDag-Erling Smørgrav    test no = "$can_build_shared" && enable_shared=no
7893f3b0ac34SDag-Erling Smørgrav
7894f3b0ac34SDag-Erling Smørgrav    # On AIX, shared libraries and static libraries use the same namespace, and
7895f3b0ac34SDag-Erling Smørgrav    # are all built from PIC.
7896f3b0ac34SDag-Erling Smørgrav    case $host_os in
7897f3b0ac34SDag-Erling Smørgrav      aix3*)
7898f3b0ac34SDag-Erling Smørgrav        test yes = "$enable_shared" && enable_static=no
7899f3b0ac34SDag-Erling Smørgrav        if test -n "$RANLIB"; then
7900f3b0ac34SDag-Erling Smørgrav          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7901f3b0ac34SDag-Erling Smørgrav          postinstall_cmds='$RANLIB $lib'
7902f3b0ac34SDag-Erling Smørgrav        fi
7903f3b0ac34SDag-Erling Smørgrav        ;;
7904f3b0ac34SDag-Erling Smørgrav      aix[[4-9]]*)
7905f3b0ac34SDag-Erling Smørgrav	if test ia64 != "$host_cpu"; then
7906f3b0ac34SDag-Erling Smørgrav	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7907f3b0ac34SDag-Erling Smørgrav	  yes,aix,yes) ;;		# shared object as lib.so file only
7908f3b0ac34SDag-Erling Smørgrav	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7909f3b0ac34SDag-Erling Smørgrav	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7910f3b0ac34SDag-Erling Smørgrav	  esac
7911f3b0ac34SDag-Erling Smørgrav	fi
7912f3b0ac34SDag-Erling Smørgrav        ;;
7913f3b0ac34SDag-Erling Smørgrav    esac
7914f3b0ac34SDag-Erling Smørgrav    AC_MSG_RESULT([$enable_shared])
7915f3b0ac34SDag-Erling Smørgrav
7916f3b0ac34SDag-Erling Smørgrav    AC_MSG_CHECKING([whether to build static libraries])
7917f3b0ac34SDag-Erling Smørgrav    # Make sure either enable_shared or enable_static is yes.
7918f3b0ac34SDag-Erling Smørgrav    test yes = "$enable_shared" || enable_static=yes
7919f3b0ac34SDag-Erling Smørgrav    AC_MSG_RESULT([$enable_static])
7920f3b0ac34SDag-Erling Smørgrav
7921f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7922f3b0ac34SDag-Erling Smørgrav    _LT_TAGVAR(LD, $1)=$LD
7923f3b0ac34SDag-Erling Smørgrav
7924f3b0ac34SDag-Erling Smørgrav    ## CAVEAT EMPTOR:
7925f3b0ac34SDag-Erling Smørgrav    ## There is no encapsulation within the following macros, do not change
7926f3b0ac34SDag-Erling Smørgrav    ## the running order or otherwise move them around unless you know exactly
7927f3b0ac34SDag-Erling Smørgrav    ## what you are doing...
7928f3b0ac34SDag-Erling Smørgrav    _LT_SYS_HIDDEN_LIBDEPS($1)
7929f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_PIC($1)
7930f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_C_O($1)
7931f3b0ac34SDag-Erling Smørgrav    _LT_COMPILER_FILE_LOCKS($1)
7932f3b0ac34SDag-Erling Smørgrav    _LT_LINKER_SHLIBS($1)
7933f3b0ac34SDag-Erling Smørgrav    _LT_SYS_DYNAMIC_LINKER($1)
7934f3b0ac34SDag-Erling Smørgrav    _LT_LINKER_HARDCODE_LIBPATH($1)
7935f3b0ac34SDag-Erling Smørgrav
7936f3b0ac34SDag-Erling Smørgrav    _LT_CONFIG($1)
7937f3b0ac34SDag-Erling Smørgrav  fi # test -n "$compiler"
7938f3b0ac34SDag-Erling Smørgrav
7939f3b0ac34SDag-Erling Smørgrav  GCC=$lt_save_GCC
7940f3b0ac34SDag-Erling Smørgrav  CC=$lt_save_CC
7941f3b0ac34SDag-Erling Smørgrav  CFLAGS=$lt_save_CFLAGS
7942f3b0ac34SDag-Erling Smørgravfi # test yes != "$_lt_disable_FC"
7943f3b0ac34SDag-Erling Smørgrav
7944f3b0ac34SDag-Erling SmørgravAC_LANG_POP
7945f3b0ac34SDag-Erling Smørgrav])# _LT_LANG_FC_CONFIG
7946f3b0ac34SDag-Erling Smørgrav
7947f3b0ac34SDag-Erling Smørgrav
7948f3b0ac34SDag-Erling Smørgrav# _LT_LANG_GCJ_CONFIG([TAG])
7949f3b0ac34SDag-Erling Smørgrav# --------------------------
7950f3b0ac34SDag-Erling Smørgrav# Ensure that the configuration variables for the GNU Java Compiler compiler
7951f3b0ac34SDag-Erling Smørgrav# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7952f3b0ac34SDag-Erling Smørgrav# to write the compiler configuration to 'libtool'.
7953f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG_GCJ_CONFIG],
7954f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([LT_PROG_GCJ])dnl
7955f3b0ac34SDag-Erling SmørgravAC_LANG_SAVE
7956f3b0ac34SDag-Erling Smørgrav
7957f3b0ac34SDag-Erling Smørgrav# Source file extension for Java test sources.
7958f3b0ac34SDag-Erling Smørgravac_ext=java
7959f3b0ac34SDag-Erling Smørgrav
7960f3b0ac34SDag-Erling Smørgrav# Object file extension for compiled Java test sources.
7961f3b0ac34SDag-Erling Smørgravobjext=o
7962f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(objext, $1)=$objext
7963f3b0ac34SDag-Erling Smørgrav
7964f3b0ac34SDag-Erling Smørgrav# Code to be used in simple compile tests
7965f3b0ac34SDag-Erling Smørgravlt_simple_compile_test_code="class foo {}"
7966f3b0ac34SDag-Erling Smørgrav
7967f3b0ac34SDag-Erling Smørgrav# Code to be used in simple link tests
7968f3b0ac34SDag-Erling Smørgravlt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7969f3b0ac34SDag-Erling Smørgrav
7970f3b0ac34SDag-Erling Smørgrav# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7971f3b0ac34SDag-Erling Smørgrav_LT_TAG_COMPILER
7972f3b0ac34SDag-Erling Smørgrav
7973f3b0ac34SDag-Erling Smørgrav# save warnings/boilerplate of simple test code
7974f3b0ac34SDag-Erling Smørgrav_LT_COMPILER_BOILERPLATE
7975f3b0ac34SDag-Erling Smørgrav_LT_LINKER_BOILERPLATE
7976f3b0ac34SDag-Erling Smørgrav
7977f3b0ac34SDag-Erling Smørgrav# Allow CC to be a program name with arguments.
7978f3b0ac34SDag-Erling Smørgravlt_save_CC=$CC
7979f3b0ac34SDag-Erling Smørgravlt_save_CFLAGS=$CFLAGS
7980f3b0ac34SDag-Erling Smørgravlt_save_GCC=$GCC
7981f3b0ac34SDag-Erling SmørgravGCC=yes
7982f3b0ac34SDag-Erling SmørgravCC=${GCJ-"gcj"}
7983f3b0ac34SDag-Erling SmørgravCFLAGS=$GCJFLAGS
7984f3b0ac34SDag-Erling Smørgravcompiler=$CC
7985f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(compiler, $1)=$CC
7986f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(LD, $1)=$LD
7987f3b0ac34SDag-Erling Smørgrav_LT_CC_BASENAME([$compiler])
7988f3b0ac34SDag-Erling Smørgrav
7989f3b0ac34SDag-Erling Smørgrav# GCJ did not exist at the time GCC didn't implicitly link libc in.
7990f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7991f3b0ac34SDag-Erling Smørgrav
7992f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7993f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_flag, $1)=$reload_flag
7994f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7995f3b0ac34SDag-Erling Smørgrav
7996f3b0ac34SDag-Erling Smørgrav## CAVEAT EMPTOR:
7997f3b0ac34SDag-Erling Smørgrav## There is no encapsulation within the following macros, do not change
7998f3b0ac34SDag-Erling Smørgrav## the running order or otherwise move them around unless you know exactly
7999f3b0ac34SDag-Erling Smørgrav## what you are doing...
8000f3b0ac34SDag-Erling Smørgravif test -n "$compiler"; then
8001f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_NO_RTTI($1)
8002f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_PIC($1)
8003f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_C_O($1)
8004f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_FILE_LOCKS($1)
8005f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_SHLIBS($1)
8006f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_HARDCODE_LIBPATH($1)
8007f3b0ac34SDag-Erling Smørgrav
8008f3b0ac34SDag-Erling Smørgrav  _LT_CONFIG($1)
8009f3b0ac34SDag-Erling Smørgravfi
8010f3b0ac34SDag-Erling Smørgrav
8011f3b0ac34SDag-Erling SmørgravAC_LANG_RESTORE
8012f3b0ac34SDag-Erling Smørgrav
8013f3b0ac34SDag-Erling SmørgravGCC=$lt_save_GCC
8014f3b0ac34SDag-Erling SmørgravCC=$lt_save_CC
8015f3b0ac34SDag-Erling SmørgravCFLAGS=$lt_save_CFLAGS
8016f3b0ac34SDag-Erling Smørgrav])# _LT_LANG_GCJ_CONFIG
8017f3b0ac34SDag-Erling Smørgrav
8018f3b0ac34SDag-Erling Smørgrav
8019f3b0ac34SDag-Erling Smørgrav# _LT_LANG_GO_CONFIG([TAG])
8020f3b0ac34SDag-Erling Smørgrav# --------------------------
8021f3b0ac34SDag-Erling Smørgrav# Ensure that the configuration variables for the GNU Go compiler
8022f3b0ac34SDag-Erling Smørgrav# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8023f3b0ac34SDag-Erling Smørgrav# to write the compiler configuration to 'libtool'.
8024f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG_GO_CONFIG],
8025f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([LT_PROG_GO])dnl
8026f3b0ac34SDag-Erling SmørgravAC_LANG_SAVE
8027f3b0ac34SDag-Erling Smørgrav
8028f3b0ac34SDag-Erling Smørgrav# Source file extension for Go test sources.
8029f3b0ac34SDag-Erling Smørgravac_ext=go
8030f3b0ac34SDag-Erling Smørgrav
8031f3b0ac34SDag-Erling Smørgrav# Object file extension for compiled Go test sources.
8032f3b0ac34SDag-Erling Smørgravobjext=o
8033f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(objext, $1)=$objext
8034f3b0ac34SDag-Erling Smørgrav
8035f3b0ac34SDag-Erling Smørgrav# Code to be used in simple compile tests
8036f3b0ac34SDag-Erling Smørgravlt_simple_compile_test_code="package main; func main() { }"
8037f3b0ac34SDag-Erling Smørgrav
8038f3b0ac34SDag-Erling Smørgrav# Code to be used in simple link tests
8039f3b0ac34SDag-Erling Smørgravlt_simple_link_test_code='package main; func main() { }'
8040f3b0ac34SDag-Erling Smørgrav
8041f3b0ac34SDag-Erling Smørgrav# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8042f3b0ac34SDag-Erling Smørgrav_LT_TAG_COMPILER
8043f3b0ac34SDag-Erling Smørgrav
8044f3b0ac34SDag-Erling Smørgrav# save warnings/boilerplate of simple test code
8045f3b0ac34SDag-Erling Smørgrav_LT_COMPILER_BOILERPLATE
8046f3b0ac34SDag-Erling Smørgrav_LT_LINKER_BOILERPLATE
8047f3b0ac34SDag-Erling Smørgrav
8048f3b0ac34SDag-Erling Smørgrav# Allow CC to be a program name with arguments.
8049f3b0ac34SDag-Erling Smørgravlt_save_CC=$CC
8050f3b0ac34SDag-Erling Smørgravlt_save_CFLAGS=$CFLAGS
8051f3b0ac34SDag-Erling Smørgravlt_save_GCC=$GCC
8052f3b0ac34SDag-Erling SmørgravGCC=yes
8053f3b0ac34SDag-Erling SmørgravCC=${GOC-"gccgo"}
8054f3b0ac34SDag-Erling SmørgravCFLAGS=$GOFLAGS
8055f3b0ac34SDag-Erling Smørgravcompiler=$CC
8056f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(compiler, $1)=$CC
8057f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(LD, $1)=$LD
8058f3b0ac34SDag-Erling Smørgrav_LT_CC_BASENAME([$compiler])
8059f3b0ac34SDag-Erling Smørgrav
8060f3b0ac34SDag-Erling Smørgrav# Go did not exist at the time GCC didn't implicitly link libc in.
8061f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8062f3b0ac34SDag-Erling Smørgrav
8063f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8064f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_flag, $1)=$reload_flag
8065f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8066f3b0ac34SDag-Erling Smørgrav
8067f3b0ac34SDag-Erling Smørgrav## CAVEAT EMPTOR:
8068f3b0ac34SDag-Erling Smørgrav## There is no encapsulation within the following macros, do not change
8069f3b0ac34SDag-Erling Smørgrav## the running order or otherwise move them around unless you know exactly
8070f3b0ac34SDag-Erling Smørgrav## what you are doing...
8071f3b0ac34SDag-Erling Smørgravif test -n "$compiler"; then
8072f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_NO_RTTI($1)
8073f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_PIC($1)
8074f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_C_O($1)
8075f3b0ac34SDag-Erling Smørgrav  _LT_COMPILER_FILE_LOCKS($1)
8076f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_SHLIBS($1)
8077f3b0ac34SDag-Erling Smørgrav  _LT_LINKER_HARDCODE_LIBPATH($1)
8078f3b0ac34SDag-Erling Smørgrav
8079f3b0ac34SDag-Erling Smørgrav  _LT_CONFIG($1)
8080f3b0ac34SDag-Erling Smørgravfi
8081f3b0ac34SDag-Erling Smørgrav
8082f3b0ac34SDag-Erling SmørgravAC_LANG_RESTORE
8083f3b0ac34SDag-Erling Smørgrav
8084f3b0ac34SDag-Erling SmørgravGCC=$lt_save_GCC
8085f3b0ac34SDag-Erling SmørgravCC=$lt_save_CC
8086f3b0ac34SDag-Erling SmørgravCFLAGS=$lt_save_CFLAGS
8087f3b0ac34SDag-Erling Smørgrav])# _LT_LANG_GO_CONFIG
8088f3b0ac34SDag-Erling Smørgrav
8089f3b0ac34SDag-Erling Smørgrav
8090f3b0ac34SDag-Erling Smørgrav# _LT_LANG_RC_CONFIG([TAG])
8091f3b0ac34SDag-Erling Smørgrav# -------------------------
8092f3b0ac34SDag-Erling Smørgrav# Ensure that the configuration variables for the Windows resource compiler
8093f3b0ac34SDag-Erling Smørgrav# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8094f3b0ac34SDag-Erling Smørgrav# to write the compiler configuration to 'libtool'.
8095f3b0ac34SDag-Erling Smørgravm4_defun([_LT_LANG_RC_CONFIG],
8096f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([LT_PROG_RC])dnl
8097f3b0ac34SDag-Erling SmørgravAC_LANG_SAVE
8098f3b0ac34SDag-Erling Smørgrav
8099f3b0ac34SDag-Erling Smørgrav# Source file extension for RC test sources.
8100f3b0ac34SDag-Erling Smørgravac_ext=rc
8101f3b0ac34SDag-Erling Smørgrav
8102f3b0ac34SDag-Erling Smørgrav# Object file extension for compiled RC test sources.
8103f3b0ac34SDag-Erling Smørgravobjext=o
8104f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(objext, $1)=$objext
8105f3b0ac34SDag-Erling Smørgrav
8106f3b0ac34SDag-Erling Smørgrav# Code to be used in simple compile tests
8107f3b0ac34SDag-Erling Smørgravlt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8108f3b0ac34SDag-Erling Smørgrav
8109f3b0ac34SDag-Erling Smørgrav# Code to be used in simple link tests
8110f3b0ac34SDag-Erling Smørgravlt_simple_link_test_code=$lt_simple_compile_test_code
8111f3b0ac34SDag-Erling Smørgrav
8112f3b0ac34SDag-Erling Smørgrav# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8113f3b0ac34SDag-Erling Smørgrav_LT_TAG_COMPILER
8114f3b0ac34SDag-Erling Smørgrav
8115f3b0ac34SDag-Erling Smørgrav# save warnings/boilerplate of simple test code
8116f3b0ac34SDag-Erling Smørgrav_LT_COMPILER_BOILERPLATE
8117f3b0ac34SDag-Erling Smørgrav_LT_LINKER_BOILERPLATE
8118f3b0ac34SDag-Erling Smørgrav
8119f3b0ac34SDag-Erling Smørgrav# Allow CC to be a program name with arguments.
8120f3b0ac34SDag-Erling Smørgravlt_save_CC=$CC
8121f3b0ac34SDag-Erling Smørgravlt_save_CFLAGS=$CFLAGS
8122f3b0ac34SDag-Erling Smørgravlt_save_GCC=$GCC
8123f3b0ac34SDag-Erling SmørgravGCC=
8124f3b0ac34SDag-Erling SmørgravCC=${RC-"windres"}
8125f3b0ac34SDag-Erling SmørgravCFLAGS=
8126f3b0ac34SDag-Erling Smørgravcompiler=$CC
8127f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(compiler, $1)=$CC
8128f3b0ac34SDag-Erling Smørgrav_LT_CC_BASENAME([$compiler])
8129f3b0ac34SDag-Erling Smørgrav_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8130f3b0ac34SDag-Erling Smørgrav
8131f3b0ac34SDag-Erling Smørgravif test -n "$compiler"; then
8132f3b0ac34SDag-Erling Smørgrav  :
8133f3b0ac34SDag-Erling Smørgrav  _LT_CONFIG($1)
8134f3b0ac34SDag-Erling Smørgravfi
8135f3b0ac34SDag-Erling Smørgrav
8136f3b0ac34SDag-Erling SmørgravGCC=$lt_save_GCC
8137f3b0ac34SDag-Erling SmørgravAC_LANG_RESTORE
8138f3b0ac34SDag-Erling SmørgravCC=$lt_save_CC
8139f3b0ac34SDag-Erling SmørgravCFLAGS=$lt_save_CFLAGS
8140f3b0ac34SDag-Erling Smørgrav])# _LT_LANG_RC_CONFIG
8141f3b0ac34SDag-Erling Smørgrav
8142f3b0ac34SDag-Erling Smørgrav
8143f3b0ac34SDag-Erling Smørgrav# LT_PROG_GCJ
8144f3b0ac34SDag-Erling Smørgrav# -----------
8145f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_PROG_GCJ],
8146f3b0ac34SDag-Erling Smørgrav[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8147f3b0ac34SDag-Erling Smørgrav  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8148f3b0ac34SDag-Erling Smørgrav    [AC_CHECK_TOOL(GCJ, gcj,)
8149f3b0ac34SDag-Erling Smørgrav      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8150f3b0ac34SDag-Erling Smørgrav      AC_SUBST(GCJFLAGS)])])[]dnl
8151f3b0ac34SDag-Erling Smørgrav])
8152f3b0ac34SDag-Erling Smørgrav
8153f3b0ac34SDag-Erling Smørgrav# Old name:
8154f3b0ac34SDag-Erling SmørgravAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8155f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
8156f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8157f3b0ac34SDag-Erling Smørgrav
8158f3b0ac34SDag-Erling Smørgrav
8159f3b0ac34SDag-Erling Smørgrav# LT_PROG_GO
8160f3b0ac34SDag-Erling Smørgrav# ----------
8161f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_PROG_GO],
8162f3b0ac34SDag-Erling Smørgrav[AC_CHECK_TOOL(GOC, gccgo,)
8163f3b0ac34SDag-Erling Smørgrav])
8164f3b0ac34SDag-Erling Smørgrav
8165f3b0ac34SDag-Erling Smørgrav
8166f3b0ac34SDag-Erling Smørgrav# LT_PROG_RC
8167f3b0ac34SDag-Erling Smørgrav# ----------
8168f3b0ac34SDag-Erling SmørgravAC_DEFUN([LT_PROG_RC],
8169f3b0ac34SDag-Erling Smørgrav[AC_CHECK_TOOL(RC, windres,)
8170f3b0ac34SDag-Erling Smørgrav])
8171f3b0ac34SDag-Erling Smørgrav
8172f3b0ac34SDag-Erling Smørgrav# Old name:
8173f3b0ac34SDag-Erling SmørgravAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8174f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
8175f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([LT_AC_PROG_RC], [])
8176f3b0ac34SDag-Erling Smørgrav
8177f3b0ac34SDag-Erling Smørgrav
8178f3b0ac34SDag-Erling Smørgrav# _LT_DECL_EGREP
8179f3b0ac34SDag-Erling Smørgrav# --------------
8180f3b0ac34SDag-Erling Smørgrav# If we don't have a new enough Autoconf to choose the best grep
8181f3b0ac34SDag-Erling Smørgrav# available, choose the one first in the user's PATH.
8182f3b0ac34SDag-Erling Smørgravm4_defun([_LT_DECL_EGREP],
8183f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_PROG_EGREP])dnl
8184f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_PROG_FGREP])dnl
8185f3b0ac34SDag-Erling Smørgravtest -z "$GREP" && GREP=grep
8186f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8187f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [EGREP], [1], [An ERE matcher])
8188f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [FGREP], [1], [A literal string matcher])
8189f3b0ac34SDag-Erling Smørgravdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8190f3b0ac34SDag-Erling SmørgravAC_SUBST([GREP])
8191f3b0ac34SDag-Erling Smørgrav])
8192f3b0ac34SDag-Erling Smørgrav
8193f3b0ac34SDag-Erling Smørgrav
8194f3b0ac34SDag-Erling Smørgrav# _LT_DECL_OBJDUMP
8195f3b0ac34SDag-Erling Smørgrav# --------------
8196f3b0ac34SDag-Erling Smørgrav# If we don't have a new enough Autoconf to choose the best objdump
8197f3b0ac34SDag-Erling Smørgrav# available, choose the one first in the user's PATH.
8198f3b0ac34SDag-Erling Smørgravm4_defun([_LT_DECL_OBJDUMP],
8199f3b0ac34SDag-Erling Smørgrav[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8200f3b0ac34SDag-Erling Smørgravtest -z "$OBJDUMP" && OBJDUMP=objdump
8201f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8202f3b0ac34SDag-Erling SmørgravAC_SUBST([OBJDUMP])
8203f3b0ac34SDag-Erling Smørgrav])
8204f3b0ac34SDag-Erling Smørgrav
8205f3b0ac34SDag-Erling Smørgrav# _LT_DECL_DLLTOOL
8206f3b0ac34SDag-Erling Smørgrav# ----------------
8207f3b0ac34SDag-Erling Smørgrav# Ensure DLLTOOL variable is set.
8208f3b0ac34SDag-Erling Smørgravm4_defun([_LT_DECL_DLLTOOL],
8209f3b0ac34SDag-Erling Smørgrav[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8210f3b0ac34SDag-Erling Smørgravtest -z "$DLLTOOL" && DLLTOOL=dlltool
8211f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8212f3b0ac34SDag-Erling SmørgravAC_SUBST([DLLTOOL])
8213f3b0ac34SDag-Erling Smørgrav])
8214f3b0ac34SDag-Erling Smørgrav
8215*3ba4c8c8SDag-Erling Smørgrav# _LT_DECL_FILECMD
8216*3ba4c8c8SDag-Erling Smørgrav# ----------------
8217*3ba4c8c8SDag-Erling Smørgrav# Check for a file(cmd) program that can be used to detect file type and magic
8218*3ba4c8c8SDag-Erling Smørgravm4_defun([_LT_DECL_FILECMD],
8219*3ba4c8c8SDag-Erling Smørgrav[AC_CHECK_TOOL([FILECMD], [file], [:])
8220*3ba4c8c8SDag-Erling Smørgrav_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
8221*3ba4c8c8SDag-Erling Smørgrav])# _LD_DECL_FILECMD
8222*3ba4c8c8SDag-Erling Smørgrav
8223f3b0ac34SDag-Erling Smørgrav# _LT_DECL_SED
8224f3b0ac34SDag-Erling Smørgrav# ------------
8225f3b0ac34SDag-Erling Smørgrav# Check for a fully-functional sed program, that truncates
8226f3b0ac34SDag-Erling Smørgrav# as few characters as possible.  Prefer GNU sed if found.
8227f3b0ac34SDag-Erling Smørgravm4_defun([_LT_DECL_SED],
8228f3b0ac34SDag-Erling Smørgrav[AC_PROG_SED
8229f3b0ac34SDag-Erling Smørgravtest -z "$SED" && SED=sed
8230f3b0ac34SDag-Erling SmørgravXsed="$SED -e 1s/^X//"
8231f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8232f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8233f3b0ac34SDag-Erling Smørgrav    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8234f3b0ac34SDag-Erling Smørgrav])# _LT_DECL_SED
8235f3b0ac34SDag-Erling Smørgrav
8236f3b0ac34SDag-Erling Smørgravm4_ifndef([AC_PROG_SED], [
8237f3b0ac34SDag-Erling Smørgrav############################################################
8238f3b0ac34SDag-Erling Smørgrav# NOTE: This macro has been submitted for inclusion into   #
8239f3b0ac34SDag-Erling Smørgrav#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8240f3b0ac34SDag-Erling Smørgrav#  a released version of Autoconf we should remove this    #
8241f3b0ac34SDag-Erling Smørgrav#  macro and use it instead.                               #
8242f3b0ac34SDag-Erling Smørgrav############################################################
8243f3b0ac34SDag-Erling Smørgrav
8244f3b0ac34SDag-Erling Smørgravm4_defun([AC_PROG_SED],
8245f3b0ac34SDag-Erling Smørgrav[AC_MSG_CHECKING([for a sed that does not truncate output])
8246f3b0ac34SDag-Erling SmørgravAC_CACHE_VAL(lt_cv_path_SED,
8247f3b0ac34SDag-Erling Smørgrav[# Loop through the user's path and test for sed and gsed.
8248f3b0ac34SDag-Erling Smørgrav# Then use that list of sed's as ones to test for truncation.
8249f3b0ac34SDag-Erling Smørgravas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8250f3b0ac34SDag-Erling Smørgravfor as_dir in $PATH
8251f3b0ac34SDag-Erling Smørgravdo
8252f3b0ac34SDag-Erling Smørgrav  IFS=$as_save_IFS
8253f3b0ac34SDag-Erling Smørgrav  test -z "$as_dir" && as_dir=.
8254f3b0ac34SDag-Erling Smørgrav  for lt_ac_prog in sed gsed; do
8255f3b0ac34SDag-Erling Smørgrav    for ac_exec_ext in '' $ac_executable_extensions; do
8256f3b0ac34SDag-Erling Smørgrav      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8257f3b0ac34SDag-Erling Smørgrav        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8258f3b0ac34SDag-Erling Smørgrav      fi
8259f3b0ac34SDag-Erling Smørgrav    done
8260f3b0ac34SDag-Erling Smørgrav  done
8261f3b0ac34SDag-Erling Smørgravdone
8262f3b0ac34SDag-Erling SmørgravIFS=$as_save_IFS
8263f3b0ac34SDag-Erling Smørgravlt_ac_max=0
8264f3b0ac34SDag-Erling Smørgravlt_ac_count=0
8265f3b0ac34SDag-Erling Smørgrav# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8266f3b0ac34SDag-Erling Smørgrav# along with /bin/sed that truncates output.
8267f3b0ac34SDag-Erling Smørgravfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8268f3b0ac34SDag-Erling Smørgrav  test ! -f "$lt_ac_sed" && continue
8269f3b0ac34SDag-Erling Smørgrav  cat /dev/null > conftest.in
8270f3b0ac34SDag-Erling Smørgrav  lt_ac_count=0
8271f3b0ac34SDag-Erling Smørgrav  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8272f3b0ac34SDag-Erling Smørgrav  # Check for GNU sed and select it if it is found.
8273f3b0ac34SDag-Erling Smørgrav  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8274f3b0ac34SDag-Erling Smørgrav    lt_cv_path_SED=$lt_ac_sed
8275f3b0ac34SDag-Erling Smørgrav    break
8276f3b0ac34SDag-Erling Smørgrav  fi
8277f3b0ac34SDag-Erling Smørgrav  while true; do
8278f3b0ac34SDag-Erling Smørgrav    cat conftest.in conftest.in >conftest.tmp
8279f3b0ac34SDag-Erling Smørgrav    mv conftest.tmp conftest.in
8280f3b0ac34SDag-Erling Smørgrav    cp conftest.in conftest.nl
8281f3b0ac34SDag-Erling Smørgrav    echo >>conftest.nl
8282f3b0ac34SDag-Erling Smørgrav    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8283f3b0ac34SDag-Erling Smørgrav    cmp -s conftest.out conftest.nl || break
8284f3b0ac34SDag-Erling Smørgrav    # 10000 chars as input seems more than enough
8285f3b0ac34SDag-Erling Smørgrav    test 10 -lt "$lt_ac_count" && break
8286f3b0ac34SDag-Erling Smørgrav    lt_ac_count=`expr $lt_ac_count + 1`
8287f3b0ac34SDag-Erling Smørgrav    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8288f3b0ac34SDag-Erling Smørgrav      lt_ac_max=$lt_ac_count
8289f3b0ac34SDag-Erling Smørgrav      lt_cv_path_SED=$lt_ac_sed
8290f3b0ac34SDag-Erling Smørgrav    fi
8291f3b0ac34SDag-Erling Smørgrav  done
8292f3b0ac34SDag-Erling Smørgravdone
8293f3b0ac34SDag-Erling Smørgrav])
8294f3b0ac34SDag-Erling SmørgravSED=$lt_cv_path_SED
8295f3b0ac34SDag-Erling SmørgravAC_SUBST([SED])
8296f3b0ac34SDag-Erling SmørgravAC_MSG_RESULT([$SED])
8297f3b0ac34SDag-Erling Smørgrav])#AC_PROG_SED
8298f3b0ac34SDag-Erling Smørgrav])#m4_ifndef
8299f3b0ac34SDag-Erling Smørgrav
8300f3b0ac34SDag-Erling Smørgrav# Old name:
8301f3b0ac34SDag-Erling SmørgravAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8302f3b0ac34SDag-Erling Smørgravdnl aclocal-1.4 backwards compatibility:
8303f3b0ac34SDag-Erling Smørgravdnl AC_DEFUN([LT_AC_PROG_SED], [])
8304f3b0ac34SDag-Erling Smørgrav
8305f3b0ac34SDag-Erling Smørgrav
8306f3b0ac34SDag-Erling Smørgrav# _LT_CHECK_SHELL_FEATURES
8307f3b0ac34SDag-Erling Smørgrav# ------------------------
8308f3b0ac34SDag-Erling Smørgrav# Find out whether the shell is Bourne or XSI compatible,
8309f3b0ac34SDag-Erling Smørgrav# or has some other useful features.
8310f3b0ac34SDag-Erling Smørgravm4_defun([_LT_CHECK_SHELL_FEATURES],
8311f3b0ac34SDag-Erling Smørgrav[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8312f3b0ac34SDag-Erling Smørgrav  lt_unset=unset
8313f3b0ac34SDag-Erling Smørgravelse
8314f3b0ac34SDag-Erling Smørgrav  lt_unset=false
8315f3b0ac34SDag-Erling Smørgravfi
8316f3b0ac34SDag-Erling Smørgrav_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8317f3b0ac34SDag-Erling Smørgrav
8318f3b0ac34SDag-Erling Smørgrav# test EBCDIC or ASCII
8319f3b0ac34SDag-Erling Smørgravcase `echo X|tr X '\101'` in
8320f3b0ac34SDag-Erling Smørgrav A) # ASCII based system
8321f3b0ac34SDag-Erling Smørgrav    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8322f3b0ac34SDag-Erling Smørgrav  lt_SP2NL='tr \040 \012'
8323f3b0ac34SDag-Erling Smørgrav  lt_NL2SP='tr \015\012 \040\040'
8324f3b0ac34SDag-Erling Smørgrav  ;;
8325f3b0ac34SDag-Erling Smørgrav *) # EBCDIC based system
8326f3b0ac34SDag-Erling Smørgrav  lt_SP2NL='tr \100 \n'
8327f3b0ac34SDag-Erling Smørgrav  lt_NL2SP='tr \r\n \100\100'
8328f3b0ac34SDag-Erling Smørgrav  ;;
8329f3b0ac34SDag-Erling Smørgravesac
8330f3b0ac34SDag-Erling Smørgrav_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8331f3b0ac34SDag-Erling Smørgrav_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8332f3b0ac34SDag-Erling Smørgrav])# _LT_CHECK_SHELL_FEATURES
8333f3b0ac34SDag-Erling Smørgrav
8334f3b0ac34SDag-Erling Smørgrav
8335f3b0ac34SDag-Erling Smørgrav# _LT_PATH_CONVERSION_FUNCTIONS
8336f3b0ac34SDag-Erling Smørgrav# -----------------------------
8337f3b0ac34SDag-Erling Smørgrav# Determine what file name conversion functions should be used by
8338f3b0ac34SDag-Erling Smørgrav# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8339f3b0ac34SDag-Erling Smørgrav# for certain cross-compile configurations and native mingw.
8340f3b0ac34SDag-Erling Smørgravm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8341f3b0ac34SDag-Erling Smørgrav[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8342f3b0ac34SDag-Erling SmørgravAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8343f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([how to convert $build file names to $host format])
8344f3b0ac34SDag-Erling SmørgravAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8345f3b0ac34SDag-Erling Smørgrav[case $host in
8346f3b0ac34SDag-Erling Smørgrav  *-*-mingw* )
8347f3b0ac34SDag-Erling Smørgrav    case $build in
8348f3b0ac34SDag-Erling Smørgrav      *-*-mingw* ) # actually msys
8349f3b0ac34SDag-Erling Smørgrav        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8350f3b0ac34SDag-Erling Smørgrav        ;;
8351f3b0ac34SDag-Erling Smørgrav      *-*-cygwin* )
8352f3b0ac34SDag-Erling Smørgrav        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8353f3b0ac34SDag-Erling Smørgrav        ;;
8354f3b0ac34SDag-Erling Smørgrav      * ) # otherwise, assume *nix
8355f3b0ac34SDag-Erling Smørgrav        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8356f3b0ac34SDag-Erling Smørgrav        ;;
8357f3b0ac34SDag-Erling Smørgrav    esac
8358f3b0ac34SDag-Erling Smørgrav    ;;
8359f3b0ac34SDag-Erling Smørgrav  *-*-cygwin* )
8360f3b0ac34SDag-Erling Smørgrav    case $build in
8361f3b0ac34SDag-Erling Smørgrav      *-*-mingw* ) # actually msys
8362f3b0ac34SDag-Erling Smørgrav        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8363f3b0ac34SDag-Erling Smørgrav        ;;
8364f3b0ac34SDag-Erling Smørgrav      *-*-cygwin* )
8365f3b0ac34SDag-Erling Smørgrav        lt_cv_to_host_file_cmd=func_convert_file_noop
8366f3b0ac34SDag-Erling Smørgrav        ;;
8367f3b0ac34SDag-Erling Smørgrav      * ) # otherwise, assume *nix
8368f3b0ac34SDag-Erling Smørgrav        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8369f3b0ac34SDag-Erling Smørgrav        ;;
8370f3b0ac34SDag-Erling Smørgrav    esac
8371f3b0ac34SDag-Erling Smørgrav    ;;
8372f3b0ac34SDag-Erling Smørgrav  * ) # unhandled hosts (and "normal" native builds)
8373f3b0ac34SDag-Erling Smørgrav    lt_cv_to_host_file_cmd=func_convert_file_noop
8374f3b0ac34SDag-Erling Smørgrav    ;;
8375f3b0ac34SDag-Erling Smørgravesac
8376f3b0ac34SDag-Erling Smørgrav])
8377f3b0ac34SDag-Erling Smørgravto_host_file_cmd=$lt_cv_to_host_file_cmd
8378f3b0ac34SDag-Erling SmørgravAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8379f3b0ac34SDag-Erling Smørgrav_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8380f3b0ac34SDag-Erling Smørgrav         [0], [convert $build file names to $host format])dnl
8381f3b0ac34SDag-Erling Smørgrav
8382f3b0ac34SDag-Erling SmørgravAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8383f3b0ac34SDag-Erling SmørgravAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8384f3b0ac34SDag-Erling Smørgrav[#assume ordinary cross tools, or native build.
8385f3b0ac34SDag-Erling Smørgravlt_cv_to_tool_file_cmd=func_convert_file_noop
8386f3b0ac34SDag-Erling Smørgravcase $host in
8387f3b0ac34SDag-Erling Smørgrav  *-*-mingw* )
8388f3b0ac34SDag-Erling Smørgrav    case $build in
8389f3b0ac34SDag-Erling Smørgrav      *-*-mingw* ) # actually msys
8390f3b0ac34SDag-Erling Smørgrav        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8391f3b0ac34SDag-Erling Smørgrav        ;;
8392f3b0ac34SDag-Erling Smørgrav    esac
8393f3b0ac34SDag-Erling Smørgrav    ;;
8394f3b0ac34SDag-Erling Smørgravesac
8395f3b0ac34SDag-Erling Smørgrav])
8396f3b0ac34SDag-Erling Smørgravto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8397f3b0ac34SDag-Erling SmørgravAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8398f3b0ac34SDag-Erling Smørgrav_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8399f3b0ac34SDag-Erling Smørgrav         [0], [convert $build files to toolchain format])dnl
8400f3b0ac34SDag-Erling Smørgrav])# _LT_PATH_CONVERSION_FUNCTIONS
8401